#Build freezing while loading a new scene.
1 messages · Page 1 of 1 (latest)
I do realize it's something with the localization, but I just don't know what, it's note referencing any of the codes I made, only tha package, gonna try some tests
also, this bug only happens in builds.
why the localized register event is taking soo much?
there is a lot of wait for completion... the hell?
It keeps repeating the awake from the interface even though there is nothing that calls this
stopped the interface to see if the thing still happens, registerchangehandler still seem to be the problem
Feels like a recursion. Are you triggering localization update from a localization update perhaps. You should expand that branch that allocates 3gb of memory to understand the call chain better.
Hi dlich, thanks for coming for the help again!
quite a long thread,
all going to garbage collection
before crashing this was the profiller
First of all, the allocation is caused by an exception log.
And then I see localization update nested there.
Is InterfaceManager a class in your project? Are there any other classes in your project that appear in that callstack?
interfacemanager is the class responsible to instantiate all the other interfaces
but even when I disable it, the bug still happens, so I don't know if this is the one responsible
what does the callstack look like when you disable it?
Do yo subscribe or have anything set on localize string changed event?
It's very likely that you have a recursion because of that.
It might even be something assigned to a unity event in the inspector.
this
what do you mean by... recursion?
Emm... Recursion. One of the basic concepts in programming. Basically where a function calls itself or some other function that in turn calls the first function, causing a sort of infinite loop if not done right.
The localization string event calls in the callstack strongly point to that.
ohhh, didn't know the name in english
well, if it's this, the guy who will enlighten me on what this could be is the dev responsible for localization, if I find the solution will explain here.
Specifically, I'm saying that you have an infinite recursion.
https://www.geeksforgeeks.org/dsa/finite-and-infinite-recursion-with-examples/
Preload.SingleStep is called at least 2 times in one stack from the screenshots. So there might be some point you can look at (or your responsible dev)
didn't saw that, thanks! gonna see if this help me find a culprit
Okay... day 3 of me attempting to fix this.
I've attempted preloading the localization system... didn't work.
I've removed every single thing that reference a localized string or localized event... didn't work.
I've tried removing the allways preload on the settings... didn't work.
I've tried a bunch of combinations of settings on the localization system... didn't as well.
Didn't find anything with the single step double call...
I will now start removing every single object in the scene until a culprit is found... if I don't... I'm gonna cry.
I feel like the culprit might not even be in the scene. The localization system seems to be loading something that probably causes the recursion.
I fell like that too, but it was working before, I don't know why this is happening now, if it's not in the code, it must be a internal problem from the localization system
but also, it's not in the other scenes who also use the localization, so it might be a specific thing that is using the localization
That's where version control should come to help. Check the commit/changeset where the issue first appeared.
I don't know if this will help much, becouse it will be 3 months since we last tried to build the game, and there was a lot of commits between
and anything that calls the localization system I removed already
soo... I DON'T KNOW WHY THIS WORLD HATE ME
Then perhaps the callstack has changed?
Does it freeze during the building process?
nop
During build launch?
only during the transiction scene from menu to the first scene
the frist mission*
the first mission
aaaaa
OK, then it's very simple. Attach the debugger, reproduce the issue. If it doesn't break automatically, break manually. Investigate the thread callstacks.
Mainly you want to see whta the main thread is doing.
how do I... investigate the thread callstack?
I know this mind sound stupid... I might be stupid
Depends on your ide.
VS has threads and parallel stacks debug windows, as well as a thread picker at the tool bar.
hmmm, gonna try.
But it's very likely it will break on the main thread anyway(or rather with the main thread selected).
there is... a lot of threads
You need to actually break.
During the freeze.
Vs code debugger can be a bit difficult for a beginner compared to VS
frozen
In the debugger. Otherwise you're not really using it.
Is it known which code is the problem?
I would have embedded my code in the dlls a long time ago
Well, just guessing doesn't make much sense if there is a call stack
I have no Idea, it mentions this one UnityEngine.Localization.Operations.WaitForCurrentOperationAsyncOperationBase`1<UnityEngine.Localization.Tables.StringTable>:InvokeWaitForCompletion () (at ./Library/PackageCache/com.unity.localization@62db12c43c5c/Runtime/Operations/WaitForCurrentOperationAsyncOperationBase.cs:20)
I also found out I wasn't debugging the player, but the game, found out how to debug the player now tho
This is log from build?
yep
one of the many
the entire log is:
some mentions InterfaceManager, but the thing is... even when I remove it, the bug still there
there are more logs up in the discussion
Well you can just inject your code in localizations dll through dnspy for debugging
Or throw exception for test
For example stop recursion
You know class name you can just find it
Just use the debugger properly already.
Did you manage to break during a freeze?
You need to learn how to use the debugger. It's an essential tool for a developer.
I know, I'm trying to find the class to put the breakpoint
ohhhhh, now that will be userful,
Don't put a breakpoint. Just press "break all"
Again, gotta learn to use the debugger properly:
https://code.visualstudio.com/docs/debugtest/debugging
;-; I've gonna see this tomorrow, currently my mind is tired
but, I'm finding something, something... unexpected
the bug seems to be coming from the... CONSTRUCTION HOLOGRAM??? WHYYYYY?, every continue goes back to the loop and the construction hologram, goddammit
ohh, wait... its running now... I think... it was something I deleted
okay, 8 hours of work without pause I will... sleep now, thanks for the help guys, gonna see the video tomorrow, and then return with the feedback
and the patience...
The main thing is to build more often next time so that you know where you can roll back
DOTS may not work in the build for absolutely any reason, but at the same time everything will work in the editor
I once had a build that just crashed for no reason because the Burst code compiled incorrectly
What's unexpected about it?
construction hologram calling the goddamn localization, there is nothing in it, but then after 2 continues the game runned normally
saw the debugger tutorial, didn't explained how to do a break it all, or I didn't look properly... then I clicked pause, and entered the thread I entered early, boom, I'm in the code!
I fell like I gained a neuron... then I fell like this was dumbly simple, and now I'm depressed
this is where the endless circle is happening
OK, it's called pause in vs code. Break all is in vs. But the idea is the same - break execution at any moment.
Try letting it go for a moment, then pause again.
still here, was stepping over it, there is at least 7 steps this circle
I mean... there are things happening inside this
Not stepping. Unpause, wait a few sec and pause again.
What's the full text of that assert?
back again
Debug.Assert(!m_Waiting, "Calling WaitForCompletion on an operation that is already waiting.");
the same thing on the logs in the start
Is your interface manager loaded from an asset bundle?
I think the issue is that something that was in an asset bundle also triggers an asset bundle(possibly the same one) load from it's awake or OnEnable causing an infinite recursion.
Here you can see that the interface manager is loaded from an asset bundle.
Check the localization component on enable to see what gameobject it's own(check gameobject name field).
It would also help to look deeper in the callstack to understand what happens earlier.
but then why this bug keeps happening when I remove the interface instantiation? gona try the test again
ok, I realized there is at least two things in the scene triggering this loop, something the interface manager is instantiating that I'm gonna, but there is something on the level of the game, see what the debugger show
THE LOCALIZESTRINGEVENT? how do I fix this then?
I'm gonna hope that is a specific object,
hmmm, I love a null object calling a enable
What makes you think these 2 callstacks are related to the issue?
... they... call the things... that call the infinite circle
I don't see the assert in these callstacks though
no?? wait, I think I sended you the wrong print, one second
And anyways, you should start from pausing during the freeze. Don't place breakpoints. You want to know what's going on during the freeze.
When there is no interface manager.
that is what I'm doing
and will do... tomorow I'm tired now, gonna play a bit of DRG and go to sleep, thanks for being with me on this little adventure of mine
honestly, I'm just happy that the way it's going I'm not gonna have to rework the localization system, that would make me cry
also, here is the assert
there is some breakpoints, but are the same ones from yesterday... I just... didn't remove them...
OK, but where does it start? Can you scroll that callstack down more until you see any calls/classes from your project?
I was sleeping... but start here
am I right to belive that the one calling the method is null?
becouse, I would be happy to know if it carries some kind of ID for me to find the one who bugged in the scene
No. The method is called from unity native code, not from the gameobject(at least not the C# side gameobject). The gameobject is being null either because it's already destroyed or not initialized yet.
While it's a bit weird, I'm not sure we can draw any conclusions from this.
If you can reproduce that particular callstack, I'd look at "this" properties for more info.
I will do this in 2 hours from now, I need to help with lunch
sooo... I found the culprit, don't know why, but it was the localizestringevent that have the WaitForCompletion marked and are enabled on the start of the scene, don't know why still tho, but I have a Fix, what makes me happy
this is weird, there are more localizestringevent with wait for completion but it seems that only this one from this specific object is causing the bug, can't find what it carries that makes this one special from the others
I need now to find the exact interface
see if just removing the wait for completion solves the problem