Skip to content

Excluding a library from interpreter would result in a crash #99248

@rolfbjarne

Description

@rolfbjarne

From @rbakhshi on Fri, 01 Mar 2024 12:15:22 GMT

Steps to Reproduce

  1. Checkout the provided example repository (link below in Example project)
  2. The project is "MauiApp2"
  3. Run it in "Release" config on an iOS 17.2 simulator
  4. When loaded, press "Click" button

Expected Behavior

The app should increment text on click button and show the time took to run BCrypt algorithm. (~400ms)

You can try running the entire app in AOT mode (by removing MtouchInterpreter tag in project file) that works fine.

Actual Behavior

App crashes with provided log (below)

Environment

I am not using Visual Studio. Building using Rider or dotnet CLI:

Version information

.net 8.0.201
maui 8.0.7
ios simulator 17.2

Installed Workload Id      Manifest Version      Installation Source
--------------------------------------------------------------------
maui-ios                   8.0.6/8.0.100         SDK 8.0.200        
maui-android               8.0.6/8.0.100         SDK 8.0.200        
maui                       8.0.6/8.0.100         SDK 8.0.200        

Build Logs

Cannot drag/drop the binlog file here. I can send it if needed through other means.
But here is the crash log:

/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8022/tools/bin/mlaunch --launchsim /Users/user/workspace/net/bugreporting/MauiApp2/bin/Release/net8.0-ios/iossimulator-arm64/MauiApp2.app --device=:v2:udid=2CE74DEB-C462-4233-B898-5258A03FC2C8 -sdk 17.2 --sdkroot /Applications/Xcode.app/Contents/Developer
xcrun simctl launch --console --terminate-running-process 2CE74DEB-C462-4233-B898-5258A03FC2C8 com.my.app
com.my.app: 71727
2024-03-01 22:22:53.100105+1030 MauiApp2[71727:2115560] You've implemented -[<UIApplicationDelegate> application:performFetchWithCompletionHandler:], but you still need to add "fetch" to the list of your supported UIBackgroundModes in your Info.plist.
2024-03-01 22:22:53.255141+1030 MauiApp2[71727:2115560] [TableView] Warning once only: UITableView was told to layout its visible cells and other contents without being in the view hierarchy (the table view or one of its superviews has not been added to a window). This may cause bugs by forcing views inside the table view to load and perform layout without accurate information (e.g. table view bounds, trait collection, layout margins, safe area insets, etc), and will also cause unnecessary performance overhead due to extra layout passes. Make a symbolic breakpoint at UITableViewAlertForLayoutOutsideViewHierarchy to catch this in the debugger and see what caused this to occur, so you can avoid this action altogether if possible, or defer it until the table view has been added to a window. Table view: <_UIMoreListTableView: 0x107a8b800; frame = (0 0; 0 0); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x600000cc47b0>; backgroundColor = <UIDynamicSystemColor: 0x60000174b3c0; name = tableBackgroundColor>; layer = <CALayer: 0x600000631080>; contentOffset: {0, 0}; contentSize: {0, 0}; adjustedContentInset: {0, 0, 0, 0}; dataSource: <UIMoreListController: 0x106228480>>

=================================================================
	Native Crash Reporting
=================================================================
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.
=================================================================

=================================================================
	Native stacktrace:
