Bug 105891

Summary: Objective-C API: Use of ObjC associated object API is wrong, causing leaks
Product: WebKit Reporter: Gavin Barraclough <barraclough>
Component: JavaScriptCoreAssignee: 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
Reported 2012-12-31 23:43:12 PST
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
Geoffrey Garen
Comment 1 2013-01-03 15:26:08 PST
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
Comment 2 2013-01-03 15:31:12 PST
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
Comment 3 2013-01-11 12:59:49 PST
Fixed in bug 106056.
Note You need to log in before you can comment on or make changes to this bug.