]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Enable address sanitizer on MacOS 9909/head
authorOtto Moerbeek <otto@drijf.net>
Tue, 5 Jan 2021 10:10:08 +0000 (11:10 +0100)
committerOtto Moerbeek <otto@drijf.net>
Tue, 5 Jan 2021 10:10:08 +0000 (11:10 +0100)
pdns/mtasker.hh
pdns/recursordist/configure.ac

index 2b9301d9a17942382a6a3cc4a7c8c7be7163cd7f..607ca57745877455caea7061040ba44c7ef8e5e9 100644 (file)
@@ -97,11 +97,19 @@ public:
   void initMainStackBounds()
   {
 #ifdef HAVE_FIBER_SANITIZER
+
+#ifdef HAVE_PTHREAD_GETATTR_NP
     pthread_attr_t attr;
     pthread_attr_init(&attr);
     pthread_getattr_np(pthread_self(), &attr);
     pthread_attr_getstack(&attr, &t_mainStack, &t_mainStackSize);
     pthread_attr_destroy(&attr);
+#endif
+#if defined(HAVE_PTHREAD_GET_STACKSIZE_NP) && defined(HAVE_PTHREAD_GET_STACKADDR_NP)
+    t_mainStack = pthread_get_stackaddr_np(pthread_self());
+    t_mainStackSize = pthread_get_stacksize_np(pthread_self());
+#endif
+
 #endif /* HAVE_FIBER_SANITIZER */
   }
 
index f5f525ad5ea5ed394fe58eef6b3d9f38b0844528..b3437599b90cee4980a86243ea5142b990229a31 100644 (file)
@@ -95,7 +95,7 @@ PDNS_CHECK_CURL
 
 dnl the *_r functions are in posix so we can use them unconditionally, but the ext/yahttp code is
 dnl using the defines.
-AC_CHECK_FUNCS_ONCE([localtime_r gmtime_r strcasestr getrandom arc4random])
+AC_CHECK_FUNCS_ONCE([localtime_r gmtime_r strcasestr getrandom arc4random pthread_getattr_np pthread_get_stackaddr_np pthread_get_stacksize_np])
 
 PDNS_CHECK_PTHREAD_NP