Skip to content

Segfault with asyncio.base_events.BaseEventLoop when passed a small float to set_debug. #126881

Closed

Description

@devdanzin

Crash report

What happened?

It's possible to segfault the interpreter by passing a small float as the enabled parameter of asyncio.base_events.BaseEventLoop.set_debug():

import asyncio.base_events

obj = asyncio.base_events.BaseEventLoop()
obj.set_debug(0.0005)
obj._run_forever_setup()

Found using fusil by @vstinner.

CPython versions tested on:

3.13, 3.14, CPython main branch

Operating systems tested on:

Linux

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

Python 3.14.0a1+ experimental free-threading build (heads/main-dirty:54c63a32d0, Nov 8 2024, 20:16:36) [GCC 11.4.0]

Linked PRs

Activity

  1. added
    type-crashA hard crash of the interpreter, possibly with a core dump
    on Nov 15, 2024
  2. picnixz commented on Nov 16, 2024

    @picnixz
    Member

    I'm assuming that this only happens on the free-threaded build, or?

  3. devdanzin commented on Nov 16, 2024

    @devdanzin
    MemberAuthor

    No, it segfaults on normal build too, sorry for not mentioning it.

  4. picnixz commented on Nov 16, 2024

    @picnixz
    Member

    I'll have a look at this one.

  5. self-assigned this
    on Nov 16, 2024
  6. added
    stdlibStandard Library Python modules in the Lib/ directory
    on Nov 16, 2024
  7. 10 remaining items

  8. added
    interpreter-core(Objects, Python, Grammar, and Parser dirs)
    and removed
    stdlibStandard Library Python modules in the Lib/ directory
    on Nov 16, 2024
  9. kumaraditya303 commented on Nov 16, 2024

    @kumaraditya303
    Contributor

    #126904 fixes this

  10. vstinner commented on Nov 18, 2024

    @vstinner
    Member

    self._debug = enabled = bool(enabled)

    IMO it's also worth it to fix asyncio.

  11. picnixz commented on Nov 18, 2024

    @picnixz
    Member

    I'll reopen it once I'm back from my travels if you think it's worth it!

  12. added a commit that references this issue on Nov 29, 2024
  13. added a commit that references this issue on Nov 29, 2024
  14. kumaraditya303 commented on Nov 29, 2024

    @kumaraditya303
    Contributor

    Fixed by #126904

  15. moved this from Todo to Done in asyncioon Nov 29, 2024
  16. added a commit that references this issue on Nov 29, 2024
  17. added a commit that references this issue on Jan 8, 2025
  18. added a commit that references this issue on Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

3.12only security fixes3.13only 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

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions