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