Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Date: Thu, 02 Jan 2003 14:21:38 -0500
From: Jason Tishler <jason@tishler.net>
Subject: Re: Heads up: *possible* bug in cygwin
In-reply-to: <3E13C1E1.1000103@ece.gatech.edu>
To: cygwin@cygwin.com
Mail-followup-to: cygwin@cygwin.com
Message-id: <20030102192138.GA1668@tishler.net>
MIME-version: 1.0
Content-type: multipart/mixed; boundary="Boundary_(ID_nv4OxJ2kD/BbiF56qnsb0Q)"
User-Agent: Mutt/1.4i
References: <3E10A7AE.20405@ece.gatech.edu> <3E10C29B.2010709@ece.gatech.edu>
 <3E111AAF.3090008@ece.gatech.edu> <20021231043913.GA26944@redhat.com>
 <3E11AD26.8050506@ece.gatech.edu> <20021231175349.GC6542@redhat.com>
 <3E123A28.8030705@ece.gatech.edu> <1041383123.6526.13.camel@lifelesswks>
 <3E137A39.9050204@ece.gatech.edu> <3E13C1E1.1000103@ece.gatech.edu>

--Boundary_(ID_nv4OxJ2kD/BbiF56qnsb0Q)
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
Content-disposition: inline

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

--Boundary_(ID_nv4OxJ2kD/BbiF56qnsb0Q)
Content-type: text/plain; charset=us-ascii; NAME=ldtoa.c.diff
Content-transfer-encoding: 7BIT
Content-disposition: attachment; filename=ldtoa.c.diff

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 );


--Boundary_(ID_nv4OxJ2kD/BbiF56qnsb0Q)
Content-Type: text/plain; charset=us-ascii

--
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/
--Boundary_(ID_nv4OxJ2kD/BbiF56qnsb0Q)--
