Skip to content

PyOS_Readline crashes in a multi-threaded race #123321

Closed
@bharel

Description

@bharel

Crash report

What happened?

The second breakpoint segfaults on Windows (==access violation).

import asyncio async def main(): def inner(): breakpoint() pass asyncio.create_task(asyncio.to_thread(inner)) asyncio.create_task(asyncio.to_thread(inner)) asyncio.ensure_future(main()) asyncio.get_event_loop().run_forever()

Core of the problem is in the myreadline.c module.
Implementing a fix...

CPython versions tested on:

3.12, CPython main branch

Operating systems tested on:

Windows

Output from running 'python -VV' on the command line:

No response

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.12only security fixes3.13bugs and security fixes3.14bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-crashA hard crash of the interpreter, possibly with a core dump

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions