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 in property.getter/setter/deleter if property subclass has weird __new__ #100942
Labels
Comments
Confirmed on 3.10, 3.11 and main. |
sobolevn
added a commit
to sobolevn/cpython
that referenced
this issue
Jan 11, 2023
class pro(property):
def __new__(typ, *args, **kwargs):
return "abcdef"
p = property.__new__(pro)
np = p.getter(lambda self: 1) This code also crashes on 3.12 |
This did not fail on 3.9. Soonish, I will hunt down the offending check in. Off hand, I suspect the disasterous and now deprecated descriptor chaining logic. |
Commit that introduced these lines: c56387f |
Confirmed, c56387f is the culprit. |
rhettinger
added a commit
to rhettinger/cpython
that referenced
this issue
Jan 12, 2023
rhettinger
added a commit
that referenced
this issue
Jan 12, 2023
sobolevn
pushed a commit
to sobolevn/cpython
that referenced
this issue
Jan 13, 2023
…nGH-100965). (cherry picked from commit 94fc770) Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
sobolevn
pushed a commit
to sobolevn/cpython
that referenced
this issue
Jan 13, 2023
…nGH-100965). (cherry picked from commit 94fc770) Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
CPython crashes if run on the following code:
The crash happens on the last line. The problem is the following code in
property_copy
:In the crashing code,
new
is a string, so casting it topropertyobject
and writing toprop_name
is wrong.This is synthetic code, I found the problem while porting some 3.10 features to PyPy and thinking about corner cases.
Linked PRs
property
subtypes with weird__new__
#100955The text was updated successfully, but these errors were encountered: