delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2024/01/04/07:28:49

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 69429386184E
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1704371327;
bh=xJgzi+gc0gfI5XGT3Yqt5kGiaXZe3Vm6MZDZWfAo4ls=;
h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
From;
b=OszK1ukicuACXm2wlPwGjbIFKuDQ+GC81hp7croOZd5DTWzFqdJesk3bTdLoMqko+
hfJAlVEhziFMeEkAHkFCT+xDjkRf/7g47E8djRFIYqAns5kwvcBpxMDVTrN9kCJH6j
+HV7N6Lbc1JjLWkj6qtR+3dKGEA4YN8wV9UoJqbg=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7FCF33858CD1
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7FCF33858CD1
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704371299; cv=none;
b=Z4hgSJKWcIlS+M9XAp7aHSqnzyhLd0x43oRYAOhJMEBlecQYfz7c96Fg4podIOEELFthQhcgxiCrDfs0CVpIeBvCYZ2whX/5HLquR9oBBo6A/N2tUvqfM+wblofxZWq7+u3Jfv2Qrg3hkvQmPiDEBXtSE5GF2hmvp/XFy2utJMs=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1704371299; c=relaxed/simple;
bh=b99mOKXerblz5NQ1793NksMRsg2UxrOaISgL1oqYtic=;
h=Message-ID:Date:MIME-Version:From:Subject:To;
b=aT+gewQbH/wr+SHZtbUnk0h4O+qdTWHqSQCURK6cnCC0exVdWN8AnV5B3+rj7g4VmtmlOW15UFEh8wly4Hh29qCTN4Vf+U/5inIJ1GFvdLkG/WFpzQDmu2r7P71THbdr82BKUJo3E+UPhMn50i1/zrGexivtSrhmKM0uUdpWM8k=
ARC-Authentication-Results: i=1; server2.sourceware.org
Message-ID: <53a5a442-6871-4227-a565-ae8d11dc2a58@SystematicSW.ab.ca>
Date: Thu, 4 Jan 2024 05:28:13 -0700
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: strverscmp is buggy in newlib 4.4.0 (was Cygwin 3.4.6)
To: newlib AT sourceware DOT org
References: <13421190 DOT uLZWGnKmhe AT nimes>
<1f182ad0-bf0d-4cf7-9829-8b7e7cbd6b43 AT SystematicSW DOT ab DOT ca>
Organization: Systematic Software
In-Reply-To: <1f182ad0-bf0d-4cf7-9829-8b7e7cbd6b43@SystematicSW.ab.ca>
X-Stat-Signature: qfrwa348oncymihtf8igigu9bhiqi5bb
X-Rspamd-Server: rspamout07
X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, GIT_PATCH_0,
KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,
SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE,
UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6
X-Rspamd-Queue-Id: B89252000D
X-Session-Marker: 427269616E2E496E676C69734053797374656D6174696353572E61622E6361
X-Session-ID: U2FsdGVkX18pVXhv5CSGYhBMPmlvDAnA/zuPoiFQbsE=
X-HE-Tag: 1704371294-805844
X-HE-Meta: U2FsdGVkX1972fIX9/TFEtupPSZuJSi6HTEaoPtpcqcO+1ba3qYPmYtAX3cEiuM+e+eRdCSsrO4h2hPJZ66bgIcpaqjBeETRTjmmZ3icTshRVyQR6AQKMy6WJrJPdo5YWEX+g43U6PTcFy9PaIXGUeKtfFFZ4ydW+GTsuZehC45e9Ne1Rx81s9OW+gXIxQtp2H4a3fjNlkOaUSyLtDuQSojnwN942FR6byhMSn/sdyy9rWIjEqxRxtApJKnI34fiDK3N6Dilgn8D1lfB5SUQlU+OeTTTY5hGi2IwiJB8101rpaA67RTpx4HMnLJ+/G+clnwfnRhPMju2bpa1pxOVJozdj+/qta6H/Pub1c/1CBd4/A+2PwIqtDCe10i03qGiILjH/Cb7r8N8xnGPDbVUXX1K8jEW4L5bN8GrWumFyxYdDqSiZSakw+p2VH+xNUR88+3AzfjdITNqRWJETNHFxzMaIsI96mxQuVROJ23N2aHIxkJVq6dPVp9m09T5gH401nl+ROB4xbimL3p3MTgUgItllE3219vn2ggFy+l2NCJq77lu4OR9gDo33pWllsW0AWzOXfWtluy5+VkQsaF9r90Sa4LTqWR1IRiMSr3km5jpB8P9roUX9+la4NSVJC649BnItLaJUaQ3Z7RhWC4HFg==
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Brian Inglis via Cygwin <cygwin AT cygwin DOT com>
Reply-To: newlib AT sourceware DOT org
Cc: Brian Inglis <Brian DOT Inglis AT SystematicSW DOT ab DOT ca>, cygwin AT cygwin DOT com
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

