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

[1.41] Attempting to reboot a system with at least two distinct file handles open causes the computer to hang with a ConcurrentModificationException.

Started by Lymia Aluysia, 30 July 2012 - 02:52 PM
Lymia Aluysia #1
Posted 30 July 2012 - 04:52 PM
Testing code:

local a = fs.open("test1", "w")
local b = fs.open("test2", "w")
os.reboot()

Resulting error:

ComputerCraft: Error running task.
java.util.ConcurrentModificationException
	at java.util.HashMap$HashIterator.nextEntry(HashMap.java:810)
	at java.util.HashMap$ValueIterator.next(HashMap.java:839)
	at dan200.computer.core.FileMount.unmount(FileMount.java:599)
	at dan200.computer.core.FileSystem.unload(FileSystem.java:399)
	at dan200.computer.core.Computer$63.execute(Computer.java:2110)
	at dan200.computer.core.ComputerThread$1$1.run(ComputerThread.java:68)
	at java.lang.Thread.run(Thread.java:679)
justync7 #2
Posted 30 July 2012 - 05:45 PM
So thats why I always close my files… :ph34r:/>/>
Xfel #3
Posted 30 July 2012 - 05:55 PM
I'm pretty shure that this will also happen if the computer is shut down by other means (eg. chunk unloading. If you were copying a file during that, you have two open handles.)
Cloudy #4
Posted 30 July 2012 - 06:16 PM
Copying files works on a different system so wouldn't be affected by this. I did think I fixed this, but apparently not - will be fixed for next release.