[Python-bugs-list] [ python-Bugs-490939 ] <string>.join(generator) crash bug

noreply@sourceforge.net noreply@sourceforge.net
Sun, 09 Dec 2001 15:06:09 -0800


Bugs item #490939, was opened at 2001-12-09 14:09
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=490939&group_id=5470

Category: Python Interpreter Core
Group: Python 2.2
>Status: Closed
Resolution: Fixed
Priority: 5
Submitted By: Sami Hangaslammi (shang)
>Assigned to: Guido van Rossum (gvanrossum)
Summary: <string>.join(generator) crash bug

Initial Comment:
Reproduced on Windows XP (Python 2.2b1) and Redhat 
7.1 (Python 2.2b1). Bug didn't manifest with Python 
2.1 (WinNT4) or Python 2.2a2 (RH7.1).

Some generators crash the interpreter when used with 
<string>.join(generator). The same generators work 
fine when used with for-loops or with the build-in 
function list.

I couldn't create a more simple generator that would 
cause the interpreter to crash, so I'll attach the 
whole script (longish).

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

>Comment By: Tim Peters (tim_one)
Date: 2001-12-09 15:06

Message:
Logged In: YES 
user_id=31435

Luck of the draw, I guess.  I rebuilt 2.2b2 and the 
resizing is definitely it -- choking in _PyTuple_Resize 
will cutting back the result tuple from 20 to 19, on a 
trash address left over from an earlier _PyTuple_Resize 
growing the tuple from 10 to 20.  Closed again.

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

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-12-09 14:59

Message:
Logged In: YES 
user_id=6380

Moreover, Tim, the crash I get is in _PyTuple_Resize().

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

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-12-09 14:57

Message:
Logged In: YES 
user_id=6380

Tim, for me reverting to tupleobject.c 2.61 *did* yield a
crash.


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

Comment By: Tim Peters (tim_one)
Date: 2001-12-09 14:50

Message:
Logged In: YES 
user_id=31435

Hmm (Guido).  tuple resizing could be relevant, but 
reverting to 2.61 of tupleobject.c didn't yield a crash.

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

Comment By: Tim Peters (tim_one)
Date: 2001-12-09 14:38

Message:
Logged In: YES 
user_id=31435

I can reproduce a crash under 2.2b1 and 2.2b2, but not 
under current CVS Python.  This irks me, because I don't 
know of anything relevant that changed (that is, AFAICT 
it's "working" by accident now -- or never should have 
failed).  I'll rebuild 2.2b2 from scratch and dig into it.

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

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-12-09 14:33

Message:
Logged In: YES 
user_id=6380

I think I *just* fixed this. Can you try a recent CVS?
tupleobject.c 2.62.

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

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