Repository navigation
test_dataclasses fails with a segfault in hunt refleaks mode #123185
Copy link
Copy link
Closed
Labels
3.14bugs and security fixesbugs and security fixestype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or errortype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
Description
Bug report
Bug description:
eclips4@nixos ~/p/p/cpython (main)> ./python -m test -R 3:3 test_dataclasses
Using random seed: 315532800
0:00:00 load avg: 0.96 Run 1 test sequentially in a single process
0:00:00 load avg: 0.96 [1/1] test_dataclasses
beginning 6 repetitions. Showing number of leaks (. for 0 or less, X for 10 or more)
123:456
XFatal Python error: Segmentation fault
Current thread 0x00007f14a8f07b80 (most recent call first):
File "/home/eclips4/programming/programming-languages/cpython/Lib/test/test_dataclasses/__init__.py", line 2217 in test_dataclasses_qualnames
File "/home/eclips4/programming/programming-languages/cpython/Lib/unittest/case.py", line 606 in _callTestMethod
File "/home/eclips4/programming/programming-languages/cpython/Lib/unittest/case.py", line 660 in run
File "/home/eclips4/programming/programming-languages/cpython/Lib/unittest/case.py", line 716 in __call__
File "/home/eclips4/programming/programming-languages/cpython/Lib/unittest/suite.py", line 122 in run
File "/home/eclips4/programming/programming-languages/cpython/Lib/unittest/suite.py", line 84 in __call__
File "/home/eclips4/programming/programming-languages/cpython/Lib/unittest/suite.py", line 122 in run
File "/home/eclips4/programming/programming-languages/cpython/Lib/unittest/suite.py", line 84 in __call__
File "/home/eclips4/programming/programming-languages/cpython/Lib/test/libregrtest/testresult.py", line 148 in run
File "/home/eclips4/programming/programming-languages/cpython/Lib/test/libregrtest/single.py", line 57 in _run_suite
File "/home/eclips4/programming/programming-languages/cpython/Lib/test/libregrtest/single.py", line 37 in run_unittest
File "/home/eclips4/programming/programming-languages/cpython/Lib/test/libregrtest/single.py", line 135 in test_func
File "/home/eclips4/programming/programming-languages/cpython/Lib/test/libregrtest/refleak.py", line 132 in runtest_refleak
File "/home/eclips4/programming/programming-languages/cpython/Lib/test/libregrtest/single.py", line 87 in regrtest_runner
File "/home/eclips4/programming/programming-languages/cpython/Lib/test/libregrtest/single.py", line 138 in _load_run_test
File "/home/eclips4/programming/programming-languages/cpython/Lib/test/libregrtest/single.py", line 181 in _runtest_env_changed_exc
File "/home/eclips4/programming/programming-languages/cpython/Lib/test/libregrtest/single.py", line 281 in _runtest
File "/home/eclips4/programming/programming-languages/cpython/Lib/test/libregrtest/single.py", line 310 in run_single_test
File "/home/eclips4/programming/programming-languages/cpython/Lib/test/libregrtest/main.py", line 363 in run_test
File "/home/eclips4/programming/programming-languages/cpython/Lib/test/libregrtest/main.py", line 397 in run_tests_sequentially
File "/home/eclips4/programming/programming-languages/cpython/Lib/test/libregrtest/main.py", line 541 in _run_tests
File "/home/eclips4/programming/programming-languages/cpython/Lib/test/libregrtest/main.py", line 576 in run_tests
File "/home/eclips4/programming/programming-languages/cpython/Lib/test/libregrtest/main.py", line 739 in main
File "/home/eclips4/programming/programming-languages/cpython/Lib/test/libregrtest/main.py", line 747 in main
File "/home/eclips4/programming/programming-languages/cpython/Lib/test/__main__.py", line 2 in <module>
File "/home/eclips4/programming/programming-languages/cpython/Lib/runpy.py", line 88 in _run_code
File "/home/eclips4/programming/programming-languages/cpython/Lib/runpy.py", line 198 in _run_module_as_main
Extension modules: _testinternalcapi (total: 1)
fish: Job 1, './python -m test -R 3:3 test_da…' terminated by signal SIGSEGV (Address boundary error)CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
3.14bugs and security fixesbugs and security fixestype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or errortype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
Activity
Eclips4 commentedon Aug 20, 2024
Bisected to bb1d303
cc @markshannon
zware commentedon Aug 20, 2024
Corroborated by the PPC64LE RHEL8 Refleaks 3.x builder (370/478 other tests passed as of right now, the build is not yet finished).
Edit: a couple of other refleak builders have finished and also crashed on
test.test_dataclasses.TestCase.test_dataclasses_qualnameswith no other issues.JelleZijlstra commentedon Aug 20, 2024
Stack trace:
Details
Apparently
new_frameis NULL here:cpython/Python/bytecodes.c
Line 3475 in f88c14d
Eclips4 commentedon Aug 20, 2024
Here's the minimal reproducible example without dataclasses:
markshannon commentedon Aug 21, 2024
@Eclips4 thanks for the triaging. It looks like I accidentally removed an error check when refactoring.
GH-123185: Check for `NULL` after calling `_PyEvalFramePushAndInit` (G…
JelleZijlstra commentedon Aug 21, 2024
Thanks Mark for the fix!
pythonGH-123185: Check for `NULL` after calling `_PyEvalFramePushAndI…