Python segfault

Thomas Wouters thomas at xs4all.net
Fri Jun 16 10:52:22 EDT 2000


On Fri, Jun 16, 2000 at 03:59:30PM +0200, Peter Schneider-Kamp wrote:

> > On Fri, Jun 16, 2000 at 02:19:03PM +0200, Hans-Joachim Widmaier wrote:

> > > Why not simply make 'n_nchildren' an (32 bit) int? And, while at it,
> > > 'n_lineno' also? It would cost some memory, though.

> > Why bother ? It would do nothing to solve the real problem, which is that
> > there is a finite number of direct children to a node. The current number is
> > practically unreachable -- the example case of ('+'.join(['2+2'] * 8193)) is
> > hardly reminiscent of real code.

> Well, what about the n_lineno? Isn't that going to overflow
> in more realistic situations? 

Hmm, actually, yes. In fact, I was too optimistic in my original mail; the
script generated by

python -c 'print "x = 1\n"*33000'

crashes as well. That is, there is a limit of actual newline-seperated
statements, but I'm not sure if that's imposed by the lineno or by the
n_nchildren member. I don't really know anything about the parser, though,
only what I've quickly browsed, so I can't say if there are any real-world
examples of those limits being reached. (If it's a limit of the number of
lines of code in a script, or of toplevel-statements, or of
toplevel-statements until a block-statement, or whatever.)

This would probably be a good time for someone who knows what he's talking
about to enter ;-)

-- 
Thomas Wouters <thomas at xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!




More information about the Python-list mailing list