Big methods crash the engine

Create issue
Issue #36 resolved
Fabian Maurer created an issue

Using MobTalker 0.6.2 and MTS 3.0.3.

The following code crashes the engine (and Minecraft) when loading the world:

function Test()
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
    SAY(""..player.."","");
end

Error:

java.lang.IllegalArgumentException: Stack size exceeds maximum 267
    at com.google.common.base.Preconditions.checkArgument(Preconditions.java:125)
    at net.mobtalker.mobtalkerscript.v3.MtsFunctionPrototype.<init>(MtsFunctionPrototype.java:62)
    at net.mobtalker.mobtalkerscript.v3.compiler.FunctionState.createPrototype(FunctionState.java:511)
    at net.mobtalker.mobtalkerscript.v3.compiler.FunctionState.createPrototype(FunctionState.java:518)
    at net.mobtalker.mobtalkerscript.v3.compiler.MtsCompiler.compile(MtsCompiler.java:717)
    at net.mobtalker.mobtalkerscript.v3.compiler.MtsCompiler.loadChunk(MtsCompiler.java:158)
    at net.mobtalker.mobtalker2.script.CompilerService$CompileTask.call(CompilerService.java:114)
    at net.mobtalker.mobtalker2.script.CompilerService$CompileTask.call(CompilerService.java:89)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

Comments (5)

  1. mezzodrinker

    The issue is resolved with b32c6baba553. It's no longer possible to reproduce this with the latest commit of MobTalkerScript.

    With MobTalker2, however, this is a different story, since it still uses MTS 3.0.3, which does not contain the above-mentioned fix yet. Created an issue over on the MobTalker2 tracker for this: MobTalker2/mobtalker2#99

  2. Log in to comment