DynamoRIO / DynamoRIO/dynamorio
add more debug checks for invalid args
- Dominant language
- C
- Stars
- 3.2k
- Forks
- 629
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 31
Description
_From [bruen...@google.com](https://code.google.com/u/109494838902877177630/) on June 07, 2011 08:05:18_
we should add more ASSERT checks for invalid arguments to make it more
obvious when users pass in NULL. we had to attach gdb to find this NULL case when building a simple tool by modifying one of the samples:
#0 0x00000000712119d2 in instr_set_ok_to_mangle (instr=0x0, val=0) at /home/username/DR/core/x86/instr.c:2294
#1 0x00000000712707ff in instrlist_meta_preinsert (ilist=0x75414218, where=0x75414d10, inst=0x0) at /home/username/DR/core/x86/instrument.c:3426
#2 0x000000007200201d in instrument_mem(void *, instrlist_t *, struct {...} *, int, bool) (drcontext=0x753a7700, ilist=0x75414218, where=0x75414d10, pos=2, write=96) at dr_tsan.cc:511
#3 0x000000007200220d in event_basic_block (drcontext=0x753a7700, tag=, bb=0x75414218, for_trace=, translating=) at dr_tsan.cc:246
#4 0x000000007126c397 in instrument_basic_block (dcontext=0x753a7700, tag=0x7f8c0e19cb08 "\270", bb=0x75414218, for_trace=0, translating=0, emitflags=0x753f5b5c) at /home/username/DR/core/x86/instrument.c:1287
#5 0x0000000071221736 in client_process_bb (dcontext=0x753a7700, bb=0x753f5dc0) at /home/username/DR/core/x86/interp.c:2392
#6 0x0000000071224f5b in build_bb_ilist (dcontext=0x753a7700, bb=0x753f5dc0) at /home/username/DR/core/x86/interp.c:3295
#7 0x00000000712294d4 in build_basic_block_fragment (dcontext=0x753a7700, start=0x7f8c0e19cb08 "\270", initial_flags=0, link=1, visible=1, for_trace=0, unmangled_ilist=0x0) at /home/username/DR/core/x86/interp.c:4208
#8 0x00000000710e9aef in dispatch (dcontext=0x753a7700) at /home/username/DR/core/dispatch.c:185
#9 0x00000000712555d9 in call_dispatch_alt_stack_no_free () from /home/username/DR/exports/lib64/debug/libdynamorio.so
#10 0x0000000000000000 in ?? ()
_Original issue: http://code.google.com/p/dynamorio/issues/detail?id=481_
Contributor guide
Assessment
This issue has not been assessed yet.