[cfe-dev] Address Sanitizer and Objective-C garbage collection (GC) incompatible?

Sean McBride sean at rogue-research.com
Thu Dec 13 15:32:08 PST 2012


On Thu, 13 Dec 2012 15:22:50 -0800, Chris Lattner said:

>> They seem incompatible. :(  Even with a trivial example that just
>calls NSApplicationLoad() in main().
>> 
>> The OS spews a bunch of these:
>> 
>> a.out(8598,0x7fff7789c960) malloc: reference count underflow for
>0x400410660, break on auto_refcount_underflow_error to debug.
>> 2012-12-13 13:02:34.723 a.out[8598:707] storing a non-GC object
>0x109733e48 in a GC collection, break on
>CFCollection_non_gc_storage_error to debug.
>> 
>> then asan spews:
>> 
>> ==8598== ERROR: AddressSanitizer: attempting free on address which was
>not malloc()-ed: 0x00010aab4000
>> 
>> I can file a bug with details, but thought I'd check here in case I'm
>not the first to try….
>
>Hi Sean,
>
>Are you aware that ObjC GC is deprecated in Mountain Lion?

Very much so.  But until I convert to ARC, I'd still like to benefit from asan, if I can.

(Aside: Xcode is still a GC app too.  As you know, it's non-trivial to just change the entire memory management of a large codebase overnight.)

Cheers,

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada




More information about the cfe-dev mailing list