Content-Length: 303012 | pFad | https://github.com/python/cpython/issues/105987

ad Crash in `_asyncio._swap_current_task` due to improper reference counting · Issue #105987 · python/cpython · GitHub
Skip to content

Crash in _asyncio._swap_current_task due to improper reference counting #105987

Description

@chgnrdv

First appeared in a474e04, where given function was introduced.

Repro:

import _asyncio

class DummyLoop:
    pass

class DummyTask:
    pass

l = DummyLoop()
_asyncio._swap_current_task(l, DummyTask())
t = _asyncio._swap_current_task(l, None)

Output:

Modules/gcmodule.c:461: visit_decref: Assertion "!_PyObject_IsFreed(op)" failed
Enable tracemalloc to get the memory block allocation traceback

object address  : 0x7fedad081130
object refcount : 1
object type     : 0x55f665a81fe0
object type name: dict
object repr     : Segmentation fault (core dumped)

I'm working on a fix.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic-asynciotype-crashA hard crash of the interpreter, possibly with a core dump

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









    ApplySandwichStrip

    pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


    --- a PPN by Garber Painting Akron. With Image Size Reduction included!

    Fetched URL: https://github.com/python/cpython/issues/105987

    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy