Re: Double-free in DLS unitialize
Re: Double-free in DLS unitialize
- Subject: Re: Double-free in DLS unitialize
- From: Daniel Jalkut <email@hidden>
- Date: Mon, 16 Jun 2003 09:12:19 -0700
I realized I didn't include any sample code. This snippet causes the
double-free if I call it from my app. I don't think there's anything
special about my app:
ComponentDescription desc = {0};
OSStatus graphErr;
AUGraph newGraph;
AUNode newNode;
// Create an empty graph
graphErr = NewAUGraph(&newGraph);
// Add a DLS MusicDevice
desc.componentType = kAudioUnitType_MusicDevice;
desc.componentSubType = kAudioUnitSubType_DLSSynth;
desc.componentManufacturer = kAudioUnitManufacturer_Apple;
graphErr = AUGraphNewNode(newGraph, &desc, 0, NULL, &newNode);
// Update the graph
AUGraphUpdate(newGraph, NULL);
// Open the graph
AUGraphOpen(newGraph);
AUGraphInitialize(newGraph);
// Now release it immediately!
AUGraphUninitialize(newGraph);
AUGraphClose(newGraph);
DisposeAUGraph(newGraph);
On Sunday, June 15, 2003, at 11:27 PM, Daniel Jalkut wrote:
>
I am seeing a disturbing double-free warning when I dispose an AUGraph
>
that has an Apple DLS device instantiated within it. I've traced the
>
problem down to a DisposePtr call made from within "NoteScheduler".
>
I've pasted the stack crawl below.
>
>
I searched the archives and found only one message describing what is
>
probably the same problem. That message was from Chris Corbell in
>
April of this year, but unfortunately it seemed to yield no comment
>
from other members of the list:
>
>
http://lists.apple.com/archives/coreaudio-api/2003/Apr/07/
>
doublefreeincalltoaugrap.txt
>
>
In my case, I started noticing it when I added code to my app to
>
switch devices. When a new device is chosen, I dispose the old
>
AUGraph and build a new one from scratch centered around the chosen
>
device. If the old graph contained an Apple DLS device, then
>
releasing it yields an error message like this:
>
>
*** malloc[3275]: Deallocation of a pointer not malloced: 0x55555555;
>
This could be a double free(), or free() called with the middle of an
>
allocated block; Try setting environment variable MallocHelp to see
>
tools to help debug
>
>
Yes - I'm running MallocScribble to force the error - but if I run in
>
deployment mode, I will eventually get the same warning from malloc on
>
a less contrived "bad address."
>
>
Should I bother writing this up in Radar, or is it already being
>
tracked? If it's already being tracked, is there a workaround?
>
>
Thanks!
>
Daniel
>
>
(stack crawl to malloc warning pasted below)
>
>
#0 0x90001104 in fprintf
>
#1 0x90221cd4 in DisposePtr
>
#2 0x014bc910 in NoteScheduler::Cleanup()
>
#3 0x014bcad4 in NoteScheduler::~NoteScheduler()
>
#4 0x014bf788 in SynthInstance::Cleanup()
>
#5 0x014abc58 in AUBase::DoCleanup()
>
#6 0x014ca60c in AUBase::ComponentEntryDispatch(ComponentParameters*,
>
AUBase*)
>
#7 0x014b3ef0 in
>
MusicDeviceBase::ComponentEntryDispatch(ComponentParameters*,
>
MusicDeviceBase*)
>
#8 0x0152abe4 in
>
ComponentEntryPoint<SynthInstance>::Dispatch(ComponentParameters*,
>
SynthInstance*)
>
#9 0x91eb0bc8 in AudioUnitUninitialize
>
#10 0x94cec4f8 in SharedGraphMgr_ReleaseDLSMusicDevice
>
#11 0x94cde930 in SharedGraphMgr_ReleaseDLSMusicDevice
>
#12 0x00007fa8 in +[RSDeviceGraph testOutputGraph] at
>
RSDeviceGraph.m:49
>
#13 0x000062ec in -[RSInstrumentPickerView takeNewDeviceFromPopUp:] at
>
RSInstrumentPickerView.m:170
>
#14 0x930f9cac in -[NSApplication sendAction:to:from:]
>
#15 0x932e2d60 in -[NSPopUpButtonCell _popUpItemAction:]
>
#16 0x930f9cac in -[NSApplication sendAction:to:from:]
>
#17 0x9316ec5c in -[NSMenu performActionForItemAtIndex:]
>
#18 0x931af2fc in -[NSCarbonMenuImpl
>
performActionWithHighlightingForItemAtIndex:]
>
#19 0x931af064 in _NSPopUpCarbonMenu
>
#20 0x93250d30 in -[NSCarbonMenuImpl
>
popUpMenu:atLocation:width:forView:withSelectedItem:withFont:]
>
#21 0x932e3d08 in -[NSPopUpButtonCell
>
trackMouse:inRect:ofView:untilMouseUp:]
>
#22 0x9312de6c in -[NSControl mouseDown:]
>
#23 0x930c102c in -[NSWindow sendEvent:]
>
#24 0x930a8e20 in -[NSApplication sendEvent:]
>
#25 0x930b1dac in -[NSApplication run]
>
#26 0x9315fc58 in NSApplicationMain
>
#27 0x00003f68 in main at main.m:12
>
#28 0x00003d04 in _start at crt.c:267
>
#29 0x00003b84 in start
>
_______________________________________________
>
coreaudio-api mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.