[PATCH] [asan] disable fast unwind on ARM

Evgeniy Stepanov eugenis at google.com
Wed May 21 00:41:57 PDT 2014


Not sure what could be the problem. You may need to go deeper.

Our unwinder is compatible with the following function prologue:
 56c:   e92d48f0        push    {..., fp, lr}
 570:   e28db010        add     fp, sp, #16  <- 16 stands for the
number of registers in "..." multiplied by 4

ASan runtime is built without frame pointers and uses
__builtin_frame_address(0) and __builtin_return_address(0) to start
the unwind process. Both on x86-linux-pc and arm-android this enables
frame pointer in the calling function. We take care to call it right
at the etry point from the user code.


On Tue, May 20, 2014 at 10:02 PM, Kostya Serebryany <kcc at google.com> wrote:
>
>
>
> On Tue, May 20, 2014 at 9:34 PM, Greg Fitzgerald <gregf at codeaurora.org>
> wrote:
>>
>> > Fast stack unwind should work on ARM for Clang-compiled code, no matter
>> > Android or not.
>> It requires -marm -fno-omit-frame-pointer.
>>
>> Hmm, I'm not seeing that.  Zooming in on "TestCases/double-free.cc", I see
>> that it is being compiled with -fno-omit-frame-pointer (and -marm is the
>> default for armv7 targets).  I double-checked and recompiled with those
>> flags tacked onto the end of the clang invocation, but the result is the
>> same:
>>
>>   ==12127==ERROR: AddressSanitizer: attempting double-free on 0x41e007f0
>> in thread T0:
>>       #0 0x7269b in free compiler-rt/lib/asan/asan_malloc_linux.cc:65
>>       #1 0x896e3 in main compiler-rt/test/asan/TestCases/double-free.cc:15
>>     LLVMSymbolizer: error reading file: No such file or directory.
>
>
> I don't like this line ^^^^
> (although it may be an unrelated problem)
>
>>
>>       #2 0x40a142cb (/lib/arm-linux-gnueabi/libc.so.6+0x182cb)
>>
>>     0x41e007f0 is located 0 bytes inside of 10-byte region
>> [0x41e007f0,0x41e007fa)
>>     freed by thread T0 here:
>>       #0 0x7269b in free compiler-rt/lib/asan/asan_malloc_linux.cc:65
>>
>>     previously allocated by thread T0 here:
>>       #0 0x72859 in malloc compiler-rt/lib/asan/asan_malloc_linux.cc:75
>>
>>     SUMMARY: AddressSanitizer: double-free
>> compiler-rt/lib/asan/asan_malloc_linux.cc:65 free
>>     ==12127==ABORTING
>>
>> What am I missing?
>>
>> http://reviews.llvm.org/D3814
>>
>>
>



More information about the llvm-commits mailing list