SkriptLang / Skript

Skript is a Spigot plugin which allows server admins to customize their server easily, but without the hassle of programming a plugin or asking/paying someone to program a plugin for them.
https://docs.skriptlang.org
GNU General Public License v3.0
1.06k stars 369 forks source link

Growing 2x2 (spruce) saplings causes the server to crash #7042

Open vilhu-github opened 1 week ago

vilhu-github commented 1 week ago

Skript/Server Version

[11:57:28 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[11:57:28 INFO]: [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[11:57:28 INFO]: [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[11:57:28 INFO]: [Skript] Server Version: 1.21.1-40-2fdb2e9 (MC: 1.21.1)
[11:57:28 INFO]: [Skript] Skript Version: 2.9.2 (skriptlang-github)
[11:57:28 INFO]: [Skript] Installed Skript Addons: None
[11:57:28 INFO]: [Skript] Installed dependencies: 
[11:57:28 INFO]: [Skript]  - Vault v1.7.3-b131
[11:57:28 INFO]: [Skript]  - WorldGuard v7.0.11-beta1+a801a9d

Bug Description

A player on my server tried to grow a 2x2 spruce tree using bone meal, which caused the server to crash. Investigated, and found it to be able to be reproduced.

Expected Behavior

2x2 spruce tree was supposed to grow without crashing the server

Steps to Reproduce

  1. place 2x2 spruce saplings
  2. fertilize them with bone meal

Errors or Screenshots

Skript error: https://paste.gg/p/anonymous/286c97415bdf42ac96a4702516488f51 Paper thread dump: https://paste.gg/p/anonymous/0eb4a395a6b04368a9af1f6de3f1d6ab

Other

Please let me know if there's any more information you need.

Agreement

Efnilite commented 1 week ago

I can't replicate this on current dev/patch with paper 1.21.1, do you have any active scripts?

vilhu-github commented 1 week ago

@Efnilite Sorry, it seems that I hadn't disabled the one script causing this issue!

Regardless, updated reproduction steps:

  1. Write a script with a listener for on grow event, specifically I'm using on grow of oak sapling. Then add a chance condition immediately after.
on grow of oak sapling:
    chance of 5%:
        # doesn't seem to matter what comes after
        # was able to reproduce with anything, such as
        broadcast "the server will now crash"

Despite the chance condition being at 5%, the crash will occur 100% of the time.

  1. Place 2x2 spruce saplings on the ground
  2. Fertilize them with bone meal (it will take a few, up to 6 in my experience)
  3. The server (Paper 1.21.1, latest stable version of Skript) will now crash, see error and thread dump.
GStudiosX2 commented 1 week ago

@Efnilite Sorry, it seems that I hadn't disabled the one script causing this issue!

Regardless, updated reproduction steps:

  1. Write a script with a listener for on grow event, specifically I'm using on grow of oak sapling. Then add a chance condition immediately after.
on grow of oak sapling:
    chance of 5%:
        # doesn't seem to matter what comes after
        # was able to reproduce with anything, such as
        broadcast "the server will now crash"

Despite the chance condition being at 5%, the crash will occur 100% of the time.

  1. Place 2x2 spruce saplings on the ground
  2. Fertilize them with bone meal (it will take a few, up to 6 in my experience)
  3. The server (Paper 1.21.1, latest stable version of Skript) will now crash, see error and thread dump.

I tested this on my server and it did indeed crash

Edit: not only did it crash my server I had to go into all the worlds and remove session.lock and I had to relogin to free up the port to be used again yay (might of been a one time thing) Edit 2: it doesn't matter what's in the event btw it just crashes

Efnilite commented 1 week ago

@Efnilite Sorry, it seems that I hadn't disabled the one script causing this issue!

Regardless, updated reproduction steps:

1. Write a script with a listener for `on grow` event, specifically I'm using `on grow of oak sapling`. Then add a `chance` condition immediately after.
on grow of oak sapling:
    chance of 5%:
        # doesn't seem to matter what comes after
        # was able to reproduce with anything, such as
        broadcast "the server will now crash"

Despite the chance condition being at 5%, the crash will occur 100% of the time.

3. Place 2x2 spruce saplings on the ground

4. Fertilize them with bone meal (it will take a few, up to 6 in my experience)

5. The server (Paper 1.21.1, latest stable version of Skript) will now crash, see error and thread dump.

Can confirm that your code (with dark oak sapling instead of oak sapling) and then growing a tree causes severe lag on latest dev/patch, this should definitely be checked out

Efnilite commented 2 days ago

Tested again, seems to not be present anymore. Tested with the 2.9.2 release and latest dev/patch. Can you try with latest dev/patch perhaps?

[19:58:18 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[19:58:18 INFO]: [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[19:58:18 INFO]: [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[19:58:18 INFO]: [Skript] Server Version: 1.21.1-12-1798e94 (MC: 1.21.1)
[19:58:18 INFO]: [Skript] Skript Version: 2.9.2 (selfbuilt-unknown)
[19:58:18 INFO]: [Skript] Installed Skript Addons: None
[19:58:18 INFO]: [Skript] Installed dependencies: None