[PATCH] D48668: [TSan] More detailed error message on failed sahdow memory madvise
Aleksey Shlyapnikov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 28 14:43:26 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rCRT335928: [TSan] More detailed error message on failed sahdow memory madvise (authored by alekseyshl, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D48668?vs=153162&id=153406#toc
Repository:
rCRT Compiler Runtime
https://reviews.llvm.org/D48668
Files:
lib/tsan/rtl/tsan_platform_posix.cc
Index: lib/tsan/rtl/tsan_platform_posix.cc
===================================================================
--- lib/tsan/rtl/tsan_platform_posix.cc
+++ lib/tsan/rtl/tsan_platform_posix.cc
@@ -16,30 +16,37 @@
#if SANITIZER_POSIX
#include "sanitizer_common/sanitizer_common.h"
+#include "sanitizer_common/sanitizer_errno.h"
#include "sanitizer_common/sanitizer_libc.h"
#include "sanitizer_common/sanitizer_procmaps.h"
#include "tsan_platform.h"
#include "tsan_rtl.h"
namespace __tsan {
static const char kShadowMemoryMappingWarning[] =
- "FATAL: %s can not madvise shadow region [%zx, %zx] with %s\n";
+ "FATAL: %s can not madvise shadow region [%zx, %zx] with %s (errno: %d)\n";
+static const char kShadowMemoryMappingHint[] =
+ "HINT: if %s is not supported in your environment, you may set "
+ "TSAN_OPTIONS=%s=0\n";
static void NoHugePagesInShadow(uptr addr, uptr size) {
if (common_flags()->no_huge_pages_for_shadow)
if (!NoHugePagesInRegion(addr, size)) {
Printf(kShadowMemoryMappingWarning, SanitizerToolName, addr, addr + size,
- "MADV_NOHUGEPAGE");
+ "MADV_NOHUGEPAGE", errno);
+ Printf(kShadowMemoryMappingHint, "MADV_NOHUGEPAGE",
+ "no_huge_pages_for_shadow");
Die();
}
}
static void DontDumpShadow(uptr addr, uptr size) {
if (common_flags()->use_madv_dontdump)
if (!DontDumpShadowMemory(addr, size)) {
Printf(kShadowMemoryMappingWarning, SanitizerToolName, addr, addr + size,
- "MADV_DONTDUMP");
+ "MADV_DONTDUMP", errno);
+ Printf(kShadowMemoryMappingHint, "MADV_DONTDUMP", "use_madv_dontdump");
Die();
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48668.153406.patch
Type: text/x-patch
Size: 1679 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180628/b9816f56/attachment.bin>
More information about the llvm-commits
mailing list