Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gdb 8.1 breakpoint trap in High Sierra 10.13.3 #25172

Closed
6 tasks done
xdavidliu opened this issue Mar 13, 2018 · 3 comments
Closed
6 tasks done

gdb 8.1 breakpoint trap in High Sierra 10.13.3 #25172

xdavidliu opened this issue Mar 13, 2018 · 3 comments

Comments

@xdavidliu
Copy link

xdavidliu commented Mar 13, 2018

  • are reporting a bug others will be able to reproduce and not asking a question. If you're not sure or want to ask a question do so on our Discourse: https://discourse.brew.sh
  • have a problem with brew install (or upgrade, reinstall) a single, official formula (not cask)? If it's a general brew problem please file this issue at Homebrew/brew: https://github.com/Homebrew/brew/issues/new. If it's a brew cask problem please file this issue at https://github.com/caskroom/homebrew-cask/issues/new. If it's a tap (e.g. Homebrew/homebrew-php) problem please file this issue at the tap.
  • ran brew update and can still reproduce the problem?
  • ran brew doctor, fixed all issues and can still reproduce the problem?
  • ran brew gist-logs <formula> (where <formula> is the name of the formula that failed) and included the output link?
$ brew gist-logs gdb
Error: No logs.
  • if brew gist-logs didn't work: ran brew config and brew doctor and included their output with your issue?
$ brew doctor
Your system is ready to brew.

$ brew config
HOMEBREW_VERSION: 1.5.10
ORIGIN: https://github.com/Homebrew/brew
HEAD: 04efbadb9ef155c5921a03bf5f5d9052cd378c21
Last commit: 3 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: f344780cad6dd0fd1eb8e1de486c0921e5b7a5c9
Core tap last commit: 8 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_RUBY_WARNINGS: -W0
CPU: quad-core 64-bit broadwell
Homebrew Ruby: 2.3.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
Clang: 9.0 build 900
Git: 2.14.3 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 7.54.0 => /usr/bin/curl
Perl: /usr/bin/perl
Python: /usr/local/opt/python/libexec/bin/python => /usr/local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/bin/python3.6
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
Java: N/A
macOS: 10.13.3-x86_64
Xcode: N/A
CLT: 9.2.0.0.1.1510905681
X11: 2.7.11 => /opt/X11

To help us debug your issue please explain:

  • What you were trying to do (and why)
    Run gdb 8.1 debugger on a simple hello world C program.
  • What happened (include command output)
(gdb) run
Starting program: ~/Documents/a.out 
[New Thread 0x2803 of process 3168]
[New Thread 0x1803 of process 3168]
During startup program terminated with signal SIGTRAP, Trace/breakpoint trap.
(gdb) info breakpoints
No breakpoints or watchpoints.
  • What you expected to happen
(gdb) run
Starting program: ~/Documents/a.out 
hello world
[Inferior 1 (process 3168) exited normally]
  • Step-by-step reproduction instructions (by running brew install commands)
  1. brew install gdb
  2. echo "set startup-with-shell off" > ~/.gdbinit
  3. create a codesigning certificate named gdb-cert in Keychain Access under Login category, then drag / export into System category.
  4. Set certificate to Always trust, reboot, then codesign -fs gdb-cert $(which gdb).
  5. gcc-7 -g hello.c, where hello.c is
#include <stdio.h>
int main() { printf("hello world\n"); }
  1. gdb a.out, then run.

Note this issue appears to be unrelated to codesigning or mach ports, since by all appearances the codesigning here was done successfully and gdb is not complaining about mach ports, which it would have if the codesigning were not done correctly.

This issue does not occur when using 8.0.1 instead, only with 8.1, although with 8.0.1 there is a warning about dyld version, as discussed in #20047, but everything works correctly. The downgrade to 8.0.1 can be performed using instructions in the answer here.

@fxcoudert
Copy link
Member

Changes between 8.0.1 and 8.1 on the Homebrew side have been minimal, so this is likely a problem with GDB itself rather than Homebrew's packaging… have you reported it to the GDB bugzilla?

@xdavidliu
Copy link
Author

sure, I just filed at https://sourceware.org/bugzilla/show_bug.cgi?id=22960

@fxcoudert
Copy link
Member

Great! Let us know if it turns out that it's due to our build system (but I wouldn't expect so)

@Homebrew Homebrew locked and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants