#Unity crashes upon exit play mode or save script

1 messages · Page 1 of 1 (latest)

uncut bone
#

Hello! In my DOTS project, each time I save a script, unity crashes or each time I spend a long time in play mode and then exit, it crashes.
I spent a lot of time trying to figure out the cause(because I cannot replicate it on an empty project), then found a crash log(I believe...), I have posted the part of the crash from the log.

Anyways, it looks like it comes from the rendering...but how do I narrow it down more?
In case it helps, my project uses Baked Global Illumination and the default occlusion culling(not the one from Entities Graphics). I also tried using polybrush(which caused it to crash a lot), then I uninstalled the package..

snow badger
#

what version of unity / entities

uncut bone
#

Unity 2022.3.28f1, Entities(graphics, phisics, etc) 1.2.3

glass locust
#

Did you try to remove all your systems one by one to see? It's possible you caused some memory corruption through your code that eventually causes a crash

The fact it also happens when saving a script is peculiar, does that also happen before you've played at least once?

uncut bone
#

I doubt that's the cause, but I'll test that theory to be sure.

#

If I enter play mode and play for a short time and exit, nothing happnes. But of I play for a long time(say > 2 minutes) and then exit play mode, then it crashes

uncut bone
#

UPDATE: It wasn't any of my systems.
I suspected that it may have something to do with rendering and because this issue started shortly after I started environment design on a new subscene on the project... I thought of all the renderer's and materials in my subscenes, one by one went through them but found nothing out of the ordinary that might raise concerns of some sort. Except that I do use a toon shader for the game, and the shader would sometimes throw a warning to the console. The shader still works(even since I started the project) so I ignored it.

For some reason the crash came from the environment subscene...
To test this theory, I removed my environment subscene and then edited some of my scripts and saved them at the same time before going back into unity, after about 40 seconds-ish of recompilation, there wasn't any crash!
Then I added the subscene and edited and saved some scripts again and they did crash again afterabout 40 seconds-ish.

So, for now to prevent a crash I would simply disable(Toggle Off) the environment subscene before editing scripts.

I will give another update if the crash persists.

uncut bone
#

UPDATE: As long as my environment subscene is closed, the crash no longer occur on exit playmode or after saving a script.
However, the crash only occurs when I make lots of changes to a prefab with Auto Save enabled.
Or making multiple changes to a prefab and saving them each time(BTW, a regular gameobject non-entity prefab, it is likely the same with an entity prefab but I haven't tested it yet).

meager phoenix
#

Does it happen on latest unity 6 version too?