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

CRASH SIGFPE with glibc 2.39 #6693

Closed
MikeWalrus opened this issue Mar 7, 2024 · 5 comments · Fixed by #6694
Closed

CRASH SIGFPE with glibc 2.39 #6693

MikeWalrus opened this issue Mar 7, 2024 · 5 comments · Fixed by #6694

Comments

@MikeWalrus
Copy link
Contributor

Describe the bug
glibc changes field offsets again in 2.39, which causes SIGFPE in __libc_early_init.
See #5437 #5695.

To Reproduce
Run drrun with any client and program on a linux system with glibc 2.39 (e.g. ArchLinux).

Expected behavior
No crashes with SIGFPE.

Screenshots or Pasted Text
See the previous issue #5437.

Versions

  • What version of DynamoRIO are you using? 9591e25 and 10.0.0
  • Does the latest build from https://github.com/DynamoRIO/dynamorio/releases solve the problem? No
  • What operating system version are you running on? ArchLinux (glibc 2.39)
  • Is your application 32-bit or 64-bit? 64-bit
MikeWalrus added a commit to MikeWalrus/dynamorio that referenced this issue Mar 7, 2024
Adds a check for glibc 2.39 on x64. x86 values are left unchanged.

Fixes DynamoRIO#6693
@derekbruening
Copy link
Contributor

Xref glibc causing pain in other ways: #5860. One possibility is to stop supporting glibc in clients and DR's own "normal" binaries: require clients to use musl or somesuch, and switch to musl in DR's binaries, since the glibc owners are making it quite difficult to keep using it in our project not just for the private loader but also for "normal" uses such as in the drrun launcher where we want backward compatibility without having to build on an old toolchain.

@MikeWalrus
Copy link
Contributor Author

In my opinion, DynamoRIO's capability of being able to work with system glibc reasonably well is a great advantage over pin. I think we should just keep an eye on new versions of glibc and fix broken fields, unless this becomes too unmanageable of course. :)

@derekbruening
Copy link
Contributor

In my opinion, DynamoRIO's capability of being able to work with system glibc reasonably well is a great advantage over pin. I think we should just keep an eye on new versions of glibc and fix broken fields, unless this becomes too unmanageable of course. :)

This is useful feedback. Could you elaborate: are there features missing from musl you want to use in your clients, or you want to avoid having to build/link your clients in non-standard ways?

@derekbruening derekbruening assigned xdje42 and unassigned xdje42 Mar 10, 2024
derekbruening pushed a commit that referenced this issue Mar 11, 2024
Adds a check for glibc 2.39 on x64. x86 values are left unchanged.

Fixes #6693
@MikeWalrus
Copy link
Contributor Author

are there features missing from musl you want to use in your clients, or you want to avoid having to build/link your clients in non-standard ways?

I'd say it's more of the latter, although I can imagine someone would prefer glibc because of its performance or some third-party libraries require glibc.

@jdw1023
Copy link

jdw1023 commented May 7, 2024

Hi, I am running into the SIGFPE crash on Arch Linux using glibc 2.39-4.
After some investigation, it looks like the offset changed in the glibc 2.39(-4?) on Arch Linux. I am not sure why the offset is different (the offset in d21d6e3 looks like the right offset with using glibc 2.39-0ubuntu8.1_amd64 on ubuntu).

Left Arch Linux glibc 2.39-4, Right Ubuntu glibc 2.39-0ubuntu8.1_amd64
image

I got drrun to work after patching offset to the following. Just want to leave this comment incase anyone ran into the same issue.

+0x02d8 _dl_tls_static_size  : size_t
+0x02e0 _dl_tls_static_align : size_t

glibc version info:

% /usr/lib/libc.so.6
GNU C Library (GNU libc) stable release version 2.39.
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 13.2.1 20240417.
libc ABIs: UNIQUE IFUNC ABSOLUTE
Minimum supported kernel: 4.4.0
For bug reporting instructions, please see:
<https://gitlab.archlinux.org/archlinux/packaging/packages/glibc/-/issues>.
% pacman -Q glibc
glibc 2.39-4

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

Successfully merging a pull request may close this issue.

4 participants