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

iOS: crash when profiling dotnet-podcasts #71492

Closed
Tracked by #14548
rolfbjarne opened this issue Jun 30, 2022 · 9 comments
Closed
Tracked by #14548

iOS: crash when profiling dotnet-podcasts #71492

rolfbjarne opened this issue Jun 30, 2022 · 9 comments
Assignees
Milestone

Comments

@rolfbjarne
Copy link
Member

rolfbjarne commented Jun 30, 2022

Description

The dotnet-podcasts app crashes on an iOS device when profiling.

Reproduction Steps

Clone https://github.com/microsoft/dotnet-podcasts

[optional] Apply this to not have to install android bits: https://gist.github.com/rolfbjarne/c4a5514cb3e0445f8e32cc03ea624d3d

Read/Follow the instructions here to profile on device: https://github.com/xamarin/xamarin-macios/wiki/Profiling:

Clone dotnet/diagnostics and patch dotnet-dsrouter with this PR: dotnet/diagnostics#3134

Run dotnet-dsrouter from dotnet/diagnostics:

$ cd src/Tools/dotnet-dsrouter
$ dotnet run -- server-client -ipcs ~/my-dev-port -tcpc 127.0.0.1:9001 --forward-port iOS
[leave this running]

Build & run the dotnet-podcasts app:

dotnet build /p:RuntimeIdentifier=ios-arm64 *.csproj /bl /p:MtouchNoSymbolStrip=true

DEVNAME=00008110-000568491A92801E

mlaunch --installdev bin/Debug/net6.0-ios/ios-arm64/Microsoft.NetConf2021.Maui.app --devname $DEVNAME
mlaunch --launchdev bin/Debug/net6.0-ios/ios-arm64/Microsoft.NetConf2021.Maui.app --devname $DEVNAME --wait-for-exit --wait-for-unlock --argument --connection-mode --argument none '--setenv:DOTNET_DiagnosticPorts=127.0.0.1:9001,suspend,listen'

Wait until the app prints this:

The runtime has been configured to pause during startup and is awaiting a Diagnostics IPC ResumeStartup command from a Diagnostic Port.

Then start diagnosing:

$ dotnet-trace collect --diagnostic-port ~/my-dev-port,connect --format speedscope
No profile or providers specified, defaulting to trace profile 'cpu-sampling'

Provider Name                           Keywords            Level               Enabled By
Microsoft-DotNETCore-SampleProfiler     0x0000F00000000000  Informational(4)    --profile
Microsoft-Windows-DotNETRuntime         0x00000014C14FCCBD  Informational(4)    --profile

Process        : my-dev-port
Output File    : /Users/rolf/work/microsoft/dotnet-podcasts/src/my-dev-port_20220630_164525.nettrace

[00:00:04:41]	Recording trace 457.052  (KB)
Press <Enter> or <Ctrl+C> to exit...

The app will now crash.

Output when using lldb: https://gist.github.com/rolfbjarne/0683b315020aef560b3790a4af01435e

Expected behavior

No crash

Actual behavior

Crash:


=================================================================
	Native Crash Reporting
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================

=================================================================
	Native stacktrace:
