Re: Weird CloseComponent Crash
Re: Weird CloseComponent Crash
- Subject: Re: Weird CloseComponent Crash
- From: William Stewart <email@hidden>
- Date: Tue, 23 Jan 2007 11:08:22 -0800
On 23/01/2007, at 9:18 AM, Norman Franke wrote:
I randomly get a crash when calling CloseComponent on the HAL
output I opened with OpenAComponent. Often it happens the first
time I call it.
It dies in different places inside CloseComponent, but always in
szone_free. Up one level it can be things like
~BufferedAudioConverter's call to operator delete[], or
Resampler2Wrapper's call to ReleaseSincKernel.
My code is modeled after AudioFilePlayer in /Developer/Examples/
CoreAudio/PublicUtility/AudioFilePlayImpl. I'm not using an
AudioFile, however, just sending buffers of data to CoreAudio much
like it's doing in its thread.
I set the render callback to NULL (as in the sample),
This might be the problem.
Neither the callback or connection to an input in an AU is thread
safe - by design. If you are just manipulating these properties while
an AU is running or could be rendering, then there is a critical
region here where memory corruption can occur. This is why the
AUGraph API has the update call and handles the connection semantics
for you (we've added the same logic so you can instantiate callbacks
using the Graph as well in Leopard).
So, if you don't do this call, but just call the stop call - does
that make any difference?
Bill
AudioOutputUnitStop, stop the thread that reads from disk (and join
with it to wait until it dies), dispose of my AudioConverter, call
AudioUnitUninitialize and then CloseComponent. Finally, I free up
my buffers that I pass via my ComplexInputProc.
Just now I got the same crash in AudioConverterDispose, which I was
able to get a stack track for this crash:
SMCX StationMaster Mach-O(13247,0xa000ed98) malloc: *** error for
object 0x2140200: incorrect checksum for freed object - object was
probably modified after being freed, break at szone_error to debug
SMCX StationMaster Mach-O(13247,0xa000ed98) malloc: *** set a
breakpoint in szone_error to debug
Program received signal: "EXC_BAD_ACCESS".
mi_cmd_stack_list_frames: Not enough frames in stack.
#0 0x900073f8 in szone_free
#1 0x94157d34 in operator delete
#2 0x94161db0 in operator delete[]
#3 0x94161c2c in BufferedAudioConverter::~BufferedAudioConverter
#4 0x94161b94 in CBRConverter::~CBRConverter
#5 0x94161d6c in Reinterleaver::~Reinterleaver
#6 0x9416193c in AudioConverterChain::~AudioConverterChain
#7 0x9416188c in AudioConverterDispose
#8 0x00219580 in ASDAudioPlayer::Shutdown at ASDAudioPlayer.cpp:602
#9 0x00219948 in ASDAudioUnitPlayer::Shutdown at ASDAudioPlayer.cpp:
1015
#10 0x0021ada0 in ASDAudioUnitPlayer::~ASDAudioUnitPlayer at
ASDAudioPlayer.cpp:1009
#11 0x001ebca4 in Audio_PlayAbort at Audio_Utilities.cc:1458
#12 0x00215150 in WrapAudio_PlayAbort at SoundWrapper.cp:181
#13 0x00206bc8 in MakeRingTone at MyTelephony.c:531
#14 0x0020716c in PhoneCallPresented at MyTelephony.c:618
#15 0x000d30f0 in CheckHotPoints at MySerial.c:3501
#16 0x000d5550 in NormalCh at MySerial.c:3833
#17 0x000d698c in ProcessByte at MySerial.c:4195
#18 0x000d6c9c in ProcessBuffer at MySerial.c:4268
#19 0x000d71a4 in ProcessSerial at MySerial.c:4375
#20 0x000bb464 in MELProgress at MELHelp.c:983
#21 0x000b7834 in ProcessEvent at MEL.c:2136
#22 0x000b78b0 in DoEvent at MEL.c:2145
#23 0x001badb0 in MainLoop at SMCMain.c:93
#24 0x001bc630 in main at SMCMain.c:599
Any ideas? I'm baffled. The application is quite stable otherwise,
so I don't think it's a memory corruption issue, and it never
crashes allocating or opening the component.
_______________________________________________
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
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
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