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

.NET 9.0 Preview 3 crashes SkiaSharp 3.0 in Release mode (possible ICU / Globalization problem) #9153

Closed
janne-hmp opened this issue Apr 16, 2024 · 25 comments
Assignees
Labels
needs-triage Issues that need to be assigned.

Comments

@janne-hmp
Copy link

Description

We are developing a game called GnollHack using .NET MAUI 9.0. After upgrading to .NET 9.0 Preview 3 from 2, the game crashes immediately at start in Release mode both with SkiaSharp 3.0 Preview 2.1 and Preview 3.1. Based on logs this seems to be an ICU / Globalization problem. mattleibow from SkiaSharp repository asked me to post this to this repository.

The exception thrown is: mono-rt : [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: TypeInitialization_Type, System.Globalization.CompareInfo

This comes after monodroid-assembly: Shared library 'libSystem.Globalization.Native' not loaded, p/invoke 'GlobalizationNative_LoadICU' may fail

The logs from Android are below.

Reproduction Steps

  1. Clone GnollHack repository (https://github.com/hyvanmielenpelit/GnollHack)
  2. Make sure you are using .NET 9.0 Preview 3
  3. Build GnollHackX in Release mode using the instructions in the wiki
  4. Build GnollHackM in Release mode
  5. Deploy GnollHackM to an Android phone.
  6. Start GnollHackM on the phone

Expected behavior

The game starts normally.

Actual behavior

The game crashes at start.

Regression?

Yes, .NET 9.0 Preview 2 worked fine.

Known Workarounds

None, have to use .NET 9.0 Preview 2

Configuration

.NET 9.0 Preview 3 / .NET MAUI 9.0 Preview 3
Android 14 (Samsung S22)
ARM64
Does not seem to depend on the phone, crashes on all phones we tried

Other information

And here's the log for .NET 9.0 Preview 3 crash:

04-15 20:38:07.568  4173  4324 D CompatibilityChangeReporter: Compat change id reported: 210923482; UID 10297; state: ENABLED
04-15 21:00:00.340  8000  8000 D CompatibilityChangeReporter: Compat change id reported: 210923482; UID 10306; state: ENABLED
04-15 21:38:18.385 32112 32112 D CompatibilityChangeReporter: Compat change id reported: 210923482; UID 10239; state: ENABLED
04-15 21:43:27.770   924   924 D Zygote  : Forked child process 10923
04-15 21:43:27.770  1412  1484 I ActivityManager: Start proc 10923:com.soundmindgames.gnollhackm/u0a307 for top-activity {com.soundmindgames.gnollhackm/crc6481ebf3e09068bf87.MainActivity}
04-15 21:43:27.778 10923 10923 I ames.gnollhackm: Using CollectorTypeCMC GC.
04-15 21:43:27.780 10923 10923 E ames.gnollhackm: Not starting debugger since process cannot load the jdwp agent.
04-15 21:43:27.783 10923 10923 D ActivityThread: setConscryptValidator
04-15 21:43:27.783 10923 10923 D ActivityThread: setConscryptValidator - put
04-15 21:43:27.788 10923 10923 D CompatibilityChangeReporter: Compat change id reported: 171979766; UID 10307; state: ENABLED
04-15 21:43:27.788 10923 10923 D CompatibilityChangeReporter: Compat change id reported: 242716250; UID 10307; state: ENABLED
04-15 21:43:27.791 10923 10923 D nativeloader: Configuring clns-4 for other apk /data/app/~~0TIYkF9E1cLppmhZJ8PC2A==/com.soundmindgames.gnollhackm-8jKvxzZZD9yN9K2b_DDCfw==/base.apk. target_sdk_version=34, uses_libraries=, library_path=/data/app/~~0TIYkF9E1cLppmhZJ8PC2A==/com.soundmindgames.gnollhackm-8jKvxzZZD9yN9K2b_DDCfw==/lib/arm64:/data/app/~~0TIYkF9E1cLppmhZJ8PC2A==/com.soundmindgames.gnollhackm-8jKvxzZZD9yN9K2b_DDCfw==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/com.soundmindgames.gnollhackm
04-15 21:43:27.794  1412  1467 D PkgPredictorService-SecIpmManagerServiceImpl: onForegroundActivitiesChanged pid:10923 uid:10307
04-15 21:43:27.797 10923 10923 V GraphicsEnvironment: Currently set values for:
04-15 21:43:27.797 10923 10923 V GraphicsEnvironment:   angle_gl_driver_selection_pkgs=[]
04-15 21:43:27.797 10923 10923 V GraphicsEnvironment:   angle_gl_driver_selection_values=[]
04-15 21:43:27.797 10923 10923 V GraphicsEnvironment: ANGLE GameManagerService for com.soundmindgames.gnollhackm: false
04-15 21:43:27.797 10923 10923 V GraphicsEnvironment: com.soundmindgames.gnollhackm is not listed in per-application setting
04-15 21:43:27.797 10923 10923 V GraphicsEnvironment: App is not on the allowlist for updatable production driver.
04-15 21:43:27.803 10923 10923 I DOTNET  : JNI_OnLoad: JNI_OnLoad in pal_jni.c
04-15 21:43:27.803 10923 10923 D DOTNET  : GetOptionalClassGRef: optional class com/android/org/conscrypt/OpenSSLEngineImpl was not found
04-15 21:43:27.872 10923 10923 W monodroid-assembly: Shared library 'libSystem.Globalization.Native' not loaded, p/invoke 'GlobalizationNative_LoadICU' may fail
04-15 21:43:27.873 10923 10923 W monodroid-assembly: Shared library 'libSystem.Globalization.Native' not loaded, p/invoke 'GlobalizationNative_LoadICU' may fail
04-15 21:43:27.873 10923 10923 W monodroid-assembly: Shared library 'libSystem.Globalization.Native' not loaded, p/invoke 'GlobalizationNative_LoadICU' may fail
04-15 21:43:27.882 10923 10923 F mono-rt : [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: TypeInitialization_Type, System.Globalization.CompareInfo
04-15 21:43:27.882 10923 10923 F mono-rt :  ---> System.TypeInitializationException: TypeInitialization_Type, System.Globalization.CultureInfo
04-15 21:43:27.882 10923 10923 F mono-rt :  ---> System.TypeInitializationException: TypeInitialization_Type, Settings
04-15 21:43:27.882 10923 10923 F mono-rt :  ---> System.DllNotFoundException: libSystem.Globalization.Native
04-15 21:43:27.882 10923 10923 F mono-rt :    at System.Globalization.GlobalizationMode.LoadICU()
04-15 21:43:27.882 10923 10923 F mono-rt :    at System.Globalization.GlobalizationMode.Settings..cctor()
04-15 21:43:27.882 10923 10923 F mono-rt :    Exception_EndOfInnerExceptionStack
04-15 21:43:27.882 10923 10923 F mono-rt :    at System.Globalization.GlobalizationMode.get_Invariant()
04-15 21:43:27.882 10923 10923 F mono-rt :    at System.Globalization.CultureData.CreateCultureWithInvariantData()
04-15 21:43:27.882 10923 10923 F mono-rt :    at System.Globalization.CultureData.get_Invariant()
04-15 21:43:27.882 10923 10923 F mono-rt :    at System.Globalization.CultureInfo..cctor()
04-15 21:43:27.882 10923 10923 F mono-rt :    Exception_EndOfInnerExceptionStack
04-15 21:43:27.882 10923 10923 F mono-rt :    Exception_EndOfInnerExceptionStack
04-15 21:43:27.882 10923 10923 F mono-rt :    at Java.Interop.TypeManager.RegisterType(String , Type )
04-15 21:43:27.882 10923 10923 F mono-rt :    at Android.Runtime.JNIEnvInit.RegisterJniNatives(IntPtr , Int32 , IntPtr , IntPtr , Int32 )
04-15 21:43:27.918  1412  1993 I ActivityManager: Process com.soundmindgames.gnollhackm (pid 10923) has died: fg  TOP (671,3230)
04-15 21:43:27.918  1412  1486 I libprocessgroup: Successfully killed process cgroup uid 10307 pid 10923 in 0ms
04-15 21:43:27.918   924   924 I Zygote  : Process 10923 exited cleanly (1)

Here's the log using Preview 2 and SkiaSharp 3.0 Preview 3.1 that also sometimes crashed in the same way. They all seem to be related.

04-15 12:42:53.555  1266  1266 D Zygote  : Forked child process 14629
04-15 12:42:53.555  1656  2068 I ActivityManager: Start proc 14629:com.soundmindgames.gnollhackm/u0a593 for top-activity {com.soundmindgames.gnollhackm/crc6481ebf3e09068bf87.MainActivity}
04-15 12:42:53.567 14629 14629 I ames.gnollhackm: Using CollectorTypeCC GC.
04-15 12:42:53.569 14629 14629 E ames.gnollhackm: Not starting debugger since process cannot load the jdwp agent.
04-15 12:42:53.573 14629 14629 D ActivityThread: setConscryptValidator
04-15 12:42:53.573 14629 14629 D ActivityThread: setConscryptValidator - put
04-15 12:42:53.581 14629 14629 D CompatibilityChangeReporter: Compat change id reported: 171979766; UID 10593; state: ENABLED
04-15 12:42:53.581 14629 14629 D CompatibilityChangeReporter: Compat change id reported: 242716250; UID 10593; state: ENABLED
04-15 12:42:53.586 14629 14629 W ziparchive: Unable to open '/data/app/~~Qx-ZqsTMknh7WSkBNzt8nw==/com.soundmindgames.gnollhackm-zy7V-_oFhQz3D1Bb2oDbEQ==/split_config.arm64_v8a.dm': No such file or directory
04-15 12:42:53.586 14629 14629 W ziparchive: Unable to open '/data/app/~~Qx-ZqsTMknh7WSkBNzt8nw==/com.soundmindgames.gnollhackm-zy7V-_oFhQz3D1Bb2oDbEQ==/split_config.arm64_v8a.dm': No such file or directory
04-15 12:42:53.587 14629 14629 W ames.gnollhackm: Entry not found
04-15 12:42:53.587 14629 14629 W ziparchive: Unable to open '/data/app/~~Qx-ZqsTMknh7WSkBNzt8nw==/com.soundmindgames.gnollhackm-zy7V-_oFhQz3D1Bb2oDbEQ==/split_config.en.dm': No such file or directory
04-15 12:42:53.587 14629 14629 W ziparchive: Unable to open '/data/app/~~Qx-ZqsTMknh7WSkBNzt8nw==/com.soundmindgames.gnollhackm-zy7V-_oFhQz3D1Bb2oDbEQ==/split_config.en.dm': No such file or directory
04-15 12:42:53.588 14629 14629 W ames.gnollhackm: Entry not found
04-15 12:42:53.588 14629 14629 W ziparchive: Unable to open '/data/app/~~Qx-ZqsTMknh7WSkBNzt8nw==/com.soundmindgames.gnollhackm-zy7V-_oFhQz3D1Bb2oDbEQ==/split_config.fi.dm': No such file or directory
04-15 12:42:53.588 14629 14629 W ziparchive: Unable to open '/data/app/~~Qx-ZqsTMknh7WSkBNzt8nw==/com.soundmindgames.gnollhackm-zy7V-_oFhQz3D1Bb2oDbEQ==/split_config.fi.dm': No such file or directory
04-15 12:42:53.588 14629 14629 W ames.gnollhackm: Entry not found
04-15 12:42:53.588 14629 14629 W ziparchive: Unable to open '/data/app/~~Qx-ZqsTMknh7WSkBNzt8nw==/com.soundmindgames.gnollhackm-zy7V-_oFhQz3D1Bb2oDbEQ==/split_config.xxhdpi.dm': No such file or directory
04-15 12:42:53.588 14629 14629 W ziparchive: Unable to open '/data/app/~~Qx-ZqsTMknh7WSkBNzt8nw==/com.soundmindgames.gnollhackm-zy7V-_oFhQz3D1Bb2oDbEQ==/split_config.xxhdpi.dm': No such file or directory
04-15 12:42:53.588  1656  2042 D PkgPredictorService-SecIpmManagerServiceImpl: onForegroundActivitiesChanged pid:14629 uid:10593
04-15 12:42:53.589 14629 14629 W ames.gnollhackm: Entry not found
04-15 12:42:53.589 14629 14629 W ziparchive: Unable to open '/data/app/~~Qx-ZqsTMknh7WSkBNzt8nw==/com.soundmindgames.gnollhackm-zy7V-_oFhQz3D1Bb2oDbEQ==/split_installtimepack.dm': No such file or directory
04-15 12:42:53.589 14629 14629 W ziparchive: Unable to open '/data/app/~~Qx-ZqsTMknh7WSkBNzt8nw==/com.soundmindgames.gnollhackm-zy7V-_oFhQz3D1Bb2oDbEQ==/split_installtimepack.dm': No such file or directory
04-15 12:42:53.589 14629 14629 W ames.gnollhackm: Entry not found
04-15 12:42:53.591 14629 14629 D nativeloader: Configuring clns-4 for other apk /data/app/~~Qx-ZqsTMknh7WSkBNzt8nw==/com.soundmindgames.gnollhackm-zy7V-_oFhQz3D1Bb2oDbEQ==/base.apk:/data/app/~~Qx-ZqsTMknh7WSkBNzt8nw==/com.soundmindgames.gnollhackm-zy7V-_oFhQz3D1Bb2oDbEQ==/split_config.arm64_v8a.apk:/data/app/~~Qx-ZqsTMknh7WSkBNzt8nw==/com.soundmindgames.gnollhackm-zy7V-_oFhQz3D1Bb2oDbEQ==/split_config.en.apk:/data/app/~~Qx-ZqsTMknh7WSkBNzt8nw==/com.soundmindgames.gnollhackm-zy7V-_oFhQz3D1Bb2oDbEQ==/split_config.fi.apk:/data/app/~~Qx-ZqsTMknh7WSkBNzt8nw==/com.soundmindgames.gnollhackm-zy7V-_oFhQz3D1Bb2oDbEQ==/split_config.xxhdpi.apk:/data/app/~~Qx-ZqsTMknh7WSkBNzt8nw==/com.soundmindgames.gnollhackm-zy7V-_oFhQz3D1Bb2oDbEQ==/split_installtimepack.apk. target_sdk_version=34, uses_libraries=, library_path=/data/app/~~Qx-ZqsTMknh7WSkBNzt8nw==/com.soundmindgames.gnollhackm-zy7V-_oFhQz3D1Bb2oDbEQ==/lib/arm64:/data/app/~~Qx-ZqsTMknh7WSkBNzt8nw==/com.soundmindgames.gnollhackm-zy7V-_oFhQz3D1Bb2oDbEQ==/base.apk!/lib/arm64-v8a:/data/app/~~Qx-ZqsTMknh7WSkBNzt8nw==/com
04-15 12:42:53.599 14629 14629 V GraphicsEnvironment: Currently set values for:
04-15 12:42:53.600 14629 14629 V GraphicsEnvironment:   angle_gl_driver_selection_pkgs=[]
04-15 12:42:53.600 14629 14629 V GraphicsEnvironment:   angle_gl_driver_selection_values=[]
04-15 12:42:53.600 14629 14629 V GraphicsEnvironment: ANGLE GameManagerService for com.soundmindgames.gnollhackm: false
04-15 12:42:53.600 14629 14629 V GraphicsEnvironment: com.soundmindgames.gnollhackm is not listed in per-application setting
04-15 12:42:53.600 14629 14629 V GraphicsEnvironment: Updatable production driver is not supported on the device.
04-15 12:42:53.608 14629 14629 I DOTNET  : JNI_OnLoad: JNI_OnLoad in pal_jni.c
04-15 12:42:53.608 14629 14629 D DOTNET  : GetOptionalClassGRef: optional class com/android/org/conscrypt/OpenSSLEngineImpl was not found
04-15 12:42:53.610 14629 14629 W monodroid: Failed to create directory '/data/user/0/com.soundmindgames.gnollhackm/files/.__override__/arm64-v8a'. No such file or directory
04-15 12:42:53.610 14629 14629 W monodroid: Creating public update directory: `/data/user/0/com.soundmindgames.gnollhackm/files/.__override__/arm64-v8a`
04-15 12:42:53.712 14629 14629 W monodroid-assembly: Shared library 'libSystem.Globalization.Native' not loaded, p/invoke 'GlobalizationNative_LoadICU' may fail
04-15 12:42:53.720 14629 14629 W monodroid-assembly: Shared library 'libSystem.Globalization.Native' not loaded, p/invoke 'GlobalizationNative_LoadICU' may fail
04-15 12:42:53.727 14629 14629 W monodroid-assembly: Shared library 'libSystem.Globalization.Native' not loaded, p/invoke 'GlobalizationNative_LoadICU' may fail
04-15 12:42:53.745 14629 14629 F mono-rt : [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: TypeInitialization_Type, System.Globalization.CompareInfo
04-15 12:42:53.745 14629 14629 F mono-rt :  ---> System.TypeInitializationException: TypeInitialization_Type, System.Globalization.CultureInfo
04-15 12:42:53.745 14629 14629 F mono-rt :  ---> System.TypeInitializationException: TypeInitialization_Type, Settings
04-15 12:42:53.745 14629 14629 F mono-rt :  ---> System.DllNotFoundException: libSystem.Globalization.Native
04-15 12:42:53.745 14629 14629 F mono-rt :    at System.Globalization.GlobalizationMode.LoadICU()
04-15 12:42:53.745 14629 14629 F mono-rt :    at System.Globalization.GlobalizationMode.Settings..cctor()
04-15 12:42:53.745 14629 14629 F mono-rt :    Exception_EndOfInnerExceptionStack
04-15 12:42:53.745 14629 14629 F mono-rt :    at System.Globalization.GlobalizationMode.get_Invariant()
04-15 12:42:53.745 14629 14629 F mono-rt :    at System.Globalization.CultureData.CreateCultureWithInvariantData()
04-15 12:42:53.745 14629 14629 F mono-rt :    at System.Globalization.CultureData.get_Invariant()
04-15 12:42:53.745 14629 14629 F mono-rt :    at System.Globalization.CultureInfo..cctor()
04-15 12:42:53.745 14629 14629 F mono-rt :    Exception_EndOfInnerExceptionStack
04-15 12:42:53.745 14629 14629 F mono-rt :    Exception_EndOfInnerExceptionStack
04-15 12:42:53.745 14629 14629 F mono-rt :    at Java.Interop.TypeManager.RegisterType(String , Type )
04-15 12:42:53.745 14629 14629 F mono-rt :    at Android.Runtime.JNIEnvInit.RegisterJniNatives(IntPtr , Int32 , IntPtr , IntPtr , Int32 )
04-15 12:42:53.777  1656  4724 I ActivityManager: Process com.soundmindgames.gnollhackm (pid 14629) has died: fg  TOP (218,1595)
04-15 12:42:53.777  1266  1266 I Zygote  : Process 14629 exited cleanly (1)
04-15 12:42:53.777  1656  2076 I libprocessgroup: Successfully killed process cgroup uid 10593 pid 14629 in 0ms
04-15 12:42:55.580  1371  1470 E ANDR-PERF-UTIL: Failed to update node /proc/14629/sched_boost with value 0
04-15 12:42:55.580  1371  1470 E ANDR-PERF-OPTSHANDLER: can't reset task 14629

Here's the another such log:

04-15 16:47:14.779 13737 13737 D nativeloader: Configuring clns-4 for other apk /data/app/~~O5RWJhgS6Zk8k0MBH8yrpA==/com.soundmindgames.gnollhackm-RXV8I9Pt69CLmHl5ap2PBg==/base.apk. target_sdk_version=34, uses_libraries=, library_path=/data/app/~~O5RWJhgS6Zk8k0MBH8yrpA==/com.soundmindgames.gnollhackm-RXV8I9Pt69CLmHl5ap2PBg==/lib/arm64:/data/app/~~O5RWJhgS6Zk8k0MBH8yrpA==/com.soundmindgames.gnollhackm-RXV8I9Pt69CLmHl5ap2PBg==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/com.soundmindgames.gnollhackm
04-15 16:47:14.795 13737 13737 V GraphicsEnvironment: Currently set values for:
04-15 16:47:14.795 13737 13737 V GraphicsEnvironment:   angle_gl_driver_selection_pkgs=[]
04-15 16:47:14.795 13737 13737 V GraphicsEnvironment:   angle_gl_driver_selection_values=[]
04-15 16:47:14.795 13737 13737 V GraphicsEnvironment: ANGLE GameManagerService for com.soundmindgames.gnollhackm: false
04-15 16:47:14.795 13737 13737 V GraphicsEnvironment: com.soundmindgames.gnollhackm is not listed in per-application setting
04-15 16:47:14.796 13737 13737 V GraphicsEnvironment: Updatable production driver is not supported on the device.
04-15 16:47:14.865 13737 13737 I DOTNET  : JNI_OnLoad: JNI_OnLoad in pal_jni.c
04-15 16:47:14.866 13737 13737 D DOTNET  : GetOptionalClassGRef: optional class com/android/org/conscrypt/OpenSSLEngineImpl was not found
04-15 16:47:14.879 13737 13737 W monodroid: Failed to create directory '/data/user/0/com.soundmindgames.gnollhackm/files/.__override__/arm64-v8a'. No such file or directory
04-15 16:47:14.879 13737 13737 W monodroid: Creating public update directory: `/data/user/0/com.soundmindgames.gnollhackm/files/.__override__/arm64-v8a`
04-15 16:47:14.881 13737 13737 W ames.gnollhackm: Attempt to remove non-JNI local reference
04-15 16:47:15.247 13737 13737 W monodroid-debug: Trying to initialize the debugger with options: --debugger-agent=transport=socket-fd,address=85,embedding=1
04-15 16:47:16.884 13737 13737 W monodroid: runtime args empty
04-15 16:47:16.888 13737 13737 W monodroid-assembly: Unable to open app library directory '/data/user/0/com.soundmindgames.gnollhackm/files/.__override__/arm64-v8a': No such file or directory
04-15 16:47:19.657  1656  3110 I Pageboost: IoRecord pid : 13737
04-15 16:47:19.725  1656  3110 I Pageboost: IoRecord pid : 13737, result_size : 19133
04-15 16:47:19.794  1656  3110 I Pageboost: memUsage collected : 128565 0 0 for com.soundmindgames.gnollhackm 13737
04-15 16:47:20.149   692   692 D io_stats: !@ Read_top(KB): ames.gnollhackm(13737) 131160 .android.chrome(15263) 752 system_server(1656) 680
04-15 16:47:20.831 13737 13737 W ames.gnollhackm: Attempt to remove non-JNI local reference
04-15 16:47:20.916 13737 13737 W monodroid-assembly: Shared library 'libSystem.Globalization.Native' not loaded, p/invoke 'GlobalizationNative_LoadICU' may fail
04-15 16:47:20.926 13737 13737 W monodroid-assembly: Shared library 'libSystem.Globalization.Native' not loaded, p/invoke 'GlobalizationNative_LoadICU' may fail
04-15 16:47:20.930 13737 13737 W monodroid-assembly: Shared library 'libSystem.Globalization.Native' not loaded, p/invoke 'GlobalizationNative_LoadICU' may fail
04-15 16:47:20.954 13737 13737 W monodroid-assembly: Shared library 'libSystem.Globalization.Native' not loaded, p/invoke 'GlobalizationNative_GetLocaleName' may fail
04-15 16:47:20.957 13737 13737 W monodroid-assembly: Shared library 'libSystem.Globalization.Native' not loaded, p/invoke 'GlobalizationNative_GetLocaleName' may fail
04-15 16:47:20.960 13737 13737 W monodroid-assembly: Shared library 'libSystem.Globalization.Native' not loaded, p/invoke 'GlobalizationNative_GetLocaleName' may fail
04-15 16:47:20.973 13737 13737 W ames.gnollhackm: Process terminated.
04-15 16:47:20.973 13737 13737 W ames.gnollhackm: Encountered infinite recursion while looking up resource 'Arg_DllNotFoundException' in System.Private.CoreLib. Verify the installation of .NET is complete and does not need repairing, and that the state of the process has not become corrupted.
04-15 16:47:20.973 13737 13737 F libc    : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 13737 (ames.gnollhackm), pid 13737 (ames.gnollhackm)
04-15 16:47:21.032   747   747 I tombstoned: received crash request for pid 13737
04-15 16:47:21.033 13778 13778 I crash_dump64: performing dump of process 13737 (target tid = 13737)
04-15 16:47:21.382 13778 13778 F DEBUG   : pid: 13737, tid: 13737, name: ames.gnollhackm  >>> com.soundmindgames.gnollhackm <<<
04-15 16:47:21.436  1266  1266 I Zygote  : Process 13737 exited due to signal 6 (Aborted)
04-15 16:47:21.459  1656  3778 I ActivityManager: Process com.soundmindgames.gnollhackm (pid 13737) has died: fg  TOP (225,1750)
04-15 16:47:21.461  1656  2076 I libprocessgroup: Successfully killed process cgroup uid 10602 pid 13737 in 2ms
04-15 16:47:24.152   692   692 D io_stats: !@ Read_top(KB): crash_dump64(13778) 6308 loop31(824) 2588 ames.gnollhackm(13737) 2216
@ivanpovazan
Copy link
Member

@mkhamoyan @matouskozak could it be that the recent HybridGlobalization changes for iOS regressed something on Android?

@mkhamoyan
Copy link

I only recall this PR dotnet/runtime#98495 (not related to HybridGlobalization) but not sure if this could cause.
@akoeplinger do you think these changes can be related ?

@pasha-o
Copy link

pasha-o commented Apr 17, 2024

what happens if you put the following in the project file

	<PropertyGroup>
		<InvariantGlobalization>true</InvariantGlobalization>
	</PropertyGroup>

@janne-hmp
Copy link
Author

janne-hmp commented Apr 17, 2024

Looks like the app builds and starts then just fine with .NET 9.0 Preview 3 and InvariantGlobalization added. If I remove InvariantGlobalization from the project file, the app crashes in release again with .NET 9.0 Preview 3.

@ivanpovazan
Copy link
Member

Thank you for checking it out.
@matouskozak can you take a look?

@janne-hmp
Copy link
Author

janne-hmp commented Apr 18, 2024

It looks like even the default .NET MAUI 9.0 project on Android does not start without <InvariantGlobalization>true</InvariantGlobalization> and does start with it. (Although this may be after I added SkiaSharp to it.)

@matouskozak
Copy link
Member

matouskozak commented May 16, 2024

Preview 2 and SkiaSharp 3.0 Preview 3.1 that also sometimes crashed in the same way. They all seem to be related.

@janne-hmp do you happen to have a smaller repro code that I could try on my machine to further investigate? I tried some small app containing:

SkiaSharp.SKImageInfo info = new SkiaSharp.SKImageInfo(100, 100);
Console.WriteLine($"SkiaSharp Version: {info.ColorType}");	

with these packages:

<PackageReference Include="SkiaSharp" Version="3.0.0-preview.3.1" />
<PackageReference Include="SkiaSharp.Views.Maui.Controls" Version="3.0.0-preview.3.1" />

that crashed in Release mode on Android (Debug working properly)

05-16 17:59:18.089 20145 20145 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0000000000000234
05-16 17:59:18.089 20145 20145 F DEBUG   : Cause: null pointer dereference
05-16 17:59:18.089 20145 20145 F DEBUG   :     x0  0000000000000000  x1  000000703536454c  x2  000000703536454c  x3  0000007fc9f6ca58
05-16 17:59:18.089 20145 20145 F DEBUG   :     x4  0000000000000080  x5  b400006e04047050  x6  6f6e20646c756f43  x7  7320646e69662074
05-16 17:59:18.089 20145 20145 F DEBUG   :     x8  0000000000000234  x9  b400006eb4045eb0  x10 0000000000000090  x11 000000000000000f
05-16 17:59:18.089 20145 20145 F DEBUG   :     x12 0000000000004b73  x13 6f6d203a6c6f626d  x14 0000000000000000  x15 00000070352b6662
05-16 17:59:18.089 20145 20145 F DEBUG   :     x16 0000000000000001  x17 00000070352cefc0  x18 000000705065e000  x19 b400006e140482e0
05-16 17:59:18.089 20145 20145 F DEBUG   :     x20 b400006e3405aa90  x21 b400006e04047000  x22 b400006dc4061c10  x23 0000000000000000
05-16 17:59:18.089 20145 20145 F DEBUG   :     x24 b400006da40422f0  x25 b400006e140482f0  x26 0000006d1b45c35d  x27 0000006d1d5b8d24
05-16 17:59:18.089 20145 20145 F DEBUG   :     x28 b400006da4042610  x29 0000007fc9f6cbe0
05-16 17:59:18.089 20145 20145 F DEBUG   :     lr  0000006d1d3f5198  sp  0000007fc9f6cb50  pc  0000006d1d3f51a4  pst 0000000060001000
05-16 17:59:18.089 20145 20145 F DEBUG   : backtrace:
05-16 17:59:18.089 20145 20145 F DEBUG   :       #00 pc 00000000001361a4  /data/app/~~m1XkJ-KmUh-yEuPkLBkUnQ==/com.companyname.androidmaui-dcCfcWpjO-jcwfm2lAqdUA==/split_config.arm64_v8a.apk!libmonosgen-2.0.so (BuildId: 2929beb5d26398447fb2d28409a70eccf684c59e)
05-16 17:59:18.089 20145 20145 F DEBUG   :       dotnet/runtime#1 pc 00000000001fbb08  /data/app/~~m1XkJ-KmUh-yEuPkLBkUnQ==/com.companyname.androidmaui-dcCfcWpjO-jcwfm2lAqdUA==/split_config.arm64_v8a.apk!libmonosgen-2.0.so (BuildId: 2929beb5d26398447fb2d28409a70eccf684c59e)
05-16 17:59:18.089 20145 20145 F DEBUG   :       dotnet/runtime#2 pc 00000000001fc830  /data/app/~~m1XkJ-KmUh-yEuPkLBkUnQ==/com.companyname.androidmaui-dcCfcWpjO-jcwfm2lAqdUA==/split_config.arm64_v8a.apk!libmonosgen-2.0.so (BuildId: 2929beb5d26398447fb2d28409a70eccf684c59e)
05-16 17:59:18.089 20145 20145 F DEBUG   :       dotnet/runtime#3 pc 00000000001fdd0c  /data/app/~~m1XkJ-KmUh-yEuPkLBkUnQ==/com.companyname.androidmaui-dcCfcWpjO-jcwfm2lAqdUA==/split_config.arm64_v8a.apk!libmonosgen-2.0.so (mono_assembly_load_from_full+116) (BuildId: 2929beb5d26398447fb2d28409a70eccf684c59e)
05-16 17:59:18.089 20145 20145 F DEBUG   :       dotnet/runtime#4 pc 000000000001c060  /data/app/~~m1XkJ-KmUh-yEuPkLBkUnQ==/com.companyname.androidmaui-dcCfcWpjO-jcwfm2lAqdUA==/split_config.arm64_v8a.apk!libmono-android.release.so (xamarin::android::internal::EmbeddedAssemblies::open_from_bundles(void*, _MonoAssemblyName*, char**, void*, _MonoError*)+7028) (BuildId: 941d3c28803eb1b4b2fb9ecfdf447edfd0a21e95)
05-16 17:59:18.089 20145 20145 F DEBUG   :       dotnet/runtime#5 pc 00000000001fe438  /data/app/~~m1XkJ-KmUh-yEuPkLBkUnQ==/com.companyname.androidmaui-dcCfcWpjO-jcwfm2lAqdUA==/split_config.arm64_v8a.apk!libmonosgen-2.0.so (BuildId: 2929beb5d26398447fb2d28409a70eccf684c59e)
05-16 17:59:18.089 20145 20145 F DEBUG   :       dotnet/runtime#6 pc 00000000001fb924  /data/app/~~m1XkJ-KmUh-yEuPkLBkUnQ==/com.companyname.androidmaui-dcCfcWpjO-jcwfm2lAqdUA==/split_config.arm64_v8a.apk!libmonosgen-2.0.so (mono_assembly_request_byname+972) (BuildId: 2929beb5d26398447fb2d28409a70eccf684c59e)
05-16 17:59:18.089 20145 20145 F DEBUG   :       dotnet/runtime#7 pc 00000000001401fc  /data/app/~~m1XkJ-KmUh-yEuPkLBkUnQ==/com.companyname.androidmaui-dcCfcWpjO-jcwfm2lAqdUA==/split_config.arm64_v8a.apk!libmonosgen-2.0.so (BuildId: 2929beb5d26398447fb2d28409a70eccf684c59e)
05-16 17:59:18.089 20145 20145 F DEBUG   :       dotnet/runtime#8 pc 0000000000140bec  /data/app/~~m1XkJ-KmUh-yEuPkLBkUnQ==/com.companyname.androidmaui-dcCfcWpjO-jcwfm2lAqdUA==/split_config.arm64_v8a.apk!libmonosgen-2.0.so (BuildId: 2929beb5d26398447fb2d28409a70eccf684c59e)
05-16 17:59:18.089 20145 20145 F DEBUG   :       dotnet/runtime#9 pc 000000000013c97c  /data/app/~~m1XkJ-KmUh-yEuPkLBkUnQ==/com.companyname.androidmaui-dcCfcWpjO-jcwfm2lAqdUA==/split_config.arm64_v8a.apk!libmonosgen-2.0.so (BuildId: 2929beb5d26398447fb2d28409a70eccf684c59e)
05-16 17:59:18.089 20145 20145 F DEBUG   :       dotnet/runtime#10 pc 000000000013c680  /data/app/~~m1XkJ-KmUh-yEuPkLBkUnQ==/com.companyname.androidmaui-dcCfcWpjO-jcwfm2lAqdUA==/split_config.arm64_v8a.apk!libmonosgen-2.0.so (BuildId: 2929beb5d26398447fb2d28409a70eccf684c59e)
05-16 17:59:18.089 20145 20145 F DEBUG   :       dotnet/runtime#11 pc 000000000014fbd4  /data/app/~~m1XkJ-KmUh-yEuPkLBkUnQ==/com.companyname.androidmaui-dcCfcWpjO-jcwfm2lAqdUA==/split_config.arm64_v8a.apk!libmonosgen-2.0.so (BuildId: 2929beb5d26398447fb2d28409a70eccf684c59e)
05-16 17:59:18.089 20145 20145 F DEBUG   :       dotnet/runtime#12 pc 0000000000004ee8  <anonymous:703bd29000>

However, the failure with Globalization you were seeing I wasn't able to reproduce. I tried inserting some Globalization-related code into my program and worked correctly so I suspect the Globalization native file was loaded as expected.

@janne-hmp
Copy link
Author

Did you finish implementing the fix?

@matouskozak
Copy link
Member

Did you finish implementing the fix?

I did not. I tried the code I had shared earlier and I was unable to get the failure you we're reporting.

@janne-hmp do you happen to have a smaller repro code that I could try on my machine to further investigate?

If you would have a smaller repro that I could try that would be helpful.

Have you tried your app with newer previews?

@matouskozak matouskozak reopened this Jun 19, 2024
@SelminBiop
Copy link

SelminBiop commented Jul 9, 2024

I've been able to repro every time with seemingly any MaUI project. Here's how :

  • Install MaUI .Net 9 preview 5 workloads with --include-previews and --skip-manifest-update flags
  • Run Android in Release mode

You should get the mentioned Globalization crash.

To note, if workloads are installed without the flags, then the behavior is a bit different. The app will run in Release, but if your project has localized resources, forcing the Culture to something else than the default language will lead to the app not launching (** Only when building on Windows, somehow on Mac it works fine **).

Also, SkiaSharp is not required.

@matouskozak
Copy link
Member

I've been able to repro every time with seemingly any MaUI project. Here's how :

  • Install MaUI .Net 9 preview 5 workloads with --include-previews and --skip-manifest-update flags
  • Run Android in Release mode

You should get the mentioned Globalization crash.

To note, if workloads are installed without the flags, then the behavior is a bit different. The app will run in Release, but if your project has localized resources, forcing the Culture to something else than the default language will lead to the app not launching.

Thank you for the info. I will investigate it more. One question:

seemingly any MaUI project

Do you mean even MAUI apps that don't use SkiaSharp are crashing for you?

@SelminBiop
Copy link

SelminBiop commented Jul 9, 2024

Exactly, SkiaSharp is not required. Updated original comment.

@matouskozak
Copy link
Member

matouskozak commented Jul 17, 2024

Exactly, SkiaSharp is not required. Updated original comment.

Sorry, I finally got time to look into it. Could you please share what MAUI version do you have (dotnet workload list)?

I tried reproducing the issue as you described but installing the regular MAUI workload with Preview 5 .NET.
maui 9.0.0-preview.5.24307.10/9.0.100-preview.5 SDK 9.0.100-preview.5

I created an app with localized resources, changed culture:
System.Threading.Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("zh-Hant");
but the app worked fine, changing the localized string on the main screen based on the newly selected culture (both on device and emulator in Release).

Do you have a repro app somewhere on GitHub which I could try myself?

@SelminBiop
Copy link

@matouskozak Indeed, it doesn't happen if you install the workloads normally. You need the mentioned flags for the crash to occur.

If you proceed the way you did, then what happens on our end is that if you build the app for Android on Windows, not Mac, then it will crash at launch.

Summary (All this applies for Preview 5, didn't try with new Preview 6):

Original Crash

  • Need to install workload with --include-previews and --skip-manifest-update flags
  • Android app crashes at launch

Follow up Crash

  • Install workloads normally
  • Create an app like you did, with resources and try to hardcode a localization change
  • Run Android app from Windows, not a Mac (discovered after making original post, will update)
  • Android app crashes at launch

Both crashes are reproducible with any sample app that has localized ressources.

@matouskozak
Copy link
Member

@matouskozak Indeed, it doesn't happen if you install the workloads normally. You need the mentioned flags for the crash to occur.

If you proceed the way you did, then what happens on our end is that if you build the app for Android on Windows, not Mac, then it will crash at launch.

Summary (All this applies for Preview 5, didn't try with new Preview 6):

Original Crash

  • Need to install workload with --include-previews and --skip-manifest-update flags
  • Android app crashes at launch

Follow up Crash

  • Install workloads normally
  • Create an app like you did, with resources and try to hardcode a localization change
  • Run Android app from Windows, not a Mac (discovered after making original post, will update)
  • Android app crashes at launch

Both crashes are reproducible with any sample app that has localized ressources.

Thank you, I was trying from my Mac before. I'll try from Windows machine and report the findings here...

@ivanpovazan
Copy link
Member

@SelminBiop @janne-hmp

Regarding:

Original Crash

  • Need to install workload with --include-previews and --skip-manifest-update flags

Why do you need these flags to be passed when installing workloads?


In general, I think this issue is becoming confusing.

Could you please create a separate issue for what you refer to as a Follow up Crash?
Additionally could you please update the description of this one with the exact repro steps that lead you to the original reported crash, to avoid any further confusion?

@SelminBiop
Copy link

For Android, we don't. But for iOS we need them otherwise our app crashes as soon as we try to display a Map.

Initially, we installed the workloads the same way for iOS and Android and so after fixing the Map issue on iOS, we got this crash on Android.

We now install the workloads differently for Android and iOS and we have our CI/CD run on a Mac agent to not have the localization crash on Android.

Doing that, everything seems to be fine. But I still thought it would be relevant to give the information.

I can create separate issues no problem.

@ivanpovazan
Copy link
Member

ivanpovazan commented Jul 23, 2024

If I understand correctly, we have 3 different issues that you are experiencing:

  1. iOS app crashes when displaying map (workaround: include --include-previews and --skip-manifest-update when installing preview 5 workloads)
  2. Android app with localization change crashes with preview 5 workloads installed with --include-previews and --skip-manifest-update
  3. Android app with localization change crashes with preview 5 workload - default installation (this has a different crash reporting than 2.)
  • 2. and 3. manifest only when built/run on Windows.

Is that correct?

I can create separate issues no problem.

That would be much appreciated, thank you.

@SelminBiop
Copy link

@ivanpovazan

For dotnet/runtime#2, no need for localization change, app just crashes at launch

@matouskozak
Copy link
Member

@SelminBiop could you please create an issue with reproduction steps for the But for iOS we need them otherwise our app crashes as soon as we try to display a Map. issue.

@grendello
Copy link
Contributor

grendello commented Oct 1, 2024

I believe 852c38e has a good chance of having fixed the OP issue, however building of the repository mentioned in OP is too involved, I simply have no time to do it. @janne-hmp the above fix is going to be part of the next .NET9 rc, please test if it fixes your issue, thanks! If the issue is still there, I'm afraid we'll need a simpler repro to be able to test things locally.

@janne-hmp
Copy link
Author

I just tried commenting out <InvariantGlobalization>true</InvariantGlobalization> in my solution file (which was the workaround to the issue before), and the game indeed works fine now in both debug and release mode on Android using .NET MAUI 9.0 RC1 and Visual Studio 2022 17.12.0 Preview 2.1, unlike in Preview 3. So the issue indeed seems to be fixed now, as far as I see it.

@grendello
Copy link
Contributor

@janne-hmp excellent news! :) I'm going to close this issue as fixed by #9315 then

@kerams
Copy link

kerams commented Oct 1, 2024

as fixed by #9315 then

He tested it with rc1 though.

@janne-hmp
Copy link
Author

That’s right. It worked already in Release in RC1, so it looks like the issue has already been fixed by something else than an upcoming fix. I can try to double-check this, but I did comment out InvariantGlobalization and then hit Rebuild, and things did still work as intended.

@github-actions github-actions bot locked and limited conversation to collaborators Nov 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs-triage Issues that need to be assigned.
Projects
None yet
Development

No branches or pull requests

8 participants