bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: glibc's snprintf bug causes printf(1) failure with MALLOC_PERTURB_ !


From: Bruno Haible
Subject: Re: glibc's snprintf bug causes printf(1) failure with MALLOC_PERTURB_ != 0
Date: Wed, 12 Nov 2008 00:39:47 +0100
User-agent: KMail/1.5.4

Jim Meyering wrote:
> It would be good for gnulib to detect the bug and to use
> the replacement snprintf on losing systems.

Does the "checking whether printf survives out-of-memory conditions" test
from gnulib (part of any of the *print-posix modules) print "yes" or "no"
on the two machines you used?

> I chose to eliminate the shared-libraries:
> 
>     gcc -static -W -Wall k.c

Is it necessary? Won't it crash also with dynamic linking?

> Then run it like this:
> 
>     env -i -- zsh -f -c \
>       'ulimit -v 5000; MALLOC_PERTURB_=9 ./a.out %$[5*2**20]d' || dmesg|tail 
> -1

Is the MALLOC_PERTURB_ essential for the failure or not?

> FYI, the libc in freebsd 6.1 and newer has no problem with the above
> snprintf usage.

But it fails the gl_PRINTF_ENOMEM check that is already in m4/printf.m4.

Bruno





reply via email to

[Prev in Thread] Current Thread [Next in Thread]