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 vstinner
Recipients Anthony Sottile, ammar2, christian.heimes, erlendaasland, pablogsal, paul.moore, shreyanavigyan, stestagg, steve.dower, tim.golden, vstinner, zach.ware
Date 2021-05-20.21:51:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1621547472.76.0.142277555175.issue44184@roundup.psfhosted.org>
In-reply-to
Content
This bug is really hard to reproduce on Windows. It depends on flake8 is run. It's a random crash in the last GC collection at Python exit.

Crash related to AST in interpreter_clear() remains me bpo-41796.

Extract of the code:

static void
interpreter_clear(PyInterpreterState *interp, PyThreadState *tstate)
{
    ...
    _PyAST_Fini(interp);
    ...
    /* Last garbage collection on this interpreter */
    _PyGC_CollectNoFail(tstate);
    _PyGC_Fini(interp);
    ...
}

The crash occurs in _PyGC_CollectNoFail().

_PyAST_Fini() clears references to AST types in the interpreter AST state. AST type instances hold a reference to the their heap type:

static int
ast_traverse(AST_object *self, visitproc visit, void *arg)
{
    Py_VISIT(Py_TYPE(self));
    Py_VISIT(self->dict);
    return 0;
}

But the crash happens when self->dict is deallocated.
History
Date User Action Args
2021-05-20 21:51:12vstinnersetrecipients: + vstinner, paul.moore, christian.heimes, tim.golden, zach.ware, steve.dower, Anthony Sottile, ammar2, pablogsal, erlendaasland, stestagg, shreyanavigyan
2021-05-20 21:51:12vstinnersetmessageid: <1621547472.76.0.142277555175.issue44184@roundup.psfhosted.org>
2021-05-20 21:51:12vstinnerlinkissue44184 messages
2021-05-20 21:51:12vstinnercreate