I'm new to DynamoRIO and just tinkering with sample clients for now. I noticed that fopen() and freopen() always crash my clients. I've modified empty.c example, adding line
fopen ("any.file", "w");
and got this message:
<Application /usr/bin/ls (4112). DynamoRIO Sample Client 'empty' internal crash at PC 0x00007f5c26b591d3. Please report this at http://dynamorio.org/issues. Program aborted.
Received SIGSEGV at pc 0x00007f5c26b591d3 in thread 4112
Base: 0x00007f5c26f70000
Registers:eax=0x0000000000000000 ebx=0x00007f59e300e350 ecx=0x0000000000000000 edx=0x00000000fbad248c
esi=0x00000000fbad0000 edi=0x00007fff62c3e250 esp=0x00007fff62c3e248 ebp=0x0000000000000000
r8 =0x00007f5c26cdf0c0 r9 =0x0000000000000020 r10=0x00007f5c2715c000 r11=0x0000000000000246
r12=0x00007fff62c3e250 r13=0x00007f5c26ce4a50 r14=0x0000000000000000 r15=0x0000000000000001
eflags=0x0000000000010246
version 10.0.19741, custom build
-no_dynamic_options -client_lib '/home/alexei/ispras/DynamoRIO-Linux-10.0.19741/test_build/bin/libempty.so;0;' -client_lib64 '/home/alexei/ispras/DynamoRIO-Linux-10.0.19741/test_build/bin/libempty.so;0;' -code_api -stack_size 56K -signal_stack_size 32K -max_elide_jmp 0 -max_elide_call 0 -early_inject -emulate_brk -no_inl
0x00007f59e2fc1080 0x0000000000000000>
Other libc functions seem to work fine. For build, default CMake was used:
DYNAMORIO_DIR='DynamoRIO-Linux-10.0.19741'
CLIENT=$DYNAMORIO_DIR'/test_build/bin/libempty.so'
TARGET_CALL='ls'
mkdir $DYNAMORIO_DIR/test_build
cd $DYNAMORIO_DIR/test_build
cmake -DDynamoRIO_DIR=../cmake ../samples
make
Maybe I'm missing something? Please help with it.