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

GlobalizationNative_LoadICUData never called when using Invariant mode (Mac Catalyst and other Apple platforms) #2759

Closed
rolfbjarne opened this issue Apr 20, 2022 · 14 comments · Fixed by #2800
Assignees
Milestone

Comments

@rolfbjarne
Copy link
Member

rolfbjarne commented Apr 20, 2022

Description

The problem occurs on Apple platforms (Mac Catalyst, iOS) when using .NET 7.

The initial symptom I get is this exception at startup:

Arg_ExternalException (System.Runtime.InteropServices.ExternalException)
   at System.Globalization.CompareInfo.SortHandleCache.GetCachedSortHandle(String )
   at System.Globalization.CompareInfo.IcuInitSortHandle(String )
   at System.Globalization.CompareInfo.InitSort(CultureInfo )
   at System.Globalization.CompareInfo..ctor(CultureInfo )
   at System.Globalization.CultureInfo.get_CompareInfo()
   at System.Globalization.CompareInfo..cctor()

Debugging in lldb shows that this occurs due to an error in ICU, the udata_openChoice function returns an error here:

(lldb) bt
* thread dotnet/runtime#1, name = 'tid_103', queue = 'com.apple.main-thread', stop reason = breakpoint 11.1
  * frame #0: 0x00000001015860e7 libmonosgen-2.0.dylib`udata_openChoice
    frame dotnet/runtime#1: 0x000000010167272e libmonosgen-2.0.dylib`icu::CollationRoot::load(UErrorCode&) + 118
    frame dotnet/runtime#2: 0x000000010164d871 libmonosgen-2.0.dylib`icu::umtx_initOnce(icu::UInitOnce&, void (*)(UErrorCode&), UErrorCode&) + 49
    frame dotnet/runtime#3: 0x0000000101672815 libmonosgen-2.0.dylib`icu::CollationRoot::getRootCacheEntry(UErrorCode&) + 31
    frame dotnet/runtime#4: 0x00000001016600f0 libmonosgen-2.0.dylib`icu::CollationLoader::loadTailoring(icu::Locale const&, UErrorCode&) + 46
    frame dotnet/runtime#5: 0x000000010165d070 libmonosgen-2.0.dylib`icu::Collator::makeInstance(icu::Locale const&, UErrorCode&) + 18
    frame dotnet/runtime#6: 0x000000010165d198 libmonosgen-2.0.dylib`icu::Collator::createInstance(icu::Locale const&, UErrorCode&) + 138
    frame dotnet/runtime#7: 0x0000000101660fcc libmonosgen-2.0.dylib`ucol_open + 74
    frame dotnet/runtime#8: 0x00000001013d0fea libmonosgen-2.0.dylib`GlobalizationNative_GetSortHandle + 74

Debugging a bit more reveals that GlobalizationNative_LoadICUData is never called, and I'm guessing this is the underlying cause for the exceptions above.

Now the question obviously becomes why GlobalizationNative_LoadICUData is never called.

Usually GlobalizationNative_LoadICUData is called like this (for another test app that works fine):

(lldb) monobt
frame #0: 0x0000000101159ac0 libmonosgen-2.0.dylib`GlobalizationNative_LoadICUData
frame dotnet/runtime#1: 0x1009e8140 (wrapper managed-to-native) Interop/Globalization:LoadICUData (string) [{0x11916b828} + 0xf0]  (0x1009e8050 0x1009e8203) [0x600002109180 - MonoTouch]
frame dotnet/runtime#2: 0x1009e800b System.Globalization.GlobalizationMode:LoadICU () [{0x11916a808} + 0x7b]  (0x1009e7f90 0x1009e8011) [0x600002109180 - MonoTouch]
frame dotnet/runtime#3: 0x1009e7453 System.Globalization.GlobalizationMode/Settings:.cctor () [{0x11916a2c0} + 0x113]  (0x1009e7340 0x1009e747d) [0x600002109180 - MonoTouch]
frame dotnet/runtime#4: 0x1009aa4c6 (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr) [{0x101887c88} + 0xa6]  (0x1009aa420 0x1009aa5a8) [0x600002109180 - MonoTouch]
frame dotnet/runtime#5: 0x0000000101169efb libmonosgen-2.0.dylib`mono_jit_runtime_invoke + 2395
frame dotnet/runtime#6: 0x0000000101086a6f libmonosgen-2.0.dylib`mono_runtime_try_invoke + 143
frame dotnet/runtime#7: 0x0000000101085516 libmonosgen-2.0.dylib`mono_runtime_class_init_full + 886
frame dotnet/runtime#8: 0x00000001011617ca libmonosgen-2.0.dylib`mono_jit_compile_method_inner + 1178
frame dotnet/runtime#9: 0x0000000101165d37 libmonosgen-2.0.dylib`jit_compile_method_with_opt + 2679
frame dotnet/runtime#10: 0x000000010116519a libmonosgen-2.0.dylib`mono_jit_compile_method + 58
frame dotnet/runtime#11: 0x00000001012130b9 libmonosgen-2.0.dylib`common_call_trampoline + 1273
frame dotnet/runtime#12: 0x0000000101212b70 libmonosgen-2.0.dylib`mono_magic_trampoline + 96
frame dotnet/runtime#13: 0x100835396<0x100835396 - generic_trampoline_jit trampoline>
frame dotnet/runtime#14: 0x1009e72e3 System.Globalization.GlobalizationMode:get_Invariant () [{0x11916a150} + 0x33]  (0x1009e72b0 0x1009e72e5) [0x600002109180 - MonoTouch]
frame dotnet/runtime#15: 0x1009e6f23 System.Globalization.CultureData:CreateCultureWithInvariantData () [{0x119165778} + 0xed3]  (0x1009e6050 0x1009e71e8) [0x600002109180 - MonoTouch]
frame dotnet/runtime#16: 0x1009e4ef3 System.Globalization.CultureData:get_Invariant () [{0x119164f40} + 0x53]  (0x1009e4ea0 0x1009e4f0f) [0x600002109180 - MonoTouch]
frame dotnet/runtime#17: 0x1009e4dcb System.Globalization.CultureInfo:.cctor () [{0x119164818} + 0x3b]  (0x1009e4d90 0x1009e4e1e) [0x600002109180 - MonoTouch]
frame dotnet/runtime#18: 0x1009aa4c6 (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr) [{0x101887c88} + 0xa6]  (0x1009aa420 0x1009aa5a8) [0x600002109180 - MonoTouch]
frame dotnet/runtime#19: 0x0000000101169efb libmonosgen-2.0.dylib`mono_jit_runtime_invoke + 2395
frame dotnet/runtime#20: 0x0000000101086a6f libmonosgen-2.0.dylib`mono_runtime_try_invoke + 143
frame dotnet/runtime#21: 0x0000000101085516 libmonosgen-2.0.dylib`mono_runtime_class_init_full + 886
frame dotnet/runtime#22: 0x0000000101190a16 libmonosgen-2.0.dylib`mono_method_to_ir + 104182
frame dotnet/runtime#23: 0x000000010115e99d libmonosgen-2.0.dylib`mini_method_compile + 3821
frame dotnet/runtime#24: 0x000000010116136f libmonosgen-2.0.dylib`mono_jit_compile_method_inner + 63
frame dotnet/runtime#25: 0x0000000101165d37 libmonosgen-2.0.dylib`jit_compile_method_with_opt + 2679
frame dotnet/runtime#26: 0x000000010116519a libmonosgen-2.0.dylib`mono_jit_compile_method + 58
frame dotnet/runtime#27: 0x00000001012130b9 libmonosgen-2.0.dylib`common_call_trampoline + 1273
frame dotnet/runtime#28: 0x0000000101212b70 libmonosgen-2.0.dylib`mono_magic_trampoline + 96
frame dotnet/runtime#29: 0x100835396<0x100835396 - generic_trampoline_jit trampoline>
frame dotnet/runtime#30: 0x1009e4d63 System.Globalization.CompareInfo:.cctor () [{0x119164e28} + 0x33]  (0x1009e4d30 0x1009e4d81) [0x600002109180 - MonoTouch]
frame dotnet/runtime#31: 0x1009aa4c6 (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr) [{0x101887c88} + 0xa6]  (0x1009aa420 0x1009aa5a8) [0x600002109180 - MonoTouch]
frame dotnet/runtime#32: 0x0000000101169efb libmonosgen-2.0.dylib`mono_jit_runtime_invoke + 2395
frame dotnet/runtime#33: 0x0000000101086a6f libmonosgen-2.0.dylib`mono_runtime_try_invoke + 143
frame dotnet/runtime#34: 0x0000000101085516 libmonosgen-2.0.dylib`mono_runtime_class_init_full + 886
frame dotnet/runtime#35: 0x0000000101190a16 libmonosgen-2.0.dylib`mono_method_to_ir + 104182
frame dotnet/runtime#36: 0x000000010115e99d libmonosgen-2.0.dylib`mini_method_compile + 3821
frame dotnet/runtime#37: 0x000000010116136f libmonosgen-2.0.dylib`mono_jit_compile_method_inner + 63
frame dotnet/runtime#38: 0x0000000101165d37 libmonosgen-2.0.dylib`jit_compile_method_with_opt + 2679
frame dotnet/runtime#39: 0x000000010116519a libmonosgen-2.0.dylib`mono_jit_compile_method + 58
frame dotnet/runtime#40: 0x00000001012130b9 libmonosgen-2.0.dylib`common_call_trampoline + 1273
frame dotnet/runtime#41: 0x0000000101212b70 libmonosgen-2.0.dylib`mono_magic_trampoline + 96
frame dotnet/runtime#42: 0x100835396<0x100835396 - generic_trampoline_jit trampoline>
frame dotnet/runtime#43: 0x1009e4cd3 string:StartsWith (string) [{0x1018baa80} + 0x53]  (0x1009e4c80 0x1009e4d13) [0x600002109180 - MonoTouch]
frame dotnet/runtime#44: 0x1009e4abb ObjCRuntime.Runtime:GetIsARM64CallingConvention () [{0x119061c48} + 0x6b]  (0x1009e4a50 0x1009e4abd) [0x600002109180 - MonoTouch]
frame dotnet/runtime#45: 0x1009b390b ObjCRuntime.Runtime:Initialize (ObjCRuntime.Runtime/InitializationOptions*) [{0x119013508} + 0x30b]  (0x1009b3600 0x1009b3a13) [0x600002109180 - MonoTouch]
frame dotnet/runtime#46: 0x1009b3b91 (wrapper runtime-invoke) <Module>:runtime_invoke_void_Runtime/InitializationOptions* (object,intptr,intptr,intptr) [{0x119061a80} + 0xb1]  (0x1009b3ae0 0x1009b3c78) [0x600002109180 - MonoTouch]
frame dotnet/runtime#47: 0x0000000101169efb libmonosgen-2.0.dylib`mono_jit_runtime_invoke + 2395
frame dotnet/runtime#48: 0x0000000101086a6f libmonosgen-2.0.dylib`mono_runtime_try_invoke + 143
frame dotnet/runtime#49: 0x0000000101088dff libmonosgen-2.0.dylib`mono_runtime_invoke + 95
frame dotnet/runtime#50: 0x0000000100a37c0e libxamarin-dotnet-debug.dylib`xamarin_bridge_call_runtime_initialize(options=0x0000000100a4b9f0, exception_gchandle=0x00007ff7bfeff1f0) at monovm-bridge.m:147:2
frame dotnet/runtime#51: 0x0000000100a2a87c libxamarin-dotnet-debug.dylib`xamarin_initialize at runtime.m:1302:2
frame dotnet/runtime#52: 0x0000000100a3dbe1 libxamarin-dotnet-debug.dylib`xamarin_main(argc=1, argv=0x00007ff7bfeff448, launch_mode=XamarinLaunchModeApp) at monotouch-main.m:438:2
frame dotnet/runtime#53: 0x00000001000aafc4 BundleStructure`main(argc=1, argv=0x00007ff7bfeff448) at main.x86_64.mm:62:11
frame dotnet/runtime#54: 0x00000001004e551e dyld`start + 462

So I traced all managed code (setting MONO_TRACE=all): iTerm2 Session 20 Apr 2022 at 6:28:03 PM.txt.zip

And I found that:

  1. System.Globalization.GlobalizationMode/Settings:.cctor is never called.
  2. System.Globalization.GlobalizationMode:get_Invariant is never called.
  3. However, System.Globalization.CultureData:CreateCultureWithInvariantData is called.

Then I compared the IL for System.Globalization.CultureData:CreateCultureWithInvariantData between a working app and a failing app, and it turns out there's no call to System.Globalization.GlobalizationMode:get_Invariant in the failing app.

I'm guessing the linker linked it away.

App that fails: BundleStructure.app.zip - download, unzip, and execute ./BundleStructure.app/Contents/MacOS/BundleStructure in Terminal to see the exception (due to a different issue on our side the app ends up in an infinite loop, but this is the cause for the loop in the first place).

Note: this is not a problem in .NET 6, only in .NET 7.

Reproduction Steps

If the above description isn't enough, I can try to find a way to reproduce it.

Expected behavior

No exception at startup

Actual behavior

See above

Regression?

Yes.

This started happened when maestro did this bump: xamarin/xamarin-macios@d9eacac.

Known Workarounds

No response

Configuration

No response

Other information

No response

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@rolfbjarne
Copy link
Member Author

CC @steveisok @akoeplinger

@ghost
Copy link

ghost commented Apr 20, 2022

Tagging subscribers to this area: @dotnet/area-system-globalization
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

The problem occurs on Apple platforms (Mac Catalyst, iOS) when using .NET 7.

The initial symptom I get is this exception at startup:

Arg_ExternalException (System.Runtime.InteropServices.ExternalException)
   at System.Globalization.CompareInfo.SortHandleCache.GetCachedSortHandle(String )
   at System.Globalization.CompareInfo.IcuInitSortHandle(String )
   at System.Globalization.CompareInfo.InitSort(CultureInfo )
   at System.Globalization.CompareInfo..ctor(CultureInfo )
   at System.Globalization.CultureInfo.get_CompareInfo()
   at System.Globalization.CompareInfo..cctor()

Debugging in lldb shows that this occurs due to an error in ICU, the udata_openChoice function returns an error here:

(lldb) bt
* thread dotnet/runtime#1, name = 'tid_103', queue = 'com.apple.main-thread', stop reason = breakpoint 11.1
  * frame #0: 0x00000001015860e7 libmonosgen-2.0.dylib`udata_openChoice
    frame dotnet/runtime#1: 0x000000010167272e libmonosgen-2.0.dylib`icu::CollationRoot::load(UErrorCode&) + 118
    frame dotnet/runtime#2: 0x000000010164d871 libmonosgen-2.0.dylib`icu::umtx_initOnce(icu::UInitOnce&, void (*)(UErrorCode&), UErrorCode&) + 49
    frame dotnet/runtime#3: 0x0000000101672815 libmonosgen-2.0.dylib`icu::CollationRoot::getRootCacheEntry(UErrorCode&) + 31
    frame dotnet/runtime#4: 0x00000001016600f0 libmonosgen-2.0.dylib`icu::CollationLoader::loadTailoring(icu::Locale const&, UErrorCode&) + 46
    frame dotnet/runtime#5: 0x000000010165d070 libmonosgen-2.0.dylib`icu::Collator::makeInstance(icu::Locale const&, UErrorCode&) + 18
    frame dotnet/runtime#6: 0x000000010165d198 libmonosgen-2.0.dylib`icu::Collator::createInstance(icu::Locale const&, UErrorCode&) + 138
    frame dotnet/runtime#7: 0x0000000101660fcc libmonosgen-2.0.dylib`ucol_open + 74
    frame dotnet/runtime#8: 0x00000001013d0fea libmonosgen-2.0.dylib`GlobalizationNative_GetSortHandle + 74

Debugging a bit more reveals that GlobalizationNative_LoadICUData is never called, and I'm guessing this is the underlying cause for the exceptions above.

Now the question obviously becomes why GlobalizationNative_LoadICUData is never called.

Usually GlobalizationNative_LoadICUData is called like this (for another test app that works fine):

(lldb) monobt
frame #0: 0x0000000101159ac0 libmonosgen-2.0.dylib`GlobalizationNative_LoadICUData
frame dotnet/runtime#1: 0x1009e8140 (wrapper managed-to-native) Interop/Globalization:LoadICUData (string) [{0x11916b828} + 0xf0]  (0x1009e8050 0x1009e8203) [0x600002109180 - MonoTouch]
frame dotnet/runtime#2: 0x1009e800b System.Globalization.GlobalizationMode:LoadICU () [{0x11916a808} + 0x7b]  (0x1009e7f90 0x1009e8011) [0x600002109180 - MonoTouch]
frame dotnet/runtime#3: 0x1009e7453 System.Globalization.GlobalizationMode/Settings:.cctor () [{0x11916a2c0} + 0x113]  (0x1009e7340 0x1009e747d) [0x600002109180 - MonoTouch]
frame dotnet/runtime#4: 0x1009aa4c6 (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr) [{0x101887c88} + 0xa6]  (0x1009aa420 0x1009aa5a8) [0x600002109180 - MonoTouch]
frame dotnet/runtime#5: 0x0000000101169efb libmonosgen-2.0.dylib`mono_jit_runtime_invoke + 2395
frame dotnet/runtime#6: 0x0000000101086a6f libmonosgen-2.0.dylib`mono_runtime_try_invoke + 143
frame dotnet/runtime#7: 0x0000000101085516 libmonosgen-2.0.dylib`mono_runtime_class_init_full + 886
frame dotnet/runtime#8: 0x00000001011617ca libmonosgen-2.0.dylib`mono_jit_compile_method_inner + 1178
frame dotnet/runtime#9: 0x0000000101165d37 libmonosgen-2.0.dylib`jit_compile_method_with_opt + 2679
frame dotnet/runtime#10: 0x000000010116519a libmonosgen-2.0.dylib`mono_jit_compile_method + 58
frame dotnet/runtime#11: 0x00000001012130b9 libmonosgen-2.0.dylib`common_call_trampoline + 1273
frame dotnet/runtime#12: 0x0000000101212b70 libmonosgen-2.0.dylib`mono_magic_trampoline + 96
frame dotnet/runtime#13: 0x100835396<0x100835396 - generic_trampoline_jit trampoline>
frame dotnet/runtime#14: 0x1009e72e3 System.Globalization.GlobalizationMode:get_Invariant () [{0x11916a150} + 0x33]  (0x1009e72b0 0x1009e72e5) [0x600002109180 - MonoTouch]
frame dotnet/runtime#15: 0x1009e6f23 System.Globalization.CultureData:CreateCultureWithInvariantData () [{0x119165778} + 0xed3]  (0x1009e6050 0x1009e71e8) [0x600002109180 - MonoTouch]
frame dotnet/runtime#16: 0x1009e4ef3 System.Globalization.CultureData:get_Invariant () [{0x119164f40} + 0x53]  (0x1009e4ea0 0x1009e4f0f) [0x600002109180 - MonoTouch]
frame dotnet/runtime#17: 0x1009e4dcb System.Globalization.CultureInfo:.cctor () [{0x119164818} + 0x3b]  (0x1009e4d90 0x1009e4e1e) [0x600002109180 - MonoTouch]
frame dotnet/runtime#18: 0x1009aa4c6 (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr) [{0x101887c88} + 0xa6]  (0x1009aa420 0x1009aa5a8) [0x600002109180 - MonoTouch]
frame dotnet/runtime#19: 0x0000000101169efb libmonosgen-2.0.dylib`mono_jit_runtime_invoke + 2395
frame dotnet/runtime#20: 0x0000000101086a6f libmonosgen-2.0.dylib`mono_runtime_try_invoke + 143
frame dotnet/runtime#21: 0x0000000101085516 libmonosgen-2.0.dylib`mono_runtime_class_init_full + 886
frame dotnet/runtime#22: 0x0000000101190a16 libmonosgen-2.0.dylib`mono_method_to_ir + 104182
frame dotnet/runtime#23: 0x000000010115e99d libmonosgen-2.0.dylib`mini_method_compile + 3821
frame dotnet/runtime#24: 0x000000010116136f libmonosgen-2.0.dylib`mono_jit_compile_method_inner + 63
frame dotnet/runtime#25: 0x0000000101165d37 libmonosgen-2.0.dylib`jit_compile_method_with_opt + 2679
frame dotnet/runtime#26: 0x000000010116519a libmonosgen-2.0.dylib`mono_jit_compile_method + 58
frame dotnet/runtime#27: 0x00000001012130b9 libmonosgen-2.0.dylib`common_call_trampoline + 1273
frame dotnet/runtime#28: 0x0000000101212b70 libmonosgen-2.0.dylib`mono_magic_trampoline + 96
frame dotnet/runtime#29: 0x100835396<0x100835396 - generic_trampoline_jit trampoline>
frame dotnet/runtime#30: 0x1009e4d63 System.Globalization.CompareInfo:.cctor () [{0x119164e28} + 0x33]  (0x1009e4d30 0x1009e4d81) [0x600002109180 - MonoTouch]
frame dotnet/runtime#31: 0x1009aa4c6 (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr) [{0x101887c88} + 0xa6]  (0x1009aa420 0x1009aa5a8) [0x600002109180 - MonoTouch]
frame dotnet/runtime#32: 0x0000000101169efb libmonosgen-2.0.dylib`mono_jit_runtime_invoke + 2395
frame dotnet/runtime#33: 0x0000000101086a6f libmonosgen-2.0.dylib`mono_runtime_try_invoke + 143
frame dotnet/runtime#34: 0x0000000101085516 libmonosgen-2.0.dylib`mono_runtime_class_init_full + 886
frame dotnet/runtime#35: 0x0000000101190a16 libmonosgen-2.0.dylib`mono_method_to_ir + 104182
frame dotnet/runtime#36: 0x000000010115e99d libmonosgen-2.0.dylib`mini_method_compile + 3821
frame dotnet/runtime#37: 0x000000010116136f libmonosgen-2.0.dylib`mono_jit_compile_method_inner + 63
frame dotnet/runtime#38: 0x0000000101165d37 libmonosgen-2.0.dylib`jit_compile_method_with_opt + 2679
frame dotnet/runtime#39: 0x000000010116519a libmonosgen-2.0.dylib`mono_jit_compile_method + 58
frame dotnet/runtime#40: 0x00000001012130b9 libmonosgen-2.0.dylib`common_call_trampoline + 1273
frame dotnet/runtime#41: 0x0000000101212b70 libmonosgen-2.0.dylib`mono_magic_trampoline + 96
frame dotnet/runtime#42: 0x100835396<0x100835396 - generic_trampoline_jit trampoline>
frame dotnet/runtime#43: 0x1009e4cd3 string:StartsWith (string) [{0x1018baa80} + 0x53]  (0x1009e4c80 0x1009e4d13) [0x600002109180 - MonoTouch]
frame dotnet/runtime#44: 0x1009e4abb ObjCRuntime.Runtime:GetIsARM64CallingConvention () [{0x119061c48} + 0x6b]  (0x1009e4a50 0x1009e4abd) [0x600002109180 - MonoTouch]
frame dotnet/runtime#45: 0x1009b390b ObjCRuntime.Runtime:Initialize (ObjCRuntime.Runtime/InitializationOptions*) [{0x119013508} + 0x30b]  (0x1009b3600 0x1009b3a13) [0x600002109180 - MonoTouch]
frame dotnet/runtime#46: 0x1009b3b91 (wrapper runtime-invoke) <Module>:runtime_invoke_void_Runtime/InitializationOptions* (object,intptr,intptr,intptr) [{0x119061a80} + 0xb1]  (0x1009b3ae0 0x1009b3c78) [0x600002109180 - MonoTouch]
frame dotnet/runtime#47: 0x0000000101169efb libmonosgen-2.0.dylib`mono_jit_runtime_invoke + 2395
frame dotnet/runtime#48: 0x0000000101086a6f libmonosgen-2.0.dylib`mono_runtime_try_invoke + 143
frame dotnet/runtime#49: 0x0000000101088dff libmonosgen-2.0.dylib`mono_runtime_invoke + 95
frame dotnet/runtime#50: 0x0000000100a37c0e libxamarin-dotnet-debug.dylib`xamarin_bridge_call_runtime_initialize(options=0x0000000100a4b9f0, exception_gchandle=0x00007ff7bfeff1f0) at monovm-bridge.m:147:2
frame dotnet/runtime#51: 0x0000000100a2a87c libxamarin-dotnet-debug.dylib`xamarin_initialize at runtime.m:1302:2
frame dotnet/runtime#52: 0x0000000100a3dbe1 libxamarin-dotnet-debug.dylib`xamarin_main(argc=1, argv=0x00007ff7bfeff448, launch_mode=XamarinLaunchModeApp) at monotouch-main.m:438:2
frame dotnet/runtime#53: 0x00000001000aafc4 BundleStructure`main(argc=1, argv=0x00007ff7bfeff448) at main.x86_64.mm:62:11
frame dotnet/runtime#54: 0x00000001004e551e dyld`start + 462

So I traced all managed code (setting MONO_TRACE=all): iTerm2 Session 20 Apr 2022 at 6:28:03 PM.txt.zip

And I found that:

  1. System.Globalization.GlobalizationMode/Settings:.cctor is never called.
  2. System.Globalization.GlobalizationMode:get_Invariant is never called.
  3. However, System.Globalization.CultureData:CreateCultureWithInvariantData is called.

Then I compared the IL for System.Globalization.CultureData:CreateCultureWithInvariantData between a working app and a failing app, and it turns out there's no call to System.Globalization.GlobalizationMode:get_Invariant in the failing app.

I'm guessing the linker linked it away.

App that fails: BundleStructure.app.zip - download, unzip, and execute ./BundleStructure.app/Contents/MacOS/BundleStructure in Terminal to see the exception (due to a different issue on our side the app ends up in an infinite loop, but this is the cause for the loop in the first place).

Note: this is not a problem in .NET 6, only in .NET 7.

Reproduction Steps

If the above description isn't enough, I can try to find a way to reproduce it.

Expected behavior

No exception at startup

Actual behavior

See above

Regression?

Yes.

This started happened when maestro did this bump: xamarin/xamarin-macios@d9eacac.

Known Workarounds

No response

Configuration

No response

Other information

No response

Author: rolfbjarne
Assignees: -
Labels:

area-System.Globalization, untriaged

Milestone: -

@ghost
Copy link

ghost commented Apr 20, 2022

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

Issue Details

Description

The problem occurs on Apple platforms (Mac Catalyst, iOS) when using .NET 7.

The initial symptom I get is this exception at startup:

Arg_ExternalException (System.Runtime.InteropServices.ExternalException)
   at System.Globalization.CompareInfo.SortHandleCache.GetCachedSortHandle(String )
   at System.Globalization.CompareInfo.IcuInitSortHandle(String )
   at System.Globalization.CompareInfo.InitSort(CultureInfo )
   at System.Globalization.CompareInfo..ctor(CultureInfo )
   at System.Globalization.CultureInfo.get_CompareInfo()
   at System.Globalization.CompareInfo..cctor()

Debugging in lldb shows that this occurs due to an error in ICU, the udata_openChoice function returns an error here:

(lldb) bt
* thread dotnet/runtime#1, name = 'tid_103', queue = 'com.apple.main-thread', stop reason = breakpoint 11.1
  * frame #0: 0x00000001015860e7 libmonosgen-2.0.dylib`udata_openChoice
    frame dotnet/runtime#1: 0x000000010167272e libmonosgen-2.0.dylib`icu::CollationRoot::load(UErrorCode&) + 118
    frame dotnet/runtime#2: 0x000000010164d871 libmonosgen-2.0.dylib`icu::umtx_initOnce(icu::UInitOnce&, void (*)(UErrorCode&), UErrorCode&) + 49
    frame dotnet/runtime#3: 0x0000000101672815 libmonosgen-2.0.dylib`icu::CollationRoot::getRootCacheEntry(UErrorCode&) + 31
    frame dotnet/runtime#4: 0x00000001016600f0 libmonosgen-2.0.dylib`icu::CollationLoader::loadTailoring(icu::Locale const&, UErrorCode&) + 46
    frame dotnet/runtime#5: 0x000000010165d070 libmonosgen-2.0.dylib`icu::Collator::makeInstance(icu::Locale const&, UErrorCode&) + 18
    frame dotnet/runtime#6: 0x000000010165d198 libmonosgen-2.0.dylib`icu::Collator::createInstance(icu::Locale const&, UErrorCode&) + 138
    frame dotnet/runtime#7: 0x0000000101660fcc libmonosgen-2.0.dylib`ucol_open + 74
    frame dotnet/runtime#8: 0x00000001013d0fea libmonosgen-2.0.dylib`GlobalizationNative_GetSortHandle + 74

Debugging a bit more reveals that GlobalizationNative_LoadICUData is never called, and I'm guessing this is the underlying cause for the exceptions above.

Now the question obviously becomes why GlobalizationNative_LoadICUData is never called.

Usually GlobalizationNative_LoadICUData is called like this (for another test app that works fine):

