From 7a748e5fe7d23a6282a7190dde28a8780dbb6493 Mon Sep 17 00:00:00 2001 From: Pablo Galindo Date: Fri, 31 Aug 2018 23:04:47 +0100 Subject: [PATCH] bpo-34007: Skip traceback tests if the Program Counter is not available. (GH-9018) Sometimes some versions of the shared libraries that are part of the traceback are compiled in optimised mode and the Program Counter (PC) is not present, not allowing gdb to walk the frames back. When this happens, the Python bindings of gdb raise an exception, making the test impossible to succeed. (cherry picked from commit f2ef51f8bec525b21e52988880c8a029642795ed) Co-authored-by: Pablo Galindo --- Lib/test/test_gdb.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py index d49769e44edfb0a..c45fd45735cdacc 100644 --- a/Lib/test/test_gdb.py +++ b/Lib/test/test_gdb.py @@ -215,6 +215,15 @@ def get_stack_trace(self, source=None, script=None, for line in errlines: if not line: continue + # bpo34007: Sometimes some versions of the shared libraries that + # are part of the traceback are compiled in optimised mode and the + # Program Counter (PC) is not present, not allowing gdb to walk the + # frames back. When this happens, the Python bindings of gdb raise + # an exception, making the test impossible to succeed. + if "PC not saved" in line: + raise unittest.SkipTest("gdb cannot walk the frame object" + " because the Program Counter is" + " not present") if not line.startswith(ignore_patterns): unexpected_errlines.append(line)