]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-137185: Fix `_Py_DumpStack()` async signal safety (gh-137187)
authorSam Gross <colesbury@gmail.com>
Tue, 29 Jul 2025 14:25:32 +0000 (10:25 -0400)
committerGitHub <noreply@github.com>
Tue, 29 Jul 2025 14:25:32 +0000 (14:25 +0000)
commit11a8652e25341e696b06d8dc7a18e8c3ee8059e4
tree69f3dbf38b21559a37c6888585e15bc6b9dcc511
parentd7e12a362a2a4a4b7d52a343ab5940be2cbcc909
gh-137185: Fix `_Py_DumpStack()` async signal safety (gh-137187)

Call backtrace() once when installing the signal handler to ensure that
libgcc is dynamically loaded outside the signal handler.

This fixes a "signal-unsafe call inside of a signal" TSan error from
test_faulthandler.test_enable_fd.
Include/internal/pycore_traceback.h
Misc/NEWS.d/next/Library/2025-07-28-20-48-32.gh-issue-137185.fgI7-B.rst [new file with mode: 0644]
Modules/faulthandler.c
Python/traceback.c