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.08k stars 373 forks source link

you can crash the server with the block of.. syntax #5243

Closed RayBytes closed 1 year ago

RayBytes commented 1 year ago

Skript/Server Version

[11:37:58 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[11:37:58 INFO]: [Skript] Skript's documentation can be found here: https://skriptlang.github.io/Skript
[11:37:58 INFO]: [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[11:37:58 INFO]: [Skript] Server Version: git-Purpur-1845 (MC: 1.19.2)
[11:37:58 INFO]: [Skript] Skript Version: 2.6.4
[11:37:58 INFO]: [Skript] Installed Skript Addons: 
[11:37:58 INFO]: [Skript]  - skript-placeholders v1.5.2 (https://github.com/APickledWalrus/skript-placeholders)
[11:37:58 INFO]: [Skript]  - Skellett v2.0.7 (https://forums.skunity.com/resources/skellett.24/)
[11:37:58 INFO]: [Skript]  - DiSky v4.1.1
[11:37:58 INFO]: [Skript]  - MongoSK v2.3.0 (https://github.com/Romitou/MongoSK)
[11:37:58 INFO]: [Skript]  - skript-reflect v2.3 (https://github.com/TPGamesNL/skript-reflect)
[11:37:58 INFO]: [Skript]  - Reqn v1.2.1
[11:37:58 INFO]: [Skript]  - skRayFall v1.9.28 (https://sk.rayfall.net/)
[11:37:58 INFO]: [Skript]  - SkriptJSON v1.0.0
[11:37:58 INFO]: [Skript]  - SkBee v2.5.1 (https://github.com/ShaneBeee/SkBee)
[11:37:58 INFO]: [Skript] Installed dependencies: 
[11:37:58 INFO]: [Skript]  - Vault v1.7.3-b131
[11:37:58 INFO]: [Skript]  - WorldGuard v7.0.7+216b061

Bug Description

Sending code like: !send block of diamond, block of diamond, block of diamond, block of diamond, block of diamond, block of diamond will literally crash the server. Kinda funny.

Expected Behavior

Its supposed to NOT crash!

Steps to Reproduce

!send block of diamond, block of diamond, block of diamond, block of diamond, block of diamond, block of diamond

Errors or Screenshots

image

Other

No response

Agreement

AyhamAl-Ali commented 1 year ago

I don't recall Skript having an expression block of can you check if that's an addon's syntax? if so then it's not a Skript issue.

Otherwise, try to only send 1 block of and see if that crashes the servers send block of diamond to me

RayBytes commented 1 year ago

From what I see its vanilla skript syntax.

send block of diamond to me does not lag or crash the server.

bluelhf commented 1 year ago

I don't recall Skript having an expression block of can you check if that's an addon's syntax? if so then it's not a Skript issue.

Otherwise, try to only send 1 block of and see if that crashes the servers send block of diamond to me

He's referring to the alias, I believe.

@RayBytes Can you send the entire error, i.e. all of the red text in console?

AyhamAl-Ali commented 1 year ago

Can't find that expression, I may have missed it or as bluelhf said, it's part of Aliases block of diamond/emerald etc. but anyways, Skript is known to have issues with parsing long lines, your code was kinda too long for Skript, see #1117 and this is probably the reason.

If you could try the following:

Also what's the server's memory size?

RayBytes commented 1 year ago

Can't find that expression, I may have missed it or as bluelhf said, it's part of Aliases block of diamond/emerald etc. but anyways, Skript is known to have issues with parsing long lines, your code was kinda too long for Skript, see #1117 and this is probably the reason.

If you could try the following:

  • Try !send diamond block, diamond block, diamond block, diamond block, diamond block see if that crashes the server
  • Try the same code without any addons

Also what's the server's memory size?

Memory size is 10GB. !send diamond block, diamond block, diamond block, diamond block, diamond block does not lag or crash the server... Which is interesting.

Trying this code on:

These conditions also crash the server. Reloading the file with this code in it also causes a crash or death.

RayBytes commented 1 year ago

I don't recall Skript having an expression block of can you check if that's an addon's syntax? if so then it's not a Skript issue. Otherwise, try to only send 1 block of and see if that crashes the servers send block of diamond to me

He's referring to the alias, I believe.

@RayBytes Can you send the entire error, i.e. all of the red text in console?

Sure!

[13:14:48 ERROR]: --- DO NOT REPORT THIS TO PURPUR - THIS IS NOT A BUG OR A CRASH  - git-Purpur-1845 (MC: 1.19.2) ---
[13:14:48 ERROR]: The server has not responded for 10 seconds! Creating thread dump
[13:14:48 ERROR]: ------------------------------
[13:14:48 ERROR]: Server thread dump (Look for plugins here before reporting to Purpur!):
[13:14:48 ERROR]: ------------------------------
[13:14:48 ERROR]: Current Thread: Server thread
[13:14:48 ERROR]:       PID: 27 | Suspended: false | Native: false | State: RUNNABLE
[13:14:48 ERROR]:       Stack:
[13:14:48 ERROR]:               java.base@17.0.2/java.util.HashMap.hash(HashMap.java:338)
[13:14:48 ERROR]:               java.base@17.0.2/java.util.HashMap.computeIfAbsent(HashMap.java:1191)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parse_i(SkriptParser.java:1254)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:224)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parseStatic(SkriptParser.java:199)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.entity.EntityData.parseWithoutIndefiniteArticle(EntityData.java:412)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.entity.EntityType.parse(EntityType.java:158)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.entity.EntityType$2.parse(EntityType.java:51)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.entity.EntityType$2.parse(EntityType.java:47)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.registrations.Classes.parseSimple(Classes.java:444)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.registrations.Classes.parse(Classes.java:473)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parseSingleExpr(SkriptParser.java:584)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parseExpression(SkriptParser.java:811)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.TypePatternElement.match(TypePatternElement.java:126)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.PatternElement.matchNext(PatternElement.java:54)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.LiteralPatternElement.match(LiteralPatternElement.java:59)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.PatternElement.matchNext(PatternElement.java:54)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.TypePatternElement.match(TypePatternElement.java:121)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.SkriptPattern.match(SkriptPattern.java:58)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parse_i(SkriptParser.java:1255)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:224)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:177)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parseSingleExpr(SkriptParser.java:522)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parseExpression(SkriptParser.java:753)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.TypePatternElement.match(TypePatternElement.java:126)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.SkriptPattern.match(SkriptPattern.java:58)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parse_i(SkriptParser.java:1255)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:224)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:177)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parseSingleExpr(SkriptParser.java:522)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parseExpression(SkriptParser.java:811)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.TypePatternElement.match(TypePatternElement.java:126)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.PatternElement.matchNext(PatternElement.java:54)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.LiteralPatternElement.match(LiteralPatternElement.java:59)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.PatternElement.matchNext(PatternElement.java:54)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.TypePatternElement.match(TypePatternElement.java:121)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.SkriptPattern.match(SkriptPattern.java:58)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parse_i(SkriptParser.java:1255)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:224)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:177)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parseSingleExpr(SkriptParser.java:522)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parseExpression(SkriptParser.java:753)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.TypePatternElement.match(TypePatternElement.java:126)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.PatternElement.matchNext(PatternElement.java:54)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.LiteralPatternElement.match(LiteralPatternElement.java:59)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.PatternElement.matchNext(PatternElement.java:54)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.TypePatternElement.match(TypePatternElement.java:121)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.SkriptPattern.match(SkriptPattern.java:58)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parse_i(SkriptParser.java:1255)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:224)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:177)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parseSingleExpr(SkriptParser.java:522)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parseExpression(SkriptParser.java:811)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.TypePatternElement.match(TypePatternElement.java:126)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.PatternElement.matchNext(PatternElement.java:54)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.LiteralPatternElement.match(LiteralPatternElement.java:59)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.PatternElement.matchNext(PatternElement.java:54)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.TypePatternElement.match(TypePatternElement.java:121)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.SkriptPattern.match(SkriptPattern.java:58)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parse_i(SkriptParser.java:1255)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:224)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:177)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parseSingleExpr(SkriptParser.java:522)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parseExpression(SkriptParser.java:753)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.TypePatternElement.match(TypePatternElement.java:126)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.OptionalPatternElement.match(OptionalPatternElement.java:43)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.PatternElement.matchNext(PatternElement.java:54)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.LiteralPatternElement.match(LiteralPatternElement.java:59)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.PatternElement.matchNext(PatternElement.java:54)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.TypePatternElement.match(TypePatternElement.java:121)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.PatternElement.matchNext(PatternElement.java:54)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.LiteralPatternElement.match(LiteralPatternElement.java:59)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.PatternElement.matchNext(PatternElement.java:54)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.OptionalPatternElement.match(OptionalPatternElement.java:46)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.SkriptPattern.match(SkriptPattern.java:58)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parse_i(SkriptParser.java:1255)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:224)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:177)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parseSingleExpr(SkriptParser.java:522)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parseExpression(SkriptParser.java:753)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.TypePatternElement.match(TypePatternElement.java:126)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.PatternElement.matchNext(PatternElement.java:54)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.LiteralPatternElement.match(LiteralPatternElement.java:59)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.PatternElement.matchNext(PatternElement.java:54)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.OptionalPatternElement.match(OptionalPatternElement.java:46)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.PatternElement.matchNext(PatternElement.java:54)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.LiteralPatternElement.match(LiteralPatternElement.java:59)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.ChoicePatternElement.match(ChoicePatternElement.java:63)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.GroupPatternElement.match(GroupPatternElement.java:47)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.patterns.SkriptPattern.match(SkriptPattern.java:58)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parse_i(SkriptParser.java:1255)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:224)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:177)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.lang.Effect.parse(Effect.java:76)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.command.Commands.handleEffectCommand(Commands.java:280)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.command.Commands$3$1.call(Commands.java:220)
[13:14:48 ERROR]:               Skript-2.6.4 (1).jar//ch.njol.skript.command.Commands$3$1.call(Commands.java:217)
[13:14:48 ERROR]:               org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftFuture.run(CraftFuture.java:88)
[13:14:48 ERROR]:               org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:483)
[13:14:48 ERROR]:               net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1500)
[13:14:48 ERROR]:               net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:486)
[13:14:48 ERROR]:               net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1424)
[13:14:48 ERROR]:               net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1194)
[13:14:48 ERROR]:               net.minecraft.server.MinecraftServer.lambda$spin$1(MinecraftServer.java:310)
[13:14:48 ERROR]:               net.minecraft.server.MinecraftServer$$Lambda$4389/0x0000000801513a10.run(Unknown Source)
[13:14:48 ERROR]:               java.base@17.0.2/java.lang.Thread.run(Thread.java:833)
bluelhf commented 1 year ago

Looks like the expression is simply too complicated for Skript to parse. You'll probably want to split it into multiple lines; perhaps you could use a list and add each item to the list on a separate line?

We're always looking for ways to optimise the parser. This seems to be something we haven't gotten to, though. @TPGamesNL, you seem to be the parser optimisation expert, is this something you'd like to look into?

kiip1 commented 1 year ago

TP's PR #5133 will optimize this, besides this is probably caused by Minehut having OOM killer enabled. Having only 1 GB of memory isn't smart anyways.

Fusezion commented 1 year ago

I mean you can use it on minehut just make sure to add () image I do most of my testing on minehut so 1GB while bad is still functional on there

TheLimeGlass commented 1 year ago

Duplicate https://github.com/SkriptLang/Skript/issues/5122

RayBytes commented 1 year ago

TP's PR #5133 will optimize this, besides this is probably caused by Minehut having OOM killer enabled. Having only 1 GB of memory isn't smart anyways.

Like I said before I also tried it with a server with 10GB not on minehut and it crashed. I only tested it on minehut because I had no free server with no addons besides Skript.

kiip1 commented 1 year ago

TP's PR #5133 will optimize this, besides this is probably caused by Minehut having OOM killer enabled. Having only 1 GB of memory isn't smart anyways.

Like I said before I also tried it with a server with 10GB not on minehut and it crashed. I only tested it on minehut because I had no free server with no addons besides Skript.

Interesting, I can't imagine the server being brought to its knees by that amount of expressions. I can only reproduce with ~100 expressions at which point it takes 35 seconds to complete. Let's hope it will be resolved with the upcoming PR.