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

iOS15 crash when iOS project references iOS extension project #12810

Closed
kozw opened this issue Sep 22, 2021 · 3 comments · Fixed by #12812
Closed

iOS15 crash when iOS project references iOS extension project #12810

kozw opened this issue Sep 22, 2021 · 3 comments · Fixed by #12812
Labels
bug If an issue is a bug or a pull request a bug fix iOS Issues affecting Xamarin.iOS
Milestone

Comments

@kozw
Copy link

kozw commented Sep 22, 2021

As requested #12778 (comment)

Steps to Reproduce

  1. Create single view iOS App
  2. Add new iOS extension project (i've used Notification Service Extension)
  3. Compile, deploy and try to debug on device
  4. Boom

Remarks

  • When the reference to the extension project is removed in the main project, the app launches just fine.
  • No issue with current stable iOS version, happens with RC 15.0.0.3

Expected Behavior

App should not crash :)

Actual Behavior

2021-09-22 22:46:46.022 TestiOS15[1959:568054] error: Unregistered icall 'System.RuntimeTypeHandle:GetAssembly (System.RuntimeType)'

=================================================================
	Native Crash Reporting
=================================================================
Got a abrt 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:
=================================================================
	0x100d1c5ac - /private/var/containers/Bundle/Application/00000000-0000-0000-0000-000000000000/TestiOS15.app/Frameworks/Mono.framework/Mono : mono_dump_native_crash_info
	0x100d12724 - /private/var/containers/Bundle/Application/00000000-0000-0000-0000-000000000000/TestiOS15.app/Frameworks/Mono.framework/Mono : mono_handle_native_crash
	0x100d1baf4 - /private/var/containers/Bundle/Application/00000000-0000-0000-0000-000000000000/TestiOS15.app/Frameworks/Mono.framework/Mono : sigabrt_signal_handler
	0x1dc9bfd50 - /usr/lib/system/libsystem_platform.dylib : <redacted>
	0x1dc9d68d8 - /usr/lib/system/libsystem_pthread.dylib : pthread_kill
	0x18d48d0c0 - /usr/lib/system/libsystem_c.dylib : abort
	0x1004adf7c - /private/var/containers/Bundle/Application/00000000-0000-0000-0000-000000000000/TestiOS15.app/TestiOS15 : xamarin_find_protocol_wrapper_type
	0x100ce95ec - /private/var/containers/Bundle/Application/00000000-0000-0000-0000-000000000000/TestiOS15.app/Frameworks/Mono.framework/Mono : monoeg_g_logv_nofree
	0x100ce963c - /private/var/containers/Bundle/Application/00000000-0000-0000-0000-000000000000/TestiOS15.app/Frameworks/Mono.framework/Mono : monoeg_g_log
	0x100d1e3e0 - /private/var/containers/Bundle/Application/00000000-0000-0000-0000-000000000000/TestiOS15.app/Frameworks/Mono.framework/Mono : mono_resolve_patch_target
	0x100cf7ce0 - /private/var/containers/Bundle/Application/00000000-0000-0000-0000-000000000000/TestiOS15.app/Frameworks/Mono.framework/Mono : mono_aot_plt_resolve
	0x100d26c68 - /private/var/containers/Bundle/Application/00000000-0000-0000-0000-000000000000/TestiOS15.app/Frameworks/Mono.framework/Mono : mono_aot_plt_trampoline
	0x10045382c - /private/var/containers/Bundle/Application/00000000-0000-0000-0000-000000000000/TestiOS15.app/TestiOS15 : 
	0x100376570 - /private/var/containers/Bundle/Application/00000000-0000-0000-0000-000000000000/TestiOS15.app/TestiOS15 : 
	0x100364314 - /private/var/containers/Bundle/Application/00000000-0000-0000-0000-000000000000/TestiOS15.app/TestiOS15 : 
	0x1003642f4 - /private/var/containers/Bundle/Application/00000000-0000-0000-0000-000000000000/TestiOS15.app/TestiOS15 : 
	0x100494374 - /private/var/containers/Bundle/Application/00000000-0000-0000-0000-000000000000/TestiOS15.app/TestiOS15 : 
	0x100437c10 - /private/var/containers/Bundle/Application/00000000-0000-0000-0000-000000000000/TestiOS15.app/TestiOS15 : 
	0x100d23e74 - /private/var/containers/Bundle/Application/00000000-0000-0000-0000-000000000000/TestiOS15.app/Frameworks/Mono.framework/Mono : mono_jit_runtime_invoke
	0x100ddfe70 - /private/var/containers/Bundle/Application/00000000-0000-0000-0000-000000000000/TestiOS15.app/Frameworks/Mono.framework/Mono : mono_runtime_try_invoke
	0x100ddeb70 - /private/var/containers/Bundle/Application/00000000-0000-0000-0000-000000000000/TestiOS15.app/Frameworks/Mono.framework/Mono : mono_runtime_class_init_full
	0x100d1e920 - /private/var/containers/Bundle/Application/00000000-0000-0000-0000-000000000000/TestiOS15.app/Frameworks/Mono.framework/Mono : mono_resolve_patch_target
	0x100cf6418 - /private/var/containers/Bundle/Application/00000000-0000-0000-0000-000000000000/TestiOS15.app/Frameworks/Mono.framework/Mono : init_method
	0x100cf7464 - /private/var/containers/Bundle/Application/00000000-0000-0000-0000-000000000000/TestiOS15.app/Frameworks/Mono.framework/Mono : load_method
	0x100cf6c98 - /private/var/containers/Bundle/Application/00000000-0000-0000-0000-000000000000/TestiOS15.app/Frameworks/Mono.framework/Mono : mono_aot_get_method
	0x100d1f164 - /private/var/containers/Bundle/Application/00000000-0000-0000-0000-000000000000/TestiOS15.app/Frameworks/Mono.framework/Mono : mono_jit_compile_method_with_opt
	0x100d23b90 - /private/var/containers/Bundle/Application/00000000-0000-0000-0000-000000000000/TestiOS15.app/Frameworks/Mono.framework/Mono : mono_jit_runtime_invoke
	0x100ddfe70 - /private/var/containers/Bundle/Application/00000000-0000-0000-0000-000000000000/TestiOS15.app/Frameworks/Mono.framework/Mono : mono_runtime_try_invoke
	0x100de1d98 - /private/var/containers/Bundle/Application/00000000-0000-0000-0000-000000000000/TestiOS15.app/Frameworks/Mono.framework/Mono : mono_runtime_invoke
	0x1004b7a74 - /private/var/containers/Bundle/Application/00000000-0000-0000-0000-000000000000/TestiOS15.app/TestiOS15 : xamarin_log
	0x1004ae094 - /private/var/containers/Bundle/Application/00000000-0000-0000-0000-000000000000/TestiOS15.app/TestiOS15 : xamarin_find_protocol_wrapper_type
	0x1004bb91c - /private/var/containers/Bundle/Application/00000000-0000-0000-0000-000000000000/TestiOS15.app/TestiOS15 : xamarin_log
	0x10031e7c8 - /private/var/containers/Bundle/Application/00000000-0000-0000-0000-000000000000/TestiOS15.app/TestiOS15 : 
	0x100894190 - Unknown

