Closed LoganLilypad closed 4 years ago
This could be a bug in Skript. What scripts are you running? Does this happen without them? Also, if you have addons installed, try without them.
Nope as I said, its just plain Skript, no addons or anything, I just booted up the server without touching anything
Oops, missed no other plugins part. With no scripts either, this is puzzling. Please try removing Skript plugin folder and reinstalling Skript jar; issues like this are sometimes caused by corrupted files.
Has there been a fix for this? I tried paperspigot 1.15.1 (paper-48) with no other plugins, fresh install for skript 2.5 & 2.4.1 with the same issue.
@soulstriker23 Debugging this issue is hard because all the information we get from the stack trace roughly translates to
We were about to run out of space on the stack because something regex-related recursed far too deeply.
So, basically, we have little information to work with, and there isn't a fix yet because of that.
@bensku
Unfortunately, Java's builtin regex support has problems with regexes containing repetitive alternative paths (that is, (A|B)*). This is compiled into a recursive call, which results in a StackOverflow error when used on a very large string. A possible solution is to rewrite your regex to not use a repititive alternative.
Maybe this would help?
Applying this advise to current parser might not be possible, unfortunately.
Applying this advise to current parser might not be possible, unfortunately.
That would mean this is quite literally impossible to fix unless we start asking whoever maintains OpenJDK to improve Java's regex parser itself?
That's reassuring.
Sorry, I was unclear. I meant that it is possible that there is no way to fix this issue with current Skript parser. We'll try to avoid regex parsing in future works.
OP can always increase their stack size, it's more of a problem with how recursive the parser is with complex patterns that causes the trouble
OP can always increase their stack size, it's more of a problem with how recursive the parser is with complex patterns that causes the trouble
Is that something the user can do to make skript actually work without it being disabled?
@soulstriker23 If the stack size is too small, Skript won't have enough space on the stack to do the regex, resulting in this error. The user can modify their stack size with the -Xss
JVM argument, which should resolve the problem provided it's set to a high enough value.
I do not recommend increasing stack size, because it may lead to the server running out of memory. A better workaround is to not have overly long lines. Avoiding installation and/or usage of addons with very complex syntaxes might also help, but I haven't tested it.
@bensku Okay, that make sense. I tried it and it works sometimes. But then tried it again with fresh install and putting the skript.jar with no skript written (just the disabled default ones) it gives the massive error and disables skript completely so I can't do anything with it. Any reason why it would just randomly work and not? Only have skquery & skript installed.
Without scripts? There are a few possibilities:
@LoganLilypad Are you, by chance, running a version of Paper that's not officially supported? A legacy build of Paper, that is..?
Well, @bensku
I downloaded the 2.4.1 skript.jar from the releases page.
Running PaperSpigot 1.15.1 Build#62 (latest) & I also removed skquery.
Starts to load then sends this whole error section and at the end says "disabled"
I have very similar issue:
[20:45:48 ERROR]: Error occurred while enabling Skript v2.4.1 (Is it up to date?)
java.lang.StackOverflowError: null
at java.lang.Character.codePointAt(Unknown Source) ~[?:1.8.0_241]
<snipped>
at java.util.regex.Pattern$GroupHead.match(Unknown Source) ~[?:1.8.0_241]
Server: Paper 70 (Minecraft 1.15.2), Skript version 2.4.1, one Skript enabled:
# Hráč se připojí
on join:
# Nejpre vyčistíme inventář
set inventory of player to air
# Do 9. slotu vložíme kompas pro výběr serveru
set {_selector} to compass named "&2&lVolba serveru &7(Pravé myšítko)" with lore "&5Klikni pravým myšítkem pro výběr serveru"
set slot 8 of player to {_selector}
# Do 5. slotu vložíme knihu pro pravidla
set {_pravidla} to book named "&4&lPravidla &7(Pravé myšítko)" with lore "&5Klikni pravým myšítkem k zobrazení pravidel"
set slot 4 of player to {_pravidla}
This is some serious issue as I was gonna test out if that skript is going to work (Yes, I made testing server just for Skripts to be tested before it is going to be deployed into main server). I cannot since Skript is having bad time enabling itself. I don't know, can't it connect to Internet?
@RXJpaw Are you therefore suggesting that this is fixed in Java 13, Erik? Oracle Java download still claims Java 8 is latest version. From IntelliJ IDEA I know that that's not true, since there is JDK version 11 used.
Script made by @Polda18 doesn't look terribly complex. Can someone reproduce this with it? If yes, does having addons have any effect on it? Can anyone reproduce on Java 11 or newer version?
Dropping support for Java 8 has been in plans for a while (see #1321), but continued support from OpenJDK vendors has made it difficult. If this is indeed a bug in Java 8, I'm not terribly interested in working on it.
@bensku Tried, it works. Looks like it really doesn't work on Java 8 or older.
Here is a bit of info regarding this:
I run this on java 8, no issues. I'm using Oracle's Java 8, Im not sure if OpenJDK is the same or not.
Another user had the same issue. I built them a fresh build (using java 8), they were able to run it without any errors.
I can't reproduce these on OpenJDK 8 or 11 either. Some generic tips that might help:
@ShaneBeee, @bensku - I was using Oracle's Java 8, it Skript didn't work. And Update Scheduler didn't announce any new update. Strange. With OpenJDK v13, it works.
Stack traces posted here do not contain any references to Skript, which makes debugging hard. Moreover, we've failed to reproduce this with both Java 8 and 11, including Oracle's JDK 8. I do not consider this to be worth investigating more with our limited resources.
I'll reconsider this if someone provides a stack trace with Skript methods and/or example I can reproduce this with on both Java 8 and 11.
To people having this issue: update to a newer Java version. It is likely going to help, even though I have no idea why.
I managed to isolate this bug to https://github.com/SkriptLang/Skript/blob/master/src/main/java/ch/njol/skript/config/Node.java#L132, and the code in question is being called by aliases system. I'm not sure why it would affect some people but not others, but replacing the regex is should be reasonably easy.
That's great! Is this something that can be fixed on our end, or will you update the 2.4.1 later on?
This is a major issue.
What should someone encountering this issue increase their stack size to?
Updating to Java 11 or 14 might help with this, but increasing stack size manually is not recommended.
Hello, I'm not sure what I'm saying, but the many times I've seen people with this error, the majority have been Java 32-bit. Do you think it could be related to that?
that's actually a good point, the default stack size is lower on 32bit which could explain at least part of this error. what do you think @bensku
@Pikachu920 The issue has been consistently solved by updating Java from 8 to something newer, usually 11 or 14. Whether they also upgraded to 64bit at the same time, I'm not sure. If I have some time I'll experiment with 32 and 64-bit versions of Java 8 and 11.
@bensku It seems like this is mainly caused by users not using 64-bit Java... Maybe it would be a good idea to add a warning if users run Skript on 32-bit Java?
hello good, also the same error happens to me. Do you know how to solve it?
hello good, also the same error happens to me. Do you know how to solve it?
Hello, this error has always been solved by updating Java to 64bits.
hola bien, también me pasa el mismo error. sabes como resolverlo?
Hola, este error siempre se ha solucionado actualizando Java a 64 bits.
I have a 64-bit PC, but the plugin does not run anyway. Should I do something else?
You may have a 64-bit PC, but you've probably downloaded 32-bit Java. Try downloading it again here, hopefully it will work! https://www.java.com/en/download/manual.jsp
Screenshot:
You may have a 64-bit PC, but you've probably downloaded 32-bit Java. Try downloading it again here, hopefully it will work! https://www.java.com/en/download/manual.jsp
Screenshot:
It worked thanks a lot for the help.
Question
I am currently trying to run a local test server with Skript and while trying to do so, Skript spits out an error. I am currently running the latest stable Spigot build along with the latest Skript build, even tried running Paper Spigot with no luck and finally tried running it on another computer.
There are no other plugins being ran on the server except Skript Skript error taken from logs https://pastebin.com/raw/dKiCK6Vi
Just wondering if this is just me doing something wrong or if its an actual issue