memtrace_simple SIGSEGV error

93 views
Skip to first unread message

Alexey Paznikov

unread,
Aug 2, 2024, 9:42:14 AM8/2/24
to DynamoRIO Users

Hello,

 I am encountering an issue while trying to run the memtrace_simple sample on Ubuntu 22.04.  It crashes with a SIGSEGV error. Many other samples from the samples directory are working fine.

 

DynamoRIO information:

* Build: Built from source code

* Version: Tried both release and debug builds – the issue persists.

 

System information:

* Operating System: Ubuntu 22.04.4 LTS (WSL)

* Kernel: Linux 5.15.153.1-microsoft-standard-WSL2

* Architecture: x86-64

 

I have attached the DynamoRIO logs and the memtrace_simple.c file for reference.

 

---------------------------------------------

$ ../../bin64/drrun -debug -loglevel 4 -logdir log4 -c ./libmemtrace_simple.so -- ls

<log dir=log4/ls.724774.00000000>

<Starting application /usr/bin/ls (724774)>

<Initial options = -no_dynamic_options -logdir 'log4' -loglevel 4 -client_lib '/home/ap/opt/dynamorio/build/api/bin/libmemtrace_simple.so;0;' -client_lib64 '/home/ap/opt/dynamorio/build/api/bin/libmemtrace_simple.so;0;' -code_api -stack_size 56K -signal_stack_size 32K -max_elide_jmp 0 -max_elide_call 0 -early_inject -emulate_brk -no_inline_ignored_syscalls -native_exec_default_list '' -no_native_exec_managed_code -no_indcall2direct >

<spurious rep/repne prefix @0x00007fb24ea06540 (f3 0f 1e fa): >

<Paste into GDB to debug DynamoRIO clients:

set confirm off

add-symbol-file '/home/ap/opt/dynamorio/build/api/bin/libmemtrace_simple.so' 0x00007fb20addbaa0

add-symbol-file '/home/ap/opt/dynamorio/build/lib64/debug/libdynamorio.so' 0x00007fb24ee65000

add-symbol-file '/home/ap/opt/dynamorio/build/ext/lib64/debug/libdrutil.so' 0x00007fb20ae206b0

add-symbol-file '/home/ap/opt/dynamorio/build/ext/lib64/debug/libdrmgr.so' 0x00007fb20ae2acb0

add-symbol-file '/home/ap/opt/dynamorio/build/ext/lib64/debug/libdrx.so' 0x00007fb20ae3f4d0

add-symbol-file '/home/ap/opt/dynamorio/build/ext/lib64/debug/libdrreg.so' 0x00007fb20ae54df0

add-symbol-file '/lib/x86_64-linux-gnu/libc.so.6' 0x00007fb24e997700

add-symbol-file '/usr/lib64/ld-linux-x86-64.so.2' 0x00007fb24ed7d090

Data file /home/ap/opt/dynamorio/build/api/bin/memtrace.ls.724774.0000.log created

<Application /usr/bin/ls (724774).  DynamoRIO Sample Client 'memtrace' internal crash at PC 0x00007fb24ea001d3.  Please report this at http://dynamorio.org/issues.  Program aborted.

Received SIGSEGV at pc 0x00007fb24ea001d3 in thread 724774

Base: 0x00007fb24ee17000

Registers:eax=0x0000000000000000 ebx=0x00007fb00aebbaa0 ecx=0x0000000000000000 edx=0x00000000fbad248c

        esi=0x00000000fbad0000 edi=0x00007ffc058a7dd0 esp=0x00007ffc058a7dc8 ebp=0x0000000000000000

        r8 =0x00007fb24eb860c0 r9 =0x00007fb24f1dd9af r10=0x00007fb24f150164 r11=0x0000000000000246

        r12=0x00007ffc058a7dd0 r13=0x00007fb24eb8ba50 r14=0x0000000000000000 r15=0x00007fb00aebbaa0

        eflags=0x0000000000010246

version 10.93.19930, custom build

-no_dynamic_options -logdir 'log4' -loglevel 4 -client_lib '/home/ap/opt/dynamorio/build/api/bin/libmemtrace_simple.so;0;' -client_lib64 '/home/ap/opt/dynamorio/build/api/bin/libmemtrace_simple.so;0;' -code_api -stack_size 56K -signal_stack_size 32K -max_elide_jmp 0 -max_elide_call 0 -early_inject -emulate_brk -no_inline

0x00007fb00ae9e7f0 0x00007fb24f12079b

0x00007fb00ae9e9a0 0x00007fb24f120850

0x00007fb00ae9ea00 0x00007fb24f126cb8

0x00007fb00ae9eab0 0x00007fb24f0df7c9>

 

 

--------------------------------------------

This is gdb session as well. Usually it crashes with SIGILL.

 

dynamorio/build/api/bin$ gdb --args ../../bin64/drrun -msgbox_mask 15 -c ./libinstrcalls.so -- ls

GNU gdb (Ubuntu 12.1-0ubuntu1~22.04.2) 12.1

Copyright (C) 2022 Free Software Foundation, Inc.

License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.

Type "show copying" and "show warranty" for details.

This GDB was configured as "x86_64-linux-gnu".

Type "show configuration" for configuration details.

For bug reporting instructions, please see:

<https://www.gnu.org/software/gdb/bugs/>.

Find the GDB manual and other documentation resources online at:

    <http://www.gnu.org/software/gdb/documentation/>.

 

For help, type "help".

Type "apropos word" to search for commands related to "word"...

Reading symbols from ../../bin64/drrun...

Reading symbols from /home/ap/opt/dynamorio/build/bin64/drrun.debug...

(gdb) set disable-randomization off

(gdb)

(gdb) handle SIGSEGV nostop pass

Signal        Stop      Print   Pass to program Description

SIGSEGV       No        Yes     Yes             Segmentation fault

(gdb) handle SIGBUS nostop pass

Signal        Stop      Print   Pass to program Description

SIGBUS        No        Yes     Yes             Bus error

(gdb) handle SIGILL nostop pass

Signal        Stop      Print   Pass to program Description

SIGILL        No        Yes     Yes             Illegal instruction

(gdb) r

Starting program: /home/ap/opt/dynamorio/build/bin64/drrun -msgbox_mask 15 -c ./libinstrcalls.so -- ls

[Thread debugging using libthread_db enabled]

Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

process 724876 is executing new program: /home/ap/opt/dynamorio/build/lib64/debug/libdynamorio.so

<Starting application /usr/bin/ls (724876)>

<press enter to continue>

 

 

Program received signal SIGILL, Illegal instruction.

<Initial options = -no_dynamic_options -client_lib '/home/ap/opt/dynamorio/build/api/bin/libinstrcalls.so;0;' -client_lib64 '/home/ap/opt/dynamorio/build/api/bin/libinstrcalls.so;0;' -code_api -msgbox_mask 15 -stack_size 56K -signal_stack_size 32K -max_elide_jmp 0 -max_elide_call 0 -early_inject -emulate_brk -no_inline_ignored_syscalls -native_exec_default_list '' -no_native_exec_managed_code -no_indcall2direct >

<press enter to continue>

 

<spurious rep/repne prefix @0x00007f03f4548540 (f3 0f 1e fa): >

<press enter to continue>

bt

<Paste into GDB to debug DynamoRIO clients:

set confirm off

add-symbol-file '/home/ap/opt/dynamorio/build/api/bin/libinstrcalls.so' 0x00007f03b091c4c0

add-symbol-file '/home/ap/opt/dynamorio/build/lib64/debug/libdynamorio.so' 0x00007f03f49a7000

add-symbol-file '/home/ap/opt/dynamorio/build/ext/lib64/debug/libdrsyms.so' 0x00007f03b0965d60

add-symbol-file '/lib/x86_64-linux-gnu/libz.so.1' 0x00007f03f493e280

add-symbol-file '/lib/x86_64-linux-gnu/libc.so.6' 0x00007f03f44d9700

add-symbol-file '/usr/lib64/ld-linux-x86-64.so.2' 0x00007f03f48bf090

add-symbol-file '/home/ap/opt/dynamorio/build/ext/lib64/debug/libdrx.so' 0x00007f03b099f4d0

add-symbol-file '/home/ap/opt/dynamorio/build/ext/lib64/debug/libdrreg.so' 0x00007f03b09b4df0

add-symbol-file '/home/ap/opt/dynamorio/build/ext/lib64/debug/libdrmgr.so' 0x00007f03b09c7cb0

<press enter to continue>

Client instrcalls is running

Data file /home/ap/opt/dynamorio/build/api/bin/instrcalls.ls.724876.0000.log created

<curiosity: rex.w on OPSZ_6_irex10_short4!>

<press enter to continue>

<get_memory_info mismatch! (can happen if os combines entries in /proc/pid/maps)

        os says: 0x00007f03f48b1000-0x00007f03f48bd000 prot=0x00000001

        cache says: 0x00007f03f48b1000-0x00007f03f48bf000 prot=0x00000001

<press enter to continue>

 

 

Program received signal SIGSEGV, Segmentation fault.

<(1+x) Handling our fault in a TRY at 0x00007f03f4c21c86>

<press enter to continue>

 

 

Program received signal SIGSEGV, Segmentation fault.

 

Program received signal SIGBUS, Bus error.

 

Program received signal SIGBUS, Bus error.

 

Program received signal SIGSEGV, Segmentation fault.

 

Program received signal SIGSEGV, Segmentation fault.

instrcalls.ls.724876.0000.log  libcountcalls.so.debug   libinstrace_simple.so.debug      libmemval_simple.so.debug            libsignal.so.debug             memtrace.ls.724736.0000.log

libbbbuf.so                    libdiv.so                libinstrace_x86_binary.so        libmodxfer.so                        libssljack.so                  memtrace.ls.724774.0000.log

libbbbuf.so.debug              libdiv.so.debug          libinstrace_x86_binary.so.debug  libmodxfer.so.debug                  libssljack.so.debug            memtrace.test.719222.0000.log

libbbcount.so                  libempty.so              libinstrace_x86_text.so          libmodxfer_app2lib.so                libstatecmp.so                 memtrace.test.719258.0000.log

libbbcount.so.debug            libempty.so.debug        libinstrace_x86_text.so.debug    libmodxfer_app2lib.so.debug          libstatecmp.so.debug           memtrace.test.719259.0000.log

libbbsize.so                   libhot_bbcount.so        libinstrcalls.so                 libopcode_count.so                   libstl_test.so                 memtrace.test.719340.0000.log

libbbsize.so.debug             libhot_bbcount.so.debug  libinstrcalls.so.debug           libopcode_count.so.debug             libstl_test.so.debug           test

libcallstack.so                libinc2add.so            libmemtrace_simple.so            libopcodes.so                        libsyscall.so                  test.c

libcallstack.so.debug          libinc2add.so.debug      libmemtrace_simple.so.debug      libopcodes.so.debug                  libsyscall.so.debug            tracedump

libcbr.so                      libinline.so             libmemtrace_x86_binary.so        libprefetch.so                       libwrap.so                     tracedump.debug

libcbr.so.debug                libinline.so.debug       libmemtrace_x86_binary.so.debug  libprefetch.so.debug                 libwrap.so.debug

libcbrtrace.so                 libinscount.so           libmemtrace_x86_text.so          librace_detector_simulator.so        log2

libcbrtrace.so.debug           libinscount.so.debug     libmemtrace_x86_text.so.debug    librace_detector_simulator.so.debug  log4

libcountcalls.so               libinstrace_simple.so    libmemval_simple.so              libsignal.so                         memtrace.echo.718078.0000.log

<Stopping application /usr/bin/ls (724876)>

<press enter to continue>

 

[Inferior 1 (process 724876) exited normally]

log.0.724774.html
ls.0.724774.html
ls.0.724736.html
log.0.724736.html

Derek Bruening

unread,
Aug 5, 2024, 12:23:51 PM8/5/24
to Alexey Paznikov, DynamoRIO Users
A callstack would help.  The SIGSEGV is inside the private libc copy?  So it is probably a variant of https://github.com/DynamoRIO/dynamorio/issues/5437?  If you could get a callstack that would help to understand: it's after the private libc constructors are called so it's some delayed issue?  What version of glibc?

--
You received this message because you are subscribed to the Google Groups "DynamoRIO Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dynamorio-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dynamorio-users/441c4538-6222-451d-b637-14476d9f2686n%40googlegroups.com.

Alexey Paznikov

unread,
Aug 7, 2024, 12:56:19 AM8/7/24
to DynamoRIO Users
Thanks for the response! It's odd that gdb isn't showing a stack trace. I've tried this on two different machines with the same result. Any ideas on what might be causing this?


============= MACHINE 1 (Ubuntu 22.04, glibc 2.35) =============

$ gdb --args ../../bin64/drrun -c ./libmemtrace_simple.so -- ls

GNU gdb (Ubuntu 12.1-0ubuntu1~22.04.2) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ../../bin64/drrun...
Reading symbols from /home/ap/opt/dynamorio/build-debug/bin64/drrun.debug...

(gdb) set disable-randomization off
(gdb) handle SIGSEGV nostop pass
Signal        Stop      Print   Pass to program Description
SIGSEGV       No        Yes     Yes             Segmentation fault
(gdb) handle SIGILL nostop pass
Signal        Stop      Print   Pass to program Description
SIGILL        No        Yes     Yes             Illegal instruction
(gdb) r
Starting program: /home/ap/opt/dynamorio/build-debug/bin64/drrun -c ./libmemtrace_simple.so -- ls

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
process 24744 is executing new program: /home/ap/opt/dynamorio/build-debug/lib64/debug/libdynamorio.so
<Starting application /usr/bin/ls (24744)>


Program received signal SIGILL, Illegal instruction.
<Initial options = -no_dynamic_options -client_lib '/home/ap/opt/dynamorio/build-debug/api/bin/libmemtrace_simple.so;0;' -client_lib64 '/home/ap/opt/dynamorio/build-debug/api/bin/libmemtrace_simple.so;0;' -code_api -stack_size 56K -signal_stack_size 32K -max_elide_jmp 0 -max_elide_call 0 -early_inject -emulate_brk -no_inline_ignored_syscalls -native_exec_default_list '' -no_native_exec_managed_code -no_indcall2direct >
<spurious rep/repne prefix @0x00007f38944d9540 (f3 0f 1e fa): >

<Paste into GDB to debug DynamoRIO clients:
set confirm off
add-symbol-file '/home/ap/opt/dynamorio/build-debug/api/bin/libmemtrace_simple.so' 0x00007f38508aeaa0
add-symbol-file '/home/ap/opt/dynamorio/build-debug/lib64/debug/libdynamorio.so' 0x00007f3894938000
add-symbol-file '/home/ap/opt/dynamorio/build-debug/ext/lib64/debug/libdrutil.so' 0x00007f38508f36b0
add-symbol-file '/home/ap/opt/dynamorio/build-debug/ext/lib64/debug/libdrmgr.so' 0x00007f38508fdcb0
add-symbol-file '/home/ap/opt/dynamorio/build-debug/ext/lib64/debug/libdrx.so' 0x00007f38509124d0
add-symbol-file '/home/ap/opt/dynamorio/build-debug/ext/lib64/debug/libdrreg.so' 0x00007f3850927df0
add-symbol-file '/lib/x86_64-linux-gnu/libc.so.6' 0x00007f389446a700
add-symbol-file '/usr/lib64/ld-linux-x86-64.so.2' 0x00007f3894850090
>
Data file /home/ap/opt/dynamorio/build-debug/api/bin/memtrace.ls.24744.0000.log created


