This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author amaury.forgeotdarc
Recipients amaury.forgeotdarc, loewis, mpalluat, ronaldoussoren
Date 2010-07-08.11:41:19
SpamBayes Score 7.517471e-05
Marked as misclassified No
Message-id <1278589282.88.0.109153607706.issue9197@psf.upfronthosting.co.za>
In-reply-to
Content
I reproduce the problem on Linux (./configure --enable-shared), after I modified the source code a bit to directly use Python.h and to link with libpython3.2.so (no call to dlopen). In gdb the stack trace has exactly the same symbols as the attached crash log, so the issue is not specific to Mac frameworks.

The crash is inside _PyImport_LoadDynamicModule("_pickle"), when _PyImport_FixupExtension() calls Py_DECREF(def->m_base.m_copy), this certainly frees objects allocated in a previous incarnation of the interpreter, and segfaults in type_dealloc(): _PyObject_GC_UNTRACK(type).

In import.c::_PyImport_FixupExtension(), the Py_DECREF is preceded by a comment: """ /* Somebody already imported the module, 
   likely under a different name.
   XXX this should really not happen. */
Py_DECREF(def->m_base.m_copy);
"""
I removed this statement, and the program now runs correctly. I don't know about memory leaks though...
History
Date User Action Args
2010-07-08 11:41:22amaury.forgeotdarcsetrecipients: + amaury.forgeotdarc, loewis, ronaldoussoren, mpalluat
2010-07-08 11:41:22amaury.forgeotdarcsetmessageid: <1278589282.88.0.109153607706.issue9197@psf.upfronthosting.co.za>
2010-07-08 11:41:21amaury.forgeotdarclinkissue9197 messages
2010-07-08 11:41:19amaury.forgeotdarccreate