SIGN IN SIGN UP

[3.14] gh-137185: Fix `_Py_DumpStack()` async signal safety (gh-137187) (gh-137206)

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.
(cherry picked from commit 11a8652e25341e696b06d8dc7a18e8c3ee8059e4)

Co-authored-by: Sam Gross <colesbury@gmail.com>
M
Miss Islington (bot) committed
75de39ba1b61636e4a49a457de23de78e7f0a5a1
Parent: 93ac6f3
Committed by GitHub <noreply@github.com> on 10/7/2025, 6:11:46 PM