Program received signal SIGSEGV, Segmentation fault.
<Application /usr/bin/ls (24744).  DynamoRIO Sample Client 'memtrace' internal crash at PC 0x00007f38944d31d3.  Please report this at http://dynamorio.org/issues.  Program aborted.
Received SIGSEGV at pc 0x00007f38944d31d3 in thread 24744
Base: 0x00007f38948ea000
Registers:eax=0x0000000000000000 ebx=0x00007f365098eaa0 ecx=0x0000000000000000 edx=0x00000000fbad248c
        esi=0x00000000fbad0000 edi=0x00007ffce45edc40 esp=0x00007ffce45edc38 ebp=0x0000000000000000
        r8 =0x00007f38946590c0 r9 =0x00007ffce45ed480 r10=0x00007f3894c23164 r11=0x0000000000000246
        r12=0x00007ffce45edc40 r13=0x00007f389465ea50 r14=0x0000000000000000 r15=0x00007f365098eaa0

        eflags=0x0000000000010246
version 10.93.19930, custom build
-no_dynamic_options -client_lib '/home/ap/opt/dynamorio/build-debug/api/bin/libmemtrace_simple.so;0;' -client_lib64 '/home/ap/opt/dynamorio/build-debug/api/bin/libmemtrace_simple.so;0;' -code_api -stack_size 56K -signal_stack_size 32K -max_elide_jmp 0 -max_elide_call 0 -early_inject -emulate_brk -no_inline_ignored_syscal
0x00007f36509717f0 0x00007f3894bf379b
0x00007f36509719a0 0x00007f3894bf3850
0x00007f3650971a00 0x00007f3894bf9cb8
0x00007f3650971ab0 0x00007f3894bb27c9>
[Inferior 1 (process 24744) exited with code 0377]
(gdb) bt
No stack.



============= MACHINE 2 (Ubuntu 24.04 LTS, glibc 2.39) =============

$ gdb --args ../../bin64/drrun -c ./libmemtrace_simple.so -- ls
GNU gdb (Ubuntu 15.0.50.20240403-0ubuntu1) 15.0.50.20240403-git
Copyright (C) 2024 Free Software Foundation, Inc.

License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ../../bin64/drrun...
Reading symbols from /home/alexey/opt/dynamorio/build/bin64/drrun.debug...

(gdb) set disable-randomization off
(gdb) handle SIGSEGV nostop pass
Signal        Stop      Print   Pass to program Description
SIGSEGV       No        Yes     Yes             Segmentation fault
(gdb) handle SIGBUS nostop pass
Signal        Stop      Print   Pass to program Description
SIGBUS        No        Yes     Yes             Bus error
(gdb) handle SIGILL nostop pass
Signal        Stop      Print   Pass to program Description
SIGILL        No        Yes     Yes             Illegal instruction
(gdb) r
Starting program: /home/alexey/opt/dynamorio/build/bin64/drrun -c ./libmemtrace_simple.so -- ls

This GDB supports auto-downloading debuginfo from the following URLs:
  <https://debuginfod.ubuntu.com>
Enable debuginfod for this session? (y or [n]) y
Debuginfod has been enabled.
To make this setting permanent, add 'set debuginfod enabled on' to .gdbinit.

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
process 696439 is executing new program: /home/alexey/opt/dynamorio/build/lib64/release/libdynamorio.so


Program received signal SIGILL, Illegal instruction.

Program received signal SIGSEGV, Segmentation fault.
<Application /usr/bin/ls (696439).  DynamoRIO internal crash at PC 0x00007fd53fd7b33a.  Please report this at http://dynamorio.org/issues/.  Program aborted.
Received SIGSEGV at unknown pc 0x00007fd53fd7b33a in thread 696439
Base: 0x00007fd53fa00000
Registers:eax=0x0000000000000000 ebx=0x00007ffc49ab0480 ecx=0x0000000000001000 edx=0x0000000000000000
        esi=0x00007ffc49ab0480 edi=0x0000000000000003 esp=0x00007ffc49ab0478 ebp=0x00007ffc49ab04a0
        r8 =0x0000000000001000 r9 =0x0000000000000001 r10=0x00007ffc49ab04b0 r11=0x0000000000000246
        r12=0x00007fd53fd74aa0 r13=0x00007ffc49ab04f8 r14=0x00000000000002d0 r15=0x00007fd53fbef000
        eflags=0x0000000000010246
