Unity crash after code compilation

Hello,
When Unity recompile (either because I modify a script or because I update a package), Unity almost always crash after the code compilation.

I already submited a bug report (Case 1352394).

=================================================================
    Native Crash Reporting
=================================================================
Got a UNKNOWN while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================

=================================================================
    Managed Stacktrace:
=================================================================
=================================================================
Received signal SIGSEGV
Obtained 10 stack frames
0x00007ff76f0abfee (Unity) TypeTree::~TypeTree
0x00007ff76e9258b8 (Unity) dynamic_array<TypeTree,0>::~dynamic_array<TypeTree,0>
0x00007ff76ff2e16f (Unity) std::_List_node<RecordedObject,void * __ptr64>::_Free_non_head<stl_allocator<std::_List_node<RecordedObject,void * __ptr64>,124,16> >
0x00007ff76ff302a2 (Unity) PropertyUndoManager::Flush
0x00007ff76fc16d03 (Unity) Application::TickTimer
0x00007ff7700492e5 (Unity) MainMessageLoop
0x00007ff77004d9ab (Unity) WinMain
0x00007ff771340d62 (Unity) __scrt_common_main_seh
0x00007ffae38354e0 (KERNEL32) BaseThreadInitThunk
0x00007ffae544485b (ntdll) RtlUserThreadStart

Any ideas where this come from? Am I the only one with this issue?

Have a nice day

Thanks for the report @Bastienre4 , we’ll have a look at it.

1 Like

BTW, if someone is interested, here’s the issue report Unity Issue Tracker - Crash on PropertyUndoManager::Flush after recompiling scripts

I think it underestimate the issue but it’s a good start :slight_smile:

1 Like

Any news on this topic?

Hi @Bastienre4 ,

We have a potential fix for the crashes but the devs are still investigating the root cause.

A potential workaround for now is to ensure that undo recordings are being flushed at the exact point it is required rather than waiting for the editor to flush and potentially introducing elements of another undo action.

In your project this can be achieved by adding Undo.IncrementCurrentGroup to Graph.cs
After Line 77. UndoUtility.RecordObjectComplete(this, UndoUtility.GetLastOperationNameOr(“Graph Change”));

1 Like

Thank you VERY much for keeping me updated AND providing a workaround.

Have a nice day.

1 Like

I tried your workaround.

Now it crash whenever I open a flow canvas window. :frowning:

7477906--919499--upload_2021-9-7_14-43-39.png

I got some additional information from the devs:

The good news is, that the fix was just approved. In the best case scenario, it could land in time for b12.

2 Likes

Awesome. Thanks for the heads up.

1 Like

You’re welcome! It’s not going to be in b12 but b13 seems likely.

1 Like

any update on this certain bug? because im still facing whenever i try to work with canvas.

When i go into play mode my game crashes and it says i have obtained 0 stack frames