Python segfault

Mike Fletcher mfletch at tpresence.com
Fri Jun 16 06:37:03 EDT 2000


Not really insight, but Python's grammar is such that you create nested sets
of expressions when you create what looks like a set of simple adds...

2+2+2+2 -> (((2+2)+2)+2)

So you get a rather deep expression tree in your examples ;) .  I'm guessing
something doesn't like creating (or evaluating) this, though whether it's
the parser I don't know.

Enjoy,
Mike

-----Original Message-----
From: Peter Schneider-Kamp [mailto:petersc at stud.ntnu.no]
Sent: Friday, June 16, 2000 2:30 AM
To: perly at xnet.com
Cc: python-list at python.org
Subject: Re: Python segfault


Pat Szuta wrote:
> 
> I don't know if anyone has seen this,  but python segfaults when given a
> rather large input.
> 
> [pat at perly pat]$ perl -e "print '2+2+' x 10000" > input
> [pat at perly pat]$ python < input

Strange. Looks like the limit is exactly at 8192. That makes 16384
operations the parser (or whatever crashes) can hold.

Not that the problem is not the length of the input itself:

$ perl -e "print '22222222 ' x 200000 > input
$ python < input

works just fine. I think the problem is the add (or mul) operation.
So the problem might be in the expression parser.

Is there anyone with some more insight around?

else-I-will-have-to-check-it-myself-ly y'rs Peter
--
Peter Schneider-Kamp          ++47-7388-7331
Herman Krags veg 51-11        mailto:peter at schneider-kamp.de
N-7050 Trondheim              http://schneider-kamp.de

-- 
http://www.python.org/mailman/listinfo/python-list




More information about the Python-list mailing list