Skip to content

CMultiplyNested closure crash: Python 3.13 regression #121863

Description

@vstinner

Test extracted from Cython tests/run/methodmangling_T5.py:

classCMultiplyNested:
deff1(self):
__arg=1classD:
defg(self, __arg):
return__argreturnD().g(_CMultiplyNested__arg=2)
deff2(self):
__arg=1classD:
defg(self, __arg):
return__argreturnD().gif__name__=="__main__":
importfaulthandler; faulthandler.enable()
inst=CMultiplyNested()
name='_CMultiplyNested__arg'try:
inst.f1()
exceptTypeError:
print("TypeError")
closure=inst.f2()
closure(_CMultiplyNested__arg=2)

Output:

$ ./python bug.py
TypeError
Fatal Python error: Segmentation fault
Current thread 0x00007fa713149740 (most recent call first):
File "/home/vstinner/python/3.13/bug.py", line 27 in <module>
Erreur de segmentation (core dumped)

Linked PRs

Metadata

Metadata

Assignees

Labels

type-crashA hard crash of the interpreter, possibly with a core dump

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions