From 88fee2ced3b9086726c732a27a04605b3c20bf43 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 4 Mar 2026 17:36:32 +0100 Subject: [PATCH] gh-144741: Fix test_frame_pointer_unwind for libpython Fix test_frame_pointer_unwind when Python is built with --enable-shared. Classify also libpython frames as "python". --- .../next/Tests/2026-03-04-17-39-15.gh-issue-144741.0RHhBF.rst | 3 +++ Modules/_testinternalcapi.c | 4 ++++ 2 files changed, 7 insertions(+) create mode 100644 Misc/NEWS.d/next/Tests/2026-03-04-17-39-15.gh-issue-144741.0RHhBF.rst diff --git a/Misc/NEWS.d/next/Tests/2026-03-04-17-39-15.gh-issue-144741.0RHhBF.rst b/Misc/NEWS.d/next/Tests/2026-03-04-17-39-15.gh-issue-144741.0RHhBF.rst new file mode 100644 index 00000000000000..be3092f1c2592a --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2026-03-04-17-39-15.gh-issue-144741.0RHhBF.rst @@ -0,0 +1,3 @@ +Fix ``test_frame_pointer_unwind`` when Python is built with +:option:`--enable-shared`. Classify also libpython frames as ``"python"``. +Patch by Victor Stinner. diff --git a/Modules/_testinternalcapi.c b/Modules/_testinternalcapi.c index 22cfa3f58a9d83..998bf5e592e8ee 100644 --- a/Modules/_testinternalcapi.c +++ b/Modules/_testinternalcapi.c @@ -196,6 +196,10 @@ classify_address(uintptr_t addr, int jit_enabled, PyInterpreterState *interp) if (strncmp(base, "python", 6) == 0) { return "python"; } + // Match "libpython3.15.so.1.0" + if (strncmp(base, "libpython", 9) == 0) { + return "python"; + } return "other"; } #ifdef _Py_JIT