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

Issue 100163: When skia ok's a NULL malloc, don't call __debugbreak. (Closed)

Created:
11 years, 7 months ago by Stephen White
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

A better fix for http://www.crbug.com/2044: crash on large <canvas> elements. We disable the __debugbreak only when skia tells us it is prepared to correctly handle a failed (NULL) malloc(). It does this by calling sk_malloc_flags() without SK_MALLOC_THROW. Note that, since the switch to tcmalloc, the new_handler was not getting called at all (since tcmalloc doesn't support it yet), so this crash is currently unreproducible in trunk. In order to test this change, I reverted the tcmalloc change in my client. This is not the case in the stable branch, since it doesn't use tcmalloc, so this change is still needed there. (It will also be needed in trunk again once mbelshe's re-implementation of the new_handler is in). BUG=http://www.crbug.com/2044 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=14891

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+25 lines, -0 lines) Patch
M chrome/app/DEPS View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/app/chrome_dll_main.cc View 1 2 2 chunks +7 lines, -0 lines 0 comments Download
M skia/corecg/SkMemory_stdlib.cpp View 3 chunks +12 lines, -0 lines 0 comments Download
M skia/include/corecg/SkTypes.h View 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Stephen White
11 years, 7 months ago (2009-04-29 18:27:08 UTC) #1
Stephen White
Ok, now that mbelshe's reimplementation of new_handler is in, this CL got stale. Updated.
11 years, 7 months ago (2009-04-29 19:03:28 UTC) #2
Mike Belshe
Sorry to have the dueling patches :-) I don't think this does anything anymore? sk_throw() ...
11 years, 7 months ago (2009-04-29 20:54:14 UTC) #3
Stephen White
On 2009/04/29 20:54:14, Mike Belshe wrote: > Sorry to have the dueling patches :-) No ...
11 years, 7 months ago (2009-04-29 21:12:57 UTC) #4
Mike Belshe
> The idea is, if skia *wouldn't* abort() (ie., SK_MALLOC_THROW is *not* > set), we ...
11 years, 7 months ago (2009-04-29 21:26:44 UTC) #5
Stephen White
11 years, 7 months ago (2009-04-29 22:09:19 UTC) #6
On 2009/04/29 21:26:44, Mike Belshe wrote:
> > The idea is, if skia *wouldn't* abort() (ie., SK_MALLOC_THROW is *not*
> > set), we shouldn't __debugbreak() either.  So we clear the flag
> > temporarily so that we don't call __debugbreak() when the caller has
> > indicated that it can safely handle a NULL return.
> 
> Doh.  Sorry for being dense.
> 
> This code LGTM in terms of how it works.  cpu has been pretty adamant about
> crashing in this case, so you'll need to be extra careful to only unset the
> SK_MALLOC_THROW flag when the caller will fail gracefully.

Mike Reed has assured me that that's the case.

Powered by Google App Engine
This is Rietveld 408576698