Message299346
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 (https://github.com/home-assistant/home-assistant/issues/7752#issuecomment-305100009, which points to https://github.com/home-assistant/home-assistant/pull/7848). 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: https://github.com/python/cpython/blob/master/Modules/_asynciomodule.c#L996
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:30 | thehesiod | set | recipients:
+ thehesiod, yselivanov |
2017-07-27 20:16:30 | thehesiod | set | messageid: <1501186590.27.0.993176632925.issue31061@psf.upfronthosting.co.za> |
2017-07-27 20:16:30 | thehesiod | link | issue31061 messages |
2017-07-27 20:16:30 | thehesiod | create | |
|