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

Unified Diff: src/heap/mark-compact.cc

Issue 2416563002: [heap] Fix forwarding pointer race between sweeper threads and pointer updating threads. (Closed)
Patch Set: explict bailout Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index 78bafce3d6fc52d9c871eb2286df5e6970ed74f6..77aa603eb73f53c298863e45a65e4b7d5a0d759b 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -3640,6 +3640,11 @@ class PointerUpdateJobTraits {
// There could still be stale pointers in large object space, map space,
// and old space for pages that have been promoted.
if (map_word.IsForwardingAddress()) {
+ // A sweeper thread may concurrently write a size value which looks like
+ // a forwarding pointer. We have to ignore these values.
+ if (map_word.ToRawValue() < Page::kPageSize) {
+ return REMOVE_SLOT;
+ }
// Update the corresponding slot.
*slot = map_word.ToForwardingAddress();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698