[New-bugs-announce] [issue45813] Importing asyncio after deleting a coroutine object and before cleaning it up leads to crashing on Python3.11

Xinmeng Xia report at bugs.python.org
Tue Nov 16 03:44:12 EST 2021


New submission from Xinmeng Xia <xiaxm at smail.nju.edu.cn>:

The following crashing can only reproduce on Python3.11.  In this case, we import "asyncio" after deleting a coroutine object and before cleaning it up, leading to crashing. 


test.py
=======================
async def f():
    pass
f = f()
frame = f.cr_frame
del f

import asyncio

frame.clear()
======================

>>>Python3.11 -Werror test.py
Exception ignored in: <coroutine object f at 0x7f860ad9cdd0>
Traceback (most recent call last):
  File "python311/Lib/warnings.py", line 506, in _warn_unawaited_coroutine
    warn(msg, category=RuntimeWarning, stacklevel=2, source=coro)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeWarning: coroutine 'f' was never awaited
Segmentation fault (core dumped)



Version: Python 3.11.0a2+ on Ubuntu 16.04

----------
components: asyncio
messages: 406388
nosy: asvetlov, xxm, yselivanov
priority: normal
severity: normal
status: open
title: Importing asyncio after deleting a coroutine object and before cleaning it up leads to crashing on Python3.11
type: crash
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45813>
_______________________________________


More information about the New-bugs-announce mailing list