[Python-bugs-list] [ python-Bugs-757520 ] irreproducable segfault on int(1e100)

SourceForge.net noreply@sourceforge.net
Mon, 30 Jun 2003 22:05:46 -0700


Bugs item #757520, was opened at 2003-06-19 16:19
Message generated for change (Comment added) made by rhettinger
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=757520&group_id=5470

Category: Python Interpreter Core
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Gerrit Holl (gerrit)
Assigned to: Nobody/Anonymous (nobody)
Summary: irreproducable segfault on int(1e100)

Initial Comment:
Segmentation Fault:

 20 >>> i
1e+100
 21 >>> int(i)Segmentation fault
23:16:12:2:gerrit@stopcontact:~/downl$ python
Python 2.3b1+ (#3, Jun 19 2003, 10:34:37)
[GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2
Type "help", "copyright", "credits" or "license" for
more information.
  0 >>> i=1e100
  1 >>> int(i)Segmentation fault
23:16:21:2:gerrit@stopcontact:~/downl$ python
Python 2.3b1+ (#3, Jun 19 2003, 10:34:37)
[GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2
Type "help", "copyright", "credits" or "license" for
more information.
  0 >>> i=1e100
  1 >>> int(i)
10000000000000000159028911097599180468360808563945281389781327557747838772170381060813469985856815104L

I'm unable to reproduce this (sorry). I noticed before
that sometimes, the interactive Python interpreter
segfaults irreproducable: only now, it was two times in
succession but not more than two times. I never
encounered this problem while executing Python programs
from scripts.


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

>Comment By: Raymond Hettinger (rhettinger)
Date: 2003-07-01 00:05

Message:
Logged In: YES 
user_id=80475

I tried about 50 times with the interactive interpreter and 
got no failures.  Do you still have the same problem with a 
fresh download of the 2.3b2 release?  Can you post anything 
useful for tracking down the problem?   

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

Comment By: Gerrit Holl (gerrit)
Date: 2003-06-25 10:00

Message:
Logged In: YES 
user_id=13298

Interestingly, the problem does not occur within a script
here, too. Maybe it is in the readline library or something
like that. Pressing <shift>-<Enter> always segfaults for me
(known readline bug). This is the same as <Escape>-O-<Enter>
and the same problem is in Ruby and sh, so this is a
readline bug.  I think this because [int(1e100) for i in
xrange(1000000)] works fine, also on the interactive prompt.
Hmm, would there be a way to test this hypotesis?

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

Comment By: Raymond Hettinger (rhettinger)
Date: 2003-06-25 09:49

Message:
Logged In: YES 
user_id=80475

Under Windows compiled by MSVC++, I've run this hundred 
thousand times in a loop without a failure. I tried it in a 
script and using the interpreter, so it does appear to be 
specific to gcc.

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

Comment By: Martin v. Löwis (loewis)
Date: 2003-06-21 08:44

Message:
Logged In: YES 
user_id=21627

I suspect this is a bug in the C library. To find out for
sure, one would have to study the relevant assembler code in
glibc in detail.

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

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