[PATCH] sanitizer_common: fix and re-enable signal_segv_handler test

Dmitry Vyukov dvyukov at google.com
Mon Jun 29 07:07:56 PDT 2015


http://reviews.llvm.org/D10803

Files:
  TestCases/Linux/signal_segv_handler.cc

Index: TestCases/Linux/signal_segv_handler.cc
===================================================================
--- TestCases/Linux/signal_segv_handler.cc
+++ TestCases/Linux/signal_segv_handler.cc
@@ -13,12 +13,11 @@
 // "benign" SEGVs that are handled by signal handler, and ensures that
 // the process survive.
 
-// REQUIRES: disabled
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <signal.h>
 #include <sys/mman.h>
+#include <string.h>
 
 void *guard;
 
@@ -28,6 +27,8 @@
 
 int main() {
   struct sigaction a, old;
+  memset(&a, 0, sizeof(a));
+  memset(&old, 0, sizeof(old));
   a.sa_sigaction = handler;
   a.sa_flags = SA_SIGINFO;
   sigaction(SIGSEGV, &a, &old);

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10803.28669.patch
Type: text/x-patch
Size: 682 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150629/aa47d146/attachment.bin>


More information about the llvm-commits mailing list