Comment #16 on issue 73 by [email protected]: Detect Use after destruction (but before free)
http://code.google.com/p/address-sanitizer/issues/detail?id=73

Comments on the patch:

if (SanOpts->Address
This should be (SanOpts->Address || SanOpts->Memory || SanOpts->Thread)

DtorType == Dtor_Complete
This is never true even on a simple test (attached). Please double-check.

"__asan_poison_memory_region"
This should be "__sanitizer_dtor_exit_callback",
every tool will implement this callback in its own way.
For msan a simple implementation (w/o origins) would be
to call __msan_poison(addr, size);

I've made these changes and modified the original test case and got this nice report
from msan:
==19562== WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x7f55690fd2a9 in A::TouchMe() uad_test.cc:6
    #1 0x7f55690fd123 in B::~B() uad_test.cc:15
    #2 0x7f55690fcfab in Outer::~Outer() uad_test.cc:19
    #3 0x7f55690fcef1 in main uad_test.cc:24

Attachments:
        uad.patch  1.3 KB
        uad_test.cc  380 bytes

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"address-sanitizer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to