Bug 4002 - AVAudioSession BeginInterruption Crashes
Summary: AVAudioSession BeginInterruption Crashes
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 5.2
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-03-20 23:14 UTC by apocalypseinterrupted
Modified: 2015-03-20 03:11 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NOT_REPRODUCIBLE

Description apocalypseinterrupted 2012-03-20 23:14:02 UTC
Using AVAudioPlayer to playback any audio content and hooking the BeginInterruption event on the associated AVAudioSession results in a crash when an interruption occurs.  The crash occurs before any application code is executed.  If the crash does not occur on the first interruption, it always occurs on the second interruption.  The same crash occurs if instead you provide a custom AVAudioSessionDelegate instance to the Delegate property of the AVAudioSession and an interruption occurs.
Comment 1 Rolf Bjarne Kvinge [MSFT] 2012-03-26 20:58:41 UTC
I haven't been able to reproduce this with a test project. Maybe you can attach a test project where it happens for you and/or the crash reports?
Comment 2 apocalypseinterrupted 2012-06-07 22:49:16 UTC
Here's the stack trace:


Native stacktrace:

	0   PlayLookListen                      0x00989de5 mono_handle_native_sigsegv + 244
	1   PlayLookListen                      0x0097b161 mono_sigsegv_signal_handler + 172
	2   libsystem_c.dylib                   0x3282e7ed _sigtramp + 48
	3   AVFoundation                        0x35255b5d _ZL30AVAudioSessionPropertyListenerPvmmPKv + 300
	4   AudioToolbox                        0x31b60307 _ZN29AudioSessionPropertyListeners24CallPropertyListenersImpEmmPKv + 274
	5   AudioToolbox                        0x31b605e5 _ZN29AudioSessionPropertyListeners21CallPropertyListenersEmmPKv + 240
	6   AudioToolbox                        0x31b5e261 SSServer_AudioSessionInterruptionListenerMessage + 56
	7   AudioToolbox                        0x31b05d33 _XAudioSessionInterruptionListenerMessage + 62
	8   AudioToolbox                        0x31a9ace3 mshMIGPerform + 374
	9   CoreFoundation                      0x353f6523 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 38
	10  CoreFoundation                      0x353f64c5 __CFRunLoopDoSource1 + 140
	11  CoreFoundation                      0x353f5313 __CFRunLoopRun + 1370
	12  CoreFoundation                      0x353784a5 CFRunLoopRunSpecific + 300
	13  CoreFoundation                      0x3537836d CFRunLoopRunInMode + 104
	14  GraphicsServices                    0x37014439 GSEventRunModal + 136
	15  UIKit                               0x32e84cd5 UIApplicationMain + 1080
	16  PlayLookListen                      0x00060b30 wrapper_managed_to_native_MonoTouch_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr + 240
	17  PlayLookListen                      0x00031b34 MonoTouch_UIKit_UIApplication_Main_string__ + 36
	18  PlayLookListen                      0x00472574 PlayLookListen_Application_Main_string__ + 264
	19  PlayLookListen                      0x006fda14 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 200
	20  PlayLookListen                      0x0097c6eb mono_jit_runtime_invoke + 1054
	21  PlayLookListen                      0x009ecddb mono_runtime_invoke + 90
	22  PlayLookListen                      0x009efa1b mono_runtime_exec_main + 306
	23  PlayLookListen                      0x009f2d73 mono_runtime_run_main + 482
	24  PlayLookListen                      0x0097f753 mono_jit_exec + 94
	25  PlayLookListen                      0x00979f31 main + 1996
	26  PlayLookListen                      0x00002a48 start + 40
Comment 3 apocalypseinterrupted 2012-06-07 23:03:13 UTC
Also, all active apps on the system receive a memory warning just before this crash.
Comment 4 apocalypseinterrupted 2012-06-07 23:08:31 UTC
Seems this doesn't happen if I override ReceiveMemoryWarning in my UIApplicationDelegate.
Comment 5 Rolf Bjarne Kvinge [MSFT] 2012-07-05 11:50:07 UTC
You're likely running into memory issues, which is why you're getting memory warnings.

I'll close this bug for now, please reopen if it's still a problem and you can provide a test project I can look at.
Comment 6 Alexey Strakh 2015-03-20 03:11:51 UTC
>>Seems this doesn't happen if I override ReceiveMemoryWarning in my
UIApplicationDelegate.

I got the same issue in my app once I subscribed to interrupt event.
The solution is the same - override ReceiveMemoryWarning.