Closed GoogleCodeExporter closed 9 years ago
Original comment by konstant...@gmail.com
on 22 Nov 2011 at 2:36
This happens because ASan does not currently work with -O0. In fact the module
remains uninstrumented, thus __asan_init() is not called and the runtime
library is in inconsistent state. This problem cannot be fixed without calling
__asan_init(), so the proposed patch is invalid.
The short-term workaround is to pass an additional -O1 option to the compiler:
$ clang try.c -faddress-sanitizer -o try -O1
$ ./try
Ok
A proper fix on the ASan side is to allow performing the instrumentation with
-O0. ASan instrumentation is conceptually different from code optimization, so
this is correct.
Original comment by ramosian.glider@gmail.com
on 22 Nov 2011 at 8:18
Thanks. This explains why I found no single error in the Perl testsuite and a
fair number of CPAN modules so far. Too good to be true. No single SIGSEGV.
With -O1 it works fine
Original comment by reini.urban
on 22 Nov 2011 at 2:18
Attached is a patch for Clang that fixes the problem with -O0 (this is not a
replacement for llvm/clang.patch, it should be applied separately)
Once someone on the LLVM-dev approves it, we'll commit it into Clang.
Original comment by ramosian.glider@gmail.com
on 23 Nov 2011 at 8:11
Attachments:
Works for me, thanks. At least for the perl Configure probes.
Got now into other problems unrelated to this patch (fails with and without) to
be handled in a separate ticket.
Original comment by reini.urban
on 23 Nov 2011 at 4:41
The O0 patch has landed.
The build instructions updated. (note, they are unstable, nothing is guaranteed
to work until we are done integrating with llvm).
Original comment by konstant...@gmail.com
on 1 Dec 2011 at 5:56
Original issue reported on code.google.com by
reini.urban
on 22 Nov 2011 at 2:21Attachments: