Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(400)

Issue 2673683002: HeapCompact: don't cast to BasePage before sanity check. (Closed)

Created:
3 years, 10 months ago by krasin1
Modified:
3 years, 10 months ago
Reviewers:
haraken, sof
CC:
chromium-reviews, oilpan-reviews, Mads Ager (chromium), blink-reviews, kinuko+watch, kouhei+heap_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

HeapCompact: don't cast to BasePage before sanity check. Otherwise, the cast might be performed on a garbage memory and CFI will detect that the cast is invalid as the vtable is invalid. BUG=688055 Review-Url: https://codereview.chromium.org/2673683002 Cr-Commit-Position: refs/heads/master@{#447922} Committed: https://chromium.googlesource.com/chromium/src/+/4116d5e5f6fd92ae9f75cc2bfe158068232c6dbe

Patch Set 1 #

Total comments: 4

Patch Set 2 : Add a comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -5 lines) Patch
M third_party/WebKit/Source/platform/heap/HeapCompact.cpp View 1 2 chunks +7 lines, -5 lines 0 comments Download

Messages

Total messages: 24 (14 generated)
krasin1
3 years, 10 months ago (2017-02-02 19:09:22 UTC) #2
haraken
LGTM
3 years, 10 months ago (2017-02-02 20:52:30 UTC) #3
krasin1
On 2017/02/02 20:52:30, haraken wrote: > LGTM Thank you, Kentaro!
3 years, 10 months ago (2017-02-02 21:17:53 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2673683002/1
3 years, 10 months ago (2017-02-02 21:24:41 UTC) #9
commit-bot: I haz the power
Try jobs failed on following builders: chromeos_amd64-generic_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_amd64-generic_chromium_compile_only_ng/builds/275385)
3 years, 10 months ago (2017-02-02 21:48:23 UTC) #11
sof
https://codereview.chromium.org/2673683002/diff/1/third_party/WebKit/Source/platform/heap/HeapCompact.cpp File third_party/WebKit/Source/platform/heap/HeapCompact.cpp (left): https://codereview.chromium.org/2673683002/diff/1/third_party/WebKit/Source/platform/heap/HeapCompact.cpp#oldcode247 third_party/WebKit/Source/platform/heap/HeapCompact.cpp:247: // All pages that are being compacted. Could you ...
3 years, 10 months ago (2017-02-02 22:04:42 UTC) #12
krasin1
https://codereview.chromium.org/2673683002/diff/1/third_party/WebKit/Source/platform/heap/HeapCompact.cpp File third_party/WebKit/Source/platform/heap/HeapCompact.cpp (left): https://codereview.chromium.org/2673683002/diff/1/third_party/WebKit/Source/platform/heap/HeapCompact.cpp#oldcode247 third_party/WebKit/Source/platform/heap/HeapCompact.cpp:247: // All pages that are being compacted. On 2017/02/02 ...
3 years, 10 months ago (2017-02-02 22:19:09 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2673683002/20001
3 years, 10 months ago (2017-02-03 00:08:39 UTC) #20
commit-bot: I haz the power
Committed patchset #2 (id:20001) as https://chromium.googlesource.com/chromium/src/+/4116d5e5f6fd92ae9f75cc2bfe158068232c6dbe
3 years, 10 months ago (2017-02-03 04:08:01 UTC) #23
sof
3 years, 10 months ago (2017-02-03 16:04:57 UTC) #24
Message was sent while issue was closed.
lgtm

https://codereview.chromium.org/2673683002/diff/1/third_party/WebKit/Source/p...
File third_party/WebKit/Source/platform/heap/HeapCompact.cpp (left):

https://codereview.chromium.org/2673683002/diff/1/third_party/WebKit/Source/p...
third_party/WebKit/Source/platform/heap/HeapCompact.cpp:247: // All pages that
are being compacted.
On 2017/02/02 22:19:09, krasin1 wrote:
> On 2017/02/02 22:04:41, sof wrote:
> > Could you update the comment to say that the void* points to the start of a
> > BasePage? "page" is a bit generic.
> 
> Is it better now?

Much better, thanks :)

https://codereview.chromium.org/2673683002/diff/1/third_party/WebKit/Source/p...
File third_party/WebKit/Source/platform/heap/HeapCompact.cpp (right):

https://codereview.chromium.org/2673683002/diff/1/third_party/WebKit/Source/p...
third_party/WebKit/Source/platform/heap/HeapCompact.cpp:89: BasePage* slotPage =
reinterpret_cast<BasePage*>(slotPageAddress);
nit: now only used if DCHECK_IS_ON().

Powered by Google App Engine
This is Rietveld 408576698