Repository navigation
Random crash of test_signal on macos sonoma #110017
Copy link
Copy link
Closed
Labels
OS-mactestsTests in the Lib/test dirTests in the Lib/test dirtype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
Description
Crash report
I've experience a randome crash while fixing #109981
Why random? Because I was not able to reproduce it ever again.
My command:
» ./python.exe -m test -f tests.txt
0:00:00 load avg: 4.78 Run 31 tests sequentially
0:00:00 load avg: 4.78 [ 1/31] test_shelve
0:00:00 load avg: 4.78 [ 2/31] test_shlex
0:00:00 load avg: 4.78 [ 3/31] test_signal
Fatal Python error: Bus error
Current thread 0x000000016c947000 (most recent call first):
File "/Users/sobolev/Desktop/cpython/Lib/test/test_signal.py", line 1338 in set_interrupts
File "/Users/sobolev/Desktop/cpython/Lib/threading.py", line 1003 in run
File "/Users/sobolev/Desktop/cpython/Lib/threading.py", line 1066 in _bootstrap_inner
File "/Users/sobolev/Desktop/cpython/Lib/threading.py", line 1023 in _bootstrap
Thread 0x00000001de555300 (most recent call first):
File "/Users/sobolev/Desktop/cpython/Lib/signal.py", line 29 in _int_to_enum
File "/Users/sobolev/Desktop/cpython/Lib/signal.py", line 57 in signal
File "/Users/sobolev/Desktop/cpython/Lib/test/test_signal.py", line 1346 in cycle_handlers
File "/Users/sobolev/Desktop/cpython/Lib/test/test_signal.py", line 1356 in test_stress_modifying_handlers
File "/Users/sobolev/Desktop/cpython/Lib/unittest/case.py", line 589 in _callTestMethod
File "/Users/sobolev/Desktop/cpython/Lib/unittest/case.py", line 636 in run
File "/Users/sobolev/Desktop/cpython/Lib/unittest/case.py", line 692 in __call__
File "/Users/sobolev/Desktop/cpython/Lib/unittest/suite.py", line 122 in run
File "/Users/sobolev/Desktop/cpython/Lib/unittest/suite.py", line 84 in __call__
File "/Users/sobolev/Desktop/cpython/Lib/unittest/suite.py", line 122 in run
File "/Users/sobolev/Desktop/cpython/Lib/unittest/suite.py", line 84 in __call__
File "/Users/sobolev/Desktop/cpython/Lib/unittest/suite.py", line 122 in run
File "/Users/sobolev/Desktop/cpython/Lib/unittest/suite.py", line 84 in __call__
File "/Users/sobolev/Desktop/cpython/Lib/test/support/testresult.py", line 146 in run
File "/Users/sobolev/Desktop/cpython/Lib/test/support/__init__.py", line 1152 in _run_suite
File "/Users/sobolev/Desktop/cpython/Lib/test/support/__init__.py", line 1279 in run_unittest
File "/Users/sobolev/Desktop/cpython/Lib/test/libregrtest/single.py", line 36 in run_unittest
File "/Users/sobolev/Desktop/cpython/Lib/test/libregrtest/single.py", line 92 in test_func
File "/Users/sobolev/Desktop/cpython/Lib/test/libregrtest/single.py", line 48 in regrtest_runner
File "/Users/sobolev/Desktop/cpython/Lib/test/libregrtest/single.py", line 95 in _load_run_test
File "/Users/sobolev/Desktop/cpython/Lib/test/libregrtest/single.py", line 138 in _runtest_env_changed_exc
File "/Users/sobolev/Desktop/cpython/Lib/test/libregrtest/single.py", line 238 in _runtest
File "/Users/sobolev/Desktop/cpython/Lib/test/libregrtest/single.py", line 266 in run_single_test
File "/Users/sobolev/Desktop/cpython/Lib/test/libregrtest/main.py", line 290 in run_test
File "/Users/sobolev/Desktop/cpython/Lib/test/libregrtest/main.py", line 325 in run_tests_sequentially
File "/Users/sobolev/Desktop/cpython/Lib/test/libregrtest/main.py", line 459 in _run_tests
File "/Users/sobolev/Desktop/cpython/Lib/test/libregrtest/main.py", line 490 in run_tests
File "/Users/sobolev/Desktop/cpython/Lib/test/libregrtest/main.py", line 576 in main
File "/Users/sobolev/Desktop/cpython/Lib/test/libregrtest/main.py", line 584 in main
File "/Users/sobolev/Desktop/cpython/Lib/test/__main__.py", line 2 in <module>
File "/Users/sobolev/Desktop/cpython/Lib/runpy.py", line 88 in _run_code
File "/Users/sobolev/Desktop/cpython/Lib/runpy.py", line 198 in _run_module_as_main
Extension modules: _testcapi (total: 1)
[1] 3657 bus error ./python.exe -m test -f tests.txt
Contents of tests.txt:
test_shelve
test_shlex
test_signal
test_site
test_slice
test_smtplib
test_smtpnet
test_socket
test_socketserver
test_sort
test_source_encoding
test_sqlite3
test_ssl
test_stable_abi_ctypes
test_startfile
test_stat
test_statistics
test_str
test_strftime
test_string
test_string_literals
test_stringprep
test_strptime
test_strtod
test_struct
test_structseq
test_subclassinit
test_subprocess
test_sundry
test_super
test_support
But, note that only 3 tests were run before: test_shelve test_shlex test_signal
I've also tried to run ./python.exe -m test -j4 --forever test_shelve test_shlex test_signal, but no luck for now.
Env:
- 98c0c1d (
main) - macos sonoma, apple m2
Linked PRs
- gh-110017: Disable test_signal.test_stress_modifying_handlers on macOS #112834
- [3.12] gh-110017: Disable test_signal.test_stress_modifying_handlers on macOS (GH-112834) #112851
- [3.11] gh-110017: Disable test_signal.test_stress_modifying_handlers on macOS (GH-112834) #112852
- [3.12] gh-110820: Make sure processor specific defines are correct for Universal 2 build on macOS (gh-112828) #112864
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
OS-mactestsTests in the Lib/test dirTests in the Lib/test dirtype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
Activity
sobolevn commentedon Sep 28, 2023
I got it again from
--forever:vstinner commentedon Sep 29, 2023
Maybe the test_signal.test_stress_modifying_handlers() was already unstable before macOS 14: I saw a crash on macOS 12.7 (GHA macOS), see issue gh-110083. Maybe it's just that it was missed before I deplayed
--rerun-failon Python CIs.erlend-aasland commentedon Oct 5, 2023
I got a failure-then-success for
test_signalrecently: https://github.com/python/cpython/actions/runs/6415769021/job/17418272051?pr=110374Eclips4 commentedon Oct 13, 2023
I came to the same conclusion. It would be great if someone with macOS 13 (or older) try to reproduce it.
Reproducer:
./python.exe -m test test_signal -m test_stress_modifying_handlers --foreverronaldoussoren commentedon Dec 7, 2023
I caught the error in a debugger:
Note the SEGV on address 0x1 triggered from within libc. A second thread is in the sigaction implementation.
This looks more and more like a bug in macOS. I'll see if I can whip up a reproducer in C.
ronaldoussoren commentedon Dec 7, 2023
This is a reproducer in C that crashes almost immediately for me on a 14.1 system. The crash is similar to the one above:
Could one of you check my C code to make sure it doesn't contain a glaring issue? I intend to file an issue with Apple about this.I will test on older macOS versions over the weekend.pythongh-110017: Disable test_signal.test_stress_modifying_handlers o…
ronaldoussoren commentedon Dec 7, 2023
I've filed an issue with Apple about this: FB13453490
ned-deily commentedon Dec 7, 2023
FWIW, your C test also crashed on macOS 13.5.1 and 12.6.1 (both Apple Silicon).
gh-110017: Disable test_signal.test_stress_modifying_handlers on macOS (
pythongh-110017: Disable test_signal.test_stress_modifying_handlers o…
pythongh-110017: Disable test_signal.test_stress_modifying_handlers o…
[3.12] gh-110017: Disable test_signal.test_stress_modifying_handlers …
[3.11] gh-110017: Disable test_signal.test_stress_modifying_handlers …
pythongh-110017: Disable test_signal.test_stress_modifying_handlers o…
pythongh-110017: Disable test_signal.test_stress_modifying_handlers o…