dlr-gtlab / intelligraph-module

A Node-based Workflow Engine for GTlab
1 stars 0 forks source link

Graph execution sometimes stuck in infinite loop #203

Closed rainman110 closed 2 weeks ago

rainman110 commented 3 weeks ago

I have an intelligraph with only dummy nodes. These nodes are not shown in the graph. So far okay.

Now I add other non-dummy nodes (e.g. double input and double display). When I now connect these and execute the graph, GTlab hangs forever.

Update: This is not related to dummy nodes but can be reproduced with out it as well. See comment below https://github.com/dlr-gtlab/intelligraph-module/issues/203#issuecomment-2470445020

rainman110 commented 3 weeks ago

It seems, that this for loop

https://github.com/dlr-gtlab/intelligraph-module/blob/34515014b6850ab3d780585a2a010100f500bedc/src/intelli/private/graphexecmodel_impl.h#L1415

keeps iterating forever.

rainman110 commented 3 weeks ago

I don' understand the logic of the loop. After each iteration, the loop iterator is set to the beginning. The node array is not necessarily shrinking, so here's our endless loop.

mariusalexander commented 2 weeks ago

I dont see why dummy nodes should cause an error here since these should not be registered as nodes in the graph. But indeed the loop looks off, Ill investigate

rainman110 commented 2 weeks ago

I am on it. In fact no dummy nodes are required. Here are some steps to reproduce:

  1. Create a new intelli-graph
  2. Set the graph on auto-execution (i.e. press play button)
  3. Create a "Bool Input" node
  4. Create a "logic display" node
  5. Connect them
  6. Toggle the bool input

Now, I am stuck in a infinite for loop

rainman110 commented 2 weeks ago

https://github.com/user-attachments/assets/9673c34a-0aec-460d-a486-fb875f6474ba

mariusalexander commented 2 weeks ago

I can reproduce the issue. Thank you!

rainman110 commented 2 weeks ago

I was thinking, that mutating a vector while iterating it is UB. But chatgpt convinced me otherwise, so your new approach seems to be valid.

mariusalexander commented 2 weeks ago

I was thinking, that mutating a vector while iterating it is UB. But chatgpt convinced me otherwise, so your new approach seems to be valid.

You have some confidence in ChatGPT😜