Skip to content

Tools don't work with DWARF 5 #77

@OctaveLarose

Description

@OctaveLarose

Trying to build liballocs on Ubuntu 22.04. Pleased to say I can get it quite far; will open a PR for a Dockerfile this week, granted I can make that last step no longer fail:

> make -f ./tools/Makefile.meta /usr/lib/meta`ldd /bin/true | grep 'libc.so.6' | sed -r 's/.*=> (.*) \(.*/\1/' | xargs readlink -f`-meta.so    
tools/Makefile.meta:14: META_BASE is /usr/lib/meta
META_CC is cc
Generating frametypes
mkdir -p /usr/lib/meta/usr/lib/x86_64-linux-gnu/
errs=$( ( /home/octavel/Programs/PhD/git_repos/liballocs_to_run_locally/tools//frametypes /usr/lib/x86_64-linux-gnu/libc.so.6 3>&2 2>&1 1>&3 ) 2>/usr/lib/meta/usr/lib/x86_64-linux-gnu/libc.so.6-frametypes.c ); \
status=$?; echo "$errs" | gzip >/usr/lib/meta/usr/lib/x86_64-linux-gnu/libc.so.6-frametypes.c.log.gz; [ $status -eq 0 ] || (mv /usr/lib/meta/usr/lib/x86_64-linux-gnu/libc.so.6-frametypes.c /usr/lib/meta/usr/lib/x86_64-linux-gnu/libc.so.6-frametypes.c.err; false)
Aborted (core dumped)
make: *** [tools/Makefile.meta:130: /usr/lib/meta/usr/lib/x86_64-linux-gnu/libc.so.6-frametypes.c] Error 1

More specifically, frametypes gives this output:

> ./tools//frametypes /usr/lib/x86_64-linux-gnu/libc.so.6
read build-ID note off: 00000380
name_size: 4
desc_size: 20
Slurped build ID: 89c3cb85f9e55046776471fed05ec441581d1969
Trying: /usr/lib/debug/.build-id/89/c3cb85f9e55046776471fed05ec441581d1969.debug
warning: libdwarf reported mangled frame entries
terminate called after throwing an instance of 'dwarf::lib::Error'
[1]    129105 IOT instruction (core dumped)   /usr/lib/x86_64-linux-gnu/libc.so.6

The build id it's trying to use *should* be correct:

> readelf -n /usr/lib/x86_64-linux-gnu/libc.so.6 | grep -1 build

Displaying notes found in: .note.gnu.build-id
  Owner                Data size        Description
  GNU                  0x00000014       NT_GNU_BUILD_ID (unique build ID bitstring)
    Build ID: 89c3cb85f9e55046776471fed05ec441581d1969

I seem to remember running into an issue related to these scripts/build-IDs (which you debugged, Stephen). IIRC it wasn't finding the right libc file, but really in this case ldd /bin/true | grep 'libc.so.6' | sed -r 's/.*=> (.*) \(.*/\1/' | xargs readlink -f seems to have the right output (/usr/lib/x86_64-linux-gnu/libc.so.6), so this should be a different issue.

It may also very well be a libc version mismatch, since the Ubuntu 18.04 image ends up with glibc 2.27 while Ubuntu 22.04 is working with libc 2.35. If so, that's more annoying to debug.

Can send a Dockerfile for Ubuntu 22.04 that builds up to that point, which may aid in pinpointing the source of this bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions