Commit a8268e6b authored by Jakob Kummerow's avatar Jakob Kummerow Committed by Commit Bot

Fix possibly-unaligned read in TickSample::Init

This is a speculative fix for issue 8744. I couldn't get it to
repro locally, but the stracktrace from the failing bot run points
at TickSample::Init, and according to code comments in that function
the value of {regs.sp} can be "arbitrary", so we must read from
that address using a method that's robust towards unalignment.

Bug: v8:8744
Change-Id: I7a45cc257e0eb557715ec67d9e66e54a6f2c1867
Reviewed-on: https://chromium-review.googlesource.com/c/1440463Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59186}
parent f5ba52e2
...@@ -173,8 +173,7 @@ DISABLE_ASAN void TickSample::Init(Isolate* v8_isolate, ...@@ -173,8 +173,7 @@ DISABLE_ASAN void TickSample::Init(Isolate* v8_isolate,
MSAN_MEMORY_IS_INITIALIZED(regs.sp, sizeof(void*)); MSAN_MEMORY_IS_INITIALIZED(regs.sp, sizeof(void*));
// Sample potential return address value for frameless invocation of // Sample potential return address value for frameless invocation of
// stubs (we'll figure out later, if this value makes sense). // stubs (we'll figure out later, if this value makes sense).
tos = reinterpret_cast<void*>( tos = i::ReadUnalignedValue<void*>(reinterpret_cast<i::Address>(regs.sp));
i::Memory<i::Address>(reinterpret_cast<i::Address>(regs.sp)));
} else { } else {
tos = nullptr; tos = nullptr;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment