assert failure in signal.c

31 views
Skip to first unread message

Prasun Ratn

unread,
Dec 21, 2022, 8:25:00 AM12/21/22
to DynamoRIO Users
I am seeing this assert failure. I am on commit 3c598ac8490e1c8b02b40563d8ced8066b2eabf9

Is this a bug or something weird manifesting in my local setup?


$ build/bin64/drrun -t drcachesim -trace_after_instrs 2000M --offline -- build/suite/tests/bin/pthreads.ptsig
<Starting application /home/prasun/dynamorio-latest/build/suite/tests/bin/pthreads.ptsig (246857)>
<Initial options = -no_dynamic_options -client_lib '/home/prasun/dynamorio-latest/build/bin64/../clients/lib64/debug/libdrmemtrace.so;0;-trace_after_instrs 2000M --offline' -client_lib64 '/home/prasun/dynamorio-latest/build/bin64/../clients/lib64/debug/libdrmemtrace.so;0;-trace_after_instrs 2000M --offline' -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 >
<Paste into GDB to debug DynamoRIO clients:
set confirm off
add-symbol-file '/home/prasun/dynamorio-latest/build/bin64/../clients/lib64/debug/libdrmemtrace.so' 0x00007fdd4ee8c3c0
add-symbol-file '/home/prasun/dynamorio-latest/build/lib64/debug/libdynamorio.so' 0x00007fdd930c27b8
add-symbol-file '/home/prasun/dynamorio-latest/build/ext/lib64/debug/libdrsyms.so' 0x00007fdd4f11a260
add-symbol-file '/lib/x86_64-linux-gnu/libc.so.6' 0x00007fdd92a79360
add-symbol-file '/lib64/ld-linux-x86-64.so.2' 0x00007fdd9282bf10
add-symbol-file '/home/prasun/dynamorio-latest/build/ext/lib64/debug/libdrwrap.so' 0x00007fdd4f3626d0
add-symbol-file '/home/prasun/dynamorio-latest/build/ext/lib64/debug/libdrmgr.so' 0x00007fdd4f573090
add-symbol-file '/home/prasun/dynamorio-latest/build/ext/lib64/debug/libdrutil.so' 0x00007fdd4f782850
add-symbol-file '/home/prasun/dynamorio-latest/build/ext/lib64/debug/libdrstatecmp.so' 0x00007fdd4f9887b0
add-symbol-file '/home/prasun/dynamorio-latest/build/ext/lib64/debug/libdrcovlib.so' 0x00007fdd4fb8ee60
add-symbol-file '/home/prasun/dynamorio-latest/build/ext/lib64/debug/libdrx.so' 0x00007fdd4fd9b350
add-symbol-file '/home/prasun/dynamorio-latest/build/ext/lib64/debug/libdrreg.so' 0x00007fdd4ffae010
add-symbol-file '/home/prasun/dynamorio-latest/build/ext/lib64/debug/libdrbbdup.so' 0x00007fdd501bd330
add-symbol-file '/home/prasun/dynamorio-latest/build/ext/lib64/debug/libdrpttracer.so' 0x00007fdd503ca130
add-symbol-file '/usr/lib/x86_64-linux-gnu/libsnappy.so.1' 0x00007fdd926241b0
add-symbol-file '/usr/lib/x86_64-linux-gnu/libstdc++.so.6' 0x00007fdd922b09c0
add-symbol-file '/lib/x86_64-linux-gnu/libm.so.6' 0x00007fdd91e80a80
add-symbol-file '/lib/libgcc_s.so.1' 0x00007fdd91c5eb50
add-symbol-file '/lib/x86_64-linux-gnu/libz.so.1' 0x00007fdd91a3ff90
>
<curiosity: rex.w on OPSZ_6_irex10_short4!>
<(1+x) Handling our fault in a TRY at 0x00007fdd93329228>
<failed to translate>
<Application /home/prasun/dynamorio-latest/build/suite/tests/bin/pthreads.ptsig (246857).  Internal Error: DynamoRIO debug check failure: /home/prasun/dynamorio-latest/dynamorio/core/unix/signal.c:3118 false
(Error occurred @2310 frags in tid 246857)
version 9.0.19345, custom build
-no_dynamic_options -client_lib '/home/prasun/dynamorio-latest/build/bin64/../clients/lib64/debug/libdrmemtrace.so;0;-trace_after_instrs 2000M --offline' -client_lib64 '/home/prasun/dynamorio-latest/build/bin64/../clients/lib64/debug/libdrmemtrace.so;0;-trace_after_instrs 2000M --offline' -code_api -stack_size 56K -signa
0x00007fdb4ef3ec40 0x00007fdd9315d5fc
0x00007fdb4ef3ee90 0x00007fdd933641aa
0x00007fdb4ef3f7d0 0x00007fdd9336a958
0x00007fdb4ef3fa10 0x00007fdd9336de31
0x00007fdb4ef3fab0 0x00007fdd93328d49
0x00007ffce2340bf0 0x00007fdd91420c87
0x00007fdd8ee73710 0x158e258d4c544155
/home/prasun/dynamorio-latest/build/lib64/debug/libdynamorio.so=0x00007fdd93077000
/home/prasun/dynamorio-latest/build/bin64/../clients/lib64/debug/libdrmemtrace.so=0x00007fdd4ee79000
/lib/x86_64-linux-gnu/libz.so.1=0x00007fdd91a3e000
/usr/lib/x86_64-linux-gnu/libsnappy.so.1=0x00007fdd92622000
/usr/lib/x86_64-linux-gnu/libstdc++.so.6=0x00007fdd92214000
/lib/libgcc_s.so.1=0x00007fdd91c5c000
/lib/x86_64-linux-gnu/libm.so.6=0x00007fdd91e75000
/home>

Derek Bruening

unread,
Dec 21, 2022, 4:43:25 PM12/21/22
to Prasun Ratn, DynamoRIO Users
Probably a bug.  I would suggest geting a symbolic callstack and trying to understand why it is translating and why it failed.

--
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/7e4b8831-e365-4bfd-8a10-7dd13f38c8f8n%40googlegroups.com.

Prasun Ratn

unread,
Dec 21, 2022, 11:19:46 PM12/21/22
to Derek Bruening, DynamoRIO Users
Looks like there is a segv caused by the code below and the assert failure happens later.


  0x00007f7298058dcb  b8 2a 00 00 00       mov    $0x0000002a -> %eax
  0x00007f7298058dd0  c7 00 00 00 00 00    mov    $0x00000000 -> (%rax)[4byte]

computing memory target for 0x00007f7298058dd0 causing SIGSEGV, kernel claims it is 0x000000000000002a
compute_memory_target: falling back to racy protection checks
opnd_compute_address for: (%rax)
    base => 0x000000000000002a
    index,scale => 0x000000000000002a
    disp => 0x000000000000002a
For SIGSEGV at cache pc 0x00007f7298058dd0, computed target write 0x000000000000002a
    faulting instr: mov    $0x00000000 -> (%rax)[4byte]
** Received SIGSEGV at cache pc 0x00007f7298058dd0 in thread 250275
record_pending_signal(11) from cache pc 0x00007f7298058dd0
    not certain can delay so handling now
    action is not SIG_IGN
    retaddr = 0x00007f72dabe0d49
SYSLOG_WARNING: failed to translate
SYSLOG_ERROR: Application /home/prasun/dynamorio-latest/build/suite/tests/bin/pthreads.ptsig (250275).  Internal Error: DynamoRIO debug check failure: /home/prasun/dynamorio-latest/dynamorio/core/unix/signal.c:3118 false


gdb output

Thread 1 "pthreads.ptsig" received signal SIGSEGV, Segmentation fault.
0x00007fffb5677d90 in ?? ()
(gdb) refresh
(gdb) c
Continuing.
<failed to translate>

Thread 1 "pthreads.ptsig" hit Breakpoint 1, translate_sigcontext (dcontext=0x7ffdb3de0080, uc=0x7ffdb3e16ac0, avoid_failure=true, f=0x7ffdb4004158)
    at /home/prasun/dynamorio-latest/dynamorio/core/unix/signal.c:3118
(gdb) where
#0  translate_sigcontext (dcontext=0x7ffdb3de0080, uc=0x7ffdb3e16ac0, avoid_failure=true, f=0x7ffdb4004158) at /home/prasun/dynamorio-latest/dynamorio/core/unix/signal.c:3118
#1  0x00000000712f3958 in record_pending_signal (dcontext=0x7ffdb3de0080, sig=11, ucxt=0x7ffdb3e16ac0, frame=0x7ffdb3e16ab8, forged=false, access_address=0x2a <error: Cannot access memory at address 0x2a>)
    at /home/prasun/dynamorio-latest/dynamorio/core/unix/signal.c:5051
#2  0x00000000712f6e31 in main_signal_handler_C (sig=11, siginfo=0x7ffdb3e16bf0, ucxt=0x7ffdb3e16ac0, xsp=0x7ffdb3e16ab8 "I\035+q") at /home/prasun/dynamorio-latest/dynamorio/core/unix/signal.c:5994
#3  0x00000000712b1d49 in xfer_to_new_libdr () at /home/prasun/dynamorio-latest/dynamorio/core/arch/x86/x86.asm:1203
#4  0x0000000000000007 in ?? ()
#5  0x0000000000000000 in ?? ()

Derek Bruening

unread,
Dec 22, 2022, 2:57:26 PM12/22/22
to Prasun Ratn, DynamoRIO Users
Did you check the sources?  Dereference of 42 is probably quite deliberate. So it’s just the translation assert that is unexpected. Logs can help figure out why. 
Reply all
Reply to author
Forward
0 new messages