[PATCH] D22586: [compiler-rt] Fix broken SymInitialize unittest

Etienne Bergeron via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 20 13:13:05 PDT 2016


etienneb created this revision.
etienneb added a reviewer: rnk.
etienneb added subscribers: chrisha, wang0109, llvm-commits.
Herald added a subscriber: kubabrecka.

By adding the initialisation of the symbolisation library (DbgHelp)
we are swapping the order in which both warnings are produced.

We can't use CHECK-NEXT as the dbghelp warning is multiline.

https://reviews.llvm.org/D22586

Files:
  lib/sanitizer_common/sanitizer_win.cc
  test/asan/TestCases/Windows/report_after_syminitialize.cc

Index: test/asan/TestCases/Windows/report_after_syminitialize.cc
===================================================================
--- test/asan/TestCases/Windows/report_after_syminitialize.cc
+++ test/asan/TestCases/Windows/report_after_syminitialize.cc
@@ -16,8 +16,8 @@
   // CHECK: ERROR: AddressSanitizer: access-violation on unknown address
   // CHECK: The signal is caused by a WRITE memory access.
   // CHECK: Hint: address points to the zero page.
-  // CHECK-NEXT: {{WARNING: Failed to use and restart external symbolizer}}
-  // CHECK-NEXT: {{WARNING: .*DbgHelp}}
+  // CHECK: {{WARNING: .*DbgHelp}}
+  // CHECK: {{WARNING: Failed to use and restart external symbolizer}}
   // CHECK: {{#0 0x.* in main.*report_after_syminitialize.cc:}}[[@LINE-6]]
   // CHECK: AddressSanitizer can not provide additional info.
 }
Index: lib/sanitizer_common/sanitizer_win.cc
===================================================================
--- lib/sanitizer_common/sanitizer_win.cc
+++ lib/sanitizer_common/sanitizer_win.cc
@@ -735,6 +735,8 @@
   STACKFRAME64 stack_frame;
   memset(&stack_frame, 0, sizeof(stack_frame));
 
+  InitializeDbgHelpIfNeeded();
+
   size = 0;
 #if defined(_WIN64)
   int machine_type = IMAGE_FILE_MACHINE_AMD64;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22586.64741.patch
Type: text/x-patch
Size: 1242 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160720/8023ce5a/attachment.bin>


More information about the llvm-commits mailing list