glider at google.com
Wed Dec 28 01:19:37 PST 2011
On Wed, Dec 28, 2011 at 12:35 AM, Kostya Serebryany <kcc at google.com> wrote:
> On Tue, Dec 27, 2011 at 12:22 PM, Joerg Sonnenberger
> <joerg at britannica.bec.de> wrote:
>> On Tue, Dec 27, 2011 at 12:10:54PM -0800, Kostya Serebryany wrote:
>> > What would be the best fix for asan?
>> Can you be explicit what you need to asan? Just the equivalent of
>> __builtin_return_address(0) or do you really need a full stack trace?
> asan-rt uses __builtin_return_address(0) to get the full stack trace.
> See compiler-rt/lib/asan/asan_stack.cc (AsanStackTrace::FastUnwindStack)
> It checks the current thread's stack bounds to avoid a wild dereference.
I think it does not. What you're doing there is traversing the stack frames.
__builtin_return_address(0) is generated for each function
individually. It just reads the return address from the known position
on the stack and does not help to unwind further.
I believe the best option for us is to add the
--fno-omit-frame-pointer depending on the -faddress-sanitizer flag.
But in order to do this reliably, we need to remove all the instances
of -fomit-frame-pointer from the command line.
IIUC Clang doesn't support this now.
More information about the llvm-dev