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.1 -> 8.2, rework debug-info-from-env #46229

Closed
wants to merge 1 commit into from

Conversation

dtzWill
Copy link
Member

@dtzWill dtzWill commented Sep 6, 2018

gdb seems to work in my limited testing,
but I can't verify the dwarffs thing works
-- when I tried to check I couldn't get
it working before or after this change.

Comments/thoughts/testing welcome :).

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: gdb

Partial log (click to expand)

shrinking /nix/store/q94j7g9xjnrkv4mzpvic0bh4scjqlqah-gdb-8.2/bin/gdbserver
shrinking /nix/store/q94j7g9xjnrkv4mzpvic0bh4scjqlqah-gdb-8.2/bin/gdb
shrinking /nix/store/q94j7g9xjnrkv4mzpvic0bh4scjqlqah-gdb-8.2/lib/libinproctrace.so
gzipping man pages under /nix/store/q94j7g9xjnrkv4mzpvic0bh4scjqlqah-gdb-8.2/share/man/
strip is /nix/store/h0lbngpv6ln56hjj59i6l77vxq25flbz-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/q94j7g9xjnrkv4mzpvic0bh4scjqlqah-gdb-8.2/lib  /nix/store/q94j7g9xjnrkv4mzpvic0bh4scjqlqah-gdb-8.2/bin
patching script interpreter paths in /nix/store/q94j7g9xjnrkv4mzpvic0bh4scjqlqah-gdb-8.2
/nix/store/q94j7g9xjnrkv4mzpvic0bh4scjqlqah-gdb-8.2/bin/gcore: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/czx8vkrb9jdgjyz8qfksh10vrnqa723l-bash-4.4-p23/bin/bash"
/nix/store/q94j7g9xjnrkv4mzpvic0bh4scjqlqah-gdb-8.2/bin/gdb-add-index: interpreter directive changed from " /bin/sh" to "/nix/store/czx8vkrb9jdgjyz8qfksh10vrnqa723l-bash-4.4-p23/bin/sh"
checking for references to /build in /nix/store/q94j7g9xjnrkv4mzpvic0bh4scjqlqah-gdb-8.2...

@GrahamcOfBorg
Copy link

Failure on x86_64-darwin (full log)

Attempted: gdb

Partial log (click to expand)

extern void store_integer (gdb_byte *addr, int len, enum bfd_endian byte_order,
            ^
2 warnings and 1 error generated.
make[2]: *** [Makefile:1620: aarch64-linux-tdep.o] Error 1
make[2]: Leaving directory '/private/tmp/nix-build-gdb-8.2.drv-0/gdb-8.2/gdb'
make[1]: *** [Makefile:8519: all-gdb] Error 2
make[1]: Leaving directory '/private/tmp/nix-build-gdb-8.2.drv-0/gdb-8.2'
make: *** [Makefile:878: all] Error 2
builder for '/nix/store/q9vhyg9l19jjkps96p20rqszim60mbxx-gdb-8.2.drv' failed with exit code 2
error: build of '/nix/store/q9vhyg9l19jjkps96p20rqszim60mbxx-gdb-8.2.drv' failed

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: gdb

Partial log (click to expand)

shrinking /nix/store/k6j8pasn78ahp5qgacvg6i8g4yl7pqqx-gdb-8.2/bin/gdb
shrinking /nix/store/k6j8pasn78ahp5qgacvg6i8g4yl7pqqx-gdb-8.2/bin/run
gzipping man pages under /nix/store/k6j8pasn78ahp5qgacvg6i8g4yl7pqqx-gdb-8.2/share/man/
strip is /nix/store/y4ymnvgxygpq05h03kyzbj572zmh6zla-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/k6j8pasn78ahp5qgacvg6i8g4yl7pqqx-gdb-8.2/lib  /nix/store/k6j8pasn78ahp5qgacvg6i8g4yl7pqqx-gdb-8.2/bin
patching script interpreter paths in /nix/store/k6j8pasn78ahp5qgacvg6i8g4yl7pqqx-gdb-8.2
/nix/store/k6j8pasn78ahp5qgacvg6i8g4yl7pqqx-gdb-8.2/bin/gdb-add-index: interpreter directive changed from " /bin/sh" to "/nix/store/fqm2x6kiay1q4vg7pqp4wp17bdijlyc3-bash-4.4-p23/bin/sh"
/nix/store/k6j8pasn78ahp5qgacvg6i8g4yl7pqqx-gdb-8.2/bin/gcore: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/fqm2x6kiay1q4vg7pqp4wp17bdijlyc3-bash-4.4-p23/bin/bash"
checking for references to /build in /nix/store/k6j8pasn78ahp5qgacvg6i8g4yl7pqqx-gdb-8.2...
/nix/store/k6j8pasn78ahp5qgacvg6i8g4yl7pqqx-gdb-8.2

@dtzWill
Copy link
Member Author

dtzWill commented Sep 19, 2018

Dunno what's going on with Darwin, but can confirm that this works with debug-from-env using dwarffs!

@GrahamcOfBorg
Copy link

Failure on x86_64-darwin (full log)

Attempted: gdb

Partial log (click to expand)

            ^
2 warnings and 1 error generated.
make[2]: *** [Makefile:1620: aarch64-linux-tdep.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/private/tmp/nix-build-gdb-8.2.drv-0/gdb-8.2/gdb'
make[1]: *** [Makefile:8519: all-gdb] Error 2
make[1]: Leaving directory '/private/tmp/nix-build-gdb-8.2.drv-0/gdb-8.2'
make: *** [Makefile:878: all] Error 2
builder for '/nix/store/4nsznyqc9xddi9mnqhjzhm19hbrg2c6g-gdb-8.2.drv' failed with exit code 2
error: build of '/nix/store/4nsznyqc9xddi9mnqhjzhm19hbrg2c6g-gdb-8.2.drv' failed

@GrahamcOfBorg
Copy link

Timed out, unknown build status on x86_64-linux (full log)

Attempted: gdb

Partial log (click to expand)

cannot build derivation '/nix/store/9qj90vrlwj2bv3qsp965px9maga55540-libkrb5-1.15.2.drv': 6 dependencies couldn't be built
cannot build derivation '/nix/store/2lkkr5nxfiarx9a5qck347xhbwvy3k65-libssh2-1.8.0.drv': 3 dependencies couldn't be built
cannot build derivation '/nix/store/0bdv6i02sawh30a9mxsfnwfpxaghq8af-mpfr-4.0.1.drv': 3 dependencies couldn't be built
cannot build derivation '/nix/store/pc4k164mcz39fy2rafc3dp36i4lidy9y-nghttp2-1.32.0.drv': 6 dependencies couldn't be built
cannot build derivation '/nix/store/46j5s6zasvv4kai04da380h1mfaw74wl-readline-6.3p08.drv': 3 dependencies couldn't be built
cannot build derivation '/nix/store/1slb2gph4l90ys3wsy4gx6afzw4rcdm9-curl-7.61.1.drv': 8 dependencies couldn't be built
cannot build derivation '/nix/store/8qy76nv654pwnh2f1acdz324fv9lxm8y-python-2.7.15.drv': 10 dependencies couldn't be built
cannot build derivation '/nix/store/8nmldqwcdhksd0rl1q76r64aljzpx642-gdb-8.2.tar.xz.drv': 4 dependencies couldn't be built
cannot build derivation '/nix/store/8cj0n8cxixp3l27j2sql69kgwdr2qcax-gdb-8.2.drv': 13 dependencies couldn't be built
error: build of '/nix/store/8cj0n8cxixp3l27j2sql69kgwdr2qcax-gdb-8.2.drv' failed

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: gdb

Partial log (click to expand)

shrinking /nix/store/606vc1xq330hs334q7y46if4fc27vcx7-gdb-8.2/bin/gdb
shrinking /nix/store/606vc1xq330hs334q7y46if4fc27vcx7-gdb-8.2/bin/run
gzipping man pages under /nix/store/606vc1xq330hs334q7y46if4fc27vcx7-gdb-8.2/share/man/
strip is /nix/store/qawdf6chgqz2cfrysjn5r4kdvhq7s4nx-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/606vc1xq330hs334q7y46if4fc27vcx7-gdb-8.2/lib  /nix/store/606vc1xq330hs334q7y46if4fc27vcx7-gdb-8.2/bin
patching script interpreter paths in /nix/store/606vc1xq330hs334q7y46if4fc27vcx7-gdb-8.2
/nix/store/606vc1xq330hs334q7y46if4fc27vcx7-gdb-8.2/bin/gdb-add-index: interpreter directive changed from " /bin/sh" to "/nix/store/jwdhdf9lfccyiksdk95rmyiqxcmfpm98-bash-4.4-p23/bin/sh"
/nix/store/606vc1xq330hs334q7y46if4fc27vcx7-gdb-8.2/bin/gcore: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/jwdhdf9lfccyiksdk95rmyiqxcmfpm98-bash-4.4-p23/bin/bash"
checking for references to /build in /nix/store/606vc1xq330hs334q7y46if4fc27vcx7-gdb-8.2...
/nix/store/606vc1xq330hs334q7y46if4fc27vcx7-gdb-8.2

@Mic92
Copy link
Member

Mic92 commented Sep 27, 2018

Gdb does not work from nixpkgs on darwin anyway because it is not signed at the moment, which is required for ptrace users.

@xeji xeji mentioned this pull request Oct 9, 2018
9 tasks
@bgamari
Copy link
Contributor

bgamari commented Oct 10, 2018

I can also confirm that GDB 8.2 built with #48113 works well in practice on NixOS.

@dtzWill
Copy link
Member Author

dtzWill commented Oct 10, 2018

I can also confirm that GDB 8.2 built with #48113 works well in practice on NixOS.

Do you know if the two patches are meaningfully different?
(I imagine just independently developed versions of same, but just in case...)

@dtzWill
Copy link
Member Author

dtzWill commented Oct 10, 2018

Related: what's the policy or best practice here, regarding Darwin breakage? I feel bad introducing build breakage but on the other hand it doesn't make sense to stall indefinitely -- but it's unclear right now if that's what's happening :).

Hmm well first step is to at least ping the right folks, thought I did this originally whoops! cc @NixOS/darwin-maintainers .

@LnL7
Copy link
Member

LnL7 commented Oct 10, 2018

@dtzWill Not everybody is as considerate, lots of things get merged even if it breaks the darwin build. And that's arguably fine for things that don't have a large impact or are not particularly useful. On darwin gdb doesn't work out of the box because the binary needs to be codesigned, so it's probably not a big deal.

@copumpkin
Copy link
Member

I'd still be curious to know what's going wrong with it. The ofBorg logs don't seem to load. Can anyone see what's going wrong? Does the other PR not break it?

@LnL7
Copy link
Member

LnL7 commented Oct 11, 2018

gettext format-security errors, I had a quick look but it needs a bit more investigation.

@dtzWill
Copy link
Member Author

dtzWill commented Nov 2, 2018

Beep boop, ping!

@matthewbauer
Copy link
Member

You can disable "format" hardening here to fix it. It's weird that Clang errors but GCC doesn't. It seems like they both should on this. It would be good to get a patch here for GDB to fix these.

@dtzWill
Copy link
Member Author

dtzWill commented Nov 2, 2018

So I was about to do as you suggest, but then I saw this:

hardeningDisable = stdenv.lib.optionals stdenv.isDarwin [ "format" ];

.... o_O

@orivej orivej mentioned this pull request Nov 16, 2018
9 tasks
@dtzWill
Copy link
Member Author

dtzWill commented Nov 16, 2018

This hasn't been merged yet?? Haha whoopsy! Closing in favor of new PR optimistically :).

@dtzWill dtzWill closed this Nov 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants