From a00392349c8cccdf2fe720fe46e504699f584f02 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 4 Mar 2026 18:29:02 +0100 Subject: [PATCH] gh-144741: Fix test_frame_pointer_unwind for libpython (#145499) 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 000000000000..be3092f1c259 --- /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 22cfa3f58a9d..998bf5e592e8 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 -- 2.47.3