Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add more debug checks for invalid args #481

Open
derekbruening opened this issue Nov 28, 2014 · 2 comments
Open

add more debug checks for invalid args #481

derekbruening opened this issue Nov 28, 2014 · 2 comments

Comments

@derekbruening
Copy link
Contributor

From [email protected] 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

@derekbruening
Copy link
Contributor Author

From [email protected] on June 07, 2011 05:06:44

adding to this same issue:
we should add debug checks for failing to call drwrap_init()
and also check that the drmgr.h dr_get_tls_field, etc. macros that are supposed
to detect using dr instead of drmgr are working: somehow they were not
blocking us from making that error in recent work

@derekbruening
Copy link
Contributor Author

From [email protected] on June 07, 2011 05:21:29

Cc: [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant