Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
rolfbjarne opened this issue Mar 4, 2024 · 4 comments · Fixed by xamarin/xamarin-macios#20687 or xamarin/xamarin-macios#20936
Assignees
Milestone

Comments

@rolfbjarne
Copy link
Member

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 xamarin/xamarin-macios#20230

@rolfbjarne
Copy link
Member Author

From @rolfbjarne on Mon, 04 Mar 2024 17:01:12 GMT

I can reproduce this. It looks like a problem for the runtime, so I'll move it there.

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Mar 4, 2024
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Mar 4, 2024
@ghost
Copy link

ghost commented Mar 4, 2024

Tagging subscribers to this area: @BrzVlad, @kotlarmilos
See info in area-owners.md if you want to be subscribed.

Issue Details

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 xamarin/xamarin-macios#20230

Author: rolfbjarne
Assignees: -
Labels:

untriaged, area-Codegen-Interpreter-mono, needs-area-label

Milestone: -

@jkotas jkotas removed the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Mar 4, 2024
@ivanpovazan ivanpovazan added the os-ios Apple iOS label Mar 5, 2024
@ghost
Copy link

ghost commented Mar 5, 2024

Tagging subscribers to 'os-ios': @steveisok, @akoeplinger, @kotlarmilos
See info in area-owners.md if you want to be subscribed.

Issue Details

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 xamarin/xamarin-macios#20230

Author: rolfbjarne
Assignees: -
Labels:

untriaged, area-Codegen-Interpreter-mono, os-ios

Milestone: -

@ivanpovazan ivanpovazan added this to the 9.0.0 milestone Mar 5, 2024
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Mar 5, 2024
@vitek-karas
Copy link
Member

@BrzVlad could you please take a quick look to figure out some more detail on what's going on?

@BrzVlad BrzVlad self-assigned this Mar 5, 2024
@kotlarmilos kotlarmilos self-assigned this Mar 20, 2024
rolfbjarne pushed a commit to xamarin/xamarin-macios that referenced this issue Jun 7, 2024
## Description

This PR enables the dedup optimization in FullAOT mode only. The
optimization can only run in FullAOT mode with complete application
context. Without it, the AOT compiler may fail to collect all generic
instances, and the runtime can't find them as they are searched in the
dedup assembly.

## Changes

This PR updates the SDK targets to enable dedup optimization in FullAOT
mode only. This change doesn't depend on any runtime changes.

## Verification

This PR also introduces partial AOT tests. They inspect the bundle for
`aot-instances.dll`, which shouldn't be generated in a partial AOT
compilation setup. Additionally, basic functionality is tested by
asserting at app startup.

## Additional notes

This change should be backported to .NET 8 as well.

Fixes dotnet/runtime#99248
rolfbjarne pushed a commit to xamarin/xamarin-macios that referenced this issue Jun 19, 2024
… only (#20701)

## Description

This PR enables the dedup optimization in FullAOT mode only. The optimization can only run in FullAOT mode with complete application context. Without it, the AOT compiler may fail to collect all generic instances, and the runtime can't find them as they are searched in the dedup assembly.

## Changes

This PR updates the SDK targets to enable dedup optimization in FullAOT mode only. This change doesn't depend on any runtime changes.

## Verification

This PR also introduces partial AOT tests. They inspect the bundle for `aot-instances.dll`, which shouldn't be generated in a partial AOT compilation setup. Additionally, basic functionality is tested by asserting at app startup.

## Additional notes

This change should be backported to .NET 8 as well.

Fixes dotnet/runtime#99248

Backport of #20687

---------

Co-authored-by: Milos Kotlar <kotlarmilos@gmail.com>
@github-actions github-actions bot locked and limited conversation to collaborators Jul 8, 2024
dalexsoto pushed a commit to xamarin/xamarin-macios that referenced this issue Jul 25, 2024
## Description

As part of the fix for: dotnet/runtime#99248
we disabled dedup optimization in partial/hybrid AOT mode (when both
interpreter and AOT compiler are enabled). This change got backported to
.NET 8 and with the latest servicing release regressed build times and
app sizes significantly as reported in:
#20848

However, it turns out that disabling dedup optimization is not required
to fix dotnet/runtime#99248 but instead we
should correct the Xamarin SDK integration with this optimization which
this PR is doing. The following section describes the initial problem in
more details.

## Overview of AOT modes and dedup optimization

When the repro project from
dotnet/runtime#99248 is built with dedup
enabled in hybrid AOT+interpreter mode, the app crashes with:
```
024-07-23 14:32:37.524110+0200 IvansApp[12711:20244208] debug: AOT NOT FOUND: (wrapper other) object:gsharedvt_out_sig (intptr).
2024-07-23 14:32:37.524120+0200 IvansApp[12711:20244208] error: * Assertion at /Users/ivan/repos/runtime-mono-iOS/src/mono/mono/mini/interp/interp.c:2667, 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://learn.microsoft.com/xamarin/ios/internals/limitations for more information.
```

To track down why these wrappers which are used to transition from
interpreter to AOT code, are not generated we need to understand when
they are compiled in different AOT modes with and without dedup
optimization enabled:

- In full AOT setup - all assemblies AOT compiled
    - `gsharedvt_out_sig` methods are never generated

- In hybrid AOT + interpreter setup - all assemblies AOT compiled:
`MtouchInterpreter=-all`
    - Dedup OFF:
- `gsharedvt_out_sig` methods are generated in AOT images of every
assembly (to enable interpreter calling into each specific assembly -
here wrappers with same signatures are duplicated)
    - Dedup ON:
- `gsharedvt_out_sig` methods are generated only in `aot-instances` AOT
image
- during AOT compilation of individual assemblies generation of
`gsharedvt_out_sig` is skipped
- during AOT compilation of `aot-instances` assembly we collect all
`gsharedvt_out_sig` variants from the full program scope and generate
code for them in `aot-instances` AOT image

- In hybrid AOT + interpreter setup - all assemblies interpreted except
a given assembly: `MtouchInterpreter=all,-MyAssembly`
    - Dedup OFF:
- `gsharedvt_out_sig` methods are generated in AOT image of `MyAssembly`
(to enable interpreter calling into it)
    - Dedup ON: <- $${\color{red} ISSUE }$$ 
- `gsharedvt_out_sig` methods *should* be generated only in
`aot-instances` AOT image, but the `aot-instances` image is missing
    - explanation:
- what happens is that generation of `gsharedvt_out_sig` is skipped
during AOT compilation of `MyAssembly` (as expected).
- But, the build does not mark `aot-instances` assembly as the one that
should be AOT compiled.
- The reason for this is that we have a global `_IsDedupEnabled` flag,
but when custom linker step analysis `aot-instances.dll` it does not see
it as an assembly which should not be interpreted.
- To explain that better: we mark *all* assemblies as to be interpreted
(via: `MtouchInterpreter=all`), but exclude only `MyAssembly` (via:
`MtouchInterpreter=all,-MyAssembly`).
- So when custom linker step processes `aot-instaces.dll` it treats it
as an assembly to be interpreted, so it does not mark it for AOT
compilation.
- This further results with `aot-instances` AOT image missing, and all
the methods which we skipped during AOT compilation never get generated.

## The fix

To fix this and address regressions reported in:
#20848 we are reenabling
dedup optimization whenever AOT compilation is requested and fixing the
issue where the custom linker step for generating AOT parameters always
treates the dedup assembly as the one to be AOTed.

Once approved this should be backported to .NET 8 as servicing releases
are also affected with it.

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
dalexsoto added a commit to xamarin/xamarin-macios that referenced this issue Jul 25, 2024
…odes (#20940)

## Description

As part of the fix for: dotnet/runtime#99248
we disabled dedup optimization in partial/hybrid AOT mode (when both
interpreter and AOT compiler are enabled). This change got backported to
.NET 8 and with the latest servicing release regressed build times and
app sizes significantly as reported in:
#20848

However, it turns out that disabling dedup optimization is not required
to fix dotnet/runtime#99248 but instead we
should correct the Xamarin SDK integration with this optimization which
this PR is doing. The following section describes the initial problem in
more details.

## Overview of AOT modes and dedup optimization

When the repro project from
dotnet/runtime#99248 is built with dedup
enabled in hybrid AOT+interpreter mode, the app crashes with:
```
024-07-23 14:32:37.524110+0200 IvansApp[12711:20244208] debug: AOT NOT FOUND: (wrapper other) object:gsharedvt_out_sig (intptr).
2024-07-23 14:32:37.524120+0200 IvansApp[12711:20244208] error: * Assertion at /Users/ivan/repos/runtime-mono-iOS/src/mono/mono/mini/interp/interp.c:2667, 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://learn.microsoft.com/xamarin/ios/internals/limitations for more information.
```

To track down why these wrappers which are used to transition from
interpreter to AOT code, are not generated we need to understand when
they are compiled in different AOT modes with and without dedup
optimization enabled:

- In full AOT setup - all assemblies AOT compiled
    - `gsharedvt_out_sig` methods are never generated

- In hybrid AOT + interpreter setup - all assemblies AOT compiled:
`MtouchInterpreter=-all`
    - Dedup OFF:
- `gsharedvt_out_sig` methods are generated in AOT images of every
assembly (to enable interpreter calling into each specific assembly -
here wrappers with same signatures are duplicated)
    - Dedup ON:
- `gsharedvt_out_sig` methods are generated only in `aot-instances` AOT
image
- during AOT compilation of individual assemblies generation of
`gsharedvt_out_sig` is skipped
- during AOT compilation of `aot-instances` assembly we collect all
`gsharedvt_out_sig` variants from the full program scope and generate
code for them in `aot-instances` AOT image

- In hybrid AOT + interpreter setup - all assemblies interpreted except
a given assembly: `MtouchInterpreter=all,-MyAssembly`
    - Dedup OFF:
- `gsharedvt_out_sig` methods are generated in AOT image of `MyAssembly`
(to enable interpreter calling into it)
    - Dedup ON: <- $${\color{red} ISSUE }$$ 
- `gsharedvt_out_sig` methods *should* be generated only in
`aot-instances` AOT image, but the `aot-instances` image is missing
    - explanation:
- what happens is that generation of `gsharedvt_out_sig` is skipped
during AOT compilation of `MyAssembly` (as expected).
- But, the build does not mark `aot-instances` assembly as the one that
should be AOT compiled.
- The reason for this is that we have a global `_IsDedupEnabled` flag,
but when custom linker step analysis `aot-instances.dll` it does not see
it as an assembly which should not be interpreted.
- To explain that better: we mark *all* assemblies as to be interpreted
(via: `MtouchInterpreter=all`), but exclude only `MyAssembly` (via:
`MtouchInterpreter=all,-MyAssembly`).
- So when custom linker step processes `aot-instaces.dll` it treats it
as an assembly to be interpreted, so it does not mark it for AOT
compilation.
- This further results with `aot-instances` AOT image missing, and all
the methods which we skipped during AOT compilation never get generated.

## The fix

To fix this and address regressions reported in:
#20848 we are reenabling
dedup optimization whenever AOT compilation is requested and fixing the
issue where the custom linker step for generating AOT parameters always
treates the dedup assembly as the one to be AOTed.

Once approved this should be backported to .NET 8 as servicing releases
are also affected with it.


Backport of #20936

---------

Co-authored-by: Ivan Povazan <ivan.povazan@gmail.com>
Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
dalexsoto added a commit to xamarin/xamarin-macios that referenced this issue Jul 26, 2024
Backport of #20936

---

## Description

As part of the fix for: dotnet/runtime#99248
we disabled dedup optimization in partial/hybrid AOT mode (when both
interpreter and AOT compiler are enabled). This change got backported to
.NET 8 and with the latest servicing release regressed build times and
app sizes significantly as reported in:
#20848

However, it turns out that disabling dedup optimization is not required
to fix dotnet/runtime#99248 but instead we
should correct the Xamarin SDK integration with this optimization which
this PR is doing. The following section describes the initial problem in
more details.

## Overview of AOT modes and dedup optimization

When the repro project from
dotnet/runtime#99248 is built with dedup
enabled in hybrid AOT+interpreter mode, the app crashes with:
```
024-07-23 14:32:37.524110+0200 IvansApp[12711:20244208] debug: AOT NOT FOUND: (wrapper other) object:gsharedvt_out_sig (intptr).
2024-07-23 14:32:37.524120+0200 IvansApp[12711:20244208] error: * Assertion at /Users/ivan/repos/runtime-mono-iOS/src/mono/mono/mini/interp/interp.c:2667, 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://learn.microsoft.com/xamarin/ios/internals/limitations for more information.
```

To track down why these wrappers which are used to transition from
interpreter to AOT code, are not generated we need to understand when
they are compiled in different AOT modes with and without dedup
optimization enabled:

- In full AOT setup - all assemblies AOT compiled
    - `gsharedvt_out_sig` methods are never generated

- In hybrid AOT + interpreter setup - all assemblies AOT compiled:
`MtouchInterpreter=-all`
    - Dedup OFF:
- `gsharedvt_out_sig` methods are generated in AOT images of every
assembly (to enable interpreter calling into each specific assembly -
here wrappers with same signatures are duplicated)
    - Dedup ON:
- `gsharedvt_out_sig` methods are generated only in `aot-instances` AOT
image
- during AOT compilation of individual assemblies generation of
`gsharedvt_out_sig` is skipped
- during AOT compilation of `aot-instances` assembly we collect all
`gsharedvt_out_sig` variants from the full program scope and generate
code for them in `aot-instances` AOT image

- In hybrid AOT + interpreter setup - all assemblies interpreted except
a given assembly: `MtouchInterpreter=all,-MyAssembly`
    - Dedup OFF:
- `gsharedvt_out_sig` methods are generated in AOT image of `MyAssembly`
(to enable interpreter calling into it)
    - Dedup ON: <- $${\color{red} ISSUE }$$ 
- `gsharedvt_out_sig` methods *should* be generated only in
`aot-instances` AOT image, but the `aot-instances` image is missing
    - explanation:
- what happens is that generation of `gsharedvt_out_sig` is skipped
during AOT compilation of `MyAssembly` (as expected).
- But, the build does not mark `aot-instances` assembly as the one that
should be AOT compiled.
- The reason for this is that we have a global `_IsDedupEnabled` flag,
but when custom linker step analysis `aot-instances.dll` it does not see
it as an assembly which should not be interpreted.
- To explain that better: we mark *all* assemblies as to be interpreted
(via: `MtouchInterpreter=all`), but exclude only `MyAssembly` (via:
`MtouchInterpreter=all,-MyAssembly`).
- So when custom linker step processes `aot-instaces.dll` it treats it
as an assembly to be interpreted, so it does not mark it for AOT
compilation.
- This further results with `aot-instances` AOT image missing, and all
the methods which we skipped during AOT compilation never get generated.

## The fix

To fix this and address regressions reported in:
#20848 we are reenabling
dedup optimization whenever AOT compilation is requested and fixing the
issue where the custom linker step for generating AOT parameters always
treates the dedup assembly as the one to be AOTed.

Once approved this should be backported to .NET 8 as servicing releases
are also affected with it.

---------

Co-authored-by: Ivan Povazan <ivan.povazan@gmail.com>
Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
mcumming pushed a commit to xamarin/xamarin-macios that referenced this issue Aug 1, 2024
## Description

As part of the fix for: dotnet/runtime#99248
we disabled dedup optimization in partial/hybrid AOT mode (when both
interpreter and AOT compiler are enabled). This change got backported to
.NET 8 and with the latest servicing release regressed build times and
app sizes significantly as reported in:
#20848

However, it turns out that disabling dedup optimization is not required
to fix dotnet/runtime#99248 but instead we
should correct the Xamarin SDK integration with this optimization which
this PR is doing. The following section describes the initial problem in
more details.

## Overview of AOT modes and dedup optimization

When the repro project from
dotnet/runtime#99248 is built with dedup
enabled in hybrid AOT+interpreter mode, the app crashes with:
```
024-07-23 14:32:37.524110+0200 IvansApp[12711:20244208] debug: AOT NOT FOUND: (wrapper other) object:gsharedvt_out_sig (intptr).
2024-07-23 14:32:37.524120+0200 IvansApp[12711:20244208] error: * Assertion at /Users/ivan/repos/runtime-mono-iOS/src/mono/mono/mini/interp/interp.c:2667, 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://learn.microsoft.com/xamarin/ios/internals/limitations for more information.
```

To track down why these wrappers which are used to transition from
interpreter to AOT code, are not generated we need to understand when
they are compiled in different AOT modes with and without dedup
optimization enabled:

- In full AOT setup - all assemblies AOT compiled
    - `gsharedvt_out_sig` methods are never generated

- In hybrid AOT + interpreter setup - all assemblies AOT compiled:
`MtouchInterpreter=-all`
    - Dedup OFF:
- `gsharedvt_out_sig` methods are generated in AOT images of every
assembly (to enable interpreter calling into each specific assembly -
here wrappers with same signatures are duplicated)
    - Dedup ON:
- `gsharedvt_out_sig` methods are generated only in `aot-instances` AOT
image
- during AOT compilation of individual assemblies generation of
`gsharedvt_out_sig` is skipped
- during AOT compilation of `aot-instances` assembly we collect all
`gsharedvt_out_sig` variants from the full program scope and generate
code for them in `aot-instances` AOT image

- In hybrid AOT + interpreter setup - all assemblies interpreted except
a given assembly: `MtouchInterpreter=all,-MyAssembly`
    - Dedup OFF:
- `gsharedvt_out_sig` methods are generated in AOT image of `MyAssembly`
(to enable interpreter calling into it)
    - Dedup ON: <- $${\color{red} ISSUE }$$ 
- `gsharedvt_out_sig` methods *should* be generated only in
`aot-instances` AOT image, but the `aot-instances` image is missing
    - explanation:
- what happens is that generation of `gsharedvt_out_sig` is skipped
during AOT compilation of `MyAssembly` (as expected).
- But, the build does not mark `aot-instances` assembly as the one that
should be AOT compiled.
- The reason for this is that we have a global `_IsDedupEnabled` flag,
but when custom linker step analysis `aot-instances.dll` it does not see
it as an assembly which should not be interpreted.
- To explain that better: we mark *all* assemblies as to be interpreted
(via: `MtouchInterpreter=all`), but exclude only `MyAssembly` (via:
`MtouchInterpreter=all,-MyAssembly`).
- So when custom linker step processes `aot-instaces.dll` it treats it
as an assembly to be interpreted, so it does not mark it for AOT
compilation.
- This further results with `aot-instances` AOT image missing, and all
the methods which we skipped during AOT compilation never get generated.

## The fix

To fix this and address regressions reported in:
#20848 we are reenabling
dedup optimization whenever AOT compilation is requested and fixing the
issue where the custom linker step for generating AOT parameters always
treates the dedup assembly as the one to be AOTed.

Once approved this should be backported to .NET 8 as servicing releases
are also affected with it.

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.