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

Issue 645223007: PartitionAlloc: Leave bucket in valid state when allocation fails (Closed)

Created:
6 years, 2 months ago by Jens Widell
Modified:
5 years, 4 months ago
CC:
aandrey+blink_chromium.org, blink-reviews, blink-reviews-wtf_chromium.org, Mikhail, mkwst+moarreviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

PartitionAlloc: Leave bucket in valid state when allocation fails When an allocation with the PartitionAllocReturnNull flag fails, we need to make sure to leave all structures in a valid state when bailing out, since the process lives on and may call again later. Specifically, make sure that the bucket's activePagesHead has a valid value, instead of null, when returning null from partitionAllocSlowPath(). Since there's no meaningful page to set as the active pages head, set it to its initial value, &PartitionRootBase::gSeedPage. This was already necessarily supported by the allocation code paths. The deallocation code path needs some minor adjustments to handle this state correctly. Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=184983

Patch Set 1 #

Patch Set 2 : fixed leak #

Patch Set 3 : add fix #

Total comments: 1

Patch Set 4 : use setrlimit() in test if OS(POSIX) #

Patch Set 5 : make test more robust #

Patch Set 6 : check that an allocation failed #

Patch Set 7 : rebased #

Total comments: 15

Patch Set 8 : address nits #

Patch Set 9 : avoid integer overflow on 32-bit systems #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+99 lines, -3 lines) Patch
M Source/wtf/PartitionAlloc.cpp View 1 2 3 4 5 6 7 3 chunks +10 lines, -3 lines 0 comments Download
M Source/wtf/PartitionAllocTest.cpp View 1 2 3 4 5 6 7 8 4 chunks +89 lines, -0 lines 1 comment Download

Messages

Total messages: 20 (4 generated)
Jens Widell
cevans: PTAL jochen: FYI This also affects the retry logic https://codereview.chromium.org/657113006/. Fixing this bug first ...
6 years, 2 months ago (2014-10-22 19:34:22 UTC) #2
Jens Widell
https://codereview.chromium.org/645223007/diff/40001/Source/wtf/PartitionAllocTest.cpp File Source/wtf/PartitionAllocTest.cpp (right): https://codereview.chromium.org/645223007/diff/40001/Source/wtf/PartitionAllocTest.cpp#newcode1102 Source/wtf/PartitionAllocTest.cpp:1102: // blocks. This may never fail on 64-bit systems, ...
6 years, 2 months ago (2014-10-22 19:40:12 UTC) #3
jochen (gone - plz use gerrit)
thx for working on this
6 years, 2 months ago (2014-10-22 20:42:52 UTC) #4
jochen (gone - plz use gerrit)
btw, you could just programatically lower the ulimit at least on platforms where this is ...
6 years, 2 months ago (2014-10-23 09:31:18 UTC) #5
Jens Widell
On 2014/10/23 09:31:18, jochen wrote: > btw, you could just programatically lower the ulimit at ...
6 years, 2 months ago (2014-10-23 11:00:49 UTC) #6
Jens Widell
Test is now updated to: * Not run at all on 64-bit non-POSIX systems. * ...
6 years, 2 months ago (2014-10-23 12:48:48 UTC) #7
Jens Widell
cevans@: ping?
6 years, 1 month ago (2014-10-29 09:51:19 UTC) #8
Chris Evans
On 2014/10/29 09:51:19, Jens Widell wrote: > cevans@: ping? Firstly, sorry for the slow reply! ...
6 years, 1 month ago (2014-11-05 23:55:22 UTC) #9
Jens Widell
On 2014/11/05 23:55:22, Chris Evans wrote: > In terms of review: can I request a ...
6 years, 1 month ago (2014-11-06 10:55:45 UTC) #10
Chris Evans
LGTM with a bunch of nits. Thanks for persevering with alternate approaches, even though we ...
6 years, 1 month ago (2014-11-07 03:33:23 UTC) #12
Jens Widell
https://codereview.chromium.org/645223007/diff/120001/Source/wtf/PartitionAlloc.cpp File Source/wtf/PartitionAlloc.cpp (right): https://codereview.chromium.org/645223007/diff/120001/Source/wtf/PartitionAlloc.cpp#newcode702 Source/wtf/PartitionAlloc.cpp:702: if (returnNull) { On 2014/11/07 03:33:23, Chris Evans wrote: ...
6 years, 1 month ago (2014-11-07 14:17:32 UTC) #13
Jens Widell
https://codereview.chromium.org/645223007/diff/120001/Source/wtf/PartitionAllocTest.cpp File Source/wtf/PartitionAllocTest.cpp (right): https://codereview.chromium.org/645223007/diff/120001/Source/wtf/PartitionAllocTest.cpp#newcode1153 Source/wtf/PartitionAllocTest.cpp:1153: void* ptrs[8192]; On 2014/11/07 14:17:31, Jens Widell wrote: > ...
6 years, 1 month ago (2014-11-07 14:29:51 UTC) #14
Chris Evans
On 2014/11/07 14:29:51, Jens Widell wrote: > https://codereview.chromium.org/645223007/diff/120001/Source/wtf/PartitionAllocTest.cpp > File Source/wtf/PartitionAllocTest.cpp (right): > > https://codereview.chromium.org/645223007/diff/120001/Source/wtf/PartitionAllocTest.cpp#newcode1153 ...
6 years, 1 month ago (2014-11-07 17:13:51 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/645223007/160001
6 years, 1 month ago (2014-11-07 17:15:56 UTC) #17
commit-bot: I haz the power
Committed patchset #9 (id:160001) as 184983
6 years, 1 month ago (2014-11-07 18:20:26 UTC) #18
Nico
5 years, 4 months ago (2015-08-08 19:46:50 UTC) #20
Message was sent while issue was closed.
https://codereview.chromium.org/645223007/diff/160001/Source/wtf/PartitionAll...
File Source/wtf/PartitionAllocTest.cpp (right):

https://codereview.chromium.org/645223007/diff/160001/Source/wtf/PartitionAll...
Source/wtf/PartitionAllocTest.cpp:108: return false;
cevans: I found this pretty confusing – DoReturnNullTest() is only defined if
!CPU(64BIT) || OS(POSIX), but then SetAddressSpaceLimit always returns false on
OS X, and as a consequence RepeatedReturnNull is then disabled on OS X. Are
there plans for getting this passing on OS X? If not, should

#if !CPU(64BIT) || OS(POSIX)

just be changed to

#if !CPU(64BIT) || (OS(POSIX) && !OS(MACOSX))

above DoReturnNullTest()?

Powered by Google App Engine
This is Rietveld 408576698