v8/tools/debug_helper
Seth Brenith 18e1eec3d7 [v8windbg] Fix crash when reading external strings
The debug_helper library is intended to be used from a debugger process
which is attached to the debuggee process that includes V8 content. When
reading memory from the debuggee process, debug_helper should use the
MemoryAccessor function which reads remote memory rather than
dereferencing pointers into the debugger's memory space and potentially
crashing. I recently noticed that v8windbg crashes on external strings
because the sandbox has been enabled, and the debug_helper code for
external strings was incorrectly reading memory from the debugger
process rather than the debuggee.

You might ask: why wasn't this caught in automated tests? There is a
test, cctest/test-debug-helper, which exercises this exact code, but it
does so with the debugger and debuggee in the same process. Setting up a
proper cross-process test would be much more complex and
platform-specific, and this class of bug has never turned up before, so
I think the existing test coverage is adequate.

Change-Id: Ib8730dd47a925f4229962d27b576a759c5a9a9ad
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4043821
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Reviewed-by: Samuel Groß <saelo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84520}
2022-11-28 16:13:09 +00:00
..
BUILD.gn Revert "Reland "[DEPS] Add abseil to deps"" 2021-09-28 20:08:22 +00:00
compiler-types.cc [v8windbg] Show bitset name of compiler type 2020-06-23 19:36:36 +00:00
debug-helper-internal.cc [ptr-compr] Store cage bases in globals when cage sharing is enabled 2022-11-22 08:00:16 +00:00
debug-helper-internal.h [v8windbg] Display js function only for js frame 2020-09-21 07:50:14 +00:00
debug-helper.h [v8windbg] Display js function only for js frame 2020-09-21 07:50:14 +00:00
debug-macro-shims.h Reland "Reland "[Torque] Generalize Torque literals to larger size"" 2022-02-04 09:40:24 +00:00
DEPS Reland "Add postmortem debugging helper library" 2019-07-31 14:30:19 +00:00
gen-heap-constants.py [ptr-compr] Store cage bases in globals when cage sharing is enabled 2022-11-22 08:00:16 +00:00
get-object-properties.cc [v8windbg] Fix crash when reading external strings 2022-11-28 16:13:09 +00:00
heap-constants.cc [heap] Add flag for disabling map space 2022-02-18 09:03:07 +00:00
heap-constants.h [heap] Add flag for disabling map space 2022-02-18 09:03:07 +00:00
list-object-classes.cc Reland "[torque] refactor: use -tq only in filenames derived from .tq files" 2020-09-25 15:04:18 +00:00
OWNERS Add myself as an owner for debug-helper and v8windbg 2020-09-21 15:19:27 +00:00
README.md Reland "Add postmortem debugging helper library" 2019-07-31 14:30:19 +00:00

V8 debug helper

This library is for debugging V8 itself, not debugging JavaScript running within V8. It is designed to be called from a debugger extension running within a native debugger such as WinDbg or LLDB. It can be used on live processes or crash dumps, and cannot assume that all memory is available in a dump.