◐ Shell
clean mode source ↗

Message 17906 - Python tracker

Logged In: YES 
user_id=31435

Martin, it's easy to transform the example into one that 
crashes.  For example, adding "print t[3]" as the last line of 
the iter() function causes it to die with a segfault on my box.  
Virtually anything that fetches a NULL from the tuple will try 
to Py_INCREF it (that's all "t[3]" does), and that's an instant 
NULL-pointer dereferencing death.

That said, it would be more helpful <wink> if Armin submitted 
a doc patch.  The introspective features of the gc module are 
intended to be used by consenting adults facing hard 
debugging problems, and I don't care if they can be tricked 
into blowing up.  I agree the docs should point out the 
possibility, though.