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

Issue 1215233004: Fix bug when transferring SharedArrayBuffer to multiple Workers. (Closed)

Created:
5 years, 5 months ago by binji
Modified:
5 years, 5 months ago
CC:
v8-dev
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Fix bug when transferring SharedArrayBuffer to multiple Workers. Previously, the serialization code would call Externalize for every transferred ArrayBuffer or SharedArrayBuffer, but that function can only be called once. If the buffer is already externalized, we should call GetContents instead. Also fix use-after-free bug when transferring ArrayBuffers. The transferred ArrayBuffer must be internalized in the new isolate, or be managed by the Shell. The current code gives it to the isolate externalized and frees it immediately afterward when the SerializationData object is destroyed. BUG=chromium:497295 R=jarin@chromium.org LOG=n Committed: https://crrev.com/dd7962bf7838f8379ba776ee6b7b0e4d3bec2140 Cr-Commit-Position: refs/heads/master@{#29499}

Patch Set 1 #

Patch Set 2 : Worker owns transferred ArrayBuffer::Contents #

Patch Set 3 : internalize transferred ArrayBuffer #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+108 lines, -55 lines) Patch
M src/d8.h View 1 2 1 chunk +3 lines, -3 lines 0 comments Download
M src/d8.cc View 1 2 7 chunks +36 lines, -21 lines 3 comments Download
M test/mjsunit/d8-worker-sharedarraybuffer.js View 1 chunk +69 lines, -31 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 21 (2 generated)
binji
5 years, 5 months ago (2015-07-01 18:52:54 UTC) #1
Jarin
On 2015/07/01 18:52:54, binji wrote: Hmm, now I am a bit confused about lifetime management ...
5 years, 5 months ago (2015-07-02 11:04:41 UTC) #3
binji
On 2015/07/02 at 11:04:41, jarin wrote: > On 2015/07/01 18:52:54, binji wrote: > > Hmm, ...
5 years, 5 months ago (2015-07-02 17:09:11 UTC) #4
jochen (gone - plz use gerrit)
On 2015/07/02 at 17:09:11, binji wrote: > On 2015/07/02 at 11:04:41, jarin wrote: > > ...
5 years, 5 months ago (2015-07-02 17:52:39 UTC) #5
binji
> > Ah, but it looks like the ArrayBuffer::New static constructor can specify that the ...
5 years, 5 months ago (2015-07-02 17:54:28 UTC) #6
jochen (gone - plz use gerrit)
https://codereview.chromium.org/1215233004/diff/40001/src/d8.cc File src/d8.cc (right): https://codereview.chromium.org/1215233004/diff/40001/src/d8.cc#newcode1542 src/d8.cc:1542: if (contents.Data()) { how can data ever be null?
5 years, 5 months ago (2015-07-03 14:29:38 UTC) #7
Jarin
lgtm. (Even though at some point we might want to implement reference counting for shared ...
5 years, 5 months ago (2015-07-06 05:04:19 UTC) #8
binji
https://codereview.chromium.org/1215233004/diff/40001/src/d8.cc File src/d8.cc (right): https://codereview.chromium.org/1215233004/diff/40001/src/d8.cc#newcode1542 src/d8.cc:1542: if (contents.Data()) { On 2015/07/06 at 05:04:19, jarin wrote: ...
5 years, 5 months ago (2015-07-06 06:23:27 UTC) #9
jochen (gone - plz use gerrit)
On 2015/07/06 at 06:23:27, binji wrote: > https://codereview.chromium.org/1215233004/diff/40001/src/d8.cc > File src/d8.cc (right): > > https://codereview.chromium.org/1215233004/diff/40001/src/d8.cc#newcode1542 ...
5 years, 5 months ago (2015-07-06 06:32:25 UTC) #10
binji
> if the current approach leaks memory, lsan bots will be unhappy, so we'll have ...
5 years, 5 months ago (2015-07-06 06:34:47 UTC) #11
Jarin
On 2015/07/06 06:34:47, binji wrote: > > if the current approach leaks memory, lsan bots ...
5 years, 5 months ago (2015-07-06 07:02:30 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1215233004/40001
5 years, 5 months ago (2015-07-06 16:53:38 UTC) #14
binji
On 2015/07/06 at 07:02:30, jarin wrote: > On 2015/07/06 06:34:47, binji wrote: > > > ...
5 years, 5 months ago (2015-07-06 16:58:19 UTC) #15
commit-bot: I haz the power
Committed patchset #3 (id:40001)
5 years, 5 months ago (2015-07-06 17:18:05 UTC) #16
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/dd7962bf7838f8379ba776ee6b7b0e4d3bec2140 Cr-Commit-Position: refs/heads/master@{#29499}
5 years, 5 months ago (2015-07-06 17:18:14 UTC) #17
Michael Achenbach
The test is sometimes hanging and timing out, e.g.: http://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20isolates/builds/4356
5 years, 5 months ago (2015-07-06 20:21:54 UTC) #18
binji
On 2015/07/06 at 20:21:54, machenbach wrote: > The test is sometimes hanging and timing out, ...
5 years, 5 months ago (2015-07-06 20:52:52 UTC) #19
Michael Achenbach
On 2015/07/06 20:52:52, binji wrote: > On 2015/07/06 at 20:21:54, machenbach wrote: > > The ...
5 years, 5 months ago (2015-07-07 06:40:25 UTC) #20
Michael Achenbach
5 years, 5 months ago (2015-07-07 06:41:07 UTC) #21
Message was sent while issue was closed.
A revert of this CL (patchset #3 id:40001) has been created in
https://codereview.chromium.org/1224843008/ by machenbach@chromium.org.

The reason for reverting is: [Sheriff] Test hangs sometimes and times out
flakily. E.g.:
http://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20nosse3/builds....

Powered by Google App Engine
This is Rietveld 408576698