From owner-svn-src-all@freebsd.org Fri Jun 10 12:03:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC9ECB71E15 for ; Fri, 10 Jun 2016 12:03:39 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm14-vm0.bullet.mail.bf1.yahoo.com (nm14-vm0.bullet.mail.bf1.yahoo.com [98.139.213.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8276A1A3F for ; Fri, 10 Jun 2016 12:03:39 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1465560217; bh=BqclPByYbXEc02+6R3zBjlrGhgRpf8NofmdjafW+V8M=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=GZojq+c6sxg946rKCOJMkYaQhpDfTDhO+Y0/Jarph46jo+vBXIaWg/hdD2kpIT4qq01blia5zd8YoBR1mgT6VMt/F9hgOCKtkAU/MUOUp+vmkDC3a32ZIqQnxypRHikaY2mVbgMDCmy5k35FfaCj0fZYuHyElB2rloEbiSWJGMbg8v0SZWz8eQxaoZhEvSnlZJgoiQuvSlDKS6KP/ptYVLdBpG74MWPSBwoZXAPEm4GKShR9TcZ3V2/KZoigkUwA1hNcYATsQbWmO8GPeYD4OpDGiOt0mYIsSzZLsiJ223snumUPz0LStHg/YVvIVEPcka1p2wCtgWSQefvbQHcPmw== Received: from [98.139.215.141] by nm14.bullet.mail.bf1.yahoo.com with NNFMP; 10 Jun 2016 12:03:37 -0000 Received: from [98.139.211.193] by tm12.bullet.mail.bf1.yahoo.com with NNFMP; 10 Jun 2016 12:03:37 -0000 Received: from [127.0.0.1] by smtp202.mail.bf1.yahoo.com with NNFMP; 10 Jun 2016 12:03:37 -0000 X-Yahoo-Newman-Id: 667655.41851.bm@smtp202.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: fR.MccgVM1lM3E1RgG6b0wB3Vz1_ncrdn14Jt91iVRco10L 23R8ih7K1D5gIZRDJE8YF0tPMVEHQI.rfykpi7vjJGzCxCc3ka7QIjK5TMjF 3K3HVIJkypX19rrY4dYD5fwCz6Yt1o2d_6IQaPNGqDNEBHvU6BWjtgvKmRxL iifhsCZdyWuLleEKbc6Aym6GerxJx3d390Hf01gEOMNYUqDva_nxVKJ7l6s0 jd2KeLEtwBh3NU3iLRnuqKhGugD.pnHWzRdUR4T7emVT1xTwGUVk0tliBD6H dWS4j4dGeWhwDDY8akTK109rgRpNPBF._vGyevcUuyEI8T0TrNStcWGaPbKL Hl2TZO3MuW_t.K1fzqUrphuBNmJqRvTCRvzvC1zWILpZy4ygUIDv8jzxl2Je ZIoxFUgeS2vbpR0_VTARUNUOEBM4xM40.DvfAhi8A4yoawiEtfUiQ3XOczEK oXpbyFlkKHCCC4LY9Nsw3ZIWvqdZETYIBz2RyW19fElVbSQ7GU0hlrywBu6W SOJCkFQm9vgXMuLd.cp3lTu98BuTH8vRT X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r301777 - head/lib/libc/stdio To: Andrey Chernov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201606100521.u5A5Lqa6035072@repo.freebsd.org> <3346cab5-d713-c1ad-5e50-ea8d50ee47b9@freebsd.org> From: Pedro Giffuni Message-ID: Date: Fri, 10 Jun 2016 07:03:36 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <3346cab5-d713-c1ad-5e50-ea8d50ee47b9@freebsd.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 12:03:39 -0000 (Sorry I have been offline/sleep for a while) Hello; I cannot back this out because of this report: http://docs.freebsd.org/cgi/mid.cgi?20160608132224.GA15454 This change only re-states what has been working before the ABI breakage fix in r301461. The fix to regex is completely independent. Pedro. On 06/10/16 03:20, Andrey Chernov wrote: > Please back it out. __sccl() use plain chars, you can't just call wide > chars __wcollate_range_cmp() from it. Never intermix plain chars and > wide chars without conversion. The problem is somewhere else. The code > used for [a-z] ranges in the format. Moreover, even if conversion added > this code can't work with wchars by definition since uses the same loop > as in regcomp() > for (i = 0; i < 256; i ++) > > Counting completely broken regcomp, our locale quickly becomes > intermixing junk of chars and wchars without any conversion. Please > anybody stop hacking here, especially blindly adding wchars everywhere > without analyzing rest of code. > If you see 256 or UCHAR_MAX somewhere, this function can't be converted > to wchars. > > On 10.06.2016 8:21, Pedro F. Giffuni wrote: >> Author: pfg >> Date: Fri Jun 10 05:21:52 2016 >> New Revision: 301777 >> URL: https://svnweb.freebsd.org/changeset/base/301777 >> >> Log: >> Fix regression from r301461. >> >> The fix to the __collate_range_cmp() ABI breakage missed some replacements >> in libc's vfscanf(). Replace them with __wcollate_range_cmp() which >> does what is expected. >> >> This was breaking applications like xterm and pidgin when using wide >> characters. >> >> Reported by: Vitalij Satanivskij >> Approved by: re >> >> Modified: >> head/lib/libc/stdio/vfscanf.c >> >> Modified: head/lib/libc/stdio/vfscanf.c >> ============================================================================== >> --- head/lib/libc/stdio/vfscanf.c Fri Jun 10 04:04:55 2016 (r301776) >> +++ head/lib/libc/stdio/vfscanf.c Fri Jun 10 05:21:52 2016 (r301777) >> @@ -873,7 +873,7 @@ doswitch: >> n = *fmt; >> if (n == ']' >> || (table->__collate_load_error ? n < c : >> - __collate_range_cmp (table, n, c) < 0 >> + __wcollate_range_cmp(table, n, c) < 0 >> ) >> ) { >> c = '-'; >> @@ -887,8 +887,8 @@ doswitch: >> } while (c < n); >> } else { >> for (i = 0; i < 256; i ++) >> - if ( __collate_range_cmp (table, c, i) < 0 >> - && __collate_range_cmp (table, i, n) <= 0 >> + if (__wcollate_range_cmp(table, c, i) < 0 && >> + __wcollate_range_cmp(table, i, n) <= 0 >> ) >> tab[i] = v; >> } >> >