• Samuel Groß's avatar
    [sandbox] Fix serialization of NativeContext · a9990e08
    Samuel Groß authored
    When a NativeContext is being serialized, the NativeContext's
    microtask_queue is set to nullptr as it is not included in the snapshot.
    However, when the sandbox is enabled, this will only set the pointer in
    the external pointer table to nullptr, but not the handle stored in the
    object. This then causes the deserialized object to briefly be invalid,
    before it's microtask queue handle is (re-)initialized. If a GC runs
    during that timeframe, it will see an invalid external pointer handle,
    which may cause DCHECK failures.
    To fix this, this CL now introduces a generic mechanism for clearing and
    restoring external pointer slots for serialization.
    
    Bug: v8:13218
    Change-Id: I03c8779bbec0a42a0b66687e76c951b1887e6122
    Cq-Include-Trybots: luci.v8.try:v8_linux64_heap_sandbox_dbg_ng,v8_linux_arm64_sim_heap_sandbox_dbg_ng
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3850294Reviewed-by: 's avatarJakob Linke <jgruber@chromium.org>
    Commit-Queue: Samuel Groß <saelo@chromium.org>
    Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#82677}
    a9990e08
Name
Last commit
Last update
..
embedded Loading commit data...
DEPS Loading commit data...
DIR_METADATA Loading commit data...
OWNERS Loading commit data...
code-serializer.cc Loading commit data...
code-serializer.h Loading commit data...
context-deserializer.cc Loading commit data...
context-deserializer.h Loading commit data...
context-serializer.cc Loading commit data...
context-serializer.h Loading commit data...
deserializer.cc Loading commit data...
deserializer.h Loading commit data...
mksnapshot.cc Loading commit data...
object-deserializer.cc Loading commit data...
object-deserializer.h Loading commit data...
read-only-deserializer.cc Loading commit data...
read-only-deserializer.h Loading commit data...
read-only-serializer.cc Loading commit data...
read-only-serializer.h Loading commit data...
references.h Loading commit data...
roots-serializer.cc Loading commit data...
roots-serializer.h Loading commit data...
serializer-deserializer.cc Loading commit data...
serializer-deserializer.h Loading commit data...
serializer-inl.h Loading commit data...
serializer.cc Loading commit data...
serializer.h Loading commit data...
shared-heap-deserializer.cc Loading commit data...
shared-heap-deserializer.h Loading commit data...
shared-heap-serializer.cc Loading commit data...
shared-heap-serializer.h Loading commit data...
snapshot-compression.cc Loading commit data...
snapshot-compression.h Loading commit data...
snapshot-data.cc Loading commit data...
snapshot-data.h Loading commit data...
snapshot-empty.cc Loading commit data...
snapshot-external.cc Loading commit data...
snapshot-source-sink.cc Loading commit data...
snapshot-source-sink.h Loading commit data...
snapshot-utils.cc Loading commit data...
snapshot-utils.h Loading commit data...
snapshot.cc Loading commit data...
snapshot.h Loading commit data...
startup-deserializer.cc Loading commit data...
startup-deserializer.h Loading commit data...
startup-serializer.cc Loading commit data...
startup-serializer.h Loading commit data...