[compiler-rt] r317874 - [esan] Fix compilation of signal handlers
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 9 21:41:13 PST 2017
Author: vitalybuka
Date: Thu Nov 9 21:41:13 2017
New Revision: 317874
URL: http://llvm.org/viewvc/llvm-project?rev=317874&view=rev
Log:
[esan] Fix compilation of signal handlers
Modified:
compiler-rt/trunk/lib/esan/esan_sideline.h
compiler-rt/trunk/lib/esan/esan_sideline_linux.cpp
compiler-rt/trunk/lib/esan/working_set_posix.cpp
Modified: compiler-rt/trunk/lib/esan/esan_sideline.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/esan/esan_sideline.h?rev=317874&r1=317873&r2=317874&view=diff
==============================================================================
--- compiler-rt/trunk/lib/esan/esan_sideline.h (original)
+++ compiler-rt/trunk/lib/esan/esan_sideline.h Thu Nov 9 21:41:13 2017
@@ -17,6 +17,7 @@
#include "sanitizer_common/sanitizer_atomic.h"
#include "sanitizer_common/sanitizer_internal_defs.h"
+#include "sanitizer_common/sanitizer_platform_limits_posix.h"
namespace __esan {
@@ -46,7 +47,8 @@ public:
private:
static int runSideline(void *Arg);
static void registerSignal(int SigNum);
- static void handleSidelineSignal(int SigNum, void *SigInfo, void *Ctx);
+ static void handleSidelineSignal(int SigNum, __sanitizer_siginfo *SigInfo,
+ void *Ctx);
char *Stack;
SidelineFunc sampleFunc;
Modified: compiler-rt/trunk/lib/esan/esan_sideline_linux.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/esan/esan_sideline_linux.cpp?rev=317874&r1=317873&r2=317874&view=diff
==============================================================================
--- compiler-rt/trunk/lib/esan/esan_sideline_linux.cpp (original)
+++ compiler-rt/trunk/lib/esan/esan_sideline_linux.cpp Thu Nov 9 21:41:13 2017
@@ -40,7 +40,8 @@ static const uptr SidelineIdUninitialize
static SidelineThread *TheThread;
// We aren't passing SA_NODEFER so the same signal is blocked while here.
-void SidelineThread::handleSidelineSignal(int SigNum, void *SigInfo,
+void SidelineThread::handleSidelineSignal(int SigNum,
+ __sanitizer_siginfo *SigInfo,
void *Ctx) {
VPrintf(3, "Sideline signal %d\n", SigNum);
CHECK_EQ(SigNum, SIGALRM);
Modified: compiler-rt/trunk/lib/esan/working_set_posix.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/esan/working_set_posix.cpp?rev=317874&r1=317873&r2=317874&view=diff
==============================================================================
--- compiler-rt/trunk/lib/esan/working_set_posix.cpp (original)
+++ compiler-rt/trunk/lib/esan/working_set_posix.cpp Thu Nov 9 21:41:13 2017
@@ -34,7 +34,7 @@ bool processWorkingSetSignal(int SigNum,
VPrintf(2, "%s: %d\n", __FUNCTION__, SigNum);
if (SigNum == SIGSEGV) {
*Result = AppSigAct.handler;
- AppSigAct.sigaction = (void (*)(int, void*, void*))Handler;
+ AppSigAct.sigaction = (decltype(AppSigAct.sigaction))Handler;
return false; // Skip real call.
}
return true;
@@ -73,7 +73,7 @@ bool processWorkingSetSigprocmask(int Ho
static void reinstateDefaultHandler(int SigNum) {
__sanitizer_sigaction SigAct;
internal_memset(&SigAct, 0, sizeof(SigAct));
- SigAct.sigaction = (void (*)(int, void*, void*)) SIG_DFL;
+ SigAct.sigaction = (decltype(SigAct.sigaction))SIG_DFL;
int Res = internal_sigaction(SigNum, &SigAct, nullptr);
CHECK(Res == 0);
VPrintf(1, "Unregistered for %d handler\n", SigNum);
@@ -81,7 +81,8 @@ static void reinstateDefaultHandler(int
// If this is a shadow fault, we handle it here; otherwise, we pass it to the
// app to handle it just as the app would do without our tool in place.
-static void handleMemoryFault(int SigNum, void *Info, void *Ctx) {
+static void handleMemoryFault(int SigNum, __sanitizer_siginfo *Info,
+ void *Ctx) {
if (SigNum == SIGSEGV) {
// We rely on si_addr being filled in (thus we do not support old kernels).
siginfo_t *SigInfo = (siginfo_t *)Info;
More information about the llvm-commits
mailing list