dart-sdk/runtime/platform
Martin Kustermann 389aab624d [vm] Allow non-TSAN gen_snapshot target TSAN AOT runtime
This is a revert of b6bbfff8c0c6c44cdab0d7d78 which temporarily disabled
this.

Turns out that a non-TSAN gen_snapshot would - when emitting code via
`Assembler::TsanLoadAcquire` - use an incorrect `Thread`-offset:

It calculated the offset via `Thread::OffsetFromThread`. That function
took a `dart::RuntimeEntry*` and tried to find its offset.

We happen to have the following leaf runtime entries:

  #define LEAF_RUNTIME_ENTRY_LIST(V)
      ...
      V(void, MsanUnpoison, void*, size_t)
      V(void, MsanUnpoisonParam, size_t)
      V(void, TsanLoadAcquire, void*)
      V(void, TsanStoreRelease, void*)
      ...

It loops over all runtime entries and finds the first one that has the
identical `dart::RuntimeEntry::function_` pointer.

Though all 4 of them are `nullptr` at `gen_snapshot` time, so when
searching for offset for

  `Thread::OffsetFromThread(kTsanLoadAcquireRuntimeEntry)`

it looked for the first runtime entry with `nullptr` function pointer -
which turned out to be `MsanUnpoison` (instead of `TsanLoadAcquire`).

=> The obvious fix is to use the `dart::RuntimeEntry*` pointer for
comparison instead of it's `function_` member.

TEST=ci
Issue b/287638965

Change-Id: I85c06674927978ef8561e9e7bdfab4823c0a8e1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312902
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-07-10 11:53:58 +00:00
..
address_sanitizer.h Revert "[vm] Mark Zone memory as unallocated/allocated/uninitialized for Address and Memory Sanitizer." 2023-06-16 11:22:38 +00:00
allocation.cc
allocation.h
assert.cc [vm] Update NULL to nullptr in runtime/platform. 2023-03-30 20:49:48 +00:00
assert.h Reland "[vm] Migrate FFI callbacks to the new metadata system." 2023-06-06 02:07:58 +00:00
atomic.h
BUILD.gn
elf.h [vm] Update to constexpr in runtime/platform and lib. 2023-04-11 17:43:58 +00:00
floating_point.h
floating_point_win.cc
floating_point_win.h
globals.h
growable_array.h [vm] Update NULL to nullptr in runtime/platform. 2023-03-30 20:49:48 +00:00
hashmap.cc [vm] Update NULL to nullptr in runtime/platform. 2023-03-30 20:49:48 +00:00
hashmap.h [vm] Update NULL to nullptr in runtime/platform. 2023-03-30 20:49:48 +00:00
leak_sanitizer.h [vm] Fix zero-as-null-pointer-constant warnings in the VM. 2023-04-10 21:38:57 +00:00
mach_o.h [vm] Update to constexpr in runtime/platform and lib. 2023-04-11 17:43:58 +00:00
memory_sanitizer.h Revert "[vm] Mark Zone memory as unallocated/allocated/uninitialized for Address and Memory Sanitizer." 2023-06-16 11:22:38 +00:00
pe.h [vm] Update to constexpr in runtime/platform and lib. 2023-04-11 17:43:58 +00:00
platform_sources.gni [vm/win/aot] Provide unwinding information for Windows AOT snapshots. 2023-05-11 03:14:27 +00:00
priority_queue.h [vm] Update to constexpr in runtime/platform and lib. 2023-04-11 17:43:58 +00:00
safe_stack.h
signal_blocker.h [vm] Update NULL to nullptr in runtime/platform. 2023-03-30 20:49:48 +00:00
splay-tree-inl.h
splay-tree.h
syslog.h
syslog_android.cc
syslog_fuchsia.cc
syslog_linux.cc
syslog_macos.cc
syslog_win.cc
text_buffer.cc [VM/Service] Rename JSONStream::AppendSerializedObject to JSONStream::AppendBytes 2023-04-17 15:58:28 +00:00
text_buffer.h
thread_sanitizer.h [vm] Allow non-TSAN gen_snapshot target TSAN AOT runtime 2023-07-10 11:53:58 +00:00
unaligned.h
undefined_behavior_sanitizer.h
unicode.cc [vm] Update to constexpr in runtime/platform and lib. 2023-04-11 17:43:58 +00:00
unicode.h [vm] Update to constexpr in runtime/platform and lib. 2023-04-11 17:43:58 +00:00
unwinding_records.cc [platform] Fix include of vm/globals.h instead of platform/globals.h. 2023-05-11 11:53:56 +00:00
unwinding_records.h [vm/win/aot] Provide unwinding information for Windows AOT snapshots. 2023-05-11 03:14:27 +00:00
unwinding_records_win.cc [vm/ffi] Move ffi-callback related state from Thread to ObjectStore, move jit trampolines from Isolate to IsolateGroup 2023-05-17 11:23:28 +00:00
utils.cc [vm] Make clz/ctz inlinable. 2023-05-15 17:52:49 +00:00
utils.h [vm] Make clz/ctz inlinable. 2023-05-15 17:52:49 +00:00
utils_android.cc
utils_android.h
utils_fuchsia.cc
utils_fuchsia.h
utils_linux.cc
utils_linux.h
utils_macos.cc [vm] Update NULL to nullptr in runtime/platform. 2023-03-30 20:49:48 +00:00
utils_macos.h
utils_win.cc [vm] Update NULL to nullptr in runtime/platform. 2023-03-30 20:49:48 +00:00
utils_win.h