segfault in property.getter/setter/deleter if property subclass has weird __new__ #100942
Copy link
Copy link
Closed
Closed
Copy link
Labels
3.10 (EOL)end of lifeend of life3.11only security fixesonly security fixes3.12only security fixesonly security fixestype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
Description
Activity
- addedtype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
on Jan 11, 2023 Confirmed on 3.10, 3.11 and main.
- added3.11only security fixesonly security fixes3.10 (EOL)end of lifeend of life3.12only security fixesonly security fixes
on Jan 11, 2023 __set_name__part is not required for the repro: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.
@sobolevn Thank you for the back ports.
Reacted by sobolevn
Metadata
Metadata
Assignees
Labels
3.10 (EOL)end of lifeend of life3.11only security fixesonly security fixes3.12only security fixesonly security fixestype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
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,
newis a string, so casting it topropertyobjectand writing toprop_nameis wrong.This is synthetic code, I found the problem while porting some 3.10 features to PyPy and thinking about corner cases.
Linked PRs
propertysubtypes with weird__new__#100955