[PATCH] [asan] disable fast unwind on ARM

Kostya Serebryany kcc at google.com
Mon May 19 21:14:45 PDT 2014


I think this is a mistake.
The slow unwinder is so terribly slow that you will not be able to use asan
on anything other than small test cases.
Instead, you need to make the fast unwinder work by enabling frame pointers
at compile time.
We do it on Android ARM, so I think this can and should be done on Linux
ARM as well.

Note also, that there are run-time flags that control the unwinder:
fast_unwind_on_fatal0Use fast unwinder when found a bug. The fast one
relies on frame pointers, while slow one does not. See also
CallStack<https://code.google.com/p/address-sanitizer/wiki/CallStack>
fast_unwind_on_malloc1Same as fast_unwind_on_fatal, but control unwinding
inside malloc/free, i.e. performance critical. See also
CallStack<https://code.google.com/p/address-sanitizer/wiki/CallStack>
--kcc






On Tue, May 20, 2014 at 3:13 AM, Greg Fitzgerald <gregf at codeaurora.org>wrote:

> Per Kostya, this version does not disable fast unwind on Android.
>
> With this patch, the error messages are significantly more useful.
>  Without this patch, in the use-after-free test for example, the stack
> trace only has references to the 'malloc/free' wrappers in the ASan runtime
> and not references to anything in use-after-free.cc.
>
> http://reviews.llvm.org/D3814
>
> Files:
>   lib/sanitizer_common/sanitizer_stacktrace.h
>
> Index: lib/sanitizer_common/sanitizer_stacktrace.h
> ===================================================================
> --- lib/sanitizer_common/sanitizer_stacktrace.h
> +++ lib/sanitizer_common/sanitizer_stacktrace.h
> @@ -21,7 +21,8 @@
>
>  #if SANITIZER_LINUX && (defined(__aarch64__) || defined(__powerpc__) || \
>                          defined(__powerpc64__) || defined(__sparc__) || \
> -                        defined(__mips__))
> +                        defined(__mips__) || \
> +                        (!SANITIZER_ANDROID && defined(__arm__)))
>  # define SANITIZER_CAN_FAST_UNWIND 0
>  #elif SANITIZER_WINDOWS
>  # define SANITIZER_CAN_FAST_UNWIND 0
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140520/4fced96e/attachment.html>


More information about the llvm-commits mailing list