Bug 1587066 - Use native abort() for ThreadSanitizer. r=jseward

Differential Revision: https://phabricator.services.mozilla.com/D48532

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Christian Holler 2019-10-09 14:27:21 +00:00
parent 665bdb853c
commit 4cbcb23e42

View File

@ -55,7 +55,7 @@ void fillAbortMessage(char (&msg)[N], uintptr_t retAddress) {
} }
#endif #endif
#if defined(XP_UNIX) && !defined(MOZ_ASAN) #if defined(XP_UNIX) && !defined(MOZ_ASAN) && !defined(MOZ_TSAN)
// Define abort() here, so that it is used instead of the system abort(). This // Define abort() here, so that it is used instead of the system abort(). This
// lets us control the behavior when aborting, in order to get better results // lets us control the behavior when aborting, in order to get better results
// on *NIX platforms. See mozalloc_abort for details. // on *NIX platforms. See mozalloc_abort for details.
@ -68,6 +68,9 @@ void fillAbortMessage(char (&msg)[N], uintptr_t retAddress) {
// //
// That segmentation fault will be interpreted as another bug by ASan and as a // That segmentation fault will be interpreted as another bug by ASan and as a
// result, ASan will just exit(1) instead of aborting. // result, ASan will just exit(1) instead of aborting.
//
// The same applies to ThreadSanitizer when run with "halt_on_error=1" in
// combination with "abort_on_error=1".
extern "C" void abort(void) { extern "C" void abort(void) {
# ifdef MOZ_WIDGET_ANDROID # ifdef MOZ_WIDGET_ANDROID
char msg[64] = {}; char msg[64] = {};