(lldb) monobt
frame #0: 0x0000000101159ac0 libmonosgen-2.0.dylib`GlobalizationNative_LoadICUData
frame dotnet/runtime#1: 0x1009e8140 (wrapper managed-to-native) Interop/Globalization:LoadICUData (string) [{0x11916b828} + 0xf0]  (0x1009e8050 0x1009e8203) [0x600002109180 - MonoTouch]
frame dotnet/runtime#2: 0x1009e800b System.Globalization.GlobalizationMode:LoadICU () [{0x11916a808} + 0x7b]  (0x1009e7f90 0x1009e8011) [0x600002109180 - MonoTouch]
frame dotnet/runtime#3: 0x1009e7453 System.Globalization.GlobalizationMode/Settings:.cctor () [{0x11916a2c0} + 0x113]  (0x1009e7340 0x1009e747d) [0x600002109180 - MonoTouch]
frame dotnet/runtime#4: 0x1009aa4c6 (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr) [{0x101887c88} + 0xa6]  (0x1009aa420 0x1009aa5a8) [0x600002109180 - MonoTouch]
frame dotnet/runtime#5: 0x0000000101169efb libmonosgen-2.0.dylib`mono_jit_runtime_invoke + 2395
frame dotnet/runtime#6: 0x0000000101086a6f libmonosgen-2.0.dylib`mono_runtime_try_invoke + 143
frame dotnet/runtime#7: 0x0000000101085516 libmonosgen-2.0.dylib`mono_runtime_class_init_full + 886
frame dotnet/runtime#8: 0x00000001011617ca libmonosgen-2.0.dylib`mono_jit_compile_method_inner + 1178
frame dotnet/runtime#9: 0x0000000101165d37 libmonosgen-2.0.dylib`jit_compile_method_with_opt + 2679
frame dotnet/runtime#10: 0x000000010116519a libmonosgen-2.0.dylib`mono_jit_compile_method + 58
frame dotnet/runtime#11: 0x00000001012130b9 libmonosgen-2.0.dylib`common_call_trampoline + 1273
frame dotnet/runtime#12: 0x0000000101212b70 libmonosgen-2.0.dylib`mono_magic_trampoline + 96
frame dotnet/runtime#13: 0x100835396<0x100835396 - generic_trampoline_jit trampoline>
frame dotnet/runtime#14: 0x1009e72e3 System.Globalization.GlobalizationMode:get_Invariant () [{0x11916a150} + 0x33]  (0x1009e72b0 0x1009e72e5) [0x600002109180 - MonoTouch]
frame dotnet/runtime#15: 0x1009e6f23 System.Globalization.CultureData:CreateCultureWithInvariantData () [{0x119165778} + 0xed3]  (0x1009e6050 0x1009e71e8) [0x600002109180 - MonoTouch]
frame dotnet/runtime#16: 0x1009e4ef3 System.Globalization.CultureData:get_Invariant () [{0x119164f40} + 0x53]  (0x1009e4ea0 0x1009e4f0f) [0x600002109180 - MonoTouch]
frame dotnet/runtime#17: 0x1009e4dcb System.Globalization.CultureInfo:.cctor () [{0x119164818} + 0x3b]  (0x1009e4d90 0x1009e4e1e) [0x600002109180 - MonoTouch]
frame dotnet/runtime#18: 0x1009aa4c6 (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr) [{0x101887c88} + 0xa6]  (0x1009aa420 0x1009aa5a8) [0x600002109180 - MonoTouch]
frame dotnet/runtime#19: 0x0000000101169efb libmonosgen-2.0.dylib`mono_jit_runtime_invoke + 2395
frame dotnet/runtime#20: 0x0000000101086a6f libmonosgen-2.0.dylib`mono_runtime_try_invoke + 143
frame dotnet/runtime#21: 0x0000000101085516 libmonosgen-2.0.dylib`mono_runtime_class_init_full + 886
frame dotnet/runtime#22: 0x0000000101190a16 libmonosgen-2.0.dylib`mono_method_to_ir + 104182
frame dotnet/runtime#23: 0x000000010115e99d libmonosgen-2.0.dylib`mini_method_compile + 3821
frame dotnet/runtime#24: 0x000000010116136f libmonosgen-2.0.dylib`mono_jit_compile_method_inner + 63
frame dotnet/runtime#25: 0x0000000101165d37 libmonosgen-2.0.dylib`jit_compile_method_with_opt + 2679
frame dotnet/runtime#26: 0x000000010116519a libmonosgen-2.0.dylib`mono_jit_compile_method + 58
frame dotnet/runtime#27: 0x00000001012130b9 libmonosgen-2.0.dylib`common_call_trampoline + 1273
frame dotnet/runtime#28: 0x0000000101212b70 libmonosgen-2.0.dylib`mono_magic_trampoline + 96
frame dotnet/runtime#29: 0x100835396<0x100835396 - generic_trampoline_jit trampoline>
frame dotnet/runtime#30: 0x1009e4d63 System.Globalization.CompareInfo:.cctor () [{0x119164e28} + 0x33]  (0x1009e4d30 0x1009e4d81) [0x600002109180 - MonoTouch]
frame dotnet/runtime#31: 0x1009aa4c6 (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr) [{0x101887c88} + 0xa6]  (0x1009aa420 0x1009aa5a8) [0x600002109180 - MonoTouch]
frame dotnet/runtime#32: 0x0000000101169efb libmonosgen-2.0.dylib`mono_jit_runtime_invoke + 2395
frame dotnet/runtime#33: 0x0000000101086a6f libmonosgen-2.0.dylib`mono_runtime_try_invoke + 143
frame dotnet/runtime#34: 0x0000000101085516 libmonosgen-2.0.dylib`mono_runtime_class_init_full + 886
frame dotnet/runtime#35: 0x0000000101190a16 libmonosgen-2.0.dylib`mono_method_to_ir + 104182
frame dotnet/runtime#36: 0x000000010115e99d libmonosgen-2.0.dylib`mini_method_compile + 3821
frame dotnet/runtime#37: 0x000000010116136f libmonosgen-2.0.dylib`mono_jit_compile_method_inner + 63
frame dotnet/runtime#38: 0x0000000101165d37 libmonosgen-2.0.dylib`jit_compile_method_with_opt + 2679
frame dotnet/runtime#39: 0x000000010116519a libmonosgen-2.0.dylib`mono_jit_compile_method + 58
frame dotnet/runtime#40: 0x00000001012130b9 libmonosgen-2.0.dylib`common_call_trampoline + 1273
frame dotnet/runtime#41: 0x0000000101212b70 libmonosgen-2.0.dylib`mono_magic_trampoline + 96
frame dotnet/runtime#42: 0x100835396<0x100835396 - generic_trampoline_jit trampoline>
frame dotnet/runtime#43: 0x1009e4cd3 string:StartsWith (string) [{0x1018baa80} + 0x53]  (0x1009e4c80 0x1009e4d13) [0x600002109180 - MonoTouch]
frame dotnet/runtime#44: 0x1009e4abb ObjCRuntime.Runtime:GetIsARM64CallingConvention () [{0x119061c48} + 0x6b]  (0x1009e4a50 0x1009e4abd) [0x600002109180 - MonoTouch]
frame dotnet/runtime#45: 0x1009b390b ObjCRuntime.Runtime:Initialize (ObjCRuntime.Runtime/InitializationOptions*) [{0x119013508} + 0x30b]  (0x1009b3600 0x1009b3a13) [0x600002109180 - MonoTouch]
frame dotnet/runtime#46: 0x1009b3b91 (wrapper runtime-invoke) <Module>:runtime_invoke_void_Runtime/InitializationOptions* (object,intptr,intptr,intptr) [{0x119061a80} + 0xb1]  (0x1009b3ae0 0x1009b3c78) [0x600002109180 - MonoTouch]
frame dotnet/runtime#47: 0x0000000101169efb libmonosgen-2.0.dylib`mono_jit_runtime_invoke + 2395
frame dotnet/runtime#48: 0x0000000101086a6f libmonosgen-2.0.dylib`mono_runtime_try_invoke + 143
frame dotnet/runtime#49: 0x0000000101088dff libmonosgen-2.0.dylib`mono_runtime_invoke + 95
frame dotnet/runtime#50: 0x0000000100a37c0e libxamarin-dotnet-debug.dylib`xamarin_bridge_call_runtime_initialize(options=0x0000000100a4b9f0, exception_gchandle=0x00007ff7bfeff1f0) at monovm-bridge.m:147:2
frame dotnet/runtime#51: 0x0000000100a2a87c libxamarin-dotnet-debug.dylib`xamarin_initialize at runtime.m:1302:2
frame dotnet/runtime#52: 0x0000000100a3dbe1 libxamarin-dotnet-debug.dylib`xamarin_main(argc=1, argv=0x00007ff7bfeff448, launch_mode=XamarinLaunchModeApp) at monotouch-main.m:438:2
frame dotnet/runtime#53: 0x00000001000aafc4 BundleStructure`main(argc=1, argv=0x00007ff7bfeff448) at main.x86_64.mm:62:11
frame dotnet/runtime#54: 0x00000001004e551e dyld`start + 462

So I traced all managed code (setting MONO_TRACE=all): iTerm2 Session 20 Apr 2022 at 6:28:03 PM.txt.zip

And I found that:

  1. System.Globalization.GlobalizationMode/Settings:.cctor is never called.
  2. System.Globalization.GlobalizationMode:get_Invariant is never called.
  3. However, System.Globalization.CultureData:CreateCultureWithInvariantData is called.

Then I compared the IL for System.Globalization.CultureData:CreateCultureWithInvariantData between a working app and a failing app, and it turns out there's no call to System.Globalization.GlobalizationMode:get_Invariant in the failing app.

I'm guessing the linker linked it away.

App that fails: BundleStructure.app.zip - download, unzip, and execute ./BundleStructure.app/Contents/MacOS/BundleStructure in Terminal to see the exception (due to a different issue on our side the app ends up in an infinite loop, but this is the cause for the loop in the first place).

Note: this is not a problem in .NET 6, only in .NET 7.

Reproduction Steps

If the above description isn't enough, I can try to find a way to reproduce it.

Expected behavior

No exception at startup

Actual behavior

See above

Regression?

Yes.

This started happened when maestro did this bump: xamarin/xamarin-macios@d9eacac.

Known Workarounds

No response

Configuration

No response

Other information

No response

Author: rolfbjarne
Assignees: -
Labels:

area-System.Globalization, untriaged, os-maccatalyst

Milestone: -

@ghost
Copy link

ghost commented Apr 20, 2022

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

Issue Details

Description

The problem occurs on Apple platforms (Mac Catalyst, iOS) when using .NET 7.

The initial symptom I get is this exception at startup:

Arg_ExternalException (System.Runtime.InteropServices.ExternalException)
   at System.Globalization.CompareInfo.SortHandleCache.GetCachedSortHandle(String )
   at System.Globalization.CompareInfo.IcuInitSortHandle(String )
   at System.Globalization.CompareInfo.InitSort(CultureInfo )
   at System.Globalization.CompareInfo..ctor(CultureInfo )
   at System.Globalization.CultureInfo.get_CompareInfo()
   at System.Globalization.CompareInfo..cctor()

Debugging in lldb shows that this occurs due to an error in ICU, the udata_openChoice function returns an error here:

(lldb) bt
* thread dotnet/runtime#1, name = 'tid_103', queue = 'com.apple.main-thread', stop reason = breakpoint 11.1
  * frame #0: 0x00000001015860e7 libmonosgen-2.0.dylib`udata_openChoice
    frame dotnet/runtime#1: 0x000000010167272e libmonosgen-2.0.dylib`icu::CollationRoot::load(UErrorCode&) + 118
    frame dotnet/runtime#2: 0x000000010164d871 libmonosgen-2.0.dylib`icu::umtx_initOnce(icu::UInitOnce&, void (*)(UErrorCode&), UErrorCode&) + 49
    frame dotnet/runtime#3: 0x0000000101672815 libmonosgen-2.0.dylib`icu::CollationRoot::getRootCacheEntry(UErrorCode&) + 31
    frame dotnet/runtime#4: 0x00000001016600f0 libmonosgen-2.0.dylib`icu::CollationLoader::loadTailoring(icu::Locale const&, UErrorCode&) + 46
    frame dotnet/runtime#5: 0x000000010165d070 libmonosgen-2.0.dylib`icu::Collator::makeInstance(icu::Locale const&, UErrorCode&) + 18
    frame dotnet/runtime#6: 0x000000010165d198 libmonosgen-2.0.dylib`icu::Collator::createInstance(icu::Locale const&, UErrorCode&) + 138
    frame dotnet/runtime#7: 0x0000000101660fcc libmonosgen-2.0.dylib`ucol_open + 74
    frame dotnet/runtime#8: 0x00000001013d0fea libmonosgen-2.0.dylib`GlobalizationNative_GetSortHandle + 74

Debugging a bit more reveals that GlobalizationNative_LoadICUData is never called, and I'm guessing this is the underlying cause for the exceptions above.

Now the question obviously becomes why GlobalizationNative_LoadICUData is never called.

Usually GlobalizationNative_LoadICUData is called like this (for another test app that works fine):

(lldb) monobt
frame #0: 0x0000000101159ac0 libmonosgen-2.0.dylib`GlobalizationNative_LoadICUData
frame dotnet/runtime#1: 0x1009e8140 (wrapper managed-to-native) Interop/Globalization:LoadICUData (string) [{0x11916b828} + 0xf0]  (0x1009e8050 0x1009e8203) [0x600002109180 - MonoTouch]
frame dotnet/runtime#2: 0x1009e800b System.Globalization.GlobalizationMode:LoadICU () [{0x11916a808} + 0x7b]  (0x1009e7f90 0x1009e8011) [0x600002109180 - MonoTouch]
frame dotnet/runtime#3: 0x1009e7453 System.Globalization.GlobalizationMode/Settings:.cctor () [{0x11916a2c0} + 0x113]  (0x1009e7340 0x1009e747d) [0x600002109180 - MonoTouch]
frame dotnet/runtime#4: 0x1009aa4c6 (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr) [{0x101887c88} + 0xa6]  (0x1009aa420 0x1009aa5a8) [0x600002109180 - MonoTouch]
frame dotnet/runtime#5: 0x0000000101169efb libmonosgen-2.0.dylib`mono_jit_runtime_invoke + 2395
frame dotnet/runtime#6: 0x0000000101086a6f libmonosgen-2.0.dylib`mono_runtime_try_invoke + 143
frame dotnet/runtime#7: 0x0000000101085516 libmonosgen-2.0.dylib`mono_runtime_class_init_full + 886
frame dotnet/runtime#8: 0x00000001011617ca libmonosgen-2.0.dylib`mono_jit_compile_method_inner + 1178
frame dotnet/runtime#9: 0x0000000101165d37 libmonosgen-2.0.dylib`jit_compile_method_with_opt + 2679
frame dotnet/runtime#10: 0x000000010116519a libmonosgen-2.0.dylib`mono_jit_compile_method + 58
frame dotnet/runtime#11: 0x00000001012130b9 libmonosgen-2.0.dylib`common_call_trampoline + 1273
frame dotnet/runtime#12: 0x0000000101212b70 libmonosgen-2.0.dylib`mono_magic_trampoline + 96
frame dotnet/runtime#13: 0x100835396<0x100835396 - generic_trampoline_jit trampoline>
frame dotnet/runtime#14: 0x1009e72e3 System.Globalization.GlobalizationMode:get_Invariant () [{0x11916a150} + 0x33]  (0x1009e72b0 0x1009e72e5) [0x600002109180 - MonoTouch]
frame dotnet/runtime#15: 0x1009e6f23 System.Globalization.CultureData:CreateCultureWithInvariantData () [{0x119165778} + 0xed3]  (0x1009e6050 0x1009e71e8) [0x600002109180 - MonoTouch]
frame dotnet/runtime#16: 0x1009e4ef3 System.Globalization.CultureData:get_Invariant () [{0x119164f40} + 0x53]  (0x1009e4ea0 0x1009e4f0f) [0x600002109180 - MonoTouch]
frame dotnet/runtime#17: 0x1009e4dcb System.Globalization.CultureInfo:.cctor () [{0x119164818} + 0x3b]  (0x1009e4d90 0x1009e4e1e) [0x600002109180 - MonoTouch]
frame dotnet/runtime#18: 0x1009aa4c6 (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr) [{0x101887c88} + 0xa6]  (0x1009aa420 0x1009aa5a8) [0x600002109180 - MonoTouch]
frame dotnet/runtime#19: 0x0000000101169efb libmonosgen-2.0.dylib`mono_jit_runtime_invoke + 2395
frame dotnet/runtime#20: 0x0000000101086a6f libmonosgen-2.0.dylib`mono_runtime_try_invoke + 143
frame dotnet/runtime#21: 0x0000000101085516 libmonosgen-2.0.dylib`mono_runtime_class_init_full + 886
frame dotnet/runtime#22: 0x0000000101190a16 libmonosgen-2.0.dylib`mono_method_to_ir + 104182
frame dotnet/runtime#23: 0x000000010115e99d libmonosgen-2.0.dylib`mini_method_compile + 3821
frame dotnet/runtime#24: 0x000000010116136f libmonosgen-2.0.dylib`mono_jit_compile_method_inner + 63
frame dotnet/runtime#25: 0x0000000101165d37 libmonosgen-2.0.dylib`jit_compile_method_with_opt + 2679
frame dotnet/runtime#26: 0x000000010116519a libmonosgen-2.0.dylib`mono_jit_compile_method + 58
frame dotnet/runtime#27: 0x00000001012130b9 libmonosgen-2.0.dylib`common_call_trampoline + 1273
frame dotnet/runtime#28: 0x0000000101212b70 libmonosgen-2.0.dylib`mono_magic_trampoline + 96
frame dotnet/runtime#29: 0x100835396<0x100835396 - generic_trampoline_jit trampoline>
frame dotnet/runtime#30: 0x1009e4d63 System.Globalization.CompareInfo:.cctor () [{0x119164e28} + 0x33]  (0x1009e4d30 0x1009e4d81) [0x600002109180 - MonoTouch]
frame dotnet/runtime#31: 0x1009aa4c6 (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr) [{0x101887c88} + 0xa6]  (0x1009aa420 0x1009aa5a8) [0x600002109180 - MonoTouch]
frame dotnet/runtime#32: 0x0000000101169efb libmonosgen-2.0.dylib`mono_jit_runtime_invoke + 2395
frame dotnet/runtime#33: 0x0000000101086a6f libmonosgen-2.0.dylib`mono_runtime_try_invoke + 143
frame dotnet/runtime#34: 0x0000000101085516 libmonosgen-2.0.dylib`mono_runtime_class_init_full + 886
frame dotnet/runtime#35: 0x0000000101190a16 libmonosgen-2.0.dylib`mono_method_to_ir + 104182
frame dotnet/runtime#36: 0x000000010115e99d libmonosgen-2.0.dylib`mini_method_compile + 3821
frame dotnet/runtime#37: 0x000000010116136f libmonosgen-2.0.dylib`mono_jit_compile_method_inner + 63
frame dotnet/runtime#38: 0x0000000101165d37 libmonosgen-2.0.dylib`jit_compile_method_with_opt + 2679
frame dotnet/runtime#39: 0x000000010116519a libmonosgen-2.0.dylib`mono_jit_compile_method + 58
frame dotnet/runtime#40: 0x00000001012130b9 libmonosgen-2.0.dylib`common_call_trampoline + 1273
frame dotnet/runtime#41: 0x0000000101212b70 libmonosgen-2.0.dylib`mono_magic_trampoline + 96
frame dotnet/runtime#42: 0x100835396<0x100835396 - generic_trampoline_jit trampoline>
frame dotnet/runtime#43: 0x1009e4cd3 string:StartsWith (string) [{0x1018baa80} + 0x53]  (0x1009e4c80 0x1009e4d13) [0x600002109180 - MonoTouch]
frame dotnet/runtime#44: 0x1009e4abb ObjCRuntime.Runtime:GetIsARM64CallingConvention () [{0x119061c48} + 0x6b]  (0x1009e4a50 0x1009e4abd) [0x600002109180 - MonoTouch]
frame dotnet/runtime#45: 0x1009b390b ObjCRuntime.Runtime:Initialize (ObjCRuntime.Runtime/InitializationOptions*) [{0x119013508} + 0x30b]  (0x1009b3600 0x1009b3a13) [0x600002109180 - MonoTouch]
frame dotnet/runtime#46: 0x1009b3b91 (wrapper runtime-invoke) <Module>:runtime_invoke_void_Runtime/InitializationOptions* (object,intptr,intptr,intptr) [{0x119061a80} + 0xb1]  (0x1009b3ae0 0x1009b3c78) [0x600002109180 - MonoTouch]
frame dotnet/runtime#47: 0x0000000101169efb libmonosgen-2.0.dylib`mono_jit_runtime_invoke + 2395
frame dotnet/runtime#48: 0x0000000101086a6f libmonosgen-2.0.dylib`mono_runtime_try_invoke + 143
frame dotnet/runtime#49: 0x0000000101088dff libmonosgen-2.0.dylib`mono_runtime_invoke + 95
frame dotnet/runtime#50: 0x0000000100a37c0e libxamarin-dotnet-debug.dylib`xamarin_bridge_call_runtime_initialize(options=0x0000000100a4b9f0, exception_gchandle=0x00007ff7bfeff1f0) at monovm-bridge.m:147:2
frame dotnet/runtime#51: 0x0000000100a2a87c libxamarin-dotnet-debug.dylib`xamarin_initialize at runtime.m:1302:2
frame dotnet/runtime#52: 0x0000000100a3dbe1 libxamarin-dotnet-debug.dylib`xamarin_main(argc=1, argv=0x00007ff7bfeff448, launch_mode=XamarinLaunchModeApp) at monotouch-main.m:438:2
frame dotnet/runtime#53: 0x00000001000aafc4 BundleStructure`main(argc=1, argv=0x00007ff7bfeff448) at main.x86_64.mm:62:11
frame dotnet/runtime#54: 0x00000001004e551e dyld`start + 462

So I traced all managed code (setting MONO_TRACE=all): iTerm2 Session 20 Apr 2022 at 6:28:03 PM.txt.zip

And I found that:

  1. System.Globalization.GlobalizationMode/Settings:.cctor is never called.
  2. System.Globalization.GlobalizationMode:get_Invariant is never called.
  3. However, System.Globalization.CultureData:CreateCultureWithInvariantData is called.

Then I compared the IL for System.Globalization.CultureData:CreateCultureWithInvariantData between a working app and a failing app, and it turns out there's no call to System.Globalization.GlobalizationMode:get_Invariant in the failing app.

I'm guessing the linker linked it away.

App that fails: BundleStructure.app.zip - download, unzip, and execute ./BundleStructure.app/Contents/MacOS/BundleStructure in Terminal to see the exception (due to a different issue on our side the app ends up in an infinite loop, but this is the cause for the loop in the first place).

Note: this is not a problem in .NET 6, only in .NET 7.

Reproduction Steps

If the above description isn't enough, I can try to find a way to reproduce it.

Expected behavior

No exception at startup

Actual behavior

See above

Regression?

Yes.

This started happened when maestro did this bump: xamarin/xamarin-macios@d9eacac.

Known Workarounds

No response

Configuration

No response

Other information

No response

Author: rolfbjarne
Assignees: -
Labels:

area-System.Globalization, untriaged, os-ios, os-maccatalyst

Milestone: -

@ghost ghost removed the untriaged label Apr 20, 2022
@steveisok
Copy link
Member

If you're using Invariant mode, I don't believe loading icu should be called at all.

@tarekgh
Copy link
Member

tarekgh commented Apr 20, 2022

A quick note, when enabling the invariant mode, it is expected that GlobalizationNative_LoadICUData not get called. But GlobalizationMode.Invariant should get called. And the IcuInitSortHandle should return early in the line
https://source.dot.net/#System.Private.CoreLib/CompareInfo.Icu.cs,21.

@steveisok could be the linker trimmed all invariant mode code somehow disabling all Invariant mode code paths?

@steveisok
Copy link
Member

@steveisok could be the linker trimmed all invariant mode code somehow disabling all Invariant mode code paths?

That would be my guess. @rolfbjarne can you validate?

@rolfbjarne
Copy link
Member Author

I got the logic reversed, this is when Invariant=false, but the problem is really the same, that the call to System.Globalization.GlobalizationMode/Settings.get_Invariant is inlined, and thus the Settings static constructor isn't called.

This is the decompiled IcuInitSortHandle:

Screen Shot 2022-04-21 at 09 17 19

This call to GlobalizationMode.Invariant is also removed: https://source.dot.net/#System.Private.CoreLib/CultureData.cs,651

See end of the decompiled CreateCultureWithInvariantData:

Screen Shot 2022-04-21 at 09 25 47

The maestro bump that resulted in this failure includes a linker bump: e8b0ba0...3292e23, which includes this interesting commit: Add constant propagation through methods with parameters or complex bodies, maybe that's got something to do with it?

CC @marek-safar

@marek-safar
Copy link
Contributor

This looks like linker related so I'll look into it.

@marek-safar marek-safar transferred this issue from dotnet/runtime Apr 24, 2022
@marek-safar marek-safar self-assigned this Apr 24, 2022
@marek-safar marek-safar added this to the .NET 7.0 milestone Apr 24, 2022
@tlakollo
Copy link
Contributor

I see an entry in the runtime substitution files that shortcircuits both GlobalizationMode.get_Invariant() and GlobalizationMode/Settings.getInvariant() to a specific boolean value. See https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.Shared.xml#L11-L17

@marek-safar
Copy link
Contributor

As I wrote I'm looking into it and have local fix already

@rolfbjarne
Copy link
Member Author

@marek-safar any idea when this can be fixed?

@jonathanpeppers
Copy link
Member

I tried a @(TrimmerRootDescriptor) like:

<?xml version="1.0" encoding="utf-8" ?>
<linker>
	<assembly fullname="System.Private.CoreLib">
		<type fullname="System.Globalization.GlobalizationMode" preserve="all" />
	</assembly>
</linker>

This preserves members like GlobalizationMode.Invariant, but it still seems to trim away some of the if-statements that cause this problem.

@marek-safar is there another workaround we could try? I was going to put something in the Android workload for now to get us on a newer .NET 7.

jonathanpeppers added a commit to dotnet/android that referenced this issue May 18, 2022
marek-safar added a commit to marek-safar/linker that referenced this issue May 19, 2022
marek-safar added a commit to marek-safar/linker that referenced this issue May 19, 2022
marek-safar added a commit to marek-safar/linker that referenced this issue May 19, 2022
jonathanpeppers added a commit to dotnet/android that referenced this issue May 19, 2022
Changes: dotnet/installer@c7afae6...2071f2c
Changes: dotnet/linker@04c49c9...b9c9da2
Changes: dotnet/runtime@c5d40c9...3e5517b
Changes: dotnet/emsdk@b8e7143...f41e658

Updates:

* Microsoft.Dotnet.Sdk.Internal: from 7.0.100-preview.4.22174.1 to 7.0.100-preview.5.22263.22

* Microsoft.NET.ILLink.Tasks: from 7.0.100-1.22173.2 to 7.0.100-1.22259.1

* Microsoft.NETCore.App.Ref: from 7.0.0-preview.4.22172.7 to 7.0.0-preview.5.22258.4

* Microsoft.NET.Workload.Emscripten.Manifest-7.0.100: from 7.0.0-preview.3.22121.1 to 7.0.0-preview.4.22215.1

~~ Changes ~~

We can use `mono_opt_aot_lazy_assembly_load` now, as this change is in
this .NET 7 version.

Updated `.apkdesc` files, since `.apk` size has improved (gotten smaller).

~~ Known Issues ~~

* Force invariant globalization by default to workaround:

dotnet/linker#2759

* Ignore tests that were hitting `InvalidProgramException`:

dotnet/linker#2799

Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com>
rolfbjarne added a commit to xamarin/xamarin-macios that referenced this issue May 19, 2022
marek-safar added a commit to marek-safar/linker that referenced this issue May 19, 2022
jonathanpeppers added a commit to dotnet/android that referenced this issue May 23, 2022
rolfbjarne added a commit to xamarin/xamarin-macios that referenced this issue May 23, 2022
jonathanpeppers added a commit to dotnet/android that referenced this issue May 23, 2022
Changes: dotnet/installer@a84c4c0...a3acdcf
Changes: dotnet/linker@5a8de69...b047935
Changes: dotnet/runtime@f4c60fd...621cd59

Updates:

* Microsoft.Dotnet.Sdk.Internal: from 7.0.100-preview.5.22267.11 to 7.0.100-preview.5.22273.1
* Microsoft.NET.ILLink.Tasks: from 7.0.100-1.22266.1 to 7.0.100-1.22270.1
* Microsoft.NETCore.App.Ref: from 7.0.0-preview.5.22266.11 to 7.0.0-preview.5.22271.4

Other changes:

* Revert workarounds for dotnet/linker#2759 and dotnet/linker#2799
* Update `.apkdesc` files

Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com>
rolfbjarne added a commit to xamarin/xamarin-macios that referenced this issue May 26, 2022
* Update dependencies from https://github.com/dotnet/installer build 20220404.1

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.4.22204.1

Dependency coherency updates

Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref
 From Version 7.0.0-preview.4.22181.10 -> To Version 7.0.0-preview.4.22201.3 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220405.16

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.4.22205.16

Dependency coherency updates

Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref
 From Version 7.0.0-preview.4.22181.10 -> To Version 7.0.0-preview.4.22205.1 (parent: Microsoft.Dotnet.Sdk.Internal

* [tests] Remove dead code.

* Update dependencies from https://github.com/dotnet/installer build 20220407.2

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.4.22207.2

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22206.2 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220407.24

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.4.22207.24

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22206.2 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220408.2

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.4.22208.2

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22206.2 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220411.1

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.4.22211.1

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22208.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220412.1

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.4.22212.1

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22211.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220412.35

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.4.22212.35

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22211.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220414.1

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.4.22214.1

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22211.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220414.17

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.4.22214.17

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22211.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220415.7

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.4.22215.7

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22211.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220417.3

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.4.22217.3

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22211.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220418.29

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.4.22218.29

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22213.2 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220419.19

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.4.22219.19

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22213.2 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220420.23

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22220.23

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22213.2 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220421.9

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22221.9

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22213.2 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220425.1

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22225.1

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22213.2 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220427.1

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22227.1

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22226.2 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220427.8

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22227.8

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22227.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220428.6

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22228.6

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22227.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220429.2

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22229.2

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22228.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220503.34

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22253.34

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22228.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220505.1

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22255.1

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22228.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220506.2

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22256.2

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22228.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220506.8

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22256.8

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22228.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220507.3

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22257.3

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22228.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220508.1

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22258.1

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22228.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220510.3

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22260.3

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22259.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220510.20

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22260.20

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22259.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220511.8

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22261.8

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22259.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220512.14

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22262.14

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22259.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220513.22

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22263.22

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22259.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220517.11

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22267.11

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22266.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Attempt workaround for dotnet/linker#2759

* [runtime] Skip passing ICU_DAT_FILE_PATH to the runtime if we don't have an ICU data file.

* [dotnet] Write our own code for the global using for nfloat.

This way we can ignore this compiler warning:

    The type name 'nfloat' only contains lower-cased ascii characters. Such names may become reserved for the language.

* Update dependencies from https://github.com/dotnet/installer build 20220523.1

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22273.1

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22270.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Revert "Attempt workaround for dotnet/linker#2759"

This reverts commit 8650556.

* [src] Fix computing the value type size of System.UIntPtr.

* Why is this needed?

> SpriteKit/SKNode.cs(89,29): error CS0121: The call is ambiguous between the following methods or properties: 'NSMutableSet<TKey>.NSMutableSet(NativeHandle)' and 'NSMutableSet<TKey>.NSMutableSet(nint)'

* Update dependencies from https://github.com/dotnet/installer build 20220524.1

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22274.1

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22273.1 (parent: Microsoft.Dotnet.Sdk.Internal

* Update dependencies from https://github.com/dotnet/installer build 20220524.9

Microsoft.Dotnet.Sdk.Internal
 From Version 7.0.100-preview.4.22201.11 -> To Version 7.0.100-preview.5.22274.9

Dependency coherency updates

Microsoft.NET.ILLink.Tasks,Microsoft.AspNetCore.App.Ref,Microsoft.NETCore.App.Ref,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22273.1 (parent: Microsoft.Dotnet.Sdk.Internal

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
simonrozsival pushed a commit to simonrozsival/xamarin-android that referenced this issue May 31, 2022
)

Changes: dotnet/installer@c7afae6...2071f2c
Changes: dotnet/linker@04c49c9...b9c9da2
Changes: dotnet/runtime@c5d40c9...3e5517b
Changes: dotnet/emsdk@b8e7143...f41e658

Updates:

* Microsoft.Dotnet.Sdk.Internal: from 7.0.100-preview.4.22174.1 to 7.0.100-preview.5.22263.22

* Microsoft.NET.ILLink.Tasks: from 7.0.100-1.22173.2 to 7.0.100-1.22259.1

* Microsoft.NETCore.App.Ref: from 7.0.0-preview.4.22172.7 to 7.0.0-preview.5.22258.4

* Microsoft.NET.Workload.Emscripten.Manifest-7.0.100: from 7.0.0-preview.3.22121.1 to 7.0.0-preview.4.22215.1

~~ Changes ~~

We can use `mono_opt_aot_lazy_assembly_load` now, as this change is in
this .NET 7 version.

Updated `.apkdesc` files, since `.apk` size has improved (gotten smaller).

~~ Known Issues ~~

* Force invariant globalization by default to workaround:

dotnet/linker#2759

* Ignore tests that were hitting `InvalidProgramException`:

dotnet/linker#2799

Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com>
simonrozsival pushed a commit to simonrozsival/xamarin-android that referenced this issue May 31, 2022
Changes: dotnet/installer@a84c4c0...a3acdcf
Changes: dotnet/linker@5a8de69...b047935
Changes: dotnet/runtime@f4c60fd...621cd59

Updates:

* Microsoft.Dotnet.Sdk.Internal: from 7.0.100-preview.5.22267.11 to 7.0.100-preview.5.22273.1
* Microsoft.NET.ILLink.Tasks: from 7.0.100-1.22266.1 to 7.0.100-1.22270.1
* Microsoft.NETCore.App.Ref: from 7.0.0-preview.5.22266.11 to 7.0.0-preview.5.22271.4

Other changes:

* Revert workarounds for dotnet/linker#2759 and dotnet/linker#2799
* Update `.apkdesc` files

Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants