[PATCH] D11277: [lib/Fuzzer] Add sanitizer runtime errors unit save option

Karl Skomski karl at skomski.com
Sat Jul 18 15:26:56 PDT 2015


skomski added a comment.

In http://reviews.llvm.org/D11277#207577, @kcc wrote:

> I am sorry, I may be missing something, can we start again? 
>  What problem exactly are you trying to solve?


My problem is that I want to have an easy way to reproduce undefined behaviour errors for further debugging purposes or to put it into my testcases. I want to achieve that saving the active unit during the time ubsan reported the error.


================
Comment at: lib/Fuzzer/FuzzerLoop.cpp:16
@@ -15,1 +15,3 @@
 
+void __sanitizer_report_error_summary(const char *ErrorSummary) {
+  fuzzer::Fuzzer::StaticErrorReportCallback(ErrorSummary);
----------------
kcc wrote:
> skomski wrote:
> > kcc wrote:
> > > __sanitizer_report_error_summary may be used by other parts of code linked with libSanitizer. 
> > > Also, summary is just a single line, not sure how it may be useful. 
> > Is there an alternative to __sanitizer_report_error_summary to receive the runtime error reports? I wanted to use __asan_set_error_report_callback but that doesn't work
> > 
> > > Also, summary is just a single line, not sure how it may be useful.
> > I wanted to use replicate the original behaviour of __sanitizer_report_error_summary that does  fuzzer::Printf("%s\n", ErrorSummary);
> asan_set_error_report_callback is closer to what you need but
>   1. it's only available in asan (well, this *may* need to be fixed separately)
>   2. it has the same problem: what if someone else want to call it to. I'e. it will need to be chained.
>   3. You say it does not work. Strange. Will need more info separately. 
> 
> Does __sanitizer_set_report_path do (almost) what you need? 
3. Well it works but only the hard crashes from asan are reported that are already handled.
https://github.com/llvm-mirror/compiler-rt/blob/6e6e601da1cd63c2e797a4b185f5ebc77496e1dc/lib/asan/asan_report.cc#L666


http://reviews.llvm.org/D11277







More information about the llvm-commits mailing list