Skip to content

Random crash of test_signal on macos sonoma #110017

Description

@sobolevn

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-mactestsTests in the Lib/test dirtype-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