Discussion:
[Bug gdb/20266] New: Broken gdb with Apple's macOS 10.12 Sierra Beta - SIGTRAP
nikolaikrill at gmail dot com
2016-06-16 22:42:06 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=20266

Bug ID: 20266
Summary: Broken gdb with Apple's macOS 10.12 Sierra Beta -
SIGTRAP
Product: gdb
Version: 7.11.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: gdb
Assignee: unassigned at sourceware dot org
Reporter: nikolaikrill at gmail dot com
Target Milestone: ---

Just tried out Apple's new beta of the next version of OS X, namely macOS 10.12
Sierra. A freshly compiled gdb 7.11.1 is not capable of debugging anything I've
tried yet, it always fails with:

During startup program terminated with signal SIGTRAP, Trace/breakpoint trap.

This is an issue specific to macOS 10.12 beta, the same gdb works fine under
Mac OS X 10.11. I'm not sure if this is an Apple issue or one with gdb, just
thought I should let you guys know. Also, lldb is working fine on macOS 10.12,
so there's that.


(gdb) run
Starting program: /Users/k/Desktop/gdb-test/test_program
During startup program terminated with signal SIGTRAP, Trace/breakpoint trap.
(gdb)
--
You are receiving this mail because:
You are on the CC list for the bug.
antonio.luis.sarmento at gmail dot com
2016-09-23 13:01:53 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=20266

antonio.luis.sarmento at gmail dot com changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@gmail
| |.com

--- Comment #1 from antonio.luis.sarmento at gmail dot com ---
So, the official, final release of Sierra is here and I'm here (alongside
another user) to confirm this problem exists and should be treated *ASAP!

Link to my recently-created thread on Reddit:
https://www.reddit.com/r/learnprogramming/comments/53zmls/gdb_itself_is_crashing_and_i_cant_seem_to_find_a/d7xs95g?context=3
--
You are receiving this mail because:
You are on the CC list for the bug.
palves at redhat dot com
2016-09-23 13:45:03 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=20266

Pedro Alves <palves at redhat dot com> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |palves at redhat dot com

--- Comment #2 from Pedro Alves <palves at redhat dot com> ---
Unfortunately, I don't think that any active maintainer uses macOS routinely.
So this likely will only get fixed when someone contributes a fix or
investigates what the problem is.
--
You are receiving this mail because:
You are on the CC list for the bug.
palves at redhat dot com
2016-09-23 19:19:32 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=20266

--- Comment #3 from Pedro Alves <palves at redhat dot com> ---
Note that "During startup program terminated..." indicates that it's the shell
that died. GDB starts the program like "sh -c '$program $arg1 $arg2'".

Usually, on Unix systems, gdb will see one SIGTRAP that indicates that the
shell execed the final program, and so gdb is now actually debugging the
program.

Maybe the problems is that now on macOS gdb needs to expect two traps.

See the START_INFERIOR_TRAPS_EXPECTED define in gdb's sources. Try bumping it.

But first try the "set startup-with-shell off" command.
--
You are receiving this mail because:
You are on the CC list for the bug.
nikolaikrill at gmail dot com
2016-10-06 18:32:38 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=20266

--- Comment #4 from nikolaikrill at gmail dot com ---
(In reply to Pedro Alves from comment #3)
Post by palves at redhat dot com
Note that "During startup program terminated..." indicates that it's the
shell that died. GDB starts the program like "sh -c '$program $arg1 $arg2'".
Usually, on Unix systems, gdb will see one SIGTRAP that indicates that the
shell execed the final program, and so gdb is now actually debugging the
program.
Maybe the problems is that now on macOS gdb needs to expect two traps.
See the START_INFERIOR_TRAPS_EXPECTED define in gdb's sources. Try bumping
it.
But first try the "set startup-with-shell off" command.
Thanks for your input, Pedro. I've tried both of your suggestions, but the
problem still persists.

What's strange is that the problem was fixed when I tried using gdb in Apple's
later betas of Sierra, but then the issue reappeared in the official public
release. Now, though, the error message has changed to the following:

During startup program terminated with signal SIG113, Real-time event 113.

I've also verified that the problem exists on macOS 10.12.1 Beta 3 (Build
16B2338c). The issue appears to be affecting everybody using gdb on Sierra, and
threads on the topic have started appearing on Stack Overflow and other forums,
but nobody seems to have solution yet.
--
You are receiving this mail because:
You are on the CC list for the bug.
palves at redhat dot com
2016-10-14 16:12:47 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=20266

--- Comment #5 from Pedro Alves <palves at redhat dot com> ---
Seems like someone found a workaround:
https://sourceware.org/ml/gdb/2016-10/msg00009.html
--
You are receiving this mail because:
You are on the CC list for the bug.
josh at joshmatthews dot net
2016-10-30 01:39:49 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=20266

Josh Matthews <josh at joshmatthews dot net> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |josh at joshmatthews dot net
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2016-11-01 03:40:40 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=20266

Tom Tromey <tromey at sourceware dot org> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |tromey at sourceware dot org

--- Comment #6 from Tom Tromey <tromey at sourceware dot org> ---
This seems to hold the answer:

https://sourceware.org/ml/gdb/2016-10/msg00062.html
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2016-11-11 17:13:29 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=20266

--- Comment #7 from Tom Tromey <tromey at sourceware dot org> ---
A partial fix went in:
https://sourceware.org/ml/gdb/2016-11/msg00011.html

But apparently it still needs "set startup-with-shell off"
--
You are receiving this mail because:
You are on the CC list for the bug.
sourceware at sd dot shawnduncan.org
2016-12-10 13:34:19 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=20266

Shawn Duncan <sourceware at sd dot shawnduncan.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |sourceware at sd dot shawnduncan.o
| |rg
--
You are receiving this mail because:
You are on the CC list for the bug.
simon at pushface dot org
2016-12-25 12:16:58 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=20266

Simon Wright <simon at pushface dot org> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |simon at pushface dot org
--
You are receiving this mail because:
You are on the CC list for the bug.
art29577 at gmail dot com
2018-02-09 18:09:22 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=20266

art29577 at gmail dot com changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |art29577 at gmail dot com

--- Comment #8 from art29577 at gmail dot com ---
This fix doesn't work for me on 10.13.3, I get exact same error message with
gdb 8.1..
--
You are receiving this mail because:
You are on the CC list for the bug.
art29577 at gmail dot com
2018-02-09 19:38:37 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=20266

--- Comment #9 from art29577 at gmail dot com ---
Created attachment 10799
--> https://sourceware.org/bugzilla/attachment.cgi?id=10799&action=edit
my terminal session leading up to an error

See more details in the attachment
--
You are receiving this mail because:
You are on the CC list for the bug.
xdavidliu at gmail dot com
2018-03-13 19:12:33 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=20266

xdavidliu at gmail dot com changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |xdavidliu at gmail dot com

--- Comment #10 from xdavidliu at gmail dot com ---
art29577 for high sierra this error actually only occurs for 8.1. If you
downgrade to 8.0.1 using brew, this issue goes away. Assuming codesigning is
done correctly (which is a whole nother unrelated can of worms, the only hiccup
in 8.0.1 would be a warning about dyld version, but gdb 8.0.1 works correctly).

whatever re-introduced the sig/breakpoint trap that occurred in your terminal
output happened between 8.0.1 and 8.1, and should be filed as a new bug, not a
continuation of this one from 2016.
--
You are receiving this mail because:
You are on the CC list for the bug.
xdavidliu at gmail dot com
2018-03-13 19:34:45 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=20266

--- Comment #11 from xdavidliu at gmail dot com ---
by the way, to downgrade from 8.1 to 8.0.1, see the answer to this question:
https://stackoverflow.com/questions/49001329/gdb-doesnt-work-on-macos-high-sierra-10-13-3#comment85498442_49001329

The fact that the problem seen in art29577 's terminal session goes away after
downgrading to 8.0.1 suggests to me that this is a newer problem, introduced
sometime between 8.0.1 and 8.1, *not* the one originally in this thread, which
goes back to 6/2016.

I have filed a new bug report at bug # 22960.
--
You are receiving this mail because:
You are on the CC list for the bug.
m.gh0stzer0 at gmail dot com
2018-06-24 15:33:54 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=20266

m.gh0stzer0 at gmail dot com changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |m.gh0stzer0 at gmail dot com

--- Comment #12 from m.gh0stzer0 at gmail dot com ---
Unable to find Mach task port for process-id 37095: (os/kern) failure (0x5).
(please check gdb is codesigned - see taskgated(8))
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-06-27 22:25:10 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=20266

Tom Tromey <tromey at sourceware dot org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2018-06-27
Ever confirmed|0 |1

--- Comment #13 from Tom Tromey <tromey at sourceware dot org> ---
Neither 8.0.1 nor git master work for me on macOS 10.13.5.
--
You are receiving this mail because:
You are on the CC list for the bug.
m.gh0stzer0 at gmail dot com
2018-06-28 01:22:19 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=20266

m.gh0stzer0 at gmail dot com changed:

What |Removed |Added
----------------------------------------------------------------------------
CC|m.gh0stzer0 at gmail dot com |
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-07-09 10:49:17 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=20266

Tom Tromey <tromey at sourceware dot org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Target| |*-*-darwin*
--
You are receiving this mail because:
You are on the CC list for the bug.
malaperle at gmail dot com
2018-09-06 20:36:00 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=20266

Marc-Andre Laperle <malaperle at gmail dot com> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |malaperle at gmail dot com

--- Comment #14 from Marc-Andre Laperle <malaperle at gmail dot com> ---
(In reply to Tom Tromey from comment #13)
Post by tromey at sourceware dot org
Neither 8.0.1 nor git master work for me on macOS 10.13.5.
Strange, 8.0.1 is working for me on macOS 10.13.6. But not master. This was
using "set startup-with-shell off" and signing with codesign.
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-09-07 02:27:23 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=20266

--- Comment #15 from Tom Tromey <tromey at sourceware dot org> ---
I don't remember the current state of this bug (for me - since experiences
seem to differ unfortunately); but you may be interested in this series:
https://sourceware.org/ml/gdb-patches/2018-08/msg00518.html
Not in yet but it seemed promising.
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-09-19 21:30:58 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=20266

Tom Tromey <tromey at sourceware dot org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |DUPLICATE
Target Milestone|--- |8.3

--- Comment #16 from Tom Tromey <tromey at sourceware dot org> ---
I think this is fixed now, so I am going to close it as a dup
of bug 23364. startup-with-shell is automatically disabled
on master, and that bug will be used to make the shell situation
a bit better.

Feel free to open if the problem persists with git master.

*** This bug has been marked as a duplicate of bug 23364 ***
--
You are receiving this mail because:
You are on the CC list for the bug.
Loading...