From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Wed, 13 Sep 2023 04:48:44 +0000 (-0700) Subject: [3.11] gh-104736: Fix test_gdb tests on ppc64le with clang (GH-109360) (#109362) X-Git-Tag: v3.11.6~94 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=66c0d0ac8c55be9c973be1189b0e9ffcfdfb35a4;p=thirdparty%2FPython%2Fcpython.git [3.11] gh-104736: Fix test_gdb tests on ppc64le with clang (GH-109360) (#109362) gh-104736: Fix test_gdb tests on ppc64le with clang (GH-109360) Fix test_gdb on Python built with LLVM clang 16 on Linux ppc64le (ex: Fedora 38). Search patterns in gdb "bt" command output to detect when gdb fails to retrieve the traceback. For example, skip a test if "Backtrace stopped: frame did not save the PC" is found. (cherry picked from commit 44d9a71ea246e7c3fb478d9be62c16914be6c545) Co-authored-by: Victor Stinner --- diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py index d1f9a03a41fd..5d042a45587a 100644 --- a/Lib/test/test_gdb.py +++ b/Lib/test/test_gdb.py @@ -246,6 +246,14 @@ class DebuggerTests(unittest.TestCase): # gh-91960: On Python built with "clang -Og", gdb gets # "frame=" for _PyEval_EvalFrameDefault() parameter '(unable to read python frame information)', + # gh-104736: On Python built with "clang -Og" on ppc64le, + # "py-bt" displays a truncated or not traceback, but "where" + # logs this error message: + 'Backtrace stopped: frame did not save the PC', + # gh-104736: When "bt" command displays something like: + # "#1 0x0000000000000000 in ?? ()", the traceback is likely + # truncated or wrong. + ' ?? ()', ): if pattern in out: raise unittest.SkipTest(f"{pattern!r} found in gdb output") diff --git a/Misc/NEWS.d/next/Tests/2023-09-13-05-58-09.gh-issue-104736.lA25Fu.rst b/Misc/NEWS.d/next/Tests/2023-09-13-05-58-09.gh-issue-104736.lA25Fu.rst new file mode 100644 index 000000000000..85c370fc87ac --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2023-09-13-05-58-09.gh-issue-104736.lA25Fu.rst @@ -0,0 +1,4 @@ +Fix test_gdb on Python built with LLVM clang 16 on Linux ppc64le (ex: Fedora +38). Search patterns in gdb "bt" command output to detect when gdb fails to +retrieve the traceback. For example, skip a test if ``Backtrace stopped: frame +did not save the PC`` is found. Patch by Victor Stinner.