From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/1188 Path: news.gmane.org!not-for-mail From: Eric Blake Newsgroups: gmane.comp.lib.gnulib.bugs,gmane.linux.lib.musl.general Subject: Re: [musl] Re: musl bugs found through gnulib Date: Mon, 18 Jun 2012 20:07:40 -0600 Organization: Red Hat Message-ID: <4FDFDEEC.8050304@redhat.com> References: <20120609230541.47eac2de@newbook> <4FD55156.7050302@cs.ucla.edu> <20120611182202.1ee4d019@newbook> <12545931.v3ALTEUUx8@linuix> <20120619001156.GJ163@brightrain.aerifal.cx> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigDB5A111618F2619B5A29F3AF" X-Trace: dough.gmane.org 1340071676 29957 80.91.229.3 (19 Jun 2012 02:07:56 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 19 Jun 2012 02:07:56 +0000 (UTC) Cc: bug-gnulib@gnu.org, Isaac Dunham , Paul Eggert , musl@lists.openwall.com, Reuben Thomas To: Rich Felker Original-X-From: bug-gnulib-bounces+gnu-bug-gnulib=m.gmane.org@gnu.org Tue Jun 19 04:07:54 2012 Return-path: Envelope-to: gnu-bug-gnulib@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SgnrF-0005Nv-HE for gnu-bug-gnulib@m.gmane.org; Tue, 19 Jun 2012 04:07:53 +0200 Original-Received: from localhost ([::1]:33760 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SgnrF-0008Ul-8n for gnu-bug-gnulib@m.gmane.org; Mon, 18 Jun 2012 22:07:53 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:46981) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SgnrB-0008US-NG for bug-gnulib@gnu.org; Mon, 18 Jun 2012 22:07:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sgnr9-0004Ru-Rg for bug-gnulib@gnu.org; Mon, 18 Jun 2012 22:07:49 -0400 Original-Received: from mx1.redhat.com ([209.132.183.28]:62960) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sgnr9-0004Rd-IO for bug-gnulib@gnu.org; Mon, 18 Jun 2012 22:07:47 -0400 Original-Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q5J27hxG002132 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 18 Jun 2012 22:07:43 -0400 Original-Received: from [10.3.113.98] (ovpn-113-98.phx2.redhat.com [10.3.113.98]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q5J27fBb001251; Mon, 18 Jun 2012 22:07:42 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 In-Reply-To: <20120619001156.GJ163@brightrain.aerifal.cx> X-Enigmail-Version: 1.4.2 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnulib-bounces+gnu-bug-gnulib=m.gmane.org@gnu.org Original-Sender: bug-gnulib-bounces+gnu-bug-gnulib=m.gmane.org@gnu.org Xref: news.gmane.org gmane.comp.lib.gnulib.bugs:31037 gmane.linux.lib.musl.general:1188 Archived-At: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigDB5A111618F2619B5A29F3AF Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 06/18/2012 06:11 PM, Rich Felker wrote: > Some updates... >=20 > On Mon, Jun 18, 2012 at 12:49:44AM +0200, Bruno Haible wrote: >> There is a recipe, in , >> that explains how to use gnulib to check a libc against bugs. When I a= pply >> this to musl-0.9.1, I get this list of problems: >> >> Replacements of *printf, because of >> [...] >> checking whether printf survives out-of-memory conditions... no >=20 > No idea. Copying out the test and running it directly, it passes just > fine for me. Maybe gnulib has already replaced printf with its own > malloc-using version by the time it gets to this test?? No; configure-time tests are relatively independent, and all done prior to any replacements at compile-time. You should be able to inspect config.log to see the actual test that configure ran. >=20 >> Replacement of fdopen, because of >> checking whether fdopen sets errno... no >=20 > There was one bug here (failure to set errno when mode string was > invalid) but I don't think that's the case gnulib was testing for. It > seems gnulib wants an error for the "may fail" when the fd is invalid. The 'EBADF may fail' condition is rather weak. And since glibc guarantees a definite failure, it is nicer to program to the glibc interface that guarantees immediate failure on a bad fd at fdopen() time than it is to deal with the surprises that result when fdopen() succeeds but later attempts to use the stream fail. Perhaps it might be worth splitting this into two gnulib modules, one for the strict POSIX compliance and one for the glibc interface, but that depends on how likely people are to want to program to the weaker POSIX interface when it is just as easy to make fdopen() guarantee failure on bad fds and save efforts up front. >=20 >> Replacement of futimens, because of >> checking whether futimens works... no >=20 > gnulib always forces this test to fail if __linux__ is defined. That's because the Linux kernel got it wrong for quite some time, and worse, it was file-system dependent - even if it worked on one machine and file system, compiling in support for futimens and then running on another file system would experience random compliance failures due to the poor file system implementation. It's been a while, so maybe we can finally graduate this module into assuming that the Linux kernel is better behaved by default, and make the user specifically request the fallbacks if they are worried about using the binary on a file system that still has bugs. But don't take it personally - this is not a case of musl getting it wrong, but of the kernel getting it wrong. --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enigDB5A111618F2619B5A29F3AF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJP397tAAoJEKeha0olJ0Nqkv8IAIBvWOvFAWoJznjBD1WYFxXy z9i2vKwnT9Vlm7A6iywoqJW2vr1avqtalFBuEokDcqvjiBXMXOlPhF0rwNIuJ6aB VBoOEnk7kgDCOK6hvJ0udL2jznfCFAAFZxJXFrmyI4SqnwZsQub2I6cBfZDLRFSG SDGCj63cdt64Pr0YJVP+R+h2QwwqsKmGfonUp0u1kngHONjioBJrXspR6IpY2Laq daX9q1HvDBH61mYkZFDYY7UqEAkAmxUvgZzXzoDVkfmH1pEKwLqMIG57e19G7An4 3dC6cSN7yiaV/ZT9sD1XmMJSW2b4ukTWNYKvj7GBtZHCWjDDc4x5gIzH/w7NLuk= =P+FG -----END PGP SIGNATURE----- --------------enigDB5A111618F2619B5A29F3AF--