This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Jan's profile picture

[1.41][SP][CRITICAL] Program freezes minecraft

Started by Jan, 06 August 2012 - 02:03 PM
Jan #1
Posted 06 August 2012 - 04:03 PM
EDIT: Marked for delete. It doesnt crash, I thought it did, only because CRTL+T didnt react :/
SpoilerDetails
Minecraft 1.2.5
Forge 3.3.8.152 and it's Mod Loader
no other mods installed

What happens?
When executing the program, minecraft freezes, and does not react anymore. You have to shut it down.
It gives the following error:

org.luaj.vm2.LuaError: mark:9: vm error: java.lang.ArrayIndexOutOfBoundsException: 256

Use this (buggy) program 'mark' to reproduce the error:
(the program was meant to replace the 'write' function and add a watermark on top of the screen each time something called 'write')

print("Watermark patcher v1.0")
function getWater()
return "Hello"
end
o = {}
o.write = term.write
term.write = function(tekst)
x,y=term.getCursorPos()
term.setCursorPos(30,1)
term.write(getWater())
term.setCursorPos(x,y)
term.write(tekst)
end
print("Patch Complete")

BTW: could someone help with further investigating the bug?
TODO:
- test if it could crash multiplayer servers
- find out which part of the program, actually made it crash. I suspect it has something to do with recursive function calling, since there is a bug in my program.

UPDATE:
Changed my program so it works as expected, no freezing anymore :P/>/>
But still, some evil person could make programs to crash servers.
Spoiler

print("Watermark patcher v1.1")
function getWater()
return "[Your Company Name]"
end
o = {}
o.write = term.write
term.write = function(tekst)
x,y=term.getCursorPos()
term.setCursorPos(30,1)
o.write(getWater())
term.setCursorPos(x,y)
o.write(tekst)
end
print("Patch Complete")
ardera #2
Posted 06 August 2012 - 05:18 PM
(deleted content of post, I didn't read the whole post… sry)
my minecraft didn't crash
Cloudy #3
Posted 07 August 2012 - 01:20 AM
Closed. Please verify what you say is happening before posting bugs saying they crash servers.