#Crash from `Unity.Entities.RuntimeContentManager` during application exit

1 messages · Page 1 of 1 (latest)

brittle patio
#

A while ago I upgraded to Unity 2022.3.6f1, Burst 1.8.8, Entities 1.0.14. From that point, my application began crashing on exit. Since then I've tried upgrading further to Unity 2022.3.8f1.

The crash logs haven't given me any information that I can usefully discern, but have been attached anyway.

So what I did was breakpoint the Application.quitting callback and step through code execution, one step at a time, until the crash occurred 😅 It ended up in Unity.Entities.RuntimeContentManager, specifically the Cleanup method, and more specifically the call to Resources.UnloadUnusedAssets();, which I couldn't dig into any further.

I could see that cleanup was dealing with some shared static business, so thought maybe there was something wrong with my usage of shared statics (maybe left uninitialised or something) that could be causing it. So I commented out ALL of my shared static definitions and got code compiling again, but the crash persisted.

Then, considering that it was a Resources.Unload call crashing, I thought maybe my Resources (I use a couple of them for application-lifetime manager objects) were problematic somehow. So I deleted them all from the project - game's now got lots of exceptions being thrown - but the same crash still persisted on Alt+F4.

Now, without any shared statics or resources (except 3rd-party / plugin ones), I'm left without any leads.

Has anybody else seen this error? Any further suggestions on how I can try to get to the bottom of it?

One further thing I'll note is that this crash is happening on the main menu, which hasn't even created an ECS world yet. I create my the ECS world myself instead of using the default Unity one, and that's driven from a MonoBehaviour in the match scene which has never come into existence when I'm doing this test crash from the menu.

#

Just noting that I tried deleting all the Resources folders in my project, including for 3rd party plugins, and the situation didn't change. I checked my non-Unity packages and there are none with Resources folders that use Entities so I left those alone.

brittle flax
#

You don't also use addressables in your project do you?

brittle patio
#

I do

brittle flax
#

i remember Resources.UnloadUnusedAssets can cause issues with addressables

#

if used at a bad time

brittle patio
#

Hmm, well I can't really control the timing in this case, since it's the Entities.RuntimeContentManager 🤔 And I've been using addressables since the beginning of the project, so it'd be strange that this recently popped up.

brittle flax
#

addressables does specifically support UnloadUnusedAssets, but my vague memory is if you use it when cleaning up asset bundles causes issues

#

either way it's probably a bug

#

but maybe calling it yourself early could resolve it, not sure

brittle patio
#

I tried calling it on Application.quitting. That call had no error, but the crash proceeded afterwards anyway

brittle flax
#

bugger

brittle patio
#

I'm going backwards to try and replicate this from a blank project, will see what set of changes makes the issue start occurring

#

I suppose Application.quitting is still too early since nothing had actually been destroyed yet 🤔