Bug 105891
Summary: | Objective-C API: Use of ObjC associated object API is wrong, causing leaks | ||
---|---|---|---|
Product: | WebKit | Reporter: | Gavin Barraclough <barraclough> |
Component: | JavaScriptCore | Assignee: | Mark Hahnenberg <mhahnenberg> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | barraclough, ggaren, mhahnenberg, ysuzuki |
Priority: | P1 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Gavin Barraclough
Initial implementation adds an associated object for each JSContext to all wrapped instances.
It may be better to (1) only add one associated object and (2) not add associated objects to immortal instances.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Geoffrey Garen
There are two problems here:
(1) Associated objects grow without bound for each JSContext an object is used in
(2) For ObjC globals, this is an error, which causes console spew
Geoffrey Garen
Example console spew:
testapi(88881,0x7fff7773c340) malloc: *** auto malloc[88881]: error for object 0x7fff5c2722a0: auto_zone_set_associative_ref: object should point to a GC block or a global address, otherwise associations will leak. Break on auto_zone_association_error() to debug.
Mark Hahnenberg
Fixed in bug 106056.