Bug in vfprintf?

Jason Tishler jason@tishler.net
Mon Feb 3 14:58:00 GMT 2003


Jeff,

On Fri, Jan 31, 2003 at 07:56:05PM -0500, J. Johnston wrote:
> Ok, another patch for you.

The attached patch fixes my most recently reported problems with "%f"
formatting.  However, my previously reported problem with:

    "%#.109g", -3333333333333333371313292264111748921061485000000.0

is back.

Unfortunately, I'm having difficulties isolating the problem in C, but
the following simple Python script SEGVs during exit (i.e., during
garbage collection):

    s = "%#.109g" % (-1.e+49/3.)
    print s

Attached is my C translation of the above.  Single stepping in gdb, I
haven't found the overwrite yet.  I will try to dig deeper, but I hope
that reporting what I have found will help you see what I'm missing.

Thanks,
Jason

-- 
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6
-------------- next part --------------
#include <stdio.h>

int
main(int argc, char* argv[])
{
	const char* format = "%#.109g";
	double value = -1.e+49/3.;
	printf(format, value);
	printf("\n");
	return 0;
}


More information about the Newlib mailing list