CommandHelper

CommandHelper

46.5k Downloads

Stacktrace with sudo

LadyCailinBot opened this issue · 5 comments

commented

CMDHELPER-2667 - Reported by VergilPrime

This is a screenshot of my log:
http://i.imgur.com/P6bordf.jpg

This is the bulk of my scheduler code:
http://paste.thezomg.com/9181/36748995/

What you see highlighted is the error resulting from '_scheduler_start()' being called in main.ms. As you can see: 'Checking Schedule...' is being broadcast to the server properly, so we know that '_scheduler_check()' is being fired properly, however the stored code/string is not being fired.

Directly below the highlighted area, you can see the code being completed normally. This is caused by '_scheduler_check()' being called by a command instead of by the set_interval() started in '_scheduler_start()'. This suggests that there is no problem with '_scheduler_check()'.

This is the command copied directly from config.txt:

*:/forcecheck = >>>
include('includes/scheduler.ms')
_scheduler_check()
<<<

The last line in the screenshot shows '_scheduler_check()' not finding anything in the global register under 'scheduler.schedule', and executing without error. This is proper behavior, as running the code via command removed the scheduled item properly.

I'm not sure if/how this relates, but I am seeing the previously stored schedule reappearing on /reloadaliases, suggesting that '_scheduler_check()' is removing the item from the global register array, but not from the stored persistence value.

tl|dr:
set_interval(1000 * 60, scheduler_check()) fails partially

*:/forcecheck = >>>
include('includes/scheduler.ms') doesn't fail
_scheduler_check()
<<<

commented

Comment by VergilPrime

I just realized that McMyAdmin excludes stack traces from it's console, so I grabbed this from the server.log:

Here's the stacktrace:
�[0mjava.lang.NullPointerException
at com.laytonsmith.core.functions.Meta$sudo.exec(Meta.java:138)
at com.laytonsmith.core.Script.eval(Script.java:301)
at com.laytonsmith.core.Script.seval(Script.java:197)
at com.laytonsmith.core.functions.Meta$eval.execs(Meta.java:352)
at com.laytonsmith.core.Script.eval(Script.java:254)
at com.laytonsmith.core.Script.eval(Script.java:262)
at com.laytonsmith.core.functions.BasicLogic$ifelse.execs(BasicLogic.java:378)
at com.laytonsmith.core.Script.eval(Script.java:254)
at com.laytonsmith.core.functions.DataHandling$foreach.execs(DataHandling.java:570)
at com.laytonsmith.core.Script.eval(Script.java:254)
at com.laytonsmith.core.Script.eval(Script.java:262)
at com.laytonsmith.core.Procedure.execute(Procedure.java:179)
at com.laytonsmith.core.Procedure.cexecute(Procedure.java:149)
at com.laytonsmith.core.Script.eval(Script.java:224)
at com.laytonsmith.core.MethodScriptCompiler.execute(MethodScriptCompiler.java:1489)
at com.laytonsmith.core.MethodScriptCompiler.execute(MethodScriptCompiler.java:1454)
at com.laytonsmith.core.constructs.CClosure.execute(CClosure.java:136)
at com.laytonsmith.core.functions.Scheduling$set_interval$1.run(Scheduling.java:221)
at org.bukkit.craftbukkit.v1_5_R2.scheduler.CraftTask.run(CraftTask.java:67)
at org.bukkit.craftbukkit.v1_5_R2.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:344)
at net.minecraft.server.v1_5_R2.MinecraftServer.r(MinecraftServer.java:508)
at net.minecraft.server.v1_5_R2.DedicatedServer.r(DedicatedServer.java:223)
at net.minecraft.server.v1_5_R2.MinecraftServer.q(MinecraftServer.java:471)
at net.minecraft.server.v1_5_R2.MinecraftServer.run(MinecraftServer.java:403)
at net.minecraft.server.v1_5_R2.ThreadServerApplication.run(SourceFile:573)

commented

Comment by LadyCailin

This stack trace is from sudo(), but there is no use of sudo in your code you pasted, so these two aren't linked. Do you have the code that is using sudo? There is more data missing from the error message that would greatly simplify tracking this bug down. Can you get all the data from the error report please, and post it in its entirety?

commented

Comment by LadyCailin

Also, please make the title of your bugs a bit more descriptive ^_^

commented

Comment by VergilPrime

Sudo is in the text being stored and ran using eval() on line 40. The code is simply 'closure(sudo('/say I weeeen!'))'

commented

Comment by LadyCailin

I have possibly fixed this, though I'm still not clear what would cause this. Can you test, and get back to me if it works?