[Python-checkins] [3.6] bpo-34007: Skip traceback tests if the Program Counter is not available. (GH-9022)

Pablo Galindo webhook-mailer at python.org
Fri Sep 7 18:10:32 EDT 2018


https://github.com/python/cpython/commit/963bcc8b71e4ab8c9ee9a91ed1300b6e39219821
commit: 963bcc8b71e4ab8c9ee9a91ed1300b6e39219821
branch: 3.6
author: Pablo Galindo <Pablogsal at gmail.com>
committer: GitHub <noreply at github.com>
date: 2018-09-07T23:10:28+01:00
summary:

[3.6] bpo-34007: Skip traceback tests if the Program Counter is not available. (GH-9022)

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 <Pablogsal at gmail.com>

files:
M Lib/test/test_gdb.py

diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py
index b7554d698c9d..bedec1fb493a 100644
--- a/Lib/test/test_gdb.py
+++ b/Lib/test/test_gdb.py
@@ -212,6 +212,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)
 



More information about the Python-checkins mailing list