Heads up: *possible* bug in cygwin
Jason Tishler
jason@tishler.net
Thu Jan 2 19:35:00 GMT 2003
Chuck,
On Wed, Jan 01, 2003 at 11:36:49PM -0500, Charles Wilson wrote:
> Turns out, the problem IS in newlib.
I concur. In fact, this problem is the root cause for the Cygwin Python
SEGV that I was trying to debug in the following:
http://cygwin.com/ml/cygwin-developers/2002-12/msg00027.html
For those interested, Python's test_format regression test would SEGV
after trying to display a 109 digit number. Unfortunately, this
occurred deep in Python's garbage collection during exit which threw me
off the track. Sigh...
Thanks for your astute analysis. With the attached "patch," I was able
to get test_format to pass. I will monitor the newlib list to see what
the outcome is.
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 --------------
Index: newlib/libc/stdlib/ldtoa.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdlib/ldtoa.c,v
retrieving revision 1.6
diff -u -p -r1.6 ldtoa.c
--- newlib/libc/stdlib/ldtoa.c 12 Nov 2002 21:47:53 -0000 1.6
+++ newlib/libc/stdlib/ldtoa.c 2 Jan 2003 19:12:30 -0000
@@ -36,7 +36,7 @@ void _IO_ldtostr(long double *, char *,
/* Maximum number of decimal digits in ASCII conversion
* = NBITS*log10(2)
*/
- #define NDEC (NBITS*8/27)
+ #define NDEC 256 // (NBITS*8/27)
/* The exponent of 1.0 */
#define EXONE (0x3fff)
@@ -2750,8 +2750,8 @@ if( ndigits > NDEC )
ndigits = NDEC;
/* reentrancy addition to use mprec storage pool */
-_REENT_MP_RESULT(ptr) = Balloc (ptr, 3);
-_REENT_MP_RESULT_K(ptr) = 3;
+_REENT_MP_RESULT(ptr) = Balloc (ptr, 5);
+_REENT_MP_RESULT_K(ptr) = 5;
outstr = (char *)_REENT_MP_RESULT(ptr);
etoasc( e, outstr, ndigits, mode, ldp );
-------------- next part --------------
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
More information about the Cygwin
mailing list