[Patches] [ python-Patches-1517042 ] Fix for Lib/test/crashers/gc_inspection.py

SourceForge.net noreply at sourceforge.net
Wed Jul 5 00:56:36 CEST 2006


Patches item #1517042, was opened at 2006-07-04 09:39
Message generated for change (Settings changed) made by nnorwitz
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1517042&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core (C code)
Group: Python 2.5
Status: Open
Resolution: None
>Priority: 7
Submitted By: Collin Winter (collinwinter)
Assigned to: Nobody/Anonymous (nobody)
Summary: Fix for Lib/test/crashers/gc_inspection.py

Initial Comment:
The attached patch fixes the bug pointed out in
crashers/gc_inspection.py, namely that
gc.get_referrers() can be used to see objects (in this
case tuples) before their built, leading to segfaults.

The patch works by modifying
Objects/abstract.c:PySequence_AsTuple, wrapping the
call to PyIter_Next() with _PyObject_GC_TRACK/UNTRACK
calls. This has the effect of hiding the being-created
tuple from gc.get_referrers() while fetching the next
item from the iterator.

Also attached is a patch to crashers/gc_inspection.py
itself, which allows the test to actually pass (the
previous version would raise IndexErrors in the event
the test passed).

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

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


More information about the Patches mailing list