[LLVMdev] -f[no-]omit-frame-pointer

Joerg Sonnenberger joerg at britannica.bec.de
Tue Dec 27 16:00:45 PST 2011


On Tue, Dec 27, 2011 at 12:35:52PM -0800, Kostya Serebryany 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.
> 
> Asan does not use unsafe __builtin_return_address(N, N>0), although it
> would be nice if __builtin_return_address(N, N>0) had safer semantics.

That's inconsistent :) __builtin_return_address(0) works with or without
frame pointer. What doesn't work is depending on the frame pointer on
the stack to "speed up" the unwinding further. So what is it?

Joerg



More information about the llvm-dev mailing list