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

include gdb alongside modern gcc versions #62

Open
alchzh opened this issue Oct 24, 2023 · 4 comments
Open

include gdb alongside modern gcc versions #62

alchzh opened this issue Oct 24, 2023 · 4 comments
Milestone

Comments

@alchzh
Copy link

alchzh commented Oct 24, 2023

The ancient version of gdb (7.6.1) on the cobalts and NPX isn't able to read the debug info in the py3-v4.3 preventing debugging. This is at least partially because gcc 11 switched the default DWARF version from 4 to 5, which is only supported in gdb 8 and later.

image

In my case, recompiling the python extension with -gdwarf-4 did NOT fix the issues. Including a gdb version >=8 alongside gcc 13 should work.

@alchzh
Copy link
Author

alchzh commented Oct 24, 2023

@nega0 dumps of gdb 7.6 and 13.2 output

gdb_output.txt
gdb_13_output.txt

The cext binary should have DWARF version 4

(csky_env) azhang@cobalt04 ~/csky $ readelf --debug-dump=info /home/azhang/csky/csky/cext.cpython-311-x86_64-linux-gnu.so | grep "Compilation Unit" -A 2
  Compilation Unit @ offset 0:
   Length:        0x15e904 (32-bit)
   Version:       4

@nega0
Copy link

nega0 commented Oct 24, 2023

oops. hitting the post button helps. can you provide everything gdb spits out, including your gdb command line? (surround it w/ tripple-backticks to get formatted text)

@dsschult
Copy link
Collaborator

RHEL8 comes with gdb 8, so this is a RHEL7 only issue. I see two main solutions:

  1. wait until we install alma8 on the cobalts, and the error will go away
  2. be more future-proof and install gdb, make, etc in cvmfs (stop depending on the OS for anything other than libc)

@alchzh
Copy link
Author

alchzh commented Oct 24, 2023

I'm in favor of option 2, since there seem to be other bugs created by having modern compiler toolchain and old gdb versions, and it's up to the OS to backport patches. For example, stock gdb 8.2 (the version in alma8) fails to load binaries compiled under py3-v4.3 because of this bug:

https://sourceware.org/bugzilla/show_bug.cgi?id=23919
https://wiki.gentoo.org/wiki/Project:Toolchain/Binutils_2.32_upgrade_notes/elfutils_0.175:_unable_to_initialize_decompress_status_for_section_.debug_info
void-linux/void-packages#9839

and I'm not sure if alma8 backports the fix or not (I don't think it does based on the files in https://git.almalinux.org/rpms/gdb/src/branch/c8/SOURCES).

I'm guessing some other incompatibility is making the provided gdb 7 not recognize the DWARF version even with -gdwarf-4.

It makes sense to keep the whole C/C++ toolchain (gcc, make, bison, binutils, autotools, gdb whatever) consistent.

@dsschult dsschult added this to the py3-v4.4.0 milestone Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants