From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=DKIM_ADSP_ALL,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2 autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 22272 invoked from network); 7 Nov 2022 12:21:30 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 7 Nov 2022 12:21:30 -0000 Received: (qmail 3980 invoked by uid 550); 7 Nov 2022 12:21:27 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 30183 invoked from network); 7 Nov 2022 08:51:33 -0000 DKIM-Signature: v=1; a=ed25519-sha256; q=dns/txt; c=relaxed/relaxed; d=josefsson.org; s=ed2110; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=PcQLQf+pF6e/X1pbr+5j8QfiMAxAWgHdeuNs2Re6bgk=; t=1667811093; x=1669020693; b=UHb9Fegl4ZkmhimhDpLjkxxKptdwu/GEJHbTgcVXXP7VvIqh60ln42t9F+nXjxK1nT/8OGpchic Fg05irNcoBA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=josefsson.org; s=rsa2110; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=PcQLQf+pF6e/X1pbr+5j8QfiMAxAWgHdeuNs2Re6bgk=; t=1667811093; x=1669020693; b=gz4K+8ie7CdJkYeiX2YuqQ5o0WykPKzCWoOevw2TKgPICJR29fqvadRXHhGDQFosttP5N7oqbAi 9S5rQy3DucgaioUakNxanWZnF85aKn1FiFYZhQan7Y6PbAuNK6c/0QQm0TbE7TDZnWgq6WQ2/9bZy 2pxuCjZ+NeSojWW+RElWGLoM6i/Rtj/b05L1dvYruk6c8l2CoDbk6IBF4IUmD6EM6qNzrVRbBsSN1 BagGxdH9TKTTbm25QuSM+HMSIR1/oxjpYSyQv0vfh7JFqZ2cZlJNRj4GIMdQbnvrvmCXgNmor6vgm d6Mr+7gbNztfsJU25N1YK1cAIMGVNuoNCTRbsOFDBbMk8/xpXN2Jqt3a+LiBbWlYgj4Rs/Wm0tDy1 HvZ0nW39e3sc6RC90n2M0ja9A4VR7UvGFEzMiftuzZlOtb2M7EvByguruoV8+mxxNF+wLRRwH; From: Simon Josefsson To: Rich Felker Cc: bug-gsasl@gnu.org, musl@lists.openwall.com In-Reply-To: <20221106233904.GE29905__8136.83224130131$1667785799$gmane$org@brightrain.aerifal.cx> (Rich Felker's message of "Sun, 6 Nov 2022 18:39:04 -0500") References: <20221106233904.GE29905__8136.83224130131$1667785799$gmane$org@brightrain.aerifal.cx> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) OpenPGP: id=B1D2BD1375BECB784CF4F8C4D73CF638C53C06BE; url=https://josefsson.org/key-20190320.txt X-Hashcash: 1:22:221107:oht-tfnfy#tah.bet#i1@kaction.cc::JUxIhVrSNcmS7Tmh:CMD X-Hashcash: 1:22:221107:dalias@libc.org::Hl6UdNGR3QeTH8G/:Ot7 X-Hashcash: 1:22:221107:bug-gsasl@gnu.org::71QwNY7gV9q8ejDw:3otr X-Hashcash: 1:22:221107:musl@lists.openwall.com::WaFnOPdEIwRT7ZJQ:8Zz8 Date: Mon, 07 Nov 2022 09:51:19 +0100 Message-ID: <87a653qha0.fsf@latte> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Subject: Re: [musl] Behaviour of strverscmp(3) --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Rich Felker writes: > On Sun, Nov 06, 2022 at 06:18:22PM -0500, Dmitry Bogatov wrote: >> Hello. >>=20 >> While trying to building gsasl statically with musl library as part of >> Nixpkgs distribution, I noticed that test built from tests/version.c >> fails when built with musl library. After a bit of troubleshooting, I >> can pinpoint the reason -- different behaviour of "strverscmp" from >> glibc and musl. >>=20 >> Example code: >>=20 >> #include >> #include >>=20 >> int main() >> { >> int value =3D strverscmp("UNKNOWN", "2.2.0"); >> printf("%d\n", value); >> return 0; >> } >>=20 >> Under glibc value "35" is printed (positive), under musl value "-1" is >> printed (negative). Not sure what is the correct solution for the >> issue, so I cross-post into two lists. >>=20 >> For now I plan to patch-out this particular test. Thank you. > > It looks like we're neglecting to honor the exception case to "longer > digit sequence is greater" when one of the sequences is degenerate (no > digits). Thanks for the report Dmitry (dropping cc because your email adressed was reject by exim -- '550 restricted characters in address'). Right, I think this is a musl bug that gnulib doesn't detect and work around. I ran into it earlier on Alpine, but must have forgotten to report it (or I found earlier bug reports about it). Ignoring the self-test failure is the right solution. I believe strverscmp is a glibc-specified interface, so musl should be compatible with it, right? I'm inclined to add this test vector to the gnulib self-test for strverscmp, so at least we know where the problem comes from. Detecting the issue and working around it seems like a lot of complexity (which is a source for other bugs) and requires time and energy to support, for what appears to be little gain, so I'm not sure it is worth it. /Simon --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIoEARYIADIWIQSjzJyHC50xCrrUzy9RcisI/kdFogUCY2jHBxQcc2ltb25Aam9z ZWZzc29uLm9yZwAKCRBRcisI/kdFoqoOAP0Ug1xEVFjAZCDpsfeDdxgkQoAW6Zkj kf9LfXORvddSggEAj62vA2LA8iVHQlgQvxXCtANIMEfunmBNwFCI3EJ90gg= =qHI7 -----END PGP SIGNATURE----- --=-=-=--