Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: release check



On 2007-03-14 15:15, Chris Hanson said:

>Detecting leaks at exit is fairly easy on Mac OS X.
>
>1.  Set up an executable for your application that has the following
>malloc(3) environment variables set:
>
>   MallocStackLogging=1
>   MallocScribble=1
>   MallocPreScribble=1
>
>You can see what these environment variables do in the malloc(3) man
>page.

Theoretically fine, except that in practice MallocStackLogging is
horribly broken and should never be used.  It's logging code is not
thread-safe, and so if two threads are in malloc/free at the same time
(thus both logging), you will crash.  And as discussed recently (I think
on this list) the OS creates threads 'behind your back' all the time (UI
heart beat, etc.).

So basically, you can't trust MallocStackLogging. :(

See:
<http://lists.apple.com/archives/mt-smp/2007/Jan/msg00010.html>
<rdar://4962019>

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


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

References: 
 >release check (From: "Ahmet Taha Sakar" <email@hidden>)
 >Re: release check (From: "I. Savant" <email@hidden>)
 >Re: release check (From: Chris Hanson <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.