Yellow-Dog-Man / Resonite-Issues

Issue repository for Resonite.
https://resonite.com
135 stars 2 forks source link

Self-Connected Loops Completely Crash Resonite. #2750

Open AmasterAmaster opened 1 month ago

AmasterAmaster commented 1 month ago

Describe the bug?

I was just chilling in a world and a friend of mine saw a stray Range Loop node. I commented that it was unwise to connect it back on itself, but they did anyways. Nothing happened when they did the following things:

However, when they connected all of the outputs into the * input, Resonite crashed (infinite loop?). But... How???

Normally, nodes get red when connected like this, and even then, a pulse is needed to start the loop. So, unless I am unaware that connecting wires sends an impulse, this is a bug (which I am very sure this is).

Looking into this further, Async loops are not safe from this, as Resonite will freeze the same way, so this can't be an impulse, it has to be something else then...

To Reproduce

Spawn out any one of these nodes:

With any node brought out, connect the following wires like this:

Resonite will crash completely after these wires are connected.

Expected behavior

Loop nodes that directly connect to themselves, should just turn red and/or stop the node group from working (or to fail gracefully).

Screenshots

This is what the nodes should do: Self-Connected Loops 02

When connecting a loop node like this (or when following the reproduction steps), it will crash Resonite: Self-Connected Loops 01

Resonite Version Number

Beta 2024.8.5.1341

What Platforms does this occur on?

Windows

What headset if any do you use?

Index & Desktop

Log Files

Here is the log file. As this is a complete crash, it just gets cut off at the end of the file. ANDREW-SUPERPC - 2024.8.5.1341 - 2024-08-10 15_24_34.log

Additional Context

From a search around GitHub, I found the following issues, along with my thoughts about them compared to this issue:

Reporters

AmasterAmaster

shiftyscales commented 1 month ago

This appears to be a duplicate to the linked issue #1677, @AmasterAmaster. At the moment there is no protection for infinitely executing node graphs in ProtoFlux, so creating a loop like this will cause this issue to occur. Thanks for the report.

TisFoolish commented 1 month ago

I don't think this is a duplicate as https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/1677 requires a call to happen, while OP states that this only requires connecting wires