~pali/llvm/compiler-rt-3.9

Viewing all changes in revision 7312.

  • Committer: etienneb
  • Date: 2016-07-15 17:16:37 UTC
  • Revision ID: svn-v4:91177308-0d34-0410-b5e6-96231b3b80d8:compiler-rt/trunk:275580
TestCase null_deref was failing in Win64:

c:\lipo\work\asan\b_llvm>c:\lipo\work\asan\b_llvm\projects\compiler-rt\test\asan\X86_64WindowsConfig\TestCases\Output\null_deref.cc.tmp
=================================================================
==5488==ERROR: AddressSanitizer: access-violation on unknown address 0x000000000028 (pc 0x7ff701f91067 bp 0x000c8cf8fbf0 sp 0x000c8cf8fbb0 T0)
==5488==The signal is caused by a READ memory access.
==5488==Hint: address points to the zero page.
    #0 0x7ff701f91066 in NullDeref(int *) C:\lipo\work\asan\llvm\projects\compiler-rt\test\asan\TestCases\null_deref.cc:15:10
    #1 0x8a0388830a67  (<unknown module>)
The reason was symbols was not initilized. In fact, it was first inited
with a call to stack.Print(), which calls
WinSymbolizerTool::SymbolizePC, then InitializeDbgHelpIfNeeded().

Since the StackWalk was performed before the stack.Print(), stack frames
where not gathered correctly.

There should be a better place to initialize symbols. For now, this
patch makes the test happy.

Patch by Wei Wang
Differential Revision: https://reviews.llvm.org/D22410

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: