Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EffContinue causes stack overflow #4096

Closed
Ubya-tech opened this issue Jun 22, 2021 · 5 comments
Closed

EffContinue causes stack overflow #4096

Ubya-tech opened this issue Jun 22, 2021 · 5 comments
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. completed The issue has been fully resolved and the change will be in the next Skript update. enhancement Feature request, an issue about something that could be improved, or a PR improving something. priority: medium Issues that are detrimental to user experience (prohibitive bugs or lack of useful implementation).

Comments

@Ubya-tech
Copy link

Description

on server restart skript crashes, but once the server has fully loaded i can do /sk reload all without issues

Steps to Reproduce

i simply have no idea, this bug happened a few weeks ago when we didn't do any changes to the plugins/paper. i tried updating paper and changing the skript.jar file witha fresh one in case it got corrupted somehow

Expected Behavior

it should load without errors

Errors / Screenshots

[05:03:53] [Server thread/INFO]: [Skript] All scripts loaded without errors. [05:03:53] [Server thread/WARN]: [Skript] Task #1385 for Skript v2.5.3 generated an exception java.lang.NoClassDefFoundError: Could not initialize class net.kyori.adventure.identity.Identities at net.kyori.adventure.identity.Identity.nil(Identity.java:49) ~[patched_1.16.5.jar:git-Paper-775] at net.kyori.adventure.audience.Audience.sendMessage(Audience.java:183) ~[patched_1.16.5.jar:git-Paper-775] at org.bukkit.craftbukkit.v1_16_R3.CraftServer.broadcast(CraftServer.java:1592) ~[patched_1.16.5.jar:git-Paper-775] at org.bukkit.craftbukkit.v1_16_R3.CraftServer.broadcast(CraftServer.java:1564) ~[patched_1.16.5.jar:git-Paper-775] at org.bukkit.Bukkit.broadcast(Bukkit.java:952) ~[patched_1.16.5.jar:git-Paper-775] at ch.njol.skript.Skript.adminBroadcast(Skript.java:1722) ~[?:?] at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:94) ~[?:?] at ch.njol.skript.effects.EffContinue.walk(EffContinue.java:63) ~[?:?] at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:88) ~[?:?] at ch.njol.skript.effects.EffContinue.walk(EffContinue.java:63) ~[?:?]
for the full error: https://pastebin.com/VBtHjpD3

Server Information

  • Server version/platform: paper-775
  • Skript version: 2.5.3

Additional Context

@TPGamesNL
Copy link
Member

Can you send your script(s)?

@TPGamesNL TPGamesNL added the waiting for reply The report needs a response from the reporter to determine course of action. label Jun 22, 2021
@Ubya-tech
Copy link
Author

Can you send your script(s)?

https://legacylands.altervista.org/skripts.rar

@TPGamesNL
Copy link
Member

This is the script causing it:

Script
on player join:
	if player has the permission "group.platinum":
		#set {claimexpireplat::%UUID of player%} to true
		stop
	else:
		set {_uuid} to uuid of player
		if {_uuid} isn't in {claimexpirelist::*}:
			add UUID of player to {claimexpirelist::*}
			send "player added to claim expire list" to console

#on skript start:
on load:
	loop {claimexpirelist::*}: # This loop, and the continue effect at the end of this trigger
		set {_player} to loop-value parsed as offline player
		if difference between {_player}'s last login and now is greater than 60 days:
			execute console command "/deleteallclaims %{_player}%"
			send "CLAIM REMOVED FOR %{_player}%" to console
			remove loop-value from {claimexpirelist::*}
			wait 10 seconds
		else:
			continue

command /joinlist:
	trigger:
		loop {claimexpirelist::*}:
			set {_player} to loop-value parsed as offline player
			send loop-value to player


command /onlinefor <offline player>:
    trigger:
        if difference between arg-1's last login and now is greater than 60 days:
            send "&aHis/Her Land must be freed"
        send "%arg-1% first joined the server %difference between arg-1's first login and now% ago." 
        send "Size of all players who have joined the server: %size of all offline players%" 
Since you were able to get your scripts to load later, can you tell me how many values the variable `{claimexpirelist::*}` has?

@Ubya-tech
Copy link
Author

This is the script causing it:
Script

on player join:
	if player has the permission "group.platinum":
		#set {claimexpireplat::%UUID of player%} to true
		stop
	else:
		set {_uuid} to uuid of player
		if {_uuid} isn't in {claimexpirelist::*}:
			add UUID of player to {claimexpirelist::*}
			send "player added to claim expire list" to console

#on skript start:
on load:
	loop {claimexpirelist::*}: # This loop, and the continue effect at the end of this trigger
		set {_player} to loop-value parsed as offline player
		if difference between {_player}'s last login and now is greater than 60 days:
			execute console command "/deleteallclaims %{_player}%"
			send "CLAIM REMOVED FOR %{_player}%" to console
			remove loop-value from {claimexpirelist::*}
			wait 10 seconds
		else:
			continue

command /joinlist:
	trigger:
		loop {claimexpirelist::*}:
			set {_player} to loop-value parsed as offline player
			send loop-value to player


command /onlinefor <offline player>:
    trigger:
        if difference between arg-1's last login and now is greater than 60 days:
            send "&aHis/Her Land must be freed"
        send "%arg-1% first joined the server %difference between arg-1's first login and now% ago." 
        send "Size of all players who have joined the server: %size of all offline players%" 

Since you were able to get your scripts to load later, can you tell me how many values the variable {claimexpirelist::*} has?

3628

@TPGamesNL
Copy link
Member

We should probably make EffContinue iterative instead of recursive:

protected TriggerItem walk(Event e) {
TriggerItem.walk(loop, e);
return null;
}

In the meanwhile, the stack size can be increased.

@TPGamesNL TPGamesNL added enhancement Feature request, an issue about something that could be improved, or a PR improving something. priority: medium Issues that are detrimental to user experience (prohibitive bugs or lack of useful implementation). bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. and removed waiting for reply The report needs a response from the reporter to determine course of action. labels Jun 22, 2021
@TPGamesNL TPGamesNL changed the title skript crashes on every server start/restart, but i can "/sk reload all" later and it works EffContinue causes stack overflow Jun 22, 2021
@TPGamesNL TPGamesNL added PR available Issues which have a yet-to-be merged PR resolving it completed The issue has been fully resolved and the change will be in the next Skript update. and removed PR available Issues which have a yet-to-be merged PR resolving it labels Jun 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. completed The issue has been fully resolved and the change will be in the next Skript update. enhancement Feature request, an issue about something that could be improved, or a PR improving something. priority: medium Issues that are detrimental to user experience (prohibitive bugs or lack of useful implementation).
Projects
None yet
Development

No branches or pull requests

3 participants