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]
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/dynamorio-users/3139b9a4-0046-4102-8fef-9bdfc0062cfcn%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dynamorio-users/7d22dc37-115a-4125-bc17-d9717b86c017n%40googlegroups.com.