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

Garbage collection of App, Auth, Instance ID, Realtime Database, Storage garbage collection can crash. #191

Closed
mgrogin opened this issue Jul 29, 2018 · 24 comments
Assignees

Comments

@mgrogin
Copy link

mgrogin commented Jul 29, 2018

My app occasionally crashing since upgrading to firebase 5.1.1
The only indication of the source of the problem that I have is in this crash information from xcode from users using IOS 11.4.1
based on the stack it looks like the problem is firebase database

any ideas?

Crash information:
screen shot 2018-07-29 at 7 09 13 pm

This is what the pod file looks like:

source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/CocoaPods/Specs'
platform :ios, '8.2'

target 'Unity-iPhone' do
pod 'Firebase/Analytics', '5.3.0'
pod 'Firebase/Auth', '5.3.0'
pod 'Firebase/Core', '5.3.0'
pod 'Firebase/Database', '5.3.0'
pod 'Firebase/DynamicLinks', '5.3.0'
pod 'Firebase/Messaging', '5.3.0'
pod 'Firebase/RemoteConfig', '5.3.0'
pod 'FirebaseInstanceID', '3.1.1'
pod 'GoogleMobileAdsMediationUnity', '2.2.1.0'
pod 'Google-Mobile-Ads-SDK', '~> 7.0'
end

@chkuang-g
Copy link
Contributor

We are trying to pinpoint the potential causes. May I ask some questions regarding to the crashes?

  • Which Firebase SDK version were you using before you upgraded to 5.1.1?
  • Do you know which Firebase Database API causes this crash?
  • In your C# code, did you hold a reference of Firebase.Database.FirebaseDatabase somehere?
    Ex. Firebase.Database.FirebaseDatabase database = Firebase.Database.FirebaseDatabase.DefaultInstance;
    Or do you always use FirebaseDatabase.DefaultInstance directly? It would be great if you can share a snippet of the way you call Database API.
  • Do you have multiple database instances?

Thank you,
Shawn

@mgrogin
Copy link
Author

mgrogin commented Aug 2, 2018

