dan200 / ComputerCraft

Programmable Computers for Minecraft
Other
980 stars 198 forks source link

java.lang.ArrayIndexOutOfBoundsException in Lua script #141

Closed NexAdn closed 8 years ago

NexAdn commented 8 years ago

Well, I can just say that this error occurs every time I start my script. It always prints me

java.lang.ArrayIndexOutOfBoundsException

Being a Java Exception it should be an error of CC itself. This is the script that made the error occur: https://github.com/NexAdn/cpm/blob/development/cpm.lua

I'm using CC1.79

dan200 commented 8 years ago

This script is far too long for me to use. Please try to narrow down the code to the line which is causing the error.

On 10 September 2016 at 15:52, NexAdn notifications@github.com wrote:

Well, I can just say that this error occurs every time I start my script. It always prints me

java.lang.ArrayIndexOutOfBoundsException

Being a Java Exception it should be an error of CC itself. This is the script that made the error occur: https://github.com/NexAdn/cpm/blob/development/cpm.lua

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/dan200/ComputerCraft/issues/141, or mute the thread https://github.com/notifications/unsubscribe-auth/AB3bbEYgfOc8OzB_JbhdIkNdEbVoZLRoks5qosQ9gaJpZM4J5vPc .

SquidDev commented 8 years ago

Generally this means there is a stack overflow in your Lua code: put this on the CC forums for debugging help. I think the LuaJ bug exists because there are no bounds checks in the debug library: they are meant to be called in the LuaThread's stack but the debug library's method gets called first.

NexAdn commented 8 years ago

This is the function that seems to throw the Java Exception. It's thrown when checkInitial() is called. https://gist.github.com/NexAdn/8dfc2d1962cb06b7899068651d649784

AEnterprise commented 8 years ago

check your initConfDir function, most likely that isn't working causing an infinite recursive loop

NexAdn commented 8 years ago

Hm. The function didn't do what it was supposed to do. That caused this infinite recursion.