Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash in asyncio if finalizer doesn't calls superclass finalizer #129289

Open
kumaraditya303 opened this issue Jan 25, 2025 · 2 comments
Open

crash in asyncio if finalizer doesn't calls superclass finalizer #129289

kumaraditya303 opened this issue Jan 25, 2025 · 2 comments
Labels
topic-asyncio type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@kumaraditya303
Copy link
Contributor

kumaraditya303 commented Jan 25, 2025

Crash report

The following code crashes the interpreter by reading into freed memory.

import asyncio

class MyTask(asyncio.Task):
    def __del__(self):
        print("MyTask.__del__")


async def main():
    task = MyTask(asyncio.sleep(1))
    await task

asyncio.run(main())

Output:

✦ ❯ ./python main.py
MyTask.__del__
fish: Job 2, './python main.py' terminated by signal SIGSEGV (Address boundary error)

Supporting subclasses seems tricky with it, I propose to use fast implementation only with exact types.

@kumaraditya303 kumaraditya303 added topic-asyncio type-crash A hard crash of the interpreter, possibly with a core dump labels Jan 25, 2025
@github-project-automation github-project-automation bot moved this to Todo in asyncio Jan 25, 2025
@AbduazizZiyodov
Copy link

Interesting, which version of Python do you have?

Image

@Eclips4
Copy link
Member

Eclips4 commented Jan 25, 2025

which version of Python do you have?

Looks like a current main branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-asyncio type-crash A hard crash of the interpreter, possibly with a core dump
Projects
Status: Todo
Development

No branches or pull requests

3 participants