Message217918
The following code causes a segfault when run under Python3.4+ on OSX10.9.
# segfaulter.py
import asyncio
class A:
pass
class B:
def __init__(self, future):
self.future = future
def __del__(self):
self.a = None
@asyncio.coroutine
def do_work(future):
a = A()
b = B(asyncio.Future())
a.b = b
b.a = a
future.set_result(None)
future = asyncio.Future()
asyncio.Task(do_work(future))
loop = asyncio.get_event_loop()
loop.run_until_complete(future)
It does matter that the Future is passed to b's __init__ method.
It doesn't matter whether the Future has been resolved.
Attached is the problem report generated by OSX on the crash. |
|
Date |
User |
Action |
Args |
2014-05-05 11:59:59 | inglesp | set | recipients:
+ inglesp |
2014-05-05 11:59:58 | inglesp | set | messageid: <1399291198.26.0.236308223501.issue21435@psf.upfronthosting.co.za> |
2014-05-05 11:59:58 | inglesp | link | issue21435 messages |
2014-05-05 11:59:57 | inglesp | create | |
|