aboutsummaryrefslogtreecommitdiff
path: root/lib/asan/asan_posix.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/asan/asan_posix.cc')
-rw-r--r--lib/asan/asan_posix.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/asan/asan_posix.cc b/lib/asan/asan_posix.cc
index 2e857f6f624c..9e01bcd091bf 100644
--- a/lib/asan/asan_posix.cc
+++ b/lib/asan/asan_posix.cc
@@ -33,11 +33,11 @@
namespace __asan {
-void AsanOnSIGSEGV(int, void *siginfo, void *context) {
+void AsanOnDeadlySignal(int signo, void *siginfo, void *context) {
ScopedDeadlySignal signal_scope(GetCurrentThread());
int code = (int)((siginfo_t*)siginfo)->si_code;
// Write the first message using the bullet-proof write.
- if (13 != internal_write(2, "ASAN:SIGSEGV\n", 13)) Die();
+ if (18 != internal_write(2, "ASAN:DEADLYSIGNAL\n", 18)) Die();
SignalContext sig = SignalContext::Create(siginfo, context);
// Access at a reasonable offset above SP, or slightly below it (to account
@@ -75,8 +75,12 @@ void AsanOnSIGSEGV(int, void *siginfo, void *context) {
// unaligned memory access.
if (IsStackAccess && (code == si_SEGV_MAPERR || code == si_SEGV_ACCERR))
ReportStackOverflow(sig);
+ else if (signo == SIGFPE)
+ ReportDeadlySignal("FPE", sig);
+ else if (signo == SIGILL)
+ ReportDeadlySignal("ILL", sig);
else
- ReportSIGSEGV("SEGV", sig);
+ ReportDeadlySignal("SEGV", sig);
}
// ---------------------- TSD ---------------- {{{1