=================================================================
	0x104f4d27c - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_dump_native_crash_info
	0x104f38620 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_handle_native_crash
	0x104f1d8c4 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_sigsegv_signal_handler_debug
	0x24dd84c10 - /usr/lib/system/libsystem_platform.dylib : <redacted>
	0x104df3788 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : ep_rt_mono_write_event_exception_thrown
	0x104e79ae0 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_profiler_raise_exception_throw
	0x104f37814 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_handle_exception_internal
	0x104f36c0c - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_handle_exception
	0x104f5a388 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : interp_throw
	0x104f56b9c - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : interp_exec_method
	0x104f4e6cc - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : interp_runtime_invoke
	0x104f20908 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_jit_runtime_invoke
	0x104e6c0ac - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_runtime_invoke_checked
	0x104e73250 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_runtime_try_invoke_array
	0x104e33588 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : ves_icall_InternalInvoke
	0x104e3dcbc - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : ves_icall_InternalInvoke_raw
	0x104f5b7bc - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : do_icall
	0x104f5a9c4 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : do_icall_wrapper
	0x104f501cc - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : interp_exec_method
	0x104f4e6cc - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : interp_runtime_invoke
	0x104f20908 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_jit_runtime_invoke
	0x104e6c0ac - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_runtime_invoke_checked
	0x104e73250 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_runtime_try_invoke_array
	0x104e33588 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : ves_icall_InternalInvoke
	0x104e3dcbc - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : ves_icall_InternalInvoke_raw
	0x104f5b7bc - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : do_icall
	0x104f5a9c4 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : do_icall_wrapper
	0x104f501cc - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : interp_exec_method
	0x104f4e6cc - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : interp_runtime_invoke
	0x104f20908 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_jit_runtime_invoke
	0x104e6d98c - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_runtime_try_invoke
	0x104e6f9a8 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_runtime_invoke
	0x104f8ff0c - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : _ZL30native_to_managed_trampoline_3P11objc_objectP13objc_selectorPP11_MonoMethodS0_S0_j
	0x104f90048 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : -[Microsoft_Maui_MauiUIApplicationDelegate application:didFinishLaunchingWithOptions:]
	0x1debcf72c - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
	0x1dedb6564 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
	0x1ded9f118 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
	0x1debfcd34 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
	0x1dea573b4 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : _UIScenePerformActionsWithLifecycleActionMask
	0x1deb81d90 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
	0x1deca1aa0 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
	0x1deee0764 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
	0x1dee6bd14 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
	0x1dea581a0 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
	0x1deb180d8 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
	0x1dea5a0a4 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : _UISceneSettingsDiffActionPerformChangesWithTransitionContext
	0x1deb44244 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
	0x1defc8e60 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
	0x1dea88484 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
	0x1deacbcc4 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
	0x1dec01b38 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
	0x1deb42508 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
	0x1ee6d3294 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : <redacted>
	0x1ee6f9090 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : <redacted>
	0x1ee6b4308 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : <redacted>
	0x1ee6b5958 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : <redacted>
	0x1dc130a30 - /usr/lib/system/libdispatch.dylib : <redacted>
	0x1dc1344e0 - /usr/lib/system/libdispatch.dylib : <redacted>
	0x1ee6b5c70 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : <redacted>
	0x1ee6b5040 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : <redacted>
	0x1ee6b9700 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : <redacted>
	0x1dc4eb414 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : <redacted>
	0x1dc4fc1a0 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : <redacted>
	0x1dc4356f8 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : <redacted>
	0x1dc43b05c - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : <redacted>
	0x1dc44ebc8 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : CFRunLoopRunSpecific
	0x1f8582374 - /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices : GSEventRunModal
	0x1dedbe648 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
	0x1deb3fd90 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : UIApplicationMain
	0x104f5b7bc - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : do_icall
	0x104f5a9c4 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : do_icall_wrapper
	0x104f501cc - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : interp_exec_method
	0x104f4e6cc - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : interp_runtime_invoke
	0x104f20908 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_jit_runtime_invoke
	0x104e6c0ac - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_runtime_invoke_checked
	0x104e71ac4 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_runtime_exec_main_checked
	0x104f256b0 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_jit_exec
	0x104c81530 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : xamarin_main
	0x104f8f468 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : main
	0x10548dce4 - Unknown

=================================================================
	Basic Fault Address Reporting
