Bug 105891 - Objective-C API: Use of ObjC associated object API is wrong, causing leaks
Summary: Objective-C API: Use of ObjC associated object API is wrong, causing leaks
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P1 Normal
Assignee: Mark Hahnenberg
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-31 23:43 PST by Gavin Barraclough
Modified: 2019-03-28 15:05 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gavin Barraclough 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.
Comment 1 Geoffrey Garen 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
Comment 2 Geoffrey Garen 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.
Comment 3 Mark Hahnenberg 2013-01-11 12:59:49 PST
Fixed in bug 106056.