Let me explain my scenario first. Recently, due to some known issues, my team decided to upgrade our unity firebase SDK to 6.7. The former one was 6.0. However, we found that on Firebase SDK 6.7, it wouldn’t support editor sign in with P12 key anymore. Hence, we turned to use the same
signIn method as android. At first, it works fine. But we found that after playing for an hour in editor mode, when you restart the play mode(press to leave ‘play’ and press to start ‘play’), the editor gets hang forever. I have created a dump and had a basic analysis on it. However, I could not go any further. So I came here for help.
I try to know which thread got stuck so long. I use windbg to get the lasting time of each threads.
After that, I try to see the call stack of thread 4a74, which is like below.
I found that it hangs because unity wants to
unloadDomain. Hence, I start to check the mono open source to see what had happened.
It seems like that
mono_domain_try_unloadwould fork a thread to call
unload_thread_main, which I also found the thread in my dump(I can’t put any more picture due to limitation). Then I check what does that thread do. It seems like it would like to finalize
monoDomain. However, it just waits there forever.
I found that
unload_thread_mainonly last for less than 1 seconds in my dump. It is not like what I expected.
The issue only happened after I upgraded my firebase SDK to 6.7 and I have tested with SDK 6.0. It works fine.
As mentioned above, I need to play in editor for about an hour. I think this may have some relation with
FIrebase id token refresh
- What is
- Why gc
monoDomaincauses my editor hang?
- Is this relative to firebase SDK?
- If so, is that because unity could not garbage collect firebase SDK?
- What should I do now…
I post this question here because my threads got hanged on unity call stack. Hope it is the right place to ask the question. BTW, I have tested Unity with
Thanks in advance.