mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@aerifal.cx>
To: Bruno Haible <bruno@clisp.org>
Cc: musl@lists.openwall.com, bug-gnulib@gnu.org
Subject: Re: musl, printf out-of-memory test
Date: Tue, 19 Jun 2012 16:08:47 -0400	[thread overview]
Message-ID: <20120619200847.GR163@brightrain.aerifal.cx> (raw)
In-Reply-To: <1959429.eYcVRAGVSA@linuix>

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 <stdio.h>
> #include <errno.h>
> 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



  reply	other threads:[~2012-06-19 20:08 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20120609230541.47eac2de@newbook>
     [not found] ` <4FD55156.7050302@cs.ucla.edu>
     [not found]   ` <20120611182202.1ee4d019@newbook>
2012-06-17 22:49     ` musl bugs found through gnulib Bruno Haible
2012-06-17 23:54       ` Rich Felker
2012-06-18  8:21         ` Szabolcs Nagy
2012-06-18 13:02           ` John Spencer
2012-06-18 14:55             ` Rich Felker
2012-06-18 15:26               ` Szabolcs Nagy
2012-06-18 16:00                 ` Rich Felker
2012-06-19 13:26               ` John Spencer
2012-06-18  0:16       ` [musl] " idunham
2012-06-19  0:11       ` Rich Felker
2012-06-19  2:07         ` [musl] " Eric Blake
2012-06-19  2:52           ` Rich Felker
2012-06-19 11:03             ` musl, fdopen test Bruno Haible
2012-06-19 11:09               ` Jim Meyering
2012-06-20 20:52                 ` Bruno Haible
2012-06-19 10:45         ` musl, printf out-of-memory test Bruno Haible
2012-06-19 19:16           ` Rich Felker
2012-06-19 20:04             ` Bruno Haible
2012-06-19 20:08               ` Rich Felker [this message]
2012-06-19 21:17                 ` Bruno Haible
2012-06-20  1:52                   ` Rich Felker
2012-06-20  7:30                     ` Szabolcs Nagy
2012-06-20  9:35                     ` Bruno Haible
2012-06-20 11:00                       ` Jim Meyering
2012-06-21 19:58                         ` Tom Tromey
2012-06-20  3:04       ` Re: musl bugs found through gnulib Rich Felker
2012-06-20  4:10         ` [musl] " Eric Blake
2012-06-20 13:27           ` Rich Felker
2012-06-20  7:32         ` Szabolcs Nagy
2012-06-22 10:39         ` grantpt test Bruno Haible
2012-07-02 22:33         ` [musl] Re: musl bugs found through gnulib Pádraig Brady
2012-06-20 19:28       ` Rich Felker
2012-06-21  2:21         ` Rich Felker
2012-06-21  8:52           ` [musl] " Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120619200847.GR163@brightrain.aerifal.cx \
    --to=dalias@aerifal.cx \
    --cc=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).