Skip to content

Infinite loops/complex functions can crash the game when they reach the statement limit. #28

@Artikae

Description

@Artikae

Issue type:

  • 🐛 Bug

Short description:

The game crashes when a script reaches the statement limit. Aka, infinite loops crash the game.

Steps to reproduce the problem:

  1. Create a script containing the following function
function oops() {
    while (true) {}
}
  1. Create a variable card that calls Apply0 on oops
  2. Place the resulting variable card in a display (and put the card for oops in a connected Variable Store)
  3. Observe that the game has crashed

Note: When I reload the world after the crash, I can't necessarily get the crash to occur again with the same script in the same network. It still produces the exception, but it doesn't seem to bring down the game. Repeating the reproduction steps again in a new location with a new script still crashes the game though.

Expected behaviour:

The function would produce an error of some sort, but would not crash the server. I assume that was why the statement limit was used in the first place.


Versions:

  • This mod: 1.0.8
  • Minecraft: 1.20.1
  • Mod loader version: Forge 47.3.0

Also installed as dependencies:

  • Integrated Dynamics: 1.24.3
  • CommonCapabilities: 2.9.4
  • Cyclops Core: 1.19.6

Log file:

https://pastebin.com/0FUg925W

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions