The default bug view has changed. See this FAQ.

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

RESOLVED FIXED in mozilla12

Status

()

Core
Graphics
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: mattwoodrow, Assigned: mattwoodrow)

Tracking

unspecified
mozilla12
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
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.
(Assignee)

Comment 1

5 years ago
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.
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+
(Assignee)

Comment 3

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/465e3ad31c64
Assignee: nobody → matt.woodrow
https://hg.mozilla.org/mozilla-central/rev/465e3ad31c64
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla12
You need to log in before you can comment on or make changes to this bug.