On 22 October 2013 22:10, Kostya Serebryany <[email protected]> wrote:
>
> On Wed, Oct 23, 2013 at 8:16 AM, Nick Lewycky <[email protected]> wrote:
>
>> __sanitizer_report_error_summary is the replaceable interface for
>> reporting an error. This patch changes asan a tiny bit to always emit a
>> summary whenever it encounters an error. This is important, otherwise a
>> library user of asan will not be aware of errors that were merely printed.
>>
>> Also, all these summaries are redundant with the non-summarized
>> printouts. Make the default weak implementation of report error summary not
>> do anything. This means we need to remove the check for SUMMARY lines from
>> the tests. This is suboptimal for testing, but printing out these redundant
>> lines is just bad UI.
>>
>
> But I've added summaries for a reason: they help to cluster bug reports.
>
But asan prints one error and exits?
> I'd really prefer to keep them by default.
>
I've attached an updated patch that puts the summaries back. What's left in
the patch will fix a bug where a subprocess may catch an asan error and
die, but that error would be lost by the parent process. The only way to
make sure we catch errors in all subprocesses is to make sure they call
into sanitizer_report_error_summary if there's any error.
And we need ubsan to do this for the same reason. UBSan already has
one-line errors. We want to print those, preferably without "SUMMARY:"
before them.
Any ideas?
Nick
Index: lib/asan/asan_report.cc
===================================================================
--- lib/asan/asan_report.cc (revision 193211)
+++ lib/asan/asan_report.cc (working copy)
@@ -550,16 +550,14 @@
};
static void ReportSummary(const char *error_type, StackTrace *stack) {
- if (!stack->size) return;
+ AddressInfo ai;
if (&getSymbolizer && getSymbolizer()->IsAvailable()) {
- AddressInfo ai;
// Currently, we include the first stack frame into the report summary.
// Maybe sometimes we need to choose another frame (e.g. skip memcpy/etc).
uptr pc = StackTrace::GetPreviousInstructionPc(stack->trace[0]);
getSymbolizer()->SymbolizeCode(pc, &ai, 1);
- ReportErrorSummary(error_type, ai.file, ai.line, ai.function);
}
- // FIXME: do we need to print anything at all if there is no symbolizer?
+ ReportErrorSummary(error_type, ai.file, ai.line, ai.function);
}
void ReportSIGSEGV(uptr pc, uptr sp, uptr bp, uptr addr) {
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits