summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/tests/sanitizer_stoptheworld_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sanitizer_common/tests/sanitizer_stoptheworld_test.cc')
-rw-r--r--lib/sanitizer_common/tests/sanitizer_stoptheworld_test.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/sanitizer_common/tests/sanitizer_stoptheworld_test.cc b/lib/sanitizer_common/tests/sanitizer_stoptheworld_test.cc
index b6786ba8b013b..802af392c6096 100644
--- a/lib/sanitizer_common/tests/sanitizer_stoptheworld_test.cc
+++ b/lib/sanitizer_common/tests/sanitizer_stoptheworld_test.cc
@@ -189,6 +189,16 @@ TEST(StopTheWorld, SuspendThreadsAdvanced) {
pthread_mutex_destroy(&advanced_incrementer_thread_exit_mutex);
}
+static void SegvCallback(const SuspendedThreadsList &suspended_threads_list,
+ void *argument) {
+ *(volatile int*)0x1234 = 0;
+}
+
+TEST(StopTheWorld, SegvInCallback) {
+ // Test that tracer thread catches SIGSEGV.
+ StopTheWorld(&SegvCallback, NULL);
+}
+
} // namespace __sanitizer
#endif // SANITIZER_LINUX && defined(__x86_64__)