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

While true loop crashes turtle if in Startup

Started by Noiro, 06 April 2013 - 04:41 AM
Noiro #1
Posted 06 April 2013 - 06:41 AM
In the Mindcrack modpack, if I program a turtle to have a while true do loop and put no sleep code inside of it (easiest way to test is with no code at all), and make that program be startup, you cannot force-close the program. In fact, no matter how many times you pickup and put down the turtle, he will be stuck in the infinite loop.

Process:

edit startup

Insert into startup script:

while true do
end

Save and close. Then run the script. I've had to trash 2 turtles so far because I forgot about this bug.
Cloudy #2
Posted 06 April 2013 - 07:12 AM
And? It's a malicious script. Get rid of it using a floppy…
Cranium #3
Posted 06 April 2013 - 07:23 AM
Well, why isn't it catching the 'too long without yeilding' error? Just because there are no function calls?
Cloudy #4
Posted 06 April 2013 - 07:26 AM
Well, why isn't it catching the 'too long without yeilding' error? Just because there are no function calls?

It will catch it and shut down.
Cranium #5
Posted 06 April 2013 - 07:50 AM
Well, he said that it would not allow for the program to stop. I don't know if he is saying that it will not error out, or if he means that you have essentially bricked the computer, but I think we need more information.

To OP: Does it cause an error, or is it stuck completely in a loop? You would have to wait around 5 seconds to see if the error would show up. If it does, then it should just exit to shell.
Bubba #6
Posted 06 April 2013 - 07:55 AM
Although the turtle should be giving an error and it's concerning that it isn't, you can override the loop by holding ctrl+t for about 3 seconds.
PixelToast #7
Posted 06 April 2013 - 08:03 AM
Although the turtle should be giving an error and it's concerning that it isn't, you can override the loop by holding ctrl+t for about 3 seconds.
nope, if it dosent yeild it wont catch the terminate event

do what cloudy said, remove the file using a startup disk
Bubba #8
Posted 06 April 2013 - 08:21 AM
nope, if it dosent yeild it wont catch the terminate event

do what cloudy said, remove the file using a startup disk

Ah. I suppose I thought that ctrl+t magically forces a yield xD

What version was the infinite loop error introduced? I thought it was pre-1.2.5