xamarin - mono-rt: Stack overflow in unmanaged: IP: xxx, fault addr: yyy - xamarin.ios

My (xamarin.iOS) app always crashes after a while with the below error
Message:
mono-rt: Stack overflow in unmanaged: IP: 0x29c2cc, fault addr:
0xb0aedf4c
mono-rt: Stack overflow in unmanaged: IP: 0x29c2cc, fault addr:
0xb0aecdcc
The requested operation caused a stack overflow.
Stack Trace:
at (wrapper managed-to-native) object:__icall_wrapper_mono_array_new_specific (intptr,int)
at System.Threading.Tasks.Task.HandleGenericException (System.Exception e) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Threading.Tasks/Task.cs:640
at System.Threading.Tasks.Task.ThreadStart () [0x00123] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Threading.Tasks/Task.cs:445
at System.Threading.Tasks.Task.Execute () [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Threading.Tasks/Task.cs:514
at System.Threading.Tasks.TpScheduler.TaskExecuterCallback (System.Object obj) [0x00007] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Threading.Tasks/TpScheduler.cs:59
Native
mono-rt: 0 RTouchIpad 0x001492d7 mono_handle_native_sigsegv + 327
mono-rt: 1 RTouchIpad 0x00153bfa sigabrt_signal_handler + 122
mono-rt: 2 libsystem_platform.dylib 0x056fbdeb _sigtramp + 43
mono-rt: 3 ??? 0xffffffff 0x0 + 4294967295
mono-rt: 4 libsystem_sim_c.dylib 0x05414e12 abort + 127
mono-rt: 5 RTouchIpad 0x002b8f33 monotouch_unhandled_exception_handler + 291
mono-rt: 6 RTouchIpad 0x00149afb mono_invoke_unhandled_exception_hook + 91
mono-rt: 7 RTouchIpad 0x00148b2c mono_handle_exception_internal + 6620
mono-rt: 8 RTouchIpad 0x00147149 mono_handle_exception + 41
mono-rt: 9 RTouchIpad 0x000e30b9 mono_x86_throw_exception + 137
mono-rt: 10 ??? 0x0fbbde57 0x0 + 263970391
mono-rt: 11 RTouchIpad 0x00148eb9 mono_altstack_restore_prot + 9
mono-rt: 12 ??? 0x0fbbd83c 0x0 + 263968828
mono-rt: 13 ??? 0x148185b0 0x0 + 344032688
mono-rt: 14 ??? 0x13fcbcd0 0x0 + 335330512
mono-rt: 15 ??? 0x13fcb558 0x0 + 335328600
mono-rt: 16 ??? 0x13fcb4fc 0x0 + 335328508
mono-rt: 17 ??? 0x0ff64827 0x0 + 267798567
mono-rt: 18 RTouchIpad 0x001797db mono_jit_runtime_invoke + 843
mono-rt: 19 RTouchIpad 0x002102ff mono_runtime_invoke + 127
mono-rt: 20 RTouchIpad 0x002153ec mono_runtime_delegate_invoke + 92
mono-rt: 21 RTouchIpad 0x002450ee async_invoke_thread + 2446
mono-rt: 22 RTouchIpad 0x00250028 start_wrapper + 376
mono-rt: 23 RTouchIpad 0x00285aa0 inner_start_thread + 240
mono-rt: 24 RTouchIpad 0x0029ed5d GC_start_routine + 93
mono-rt: 25 libsystem_pthread.dylib 0x057ea5fb _pthread_body + 144
mono-rt: 26 libsystem_pthread.dylib 0x057ea485 _pthread_struct_init + 0
mono-rt: 27 libsystem_pthread.dylib 0x057efcf2 thread_start + 34
mono-rt:
=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
Any idea how to best solve this issue?

Such crashes are often caused by a memory corruption inside the application. This is not easy to diagnose unless there's a (symbolicated) crash report (which will include every threads).
You can try to run your application under Instruments and it might pinpoint something unusual.
You can also file a bug report and include a reproducible test case (or, at a minimum, the symbolicated crash report).

Related

My Apps not working for iOS 4.2.1

I have uploaded my latest iPhone Application on iTunes, Its working fine for iOS 6.0 and iOS 5 but when i have download app on iOS 4.2.1 its downloaded successfully but its not being run. Its display black screen for a moment and after crashed. Please check crash log below.
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2012-10-25 10:20:20.830 +0100
OS Version: iPhone OS 4.3.5 (8L1)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00000000
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 MeteorElectrical 0x0002d12a 0x1000 + 180522
1 MeteorElectrical 0x0000268e 0x1000 + 5774
2 UIKit 0x3503281a 0x34ffd000 + 219162
3 UIKit 0x3502cb5e 0x34ffd000 + 195422
4 UIKit 0x350017d0 0x34ffd000 + 18384
5 UIKit 0x3500120e 0x34ffd000 + 16910
6 UIKit 0x35000c4c 0x34ffd000 + 15436
7 GraphicsServices 0x3593be70 0x35937000 + 20080
8 CoreFoundation 0x361eea90 0x36179000 + 481936
9 CoreFoundation 0x361f0838 0x36179000 + 489528
10 CoreFoundation 0x361f1606 0x36179000 + 493062
11 CoreFoundation 0x36181ebc 0x36179000 + 36540
12 CoreFoundation 0x36181dc4 0x36179000 + 36292
13 UIKit 0x3502bd42 0x34ffd000 + 191810
14 UIKit 0x35029800 0x34ffd000 + 182272
15 MeteorElectrical 0x0000214e 0x1000 + 4430
16 MeteorElectrical 0x000020e0 0x1000 + 4320
Thread 1:
0 libsystem_kernel.dylib 0x33ec03ec 0x33eae000 + 74732
1 libsystem_c.dylib 0x33efa6d8 0x33ec6000 + 214744
2 libsystem_c.dylib 0x33efabbc 0x33ec6000 + 215996
Thread 2 name: Dispatch queue: com.apple.libdispatch-manager
Thread 2:
0 libsystem_kernel.dylib 0x33ec0fbc 0x33eae000 + 77756
1 libdispatch.dylib 0x33091032 0x3308b000 + 24626
2 libdispatch.dylib 0x3309203a 0x3308b000 + 28730
3 libdispatch.dylib 0x330915ea 0x3308b000 + 26090
4 libsystem_c.dylib 0x33efa58a 0x33ec6000 + 214410
5 libsystem_c.dylib 0x33efabbc 0x33ec6000 + 215996
Thread 3 name: WebThread
Thread 3:
0 libsystem_kernel.dylib 0x33ebdc00 0x33eae000 + 64512
1 libsystem_kernel.dylib 0x33ebd758 0x33eae000 + 63320
2 CoreFoundation 0x361ef2b8 0x36179000 + 484024
3 CoreFoundation 0x361f1562 0x36179000 + 492898
4 CoreFoundation 0x36181ebc 0x36179000 + 36540
5 CoreFoundation 0x36181dc4 0x36179000 + 36292
6 WebCore 0x3594a27e 0x35944000 + 25214
7 libsystem_c.dylib 0x33ef930a 0x33ec6000 + 209674
8 libsystem_c.dylib 0x33efabb4 0x33ec6000 + 215988
Thread 0 crashed with ARM Thread State:
r0: 0x00000000 r1: 0x00066310 r2: 0x3ee32fa8 r3: 0x3e784400
r4: 0x0019a790 r5: 0x352ee670 r6: 0x36259dd8 r7: 0x2fdfe348
r8: 0x000665a8 r9: 0x3e796418 r10: 0x352ee690 r11: 0x352f46c0
ip: 0x345cc72d sp: 0x2fdfe328 lr: 0x0002d111 pc: 0x0002d12a
cpsr: 0x20000030
Please help me if you have any idea about this.
Please check if you have added such functionality that only works in IOS 5 or later & in older Ios it gives warning. That'll possibly make your Application not work in older Ios.
Hope this helps.

Proper way to remove unwanted subview and dispose it in Monotouch

I have a class derived from UIControl called MyObject and I also have a List that holds several objects on MyObject type.
All these objects are added as SubViews in ViewDidLoad overridden method of UIViewController before calling base.ViewDidLoad (); (I don't know if this is important).
The thing is that at certain periods I want to remove several objects because I don't need them anymore. Here is what steps I take:
- First of all I remove that object from my generic list collection
- Then I remove it from view using RemoveFromSuperview() method.
At this point everything works well, but I also want to get rid of it from memory because I don't need it anymore and I also need to add some more objects so I have to free some memory. So I call Dispose() method on that object.
As soon as I do it I get a nasty exception:
Stacktrace:
at (wrapper managed-to-native) MonoTouch.ObjCRuntime.Messaging.void_objc_msgSendSuper_RectangleF (intptr,intptr,System.Drawing.RectangleF) <IL 0x00025, 0xffffffff>
at MonoTouch.UIKit.UIView.set_Frame (System.Drawing.RectangleF) [0x00021] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIView.g.cs:1179
at BubbleBuster.Lib.UI.Gameplay.Bubble.Update (System.Drawing.RectangleF) [0x001a2] in /Development/Helix/iOS/BubbleBuster/BubbleBusterSolution/BubbleBusterApp/Lib/UI/Gameplay/Bubble.cs:141
at BubbleBuster.Lib.UI.Gameplay.BubbleCollection/<Update>c__AnonStorey2.<>m__4 (BubbleBuster.Lib.UI.Gameplay.Bubble) [0x00014] in /Development/Helix/iOS/BubbleBuster/BubbleBusterSolution/BubbleBusterApp/Lib/UI/Gameplay/BubbleCollection.cs:21
at System.Collections.Generic.List`1.ForEach (System.Action`1<T>) [0x00018] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Collections.Generic/List.cs:360
at BubbleBuster.Lib.UI.Gameplay.BubbleCollection.Update (System.Drawing.RectangleF) [0x00014] in /Development/Helix/iOS/BubbleBuster/BubbleBusterSolution/BubbleBusterApp/Lib/UI/Gameplay/BubbleCollection.cs:19
at BubbleBuster.Lib.UI.Screens.WelcomeScreen.<UpdateTime_Elapsed>m__1 () [0x00000] in /Development/Helix/iOS/BubbleBuster/BubbleBusterSolution/BubbleBusterApp/Lib/UI/Screens/WelcomeScreen.cs:44
at MonoTouch.Foundation.NSActionDispatcher.Apply () [0x00000] in /Developer/MonoTouch/Source/monotouch/src/shared/Foundation/NSAction.cs:48
at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr) <IL 0x0004e, 0xffffffff>
at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <IL 0x0009f, 0xffffffff>
Thread started:
at MonoTouch.UIKit.UIApplication.Main (string[],string,string) [0x00042] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:29
at BubbleBuster.Application.Main (string[]) [0x00000] in /Development/Helix/iOS/BubbleBuster/BubbleBusterSolution/BubbleBusterApp/Main.cs:17
at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <IL 0x00050, 0xffffffff>
Native stacktrace:
0 BubbleBusterApp 0x0009094c mono_handle_native_sigsegv + 284
1 BubbleBusterApp 0x00005cd8 mono_sigsegv_signal_handler + 248
2 libsystem_c.dylib 0x9923959b _sigtramp + 43
3 ??? 0xffffffff 0x0 + 4294967295
4 ??? 0x0e2662b8 0x0 + 237396664
5 ??? 0x0e2661dc 0x0 + 237396444
6 ??? 0x0e2651c6 0x0 + 237392326
7 ??? 0x0e269920 0x0 + 237410592
8 ??? 0x0e24f8e2 0x0 + 237304034
9 ??? 0x0e2697e4 0x0 + 237410276
10 ??? 0x0e269678 0x0 + 237409912
11 ??? 0x0e2695e0 0x0 + 237409760
12 ??? 0x09fe9a90 0x0 + 167680656
13 BubbleBusterApp 0x0000a042 mono_jit_runtime_invoke + 722
14 BubbleBusterApp 0x00169f4e mono_runtime_invoke + 126
15 BubbleBusterApp 0x00206748 monotouch_trampoline + 3416
16 CoreFoundation 0x011d6e42 -[NSObject performSelector:withObject:] + 66
17 Foundation 0x017509df __NSThreadPerformPerform + 254
18 CoreFoundation 0x011a994f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
19 CoreFoundation 0x0110cb43 __CFRunLoopDoSources0 + 243
20 CoreFoundation 0x0110c424 __CFRunLoopRun + 1012
21 CoreFoundation 0x0110bd84 CFRunLoopRunSpecific + 212
22 CoreFoundation 0x0110bc9b CFRunLoopRunInMode + 123
23 GraphicsServices 0x047c47d8 GSEventRunModal + 190
24 GraphicsServices 0x047c488a GSEventRun + 103
25 UIKit 0x02258626 UIApplicationMain + 1163
26 ??? 0x0d7c4a05 0x0 + 226249221
27 ??? 0x0d53cf18 0x0 + 223596312
28 ??? 0x0d53cc10 0x0 + 223595536
29 ??? 0x0d53cd66 0x0 + 223595878
30 BubbleBusterApp 0x0000a042 mono_jit_runtime_invoke + 722
31 BubbleBusterApp 0x00169f4e mono_runtime_invoke + 126
32 BubbleBusterApp 0x0016e034 mono_runtime_exec_main + 420
33 BubbleBusterApp 0x00173455 mono_runtime_run_main + 725
34 BubbleBusterApp 0x00067245 mono_jit_exec + 149
35 BubbleBusterApp 0x002116a5 main + 2837
36 BubbleBusterApp 0x00003095 start + 53
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
From here:
at MonoTouch.UIKit.UIView.set_Frame (System.Drawing.RectangleF) [0x00021] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIView.g.cs:1179
it looks like you're setting Frame on a view that has already been freed.
When you create the view, set it's tag to 333 i.e.
To dispose the view:
MyCreatedView.ViewWithTag(333).RemoveFromSuperview();
Where -MyCreatedView- is the parent view of the view you want to get rid of.

MonoTouch_Disposer.Drain Exception displaying PDF content

I'm writing an app that makes heavy use of the PDF viewer to display various documents, and every so often after browsing my document library I encounter the following exception:
OutputLayer: Ecolab.SalesPad.ContentItem FreedomAire 3 Helmet
Thread finished:
Stacktrace:
at MonoTouch.Foundation.NSObject/MonoTouch_Disposer.Drain (MonoTouch.Foundation.NSObject) <0x000eb>
at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) <0xffffffff>
at MonoTouch.UIKit.UIApplication.Main (string[],string,string) <0x0010f>
at Ecolab.SalesPad.Touch.Application.Main (string[]) [0x00000] in /Users/itrgroup/Projects/SalesPad/SalesPad.Touch/Main.cs:20
at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) <0xffffffff>
Native stacktrace:
0 SalesPadTouch 0x00b62b18 mono_handle_native_sigsegv + 456
1 SalesPadTouch 0x00b484e4 mono_sigsegv_signal_handler + 428
2 libsystem_c.dylib 0x34db7539 _sigtramp + 48
3 UIKit 0x35107b23 -[UISearchDisplayController dealloc] + 78
4 libobjc.A.dylib 0x3564b0c5 _objc_rootRelease + 36
5 SalesPadTouch 0x00489eb8 wrapper_managed_to_native_MonoTouch_ObjCRuntime_Messaging_void_objc_msgSend_intptr_intptr + 68
6 SalesPadTouch 0x0028d094 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 200
7 SalesPadTouch 0x00b48108 mono_jit_runtime_invoke + 2892
8 SalesPadTouch 0x00c40414 mono_runtime_invoke + 200
9 SalesPadTouch 0x00cd3944 monotouch_trampoline + 3140
10 CoreFoundation 0x33e9222b -[NSObject performSelector:withObject:] + 42
11 Foundation 0x31a01757 __NSThreadPerformPerform + 350
12 CoreFoundation 0x33f07b03 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
13 CoreFoundation 0x33f072cf __CFRunLoopDoSources0 + 214
14 CoreFoundation 0x33f06075 __CFRunLoopRun + 652
15 CoreFoundation 0x33e894dd CFRunLoopRunSpecific + 300
16 CoreFoundation 0x33e893a5 CFRunLoopRunInMode + 104
17 GraphicsServices 0x35ac9fcd GSEventRunModal + 156
18 UIKit 0x34fce743 UIApplicationMain + 1090
19 SalesPadTouch 0x00491160 wrapper_managed_to_native_MonoTouch_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr + 240
20 SalesPadTouch 0x00073d60 Ecolab_SalesPad_Touch_Application_Main_string__ + 152
21 SalesPadTouch 0x0028d094 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 200
22 SalesPadTouch 0x00b48108 mono_jit_runtime_invoke + 2892
23 SalesPadTouch 0x00c40414 mono_runtime_invoke + 200
24 SalesPadTouch 0x00c4353c mono_runtime_exec_main + 836
25 SalesPadTouch 0x00c4253c mono_runtime_run_main + 968
26 SalesPadTouch 0x00b4f1b8 mono_jit_exec + 244
27 SalesPadTouch 0x00b424fc main + 4076
28 SalesPadTouch 0x00002914 start + 52
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
It hits this on MonoTouch.Disposer_Drain every time. Sometimes after ViewDidAppear is called, sometimes before. I can't find any advice on MonoTouch.Disposer_Drain in a Google search. Has anyone run into this before? Any advice on what the cause and/or a workaround would be?
Thanks!
Scott --
There are two likely causes for this:
A (native) object is being freed too early. This can happen if there is no managed reference to the corresponding managed peer, while native code still has a pointer to it. In this case the garbage collector will free the managed peer (and the native object is freed too).
Dispose is called on an object when it's not needed (calling Dispose manually may, in some very rare cases, change the usual order the objects in a tree of objects are destroyed).
It can be quite hard to track down the cause, but there is a hint in the stack trace:
3 UIKit 0x35107b23 -[UISearchDisplayController dealloc] + 78
it's related to a UISearchDisplayController. My guess is that the UISearchDisplayController's native destructor is trying to call into an object it has a reference to (to call that object's destructor for instance), and that object has already been freed. So I would look if any objects assigned to fields of a UISearchDisplayController (that can be normal fields, event handlers, callbacks, etc.) happen to get freed early.
Once you know which object are freed early, you must ensure that the GC can see the object as long as the UISearchDisplayController is alive (one common way is to assign it to a class variable of the appropriate class).
Update
A very similar issue has been answered here: MonoTouch SIGSEGV crash using navigationcontroller and searchdisplaycontroller, it may be what you're running into.

Getting SIGSEGV When Trying to Play an mp3 in AVAudioPlayer Using Monotouch

I am trying to play an mp3 file with the following code.
AVAudioPlayer player = new AVAudioPlayer();
NSUrl mediaFile = NSUrl.FromFilename(monkeySound);
player = AVAudioPlayer.FromUrl(mediaFile);
player.Delegate = new PlayerDelegate();
if(player.PrepareToPlay()){
player.Play();
}
private class PlayerDelegate:AVAudioPlayerDelegate {
public PlayerDelegate(){
}
public override void FinishedPlaying (AVAudioPlayer player, bool flag)
{
//Some Stuff Done Here
}
}
This is the error I get:
Stacktrace:
at (wrapper managed-to-native) MonoTouch.ObjCRuntime.Messaging.void_objc_msgSend (intptr,intptr)
at MonoTouch.Foundation.NSObject/MonoTouch_Disposer.Drain (MonoTouch.Foundation.NSObject) [0x0002a] in /Users/plasma/Source/iphone/monotouch/Foundation/NSObject.cs:305
at (wrapper runtime-invoke) .runtime_invoke_void_this__object (object,intptr,intptr,intptr)
at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr)
at MonoTouch.UIKit.UIApplication.Main (string[],string,string) [0x00038] in /Users/plasma/Source/iphone/monotouch/UIKit/UIApplication.cs:26
at MonoTouch.UIKit.UIApplication.Main (string[]) [0x00000] in /Users/plasma/Source/iphone/monotouch/UIKit/UIApplication.cs:31
at MonkeyShot.Application.Main (string[]) [0x00000] in /Users/fencer04/Projects/MonkeyShot/MonkeyShot/Main.cs:14
at (wrapper runtime-invoke) .runtime_invoke_void_object (object,intptr,intptr,intptr)
Native stacktrace:
0 MonkeyShot 0x000d0d25 mono_handle_native_sigsegv + 343
1 MonkeyShot 0x0000f6f4 mono_sigsegv_signal_handler + 322
2 libSystem.B.dylib 0x992a345b _sigtramp + 43
3 ??? 0xffffffff 0x0 + 4294967295
4 AVFoundation 0x0047c28d -[AVAudioPlayer privCommonCleanup] + 50
5 AVFoundation 0x0047c339 -[AVAudioPlayer dealloc] + 51
6 ??? 0x0a2af91c 0x0 + 170588444
7 ??? 0x0a2cab1c 0x0 + 170699548
8 ??? 0x077520d6 0x0 + 125116630
9 MonkeyShot 0x0000f4af mono_jit_runtime_invoke + 1332
10 MonkeyShot 0x001ed319 mono_runtime_invoke + 137
11 MonkeyShot 0x0029da57 monotouch_trampoline + 2527
12 Foundation 0x0140d94e __NSThreadPerformPerform + 251
13 CoreFoundation 0x00e9f8ff __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
14 CoreFoundation 0x00dfd88b __CFRunLoopDoSources0 + 571
15 CoreFoundation 0x00dfcd86 __CFRunLoopRun + 470
16 CoreFoundation 0x00dfc840 CFRunLoopRunSpecific + 208
17 CoreFoundation 0x00dfc761 CFRunLoopRunInMode + 97
18 GraphicsServices 0x0404b1c4 GSEventRunModal + 217
19 GraphicsServices 0x0404b289 GSEventRun + 115
20 UIKit 0x01cdfc93 UIApplicationMain + 1160
21 ??? 0x09d530a3 0x0 + 164966563
22 ??? 0x09d52e74 0x0 + 164966004
23 ??? 0x09d52474 0x0 + 164963444
24 ??? 0x09d522cc 0x0 + 164963020
25 ??? 0x09d5241e 0x0 + 164963358
26 MonkeyShot 0x0000f4af mono_jit_runtime_invoke + 1332
27 MonkeyShot 0x001ed319 mono_runtime_invoke + 137
28 MonkeyShot 0x001efa00 mono_runtime_exec_main + 669
29 MonkeyShot 0x001eedea mono_runtime_run_main + 843
30 MonkeyShot 0x000a3083 mono_jit_exec + 200
31 MonkeyShot 0x002a1697 main + 3838
32 MonkeyShot 0x00002809 _start + 208
33 MonkeyShot 0x00002738 start + 40
Debug info from gdb:
/tmp/mono-gdb-commands.0GDVJY:1: Error in sourced command file:
unable to debug self
===============================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
I don't know if this is your issue, but I had some issues using the C#-style delegate methods and AVAudioPlayer. If this is similar to my issue, using the "WeakDelegate" construct and exporting methods might be useful.

Cannot run existing projects on simulator after upgrading MonoTouch

I just upgraded Monotouch to latest 4.0 and MonoFramework to 2.10.1_3.macos10 and now none of my existing projects run on simulator. If I create a new project, it runs fine. How can I fix this?
If I click on the Run button in Monodevelop, the build completes successfully, but at the Application Output window I get this error:
Error connecting stdout and stderr (127.0.0.1:10001)
Couldn't register com.yourcompany.textproblem with the bootstrap server. Error: unknown error code.
This generally means that another instance of this process was already running or is hung in the debugger.Stacktrace:
at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <IL 0x0009f, 0xffffffff>
at MonoTouch.UIKit.UIApplication.Main (string[],string,string) [0x00038] in /Users/plasma/Source/iphone/monotouch/UIKit/UIApplication.cs:26
at MonoTouch.UIKit.UIApplication.Main (string[]) [0x00000] in /Users/plasma/Source/iphone/monotouch/UIKit/UIApplication.cs:31
at TextProblem.Application.Main (string[]) [0x00000] in /Users/admin/Projects/TextProblem/TextProblem/Main.cs:14
at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <IL 0x00050, 0xffffffff>
Native stacktrace:
0 TextProblem 0x000d0db5 mono_handle_native_sigsegv + 343
1 TextProblem 0x0013afad sigabrt_signal_handler + 116
2 libSystem.B.dylib 0x9027246b _sigtramp + 43
3 ??? 0xffffffff 0x0 + 4294967295
4 libSystem.B.dylib 0x902ff89d raise + 26
5 libSystem.B.dylib 0x903159bc abort + 93
6 GraphicsServices 0x03edd558 GSRegisterPurpleNamedPort + 323
7 GraphicsServices 0x03edd715 GSEventInitialize + 220
8 UIKit 0x01c17229 UIApplicationMain + 643
9 ??? 0x09e09744 0x0 + 165713732
10 ??? 0x09e0967a 0x0 + 165713530
11 ??? 0x07ff2b96 0x0 + 134163350
12 ??? 0x07ff2ae2 0x0 + 134163170
13 ??? 0x07ff2b6d 0x0 + 134163309
14 TextProblem 0x0000f5c7 mono_jit_runtime_invoke + 1332
15 TextProblem 0x001ed281 mono_runtime_invoke + 137
16 TextProblem 0x001ef968 mono_runtime_exec_main + 669
17 TextProblem 0x001eed52 mono_runtime_run_main + 843
18 TextProblem 0x000a3153 mono_jit_exec + 200
19 TextProblem 0x002a16b8 main + 4155
20 TextProblem 0x00002949 _start + 208
21 TextProblem 0x00002878 start + 40
Debug info from gdb:
/tmp/mono-gdb-commands.C9e16B:1: Error in sourced command file:
unable to debug self
=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
Try resetting the simulator. iOS Simulator -> Reset Content and Settings. Note that this will reset the simulator to its default state.
You have a process hung in the simulator, a reboot should resolve this.

Resources