]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-104736: Fix test_gdb tests on ppc64le with clang (#109360)
authorVictor Stinner <vstinner@python.org>
Wed, 13 Sep 2023 04:24:32 +0000 (06:24 +0200)
committerGitHub <noreply@github.com>
Wed, 13 Sep 2023 04:24:32 +0000 (04:24 +0000)
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.

Lib/test/test_gdb.py
Misc/NEWS.d/next/Tests/2023-09-13-05-58-09.gh-issue-104736.lA25Fu.rst [new file with mode: 0644]

index ca50574e46660d347961c3d63952e7a8d4396e2b..914ef942feab12d45b9419b944c7a5af7f581e5b 100644 (file)
@@ -246,6 +246,14 @@ class DebuggerTests(unittest.TestCase):
             # gh-91960: On Python built with "clang -Og", gdb gets
             # "frame=<optimized out>" 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 (file)
index 0000000..85c370f
--- /dev/null
@@ -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.