<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 12, 2014 at 1:03 AM, Evgeniy Stepanov <span dir="ltr"><<a href="mailto:eugeni.stepanov@gmail.com" target="_blank">eugeni.stepanov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">We remove frames that belong to the sanitizer runtime off the top of<br>
the stack trace.<br>
<br>
This situation, when the unwinder returned a single-frame stack trace,<br>
was observed in an unusual environment where the CFI unwinder<br>
misbehaved for a yet unknown reason.</blockquote><div><br></div><div>It'd be nice to have an explanation here at some point, otherwise I'd be concerned about someone removing this code as meaningless.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> It involved building ASan runtime<br>
with a custom build system (neither make or cmake), and I can't<br>
reproduce the results in a test.<br>
<div class="HOEnZb"><div class="h5"><br>
On Wed, Nov 12, 2014 at 1:46 AM, David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br>
><br>
><br>
> On Fri, Nov 7, 2014 at 4:03 AM, Evgeniy Stepanov <<a href="mailto:eugeni.stepanov@gmail.com">eugeni.stepanov@gmail.com</a>><br>
> wrote:<br>
>><br>
>> Author: eugenis<br>
>> Date: Fri Nov  7 06:03:07 2014<br>
>> New Revision: 221520<br>
>><br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=221520&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=221520&view=rev</a><br>
>> Log:<br>
>> [sanitizer] Never remove the last frame off the stack trace.<br>
><br>
><br>
> Test case? I'm also not quite sure what this is doing - why are we<br>
> popping/ignoring frames exactly?<br>
><br>
>><br>
>><br>
>> It can only make it worse.<br>
>><br>
>> Modified:<br>
>><br>
>> compiler-rt/trunk/lib/sanitizer_common/sanitizer_unwind_posix_libcdep.cc<br>
>><br>
>> Modified:<br>
>> compiler-rt/trunk/lib/sanitizer_common/sanitizer_unwind_posix_libcdep.cc<br>
>> URL:<br>
>> <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_unwind_posix_libcdep.cc?rev=221520&r1=221519&r2=221520&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_unwind_posix_libcdep.cc?rev=221520&r1=221519&r2=221520&view=diff</a><br>
>><br>
>> ==============================================================================<br>
>> ---<br>
>> compiler-rt/trunk/lib/sanitizer_common/sanitizer_unwind_posix_libcdep.cc<br>
>> (original)<br>
>> +++<br>
>> compiler-rt/trunk/lib/sanitizer_common/sanitizer_unwind_posix_libcdep.cc Fri<br>
>> Nov  7 06:03:07 2014<br>
>> @@ -116,7 +116,7 @@ void BufferedStackTrace::SlowUnwindStack<br>
>>    // We need to pop a few frames so that pc is on top.<br>
>>    uptr to_pop = LocatePcInTrace(pc);<br>
>>    // trace_buffer[0] belongs to the current function so we always pop it.<br>
>> -  if (to_pop == 0)<br>
>> +  if (to_pop == 0 && size > 1)<br>
>>      to_pop = 1;<br>
>>    PopStackFrames(to_pop);<br>
>>    trace_buffer[0] = pc;<br>
>><br>
>><br>
>> _______________________________________________<br>
>> llvm-commits mailing list<br>
>> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
><br>
><br>
</div></div></blockquote></div><br></div></div>