=================================================================
	0x1068281a0 - /Users/user/Library/Developer/CoreSimulator/Devices/2CE74DEB-C462-4233-B898-5258A03FC2C8/data/Containers/Bundle/Application/0F137329-EDF6-4436-BB00-D6898AAAA4BE/MauiApp2.app/libmonosgen-2.0.dylib : mono_dump_native_crash_info
	0x1067d81c0 - /Users/user/Library/Developer/CoreSimulator/Devices/2CE74DEB-C462-4233-B898-5258A03FC2C8/data/Containers/Bundle/Application/0F137329-EDF6-4436-BB00-D6898AAAA4BE/MauiApp2.app/libmonosgen-2.0.dylib : mono_handle_native_crash
	0x106afabc8 - /Users/user/Library/Developer/CoreSimulator/Devices/2CE74DEB-C462-4233-B898-5258A03FC2C8/data/Containers/Bundle/Application/0F137329-EDF6-4436-BB00-D6898AAAA4BE/MauiApp2.app/libmonosgen-2.0.dylib : sigabrt_signal_handler.cold.1
	0x106827a60 - /Users/user/Library/Developer/CoreSimulator/Devices/2CE74DEB-C462-4233-B898-5258A03FC2C8/data/Containers/Bundle/Application/0F137329-EDF6-4436-BB00-D6898AAAA4BE/MauiApp2.app/libmonosgen-2.0.dylib : mono_runtime_setup_stat_profiler
	0x104c57c60 - /usr/lib/system/libsystem_platform.dylib : _sigtramp
	0x104ccf1d0 - /usr/lib/system/libsystem_pthread.dylib : pthread_kill
	0x1801605cc - /Library/Developer/CoreSimulator/Volumes/iOS_21C62/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.2.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libsystem_c.dylib : abort
	0x105d290d8 - /Users/user/Library/Developer/CoreSimulator/Devices/2CE74DEB-C462-4233-B898-5258A03FC2C8/data/Containers/Bundle/Application/0F137329-EDF6-4436-BB00-D6898AAAA4BE/MauiApp2.app/libxamarin-dotnet.dylib : _ZL14print_callbackPKci
	0x10686af34 - /Users/user/Library/Developer/CoreSimulator/Devices/2CE74DEB-C462-4233-B898-5258A03FC2C8/data/Containers/Bundle/Application/0F137329-EDF6-4436-BB00-D6898AAAA4BE/MauiApp2.app/libmonosgen-2.0.dylib : monoeg_g_logv_nofree
	0x10686afd8 - /Users/user/Library/Developer/CoreSimulator/Devices/2CE74DEB-C462-4233-B898-5258A03FC2C8/data/Containers/Bundle/Application/0F137329-EDF6-4436-BB00-D6898AAAA4BE/MauiApp2.app/libmonosgen-2.0.dylib : monoeg_assertion_message
	0x10683853c - /Users/user/Library/Developer/CoreSimulator/Devices/2CE74DEB-C462-4233-B898-5258A03FC2C8/data/Containers/Bundle/Application/0F137329-EDF6-4436-BB00-D6898AAAA4BE/MauiApp2.app/libmonosgen-2.0.dylib : get_arg_offset_fast
	0x10683709c - /Users/user/Library/Developer/CoreSimulator/Devices/2CE74DEB-C462-4233-B898-5258A03FC2C8/data/Containers/Bundle/Application/0F137329-EDF6-4436-BB00-D6898AAAA4BE/MauiApp2.app/libmonosgen-2.0.dylib : do_jit_call
	0x10682c0e4 - /Users/user/Library/Developer/CoreSimulator/Devices/2CE74DEB-C462-4233-B898-5258A03FC2C8/data/Containers/Bundle/Application/0F137329-EDF6-4436-BB00-D6898AAAA4BE/MauiApp2.app/libmonosgen-2.0.dylib : mono_interp_exec_method
	0x106829910 - /Users/user/Library/Developer/CoreSimulator/Devices/2CE74DEB-C462-4233-B898-5258A03FC2C8/data/Containers/Bundle/Application/0F137329-EDF6-4436-BB00-D6898AAAA4BE/MauiApp2.app/libmonosgen-2.0.dylib : interp_runtime_invoke
	0x1067429b0 - /Users/user/Library/Developer/CoreSimulator/Devices/2CE74DEB-C462-4233-B898-5258A03FC2C8/data/Containers/Bundle/Application/0F137329-EDF6-4436-BB00-D6898AAAA4BE/MauiApp2.app/libmonosgen-2.0.dylib : mono_jit_runtime_invoke
	0x1068fea28 - /Users/user/Library/Developer/CoreSimulator/Devices/2CE74DEB-C462-4233-B898-5258A03FC2C8/data/Containers/Bundle/Application/0F137329-EDF6-4436-BB00-D6898AAAA4BE/MauiApp2.app/libmonosgen-2.0.dylib : mono_runtime_try_invoke
	0x1068fe074 - /Users/user/Library/Developer/CoreSimulator/Devices/2CE74DEB-C462-4233-B898-5258A03FC2C8/data/Containers/Bundle/Application/0F137329-EDF6-4436-BB00-D6898AAAA4BE/MauiApp2.app/libmonosgen-2.0.dylib : mono_runtime_class_init_full
	0x10673dfe8 - /Users/user/Library/Developer/CoreSimulator/Devices/2CE74DEB-C462-4233-B898-5258A03FC2C8/data/Containers/Bundle/Application/0F137329-EDF6-4436-BB00-D6898AAAA4BE/MauiApp2.app/libmonosgen-2.0.dylib : jit_compile_method_with_opt
	0x10673ef60 - /Users/user/Library/Developer/CoreSimulator/Devices/2CE74DEB-C462-4233-B898-5258A03FC2C8/data/Containers/Bundle/Application/0F137329-EDF6-4436-BB00-D6898AAAA4BE/MauiApp2.app/libmonosgen-2.0.dylib : mono_jit_compile_method_jit_only
	0x106838360 - /Users/user/Library/Developer/CoreSimulator/Devices/2CE74DEB-C462-4233-B898-5258A03FC2C8/data/Containers/Bundle/Application/0F137329-EDF6-4436-BB00-D6898AAAA4BE/MauiApp2.app/libmonosgen-2.0.dylib : init_jit_call_info
	0x10683709c - /Users/user/Library/Developer/CoreSimulator/Devices/2CE74DEB-C462-4233-B898-5258A03FC2C8/data/Containers/Bundle/Application/0F137329-EDF6-4436-BB00-D6898AAAA4BE/MauiApp2.app/libmonosgen-2.0.dylib : do_jit_call
	0x10682c0e4 - /Users/user/Library/Developer/CoreSimulator/Devices/2CE74DEB-C462-4233-B898-5258A03FC2C8/data/Containers/Bundle/Application/0F137329-EDF6-4436-BB00-D6898AAAA4BE/MauiApp2.app/libmonosgen-2.0.dylib : mono_interp_exec_method
	0x106829910 - /Users/user/Library/Developer/CoreSimulator/Devices/2CE74DEB-C462-4233-B898-5258A03FC2C8/data/Containers/Bundle/Application/0F137329-EDF6-4436-BB00-D6898AAAA4BE/MauiApp2.app/libmonosgen-2.0.dylib : interp_runtime_invoke
	0x1067429b0 - /Users/user/Library/Developer/CoreSimulator/Devices/2CE74DEB-C462-4233-B898-5258A03FC2C8/data/Containers/Bundle/Application/0F137329-EDF6-4436-BB00-D6898AAAA4BE/MauiApp2.app/libmonosgen-2.0.dylib : mono_jit_runtime_invoke
	0x1068fea28 - /Users/user/Library/Developer/CoreSimulator/Devices/2CE74DEB-C462-4233-B898-5258A03FC2C8/data/Containers/Bundle/Application/0F137329-EDF6-4436-BB00-D6898AAAA4BE/MauiApp2.app/libmonosgen-2.0.dylib : mono_runtime_try_invoke
	0x106901aa0 - /Users/user/Library/Developer/CoreSimulator/Devices/2CE74DEB-C462-4233-B898-5258A03FC2C8/data/Containers/Bundle/Application/0F137329-EDF6-4436-BB00-D6898AAAA4BE/MauiApp2.app/libmonosgen-2.0.dylib : mono_runtime_invoke
	0x1046e4b1c - /Users/user/Library/Developer/CoreSimulator/Devices/2CE74DEB-C462-4233-B898-5258A03FC2C8/data/Containers/Bundle/Application/0F137329-EDF6-4436-BB00-D6898AAAA4BE/MauiApp2.app/MauiApp2 : _ZL30native_to_managed_trampoline_9P11objc_objectP13objc_selectorPP11_MonoMethodj
	0x104735868 - /Users/user/Library/Developer/CoreSimulator/Devices/2CE74DEB-C462-4233-B898-5258A03FC2C8/data/Containers/Bundle/Application/0F137329-EDF6-4436-BB00-D6898AAAA4BE/MauiApp2.app/MauiApp2 : -[UIKit_UIControlEventProxy BridgeSelector]
	0x1852f5198 - /Library/Developer/CoreSimulator/Volumes/iOS_21C62/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.2.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : -[UIApplication sendAction:to:from:forEvent:]
	0x184c0fe98 - /Library/Developer/CoreSimulator/Volumes/iOS_21C62/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.2.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : -[UIControl sendAction:to:forEvent:]
	0x184c101dc - /Library/Developer/CoreSimulator/Volumes/iOS_21C62/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.2.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : -[UIControl _sendActionsForEvents:withEvent:]
	0x184c0cd1c - /Library/Developer/CoreSimulator/Volumes/iOS_21C62/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.2.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : -[UIButton _sendActionsForEvents:withEvent:]
	0x184c0ef18 - /Library/Developer/CoreSimulator/Volumes/iOS_21C62/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.2.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : -[UIControl touchesEnded:withEvent:]
	0x185328a2c - /Library/Developer/CoreSimulator/Volumes/iOS_21C62/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.2.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : -[UIWindow _sendTouchesForEvent:]
	0x185329f10 - /Library/Developer/CoreSimulator/Volumes/iOS_21C62/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.2.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : -[UIWindow sendEvent:]
	0x18530998c - /Library/Developer/CoreSimulator/Volumes/iOS_21C62/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.2.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : -[UIApplication sendEvent:]
	0x18538a5c0 - /Library/Developer/CoreSimulator/Volumes/iOS_21C62/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.2.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : __dispatchPreprocessedEventFromEventQueue
	0x18538d474 - /Library/Developer/CoreSimulator/Volumes/iOS_21C62/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.2.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : __processEventQueue
	0x185385e38 - /Library/Developer/CoreSimulator/Volumes/iOS_21C62/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.2.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : __eventFetcherSourceCallback
	0x1803f1f18 - /Library/Developer/CoreSimulator/Volumes/iOS_21C62/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.2.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
	0x1803f1e60 - /Library/Developer/CoreSimulator/Volumes/iOS_21C62/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.2.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : __CFRunLoopDoSource0
	0x1803f15d0 - /Library/Developer/CoreSimulator/Volumes/iOS_21C62/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.2.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : __CFRunLoopDoSources0
	0x1803ebcb8 - /Library/Developer/CoreSimulator/Volumes/iOS_21C62/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.2.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : __CFRunLoopRun
	0x1803eb5a4 - /Library/Developer/CoreSimulator/Volumes/iOS_21C62/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.2.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : CFRunLoopRunSpecific
	0x18e9fbae4 - /Library/Developer/CoreSimulator/Volumes/iOS_21C62/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.2.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices : GSEventRunModal
	0x1852f02e4 - /Library/Developer/CoreSimulator/Volumes/iOS_21C62/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.2.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : -[UIApplication _run]
	0x1852f3f5c - /Library/Developer/CoreSimulator/Volumes/iOS_21C62/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.2.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : UIApplicationMain
	0x105d1e104 - /Users/user/Library/Developer/CoreSimulator/Devices/2CE74DEB-C462-4233-B898-5258A03FC2C8/data/Containers/Bundle/Application/0F137329-EDF6-4436-BB00-D6898AAAA4BE/MauiApp2.app/libxamarin-dotnet.dylib : xamarin_UIApplicationMain
	0x106838a50 - /Users/user/Library/Developer/CoreSimulator/Devices/2CE74DEB-C462-4233-B898-5258A03FC2C8/data/Containers/Bundle/Application/0F137329-EDF6-4436-BB00-D6898AAAA4BE/MauiApp2.app/libmonosgen-2.0.dylib : do_icall
	0x1068372f0 - /Users/user/Library/Developer/CoreSimulator/Devices/2CE74DEB-C462-4233-B898-5258A03FC2C8/data/Containers/Bundle/Application/0F137329-EDF6-4436-BB00-D6898AAAA4BE/MauiApp2.app/libmonosgen-2.0.dylib : do_icall_wrapper
	0x10682bd3c - /Users/user/Library/Developer/CoreSimulator/Devices/2CE74DEB-C462-4233-B898-5258A03FC2C8/data/Containers/Bundle/Application/0F137329-EDF6-4436-BB00-D6898AAAA4BE/MauiApp2.app/libmonosgen-2.0.dylib : mono_interp_exec_method
	0x106829910 - /Users/user/Library/Developer/CoreSimulator/Devices/2CE74DEB-C462-4233-B898-5258A03FC2C8/data/Containers/Bundle/Application/0F137329-EDF6-4436-BB00-D6898AAAA4BE/MauiApp2.app/libmonosgen-2.0.dylib : interp_runtime_invoke
	0x1067429b0 - /Users/user/Library/Developer/CoreSimulator/Devices/2CE74DEB-C462-4233-B898-5258A03FC2C8/data/Containers/Bundle/Application/0F137329-EDF6-4436-BB00-D6898AAAA4BE/MauiApp2.app/libmonosgen-2.0.dylib : mono_jit_runtime_invoke
	0x1068fda14 - /Users/user/Library/Developer/CoreSimulator/Devices/2CE74DEB-C462-4233-B898-5258A03FC2C8/data/Containers/Bundle/Application/0F137329-EDF6-4436-BB00-D6898AAAA4BE/MauiApp2.app/libmonosgen-2.0.dylib : mono_runtime_invoke_checked
	0x106904ff4 - /Users/user/Library/Developer/CoreSimulator/Devices/2CE74DEB-C462-4233-B898-5258A03FC2C8/data/Containers/Bundle/Application/0F137329-EDF6-4436-BB00-D6898AAAA4BE/MauiApp2.app/libmonosgen-2.0.dylib : mono_runtime_exec_main_checked
	0x106796c70 - /Users/user/Library/Developer/CoreSimulator/Devices/2CE74DEB-C462-4233-B898-5258A03FC2C8/data/Containers/Bundle/Application/0F137329-EDF6-4436-BB00-D6898AAAA4BE/MauiApp2.app/libmonosgen-2.0.dylib : mono_jit_exec
	0x105d325bc - /Users/user/Library/Developer/CoreSimulator/Devices/2CE74DEB-C462-4233-B898-5258A03FC2C8/data/Containers/Bundle/Application/0F137329-EDF6-4436-BB00-D6898AAAA4BE/MauiApp2.app/libxamarin-dotnet.dylib : xamarin_main
	0x1047a46cc - /Users/user/Library/Developer/CoreSimulator/Devices/2CE74DEB-C462-4233-B898-5258A03FC2C8/data/Containers/Bundle/Application/0F137329-EDF6-4436-BB00-D6898AAAA4BE/MauiApp2.app/MauiApp2 : main
	0x105279544 - Unknown
	0x104d760e0 - Unknown
	0xe911800000000000 - Unknown

=================================================================
	Basic Fault Address Reporting
=================================================================
Memory around native instruction pointer (0x105d809ec):0x105d809dc  c0 03 5f d6 c0 03 5f d6 10 29 80 d2 01 10 00 d4  .._..._..)......
0x105d809ec  e3 00 00 54 fd 7b bf a9 fd 03 00 91 ce e2 ff 97  ...T.{..........
0x105d809fc  bf 03 00 91 fd 7b c1 a8 c0 03 5f d6 c0 03 5f d6  .....{...._..._.
0x105d80a0c  70 0a 80 d2 01 10 00 d4 e3 00 00 54 fd 7b bf a9  p..........T.{..

=================================================================
	Managed Stacktrace:
=================================================================
	  at <unknown> <0xffffffff>
	  at <unknown> <0xffffffff>
	  at UIKit.UIApplication:xamarin_UIApplicationMain <0x0006c>
	  at UIKit.UIApplication:UIApplicationMain <0x00044>
	  at UIKit.UIApplication:Main <0x000f8>
	  at MauiApp2.Program:Main <0x00018>
	  at <Module>:runtime_invoke_direct_void_string[] <0x0004a>
	  at <unknown> <0x00000>
=================================================================
2024-03-01 22:22:55.350183+1030 MauiApp2[71727:2115560] error: * Assertion at /Users/runner/work/1/s/src/mono/mono/mini/interp/interp.c:2551, condition `is_ok (error)' not met, function:init_jit_call_info, Attempting to JIT compile method '(wrapper other) void object:gsharedvt_out_sig (intptr)' while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.
 assembly:<unknown assembly> type:<unknown type> member:(null)

Example Project (If Possible)

Check out here

Copied from original issue dotnet/macios#20230

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions