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

Issue 1577783004: [v8] don't crash when ArrayBuffer allocation fails (Closed)

Created:
4 years, 11 months ago by caitp (gmail)
Modified:
4 years, 11 months ago
CC:
blink-reviews, blink-reviews-wtf_chromium.org, chromium-reviews, Mikhail
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[v8] don't crash when ArrayBuffer allocation fails When ArrayBufferContents::Allocator fails to allocate a backing store, return a nullptr so that v8 knows to throw a RangeError (per http://tc39.github.io/ecma262/#sec-createbytedatablock). This replaces the current behaviour of failing an assertion and crashing the process BUG=536816, v8:4639 R=jochen@chromium.org, littledan@chromium.org, haraken@chromium.org Committed: https://crrev.com/74b20fa86efa112b53c838b88af7c060eb6e6f65 Cr-Commit-Position: refs/heads/master@{#369488}

Patch Set 1 #

Patch Set 2 : don't use fast/js/script-tests/*, infra doesn't seem to use them? #

Patch Set 3 : Only check exception type, not message #

Patch Set 4 : Add a solution which doesn't modify behaviour of existing code, apart from JS TypedArrays #

Total comments: 5

Patch Set 5 : "Reduce duplication" a little bit #

Patch Set 6 : Add a little comment explaining the contract #

Unified diffs Side-by-side diffs Delta from patch set Stats (+83 lines, -4 lines) Patch
A third_party/WebKit/LayoutTests/fast/js/typed-array-allocation-failure.html View 1 2 1 chunk +46 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/js/typed-array-allocation-failure-expected.txt View 1 2 1 chunk +19 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp View 1 2 3 4 5 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/wtf/ArrayBufferContents.h View 1 2 3 4 2 chunks +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/wtf/ArrayBufferContents.cpp View 1 2 3 4 1 chunk +12 lines, -2 lines 0 comments Download

Messages

Total messages: 29 (13 generated)
caitp (gmail)
Hi, can you take a quick look? Returns 0 for ArrayBuffer allocation failures, rather than ...
4 years, 11 months ago (2016-01-11 17:52:18 UTC) #3
caitp (gmail)
So, the exceptions thrown differ a bit between x86 and x64 builds, because of the ...
4 years, 11 months ago (2016-01-12 02:17:38 UTC) #7
Stephen White
+junov, who might be interested in this.
4 years, 11 months ago (2016-01-12 14:09:29 UTC) #11
Justin Novosad
On 2016/01/12 14:09:29, Stephen White wrote: > +junov, who might be interested in this. not ...
4 years, 11 months ago (2016-01-12 15:02:05 UTC) #12
jochen (gone - plz use gerrit)
(just for the record, there's another allocator we use in //gin/array_buffer.cc)
4 years, 11 months ago (2016-01-12 15:51:15 UTC) #14
caitp (gmail)
On 2016/01/12 15:51:15, jochen wrote: > (just for the record, there's another allocator we use ...
4 years, 11 months ago (2016-01-12 16:15:54 UTC) #15
caitp (gmail)
New version doesn't change behaviour of any existing code, but adds a new `allocateNewOrNull()` method ...
4 years, 11 months ago (2016-01-13 01:13:10 UTC) #16
Justin Novosad
On 2016/01/13 01:13:10, caitp wrote: > New version doesn't change behaviour of any existing code, ...
4 years, 11 months ago (2016-01-13 21:29:56 UTC) #17
Dan Ehrenberg
lgtm, but I am not so convinced that libc/the OS will always give you what ...
4 years, 11 months ago (2016-01-13 22:55:14 UTC) #18
caitp (gmail)
I'm probably not going to take the time to write a whole new heap allocator ...
4 years, 11 months ago (2016-01-13 23:41:10 UTC) #19
haraken
https://codereview.chromium.org/1577783004/diff/60001/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp File third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp (right): https://codereview.chromium.org/1577783004/diff/60001/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp#newcode335 third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp:335: WTF::ArrayBufferContents::allocateMemoryOrNull(size, WTF::ArrayBufferContents::ZeroInitialize, data); I'm a bit confused. If you ...
4 years, 11 months ago (2016-01-14 01:52:33 UTC) #20
caitp (gmail)
https://codereview.chromium.org/1577783004/diff/60001/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp File third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp (right): https://codereview.chromium.org/1577783004/diff/60001/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp#newcode335 third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp:335: WTF::ArrayBufferContents::allocateMemoryOrNull(size, WTF::ArrayBufferContents::ZeroInitialize, data); On 2016/01/14 01:52:33, haraken wrote: > ...
4 years, 11 months ago (2016-01-14 01:59:04 UTC) #21
haraken
LGTM https://codereview.chromium.org/1577783004/diff/60001/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp File third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp (right): https://codereview.chromium.org/1577783004/diff/60001/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp#newcode335 third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp:335: WTF::ArrayBufferContents::allocateMemoryOrNull(size, WTF::ArrayBufferContents::ZeroInitialize, data); On 2016/01/14 01:59:04, caitp wrote: ...
4 years, 11 months ago (2016-01-14 02:17:32 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1577783004/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1577783004/100001
4 years, 11 months ago (2016-01-14 17:51:25 UTC) #25
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years, 11 months ago (2016-01-14 19:06:28 UTC) #27
commit-bot: I haz the power
4 years, 11 months ago (2016-01-14 19:07:18 UTC) #29
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/74b20fa86efa112b53c838b88af7c060eb6e6f65
Cr-Commit-Position: refs/heads/master@{#369488}

Powered by Google App Engine
This is Rietveld 408576698