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

Issue 9597031: In CrMallocErrorBreak, do not kill the process if errno is ENOMEM. (Closed)

Created:
8 years, 9 months ago by Robert Sesek
Modified:
8 years, 9 months ago
CC:
chromium-reviews, brettw-cc_chromium.org
Visibility:
Public.

Description

In CrMallocErrorBreak, do not kill the process if errno is ENOMEM. This will allow large JPEG decodes to be handled and optionally killed by the OOM killer instead. Based on a sampling of the other malloc_error_break() bugs ("unaligned pointer", "freed was not allocated", "double free", and "incorrect checksum"), this will only affect the "allocate region" error, as those others happen at free(), rather than malloc(). BUG=103980 TEST=Covered by ProcessUtilTest.MacTerminateOnHeapCorruption Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=125441

Patch Set 1 #

Total comments: 6

Patch Set 2 : '' #

Total comments: 2

Patch Set 3 : Better size for malloc #

Patch Set 4 : Merge origin/master #

Patch Set 5 : Alias the value #

Total comments: 4

Patch Set 6 : nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+30 lines, -5 lines) Patch
M base/process_util_mac.mm View 1 1 chunk +7 lines, -0 lines 0 comments Download
M base/process_util_unittest.cc View 1 2 3 4 5 4 chunks +23 lines, -5 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
Robert Sesek
8 years, 9 months ago (2012-03-05 20:14:35 UTC) #1
Scott Hess - ex-Googler
https://chromiumcodereview.appspot.com/9597031/diff/1/base/process_util_mac.mm File base/process_util_mac.mm (right): https://chromiumcodereview.appspot.com/9597031/diff/1/base/process_util_mac.mm#newcode553 base/process_util_mac.mm:553: // Out of memory is certainly not heap corruption, ...
8 years, 9 months ago (2012-03-05 20:34:20 UTC) #2
Scott Hess - ex-Googler
Hmm, and I also was wondering if other cases were setting errno in other ways? ...
8 years, 9 months ago (2012-03-05 20:36:53 UTC) #3
Robert Sesek
https://chromiumcodereview.appspot.com/9597031/diff/1/base/process_util_mac.mm File base/process_util_mac.mm (right): https://chromiumcodereview.appspot.com/9597031/diff/1/base/process_util_mac.mm#newcode553 base/process_util_mac.mm:553: // Out of memory is certainly not heap corruption, ...
8 years, 9 months ago (2012-03-06 01:16:27 UTC) #4
Scott Hess - ex-Googler
LGTM. https://chromiumcodereview.appspot.com/9597031/diff/3002/base/process_util_unittest.cc File base/process_util_unittest.cc (right): https://chromiumcodereview.appspot.com/9597031/diff/3002/base/process_util_unittest.cc#newcode458 base/process_util_unittest.cc:458: void* buf = malloc(std::numeric_limits<size_t>::max()); Whoa, that's super shiny! ...
8 years, 9 months ago (2012-03-06 01:27:51 UTC) #5
Robert Sesek
https://chromiumcodereview.appspot.com/9597031/diff/3002/base/process_util_unittest.cc File base/process_util_unittest.cc (right): https://chromiumcodereview.appspot.com/9597031/diff/3002/base/process_util_unittest.cc#newcode458 base/process_util_unittest.cc:458: void* buf = malloc(std::numeric_limits<size_t>::max()); On 2012/03/06 01:27:51, shess wrote: ...
8 years, 9 months ago (2012-03-06 01:55:43 UTC) #6
Scott Hess - ex-Googler
STILL LGTM
8 years, 9 months ago (2012-03-06 01:56:55 UTC) #7
Mark Mentovai
LGTM
8 years, 9 months ago (2012-03-06 22:08:52 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rsesek@chromium.org/9597031/10001
8 years, 9 months ago (2012-03-06 23:40:09 UTC) #9
commit-bot: I haz the power
Try job failure for 9597031-10001 (retry) on mac_rel for step "base_unittests". It's a second try, ...
8 years, 9 months ago (2012-03-07 01:20:14 UTC) #10
Robert Sesek
Mark: PTAL
8 years, 9 months ago (2012-03-07 17:51:21 UTC) #11
Mark Mentovai
LGTM otherwise http://codereview.chromium.org/9597031/diff/17001/base/process_util_unittest.cc File base/process_util_unittest.cc (right): http://codereview.chromium.org/9597031/diff/17001/base/process_util_unittest.cc#newcode464 base/process_util_unittest.cc:464: void* buf = malloc(std::numeric_limits<size_t>::max() - (2*PAGE_SIZE) - ...
8 years, 9 months ago (2012-03-07 17:54:12 UTC) #12
Robert Sesek
http://codereview.chromium.org/9597031/diff/17001/base/process_util_unittest.cc File base/process_util_unittest.cc (right): http://codereview.chromium.org/9597031/diff/17001/base/process_util_unittest.cc#newcode464 base/process_util_unittest.cc:464: void* buf = malloc(std::numeric_limits<size_t>::max() - (2*PAGE_SIZE) - 1); On ...
8 years, 9 months ago (2012-03-07 17:58:16 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rsesek@chromium.org/9597031/17003
8 years, 9 months ago (2012-03-07 17:58:33 UTC) #14
commit-bot: I haz the power
Change committed as 125441
8 years, 9 months ago (2012-03-07 20:33:25 UTC) #15
Scott Hess - ex-Googler
8 years, 9 months ago (2012-03-07 23:00:59 UTC) #16
On 2012/03/05 20:36:53, shess wrote:
> Hmm, and I also was wondering if other cases were setting errno in other ways?

> In practical terms, I don't think that would be a problem, if calls where
> random.  But I worry about whether callers might do bad things after seeing
the
> ENOMEM case, which this code ignores because of ENOMEM.  I will admit that
this
> may not be solvable.

PROVEN!

Powered by Google App Engine
This is Rietveld 408576698