[3.12] Crash of repeated Programs/_testembed.c
on Windows DEBUG build
#128833
Labels
3.12
bugs and security fixes
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
OS-windows
type-bug
An unexpected behavior, bug, or error
type-crash
A hard crash of the interpreter, possibly with a core dump
Bug report
Bug description:
This is an issue that only affects Windows DEBUG builds and Python 3.12. I discovered it while writing #127780 and @Yhg1s (#127780 (comment)) investigated it more in details.
The reproducer is as follows:
Paraphrasing Thomas, the assertion failure happens only the second time, namely after finalizing and reinitializing, and the
ep
the assertion fails on is a deallocated object. We suspect that something isn't refcounted correctly, isn't marked as immortal when it should be, or isn't recreated on interpreter starutp when it should be. However, we don't why the issue does not appear on Linux.According to Thomas, this is likely an issue with repeated calls to
Py_Finalize
andPy_Initialize
. However, since 3.12 and 3.13 manage objects lifetime quite differently, it might be easier to just patch the test currently failing as follows: 68a33f3.CPython versions tested on:
3.12
Operating systems tested on:
Windows, Linux
Linked PRs
test_embed.test_specialized_static_code_gets_unspecialized_at_Py_FINALIZE
on Windows #128860The text was updated successfully, but these errors were encountered: