[PATCH] D20577: [esan|wset] Intercept and chain signal handlers

Filipe Cabecinhas via llvm-commits llvm-commits at lists.llvm.org
Wed May 25 07:24:42 PDT 2016


filcab added a subscriber: filcab.

================
Comment at: lib/esan/esan.h:43
@@ -42,1 +42,3 @@
 
+// Platform-varying routines.
+// The return value indicates whether to call the real version or not.
----------------
"Platform dependent"?

================
Comment at: lib/esan/working_set.h:28
@@ -27,1 +27,3 @@
 
+// Platform-varying
+void registerShadowFault();
----------------
Minor nit: dependent? They're not changing the platform.

================
Comment at: lib/esan/working_set_posix.cpp:67
@@ +66,3 @@
+
+static void handleShadowFault(int SigNum, void *Info, void *Ctx) {
+  if (SigNum == SIGSEGV) {
----------------
`handleSEGV` for now. Possibly `handleSignal` later.
This will be called for any SEGV, and `ShadowFault` isn't descriptive.

================
Comment at: lib/esan/working_set_posix.cpp:84
@@ +83,3 @@
+
+void registerShadowFault() {
+  // We do not use an alternate signal stack, as doing so would require
----------------
`registerSEGVHandler`

================
Comment at: test/esan/TestCases/workingset-fault.cpp:32
@@ +31,3 @@
+  if (sigsetjmp(mark, 1) == 0)
+    *((volatile int *)(ssize_t)argc) = 42; // Raise SIGSEGV
+  fprintf(stderr, "Past longjmp for signal\n");
----------------
Would `kill(SIGSEGV, getpid())` work?


http://reviews.llvm.org/D20577





More information about the llvm-commits mailing list