version 10.93.19936, custom build
-no_dynamic_options -client_lib '/home/alexey/opt/dynamorio/build/api/bin/libmemtrace_simple.so;0;' -client_lib64 '/home/alexey/opt/dynamorio/build/api/bin/libmemtrace_simple.so;0;' -code_api -stack_size 56K -signal_stack_size 32K -max_elide_jmp 0 -max_elide_call 0 -early_inject -emulate_brk -no_inline_ignored_syscalls -
0x00007ffc49ab04a0 0x00007fd53f385536
0x00007ffc49ab04e0 0x00007fd53fb373b8
0x00007fd53f385470 0x6428ec8348fb8953>
[Inferior 1 (process 696439) exited with code 0377]
(gdb) bt
No stack.
(gdb)


вторник, 6 августа 2024 г. в 00:23:51 UTC+8, Derek Bruening:

Derek Bruening

unread,
Aug 7, 2024, 11:35:18 AM8/7/24
to Alexey Paznikov, DynamoRIO Users
You told gdb to not stop by saying "handle SIGSEGV nostop pass" so it went past the fatal SIGSEGV and the process is gone and there is no stack to examine.

Alexey Paznikov

unread,
Aug 8, 2024, 12:13:51 AM8/8/24
to DynamoRIO Users
Oh, I see. Sorry for the confusion. Here is the information that might help:


============= MACHINE 1 (Ubuntu 22.04, glibc 2.35) =============

(gdb) bt
#0  0x00007f434e2e61d3 in __GI___libc_cleanup_push_defer (buffer=buffer@entry=0x7ffe27bd5390) at ./nptl/libc-cleanup.c:30
#1  0x00007f434e2e234e in __GI__IO_link_in (fp=fp@entry=0x7f410a7bbaa0) at ./libio/genops.c:92
#2  0x00007f434e2e0e2e in _IO_new_file_init_internal (fp=fp@entry=0x7f410a7bbaa0) at ./libio/fileops.c:113
#3  0x00007f434e2d3fbe in _IO_new_fdopen (fd=1048480, mode=<optimized out>) at ./libio/iofdopen.c:139
#4  0x00007f430a6dc05f in event_thread_init (drcontext=0x7f410a768080) at /home/ap/opt/dynamorio/api/samples/memtrace_simple.c:397
#5  0x00007f430a72fab6 in drmgr_thread_init_event (drcontext=0x7f410a768080) at /home/ap/opt/dynamorio/ext/drmgr/drmgr.c:2639
#6  0x00007f434e8e3dbf in instrument_thread_init (dcontext=0x7f410a768080, client_thread=false, valid_mc=false) at /home/ap/opt/dynamorio/core/lib/instrument.c:1474
#7  0x00007f434e8e2487 in instrument_init () at /home/ap/opt/dynamorio/core/lib/instrument.c:786
#8  0x00007f434e74435d in dynamorio_app_init_part_two_finalize () at /home/ap/opt/dynamorio/core/dynamo.c:716
#9  0x00007f434ea07202 in privload_early_inject (sp=0x7ffe27bd7350, old_libdr_base=0x0, old_libdr_size=1) at /home/ap/opt/dynamorio/core/unix/loader.c:2279
#10 0x00007f434e9ac7b3 in reloaded_xfer () at /home/ap/opt/dynamorio/core/arch/x86/x86.asm:1179
#11 0x0000000000000002 in ?? ()
#12 0x00007ffe27bd8198 in ?? ()
#13 0x00007ffe27bd819d in ?? ()
#14 0x0000000000000000 in ?? ()


============= MACHINE 2 (Ubuntu 24.04 LTS, glibc 2.39) =============

(gdb) bt
#0  0x00007f261f5c733a in ?? ()
#1  0x00007f261e89f634 in __pthread_tunables_init () at ./nptl/pthread_mutex_conf.c:56
#2  0x00007f261e985536 in __pthread_early_init () at ../sysdeps/nptl/pthread_early_init.h:56
#3  __libc_early_init (initial=true) at ./elf/libc_early_init.c:44
#4  0x00007f261f31ef8b in privload_os_finalize (privmod=0x7f23dacea7e8) at /home/alexey/opt/dynamorio/core/unix/loader.c:775
#5  0x00007f261f1f4bfa in privload_load_process (privmod=0x7f23dacea7e8) at /home/alexey/opt/dynamorio/core/loader_shared.c:818
#6  0x00007f261f1f43d4 in privload_load (filename=0x7ffc70c83940 "/lib/x86_64-linux-gnu/libc.so.6", dependent=0x7f23dac705b0, client=false)
    at /home/alexey/opt/dynamorio/core/loader_shared.c:683
#7  0x00007f261f31f02f in privload_locate_and_load (impname=0x7f25dae096b3 "libc.so.6", dependent=0x7f23dac705b0, reachable=false) at /home/alexey/opt/dynamorio/core/unix/loader.c:791
#8  0x00007f261f31e439 in privload_process_imports (mod=0x7f23dac705b0) at /home/alexey/opt/dynamorio/core/unix/loader.c:571
#9  0x00007f261f1f4b59 in privload_load_process (privmod=0x7f23dac705b0) at /home/alexey/opt/dynamorio/core/loader_shared.c:811
#10 0x00007f261f1f2bc1 in privload_process_early_mods () at /home/alexey/opt/dynamorio/core/loader_shared.c:139
#11 0x00007f261f1f2db3 in loader_init_epilogue (dcontext=0x7f23dac8b880) at /home/alexey/opt/dynamorio/core/loader_shared.c:203
#12 0x00007f261f0602f4 in dynamorio_app_init_part_two_finalize () at /home/alexey/opt/dynamorio/core/dynamo.c:675
#13 0x00007f261f322c34 in privload_early_inject (sp=0x7ffc70c85b20, old_libdr_base=0x0, old_libdr_size=1) at /home/alexey/opt/dynamorio/core/unix/loader.c:2279
#14 0x00007f261f2c8258 in reloaded_xfer () at /home/alexey/opt/dynamorio/core/arch/x86/x86.asm:1179
#15 0x0000000000000002 in ?? ()
#16 0x00007ffc70c87449 in ?? ()
#17 0x00007ffc70c8744e in ?? ()
#18 0x0000000000000000 in ?? ()


среда, 7 августа 2024 г. в 23:35:18 UTC+8, Derek Bruening:

Derek Bruening

unread,
Aug 13, 2024, 11:09:03 PM8/13/24
to Alexey Paznikov, DynamoRIO Users
So it is a private glibc issue, probably a variant of https://github.com/DynamoRIO/dynamorio/issues/5437, as suspected.  What version of glibc?  As you can see in the discussion in that issue there is no simple solution (proposals include abandoning support for clients using glibc or trying to preserve ld.so instead of replacing), since glibc now has undocumented interactions where we need proper interfaces.  You could add your callstack (and glibc version) to the issue, and if you are able to track down the missing initialization please report that in the issue and ideally send a PR.  Or if you prefer file a separate issue and xref #5437, which might keep things clearer.

Alexey Paznikov

unread,
Sep 24, 2024, 1:54:23 AM9/24/24
to DynamoRIO Users
Hi Derek,

Thanks for the detailed explanation and the link to the issue! I will try to investigate the initialization and will try to follow your advice on this.
Thanks again for your help!

среда, 14 августа 2024 г. в 11:09:03 UTC+8, Derek Bruening:
Reply all
Reply to author
Forward
0 new messages