-
Notifications
You must be signed in to change notification settings - Fork 196
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
ArrayIndexOutOfBoundsException #425
Comments
This is likely a bug in your own code. In future, you would be better off posting on the forums. As for the cause of the issue, your function calls itself: if msg == nil then
print("Invalid message recived! (No JSON)")
placeholder()
handle()
end
handle sometimes calls itself and sometimes (always?) never returns, each time this means that the function stack (stored in a java array) gets bigger. Eventually this overflows causing the error message you received, |
This generally means you're getting a stack overflow - probably as |
Maybe I should sleep a while. I trying it |
adding a sleep block fixed the issuise, maybe cc should output the stacktrace to the console (or is there a debug mode?) |
Although the crash is indeed due to problems in the script, how tricky would it be to have ComputerCraft produce a more descriptive error? "Too many functions in stack" or somesuch? |
#163 will error with "stack overflow" instead, which is what PUC Lua does. |
This is undoubtably a bug in your program, not cc |
@dan200 the topic of the issue changed to having CC give a clearer error for stack overflow. Thoughts? |
So, hello,
the code above will result in an ArrayIndexOutOfBoundsExecption after the second fail...
Im not getting any stacktrace in console (running on a server).
Here is an screenshot:

If Im doing something wrong then tell me ;)
The text was updated successfully, but these errors were encountered: