summaryrefslogtreecommitdiff
path: root/src/pal/src/exception/signal.cpp
diff options
context:
space:
mode:
authorKonstantin Baladurin <k.baladurin@partner.samsung.com>2018-01-26 01:19:19 +0300
committerJan Vorlicek <janvorli@microsoft.com>2018-01-25 23:19:19 +0100
commit9639f454de21775ab1031471c2acb64738b77c95 (patch)
treedbbe9db41865ddee216ec447dec6f4238eab8a26 /src/pal/src/exception/signal.cpp
parent209415618ca5d1a5d1d9e39ca78d643d0935534e (diff)
downloadcoreclr-9639f454de21775ab1031471c2acb64738b77c95.tar.gz
coreclr-9639f454de21775ab1031471c2acb64738b77c95.tar.bz2
coreclr-9639f454de21775ab1031471c2acb64738b77c95.zip
Fix asan false-positive errors: (#15563)
- Call __asan_handle_no_return in RtlRestoreContext if it doesn't return and in ThrowExceptionFromContextInternal function; - Increase alternate signal stack size and use it also for asan.
Diffstat (limited to 'src/pal/src/exception/signal.cpp')
-rw-r--r--src/pal/src/exception/signal.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/pal/src/exception/signal.cpp b/src/pal/src/exception/signal.cpp
index 012e320338..a27382315c 100644
--- a/src/pal/src/exception/signal.cpp
+++ b/src/pal/src/exception/signal.cpp
@@ -153,6 +153,11 @@ BOOL EnsureSignalAlternateStack()
// We include the size of the SignalHandlerWorkerReturnPoint in the alternate stack size since the
// context contained in it is large and the SIGSTKSZ was not sufficient on ARM64 during testing.
int altStackSize = SIGSTKSZ + ALIGN_UP(sizeof(SignalHandlerWorkerReturnPoint), 16) + GetVirtualPageSize();
+#ifdef HAS_ASAN
+ // Asan also uses alternate stack so we increase its size on the SIGSTKSZ * 4 that enough for asan
+ // (see kAltStackSize in compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cc)
+ altStackSize += SIGSTKSZ * 4;
+#endif
void* altStack;
int st = posix_memalign(&altStack, GetVirtualPageSize(), altStackSize);
if (st == 0)