SIGFPE in private __libc_early_init in glibc 2.34+
Created by: derchr
Describe the bug This bug may not only affect drcachesim but also drmemory, drcpusim and probably other clients as well.
When I run drcachesim like this: ./drrun -disable_rseq -t drcachesim -offline -- ls
I get a SIGFPE:
[1] 2736 floating point exception (core dumped) ./drrun -disable_rseq -t drcachesim -offline -- ls
To Reproduce Steps to reproduce the behavior:
- Pointer to a minimized application:
ls
should work - Precise command line for running the application.
./drrun -disable_rseq -t drcachesim -offline -- ls
- Exact output or incorrect behavior. See above
Please also answer these questions:
-
What happens when you run without any client? Without any client works (thanks to -disable_rseq)
-
What happens when you run with debug build ("-debug" flag to drrun/drconfig/drinject)? Same behaviour
Expected behavior No crash
Screenshots or Pasted Text
``` Program received signal SIGFPE, Arithmetic exception. 0x00007ffff770eb89 in ?? () (gdb) bt #0 0x00007ffff770eb89 in ?? () #1 0x0000000000800000 in ?? () #2 0xffffffffffffffff in ?? () #3 0x0000000000000007 in ?? () #4 0xabababababababab in ?? () #5 0x00007ffff7ff0810 in ?? () #6 0x00007ffff7e76f77 in privload_os_finalize (privmod=0x7ffdb3ba77d8) at /home/derek/Git/dynamorio/core/unix/loader.c:693 #7 0x00007ffff7d54a7b in privload_load_process (privmod=0x7ffdb3ba77d8) at /home/derek/Git/dynamorio/core/loader_shared.c:818 #8 0x00007ffff7d54265 in privload_load (filename=0x7fffffffafa0 "/usr/lib/libc.so.6", dependent=0x7ffdb3ba7140, client=false) at /home/derek/Git/dynamorio/core/loader_shared.c:683 #9 0x00007ffff7e7700a in privload_locate_and_load (impname=0x7ffff7a2668a "libc.so.6", dependent=0x7ffdb3ba7140, reachable=false) at /home/derek/Git/dynamorio/core/unix/loader.c:710 #10 0x00007ffff7e7681f in privload_process_imports (mod=0x7ffdb3ba7140) at /home/derek/Git/dynamorio/core/unix/loader.c:566 #11 0x00007ffff7d549da in privload_load_process (privmod=0x7ffdb3ba7140) at /home/derek/Git/dynamorio/core/loader_shared.c:811 #12 0x00007ffff7d54265 in privload_load (filename=0x7fffffffb2b0 "/usr/lib/libm.so.6", dependent=0x7ffdb3ba6ab8, client=false) at /home/derek/Git/dynamorio/core/loader_shared.c:683 #13 0x00007ffff7e7700a in privload_locate_and_load (impname=0x7ffff675785c "libm.so.6", dependent=0x7ffdb3ba6ab8, reachable=false) at /home/derek/Git/dynamorio/core/unix/loader.c:710 #14 0x00007ffff7e7681f in privload_process_imports (mod=0x7ffdb3ba6ab8) at /home/derek/Git/dynamorio/core/unix/loader.c:566 #15 0x00007ffff7d549da in privload_load_process (privmod=0x7ffdb3ba6ab8) at /home/derek/Git/dynamorio/core/loader_shared.c:811 #16 0x00007ffff7d54265 in privload_load (filename=0x7fffffffb5c0 "/usr/lib/libstdc++.so.6", dependent=0x7ffdb3ba5478, client=false) at /home/derek/Git/dynamorio/core/loader_shared.c:683 #17 0x00007ffff7e7700a in privload_locate_and_load (impname=0x7fffb3bb486a "libstdc++.so.6", dependent=0x7ffdb3ba5478, reachable=false) at /home/derek/Git/dynamorio/core/unix/loader.c:710 #18 0x00007ffff7e7681f in privload_process_imports (mod=0x7ffdb3ba5478) at /home/derek/Git/dynamorio/core/unix/loader.c:566 #19 0x00007ffff7d549da in privload_load_process (privmod=0x7ffdb3ba5478) at /home/derek/Git/dynamorio/core/loader_shared.c:811 #20 0x00007ffff7d54265 in privload_load (filename=0x7fffffffb8d0 "/home/derek/Git/dynamorio/build/ext/lib64/debug/libdrsyms.so", dependent=0x7ffdb3b71fb8, client=true) at /home/derek/Git/dynamorio/core/loader_shared.c:683 #21 0x00007ffff7e7700a in privload_locate_and_load (impname=0x7fffb3b2cfdc "libdrsyms.so", dependent=0x7ffdb3b71fb8, reachable=true) at /home/derek/Git/dynamorio/core/unix/loader.c:710 #22 0x00007ffff7e7681f in privload_process_imports (mod=0x7ffdb3b71fb8) at /home/derek/Git/dynamorio/core/unix/loader.c:566 #23 0x00007ffff7d549da in privload_load_process (privmod=0x7ffdb3b71fb8) at /home/derek/Git/dynamorio/core/loader_shared.c:811 #24 0x00007ffff7d52a9a in privload_process_early_mods () at /home/derek/Git/dynamorio/core/loader_shared.c:139 #25 0x00007ffff7d52c84 in loader_init_epilogue (dcontext=0x7ffdb3ba0080) at /home/derek/Git/dynamorio/core/loader_shared.c:203 #26 0x00007ffff7bc2128 in dynamorio_app_init_part_two_finalize () at /home/derek/Git/dynamorio/core/dynamo.c:670 #27 0x00007ffff7e7a6f4 in privload_early_inject (sp=0x7fffffffdab0, old_libdr_base=0x0, old_libdr_size=140737488345328) at /home/derek/Git/dynamorio/core/unix/loader.c:2154 #28 0x00007ffff7e234c7 in reloaded_xfer () at /home/derek/Git/dynamorio/core/arch/x86/x86.asm:1179 #29 0x0000000000000001 in ?? () #30 0x00007fffffffded5 in ?? () #31 0x0000000000000000 in ?? () ```
Versions
-
What version of DynamoRIO are you using? current master (562e7973) and also 9.0.1
-
Does the latest build from https://github.com/DynamoRIO/dynamorio/releases solve the problem? No
-
What operating system version are you running on? Manjaro Linux (derivative of Arch Linux)
-
Is your application 32-bit or 64-bit? 64bit
Additional context This time, I wasn't able to test glibc 2.33, so it's not clear if this is also related to glibc 2.35.
Logs: log.0.3045.txt ls.0.3045.txt
When I run without -offline another issue occurs. DynamoRIO hangs while waiting on a pipe:
#0 0x00007ffff7694f0b in open64 () from /usr/lib/libc.so.6
#1 0x00005555555b959a in named_pipe_t::open_for_read (this=0x7ffff7f8d0d0)
at /home/derek/Git/dynamorio/clients/drcachesim/common/named_pipe_unix.cpp:145
#2 0x00005555555d574a in ipc_reader_t::init (this=0x7ffff7f8d010)
at /home/derek/Git/dynamorio/clients/drcachesim/reader/ipc_reader.cpp:77
#3 0x00005555555a7805 in analyzer_t::start_reading (this=0x5555557b9820)
at /home/derek/Git/dynamorio/clients/drcachesim/analyzer.cpp:227
#4 0x00005555555a83be in analyzer_t::run (this=0x5555557b9820)
at /home/derek/Git/dynamorio/clients/drcachesim/analyzer.cpp:296
#5 0x00005555555a48d2 in main (argc=12, targv=0x7fffffffd948)
at /home/derek/Git/dynamorio/client
s/drcachesim/launcher.cpp:356
I will eventually also create an issue for this.