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 should not have been upgraded past 8.0.1 on recent macOS systems #31424

Closed
robohack opened this issue Aug 24, 2018 · 5 comments
Closed

GDB should not have been upgraded past 8.0.1 on recent macOS systems #31424

robohack opened this issue Aug 24, 2018 · 5 comments
Labels
outdated PR was locked due to age stale No recent activity

Comments

@robohack
Copy link

To help us debug your issue please explain:

  • What you were trying to do (and why)

On a system running macOS 10.13.x I tried to use gdb after running brew upgrade where gdb was upgraded from 8.0.1 to 8.1 (then more recently to 8.1.1)

  • What happened (include command output)

Upgrades of GDB since 8.1 fail to run inferior processes on any recent macOS:

21:24 [3421] $ codesign -vv  /usr/local/Cellar/gdb/8.1.1/bin/gdb
/usr/local/Cellar/gdb/8.1.1/bin/gdb: valid on disk
/usr/local/Cellar/gdb/8.1.1/bin/gdb: satisfies its Designated Requirement
21:24 [3422] $ /usr/local/Cellar/gdb/8.1.1/bin/gdb thello                       
GNU gdb (GDB) 8.1.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin17.7.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from thello...Reading symbols from /Users/gaw/src/thello.dSYM/Contents/Resources/DWARF/thello...done.
done.
(gdb) run
Starting program: /Users/gaw/src/thello 
[New Thread 0x2803 of process 19378]
[New Thread 0x1803 of process 19378]
Warning:
Cannot insert breakpoint -1.
Cannot access memory at address 0xf7ce

Command aborted.
(gdb) quit
A debugging session is active.

        Inferior 1 [process 19378] will be killed.

Quit anyway? (y or n) y
  • What you expected to happen

And here you can see the older release still works well enough to actually start an inferior process:

21:24 [3423] $ /usr/local/Cellar/gdb/8.0.1/bin/gdb thello
GNU gdb (GDB) 8.0.1
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin17.7.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from thello...Reading symbols from /Users/gaw/src/thello.dSYM/Contents/Resources/DWARF/thello...done.
done.
(gdb) run
Starting program: /Users/gaw/src/thello 
[New Thread 0x2603 of process 19382]
warning: unhandled dyld version (15)
Hello, world!
Jackdaws love my big sphinx of quartz
Pack my box with five dozen liquor jugs
The quick brown fox jumps over a lazy dog
The quick brown fox jumps over lazy dogs
This Pangram contains four as, one b, two cs, one d, thirty es, six fs, five gs, seven hs, eleven is, one j, one k, two ls, two ms, eighteen ns, fifteen os, two ps, one q, five rs, twenty-seven ss, eighteen ts, two us, seven vs, eight ws, two xs, three ys, & one z.
[Inferior 1 (process 19382) exited normally]
(gdb) quit
21:25 [3424] $ 
  • What you expected to happen

GDB should have been downgraded back to 8.0.1 when macOS updates made the newer releases stop working. Perhaps 8.0.1 will also stop working entirely with some new macOS release, in which case it should be deprecated and removed (at least for macOS systems where it cannot work).

Please downgrade GDB again (at least for macOS releases where 8.1 and newer are impossibly broken) and then see the following GDB bug reports and don't upgrade GDB again until those GDB bug reports are fixed and closed and the fixes are available in a new release that is properly tested on a current macOS release!

https://sourceware.org/bugzilla/show_bug.cgi?id=22960
https://sourceware.org/bugzilla/show_bug.cgi?id=20266

@indicolite
Copy link

indicolite commented Aug 28, 2018

bingo@bingoplus:~|⇒  brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/9ec9fb27a33698fc7636afce5c1c16787e9ce3f3/Formula/gdb.rb
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 3 taps (phinze/cask, homebrew/core, homebrew/cask).
==> New Formulae
eslint                           go@1.10                          libsignal-protocol-c
geogram                          json11                           luit
==> Updated Formulae
xxxxxxxxxx
==> Deleted Formulae
ghc@8.0

######################################################################## 100.0%
Warning: gdb 8.1.1 is available and more recent than version 8.0.1.
==> Downloading https://homebrew.bintray.com/bottles/gdb-8.0.1.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring gdb--8.0.1.high_sierra.bottle.tar.gz
==> Caveats
gdb requires special privileges to access Mach ports.
You will need to codesign the binary. For instructions, see:

  https://sourceware.org/gdb/wiki/BuildingOnDarwin

On 10.12 (Sierra) or later with SIP, you need to run this:

  echo "set startup-with-shell off" >> ~/.gdbinit
==> Summary
🍺  /usr/local/Cellar/gdb/8.0.1: 53 files, 9.3MB

@DomT4
Copy link
Member

DomT4 commented Aug 28, 2018

GDB should have been downgraded back to 8.0.1 when macOS updates made the newer releases stop working.

Without upstream or user guidance if it builds and the brew test process passes that's about as much time as we have to go digging into every update to every formula to test compatibility. gdb falls into an unhelpful gap where because it needs codesigning we're limited as to how comprehensive the test do block can be.

Please downgrade GDB again (at least for macOS releases where 8.1 and newer are impossibly broken) and then see the following GDB bug reports and don't upgrade GDB again until those GDB bug reports are fixed and closed and the fixes are available in a new release that is properly tested on a current macOS release!

We're not going to do conditional downgrades so we'd need to settle on a version. We're also not prepared to pin a formula on one version indefinitely; there would need to be some kind of reassurance that the formula will be upgradeable again in the not-overly-distant future.

Your last sentence there somewhat concerns me because clearly upstream are having some issues testing with macOS, and I'm not sure quite how you propose we ensure a new release has been "properly tested" on a current macOS release without investing a significant chunk of time into doing so ourselves, which is a burden I'm not willing to impose on myself and/or the rest of the maintainer team. I would appreciate some clarity as to what this proper testing would look like & where it would come from.

@fxcoudert
Copy link
Member

Looking at the above-linked bug reports, it is clear that the problem(s) has (have) not been identified, and that it is not even sure they are specific to 8.1, as other reports this bug for Sierra on an earlier version of gdb.

Like @DomT4, I don't think we want to roll back (which is a huge annoyance for everyone) unless there is a fix coming / timeline for a solution. And it seems we're far from that.

@robohack
Copy link
Author

I'm not sure you guys understand.

GDB-8.1 and GDB-8.1.1 are both entirely useless and CAN NOT WORK AT ALL on macOS (since probably 10.11, maybe even 10.10, and definitely not on 10.12 or 10.13). The fact that they even compile on macOS is a mistake (the builds should have been purposefully broken to prevent this kind of tail-chasing nonsense). It is also pointless to even look at these or any newer release until after the bug reports I referenced are marked as fixed and those fixes are incorporated into a new release. I can't give you any hints about timelines for when GDB might work on macOS again -- I'm not a maintainer. I did note in reading the GDB mailing list archives that there is code available that should include the necessary fixes, but there are disagreements and disillusionment surrounding its copyright assignment, and also at the moment there are apparently no macOS systems available to GDB maintainers. I don't think it's worth adding any additional GDB testing for brew test. It is clear that the new releases do not and can not work and anyone approving changes which would upgrade GDB can be given links to the GDB bugs database to verify that such an upgrade might work.

However it is possible to continue to use GDB-8.0.1 on macOS (to the limited degree that it has always worked on OS X and now macOS).

As I see it this leaves two possible reasonable choices for Homebrew:

  1. downgrade GDB to 8.0.1 and stay there until a new and working release is available (and hope that new macOS releases don't break that one too in the mean time).
  2. remove GDB from Homebrew.

It would be unreasonable to continue to offer a known-to-be-broken and useless GDB to Homebrew users.

I would assume there is some non-empty set of Homebrew users (other than me) who also would like to sometimes use GDB, but of course I have no idea how many users that might be. I do note that it seems common for people to suggest Homebrew as the answer to how to get GDB on macOS. The fact that one well read and well referenced post on StackOverflow gives instructions on how to manually downgrade GDB using Homebrew is also something interesting and relevant to keep in mind (though it is definitely not a real solution to this problem).

I have not had the chance to see if 8.1 or 8.1.1 works on an older OS X -- I no longer have access to any such system, but I suppose it is possible it may work, e.g. on say 10.6.8. If Homebrew supports 10.6.8, and if GDB-8.1.1 works there, then maybe there is some way to continue to offer the newer GDB for such older OS X releases while at the same time sticking to 8.0.1 on newer macOS systems.

@stale
Copy link

stale bot commented Sep 19, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale No recent activity label Sep 19, 2018
@stale stale bot closed this as completed Sep 26, 2018
@lock lock bot added the outdated PR was locked due to age label Oct 26, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Oct 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age stale No recent activity
Projects
None yet
Development

No branches or pull requests

4 participants