<br><br><div class="gmail_quote">On Tue, Dec 27, 2011 at 4:00 PM, Joerg Sonnenberger <span dir="ltr"><<a href="mailto:joerg@britannica.bec.de">joerg@britannica.bec.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Tue, Dec 27, 2011 at 12:35:52PM -0800, Kostya Serebryany wrote:<br>
> On Tue, Dec 27, 2011 at 12:22 PM, Joerg Sonnenberger <<br>
> <a href="mailto:joerg@britannica.bec.de">joerg@britannica.bec.de</a>> wrote:<br>
><br>
> > On Tue, Dec 27, 2011 at 12:10:54PM -0800, Kostya Serebryany wrote:<br>
> > > What would be the best fix for asan?<br>
> ><br>
> > Can you be explicit what you need to asan? Just the equivalent of<br>
> > __builtin_return_address(0) or do you really need a full stack trace?<br>
> ><br>
><br>
> asan-rt uses __builtin_return_address(0) to get the full stack trace.<br>
> See compiler-rt/lib/asan/asan_stack.cc (AsanStackTrace::FastUnwindStack)<br>
> It checks the current thread's stack bounds to avoid a wild dereference.<br>
><br>
> Asan does not use unsafe __builtin_return_address(N, N>0), although it<br>
> would be nice if __builtin_return_address(N, N>0) had safer semantics.<br>
<br>
</div>That's inconsistent :) __builtin_return_address(0) works with or without<br>
frame pointer. What doesn't work is depending on the frame pointer on<br>
the stack to "speed up" the unwinding further. So what is it?<br></blockquote><div><br></div><div>Not sure what your question is. </div><div>afaict, the method used by asan is the only fast way to get stack traces (but it requires frame pointers). </div>
<div>All other methods (e.g. libunwind) are much slower. </div><div><br></div><div>--kcc </div><div> </div></div>