Bug 20224 - Assertion at ../../../../../mono/mono/mini/exceptions-arm.c:454, condition `ext->debugger_invoke' not met
Summary: Assertion at ../../../../../mono/mono/mini/exceptions-arm.c:454, condition `e...
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: master
Hardware: PC Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2014-05-30 16:51 UTC by Frank A. Krueger
Modified: 2016-05-25 00:11 UTC (History)
5 users (show)

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:

Description Frank A. Krueger 2014-05-30 16:51:08 UTC
I must be doing something wrong with a UICollectionView because iOS is hitting an assertion:

<Warning>: *** Assertion failure in -[DocumentThumbnailsView _endItemAnimations], /SourceCache/UIKit/UIKit-2935.137/UICollectionView.m:3840

This causes an exception to be thrown. That exception crashes mono:

<Critical>: * Assertion at ../../../../../mono/mono/mini/exceptions-arm.c:454, condition `ext->debugger_invoke' not met

What's strange is I get this even on Release builds, but I guess "debugger" could be misleading.

While hopefully preventing the iOS assertion will fix this, I wonder if there is anything on the mono side going wrong.

Here are the stack traces.

<Warning>: *** Assertion failure in -[DocumentThumbnailsView _endItemAnimations], /SourceCache/UIKit/UIKit-2935.137/UICollectionView.m:3840
<Critical>: * Assertion at ../../../../../mono/mono/mini/exceptions-arm.c:454, condition `ext->debugger_invoke' not met

Incident Identifier: DBC4B0C9-675F-461C-B1D1-66E04837233A
CrashReporter Key:   72f86b62d49cc6422c81f2d151061c4092392200
Hardware Model:      iPhone6,1
Process:             Calca [11702]
Path:                /var/mobile/Applications/1DAC71E4-B56A-41AD-88B5-61D11C336D74/Calca.app/Calca
Identifier:          com.kruegersystems.calca.ios
Version:             1.2.2 (1.2.2)
Code Type:           ARM (Native)
Parent Process:      launchd [1]

Date/Time:           2014-05-30 13:33:14.674 -0700
OS Version:          iOS 7.1 (11D167)
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread:  0

Last Exception Backtrace:
0   CoreFoundation                	0x2ec3af03 __exceptionPreprocess + 131
1   libobjc.A.dylib               	0x393cbce7 objc_exception_throw + 38
2   CoreFoundation                	0x2ec3add5 +[NSException raise:format:arguments:] + 104
3   Foundation                    	0x2f5e7e2f -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 90
4   UIKit                         	0x3162cf7d -[UICollectionView _endItemAnimations] + 8044
5   Calca                         	0x006d2918 (wrapper managed-to-native) MonoTouch.ObjCRuntime.Messaging:void_objc_msgSendSuper_IntPtr + 108
6   Calca                         	0x0068e954 MonoTouch.UIKit.UICollectionView:InsertItems (.pmcs-compat.UICollectionView.g.cs:753)
7   Calca                         	0x003186d4 Praeclarum.UI.DocumentThumbnailsView:Praeclarum.UI.IDocumentsView.InsertItems (DocumentThumbnailsView.cs:333)
8   Calca                         	0x00308818 Praeclarum.UI.DocumentsViewController:InsertDocument (DocumentsViewController.cs:235)
9   Calca                         	0x0035e5ec Praeclarum.UI.DocumentAppDelegate/<AddAndOpenDocRef>c__asyncC:MoveNext (DocumentAppDelegate.cs:1775)
10  Calca                         	0x003c52b4 System.Runtime.CompilerServices.AsyncTaskMethodBuilder:Start<Praeclarum.UI.DocumentAppDelegate/<AddAndOpenDocRef>c__asyncC> (AsyncTaskMethodBuilder.cs:210)
11  Calca                         	0x00303ad4 Praeclarum.UI.DocumentAppDelegate:AddAndOpenDocRef + 448
12  Calca                         	0x001fafc8 Calca.iOS.AppDelegate/<CreateWithPathAction>c__async1:MoveNext (AppDelegate.cs:584)
13  Calca                         	0x00486e84 System_Threading_Tasks_SynchronizationContextContinuation__Executem__0_object + 88
14  Calca                         	0x00694540 MonoTouch.UIKit.UIKitSynchronizationContext/<Post>c__AnonStorey0:<>m__0 (.pmcs-compat.UIKitSynchronizationContext.cs:47)
15  Calca                         	0x00672408 MonoTouch.Foundation.NSAsyncActionDispatcher:Apply (.pmcs-compat.NSAction.cs:179)
16  Calca                         	0x00557388 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 200
17  Calca                         	0x008ff509 mono_jit_runtime_invoke (mini.c:6716)
18  Calca                         	0x00948fa5 mono_runtime_invoke (object.c:2828)
19  Calca                         	0x008bf903 native_to_managed_trampoline_9 (registrar.m:341)
20  Calca                         	0x008c8541 -[__MonoMac_NSAsyncActionDispatcher xamarinApplySelector] (registrar.m:3886)
21  Foundation                    	0x2f623c23 __NSThreadPerformPerform + 386
22  CoreFoundation                	0x2ec05fe7 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
23  CoreFoundation                	0x2ec054af __CFRunLoopDoSources0 + 206
24  CoreFoundation                	0x2ec03c9f __CFRunLoopRun + 630
25  CoreFoundation                	0x2eb6e7a9 CFRunLoopRunSpecific + 524
26  CoreFoundation                	0x2eb6e58b CFRunLoopRunInMode + 106
27  GraphicsServices              	0x33acb6d3 GSEventRunModal + 138
28  UIKit                         	0x314cd891 UIApplicationMain + 1136
29  Calca                         	0x006da7e8 (wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain + 272
30  Calca                         	0x0068bff0 MonoTouch.UIKit.UIApplication:Main (.pmcs-compat.UIApplication.cs:75)
31  Calca                         	0x000c34c8 Calca.iOS.Application:Main (Main.cs:30)
32  Calca                         	0x00557388 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 200
33  Calca                         	0x008ff509 mono_jit_runtime_invoke (mini.c:6716)
34  Calca                         	0x00948fa5 mono_runtime_invoke (object.c:2828)
35  Calca                         	0x0094ce67 mono_runtime_exec_main (object.c:4085)
36  Calca                         	0x0094cca7 mono_runtime_run_main (object.c:3711)
37  Calca                         	0x008e8d15 mono_jit_exec (driver.g.c:1009)
38  Calca                         	0x009a9348 main (main.m:486)
39  libdyld.dylib                 	0x398c9ab7 start + 2

Thread 0 Crashed:
0   libsystem_kernel.dylib        	0x399801f0 __pthread_kill + 8
1   libsystem_pthread.dylib       	0x399e87b3 pthread_kill + 55
2   libsystem_c.dylib             	0x39930ff5 abort + 73
3   Calca                         	0x008f2351 mono_handle_native_sigsegv (mini-exceptions.c:2341)
4   Calca                         	0x008f76f3 sigabrt_signal_handler (mini-posix.c:206)
5   libsystem_platform.dylib      	0x399e3721 _sigtramp + 41
6   libsystem_pthread.dylib       	0x399e87b3 pthread_kill + 55
7   libsystem_c.dylib             	0x39930ff5 abort + 73
8   Calca                         	0x009a2563 monoeg_assertion_message (goutput.c:197)
9   Calca                         	0x008eb667 mono_arch_find_jit_info (exceptions-arm.c:454)
10  Calca                         	0x008f0251 mono_find_jit_info_ext (mini-exceptions.c:368)
11  Calca                         	0x008f141b mono_handle_exception_internal (mini-exceptions.c:1357)
12  Calca                         	0x008f0fa7 mono_handle_exception (mini-exceptions.c:1921)
13  Calca                         	0x008eaef1 mono_arm_throw_exception (exceptions-arm.c:157)
14  Calca                         	0x00589350 throw_exception + 64
15  Calca                         	0x009c2100 monotouch_throw_monotouch_exception (monotouch-glue.m:1569)
16  Calca                         	0x009b07e0 monotouch_exception_handler (monotouch-glue.m:1580)
17  CoreFoundation                	0x2ec3b203 __handleUncaughtException + 579
18  libobjc.A.dylib               	0x393cbf69 _objc_terminate() + 173
19  libc++abi.dylib               	0x38d961b1 std::__terminate(void (*)()) + 77
20  libc++abi.dylib               	0x38d95d13 __cxa_rethrow + 99
21  libobjc.A.dylib               	0x393cbe2b objc_exception_rethrow + 39
22  CoreFoundation                	0x2eb6e81b CFRunLoopRunSpecific + 639
23  CoreFoundation                	0x2eb6e587 CFRunLoopRunInMode + 103
24  GraphicsServices              	0x33acb6cf GSEventRunModal + 135
25  UIKit                         	0x314cd88d UIApplicationMain + 1133
26  Calca                         	0x006da7e4 (wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain + 268
27  Calca                         	0x0068bfec MonoTouch.UIKit.UIApplication:Main (.pmcs-compat.UIApplication.cs:75)
28  Calca                         	0x000c34c4 Calca.iOS.Application:Main (Main.cs:30)
29  Calca                         	0x00557384 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 196
30  Calca                         	0x008ff507 mono_jit_runtime_invoke (mini.c:6716)
31  Calca                         	0x00948fa3 mono_runtime_invoke (object.c:2828)
32  Calca                         	0x0094ce63 mono_runtime_exec_main (object.c:4085)
33  Calca                         	0x0094cca3 mono_runtime_run_main (object.c:3711)
34  Calca                         	0x008e8d11 mono_jit_exec (driver.g.c:1009)
35  Calca                         	0x009a9344 main (main.m:486)
36  libdyld.dylib                 	0x398c9ab5 start + 1

Praeclarum master 7c088e1
Calca master c123c8e
Comment 1 Frank A. Krueger 2014-05-30 16:54:43 UTC
I should mention that the call to:


is in a try catch:

try {
	docsView.InsertItems (new[] { docIndex });
} catch (Exception ex) {
	Debug.WriteLine (ex);				
Comment 2 Ram Chandra 2014-06-02 10:14:00 UTC
I have tried to reproduce this issue with following builds but I am not sure about the steps.

Mac OS X 10.9.2
Xamarin Studio: 5.0 (build 878)

Build Information
Release ID: 500000878
Git revision: bcd66920d963483e7d638a2339c4022fe035b529
Build date: 2014-05-27 17:36:26-04
Xamarin addins: da9064ce55b0fa90930a7c437a4cc1ae0e5c778c

Could you please provide sample application or steps to reproduce this issue? This will help us efficiently confirm this issue.
Comment 3 Rolf Bjarne Kvinge [MSFT] 2014-06-09 07:55:08 UTC
Frank, the mono crash is a direct consequence of the assert in native code, so if you fix the assert, the problem will go away as well.

Yet there is a bug in mono somewhere, what happens is the following:

1. Native code throws a native NSException.
2. Nobody handles this native exception, so the uncaught exception handler is invoked.
3. The uncaught exception handler is our code, and here we try to create a managed exception for the native NSException.
  3.1 This is where the mono crash occurs, when we try to create the stack trace for the managed exception. This should not crash.

Note that if the crash hadn't occurred, the process would still abort, because there are no managed exception handlers up in the stack either (you could probably put one in your Main method, but there wouldn't be much you could do except exit anyway at that point), so the process would abort once the managed exception was thrown anyway.

Exactly what do we need to do to reproduce this?
Comment 4 Sebastien Pouliot 2016-05-25 00:11:24 UTC
We have not received the requested information. If you are still experiencing this issue please provide all the requested information and re-open the bug report. Thanks!