• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Weird CloseComponent Crash
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Weird CloseComponent Crash


  • Subject: Re: Weird CloseComponent Crash
  • From: Norman Franke <email@hidden>
  • Date: Tue, 23 Jan 2007 14:52:43 -0800

Quoting William Stewart <email@hidden>:

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?

I've removed that and we'll see how it goes, thanks. Someone may want to update the sample code to not do this so people like me don't emulate it. :)


-Norman

_______________________________________________
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


References: 
 >Weird CloseComponent Crash (From: Norman Franke <email@hidden>)
 >Re: Weird CloseComponent Crash (From: William Stewart <email@hidden>)

  • Prev by Date: Re: Does CoreAudio use the alarm signal in the IO proc thread?
  • Next by Date: Re: Does CoreAudio use the alarm signal in the IO proc thread?
  • Previous by thread: Re: Weird CloseComponent Crash
  • Next by thread: Re: Weird CloseComponent Crash
  • Index(es):
    • Date
    • Thread