small progress.

This commit is contained in:
christos 2016-06-11 23:10:01 +00:00
parent fae93e9b6d
commit dbe760216f
2 changed files with 14 additions and 3 deletions

View File

@ -36,6 +36,13 @@ using namespace __tsan; // NOLINT
#define stdout __stdoutp #define stdout __stdoutp
#define stderr __stderrp #define stderr __stderrp
#endif #endif
#if SANITIZER_NETBSD
#define __errno_location __errno
#define pthread_yield sched_yield
#define fileno_unlocked fileno
#define stdout __sF[1]
#define stderr __sF[2]
#endif
const int kSigCount = 65; const int kSigCount = 65;
@ -73,7 +80,11 @@ extern "C" void __libc_free(void *ptr);
#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD #if !SANITIZER_FREEBSD && !SANITIZER_NETBSD
extern "C" int mallopt(int param, int value); extern "C" int mallopt(int param, int value);
#endif #endif
#if SANITIZER_NETBSD
extern __sanitizer_FILE **__sF;
#else
extern __sanitizer_FILE *stdout, *stderr; extern __sanitizer_FILE *stdout, *stderr;
#endif
const int PTHREAD_MUTEX_RECURSIVE = 1; const int PTHREAD_MUTEX_RECURSIVE = 1;
const int PTHREAD_MUTEX_RECURSIVE_NP = 1; const int PTHREAD_MUTEX_RECURSIVE_NP = 1;
const int EINVAL = 22; const int EINVAL = 22;

View File

@ -12,7 +12,7 @@
#include "sanitizer_common/sanitizer_platform.h" #include "sanitizer_common/sanitizer_platform.h"
#if SANITIZER_LINUX || SANITIZER_FREEBSD #if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD
#include "sanitizer_common/sanitizer_common.h" #include "sanitizer_common/sanitizer_common.h"
#include "sanitizer_common/sanitizer_libc.h" #include "sanitizer_common/sanitizer_libc.h"
@ -316,7 +316,7 @@ static void CheckAndProtect() {
if (p >= 0xf000000000000000ull) // vdso if (p >= 0xf000000000000000ull) // vdso
break; break;
Printf("FATAL: ThreadSanitizer: unexpected memory mapping %p-%p\n", p, end); Printf("FATAL: ThreadSanitizer: unexpected memory mapping %p-%p\n", p, end);
Die(); // Die();
} }
ProtectRange(kLoAppMemEnd, kShadowBeg); ProtectRange(kLoAppMemEnd, kShadowBeg);
@ -423,4 +423,4 @@ int call_pthread_cancel_with_cleanup(int(*fn)(void *c, void *m,
} // namespace __tsan } // namespace __tsan
#endif // SANITIZER_LINUX || SANITIZER_FREEBSD #endif // SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD