[Python-bugs-list] [ python-Bugs-522699 ] Segfault evaluating '%.100f' % 2.0**100

noreply@sourceforge.net noreply@sourceforge.net
Fri, 22 Mar 2002 14:44:06 -0800


Bugs item #522699, was opened at 2002-02-25 22:49
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=522699&group_id=5470

Category: Python Interpreter Core
Group: Python 2.1.2
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Erwin S. Andreasen (drylock)
Assigned to: Nobody/Anonymous (nobody)
Summary: Segfault evaluating '%.100f' % 2.0**100

Initial Comment:
Evaluating this code:

'%.100f' % 2.0**100

will crash python2.1.2. gdb on the core file shows

#0  0x30303030 in ?? ()
Error accessing memory address 0x30303030: No such process.

which suggests overflow of some stack variable (0x30 is ASCII character '0')

The same problem also happens on Python 2.0

The problem does NOT occur on Python 2.2 nor 1.5


Program versions used:
Python 2.0b1 (#18, Sep 23 2001, 21:06:34) 
[GCC 2.95.2 20000220 (Debian GNU/Linux)] on linux2

Python 2.1.2 (#1, Jan 18 2002, 18:05:45) 
[GCC 2.95.4  (Debian prerelease)] on linux2

Python 2.2 (#1, Jan  8 2002, 01:13:32) 
[GCC 2.95.4 20011006 (Debian prerelease)] on linux2

Python 1.5.2 (#0, Dec 27 2000, 13:59:38)  
[GCC 2.95.2 20000220 (Debian GNU/Linux)] on linux2



----------------------------------------------------------------------

>Comment By: Neil Schemenauer (nascheme)
Date: 2002-03-22 22:44

Message:
Logged In: YES 
user_id=35752

This has already been fixed.

----------------------------------------------------------------------

Comment By: Neil Schemenauer (nascheme)
Date: 2002-02-25 23:52

Message:
Logged In: YES 
user_id=35752

I think this was fixed in floatobject.c 2.108.  The patch is
attached if anyone wants to backport it.  2.1 doesn't seem
to have snprintf though so the port could be tricky.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=522699&group_id=5470