This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: test_gdb fails on OSX
Type: behavior Stage: resolved
Components: macOS, Tests Versions: Python 2.7
Status: closed Resolution: duplicate
Dependencies: Superseder: test_gdb failures on os x 10.9.2
View: 21263
Assigned To: Nosy List: Bryce Miller, ned.deily, ronaldoussoren
Priority: normal Keywords:

Created on 2016-01-02 05:50 by Bryce Miller, last changed 2022-04-11 14:58 by admin. This issue is now closed.

File name Uploaded Description Edit
regrtest_test_gdb.log Bryce Miller, 2016-01-02 05:50 verbose output for regrtest test_gdb failures
Messages (4)
msg257326 - (view) Author: Bryce Miller (Bryce Miller) Date: 2016-01-02 05:50
test_gdb fails for me on OSX

Steps I did to duplicate: 
Checked out fresh '2.7' branch from
From the new cypthon dir ran: 
make test
./Lib/test/ -v test_gdb

Attached the full verbose output. 

I am looking at Issue23137 and the output messages look different than mine, so I'm posting this as a separate issue. Perhaps it is duplicate. 

34 tracebacks included in attachment, but below is a sample for reference: 

FAIL: test_NULL_instance_dict (test.test_gdb.PrettyPrintTests)
Ensure that a PyInstanceObject with with a NULL in_dict is handled
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/test/", line 521, in test_NULL_instance_dict
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/test/", line 459, in assertSane
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/test/", line 239, in get_gdb_repr
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/test/", line 224, in get_stack_trace
    self.assertEqual(unexpected_errlines, [])
AssertionError: Lists differ: ['Unable to find Mach task por... != []

First list contains 4 additional elements.
First extra element 0:
Unable to find Mach task port for process-id 53220: (os/kern) failure (0x5).
msg257327 - (view) Author: Bryce Miller (Bryce Miller) Date: 2016-01-02 05:52
Github repo version was 4935c6c381b196334b97aac4e9e4e8fee35b0947
msg257396 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2016-01-03 04:36
As you may know, GNU gcc and gdb have not been included in the standard development tools shipped with Apple as part of Xcode and the Command Line Tools for a number of releases, in favor of llvm/clang and lldb.  So test_gdb is typically automatically skipped on current OS X releases.  That said, if you install gcc and gdb from a third-party and build a current Python with it, it would be good if test_gdb passed.  However, the log file you attached hints that gdb may not be functional, at least with the Homebrew Python you appear to be using (built with Clang); note the'Unable to find Mach task port' message.  Can you verify that the gdb you are using does or does not work with the Python in question, perhaps by trying some of the examples in the Developer's Guide (
msg259760 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2016-02-07 04:02
There is an open earlier issue about test_gdb failures on OS X with Homebrew.  Closing this issue in favor of that one.
Date User Action Args
2022-04-11 14:58:25adminsetgithub: 70180
2016-02-07 04:02:48ned.deilysetstatus: open -> closed
superseder: test_gdb failures on os x 10.9.2
messages: + msg259760

resolution: duplicate
stage: resolved
2016-01-08 17:54:44terry.reedysettitle: test_gdb fails -> test_gdb fails on OSX
2016-01-03 04:36:19ned.deilysetmessages: + msg257396
2016-01-02 06:02:16martin.pantersetnosy: + ronaldoussoren, ned.deily
components: + macOS
2016-01-02 05:52:22Bryce Millersetmessages: + msg257327
2016-01-02 05:51:10Bryce Millersethgrepos: - hgrepo329
2016-01-02 05:50:06Bryce Millercreate