Last Comment Bug 712509 - [Skia] Skia code is linking against libstdc++ operator new on Android
: [Skia] Skia code is linking against libstdc++ operator new on Android
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Graphics (show other bugs)
: unspecified
: x86 Mac OS X
: -- normal (vote)
: mozilla12
Assigned To: Matt Woodrow (:mattwoodrow) (PTO until 27 June)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-20 17:02 PST by Matt Woodrow (:mattwoodrow) (PTO until 27 June)
Modified: 2012-01-12 11:03 PST (History)
7 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Use standard malloc on skia (611 bytes, patch)
2012-01-10 22:07 PST, Matt Woodrow (:mattwoodrow) (PTO until 27 June)
bas: review+
Details | Diff | Review

Description Matt Woodrow (:mattwoodrow) (PTO until 27 June) 2011-12-20 17:02:08 PST
On android, files within gfx/skia are linking against the libstdc++ allocation functions instead of going through mozalloc.

This is causing crashes when we allocate objects in gfx/2d, and skia attempts to free them (via unref()).

I've got a temporary workaround, moving all allocations into skia itself, but I'd rather figure out why this is and fix it properly.
Comment 1 Matt Woodrow (:mattwoodrow) (PTO until 27 June) 2012-01-10 22:07:26 PST
Created attachment 587595 [details] [diff] [review]
Use standard malloc on skia

Instead of linking against stdlib new/free, this turned out be skia having wrappers around malloc/free that were allocating a block header to track allocations.

Allocating objects without this header, and then attempting to adjust for the header when free'ing was causing this issue.
Comment 2 Bas Schouten (:bas.schouten) 2012-01-10 22:46:53 PST
Comment on attachment 587595 [details] [diff] [review]
Use standard malloc on skia

Review of attachment 587595 [details] [diff] [review]:
-----------------------------------------------------------------

From what I understand this might lose us some debug capabilities of Skia so it's a shame. I'm fine with this though as allocation/freeing consistency within our code is important.
Comment 3 Matt Woodrow (:mattwoodrow) (PTO until 27 June) 2012-01-11 16:47:43 PST
https://hg.mozilla.org/integration/mozilla-inbound/rev/465e3ad31c64
Comment 4 Matt Brubeck (:mbrubeck) 2012-01-12 11:03:50 PST
https://hg.mozilla.org/mozilla-central/rev/465e3ad31c64

Note You need to log in before you can comment on or make changes to this bug.