|
|
Created:
5 years, 3 months ago by fedor.indutny Modified:
5 years, 3 months ago Reviewers:
Michael Lippautz, jochen (gone - plz use gerrit) CC:
v8-reviews_googlegroups.com Base URL:
https://chromium.googlesource.com/v8/v8.git@master Target Ref:
refs/pending/heads/master Project:
v8 Visibility:
Public. |
Description[objects] do not visit ArrayBuffer's backing store
ArrayBuffer's backing store is a pointer to external heap, and can't be
treated as a heap object. Doing so will result in crashes, when the
backing store is unaligned.
See: https://github.com/nodejs/node/issues/2791
BUG=chromium:530531
R=mlippautz@chromium.org
LOG=N
Committed: https://crrev.com/0d017282d32ce634f364461aa79ee996108f8b9d
Cr-Commit-Position: refs/heads/master@{#30771}
Patch Set 1 #
Total comments: 4
Patch Set 2 : fixes #Patch Set 3 : remove unused var in test #Patch Set 4 : visit all fields in array buffer, reorder fields for simplicity #
Created: 5 years, 3 months ago
Messages
Total messages: 35 (10 generated)
Hello again! One more CL from me. I hope you don't mind! ;) I'm not sure if this patch covers all edge cases, especially if the backing store could still be visited from the layout descriptor. Does ArrayBuffer have LayoutDescriptor? Thanks!
mlippautz@chromium.org changed reviewers: + jochen@chromium.org
+jochen I added a tracking bug for this issue. Will maybe have a look today or starting Monday. -Michael
Thanks for digging into this, but I think there are some problems. The main problem I see is that we also have to deal with non-externalized buffers. This is completely missing from the specialized visitors. I leave the main review to Jochen, as he knows more about ArrayBuffers.
Oh yeah, I forgot about it. Looking forward for full review! Thanks.
Hello! Just wanted to let you know that this is very critical for node.js . There are many C++ modules that are currently crashing because of this. Thank you very much, Fedor.
Object::ContentType needs to return kMixedValues for array buffers, and all call-sites of content type need to be updated to deal with array buffers. https://codereview.chromium.org/1327403002/diff/1/src/objects-inl.h File src/objects-inl.h (right): https://codereview.chromium.org/1327403002/diff/1/src/objects-inl.h#newcode6594 src/objects-inl.h:6594: HeapObject::RawField(obj, JSArrayBuffer::BodyDescriptor::kStartOffset), I wouldn't use constants here, just visit the length and the internal fields https://codereview.chromium.org/1327403002/diff/1/src/objects.h File src/objects.h (right): https://codereview.chromium.org/1327403002/diff/1/src/objects.h#newcode9679 src/objects.h:9679: class BodyDescriptor { instead of having a body description, just add two methods called JSArrayBufferIterateBody() to JSArrayBuffer (similar to what FixedTypedArrayBase has)
All fixed. Thanks! https://codereview.chromium.org/1327403002/diff/1/src/objects-inl.h File src/objects-inl.h (right): https://codereview.chromium.org/1327403002/diff/1/src/objects-inl.h#newcode6594 src/objects-inl.h:6594: HeapObject::RawField(obj, JSArrayBuffer::BodyDescriptor::kStartOffset), On 2015/09/14 10:04:36, jochen wrote: > I wouldn't use constants here, just visit the length and the internal fields Acknowledged. https://codereview.chromium.org/1327403002/diff/1/src/objects.h File src/objects.h (right): https://codereview.chromium.org/1327403002/diff/1/src/objects.h#newcode9679 src/objects.h:9679: class BodyDescriptor { On 2015/09/14 10:04:36, jochen wrote: > instead of having a body description, just add two methods called > JSArrayBufferIterateBody() to JSArrayBuffer (similar to what FixedTypedArrayBase > has) Acknowledged.
lgtm
The CQ bit was checked by fedor@indutny.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1327403002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1327403002/20001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: v8_presubmit on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_presubmit/builds/5806)
Jochen, Looks like it is missing some more LGTMs: ** Presubmit ERRORS ** Missing LGTM from an OWNER for these files: src/heap/mark-compact.cc src/heap/objects-visiting-inl.h src/heap/objects-visiting.cc src/heap/store-buffer.cc
Going to try it one more time with removed unused variable, just in case...
The CQ bit was checked by fedor@indutny.com
The patchset sent to the CQ was uploaded after l-g-t-m from jochen@chromium.org Link to the patchset: https://codereview.chromium.org/1327403002/#ps40001 (title: "remove unused var in test")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1327403002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1327403002/40001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: v8_presubmit on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_presubmit/builds/5808)
Yeah, the same. We need more LGTMs :) Thank you!
Looks like there was a debug build failure because I didn't visit all the JSObject fields. This is fixed now, running CQ just to verify that it no longer fails on a buildbot (it should not commit the change anyway, so I assume that it is safe to trigger the CQ).
The CQ bit was checked by fedor@indutny.com
The patchset sent to the CQ was uploaded after l-g-t-m from jochen@chromium.org Link to the patchset: https://codereview.chromium.org/1327403002/#ps60001 (title: "visit all fields in array buffer, reorder fields for simplicity")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1327403002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1327403002/60001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: v8_presubmit on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_presubmit/builds/5812)
All green now, please take a look. Thanks!
still lgtm
The CQ bit was checked by fedor@indutny.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1327403002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1327403002/60001
Message was sent while issue was closed.
Committed patchset #4 (id:60001)
Message was sent while issue was closed.
Patchset 4 (id:??) landed as https://crrev.com/0d017282d32ce634f364461aa79ee996108f8b9d Cr-Commit-Position: refs/heads/master@{#30771}
Message was sent while issue was closed.
Not sure why it worked now, but hooray! :) Thank you. |