kstenerud / ObjectAL-for-iPhone

Mac and iOS Audio development, minus the headache. ObjectAL is the easy Objective-C interface to OpenAL, AVAudioPlayer, and audio session management.
http://kstenerud.github.com/ObjectAL-for-iPhone
885 stars 171 forks source link

Access violation in OALSource::DoRender(AudioBufferList*, unsigned long) #58

Open miklselsoe opened 11 years ago

miklselsoe commented 11 years ago

I'm regularly seeing crashes (from users) with this signature:

Exception Type: EXC_BAD_ACCESS Code: KERN_INVALID_ADDRESS at 0x60521472
13 com.apple.root.default-overcommit-priority Crashed
0    libsystem_platform.dylib    _platform_memmove$VARIANT$Swift + 37
1    OpenAL      OALSource::DoRender(AudioBufferList*, unsigned long) + 2112
2    OpenAL  OALSource::SourceInputProc(void*, unsigned long*, AudioTimeStamp const*, unsigned long, unsigned long, AudioBufferList*) + 28
3    AudioToolbox    AU3DMixerEmbeddedInputElement::PullSharedInput(unsigned long, unsigned long&, AudioTimeStamp const&, unsigned long) + 156
4    AudioToolbox    AU3DMixerEmbedded::Render(unsigned long&, AudioTimeStamp const&, unsigned long) + 1438
5    AudioToolbox    AUBase::DoRenderBus(unsigned long&, AudioTimeStamp const&, unsigned long, AUOutputElement*, unsigned long, AudioBufferList&) + 150
6    AudioToolbox    AUBase::DoRender(unsigned long&, AudioTimeStamp const&, unsigned long, unsigned long, AudioBufferList&) + 532
7    AudioToolbox    AUMethodRender(void*, unsigned long*, AudioTimeStamp const*, unsigned long, unsigned long, AudioBufferList*) + 46
8    AudioToolbox    AUInputElement::PullInput(unsigned long&, AudioTimeStamp const&, unsigned long, unsigned long) + 102
9    AudioToolbox    AUInputFormatConverter2::InputProc(OpaqueAudioConverter*, unsigned long*, AudioBufferList*, AudioStreamPacketDescription**, void*) + 212
10   AudioToolbox    AudioConverterChain::CallInputProc(unsigned long) + 328
11   AudioToolbox    AudioConverterChain::FillBufferFromInputProc(unsigned long*, CABufferList*) + 92
12   AudioToolbox    BufferedAudioConverter::GetInputBytes(unsigned long, unsigned long&, CABufferList const*&) + 114
13   AudioToolbox    Resampler2Wrapper::RenderOutput(CABufferList*, unsigned long, unsigned long&) + 128
14   AudioToolbox    BufferedAudioConverter::FillBuffer(unsigned long&, AudioBufferList&, AudioStreamPacketDescription*) + 296
15   AudioToolbox    AudioConverterChain::RenderOutput(CABufferList*, unsigned long, unsigned long&, AudioStreamPacketDescription*) + 92
16   AudioToolbox    BufferedAudioConverter::FillBuffer(unsigned long&, AudioBufferList&, AudioStreamPacketDescription*) + 296
17   AudioToolbox    AudioConverterFillComplexBuffer + 356
18   AudioToolbox    AUInputFormatConverter2::PullAndConvertInput(AudioTimeStamp const&, unsigned long&, AudioBufferList&, AudioStreamPacketDescription*, bool&) + 100
19   AudioToolbox    AUConverterBase::RenderBus(unsigned long&, AudioTimeStamp const&, unsigned long, unsigned long) + 216
20   AudioToolbox    AURemoteIO::RenderBus(unsigned long&, AudioTimeStamp const&, unsigned long, unsigned long) + 50
21   AudioToolbox    AUBase::DoRenderBus(unsigned long&, AudioTimeStamp const&, unsigned long, AUOutputElement*, unsigned long, AudioBufferList&) + 150
22   AudioToolbox    AUBase::DoRender(unsigned long&, AudioTimeStamp const&, unsigned long, unsigned long, AudioBufferList&) + 532
23   AudioToolbox    AURemoteIO::PerformIO(unsigned long, unsigned int, unsigned int, AudioTimeStamp const&, AudioTimeStamp const&, AudioBufferList const*, AudioBufferList*, int&) + 630
24   AudioToolbox    AURIOCallbackReceiver_PerformIO + 372
25   AudioToolbox    _XPerformIO + 178
26   AudioToolbox    mshMIGPerform + 124
27   AudioToolbox    MSHMIGDispatchMessage + 32
28   AudioToolbox    AURemoteIO::IOThread::Run() + 186
29   AudioToolbox    AURemoteIO::IOThread::Entry(void*) + 8
30   AudioToolbox    CAPThread::Entry(CAPThread*) + 210
31   libsystem_pthread.dylib     _pthread_body + 140
32   libsystem_pthread.dylib     _pthread_start + 102

I have zero ideas about what to do with it. It is also mentioned in the Developer Forums: https://devforums.apple.com/message/849099#849099

miklselsoe commented 11 years ago

I managed to reproduce this in the debugger. For me (and my tester) it seems related to unplugging the headphones from the (in this case) iPad. It's not 100% reproducible though but happens once in a while. I still have problems debugging this though. If anyone have any ideas what to look for and where, I'll be happy to investigate further.

mloigeret commented 9 years ago

I also have the same issue. I'm not able to reproduce it on my device but I see it from user's crash reports (around 5% of my users experience it) It's happening on iphone 5s and 6 as well as on iOS7 and 8.

Did you find any fix for this issue ?

piyush928 commented 8 months ago

Hey, we're facing a similar issue with the same crash logs shared above. Have we reached a resolution for this issue? It seems the issue is caused while unloading audio effects. Please let us know if this issue was resolved or ways to bypass this issue.