Author Yang Ke
Recipients Yang Ke
Date 2016-03-23.06:49:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1458715782.36.0.22091386428.issue26617@psf.upfronthosting.co.za>
In-reply-to
Content
The crash may be raised on both Windows OS and Linux. We got crashed under Ubuntu 14.04, while a similar issue was found https://bugs.python.org/issue23187#msg238139 last year under Windows OS.

We actually raise such bug working on a program with asyncio and multithread(use asyncio.BaseEventLoop.run_in_executor with its default threadpool).
The asyncio.Task class creates a weakref.WeakSet(https://hg.python.org/cpython/file/3.5/Lib/asyncio/tasks.py#l38) containing alive tasks. WeakSet is implemented as a list containing weakref.ref with CALLBACK function(https://hg.python.org/cpython/file/3.5/Lib/_weakrefset.py#l84). And that may lead to the situation described in sample crash code:
Once a asyncio.Task.__del__ function is called, and callback of the weakref is called, then the interpreter switches to other thread, which may trigger gc.collect(the thread allocate a huge number of objects, for example), and leaves the task object in gc_list with refcount==0.
History
Date User Action Args
2016-03-23 06:49:42Yang Kesetrecipients: + Yang Ke
2016-03-23 06:49:42Yang Kesetmessageid: <1458715782.36.0.22091386428.issue26617@psf.upfronthosting.co.za>
2016-03-23 06:49:42Yang Kelinkissue26617 messages
2016-03-23 06:49:41Yang Kecreate