This is essentially a copy of the issue described in [Content removed] which was closed without resolution. We are also seeing this on creation of a UNiagaraScript object. Our repro steps are as following and is 100% for at least one specific Niagara System asset, but certainly not all:
Open problematic Niagara System asset.
Disable any one of the three emitters with the check box at the top.
Observe failed assertion
I have followed some of the debugging hints provided in the previous thread, but no progress yet.
I should also mention that when opening the asset I get this. Not sure if this is related or not:
I’ve reached out to the dev team, and they would be very grateful for a repro. Are you able to provide this - maybe using the suspect asset is a new level or similar?
Looking at the callstack above it’s hitting an assert, can you post the assert message? If in the editor it should be in the log, or if in the debugger check the output window. The assert message from the NiagaraStackEntry is an indication of a different problem, but the surrounding code handles it without issue, so it’s unrelated. The callstack above is more concerning because it’s happening in the core uobject code, but it’s not clear what the actual issue is.
No luck with isolating a repro. However, I did manage to track down why the object in question was added to the root set in the first place. Turns out we have a custom class deriving from UDeveloperSettings that hard references a blueprint. This blueprint in turn references the Niagara system among other things. Early when booting the editor the default constructed developer settings will get added to the root set along with everything it references. I have attempted to fix this on our end by instead soft referencing the BP class and loading it on spawn instead. This seems to have resolved the crash at least .
In our case the early load of those assets might not have been intentional, so this was probably good to take care of. But whether intentional or not it probably shouldn’t crash the editor, so might be worth looking into. I mean the original setup we had is still valid, right? As far as I know, the only issue is we’ve had with it is the crash in the Niagara editor. The fact that I can’t reproduce this with the setup described above might mean that it has already been fixed in one of the patch versions (which we do not have afaik).
You are correct, it definitely should not crash the editor. I’ve added an issue to try to figure out a reproduction case for this so that I can be fixed in a future release. Thanks for your help on this.
Just some extra info I found after reading @anonymous-edc post:
I am using NDC based ammo from C++ and was experiencing the crash leaving me unable to disable an emitter to test others in the system. “…that hard references a blueprint…” made me think about how I was handling the asset in my code. Moving the following from the Constructor to BeginPlay resolved the issue for me:
So just assigning the UNiagaraDataChannelAsset is causing the “root lock”. I am guessing that this should not be the case, but Niagara initializes in an “offset” fashion that has required other code to execute no sooner than BeginPlay… I just started implementing NDC so my knowledge is limited.
FWIW
P.S.
Kind of a marginal response if I don’t include these 2 things: