Closed Bug 712509 Opened 13 years ago Closed 12 years ago

[Skia] Skia code is linking against libstdc++ operator new on Android

Categories

(Core :: Graphics, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla12

People

(Reporter: mattwoodrow, Assigned: mattwoodrow)

Details

Attachments

(1 file)

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.
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.
Attachment #587595 - Flags: review?(bas.schouten)
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.
Attachment #587595 - Flags: review?(bas.schouten) → review+
https://hg.mozilla.org/mozilla-central/rev/465e3ad31c64
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla12
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: