From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/1202 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.comp.lib.gnulib.bugs,gmane.linux.lib.musl.general Subject: Re: musl, printf out-of-memory test Date: Tue, 19 Jun 2012 16:08:47 -0400 Message-ID: <20120619200847.GR163@brightrain.aerifal.cx> References: <20120609230541.47eac2de@newbook> <5041927.IR2Ri05J2P@linuix> <20120619191650.GP163@brightrain.aerifal.cx> <1959429.eYcVRAGVSA@linuix> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1340136779 4443 80.91.229.3 (19 Jun 2012 20:12:59 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 19 Jun 2012 20:12:59 +0000 (UTC) Cc: musl@lists.openwall.com, bug-gnulib@gnu.org To: Bruno Haible Original-X-From: bug-gnulib-bounces+gnu-bug-gnulib=m.gmane.org@gnu.org Tue Jun 19 22:12:57 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 1Sh4nG-0004d3-JN for gnu-bug-gnulib@m.gmane.org; Tue, 19 Jun 2012 22:12:54 +0200 Original-Received: from localhost ([::1]:40997 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sh4nG-0002o7-Bh for gnu-bug-gnulib@m.gmane.org; Tue, 19 Jun 2012 16:12:54 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56296) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sh4nC-0002nU-Gq for bug-gnulib@gnu.org; Tue, 19 Jun 2012 16:12:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sh4nA-0003WC-Qz for bug-gnulib@gnu.org; Tue, 19 Jun 2012 16:12:50 -0400 Original-Received: from 216-12-86-13.cv.mvl.ntelos.net ([216.12.86.13]:33887 helo=brightrain.aerifal.cx) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sh4nA-0003W3-Li for bug-gnulib@gnu.org; Tue, 19 Jun 2012 16:12:48 -0400 Original-Received: from dalias by brightrain.aerifal.cx with local (Exim 3.15 #2) id 1Sh4jH-0007YA-00; Tue, 19 Jun 2012 20:08:47 +0000 Content-Disposition: inline In-Reply-To: <1959429.eYcVRAGVSA@linuix> User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 216.12.86.13 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:31066 gmane.linux.lib.musl.general:1202 Archived-At: On Tue, Jun 19, 2012 at 10:04:57PM +0200, Bruno Haible wrote: > I can reduce the program and the compilation options: > > =============================== conftest.c ============================= > #include > #include > int main() > { > int ret; > int err; > ret = printf ("%.5000000f", 1.0); > err = errno; > fprintf (stderr, "printf's return value = %d, errno = %d\n", ret, err); > return !(ret == 5000002 || (ret < 0 && err == ENOMEM)); > } > ======================================================================== > $ musl-gcc -g -Wall conftest.c -o conftest > $ ./conftest > /dev/null ; echo $? > printf's return value = 5000002, errno = 0 > 0 > $ ./conftest > /dev/null ; echo $? > printf's return value = 5000002, errno = 0 > 0 > $ ./conftest > /dev/null ; echo $? > printf's return value = 5000002, errno = 0 > 0 > $ ./conftest > /dev/null ; echo $? > Speicherzugriffsfehler (Speicherabzug geschrieben) > 139 > $ ./conftest > /dev/null ; echo $? > Speicherzugriffsfehler (Speicherabzug geschrieben) > 139 > > I couldn't get useful info from gdb. > > This is on Linux, 32-bit mode on a 64-bit system. Can you reproduce this? I can't reproduce it. Do you have a dynamic-linked musl or just static? I tried both and couldn't reproduce with either. Did you set resource limits before running it? Are you using any strange kernel mods? I once heard of a patched kernel setting up other mappings over top of the not-yet-expanded-into stack space, but I'd be surprised if more weren't breaking on such a system... What happened in gdb? Were you unable to get it to crash? What if you run it under strace? Rich