=================================================================
Memory around native instruction pointer (0x104df37a4):0x104df3794  08 02 80 52 16 05 88 1a 68 0e 40 f9 00 51 00 91  [email protected]..
0x104df37a4  01 11 80 b9 02 00 80 d2 03 00 80 d2 04 00 80 d2  ................
0x104df37b4  eb 5b 06 94 f4 03 00 aa 75 62 40 b9 d7 08 02 94  .[......ub@.....
0x104df37c4  08 00 40 f9 28 01 00 b4 d4 08 02 94 08 00 40 f9  ..@.(.........@.

=================================================================
	Managed Stacktrace:
=================================================================
	  at <unknown> <0xffffffff>
	  at System.Reflection.Assembly:Load <0x00082>
	  at System.Reflection.RuntimeAssembly:InternalGetSatelliteAssembly <0x000d6>
	  at System.Resources.ManifestBasedResourceGroveler:InternalGetSatelliteAssembly <0x00018>
	  at System.Resources.ManifestBasedResourceGroveler:GetSatelliteAssembly <0x000c0>
	  at System.Resources.ManifestBasedResourceGroveler:GrovelForResourceSet <0x0008c>
	  at System.Resources.ResourceManager:InternalGetResourceSet <0x001c2>
	  at System.Resources.ResourceManager:GetString <0x000e0>
	  at System.SR:InternalGetResourceString <0x00710>
	  at System.SR:GetResourceString <0x0001e>
	  at System.Text.EncodingTable:GetDisplayName <0x00028>
	  at System.Text.EncodingTable:InternalGetCodePageDataItem <0x00072>
	  at System.Text.EncodingTable:GetCodePageDataItem <0x0013c>
	  at System.Text.Encoding:GetDataItem <0x0001c>
	  at System.Text.Encoding:get_WebName <0x0001a>
	  at System.Xml.XmlTextReaderImpl:SwitchEncoding <0x0000e>
	  at System.Xml.XmlTextReaderImpl:ParseXmlDeclaration <0x0053e>
	  at System.Xml.XmlTextReaderImpl:Read <0x00124>
	  at Microsoft.Maui.Controls.Xaml.XamlLoader:Load <0x0023e>
	  at Microsoft.Maui.Controls.Xaml.XamlLoader:Load <0x0001a>
	  at Microsoft.Maui.Controls.Xaml.XamlLoader:Load <0x00096>
	  at Microsoft.Maui.Controls.Xaml.Extensions:LoadFromXaml <0x00010>
	  at Microsoft.NetConf2021.Maui.Resources.Styles.DefaultTheme:InitializeComponent <0x00012>
	  at Microsoft.NetConf2021.Maui.Resources.Styles.DefaultTheme:.ctor <0x0001a>
	  at System.Object:runtime_invoke_direct_void__this__ <0x00048>
	  at <unknown> <0x00000>
	  at <unknown> <0xffffffff>
	  at System.Reflection.RuntimeConstructorInfo:InternalInvoke <0x00054>
	  at System.Reflection.RuntimeConstructorInfo:InternalInvoke <0x00038>
	  at System.RuntimeType:CreateInstanceMono <0x00244>
	  at System.RuntimeType:CreateInstanceDefaultCtor <0x0008c>
	  at System.Activator:CreateInstance <0x00078>
	  at System.Activator:CreateInstance <0x00016>
	  at System.Activator:CreateInstance <0x00010>
	  at <>c:<SetAndLoadSource>b__7_0 <0x0000c>
	  at System.Runtime.CompilerServices.ConditionalWeakTable`2:GetValueLocked <0x0001a>
	  at System.Runtime.CompilerServices.ConditionalWeakTable`2:GetValue <0x00052>
	  at Microsoft.Maui.Controls.ResourceDictionary:SetAndLoadSource <0x00096>
	  at RDSourceTypeConverter:Microsoft.Maui.Controls.IExtendedTypeConverter.ConvertFromInvariantString <0x00238>
	  at Microsoft.Maui.Controls.Xaml.TypeConversionExtensions:ConvertTo <0x00092>
	  at Microsoft.Maui.Controls.Xaml.TypeConversionExtensions:ConvertTo <0x00052>
	  at Microsoft.Maui.Controls.Xaml.ApplyPropertiesVisitor:TrySetProperty <0x0017e>
	  at Microsoft.Maui.Controls.Xaml.ApplyPropertiesVisitor:TrySetPropertyValue <0x002b2>
	  at Microsoft.Maui.Controls.Xaml.ApplyPropertiesVisitor:SetPropertyValue <0x000e6>
	  at Microsoft.Maui.Controls.Xaml.ApplyPropertiesVisitor:Visit <0x00176>
	  at Microsoft.Maui.Controls.Xaml.ValueNode:Accept <0x00018>
	  at Microsoft.Maui.Controls.Xaml.ElementNode:Accept <0x000d0>
	  at Microsoft.Maui.Controls.Xaml.FillResourceDictionariesVisitor:Visit <0x00232>
	  at Microsoft.Maui.Controls.Xaml.ElementNode:Accept <0x00050>
	  at Microsoft.Maui.Controls.Xaml.ElementNode:Accept <0x00148>
	  at Microsoft.Maui.Controls.Xaml.RootNode:Accept <0x000d0>
	  at Microsoft.Maui.Controls.Xaml.XamlLoader:Visit <0x0019c>
	  at Microsoft.Maui.Controls.Xaml.XamlLoader:Load <0x00202>
	  at Microsoft.Maui.Controls.Xaml.XamlLoader:Load <0x0001a>
	  at Microsoft.Maui.Controls.Xaml.XamlLoader:Load <0x00096>
	  at Microsoft.Maui.Controls.Xaml.Extensions:LoadFromXaml <0x00010>
	  at Microsoft.NetConf2021.Maui.App:InitializeComponent <0x00012>
	  at Microsoft.NetConf2021.Maui.App:.ctor <0x00020>
	  at System.Object:runtime_invoke_direct_void__this__ <0x00048>
	  at <unknown> <0x00000>
	  at <unknown> <0xffffffff>
	  at System.Reflection.RuntimeConstructorInfo:InternalInvoke <0x00054>
	  at System.Reflection.RuntimeConstructorInfo:InternalInvoke <0x00074>
	  at System.Reflection.RuntimeConstructorInfo:DoInvoke <0x001ce>
	  at System.Reflection.RuntimeConstructorInfo:Invoke <0x00022>
	  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver:VisitConstructor <0x000ba>
	  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2:VisitCallSiteMain <0x0009c>
	  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver:VisitRootCache <0x000d0>
	  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2:VisitCallSite <0x000c2>
	  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver:Resolve <0x00056>
	  at Microsoft.Extensions.DependencyInjection.ServiceProvider:CreateServiceAccessor <0x000aa>
	  at System.Collections.Concurrent.ConcurrentDictionary`2:GetOrAdd <0x000d8>
	  at Microsoft.Extensions.DependencyInjection.ServiceProvider:GetService <0x0003e>
	  at Microsoft.Extensions.DependencyInjection.ServiceProvider:GetService <0x00018>
	  at WrappedServiceProvider:GetService <0x00078>
	  at WrappedServiceProvider:GetService <0x00078>
	  at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions:GetRequiredService <0x00088>
	  at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions:GetRequiredService <0x0002c>
	  at Microsoft.Maui.MauiUIApplicationDelegate:FinishedLaunching <0x00030>
	  at <Module>:runtime_invoke_direct_bool__this___UIApplication_NSDictionary <0x00056>
	  at <unknown> <0x00000>
	  at <unknown> <0xffffffff>
	  at UIKit.UIApplication:UIApplicationMain <0x000f6>
	  at UIKit.UIApplication:Main <0x000f8>
	  at Microsoft.NetConf2021.Maui.Program:Main <0x00016>
	  at <Module>:runtime_invoke_direct_void_string[] <0x00048>
	  at <unknown> <0x00000>
=================================================================

Regression?

No response

Known Workarounds

Disable capturing the exception runtime events:

dotnet-trace collect --diagnostic-port ~/my-dev-port,connect --providers Microsoft-Windows-DotNETRuntime:0x00000014C14F4CBD:4,Microsoft-DotNETCore-SampleProfiler:0x0000F00000000000:4 --format speedscope

Configuration

No response

Other information

Binlog: msbuild.binlog.zip

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jun 30, 2022
@ghost
Copy link

ghost commented Jun 30, 2022

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

Issue Details

Description

The dotnet-podcasts app crashes on an iOS device when profiling.

Reproduction Steps

Clone https://github.com/microsoft/dotnet-podcasts

[optional] Apply this to not have to install android bits: https://gist.github.com/rolfbjarne/c4a5514cb3e0445f8e32cc03ea624d3d

Read/Follow the instructions here to profile on device: https://github.com/xamarin/xamarin-macios/wiki/Profiling:

Clone dotnet/diagnostics and patch dotnet-dsrouter with this PR: dotnet/diagnostics#3134

Run dotnet-dsrouter from dotnet/diagnostics:

$ cd src/Tools/dotnet-dsrouter
$ dotnet run -- server-client -ipcs ~/my-dev-port -tcpc 127.0.0.1:9001 --forward-port iOS
[leave this running]

Build & run the dotnet-podcasts app:

dotnet build /p:RuntimeIdentifier=ios-arm64 *.csproj /bl /p:MtouchNoSymbolStrip=true

DEVNAME=00008110-000568491A92801E

mlaunch --installdev bin/Debug/net6.0-ios/ios-arm64/Microsoft.NetConf2021.Maui.app --devname $DEVNAME
mlaunch --launchdev bin/Debug/net6.0-ios/ios-arm64/Microsoft.NetConf2021.Maui.app --devname $DEVNAME --wait-for-exit --wait-for-unlock --argument --connection-mode --argument none '--setenv:DOTNET_DiagnosticPorts=127.0.0.1:9001,suspend,listen'

Wait until the app prints this:

The runtime has been configured to pause during startup and is awaiting a Diagnostics IPC ResumeStartup command from a Diagnostic Port.

Then start diagnosing:

$ dotnet-trace collect --diagnostic-port ~/my-dev-port,connect --format speedscope
No profile or providers specified, defaulting to trace profile 'cpu-sampling'

Provider Name                           Keywords            Level               Enabled By
Microsoft-DotNETCore-SampleProfiler     0x0000F00000000000  Informational(4)    --profile
Microsoft-Windows-DotNETRuntime         0x00000014C14FCCBD  Informational(4)    --profile

Process        : my-dev-port
Output File    : /Users/rolf/work/microsoft/dotnet-podcasts/src/my-dev-port_20220630_164525.nettrace

[00:00:04:41]	Recording trace 457.052  (KB)
Press <Enter> or <Ctrl+C> to exit...

The app will now crash.

Output when using lldb: https://gist.github.com/rolfbjarne/0683b315020aef560b3790a4af01435e

Expected behavior

No crash

Actual behavior

Crash

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

Binlog: msbuild.binlog.zip

Author: rolfbjarne
Assignees: -
Labels:

area-Diagnostics-coreclr, untriaged

Milestone: -

@steveisok steveisok removed the untriaged New issue has not been triaged by the area owner label Jun 30, 2022
@steveisok steveisok added this to the 7.0.0 milestone Jun 30, 2022
@steveisok steveisok added the os-ios Apple iOS label Jun 30, 2022
@ghost
Copy link

ghost commented Jun 30, 2022

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

Issue Details

Description

The dotnet-podcasts app crashes on an iOS device when profiling.

Reproduction Steps

Clone https://github.com/microsoft/dotnet-podcasts

[optional] Apply this to not have to install android bits: https://gist.github.com/rolfbjarne/c4a5514cb3e0445f8e32cc03ea624d3d

Read/Follow the instructions here to profile on device: https://github.com/xamarin/xamarin-macios/wiki/Profiling:

Clone dotnet/diagnostics and patch dotnet-dsrouter with this PR: dotnet/diagnostics#3134

Run dotnet-dsrouter from dotnet/diagnostics:

$ cd src/Tools/dotnet-dsrouter
$ dotnet run -- server-client -ipcs ~/my-dev-port -tcpc 127.0.0.1:9001 --forward-port iOS
[leave this running]

Build & run the dotnet-podcasts app:

dotnet build /p:RuntimeIdentifier=ios-arm64 *.csproj /bl /p:MtouchNoSymbolStrip=true

DEVNAME=00008110-000568491A92801E

mlaunch --installdev bin/Debug/net6.0-ios/ios-arm64/Microsoft.NetConf2021.Maui.app --devname $DEVNAME
mlaunch --launchdev bin/Debug/net6.0-ios/ios-arm64/Microsoft.NetConf2021.Maui.app --devname $DEVNAME --wait-for-exit --wait-for-unlock --argument --connection-mode --argument none '--setenv:DOTNET_DiagnosticPorts=127.0.0.1:9001,suspend,listen'

Wait until the app prints this:

The runtime has been configured to pause during startup and is awaiting a Diagnostics IPC ResumeStartup command from a Diagnostic Port.

Then start diagnosing:

$ dotnet-trace collect --diagnostic-port ~/my-dev-port,connect --format speedscope
No profile or providers specified, defaulting to trace profile 'cpu-sampling'

Provider Name                           Keywords            Level               Enabled By
Microsoft-DotNETCore-SampleProfiler     0x0000F00000000000  Informational(4)    --profile
Microsoft-Windows-DotNETRuntime         0x00000014C14FCCBD  Informational(4)    --profile

Process        : my-dev-port
Output File    : /Users/rolf/work/microsoft/dotnet-podcasts/src/my-dev-port_20220630_164525.nettrace

[00:00:04:41]	Recording trace 457.052  (KB)
Press <Enter> or <Ctrl+C> to exit...

The app will now crash.

Output when using lldb: https://gist.github.com/rolfbjarne/0683b315020aef560b3790a4af01435e

Expected behavior

No crash

Actual behavior

Crash:


=================================================================
	Native Crash Reporting
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================

=================================================================
	Native stacktrace:
=================================================================
	0x104f4d27c - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_dump_native_crash_info
	0x104f38620 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_handle_native_crash
	0x104f1d8c4 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_sigsegv_signal_handler_debug
	0x24dd84c10 - /usr/lib/system/libsystem_platform.dylib : <redacted>
	0x104df3788 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : ep_rt_mono_write_event_exception_thrown
	0x104e79ae0 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_profiler_raise_exception_throw
	0x104f37814 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_handle_exception_internal
	0x104f36c0c - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_handle_exception
	0x104f5a388 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : interp_throw
	0x104f56b9c - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : interp_exec_method
	0x104f4e6cc - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : interp_runtime_invoke
	0x104f20908 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_jit_runtime_invoke
	0x104e6c0ac - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_runtime_invoke_checked
	0x104e73250 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_runtime_try_invoke_array
	0x104e33588 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : ves_icall_InternalInvoke
	0x104e3dcbc - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : ves_icall_InternalInvoke_raw
	0x104f5b7bc - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : do_icall
	0x104f5a9c4 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : do_icall_wrapper
	0x104f501cc - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : interp_exec_method
	0x104f4e6cc - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : interp_runtime_invoke
	0x104f20908 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_jit_runtime_invoke
	0x104e6c0ac - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_runtime_invoke_checked
	0x104e73250 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_runtime_try_invoke_array
	0x104e33588 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : ves_icall_InternalInvoke
	0x104e3dcbc - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : ves_icall_InternalInvoke_raw
	0x104f5b7bc - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : do_icall
	0x104f5a9c4 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : do_icall_wrapper
	0x104f501cc - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : interp_exec_method
	0x104f4e6cc - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : interp_runtime_invoke
	0x104f20908 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_jit_runtime_invoke
	0x104e6d98c - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_runtime_try_invoke
	0x104e6f9a8 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_runtime_invoke
	0x104f8ff0c - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : _ZL30native_to_managed_trampoline_3P11objc_objectP13objc_selectorPP11_MonoMethodS0_S0_j
	0x104f90048 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : -[Microsoft_Maui_MauiUIApplicationDelegate application:didFinishLaunchingWithOptions:]
	0x1debcf72c - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
	0x1dedb6564 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
	0x1ded9f118 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
	0x1debfcd34 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
	0x1dea573b4 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : _UIScenePerformActionsWithLifecycleActionMask
	0x1deb81d90 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
	0x1deca1aa0 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
	0x1deee0764 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
	0x1dee6bd14 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
	0x1dea581a0 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
	0x1deb180d8 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
	0x1dea5a0a4 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : _UISceneSettingsDiffActionPerformChangesWithTransitionContext
	0x1deb44244 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
	0x1defc8e60 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
	0x1dea88484 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
	0x1deacbcc4 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
	0x1dec01b38 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
	0x1deb42508 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
	0x1ee6d3294 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : <redacted>
	0x1ee6f9090 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : <redacted>
	0x1ee6b4308 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : <redacted>
	0x1ee6b5958 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : <redacted>
	0x1dc130a30 - /usr/lib/system/libdispatch.dylib : <redacted>
	0x1dc1344e0 - /usr/lib/system/libdispatch.dylib : <redacted>
	0x1ee6b5c70 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : <redacted>
	0x1ee6b5040 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : <redacted>
	0x1ee6b9700 - /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices : <redacted>
	0x1dc4eb414 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : <redacted>
	0x1dc4fc1a0 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : <redacted>
	0x1dc4356f8 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : <redacted>
	0x1dc43b05c - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : <redacted>
	0x1dc44ebc8 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : CFRunLoopRunSpecific
	0x1f8582374 - /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices : GSEventRunModal
	0x1dedbe648 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
	0x1deb3fd90 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : UIApplicationMain
	0x104f5b7bc - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : do_icall
	0x104f5a9c4 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : do_icall_wrapper
	0x104f501cc - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : interp_exec_method
	0x104f4e6cc - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : interp_runtime_invoke
	0x104f20908 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_jit_runtime_invoke
	0x104e6c0ac - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_runtime_invoke_checked
	0x104e71ac4 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_runtime_exec_main_checked
	0x104f256b0 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : mono_jit_exec
	0x104c81530 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : xamarin_main
	0x104f8f468 - /private/var/containers/Bundle/Application/89827523-6921-4158-A080-67C9A833F89D/Microsoft.NetConf2021.Maui.app/Microsoft.NetConf2021.Maui : main
	0x10548dce4 - Unknown

=================================================================
	Basic Fault Address Reporting
=================================================================
Memory around native instruction pointer (0x104df37a4):0x104df3794  08 02 80 52 16 05 88 1a 68 0e 40 f9 00 51 00 91  [email protected]..
0x104df37a4  01 11 80 b9 02 00 80 d2 03 00 80 d2 04 00 80 d2  ................
0x104df37b4  eb 5b 06 94 f4 03 00 aa 75 62 40 b9 d7 08 02 94  .[......ub@.....
0x104df37c4  08 00 40 f9 28 01 00 b4 d4 08 02 94 08 00 40 f9  ..@.(.........@.

=================================================================
	Managed Stacktrace:
=================================================================
	  at <unknown> <0xffffffff>
	  at System.Reflection.Assembly:Load <0x00082>
	  at System.Reflection.RuntimeAssembly:InternalGetSatelliteAssembly <0x000d6>
	  at System.Resources.ManifestBasedResourceGroveler:InternalGetSatelliteAssembly <0x00018>
	  at System.Resources.ManifestBasedResourceGroveler:GetSatelliteAssembly <0x000c0>
	  at System.Resources.ManifestBasedResourceGroveler:GrovelForResourceSet <0x0008c>
	  at System.Resources.ResourceManager:InternalGetResourceSet <0x001c2>
	  at System.Resources.ResourceManager:GetString <0x000e0>
	  at System.SR:InternalGetResourceString <0x00710>
	  at System.SR:GetResourceString <0x0001e>
	  at System.Text.EncodingTable:GetDisplayName <0x00028>
	  at System.Text.EncodingTable:InternalGetCodePageDataItem <0x00072>
	  at System.Text.EncodingTable:GetCodePageDataItem <0x0013c>
	  at System.Text.Encoding:GetDataItem <0x0001c>
	  at System.Text.Encoding:get_WebName <0x0001a>
	  at System.Xml.XmlTextReaderImpl:SwitchEncoding <0x0000e>
	  at System.Xml.XmlTextReaderImpl:ParseXmlDeclaration <0x0053e>
	  at System.Xml.XmlTextReaderImpl:Read <0x00124>
	  at Microsoft.Maui.Controls.Xaml.XamlLoader:Load <0x0023e>
	  at Microsoft.Maui.Controls.Xaml.XamlLoader:Load <0x0001a>
	  at Microsoft.Maui.Controls.Xaml.XamlLoader:Load <0x00096>
	  at Microsoft.Maui.Controls.Xaml.Extensions:LoadFromXaml <0x00010>
	  at Microsoft.NetConf2021.Maui.Resources.Styles.DefaultTheme:InitializeComponent <0x00012>
	  at Microsoft.NetConf2021.Maui.Resources.Styles.DefaultTheme:.ctor <0x0001a>
	  at System.Object:runtime_invoke_direct_void__this__ <0x00048>
	  at <unknown> <0x00000>
	  at <unknown> <0xffffffff>
	  at System.Reflection.RuntimeConstructorInfo:InternalInvoke <0x00054>
	  at System.Reflection.RuntimeConstructorInfo:InternalInvoke <0x00038>
	  at System.RuntimeType:CreateInstanceMono <0x00244>
	  at System.RuntimeType:CreateInstanceDefaultCtor <0x0008c>
	  at System.Activator:CreateInstance <0x00078>
	  at System.Activator:CreateInstance <0x00016>
	  at System.Activator:CreateInstance <0x00010>
	  at <>c:<SetAndLoadSource>b__7_0 <0x0000c>
	  at System.Runtime.CompilerServices.ConditionalWeakTable`2:GetValueLocked <0x0001a>
	  at System.Runtime.CompilerServices.ConditionalWeakTable`2:GetValue <0x00052>
	  at Microsoft.Maui.Controls.ResourceDictionary:SetAndLoadSource <0x00096>
	  at RDSourceTypeConverter:Microsoft.Maui.Controls.IExtendedTypeConverter.ConvertFromInvariantString <0x00238>
	  at Microsoft.Maui.Controls.Xaml.TypeConversionExtensions:ConvertTo <0x00092>
	  at Microsoft.Maui.Controls.Xaml.TypeConversionExtensions:ConvertTo <0x00052>
	  at Microsoft.Maui.Controls.Xaml.ApplyPropertiesVisitor:TrySetProperty <0x0017e>
	  at Microsoft.Maui.Controls.Xaml.ApplyPropertiesVisitor:TrySetPropertyValue <0x002b2>
	  at Microsoft.Maui.Controls.Xaml.ApplyPropertiesVisitor:SetPropertyValue <0x000e6>
	  at Microsoft.Maui.Controls.Xaml.ApplyPropertiesVisitor:Visit <0x00176>
	  at Microsoft.Maui.Controls.Xaml.ValueNode:Accept <0x00018>
	  at Microsoft.Maui.Controls.Xaml.ElementNode:Accept <0x000d0>
	  at Microsoft.Maui.Controls.Xaml.FillResourceDictionariesVisitor:Visit <0x00232>
	  at Microsoft.Maui.Controls.Xaml.ElementNode:Accept <0x00050>
	  at Microsoft.Maui.Controls.Xaml.ElementNode:Accept <0x00148>
	  at Microsoft.Maui.Controls.Xaml.RootNode:Accept <0x000d0>
	  at Microsoft.Maui.Controls.Xaml.XamlLoader:Visit <0x0019c>
	  at Microsoft.Maui.Controls.Xaml.XamlLoader:Load <0x00202>
	  at Microsoft.Maui.Controls.Xaml.XamlLoader:Load <0x0001a>
	  at Microsoft.Maui.Controls.Xaml.XamlLoader:Load <0x00096>
	  at Microsoft.Maui.Controls.Xaml.Extensions:LoadFromXaml <0x00010>
	  at Microsoft.NetConf2021.Maui.App:InitializeComponent <0x00012>
	  at Microsoft.NetConf2021.Maui.App:.ctor <0x00020>
	  at System.Object:runtime_invoke_direct_void__this__ <0x00048>
	  at <unknown> <0x00000>
	  at <unknown> <0xffffffff>
	  at System.Reflection.RuntimeConstructorInfo:InternalInvoke <0x00054>
	  at System.Reflection.RuntimeConstructorInfo:InternalInvoke <0x00074>
	  at System.Reflection.RuntimeConstructorInfo:DoInvoke <0x001ce>
	  at System.Reflection.RuntimeConstructorInfo:Invoke <0x00022>
	  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver:VisitConstructor <0x000ba>
	  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2:VisitCallSiteMain <0x0009c>
	  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver:VisitRootCache <0x000d0>
	  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2:VisitCallSite <0x000c2>
	  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver:Resolve <0x00056>
	  at Microsoft.Extensions.DependencyInjection.ServiceProvider:CreateServiceAccessor <0x000aa>
	  at System.Collections.Concurrent.ConcurrentDictionary`2:GetOrAdd <0x000d8>
	  at Microsoft.Extensions.DependencyInjection.ServiceProvider:GetService <0x0003e>
	  at Microsoft.Extensions.DependencyInjection.ServiceProvider:GetService <0x00018>
	  at WrappedServiceProvider:GetService <0x00078>
	  at WrappedServiceProvider:GetService <0x00078>
	  at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions:GetRequiredService <0x00088>
	  at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions:GetRequiredService <0x0002c>
	  at Microsoft.Maui.MauiUIApplicationDelegate:FinishedLaunching <0x00030>
	  at <Module>:runtime_invoke_direct_bool__this___UIApplication_NSDictionary <0x00056>
	  at <unknown> <0x00000>
	  at <unknown> <0xffffffff>
	  at UIKit.UIApplication:UIApplicationMain <0x000f6>
	  at UIKit.UIApplication:Main <0x000f8>
	  at Microsoft.NetConf2021.Maui.Program:Main <0x00016>
	  at <Module>:runtime_invoke_direct_void_string[] <0x00048>
	  at <unknown> <0x00000>
=================================================================

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

Binlog: msbuild.binlog.zip

Author: rolfbjarne
Assignees: lateralusX
Labels:

os-ios, area-Diagnostics-mono

Milestone: 7.0.0

@lateralusX
Copy link
Member

lateralusX commented Jul 1, 2022

Happens when we get a thrown exception with a NULL exceptions message from profiler into EventPipe. This issue has been fixed in .net7, 0e35b8d.

It is possible to disable exception events to be generated as a workaround, remove 0x8000 from:

Microsoft-Windows-DotNETRuntime 0x00000014C14FCCBD

provider giving it a mask of 0x00000014C14F4CBD instead, that should not trigger exception events anymore.

It might be worth considering a backport of 0e35b8d to .net6.

Have not seen this in the past on any other platform, and I know that MAUI team have been profiling the PodCast app on Android quite extensively, so is probably a failure on iOS, maybe in relationship with full AOT (since its device).

Thanks for reporting with all details, it really helped locating the issue by just investigate the callstack and assembly dump info.

@lateralusX
Copy link
Member

@rolfbjarne Do you have ability to rebuild runtime with 0e35b8d and verify that it resolves the issue in .net6?

@steveisok
Copy link
Member

steveisok commented Jul 1, 2022

If it does resolve in .NET 6, we should backport 0e35b8d

@rolfbjarne
Copy link
Member Author

@steveisok @lateralusX how can I build the runtime and get runtime packs for iOS?

./build.sh clr+libs+host+packs+mono doesn't seem to do it.

@steveisok
Copy link
Member

For iOS, just build like this

'./build.sh -Subset mono+libs+packs -os iOS -arch arm64'

@rolfbjarne
Copy link
Member Author

If it does resolve in .NET 6, we should backport 0e35b8d

Yes, this resolves the crash.

@lateralusX
Copy link
Member

Already fixed in .net7 and pending backport for .net6, #72002.

@ghost ghost locked as resolved and limited conversation to collaborators Aug 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants