Internal crash when inserting instruction

28 views
Skip to first unread message

Ray Guo

unread,
May 22, 2023, 4:23:06 PM5/22/23
to DynamoRIO Users
Hi,

I am trying to insert an add instruction to increment a global counter by the following code. I use Linux system with Aarch64 architecture. 
/* save arithmetic flags */ 
dr_save_reg(drcontext, bb, first_inst, DR_REG_X0, SPILL_SLOT_1); dr_save_arith_flags_to_reg(drcontext, bb, first_inst, DR_REG_X0); 
/* inser inst to increment the counter */ 
uint64_t tmp = 0; int one = 1; 
instrlist_meta_preinsert(bb, 
                         first_inst, 
                         XINST_CREATE_add(drcontext, OPND_CREATE_ABSMEM((void*)&global_counter, OPSZ_8), OPND_CREATE_INT(1))  
); 
/* restore arithmetic flags */ 
dr_restore_arith_flags_from_reg(drcontext, bb, first_inst, DR_REG_X0);
dr_restore_reg(drcontext, bb, first_inst, DR_REG_X0, SPILL_SLOT_1);

But the client crashes with the following information: 
Tool internal crash at PC 0x000000007109cd7c.  Please report this at your tool's issue tracker.  Program aborted.
Received SIGSEGV at pc 0x000000007109cd7c in thread 2920934
Base: 0x0000000071000000
Registers:      eflags=0x0000000080001000
version 9.0.1, custom build


Do you have any ideas about how to solve this issue?

Thanks a lot for your help. 

Sincerely,
Ray

Sahil Gupta

unread,
May 23, 2023, 4:28:07 PM5/23/23
to DynamoRIO Users
Hello,

In order to assist you better, would you be able to run this with a debug build and provide us with:
  • The crash callstack
  • The exact crashing block ASM code
  • Register values at that point 
These can be obtained using GDB. Our debug page has some information on how to do this: https://dynamorio.org/page_debugging.html
Reply all
Reply to author
Forward
0 new messages