PowerPC: reuse same va_list more that once failed
Package: libc6
Version: 2.2.3-5
Severity: important
Hi,
On PowerPC wget coredump into vfprintf() (bug #104325).
MasqMail-0.1.15-1 also coredump with same stack trace.
I realise that both reuse same va_list more that once. The following
probram demonstrate this bug:
#include <stdio.h>
#include <stdarg.h>
void vlog_and_print(char *fmt, va_list ap)
{
fprintf (stdout, "First\n"); fflush(stdout);
vfprintf (stdout, fmt, ap); fflush(stdout);
fprintf (stdout, "Second\n"); fflush(stdout);
vfprintf (stdout, fmt, ap); fflush(stdout);
}
void log_and_print (char *fmt, ...)
{
va_list ap;
va_start (ap, fmt);
vlog_and_print (fmt, ap);
va_end (ap);
}
int main (int argc, char *argv[])
{
log_and_print ("a=%x, b=%x\n", 0x11111111, 0x22222222, 0x33333333, 0x44444444);
return 0;
}
$ ./va_bug
First
a=11111111, b=22222222
Second
a=33333333, b=44444444
-- System Information
Debian Release: testing/unstable
Kernel Version: Linux adam 2.4.6 #2 Fri Jul 13 17:29:30 CEST 2001 ppc unknown
Versions of the packages libc6 depends on:
ii libdb2 2.7.7-8 The Berkeley database routines (run-time fil
--
Edouard G. Parmelan
http://egp.free.fr
Reply to: