about summary refs log tree commit diff
diff options
context:
space:
mode:
authorhexcoder- <heiko@hexco.de>2019-10-20 03:34:46 +0200
committerhexcoder- <heiko@hexco.de>2019-10-20 03:34:46 +0200
commita282ae22afec0e5d5a8455c7aaa3e472839788e4 (patch)
tree91aeafb55123bad46eeeb6e2a6c49754c2fc17e2
parentc83e8e1e6255374b085292ba8673efdca7388d76 (diff)
downloadafl++-a282ae22afec0e5d5a8455c7aaa3e472839788e4.tar.gz
In OpenBSD initial thread local storage is allocated with calloc(),
which leads to locked mutexes and a stall. So no thread support
(and no tls) here.
-rw-r--r--libdislocator/libdislocator.so.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libdislocator/libdislocator.so.c b/libdislocator/libdislocator.so.c
index 57607210..f3f02c8b 100644
--- a/libdislocator/libdislocator.so.c
+++ b/libdislocator/libdislocator.so.c
@@ -88,6 +88,10 @@ static u8  alloc_verbose,               /* Additional debug messages        */
     hard_fail,                          /* abort() when max_mem exceeded?   */
     no_calloc_over;                     /* abort() on calloc() overflows?   */
 
+#ifdef	__OpenBSD__
+#define __thread
+#warning no thread support available
+#endif
 static __thread size_t total_mem;       /* Currently allocated mem          */
 
 static __thread u32 call_depth;         /* To avoid recursion via fprintf() */