tsan: restore Initialize call in Java entry points
authorDmitry Vyukov <dvyukov@google.com>
Thu, 29 Jul 2021 11:30:16 +0000 (13:30 +0200)
committerDmitry Vyukov <dvyukov@google.com>
Thu, 29 Jul 2021 15:13:09 +0000 (17:13 +0200)
We used to call Initialize in every Java point.
That was removed in 6563bb53b5 ("tsan: don't use caller/current PC in Java interfaces").
The intention was to add a single Initialize to __tsan_java_init instead.
Do that.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D107069

compiler-rt/lib/tsan/rtl/tsan_interface_java.cpp

index 011230c..270c136 100644 (file)
@@ -62,6 +62,7 @@ MBlock *JavaHeapBlock(uptr addr, uptr *start) {
 
 void __tsan_java_init(jptr heap_begin, jptr heap_size) {
   JAVA_FUNC_ENTER(__tsan_java_init);
+  Initialize(thr);
   DPrintf("#%d: java_init(%p, %p)\n", thr->tid, heap_begin, heap_size);
   CHECK_EQ(jctx, 0);
   CHECK_GT(heap_begin, 0);