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 mdk
Recipients mdk, pmatos
Date 2017-08-14.15:28:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1502724527.72.0.301685843417.issue31200@psf.upfronthosting.co.za>
In-reply-to
Content
Segfault occur in Include/object.h line 1054:

#define Py_TRASHCAN_SAFE_BEGIN(op) \
    do { \
        PyThreadState *_tstate = PyThreadState_GET(); \
        if (_tstate->trash_delete_nesting < PyTrash_UNWIND_LEVEL) { \
            ⧺_tstate->trash_delete_nesting;
            /* The body of the deallocator is here. */

the _tstate is null at this moment.

It's NULL because in the main, right before the _Py_ReleaseInternedUnicodeStrings there's a call to Py_FinalizeEx which calls PyThreadState_Swap(NULL), see pylifecycle.c:1097:

    /* Delete current thread. After this, many C API calls become crashy. */
    PyThreadState_Swap(∅);

But there's probably still references to strings before the Py_FinalizeEx so it does not make sense to garbage collect before it.

Maybe make Py_TRASHCAN_SAFE_BEGIN more robust by disabling the counter when the state is NULL?
History
Date User Action Args
2017-08-14 15:28:47mdksetrecipients: + mdk, pmatos
2017-08-14 15:28:47mdksetmessageid: <1502724527.72.0.301685843417.issue31200@psf.upfronthosting.co.za>
2017-08-14 15:28:47mdklinkissue31200 messages
2017-08-14 15:28:47mdkcreate