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 lemburg
Recipients lemburg, pitrou
Date 2013-04-12.13:45:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1365774337.76.0.849848106249.issue17703@psf.upfronthosting.co.za>
In-reply-to
Content
After a closer look at recent checkins, I found this checking for the trash can mechanism: 5a2ef447b80d (ticket #13992).

This appears to be the cause:

    1.20  #define Py_TRASHCAN_SAFE_BEGIN(op) \
    1.21 -    if (_PyTrash_delete_nesting < PyTrash_UNWIND_LEVEL) { \
    1.22 -        ++_PyTrash_delete_nesting;
    1.23 -        /* The body of the deallocator is here. */
    1.24 +    do { \
    1.25 +        PyThreadState *_tstate = PyThreadState_GET(); \
    1.26 +        if (_tstate->trash_delete_nesting < PyTrash_UNWIND_LEVEL) { \
    1.27 +            ++_tstate->trash_delete_nesting;
    1.28 +            /* The body of the deallocator is here. */

At the time the Py_AtExit functions are called, the thread state
is NULL, so the if (_tstate->...) segfaults.
History
Date User Action Args
2013-04-12 13:45:37lemburgsetrecipients: + lemburg, pitrou
2013-04-12 13:45:37lemburgsetmessageid: <1365774337.76.0.849848106249.issue17703@psf.upfronthosting.co.za>
2013-04-12 13:45:37lemburglinkissue17703 messages
2013-04-12 13:45:37lemburgcreate