3 posts
Posted 25 August 2014 - 01:44 PM
VERSION:
1.63
DESCRIPTION:
It kept saying CraftOS 1.6 then eventually errored 'bios:222: vm error: java.lang.ArrayIndexOutOfBoundsException: 32'
EXPECTED RESULT:
Just to launch the shell
REPRODUCTION STEPS:
put this in a startup file on a disk os.run( {}, "rom/programs/shell" ) then reboot
SCREENSHOT/VIDEO:
none needed
8543 posts
Posted 25 August 2014 - 03:28 PM
Moved to Ask a Pro.
You've created a loop by not providing the shell "API" to the instance of the shell that you're starting. It therefore thinks that it is the first shell instance and runs the startup program again.
1852 posts
Location
Sweden
Posted 25 August 2014 - 07:56 PM
I'm not even sure why you put that at startup, wouldn't it be better just to have a clean startup file?
You could fix this by doing this ( as mentioned above )
shell.run( "rom/programs/shell" )
And another thing, in the future you should use code tags for your code even though it may be one line or something it's easier to see.
You can either use the '<>' in the editor or manually put code tags around your code by using [.code] Code here [./code] ( without the period )
171 posts
Location
Eastern USA
Posted 02 September 2014 - 06:21 PM
I've gotten this error many times. It means stack overflow, right? Then why the 32? The maximum stack depth is surely greater than 32?
Edited on 02 September 2014 - 04:21 PM
7083 posts
Location
Tasmania (AU)
Posted 03 September 2014 - 02:07 AM
Depends on which stack you're talking about. I don't see why you'd ever need more than that amount of scripts running at once, so it seems a reasonable figure for, say, a program stack.
Truth be told, the error is a Java ArrayIndexOutOfBoundsException which happens to be triggered by a stack overflow (though those aren't the only possible causes of an out-of-bounds error). LuaJ just happens to stick its stacks in Java arrays, and doesn't bother to catch scenarios where those arrays have overfilled.