Make v8::TracedReference a root for Scavenger if tracing is in progress
This fixes a stale pointer in the following scenario: 1) We have a JS object A in the young generation of V8's heap. 2) A Blink object B points to A via v8::TracedReference. 3) Incremental unified heap GC starts. 4) A V8 Scavenge happens during the unified heap GC and discovers that object A is reachable only via the v8::TracedReference. It checks whether the object can be collected using IsRootForNonTracingGC, which returns false. 5) Object A is collected by the Scavenger and object B points to a free region (i.e. it has a stale pointer to V8's heap). 6) Object B is traced and the stale pointer is reported to V8 and added to V8's marking worklist. 7) Next Scavenge crashes when it tries to update the marking worklist. Bug: 1019839 Change-Id: I6f5ae2e21273cdd3ea4150ceb0f70fe33eeb2614 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1893255 Commit-Queue: Ulan Degenbaev <ulan@chromium.org> Reviewed-by:Michael Lippautz <mlippautz@chromium.org> Cr-Commit-Position: refs/heads/master@{#711268}
Showing
Please register or sign in to comment