Skip to content

Commit d24dd2b

Browse files
committed
tsan: fix test in debug mode
sanitizer-x86_64-linux-autoconf has failed after the previous tsan commit: FAIL: ThreadSanitizer-x86_64 :: java_finalizer2.cpp (245 of 403) ******************** TEST 'ThreadSanitizer-x86_64 :: java_finalizer2.cpp' FAILED ******************** Script: -- : 'RUN: at line 1'; /b/sanitizer-x86_64-linux-autoconf/build/tsan_debug_build/./bin/clang --driver-mode=g++ -fsanitize=thread -Wall -m64 -gline-tables-only -I/b/sanitizer-x86_64-linux-autoconf/build/llvm-project/compiler-rt/test/tsan/../ -std=c++11 -I/b/sanitizer-x86_64-linux-autoconf/build/llvm-project/compiler-rt/test/tsan/../ -nostdinc++ -I/b/sanitizer-x86_64-linux-autoconf/build/tsan_debug_build/tools/clang/runtime/compiler-rt-bins/lib/tsan/libcxx_tsan_x86_64/include/c++/v1 -O1 /b/sanitizer-x86_64-linux-autoconf/build/llvm-project/compiler-rt/test/tsan/java_finalizer2.cpp -o /b/sanitizer-x86_64-linux-autoconf/build/tsan_debug_build/tools/clang/runtime/compiler-rt-bins/test/tsan/X86_64Config/Output/java_finalizer2.cpp.tmp && /b/sanitizer-x86_64-linux-autoconf/build/tsan_debug_build/tools/clang/runtime/compiler-rt-bins/test/tsan/X86_64Config/Output/java_finalizer2.cpp.tmp 2>&1 | FileCheck /b/sanitizer-x86_64-linux-autoconf/build/llvm-project/compiler-rt/test/tsan/java_finalizer2.cpp -- Exit Code: 1 Command Output (stderr): -- /b/sanitizer-x86_64-linux-autoconf/build/llvm-project/compiler-rt/test/tsan/java_finalizer2.cpp:82:11: error: CHECK: expected string not found in input // CHECK: DONE ^ <stdin>:1:1: note: scanning from here FATAL: ThreadSanitizer CHECK failed: /b/sanitizer-x86_64-linux-autoconf/build/llvm-project/compiler-rt/lib/tsan/rtl/tsan_sync.cpp:69 "((*meta)) == ((0))" (0x4000003e, 0x0) ^ <stdin>:5:12: note: possible intended match here rust-lang#3 __tsan::OnUserAlloc(__tsan::ThreadState*, unsigned long, unsigned long, unsigned long, bool) /b/sanitizer-x86_64-linux-autoconf/build/llvm-project/compiler-rt/lib/tsan/rtl/tsan_mman.cpp:225:16 (java_finalizer2.cpp.tmp+0x4af407) ^ http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-autoconf/builds/51143/steps/test%20tsan%20in%20debug%20compiler-rt%20build/logs/stdio Fix heap object overlap by offsetting java heap as other tests are doing.
1 parent eb1092a commit d24dd2b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler-rt/test/tsan/java_finalizer2.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ void *Ballast(void *p) {
4747
}
4848

4949
int main() {
50-
Heap* heap = (Heap*)calloc(sizeof(Heap), 1);
50+
Heap* heap = (Heap*)calloc(sizeof(Heap), 2) + 1;
5151
__tsan_java_init((jptr)heap, sizeof(*heap));
5252
__tsan_java_alloc((jptr)heap, sizeof(*heap));
5353
// Ballast threads merely make the bug a bit easier to trigger.

0 commit comments

Comments
 (0)