Test failures on no-GIL interpreter macOS 26 ARM64 with UBSan
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
Bug report
Bug description:
Here's my Action file: https://github.com/clin1234/sanitizer-experiments/blob/main/.github/workflows/cpython.yml
Log: https://github.com/clin1234/sanitizer-experiments/actions/runs/26239722888/job/77222501727
On macOS 26 ARM64, with the following flags on Clang 22: CFLAGS='-fsanitize-address-use-after-scope -fsanitize-coverage=trace-cmp -fstack-clash-protection' GDBM_CFLAGS="-I$(brew --prefix gdbm)/include"
GDBM_LIBS="-L$(brew --prefix gdbm)/lib -lgdbm"
./configure
--with-undefined-behavior-sanitizer
--with-pydebug
--disable-gil
--enable-safety
--enable-slower-safety
--with-lto=yes
--config-cache
--prefix=/opt/python-dev
--disable-ipv6
--with-openssl="$(brew --prefix openssl@3.5)"
In particular, these tests fail:
- test.test_asyncio.test_streams: (test.test_asyncio.test_streams.StreamTests.test_unhandled_cancel) and (test.test_asyncio.test_streams.StreamTests.test_unhandled_exception) due to OSError: [Errno None] error while attempting to bind on address (30, b'\xc5\xe5\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'): bind(): bad family
File "/Users/runner/work/sanitizer-experiments/sanitizer-experiments/Lib/test/test_asyncio/test_streams.py", line 1225, in _basetest_unhandled_exceptions
self.loop.run_until_complete(main())
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
File "/Users/runner/work/sanitizer-experiments/sanitizer-experiments/Lib/asyncio/base_events.py", line 725, in run_until_complete
return future.result()
~~~~~~~~~~~~~^^
File "/Users/runner/work/sanitizer-experiments/sanitizer-experiments/Lib/test/test_asyncio/test_streams.py", line 1218, in main
server = await asyncio.start_server(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
handle_echo, 'localhost', port)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/runner/work/sanitizer-experiments/sanitizer-experiments/Lib/asyncio/streams.py", line 84, in start_server
return await loop.create_server(factory, host, port, **kwds)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/runner/work/sanitizer-experiments/sanitizer-experiments/Lib/asyncio/base_events.py", line 1646, in create_server
raise OSError(err.errno, msg) from None
- test_dict and test_embed: 76 failures from the same error:
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
WARN: Could not find the standard library directory! sys.prefix is set to /opt/python-dev, is this correct?
Fatal Python error: Failed to import encodings module
Python runtime state: core initialized
Exception ignored in the internal traceback machinery:
ModuleNotFoundError: No module named 'traceback'
ModuleNotFoundError: No module named 'encodings'
- (test.test_exception_group.DeepRecursionInSplitAndSubgroup.test_deep_split) and (test.test_exception_group.DeepRecursionInSplitAndSubgroup.test_deep_subgroup) with AssertionError: RecursionError not raised in tests test_deep_split
- test_list due to timeout:
(test.test_list.ListTest.test_repr_deep) ... Timeout (0:10:00)!
Thread 0x00000001f33b3080 (most recent call first):
File "/Users/runner/work/sanitizer-experiments/sanitizer-experiments/Lib/unittest/case.py", line 245 in handle
File "/Users/runner/work/sanitizer-experiments/sanitizer-experiments/Lib/unittest/case.py", line 835 in assertRaises
File "/Users/runner/work/sanitizer-experiments/sanitizer-experiments/Lib/test/list_tests.py", line 69 in test_repr_deep
File "/Users/runner/work/sanitizer-experiments/sanitizer-experiments/Lib/unittest/case.py", line 637 in _callTestMethod
File "/Users/runner/work/sanitizer-experiments/sanitizer-experiments/Lib/unittest/case.py", line 691 in run
File "/Users/runner/work/sanitizer-experiments/sanitizer-experiments/Lib/unittest/case.py", line 747 in __call__
File "/Users/runner/work/sanitizer-experiments/sanitizer-experiments/Lib/unittest/suite.py", line 122 in run
File "/Users/runner/work/sanitizer-experiments/sanitizer-experiments/Lib/unittest/suite.py", line 84 in __call__
File "/Users/runner/work/sanitizer-experiments/sanitizer-experiments/Lib/unittest/suite.py", line 122 in run
File "/Users/runner/work/sanitizer-experiments/sanitizer-experiments/Lib/unittest/suite.py", line 84 in __call__
File "/Users/runner/work/sanitizer-experiments/sanitizer-experiments/Lib/unittest/runner.py", line 256 in run
File "/Users/runner/work/sanitizer-experiments/sanitizer-experiments/Lib/test/libregrtest/single.py", line 84 in _run_suite
File "/Users/runner/work/sanitizer-experiments/sanitizer-experiments/Lib/test/libregrtest/single.py", line 42 in run_unittest
File "/Users/runner/work/sanitizer-experiments/sanitizer-experiments/Lib/test/libregrtest/single.py", line 162 in test_func
File "/Users/runner/work/sanitizer-experiments/sanitizer-experiments/Lib/test/libregrtest/single.py", line 118 in regrtest_runner
File "/Users/runner/work/sanitizer-experiments/sanitizer-experiments/Lib/test/libregrtest/single.py", line 165 in _load_run_test
File "/Users/runner/work/sanitizer-experiments/sanitizer-experiments/Lib/test/libregrtest/single.py", line 210 in _runtest_env_changed_exc
File "/Users/runner/work/sanitizer-experiments/sanitizer-experiments/Lib/test/libregrtest/single.py", line 319 in _runtest
File "/Users/runner/work/sanitizer-experiments/sanitizer-experiments/Lib/test/libregrtest/single.py", line 348 in run_single_test
File "/Users/runner/work/sanitizer-experiments/sanitizer-experiments/Lib/test/libregrtest/worker.py", line 99 in worker_process
File "/Users/runner/work/sanitizer-experiments/sanitizer-experiments/Lib/test/libregrtest/worker.py", line 137 in main
File "/Users/runner/work/sanitizer-experiments/sanitizer-experiments/Lib/test/libregrtest/worker.py", line 141 in <module>
File "/Users/runner/work/sanitizer-experiments/sanitizer-experiments/Lib/runpy.py", line 87 in _run_code
File "/Users/runner/work/sanitizer-experiments/sanitizer-experiments/Lib/runpy.py", line 201 in _run_module_as_main
== Tests result: FAILURE ==
CPython versions tested on:
CPython main branch
Operating systems tested on:
macOS
Linked PRs
- gh-150256
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the sanitizer workflow at .github/workflows/cpython.yml and reproduce the failures in test_asyncio/test_streams.py, test_dict, test_embed, test_exception_group, and test_list. Compare the results with linked PR gh-150256; the issue does not define a single requested change, so done would require an agreed fix and passing the affected tests on macOS ARM64 with the reported sanitizer configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- macos, python
- Domain
- operating-systems, testing-qa
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100