[PATCH] D65495: [asan_symbolize] Fix bug where the frame counter was not incremented.

Dan Liew via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 30 18:10:24 PDT 2019


delcypher created this revision.
delcypher added reviewers: kubamracek, yln, samsonov, dvyukov, vitalybuka.
Herald added projects: LLVM, Sanitizers.
Herald added a subscriber: Sanitizers.

This bug occurred when a plug-in requested that a binary not be
symbolized while the script is trying to symbolize a stack frame. In
this case `self.frame_no` would not be incremented. This would cause
subsequent stack frames that are symbolized to be incorrectly numbered.

To fix this `get_symbolized_lines()` has been modified to take an
argument that indicates whether the stack frame counter should
incremented. In `process_line_posix()` `get_symbolized_lines(None)` is
now used in cases where we don't want to symbolize a line so that we can
keep the frame counter increment in a single function.

A test case is included. The test uses a dummy plugin that always asks
`asan_symbolize.py` script to not symbolize the first binary that the
script asks about. Prior to the patch this would cause the output to
script to look something like

  #0 0x0
  #0 0x0 in do_access
  #1 0x0 in main

rdar://problem/49476995


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D65495

Files:
  lib/asan/scripts/asan_symbolize.py
  test/asan/TestCases/Posix/asan_symbolize_script/plugin_wrong_frame_number_bug.cc
  test/asan/TestCases/Posix/asan_symbolize_script/plugin_wrong_frame_number_bug.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65495.212488.patch
Type: text/x-patch
Size: 4695 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190731/832a9c37/attachment-0001.bin>


More information about the llvm-commits mailing list