• hpayer's avatar
    Filter out slot buffer slots, that point to SMIs in dead objects. · 8606664b
    hpayer authored
    The following situation may happen which reproduces this bug:
    (1) We allocate JSObject A on an evacuation candidate.
    (2) We allocate JSObject B on a non-evacuation candidate.
    (3) Incremental marking starts and marks object A and B.
    (4) We create a reference from B.field = A; which records the slot B.field since A is on an evacuation candidate.
    (5) After that we write a SMI into B.field.
    (6) After that B goes into dictionary mode and shrinks its original size. B.field is now outside of the JSObject, i.e B.field is in memory that will be freed by the sweeper threads.
    (7) GC is triggered.
    (8) BUG: Slots buffer filtering walks over the slots buffer, SMIs are not filtered out because we assumed that SMIs are just ignored when the slots get updated later. However, recorded SMI slots of dead objects may be overwritten by double values at evacuation time.
    (9) During evacuation, a heap number that looks like a valid pointer is moved over B.field.
    (10) The slots buffer is scanned for updates, follows B.field since it looks like a pointer (the double value looks like a pointer), and crashes.
    
    BUG=chromium:519577,chromium:454297
    LOG=y
    
    Review URL: https://codereview.chromium.org/1286343004
    
    Cr-Commit-Position: refs/heads/master@{#30200}
    8606664b
Name
Last commit
Last update
benchmarks Loading commit data...
build Loading commit data...
include Loading commit data...
infra Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
testing Loading commit data...
third_party/binutils Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.gitignore Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.gn Loading commit data...
ChangeLog Loading commit data...
DEPS Loading commit data...
LICENSE Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
LICENSE.valgrind Loading commit data...
Makefile Loading commit data...
Makefile.android Loading commit data...
Makefile.nacl Loading commit data...
OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...