=================================================================
	Basic Fault Address Reporting
=================================================================
Memory around native instruction pointer (0x1bc5a2a48):0x1bc5a2a38  c0 03 5f d6 c0 03 5f d6 10 29 80 d2 01 10 00 d4  .._..._..)......
0x1bc5a2a48  e3 00 00 54 fd 7b bf a9 fd 03 00 91 1f ef ff 97  ...T.{..........
0x1bc5a2a58  bf 03 00 91 fd 7b c1 a8 c0 03 5f d6 c0 03 5f d6  .....{...._..._.
0x1bc5a2a68  fd 7b bf a9 fd 03 00 91 50 00 80 d2 01 10 00 d4  .{......P.......

=================================================================
	Managed Stacktrace:
=================================================================
	  at <unknown> <0xffffffff>
	  at System.RuntimeTypeHandle:GetAssembly <0x0005f>
	  at System.RuntimeType:GetRuntimeAssembly <0x00013>
	  at System.RuntimeType:get_Assembly <0x00013>
	  at Foundation.NSObject:.cctor <0x00023>
	  at System.Object:runtime_invoke_dynamic <0x0010f>
=================================================================

Environment

=== Visual Studio Community 2019 for Mac ===

Version 8.10.9 (build 3)
Installation UUID: a48ff78a-85e3-4d07-a3ef-50816497e5ca
	GTK+ 2.24.23 (Raleigh theme)
	Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)

	Package version: 612000140

=== Mono Framework MDK ===

Runtime:
	Mono 6.12.0.140 (2020-02/51d876a041e) (64-bit)
	Package version: 612000140

=== Roslyn (Language Service) ===

3.10.0-4.21269.26+029847714208ebe49668667c60ea5b0a294e0fcb

=== NuGet ===

Version: 5.9.0.7134

=== .NET Core SDK ===

SDK: /usr/local/share/dotnet/sdk/5.0.401/Sdks
SDK Versions:
	5.0.401
	5.0.400
	5.0.302
	5.0.301
	5.0.203
	5.0.202
	5.0.201
	5.0.103
	5.0.102
	5.0.101
	5.0.100
	3.1.413
	3.1.412
	3.1.411
	3.1.410
	3.1.409
	3.1.408
	3.1.407
	3.1.406
	3.1.405
	3.1.404
	3.1.403
	3.1.402
	3.1.401
	3.1.302
	3.1.301
	3.1.300
	3.1.202
	3.1.200
	3.1.102
	3.1.101
	3.1.100
	3.0.101
	3.0.100
	2.1.809
MSBuild SDKs: /Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/Sdks

=== .NET Core Runtime ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
	5.0.10
	5.0.9
	5.0.8
	5.0.7
	5.0.6
	5.0.5
	5.0.4
	5.0.3
	5.0.2
	5.0.1
	5.0.0
	3.1.19
	3.1.18
	3.1.17
	3.1.16
	3.1.15
	3.1.14
	3.1.13
	3.1.12
	3.1.11
	3.1.10
	3.1.9
	3.1.8
	3.1.7
	3.1.6
	3.1.5
	3.1.4
	3.1.2
	3.1.1
	3.1.0
	3.0.1
	3.0.0
	2.1.23
	2.1.22
	2.1.21
	2.1.20
	2.1.19
	2.1.18
	2.1.17
	2.1.16
	2.1.15
	2.1.14
	2.1.13

=== .NET Core 3.1 SDK ===

SDK: 3.1.413

=== Xamarin.Profiler ===

'/Applications/Xamarin Profiler.app' not found

=== Updater ===

Version: 11

=== Xamarin.Android ===

Version: 11.3.0.4 (Visual Studio Community)
Commit: xamarin-android/d16-10/ae14caf
Android SDK: /Users/xx/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		7.1 (API level 25)
		8.0 (API level 26)
		8.1 (API level 27)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 31.0.0
SDK Build Tools Version: 30.0.3

Build Information: 
Mono: b4a3858
Java.Interop: xamarin/java.interop/d16-10@f39db25
ProGuard: Guardsquare/proguard/v7.0.1@912d149
SQLite: xamarin/sqlite/3.35.4@85460d3
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-10@c5732a0

=== Microsoft OpenJDK for Mobile ===

Java SDK: /Users/xx/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Android SDK Manager ===

Version: 16.10.0.13
Hash: 1b81df5
Branch: remotes/origin/d16-10
Build date: 2021-08-12 20:43:52 UTC

=== Android Device Manager ===

Version: 16.10.0.15
Hash: 89dcc0b
Branch: remotes/origin/d16-10
Build date: 2021-08-12 20:44:10 UTC

=== Xamarin Designer ===

Version: 16.10.0.119
Hash: 36a2d986f
Branch: remotes/origin/d16-10
Build date: 2021-06-02 19:41:34 UTC

=== Apple Developer Tools ===

Xcode 13.0 (19234)
Build 13A233

=== Xamarin.Mac ===

Xamarin.Mac not installed. Can't find /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/Version.

=== Xamarin.iOS ===

Version: 15.0.0.3 (Visual Studio Community)
Hash: 011ef4317
Branch: xcode13-ios
Build date: 2021-09-22 08:31:50-0400

=== Build Information ===

Release ID: 810090003
Git revision: 156eb53c9c668cb7ff4311ae3d1dab894549848b
Build date: 2021-09-08 07:26:54-04
Build branch: release-8.10

=== Operating System ===

Mac OS X 10.16.0
Darwin 20.6.0 Darwin Kernel Version 20.6.0
    Wed Jun 23 00:26:31 PDT 2021
    root:xnu-7195.141.2~5/RELEASE_X86_64 x86_64

=== Enabled user installed extensions ===

AddinMaker 1.6.0

@dalexsoto
Copy link
Member

After investigating a little more on my side it seems that bundling mono as a framework is giving out issues

Steps to Reproduce

  1. Create single view iOS App
  2. Add --mono:framework to Additional mtouch arguments
  3. Compile, deploy and try to debug on device
  4. Boom

Sample project
iOSFrameworkTest.zip

This is not contained to xcode13-ios branch but also present in main

@dalexsoto dalexsoto added the iOS Issues affecting Xamarin.iOS label Sep 22, 2021
@dalexsoto dalexsoto added this to the Future milestone Sep 22, 2021
@dalexsoto dalexsoto added the bug If an issue is a bug or a pull request a bug fix label Sep 22, 2021
@kozw
Copy link
Author

kozw commented Sep 22, 2021

Interesting observation that this is also present in main. Extensions work fine on stable Xamarin.iOS with Xcode 12.5

@dalexsoto
Copy link
Member

Interesting observation that this is also present in main. Extensions work fine on stable Xamarin.iOS with Xcode 12.5

Yes, still investigating what or where this broke, thanks a lot for your report, we will continue to work on it!

rolfbjarne added a commit to rolfbjarne/xamarin-macios that referenced this issue Sep 23, 2021
vs-mobiletools-engineering-service2 pushed a commit to vs-mobiletools-engineering-service2/xamarin-macios that referenced this issue Sep 23, 2021
rolfbjarne added a commit that referenced this issue Sep 23, 2021
…amarin. Fixes #12810. (#12813)

Fixes #12810.
Fixes mono/mono#21210.

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
@ghost ghost locked as resolved and limited conversation to collaborators Apr 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug If an issue is a bug or a pull request a bug fix iOS Issues affecting Xamarin.iOS
Projects
None yet
2 participants