This is a multi-part message in MIME format.
--------------8SsfXTLWnT434oMp6X2ZxNT1
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

On 2024-01-02 10:36, Brian Inglis via Cygwin wrote:
> On 2024-01-02 03:23, Bruno Haible via Cygwin wrote:
>> Here's a test case of strverscmp, from Dmitry Bogatov [1]
>> #include <string.h>
>> int main ()
>> {
>>    return strverscmp ("UNKNOWN", "2.2.0") <= 0;
>> }
>> It succeeds on glibc and musl libc 1.2.4, but fails on musl libc 1.2.3
>> and Cygwin 2.9.0 and 3.4.6.
>> The cause is apparently that Cygwin's strverscmp implementation was
>> borrowed from musl libc (Cygwin commit 59e09b6419cdf400be3c73b61ac9c22560dc397e)
>> at a time when musl libc's implementation was buggy. In musl libc, it is
>> meanwhile fixed, through
>> https://git.musl-libc.org/cgit/musl/commit/src/string/strverscmp.c?id=b50eb8c36c20f967bd0ed70c0b0db38a450886ba
>> [1] https://lists.gnu.org/archive/html/bug-gnulib/2024-01/msg00002.html
> 
> Issue is in newlib (x-post and followups set):
> https://sourceware.org/cgit/newlib-cygwin/tree/newlib/libc/string/strverscmp.c
> 
> patch with git log msg:
> https://git.musl-libc.org/cgit/musl/patch/src/string/strverscmp.c?id=b50eb8c36c20f967bd0ed70c0b0db38a450886ba

This musl patch applies cleanly to newlib (patch offsets) and is attached.

> Gnulib discussion:
> https://lists.gnu.org/archive/html/bug-gnulib/2024-01/msg00002.html
> 
> Musl thread starts:
> https://www.openwall.com/lists/musl/2022/11/06/1
> 
> bare patch without git log msg attached to:
> https://www.openwall.com/lists/musl/2022/11/08/1
-- 
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer     but when there is no more to cut
                                 -- Antoine de Saint-Exupéry
--------------8SsfXTLWnT434oMp6X2ZxNT1
Content-Type: text/plain; charset=UTF-8; name="musl_string_strverscmp.patch"
Content-Disposition: attachment; filename="musl_string_strverscmp.patch"
Content-Transfer-Encoding: base64

RnJvbSBiNTBlYjhjMzZjMjBmOTY3YmQwZWQ3MGMwYjBkYjM4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ykK
CmRpZmYgLS1naXQgYS9zcmMvc3RyaW5nL3N0cnZlcnNjbXAuYyBiL3NyYy9zdHJpbmcvc3Ry
dmVyc2NtcC5jCmluZGV4IDRkYWYyNzZkLi4xNmMxZGEyMiAxMDA2NDQKLS0tIGEvc3JjL3N0
cmluZy9zdHJ2ZXJzY21wLmMKKysrIGIvc3JjL3N0cmluZy9zdHJ2ZXJzY21wLmMKQEAgLTE4
LDkgKzE4LDkgQEAgaW50IHN0cnZlcnNjbXAoY29uc3QgY2hhciAqbDAsIGNvbnN0IGNoYXIg
KnIwKQogCQllbHNlIGlmIChjIT0nMCcpIHo9MDsKIAl9CiAKLQlpZiAobFtkcF0hPScwJyAm
JiByW2RwXSE9JzAnKSB7Ci0JCS8qIElmIHdlJ3JlIG5vdCBsb29raW5nIGF0IGEgZGlnaXQg
c2VxdWVuY2UgdGhhdCBiZWdhbgotCQkgKiB3aXRoIGEgemVybywgbG9uZ2VzdCBkaWdpdCBz
dHJpbmcgaXMgZ3JlYXRlci4gKi8KKwlpZiAobFtkcF0tJzEnPDlVICYmIHJbZHBdLScxJzw5
VSkgeworCQkvKiBJZiB3ZSdyZSBsb29raW5nIGF0IG5vbi1kZWdlbmVyYXRlIGRpZ2l0IHNl
cXVlbmNlcyBzdGFydGluZworCQkgKiB3aXRoIG5vbnplcm8gZGlnaXRzLCBsb25nZXN0IGRp
Z2l0IHN0cmluZyBpcyBncmVhdGVyLiAqLwogCQlmb3IgKGo9aTsgaXNkaWdpdChsW2pdKTsg
aisrKQogCQkJaWYgKCFpc2RpZ2l0KHJbal0pKSByZXR1cm4gMTsKIAkJaWYgKGlzZGlnaXQo
cltqXSkpIHJldHVybiAtMTsKLS0gCmNnaXQgdjEuMi4xCgo=

--------------8SsfXTLWnT434oMp6X2ZxNT1
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

--------------8SsfXTLWnT434oMp6X2ZxNT1--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019