godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.19k stars 21.21k forks source link

Using `C#` built-in `Timer` Crashes Android `AAB` Export #55638

Closed MrZak-dev closed 2 years ago

MrZak-dev commented 2 years ago

Godot version

3.4.mono.stable , 3.4.1.mono.rc1

System information

Android

Issue description

Using C# built-in Timer Crashes Android AAB Export.

maybe releated to https://github.com/godotengine/godot/issues/48458 ,

Steps to reproduce

Crash log

--------- beginning of crash
2021-12-01 13:13:00.942 7285-7398/? A/libc: FORTIFY: pthread_mutex_lock called on a destroyed mutex (0xc17ed80c)
2021-12-01 13:13:00.946 7285-7398/? A/libc: Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 7398 (Thread Pool Wor), pid 7285 (icopo.SpaceFire)
2021-12-01 13:13:00.939 7285-7342/? E/mono: Unhandled Exception:
    System.DllNotFoundException: __Internal assembly:<unknown assembly> type:<unknown type> member:(null)
        at (wrapper managed-to-native) System.TimeZoneInfo+AndroidTimeZones.monodroid_get_system_property(string,intptr&)
      at System.TimeZoneInfo+AndroidTimeZones.GetDefaultTimeZoneName () [0x00029] in <a947100bfc9e4b689622af54e1e07934>:0 
      at System.TimeZoneInfo+AndroidTimeZones.get_Local () [0x00000] in <a947100bfc9e4b689622af54e1e07934>:0 
      at System.TimeZoneInfo.CreateLocal () [0x00000] in <a947100bfc9e4b689622af54e1e07934>:0 
      at System.TimeZoneInfo.get_Local () [0x00009] in <a947100bfc9e4b689622af54e1e07934>:0 
      at System.TimeZoneInfo.GetDateTimeNowUtcOffsetFromUtc (System.DateTime time, System.Boolean& isAmbiguousLocalDst) [0x00000] in <a947100bfc9e4b689622af54e1e07934>:0 
      at System.DateTime.get_Now () [0x00008] in <a947100bfc9e4b689622af54e1e07934>:0 
      at System.Timers.Timer.MyTimerCallback (System.Object state) [0x00019] in <ff8dc755b313498597c01f2c3444935b>:0 
      at System.Threading.Timer+Scheduler.TimerCB (System.Object o) [0x00007] in <a947100bfc9e4b689622af54e1e07934>:0 
      at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x00008] in <a947100bfc9e4b689622af54e1e07934>:0 
      at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00074] in <a947100bfc9e4b689622af54e1e07934>:0 
      at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in <a947100bfc9e4b689622af54e1e07934>:0 

Minimal reproduction project

UnisgTimersAABCrash.zip

Calinou commented 2 years ago

@MrZak-dev Does it crash if you export a release APK instead (and a debug APK/one-click deploy)?

MrZak-dev commented 2 years ago

@Calinou No it doesn't , it crashes only when you export AAB and install it directly from Google play or using Bundletool and exporting apks from The AAB

oknpk commented 2 years ago

Hi, is there any solution? After uploading the app to google play, the app crashes after splash screen. No problem as .APK, now I'm trying to remove the timers and datetime methods from the project.

MrZak-dev commented 2 years ago

the only solution i found for my particular project is to not use C# built-in timers and i have switched all of them to the regular Godot timer Node.

oknpk commented 2 years ago

After a little look, my problem was different. I am using LiteDB database and LINQ. These also crash. I'll open a new issue after doing some more research.

akien-mga commented 2 years ago

Fixed by #57420.