[compiler-rt] r221520 - [sanitizer] Never remove the last frame off the stack trace.
David Blaikie
dblaikie at gmail.com
Wed Nov 12 12:48:36 PST 2014
On Wed, Nov 12, 2014 at 1:03 AM, Evgeniy Stepanov <eugeni.stepanov at gmail.com
> wrote:
> We remove frames that belong to the sanitizer runtime off the top of
> the stack trace.
>
> This situation, when the unwinder returned a single-frame stack trace,
> was observed in an unusual environment where the CFI unwinder
> misbehaved for a yet unknown reason.
It'd be nice to have an explanation here at some point, otherwise I'd be
concerned about someone removing this code as meaningless.
> It involved building ASan runtime
> with a custom build system (neither make or cmake), and I can't
> reproduce the results in a test.
>
> On Wed, Nov 12, 2014 at 1:46 AM, David Blaikie <dblaikie at gmail.com> wrote:
> >
> >
> > On Fri, Nov 7, 2014 at 4:03 AM, Evgeniy Stepanov <
> eugeni.stepanov at gmail.com>
> > wrote:
> >>
> >> Author: eugenis
> >> Date: Fri Nov 7 06:03:07 2014
> >> New Revision: 221520
> >>
> >> URL: http://llvm.org/viewvc/llvm-project?rev=221520&view=rev
> >> Log:
> >> [sanitizer] Never remove the last frame off the stack trace.
> >
> >
> > Test case? I'm also not quite sure what this is doing - why are we
> > popping/ignoring frames exactly?
> >
> >>
> >>
> >> It can only make it worse.
> >>
> >> Modified:
> >>
> >> compiler-rt/trunk/lib/sanitizer_common/sanitizer_unwind_posix_libcdep.cc
> >>
> >> Modified:
> >> compiler-rt/trunk/lib/sanitizer_common/sanitizer_unwind_posix_libcdep.cc
> >> URL:
> >>
> 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
> >>
> >>
> ==============================================================================
> >> ---
> >> compiler-rt/trunk/lib/sanitizer_common/sanitizer_unwind_posix_libcdep.cc
> >> (original)
> >> +++
> >>
> compiler-rt/trunk/lib/sanitizer_common/sanitizer_unwind_posix_libcdep.cc Fri
> >> Nov 7 06:03:07 2014
> >> @@ -116,7 +116,7 @@ void BufferedStackTrace::SlowUnwindStack
> >> // We need to pop a few frames so that pc is on top.
> >> uptr to_pop = LocatePcInTrace(pc);
> >> // trace_buffer[0] belongs to the current function so we always pop
> it.
> >> - if (to_pop == 0)
> >> + if (to_pop == 0 && size > 1)
> >> to_pop = 1;
> >> PopStackFrames(to_pop);
> >> trace_buffer[0] = pc;
> >>
> >>
> >> _______________________________________________
> >> llvm-commits mailing list
> >> llvm-commits at cs.uiuc.edu
> >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141112/c40fa383/attachment.html>
More information about the llvm-commits
mailing list