-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
Segfault from asyncio.events._running_loop.__setattr__
with invalid name
#127190
Comments
The report says it's not specific to the JIT or free-threading :) @devdanzin - if you're able to reproduce an issue on both the default (with GIL) build and free threading, it's probably more helpful to report the |
The bug is unrelated to asyncio, it's a bug in import threading
class Loop(threading.local):
attr = 1
class Liar1:
def __eq__(self, other):
return True
loop = Loop()
loop.__setattr__(Liar1(), 2) It's a minor bug in the error handling of |
Don't make the assumption that the first argument is a string. Use repr() to format the argument instead.
Don't make the assumption that the first argument is a string. Use repr() to format the argument instead.
Don't make the assumption that the 'name' argument is a string. Use repr() to format the 'name' argument instead.
I wrote PR #127366 to fix the issue. |
Don't make the assumption that the 'name' argument is a string. Use repr() to format the 'name' argument instead.
Don't make the assumption that the 'name' argument is a string. Use repr() to format the 'name' argument instead. (cherry picked from commit 20657fb) Co-authored-by: Victor Stinner <vstinner@python.org>
Don't make the assumption that the 'name' argument is a string. Use repr() to format the 'name' argument instead. (cherry picked from commit 20657fb) Co-authored-by: Victor Stinner <vstinner@python.org>
Fixed by 20657fb. Thanks for your report @devdanzin. |
Crash report
What happened?
It's possible to segfault the interpreter by calling
asyncio.events._running_loop.__setattr__
with a special class asname
, as in this example:The backtrace is:
No threads, free-threading or JIT necessary for this to work.
In a debug built, an assertion fails instead:
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.0a2+ experimental free-threading build (heads/main-dirty:a13e94d84bf, Nov 23 2024, 07:16:19) [GCC 11.4.0]
Linked PRs
The text was updated successfully, but these errors were encountered: