tst2005googlecode2 / address-sanitizer

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

Unify symbolization in PrintStackTrace and suppression code #251

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Suppressions should:
- match module name if symbolization is disabled
- use the symbolize callback when present
- use GetPreviousInstructionPc

Original issue reported on code.google.com by earth...@google.com on 29 Nov 2013 at 2:55

GoogleCodeExporter commented 9 years ago
Expanding on point #1. Presently, when symbolize=0, we use a dummy symbolizer 
which returns 0 symbolized frames. POSIXSymbolizer will fall back to 
module+offset if the on-line symbolizer fails, but the dummy symbolizer won't. 
We don't normally notice that, because StackTrace::PrintStack reimplements this 
fallback mechanism. Hence, we see module+offset in reports even when 
symbolize=0, but suppression matching (which doesn't use PrintStack()) won't 
work. This is bad - in some environments we don't have the on-line symbolizer, 
but we still want to skip, e.g., the hundreds of false positives coming from 
libfontconfig in Chrome.

Possible extra improvement: with symbolize=1, support a way to get just the 
module name first, so we won't have to symbolize if the module name is 
suppressed (this should improve performance somewhat).

Also, vis-a-vis #2, I'm guessing the use of symbolize callback needs to be 
moved from PrintStack() to the symbolization code as well?

Original comment by earth...@google.com on 16 Dec 2013 at 1:34

GoogleCodeExporter commented 9 years ago
After the recent changes:
* We create a POSIXSymbolizer (and thus get <module>+<offset>) even if 
symbolize=0. So, suppression by module name should now always work. In fact, we 
have one extra path in PrintStackTrace which is not present in Symbolizer - 
fall back to /proc/self/maps if symbolizer failed to return anything. Do you 
think we should move this functionality to Symbolizer as well?
* symbolize callback functionality is removed.
* It is possible to add a method Symbolizer::GetPCModuleAndOffset(), but I'd 
like to avoid it unless we see a measurable performance improvement.

Original comment by samso...@google.com on 24 Dec 2013 at 7:02

GoogleCodeExporter commented 9 years ago
> Do you think we should move this functionality to Symbolizer as well?

I don't see why not.

Original comment by earth...@google.com on 24 Dec 2013 at 7:21

GoogleCodeExporter commented 9 years ago
This should be fixed at r198025 by a series of recent commits. Currently 
StackTrace::PrintStack is pretty straightforward, there is no symbolize 
callback and no /proc/self/maps fallback. 
Symbolizer::GetModuleNameAndOffsetForPC() is implemented and is used in LSan 
suppression matcher.

Original comment by samso...@google.com on 25 Dec 2013 at 8:23