Hi Shawn,

  • I was using version 4.5.2 (I reverted my code back to that version for now)
  • I don't know which Firebase Database API causes this crash - I'm only writing to the database (I use Anonymous authentication [auth.SignInAnonymouslyAsync().ContinueWith(task => .....] )
  • I have one function with this line:
    DatabaseReference databaseRef = FirebaseDatabase.DefaultInstance.RootReference;
    so once you exit that function theres no reference to it
    the usage I have in that function is
    databaseRef.Child("users").Child(firebaseAuthUserId).SetRawJsonValueAsync(json);
  • I don't have multiple database instances

This is the pod file I reverted to:

source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/CocoaPods/Specs'
platform :ios, '8.2'

target 'Unity-iPhone' do
pod 'Firebase/Analytics', '4.11.0'
pod 'Firebase/Auth', '4.11.0'
pod 'Firebase/Core', '4.11.0'
pod 'Firebase/Messaging', '4.11.0'
pod 'Firebase/RemoteConfig', '4.11.0'
pod 'GoogleMobileAdsMediationUnity', '2.2.1.0'
pod 'Google-Mobile-Ads-SDK', '~> 7.0'
end

Thanks for looking in to this @chkuang-g !!

@chkuang-g
Copy link
Contributor

Thank you for the information.

We did have bug that FirebaseDatabase.DefaultInstance gets garbage-collected once nothing is referencing it. However, I think we've fixed that already.

We will investigate if this is still a potential issue. At the meantime, what you can do is to keep a reference of FirebaseDatabase.DefaultInstance somewhere in a script that lives way longer than the scope of a function, AFTER FirebaseApp.CheckAndFixDependenciesAsync() is done. For example, in a GameObject that lives as long as the game is on. Keeping a reference of DatabaseReference will do as well. And please let us know if this fixes the occasion crashes.

Also, I'd like to collect a bit more information, just in case this only happens to certain configuration.

  • What is your Unity version?
  • What is your .NET version? (See your "Scripting Runtime Version" and "Api Compatibility" settings in your Player Settings)
  • What is your Scripting Backend? (You can find this in your Player Settings as well)
  • What is your Xcode version?

Thank you,
Shawn

@mgrogin
Copy link
Author

mgrogin commented Aug 5, 2018

This is my Configuration:

  • Unity version 5.6.5f1
  • API Compatibility Level .NET 2.0
  • Scripting Backend IL2CPP
  • Xcode Version 9.4.1 (9F2000)

@gldio
Copy link

gldio commented Sep 10, 2018

my app crashes as well. i got this errors. but It started to crash less after updating.
xcode 9.3 (9e145)
firebase sdk 5.2.1
unity 2018.2.6f1
.net 2.0
backend IL2CPP

crash_ss1
crash_ss2

@chkuang-g
Copy link
Contributor

Hi @gldio,

We are gradually pushing out fixes for GC related crashes. However, it is still on-going.
At the meantime, please try to keep a reference of FirebaseDatabase to prevent it from being garbage-collected.

Sorry for the inconvenience.
Shawn

@stewartmiles stewartmiles changed the title IOS app occasionally crashing since upgrading to firebase 5.1.1 Garbage collection of App, Auth, Instance ID, Realtime Database, Storage garbage collection can crash. Oct 23, 2018
@stewartmiles
Copy link
Contributor

To summarize, @chkuang-g discovered a general issue with garbage collection across the SDK. If you create an object release the reference then create effectively the same object (e.g the same database reference) again it's possible for the SDK to end up with two C# objects, one in the garbage collection queue and the other held by the application, pointing at the same C++ object. When the object in the garbage collection queue is finally deleted, it also deletes the C++ object and we end up with a C# object referencing a stale pointer to a C++ object. @chkuang-g is working on a fix at the moment.

In the meantime, you should keep references around to objects that are reused on a regular basis in your application.

@stewartmiles
Copy link
Contributor

@chkuang-g I'm pretty sure #200 is the same thing.

@asger60
Copy link

asger60 commented Jan 31, 2019

I think I have this issue aswell.
The Unity editor keeps crashing on me whenever i try to do firebase stuff.
This happens whenever i enter build mode about 50% of the time.
Could you please explain how I should keep an reference to the database object?

@asger60
Copy link

asger60 commented Feb 1, 2019

I've changed my code to run in a editor window, but the crashes prevail. It seems to happen whenever Unity has recompiled the code and I try to fetch data.

@chkuang-g
Copy link
Contributor

@asger60 This issue was on iOS. Yours seems like a different one.
Could you open a different issue and detailed the environment you had (ex. Unity version, Firebase version)

Also, you can fetch editor log here.
https://docs.unity3d.com/Manual/LogFiles.html
It would be helpful if you can find some log related to your crash in the log and include that in the description.

Thank you,
Shawn

@fingerfunkNIK
Copy link

Mac editor keeps crasching here too. every second time.
Have tried all possible permutations of keeping refs to database, trying to destroy OnDestroy() etc.
this is a dump:
DependOn - group: com.google.firebase artifact: firebase-database-unity version: 5.4.4 packageIds: repositories: Assets/Firebase/m2repository
UnityEngine.DebugLogHandler:Internal_Log()
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
Google.Logger:Log(String, LogLevel) (at Z:\tmp\tmp.x6o0WrFOpy\third_party\unity\unity_jar_resolver\source\VersionHandlerImpl\src\Logger.cs:83)
GooglePlayServices.PlayServicesResolver:Log(String, LogLevel) (at Z:\tmp\tmp.mz1RZCSjez\third_party\unity\unity_jar_resolver\source\PlayServicesResolver\src\PlayServicesResolver.cs:707)
GooglePlayServices.PlayServicesResolver:LogDelegate(String, LogLevel) (at Z:\tmp\tmp.mz1RZCSjez\third_party\unity\unity_jar_resolver\source\PlayServicesResolver\src\PlayServicesResolver.cs:687)
Google.JarResolver.PlayServicesSupport:Log(String, LogLevel, Boolean) (at Z:\tmp\tmp.mz1RZCSjez\third_party\unity\unity_jar_resolver\source\JarResolverLib\src\Google.JarResolver\PlayServicesSupport.cs:210)
Google.JarResolver.PlayServicesSupport:DependOn(String, String, String, String[], String[], String) (at Z:\tmp\tmp.mz1RZCSjez\third_party\unity\unity_jar_resolver\source\JarResolverLib\src\Google.JarResolver\PlayServicesSupport.cs:267)
GooglePlayServices.c__AnonStorey0:<>m__0(XmlTextReader, String, Boolean, String, List1) (at Z:\tmp\tmp.mz1RZCSjez\third_party\unity\unity_jar_resolver\source\PlayServicesResolver\src\AndroidXmlDependencies.cs:103) Google.XmlUtilities:ParseXmlTextFileElements(String, Logger, ParseElement) (at Z:\tmp\tmp.x6o0WrFOpy\third_party\unity\unity_jar_resolver\source\VersionHandlerImpl\src\XmlUtilities.cs:136) GooglePlayServices.AndroidXmlDependencies:Read(String, Logger) (at Z:\tmp\tmp.mz1RZCSjez\third_party\unity\unity_jar_resolver\source\PlayServicesResolver\src\AndroidXmlDependencies.cs:66) GooglePlayServices.XmlDependencies:ReadAll(Logger) (at Z:\tmp\tmp.mz1RZCSjez\third_party\unity\unity_jar_resolver\source\PlayServicesResolver\src\XmlDependencies.cs:78) GooglePlayServices.AndroidXmlDependencies:ReadAll(Logger) (at Z:\tmp\tmp.mz1RZCSjez\third_party\unity\unity_jar_resolver\source\PlayServicesResolver\src\AndroidXmlDependencies.cs:150) GooglePlayServices.PlayServicesResolver:ResolveUnsafe(Action1, Boolean) (at Z:\tmp\tmp.mz1RZCSjez\third_party\unity\unity_jar_resolver\source\PlayServicesResolver\src\PlayServicesResolver.cs:1356)
GooglePlayServices.c__AnonStorey4:<>m__0() (at Z:\tmp\tmp.mz1RZCSjez\third_party\unity\unity_jar_resolver\source\PlayServicesResolver\src\PlayServicesResolver.cs:1328)
GooglePlayServices.PlayServicesResolver:ExecuteNextResolveJob() (at Z:\tmp\tmp.mz1RZCSjez\third_party\unity\unity_jar_resolver\source\PlayServicesResolver\src\PlayServicesResolver.cs:1247)
GooglePlayServices.PlayServicesResolver:ScheduleResolve(Boolean, Action`1, Boolean) (at Z:\tmp\tmp.mz1RZCSjez\third_party\unity\unity_jar_resolver\source\PlayServicesResolver\src\PlayServicesResolver.cs:1338)
GooglePlayServices.PlayServicesResolver:AutoResolve(Action) (at Z:\tmp\tmp.mz1RZCSjez\third_party\unity\unity_jar_resolver\source\PlayServicesResolver\src\PlayServicesResolver.cs:921)
GooglePlayServices.PlayServicesResolver:m__8() (at Z:\tmp\tmp.mz1RZCSjez\third_party\unity\unity_jar_resolver\source\PlayServicesResolver\src\PlayServicesResolver.cs:900)
Google.RunOnMainThread:ExecutePollingJobs() (at Z:\tmp\tmp.x6o0WrFOpy\third_party\unity\unity_jar_resolver\source\VersionHandlerImpl\src\RunOnMainThread.cs:286)
Google.RunOnMainThread:m__1() (at Z:\tmp\tmp.x6o0WrFOpy\third_party\unity\unity_jar_resolver\source\VersionHandlerImpl\src\RunOnMainThread.cs:400)
Google.RunOnMainThread:RunAction(Action) (at Z:\tmp\tmp.x6o0WrFOpy\third_party\unity\unity_jar_resolver\source\VersionHandlerImpl\src\RunOnMainThread.cs:234)
Google.RunOnMainThread:ExecuteAll() (at Z:\tmp\tmp.x6o0WrFOpy\third_party\unity\unity_jar_resolver\source\VersionHandlerImpl\src\RunOnMainThread.cs:392)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions() (at /Users/builduser/buildslave/unity/build/Editor/Mono/EditorApplication.cs:200)

(Filename: Z Line: 0)

Receiving unhandled NULL exception
Obtained 12 stack frames.
#0 0x000001473a6a3a in GC_mark_from
#1 0x000001473a133c in GC_mark_some
#2 0x000001473a0a40 in GC_stopped_mark
#3 0x000001473a0715 in GC_try_to_collect_inner
#4 0x000001473a2dfb in GC_collect_or_expand
#5 0x000001473a3051 in GC_allocobj
#6 0x0000014739d0a4 in GC_generic_malloc_inner
#7 0x000001473a397b in GC_generic_malloc
#8 0x000001473a7736 in GC_malloc_kind_global
#9 0x000001473776e0 in mono_gc_alloc_vector
#10 0x00000147321f61 in mono_array_new_specific_checked
#11 0x0000014732203f in ves_icall_array_new_specific
Launching bug reporter
[Performance] WebView.DoCefMessages : 125 samples, Peak. 45.1 ms (25.8x), Avg. 1.75 ms, Total. 218.4 ms (0.2%)
[Performance] WebView.CheckCurlRequests : 32 samples, Peak. 162 us (18.3x), Avg. 8.84 us, Total. 282.9 us (0.0%)
[Performance] License.Tick : 1832 samples, Peak. 26.9 us (15.8x), Avg. 1.71 us, Total. 3.124 ms (0.0%)
[Performance] UnityConnect.Tick : 1318 samples, Peak. 2.49 ms (68.5x), Avg. 36.3 us, Total. 47.89 ms (0.0%)
[Performance] PackageManager::RunRequestSynchronously : 4 samples, Peak. 39.7 ms (4.0x), Avg. 9.97 ms, Total. 39.88 ms (0.0%)
[Performance] ApplicationTickTimer : 4814 samples, Peak. 2.56 s (756.6x), Avg. 3.38 ms, Total. 16.27 s (12.7%)
[Performance] MonoCompiler.Tick : 450 samples, Peak. 2.33 s (435.5x), Avg. 5.34 ms, Total. 2.403 s (1.9%)
[Performance] Internal_SwitchSkin : 4815 samples, Peak. 13.9 us (96.6x), Avg. 144 ns, Total. 695.2 us (0.0%)
[Performance] Collab.Tick : 1257 samples, Peak. 683 us (195.2x), Avg. 3.50 us, Total. 4.398 ms (0.0%)
[Performance] WebView.Tick : 1709 samples, Peak. 637 ms (777.5x), Avg. 820 us, Total. 1.401 s (1.1%)
[Performance] GameView.OnGUI : 431 samples, Peak. 17.8 ms (17.2x), Avg. 1.03 ms, Total. 444.8 ms (0.3%)
[Performance] ConsoleWindow.OnGUI : 52 samples, Peak. 18.4 ms (10.6x), Avg. 1.74 ms, Total. 90.60 ms (0.1%)
[Performance] InspectorWindow.OnGUI : 52 samples, Peak. 472 ms (32.8x), Avg. 14.4 ms, Total. 748.5 ms (0.6%)
[Performance] ProjectBrowser.OnGUI : 154 samples, Peak. 145 ms (43.4x), Avg. 3.35 ms, Total. 515.7 ms (0.4%)
[Performance] SceneHierarchyWindow.OnGUI : 86 samples, Peak. 12.3 ms (19.4x), Avg. 630 us, Total. 54.17 ms (0.0%)
[Performance] SceneView.OnGUI : 694 samples, Peak. 35.7 ms (30.8x), Avg. 1.16 ms, Total. 805.7 ms (0.6%)
[Performance] CurlRequest.Tick : 746 samples, Peak. 179 us (96.0x), Avg. 1.86 us, Total. 1.391 ms (0.0%)
[Performance] SceneBackgroundTask.Tick : 579 samples, Peak. 1.07 us (2.7x), Avg. 396 ns, Total. 229.5 us (0.0%)
[Performance] Scheduler.Tick : 2316 samples, Peak. 2.27 ms (73.0x), Avg. 31.1 us, Total. 72.04 ms (0.1%)
[Performance] RepaintAllProfilerWindows : 47 samples, Peak. 1.02 ms (23.7x), Avg. 43.1 us, Total. 2.024 ms (0.0%)
[Performance] PlayerUpdates.Tick : 1257 samples, Peak. 60.0 us (2.3x), Avg. 26.6 us, Total. 33.48 ms (0.0%)
[Performance] GlobalCallbacks : 4815 samples, Peak. 803 us (49.8x), Avg. 16.1 us, Total. 77.61 ms (0.1%)
[Performance] EditorAnalytics.Tick : 382 samples, Peak. 106 us (30.4x), Avg. 3.48 us, Total. 1.331 ms (0.0%)
[Performance] GI.Tick : 301 samples, Peak. 664 us (11.0x), Avg. 60.1 us, Total. 18.10 ms (0.0%)
[Performance] Video.Update : 4815 samples, Peak. 37.9 us (31.9x), Avg. 1.19 us, Total. 5.723 ms (0.0%)
[Performance] UnitySynchronization.ExecuteTasks : 1181 samples, Peak. 54.0 us (5.9x), Avg. 9.21 us, Total. 10.87 ms (0.0%)
[Performance] PreloadManager : 4615 samples, Peak. 464 us (36.8x), Avg. 12.6 us, Total. 58.12 ms (0.0%)
[Performance] SceneTracker : 4815 samples, Peak. 496 ms (685.5x), Avg. 723 us, Total. 3.480 s (2.7%)
[Performance] ConsoleLog.Tick : 442 samples, Peak. 267 us (26.0x), Avg. 10.3 us, Total. 4.531 ms (0.0%)
[Performance] HierarchyWindow.Tick : 138 samples, Peak. 1.98 ms (48.9x), Avg. 40.5 us, Total. 5.593 ms (0.0%)
[Performance] Inspector.Tick : 138 samples, Peak. 2.66 ms (5.9x), Avg. 450 us, Total. 62.12 ms (0.0%)
[Performance] Tooltip.Tick : 375 samples, Peak. 22.1 ms (164.0x), Avg. 135 us, Total. 50.53 ms (0.0%)
[Performance] RequestRepaintForPanels : 3933 samples, Peak. 428 us (77.8x), Avg. 5.50 us, Total. 21.62 ms (0.0%)
[Performance] UpdateSceneIfNeeded : 3932 samples, Peak. 543 ms (375.4x), Avg. 1.45 ms, Total. 5.683 s (4.4%)
[Performance] UpdateVideoTextures : 3733 samples, Peak. 14.1 us (42.4x), Avg. 332 ns, Total. 1.239 ms (0.0%)
[Performance] PackageImporter.Tick : 442 samples, Peak. 4.05 us (7.7x), Avg. 523 ns, Total. 231.4 us (0.0%)
[Performance] InspectorBackground.Tick : 577 samples, Peak. 4.05 us (2.5x), Avg. 1.64 us, Total. 943.4 us (0.0%)
[Performance] ChangeLayoutIfNeeded : 4814 samples, Peak. 1.07 us (8.9x), Avg. 121 ns, Total. 582.2 us (0.0%)
[Performance] AsyncReadManager.ForceCloseFiles : 107 samples, Peak. 78.9 us (12.6x), Avg. 6.28 us, Total. 672.2 us (0.0%)
[Performance] VCProvider : 4814 samples, Peak. 34.0 us (26.7x), Avg. 1.27 us, Total. 6.122 ms (0.0%)
[Performance] InactiveGI.Tick : 295 samples, Peak. 774 us (9.1x), Avg. 85.5 us, Total. 25.21 ms (0.0%)
[Performance] RepaintAll : 882 samples, Peak. 4.49 ms (34.0x), Avg. 132 us, Total. 116.5 ms (0.1%)
Firebase App initializing app __FIRAPP_DEFAULT (default 1).
[Unity Package Manager (Upm)]
Parent process [16195] was terminated

@fingerfunkNIK
Copy link

I am just using the supplied
namespace Firebase.Sample.Database
UIHandler.cs script.

@chkuang-g
Copy link
Contributor

chkuang-g commented Apr 2, 2019

Hi folks,

We made several fixes in 5.6.0 to fix multiple GC related crashes.
https://firebase.google.com/support/release-notes/unity

Could you try 5.6.0 and kindly report if the newer SDK resolve your issues?

Here is the downloadable link for your convenience.
https://firebase.google.com/download/unity

Thank you,
Shawn

@inxidious
Copy link

@chkuang-g i think the bug is still there
The weird thing is that, the bug behaved differently between version firebase v5.4.3 and v5.6.0
All the bugs happened on Unity Editor, it runs fine on android

Please note that i disabled the FirebaseDatabase.dll under Firebase/Plugins/Mono for the editor platform, and enabled the one under Firebase/Plugins/ instead. Because of this issue: #106

Before upgrading to 5.6.0 (5.4.3):
Everything runs smoothly if i didn't use any database listener events, e.g. onChildAdded . But if use one, The unity editor either crashed or not responding on the second time i hit play.

After upgrade to 5.6.0:

  • The use of .OrderByKey().StartAt() sometimes worked, sometimes not. So, i want to fetch data StartAt(6), but it returned all data instead. It never happened before upgrading to 5.6.0
  • Now if i use onChildAdded, the editor didn't crashed anymore even when i hit Play the second time. but now it crashed when i called database.UpdateChildrenAsync (it didn't crash if i don't use any listener events in the game)

My informations:
Unity editor version: 2018.3.8f1
Firebase Unity SDK version: 5.6.0
Platform: Mac OS 10.14.3, 64 bit
Scripting Runtime Version: .NET 4.x Equivalent
Scripting Backend: Mono
Api Compatibility Level: .NET Standard 2.0

Products used:
Authentication, Database, & Cloud Functions

@chkuang-g
Copy link
Contributor

chkuang-g commented Apr 4, 2019

@inxidious
Using Firebase/Plugins/FirebaseDatabase.dll in the editor is not supported yet. This is why it is disabled by default.

This dll is pointing to our C++ desktop implementation, which is still work in progress. (And it is almost done!!!) We are making a lot of changes lately so I wouldn't be surprised that 5.6.0 behaves differently than 5.4.3. Unfortunately the best bet to resolve #106 is to change the networking environment for now.

Still, thanks for the report. I will forward this information to the engineer who is working on this.

@alexames
Copy link

alexames commented Jul 3, 2019

This should be fixed as of the latest release, 6.2.0

@alexames alexames closed this as completed Jul 3, 2019
@unnanego
Copy link

I'm using firebase 6.3.0 and still have crashes every time I call database and stop the game in the editor. 2019.1.10 mac os

@dakimaru
Copy link

dakimaru commented Jul 22, 2019

Can Confirm that it happens for us as well with 6.1.1, 6.2.0, 6.3.0 on 2019.1.10f1 mac 10.14.4
Crashes every second time Play is pressed, it's a nightmare! Half of our development time is waiting for Unity to restart because of this and it's been like this for weeks since we updated.

Relevant logs below.

Reloading assemblies after finishing script compilation.
Begin MonoManager ReloadAssembly
Receiving unhandled NULL exception
Obtained 17 stack frames.
WARNING: Auth object 0x9e08d640 should be deleted before the App 0x9d2b3040 it depends upon.
WARNING: Database object 0xc303cde0 should be deleted before the App 0x9d2b3040 it depends upon.
Receiving unhandled NULL exception
Obtained 46 stack frames.
#0 0x0000015573f41b in firebase::database::internal::DatabaseInternal::~DatabaseInternal()
#1 0x0000015575eb44 in firebase::database::Database::DeleteInternal()
#2 0x000001558bfc95 in firebase::CleanupNotifier::CleanupAll()
#3 0x000001558bc40a in firebase::app_common::RemoveApp(firebase::App*)
#4 0x000001558cacd7 in firebase::App::~App()
#5 0x00000155697882 in firebase::CppInstanceManagerfirebase::App::ReleaseReference(firebase::App*)
#6 0x00000157af309b in (wrapper managed-to-native) Firebase.AppUtilPINVOKE:FirebaseApp_ReleaseReferenceInternal (System.Runtime.InteropServices.HandleRef) {0x7f8fb8dc8d48} + 0x11b (0x157af2f80 0x157af31a5) [0x148c27000 - Unity Child Domain]
#7 0x00000157af1de3 in Firebase.FirebaseApp:Dispose () {0x7f8fc7d3ff68} + 0x73 (0x157af1d70 0x157af1e0e) [0x148c27000 - Unity Child Domain]
#8 0x000001618c572c in (wrapper runtime-invoke) object:runtime_invoke_virtual_void__this__ (object,intptr,intptr,intptr) {0x7f8fbd156ad8} + 0x16c (0x1618c55c0 0x1618c5935) [0x148c27000 - Unity Child Domain]
#9 0x000001486a3bcf in mono_gc_run_finalize
#10 0x000001486a57ac in finalizer_thread
#11 0x0000014866c388 in start_wrapper
#12 0x000001486e0114 in GC_inner_start_routine
#13 0x000001486e00a9 in GC_start_routine
#14 0x007fff5a6562eb in _pthread_body
#15 0x007fff5a659249 in _pthread_start
#16 0x007fff5a65540d in thread_start

@fingerfunkNIK
Copy link

fingerfunkNIK commented Jul 22, 2019 via email

@JanSob
Copy link

JanSob commented Sep 6, 2019

Same here...

@stewartmiles
Copy link
Contributor

@chkuang-g has another patch for this pending release.

@HuuugeGames-MichalOglozinski

Is there any info about that issue? We've tried to update SDK to 6.6.0 released on September 25, but the crashes are still here every time we restart the project in editor on MacOS.

@chkuang-g
Copy link
Contributor

chkuang-g commented Oct 5, 2019

Hi folks,

I think a couple of different issues were mixed here. The original post from @mgrogin was about the crash on iOS. And most the the rest are about crash in Unity Editor on Mac. I think the original issue was resolved. Also the Unity Editor issue should have been resolved in the past release. Here is the reason.

Crash when play for the second time should be resolved in 6.5.0.
https://firebase.google.com/support/release-notes/unity#version_650_-_september_10_2019
There was an issue that when Unity Editor unloads AppDomain, which happens when you press Play button, the editor would attempt to kill threads created from C++ library and cause crash or freeze depending on your editor version. There is a Unity issue about this and was fixed in Unity 2018.1.
https://issuetracker.unity3d.com/issues/dot-net-4-dot-6-macos-native-code-callbacks-from-separate-thread-crash-unity-when-net-4-dot-6-is-used
I have put in a fix to prevent this from happening for other Unity versions.

Some other crash in editor related to Database should be fixed in 6.6.0.
https://firebase.google.com/support/release-notes/unity#version_660_-_september_25_2019

@HuuugeGames-MichalOglozinski
This is the first time you posted in this thread and your issue might be a different one. Could you create another issue and fill up the template with more detail?

Thank you,
Shawn

@firebase firebase locked and limited conversation to collaborators Nov 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests