Author thehesiod
Recipients thehesiod, yselivanov
Date 2017-07-27.20:16:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I have a project in a prod environment which heavily uses asyncio and a threadpool.  It uses the threadpool to run CPU heavy tasks (in this case populating a defaultdict) to avoid blocking the main thread (no async code in thread).  For some time now my service has been randomly crashing at the same place in the thread which does the dict updating.  I've finally got both the python and native stack traces, and based on the information presented it looked very similar to the issue found by the devs at home-assistant (, which points to  So I tried their fix of disabling the "_asyncio" module, and lo and behold python no longer segfaults.

Per the stacktrace it's crashing in PyObject_GC_Del, and the only place this is used in the asyncio module seems to be here:

does anyone have any idea why it's crashing on this line?  Are there thread protections missing in this file?

I'm trying to reproduce this in a testcase but it's proving very difficult as I'm guessing it's timing related.
Date User Action Args
2017-07-27 20:16:30thehesiodsetrecipients: + thehesiod, yselivanov
2017-07-27 20:16:30thehesiodsetmessageid: <>
2017-07-27 20:16:30thehesiodlinkissue31061 messages
2017-07-27 20:16:30thehesiodcreate