Skip to content

Mac Catalyst apps crash upon launch #118519

@rolfbjarne

Description

@rolfbjarne

Description

Some Mac Catalyst apps crashes upon launch. Seems to be arm64 only, I haven't seen it happen on x64.

Neither have I seen it on iOS arm64 simulator (haven't tested on device though).

Reproduction Steps

Use .NET 10.0.100-rc.1.25407.105 (this is a regression since 10.0.100-rc.1.25406.102)

$ dotnet new maccatalyst
$ dotnet build
./bin/Debug/net10.0-maccatalyst/maccatalyst-arm64/*.app/Contents/MacOS/*

Expected behavior

No crash.

Actual behavior

Crash.

Complete output (with stack trace)
=================================================================
	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:
=================================================================
	0x10107991c - /Users/rolf/work/dotnet/macios/mono-master/macios/tests/dotnet/bug/bin/Debug/net10.0-maccatalyst/maccatalyst-arm64/bug.app/Contents/MacOS/bug : mono_dump_native_crash_info
	0x10102e020 - /Users/rolf/work/dotnet/macios/mono-master/macios/tests/dotnet/bug/bin/Debug/net10.0-maccatalyst/maccatalyst-arm64/bug.app/Contents/MacOS/bug : mono_handle_native_crash
	0x100fbe9f8 - /Users/rolf/work/dotnet/macios/mono-master/macios/tests/dotnet/bug/bin/Debug/net10.0-maccatalyst/maccatalyst-arm64/bug.app/Contents/MacOS/bug : mono_sigsegv_signal_handler_debug
	0x185e216a4 - /usr/lib/system/libsystem_platform.dylib : _sigtramp
	0x100733a4c - /Users/rolf/work/dotnet/macios/mono-master/macios/tests/dotnet/bug/bin/Debug/net10.0-maccatalyst/maccatalyst-arm64/bug.app/Contents/MacOS/bug : System_ArgumentOutOfRangeException_ThrowIfNegative_int_int_string
	0x100abe450 - /Users/rolf/work/dotnet/macios/mono-master/macios/tests/dotnet/bug/bin/Debug/net10.0-maccatalyst/maccatalyst-arm64/bug.app/Contents/MacOS/bug : string_Ctor_char__int_int
	0x100abe3f0 - /Users/rolf/work/dotnet/macios/mono-master/macios/tests/dotnet/bug/bin/Debug/net10.0-maccatalyst/maccatalyst-arm64/bug.app/Contents/MacOS/bug : wrapper_managed_to_managed_string__ctor_char__int_int
	0x100acca4c - /Users/rolf/work/dotnet/macios/mono-master/macios/tests/dotnet/bug/bin/Debug/net10.0-maccatalyst/maccatalyst-arm64/bug.app/Contents/MacOS/bug : System_AppContext_Setup_char___uint__char___uint__int
	0x100d4eda8 - /Users/rolf/work/dotnet/macios/mono-master/macios/tests/dotnet/bug/bin/Debug/net10.0-maccatalyst/maccatalyst-arm64/bug.app/Contents/MacOS/bug : wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr
	0x100fc1d00 - /Users/rolf/work/dotnet/macios/mono-master/macios/tests/dotnet/bug/bin/Debug/net10.0-maccatalyst/maccatalyst-arm64/bug.app/Contents/MacOS/bug : mono_jit_runtime_invoke
	0x100f617d8 - /Users/rolf/work/dotnet/macios/mono-master/macios/tests/dotnet/bug/bin/Debug/net10.0-maccatalyst/maccatalyst-arm64/bug.app/Contents/MacOS/bug : mono_runtime_invoke_checked
	0x100efb04c - /Users/rolf/work/dotnet/macios/mono-master/macios/tests/dotnet/bug/bin/Debug/net10.0-maccatalyst/maccatalyst-arm64/bug.app/Contents/MacOS/bug : mono_runtime_install_appctx_properties
	0x100efa594 - /Users/rolf/work/dotnet/macios/mono-master/macios/tests/dotnet/bug/bin/Debug/net10.0-maccatalyst/maccatalyst-arm64/bug.app/Contents/MacOS/bug : mono_runtime_init_checked
	0x100fc128c - /Users/rolf/work/dotnet/macios/mono-master/macios/tests/dotnet/bug/bin/Debug/net10.0-maccatalyst/maccatalyst-arm64/bug.app/Contents/MacOS/bug : mini_init
	0x101013cdc - /Users/rolf/work/dotnet/macios/mono-master/macios/tests/dotnet/bug/bin/Debug/net10.0-maccatalyst/maccatalyst-arm64/bug.app/Contents/MacOS/bug : mono_jit_init_version
	0x100e48068 - /Users/rolf/work/dotnet/macios/mono-master/macios/tests/dotnet/bug/bin/Debug/net10.0-maccatalyst/maccatalyst-arm64/bug.app/Contents/MacOS/bug : xamarin_bridge_initialize
	0x100e4c9ec - /Users/rolf/work/dotnet/macios/mono-master/macios/tests/dotnet/bug/bin/Debug/net10.0-maccatalyst/maccatalyst-arm64/bug.app/Contents/MacOS/bug : xamarin_main
	0x1010bd6bc - /Users/rolf/work/dotnet/macios/mono-master/macios/tests/dotnet/bug/bin/Debug/net10.0-maccatalyst/maccatalyst-arm64/bug.app/Contents/MacOS/bug : main
	0x185a46b98 - /usr/lib/dyld : start

=================================================================
	Basic Fault Address Reporting
=================================================================
Memory around native instruction pointer (0x131839a98):0x131839a88  48 c6 a5 01 01 00 00 00 58 c6 a5 01 01 00 00 00  H.......X.......
0x131839a98  c8 a2 02 31 01 00 00 00 1b 00 00 00 00 00 00 00  ...1............
0x131839aa8  c0 0d b1 03 00 60 00 00 10 48 a2 06 01 00 00 00  .....`...H......
0x131839ab8  30 a4 82 31 01 00 00 00 00 00 00 00 00 00 00 00  0..1............

=================================================================
	Managed Stacktrace:
=================================================================
=================================================================
[1]    42702 segmentation fault  ./bin/Debug/net10.0-maccatalyst/maccatalyst-arm64/bug.app/Contents/MacOS/bug

Full crash report: https://gist.github.com/rolfbjarne/265ceae02069563937c25999aa9f99b2

Lldb session: https://gist.github.com/rolfbjarne/1c3b169cc03c6e190463f3be30680803 - I actually got crashes in three different locations, all three are in the gist.

Regression?

Yes, between 10.0.100-rc.1.25406.102 and 10.0.100-rc.1.25407.105 (this started happening in this maestro bump: dotnet/macios#23522)

Known Workarounds

None

Configuration

.NET 10.0.100-rc.1.25407.105

Other information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions