FlowCanvas Forums › Support › Crash when deleting nodes or removing connections.
Hi!
I noticed that in versions of Unity 2018.x and 2019.x, the editor will crash pretty often when deleting a node or a connection from a node. I can’t get this to reproduce 100% of the times but the error message I have in my Editor.log seems to say something about threads which would explain the difficulty to reproduce overall.
I think this happens most often when I am working in a Prefab (or Nested Prefab) view but I am not sure. I think this also happens when working on a graph at runtime directly in the scene hierarchy as well
This happens in both Unity for Windows and for Mac in my experience.
Here is what the last line in my Editor.log says:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
Obtained 14 stack frames. #0 0x0000010c6ef263 in GUIView::ProcessInputEvent(InputEvent&) #1 0x000001101dd4ea in -[GUIRenderView menuForEvent:] #2 0x007fff4ee95a14 in -[NSView _showMenuForEvent:] #3 0x007fff4ea30cdc in -[NSView rightMouseDown:] #4 0x000001101dcae2 in -[GUIRenderView rightMouseDown:] #5 0x007fff4e730367 in -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] #6 0x007fff4e72e667 in -[NSWindow(NSEventRouting) sendEvent:] #7 0x007fff4e5ce79e in -[NSApplication(NSEvent) sendEvent:] #8 0x000001101d92c1 in -[EditorApplicationPrincipalClass sendEvent:] #9 0x007fff4e5bc5c0 in -[NSApplication run] #10 0x007fff4e5abac8 in NSApplicationMain #11 0x000001101d9adf in EditorMain(int, char const**) #12 0x000001101d9de9 in main #13 0x007fff7cf553d5 in start Launching bug reporter [Unity Package Manager (Upm)] Parent process [44605] was terminated QObject: Cannot create children for a parent that is in a different thread. (Parent is QObject(0x7f9a4d6d1bd0), parent's thread is QThread(0x7f9a4d60b7d0), current thread is Thread(0x7f9a53801020) |
And here is what is shown in the Unity Bug Report window:
~/Library/Logs/Unity/upm.log
1 2 3 4 5 |
[2020-03-17T00:10:13.564Z][INFO] Starting Server [2020-03-17T00:10:13.570Z][INFO] Server started on port [56938] [2020-03-17T00:10:13.740Z][INFO] Health Request received [2020-03-17T00:13:49.271Z][ERROR] [Unity Package Manager (Upm)] Parent process [54227] was terminated |
Here is the content of my UPM manifest:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
{ "dependencies": { "com.unity.ext.nunit": "1.0.0", "com.unity.ide.rider": "1.1.4", "com.unity.ide.vscode": "1.1.4", "com.unity.postprocessing": "2.3.0", "com.unity.subsystemregistration": "1.0.6", "com.unity.test-framework": "1.1.11", "com.unity.textmeshpro": "2.0.1", "com.unity.timeline": "1.2.13", "com.unity.ugui": "1.0.0", "com.unity.xr.arcore": "3.0.1", "com.unity.xr.arfoundation": "3.0.1", "com.unity.xr.arkit": "3.0.1", "com.unity.xr.legacyinputhelpers": "2.0.8", "jp.keijiro.klak.vjui": "https://github.com/keijiro/VJUI.git#upm", "com.unity.modules.ai": "1.0.0", "com.unity.modules.androidjni": "1.0.0", "com.unity.modules.animation": "1.0.0", "com.unity.modules.assetbundle": "1.0.0", "com.unity.modules.audio": "1.0.0", "com.unity.modules.cloth": "1.0.0", "com.unity.modules.director": "1.0.0", "com.unity.modules.imageconversion": "1.0.0", "com.unity.modules.imgui": "1.0.0", "com.unity.modules.jsonserialize": "1.0.0", "com.unity.modules.particlesystem": "1.0.0", "com.unity.modules.physics": "1.0.0", "com.unity.modules.physics2d": "1.0.0", "com.unity.modules.screencapture": "1.0.0", "com.unity.modules.terrain": "1.0.0", "com.unity.modules.terrainphysics": "1.0.0", "com.unity.modules.tilemap": "1.0.0", "com.unity.modules.ui": "1.0.0", "com.unity.modules.uielements": "1.0.0", "com.unity.modules.umbra": "1.0.0", "com.unity.modules.unityanalytics": "1.0.0", "com.unity.modules.unitywebrequest": "1.0.0", "com.unity.modules.unitywebrequestassetbundle": "1.0.0", "com.unity.modules.unitywebrequestaudio": "1.0.0", "com.unity.modules.unitywebrequesttexture": "1.0.0", "com.unity.modules.unitywebrequestwww": "1.0.0", "com.unity.modules.vehicles": "1.0.0", "com.unity.modules.video": "1.0.0", "com.unity.modules.vr": "1.0.0", "com.unity.modules.wind": "1.0.0", "com.unity.modules.xr": "1.0.0" } } |
Let me know if you need more. Will try to import the plugin in an empty project too now to see if it might be related to one of the packages or some code in my existing project.
Cheers,
Oz
I can’t seem to be able to make it crash in a brand new project. I’m wondering if this might be in conflict with something in my project. The project I have is pretty big (6-7GB) with lots of different stuff in it. I don’t think I could share the entire project as it contains proprietary stuff.
Is there a way I could help you identify what the issue is here?
Hello there,
Hmm. It must be something in your project since that is the first time I’ve ever been reported that. It is very hard to tell what it could be however without knowing what your project contains and what might be affecting this behaviour. Do you have any 3rd party asset (or custom code) that might be affecting prefabs in any way? If you have any leads to what might be causing this I would be glad to help.
Let me know.
Thanks 🙂
Join us on Discord: https://discord.gg/97q2Rjh
Hey,
Thank you, I’m creating a parallel project and moving suspicious plugins or custom code one by one to see if I can reproduce this. Hopefully I can find the issue at hand but this is going to be quite a challenge I think. I will try to attach my Visual Studio/Rider to the Unity Editor process to see if I can capture an exception before it crashes too.
Stay safe out there you all.
Oz
Hey,
So I have taken a deeper look at this and I still can’t figure out why it is crashing sometimes but I did discovered something very strange. Whenever a FlowController
component exists within the same GameObject as an UnityEngine.UI.Image
component within a Nested Prefab setup (!thats the important part!), the graph starts behaving extremely strangely very reminiscent of the problems I would see before it would eventually crash.
I have made a example project as well as a video show the problem. Hopefully it can point to what is going on. I also went through the code with the debugger and noticed that there is a peculiar bug that happens when in this configuration when trying to add or delete nodes and node connections (which is usually where the crash occurs).
Specifically, in the NodeCanvas.Framework.Graph.AssignNodeID()
method of the ParadoxNotion\Assets\ParadoxNotion\CanvasCore\Framework\Runtime\Graphs\Graph.cs :
class at line 458
, sometimes the value of lastID
will be larger than the contents of the parsed
Node[]
list for some reason. I’m not sure if this is related or a separate issue.
In context:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
//Used above to assign a node's ID and list order int AssignNodeID(Node node, int lastID, ref Node[] parsed) { if ( !parsed.Contains(node) ) { lastID++; node.ID = lastID; parsed[lastID] = node; // <-------------------------- This array lookup right here returns an out of bounds exception sometimes. for ( var i = 0; i < node.outConnections.Count; i++ ) { var targetNode = node.outConnections<em class="d4pbbc-italic"></em>.targetNode; lastID = AssignNodeID(targetNode, lastID, ref parsed); } } return lastID; } |
I recommend you take a look at the video first and then you can get in touch with me and I can send you the demo project I have if you want to take a look at it on your side (I don’t want to distribute your plugin by linking the demo project publicly). I am also on the Discord channel, if it is any easier we can talk over there.
Here is the screen capture video that illustrates the glitch:
https://youtu.be/PPiRTGWTtts
Hey,
Thanks for the further information.
Something looks strange indeed. I would love to get a hold on the demo project you’ve made please. I’ve send you a PM in discord.
Thanks.
Join us on Discord: https://discord.gg/97q2Rjh