-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
SIGSEV with method descriptors called without a second argument #132747
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
Comments
It appears that there is some issue with method resolution. When using Note: |
_io
module_io.TextIOBase
on sys.stderr
_io.TextIOBase
on sys.stderr
_io._TextIOBase
This also crashes: import io, _io
_io._TextIOBase.read.__get__(io.StringIO()) |
As I understand it, the |
Actually, I'm not sure about the resolution. It's as if there was a missing tp_flag somewhere or something else. It doesn't seem to occur with other static types. I don't have time to investigate though. |
In addition to Example: |
From what I can tell, this is a nasty bug related to descriptors themselves, not import _queue
print(_queue.SimpleQueue.get.__get__(_queue.SimpleQueue())) This seems to affect all heap types with methods. The issue is that I'm really suprised that nobody noticed this for this long. |
I guess nobody noticed this bug before because nobody calls those |
…s `__get__` manually (pythonGH-132772) (cherry picked from commit fa70bf8) Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
_io._TextIOBase
Thanks for the report @Changaco and the fix @ZeroIntensity |
Crash report
What happened?
Since Python 3.12, the following code triggers a segmentation fault:
CPython versions tested on:
3.9, 3.11, 3.12, 3.13, 3.14
Operating systems tested on:
Linux
Output from running 'python -VV' on the command line:
No response
Linked PRs
NULL
dereference when calling a method's__get__
manually #132772NULL
dereference when calling a method's__get__
manually (GH-132772) #132786The text was updated successfully, but these errors were encountered: