Re: leak in example code
Re: leak in example code
- Subject: Re: leak in example code
- From: Jeff Moore <email@hidden>
- Date: Wed, 23 May 2007 15:10:42 -0700
The leaks tool is a fine tool for the job provided you keep in mind
the caveat that no leak detection tool is going to be perfect. You
will see false positives from time to time. Some of those false
positives are pretty well-known, like the first one you showed us.
Others need to be investigated before they can be deemed as such.
So, keep using leaks. Just keep in mind that some of the leaks may not
really be leaks. And when in doubt, just do what you did: post them to
this list and we can help you sort them out.
On May 23, 2007, at 2:57 PM, Daniel Birns wrote:
Jeff,
Thanks for your response. This leads me to the question about what
to use to detect for leaks? Is the bug with the leaks program
something you can characterize so I would know what to look for? Is
there a different tool you would recommend?
--Daniel
On 5/23/07, Jeff Moore <email@hidden> wrote:
On May 23, 2007, at 2:18 PM, Daniel Birns wrote:
> I'm using the 'leaks' command on my code to clean it up, and
> discovered leaks in the audio portion. I went back to the example I
> used, and discovered that the example also has a leak.
>
> The example code is DefaultOutputUnit, and here's the leak info:
>
> leaks DefaultOutputUnit
> Process 2242: 2079 nodes malloced for 433 KB
> Process 2242: 2 leaks for 1040 total leaked bytes.
> Leak: 0x01812200 size=1024 string 'DRHT'
> Call stack: [thread 53]: | 0x1 | start | _start | main |
> TestDefaultAU() | AudioOutputUnitStart | CallComponentDispatch |
> DefaultOutputAUEntry | DefaultOutputAUEntry | AudioDeviceStart |
> HALDevice::StartIOProc(long (*)(unsigned long, AudioTimeStamp
> const*, AudioBufferList const*, AudioTimeStamp const*,
> AudioBufferList*, AudioTimeStamp const*, void*)) |
> HALPlugIn::DeviceStartIOProc(HALObject const&, long (*)(unsigned
> long, AudioTimeStamp const*, AudioBufferList const*, AudioTimeStamp
> const*, AudioBufferList*, AudioTimeStamp const*, void*)) |
> HP_PlugIn_DeviceStart(AudioHardwarePlugInInterface**, unsigned long,
> long (*)(unsigned long, AudioTimeStamp const*, AudioBufferList
> const*, AudioTimeStamp const*, AudioBufferList*, AudioTimeStamp
> const*, void*)) | HP_Device::ExecuteCommand(HP_Command*) |
> HP_IOThread::Start() | CAPThread::Start() | pthread_create | malloc
This is a known bug in the leaks tool showing you a false positive.
> Leak: 0x00313710 size=16 string '`
> 0'
> Call stack: [thread ffffffff]: | 0x1 | start | _start | main
> | TestDefaultAU() | AudioUnitInitialize | CallComponentDispatch |
> DefaultOutputAUEntry | DefaultOutputAUEntry | DefaultOutputAUEntry |
> DefaultOutputAUEntry | DefaultOutputAUEntry | DefaultOutputAUEntry |
> DefaultOutputAUEntry | 0x700d27dd | AudioConverterNew |
> ConverterRegistry::CreateConverter(StreamDescPair const&,
> AudioConverterChain**, unsigned long, AudioClassDescription*) |
> PCMConverterFactory::BuildConverterChain(StreamDescPair const&,
> AudioConverterChain*, PCMConverterFactory*) |
> PCMConverterFactory::BuildConverterChain2(StreamDescPair const&,
> CAStreamBasicDescription&, AudioConverterChain*) | operator
> new(unsigned long) | malloc
This one, I'm not so sure about. It's probably worth filing a bug
about it so we can check it out.
--
Jeff Moore
Core Audio
Apple
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
--
Jeff Moore
Core Audio
Apple
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden