python / python/cpython

test_io failed with ASAN failures (heap-use-after-free) on AMD64 Arch Linux Asan 3.13

Open
#154,175 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

tests topic-IO type-bug
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

AMD64 Arch Linux Asan 3.13: https://buildbot.python.org/#/builders/1464/builds/1125

== CPython 3.13.14+ (heads/3.13:303d0acfcdcc, Jul 19 2026, 12:37:17) [GCC 16.1.1 20260625]
== Linux-7.0.14-arch1-1-x86_64-with-glibc2.43 little-endian
== Python build: release ASAN
== cwd: /buildbot/buildarea/3.13.pablogsal-arch-x86_64.asan/build/build/test_python_worker_1123020æ
== CPU count: 2
== encodings: locale=UTF-8 FS=utf-8
== resources: all,-network,-urlfetch
== sanitizers: address
== ASAN_OPTIONS='detect_leaks=0:allocator_may_return_null=1:handle_segv=0'

(...)

FAIL: test_daemon_threads_shutdown_stderr_deadlock (test.test_io.CMiscIOTest.test_daemon_threads_shutdown_stderr_deadlock)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/buildbot/buildarea/3.13.pablogsal-arch-x86_64.asan/build/Lib/test/test_io.py", line 4755, in test_daemon_threads_shutdown_stderr_deadlock
    self.check_daemon_threads_shutdown_deadlock('stderr')
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/buildbot/buildarea/3.13.pablogsal-arch-x86_64.asan/build/Lib/test/test_io.py", line 4745, in check_daemon_threads_shutdown_deadlock
    self.assertFalse(err.strip('.!'))
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
AssertionError: '=================================================================\n
==1136209==ERROR: AddressSanitizer: heap-use-after-free on address 0x7c9453c52a58 at pc 0x555f594278c6 bp 0x7b64519fe080 sp 0x7b64519fe070\n
READ of size 8 at 0x7c9453c52a58 thread T1\n
' is not false

It seems like the test fails randomly since July 14.

Linked PRs
  • gh-157013
  • gh-157019

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Lib/test/test_io.py, especially check_daemon_threads_shutdown_deadlock and test_daemon_threads_shutdown_stderr_deadlock, then inspect the linked buildbot run and ASAN trace. Review gh-157013 and gh-157019 before investigating further; done means the intermittent ASAN heap-use-after-free no longer causes the test to fail.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.