ramosian-glider / memory-sanitizer

Automatically exported from code.google.com/p/memory-sanitizer
0 stars 0 forks source link

Use-after-dtor reports are hard to read #89

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The "origin" portion of use-after-dtor reports on global variables looks 
something like this:
#0  in __sanitizer_dtor_callback 
#1  in MSanAtExitWrapper
#2  in __run_exit_handlers
...
#  in __libc_start_main

There are 2 issues here:
1. There is no destructor frame. That's probably because 
__sanitizer_dtor_callback is the last thing a destructor does, and it is 
tail-called. We should suppress tail-call optimization in this case. This 
affects both global and heap-allocated objects.
2. For globals it should be possible to print the variable name (and the 
location of the global definition). There is no support for this in MSan 
(because globals are almost always initialized); there is code in TSan that 
does this and support in llvm-symbolizer.
3. I wonder how hard it would be to do the same for local (stack) variables.

Original issue reported on code.google.com by euge...@google.com on 21 Jul 2015 at 11:31

GoogleCodeExporter commented 8 years ago
Adding Project:MemorySanitizer as part of GitHub migration.

Original comment by gli...@google.com on 30 Jul 2015 at 9:22