mojira.dev
MC-68374

ConcurrentModificationException when performing save-all via rcon

Issuing save-all on a server via RCON sometimes causes a (non-fatal) exception to be logged:

[10:48:57] [RCON Client #2/ERROR]: Couldn't process command: 'save-all'
java.util.ConcurrentModificationException
        at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:819) ~[?:1.7.0_09]
        at java.util.ArrayList$Itr.next(ArrayList.java:791) ~[?:1.7.0_09]
        at qt.a(SourceFile:771) ~[minecraft_server.14w34c.jar:?]
        at cg.a(SourceFile:37) ~[minecraft_server.14w34c.jar:?]
        at ab.a(SourceFile:80) [minecraft_server.14w34c.jar:?]
        at ab.a(SourceFile:63) [minecraft_server.14w34c.jar:?]
        at net.minecraft.server.MinecraftServer.g(SourceFile:789) [minecraft_server.14w34c.jar:?]
        at th.run(SourceFile:80) [minecraft_server.14w34c.jar:?]
        at java.lang.Thread.run(Thread.java:722) [?:1.7.0_09]

Linked issues

Comments 4

Your Java version is out of date! Please update your Java to the latest version (1.8.0_11): http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html
Please report if the issue persists with the latest Java version.

I've updated Java, restarted the server, but this exception doesn't happen often. Haven't seen it yet, will keep watching (I think it's bound to happen again, ConcurrentModificationExceptions are almost never a JVM version issue).

Can confirm this issue exists in Minecraft 1.8 running on Java 8. I can also confirm that this is a long-standing issue: I originally reported this bug for Minecraft 1.3.2, see BUKKIT-2546.

Related: MC-46850

[12:40:09 INFO]: [STDERR]@.(null:-1): java.util.ConcurrentModificationException
[12:40:09 INFO]: [STDERR]@.(null:-1):   at java.util.TreeMap$AbstractMapIterator.makeNext(TreeMap.java:200)
[12:40:09 INFO]: [STDERR]@.(null:-1):   at java.util.TreeMap$UnboundedKeyIterator.next(TreeMap.java:269)
[12:40:09 INFO]: [STDERR]@.(null:-1):   at qt.a(SourceFile:575)
[12:40:09 INFO]: [STDERR]@.(null:-1):   at qt.a(SourceFile:555)
[12:40:09 INFO]: [STDERR]@.(null:-1):   at bfy.a(SourceFile:258)
[12:40:09 INFO]: [STDERR]@.(null:-1):   at bfy.a(SourceFile:113)
[12:40:09 INFO]: [STDERR]@.(null:-1):   at qs.b(SourceFile:160)
[12:40:09 INFO]: [STDERR]@.(null:-1):   at qs.a(SourceFile:203)
[12:40:09 INFO]: [STDERR]@.(null:-1):   at qt.a(SourceFile:767)
[12:40:09 INFO]: [STDERR]@.(null:-1):   at cg.a(SourceFile:37)
[12:40:09 INFO]: [STDERR]@.(null:-1):   at ab.a(ab.java:120)
[12:40:09 INFO]: [STDERR]@.(null:-1):   at ab.a(ab.java:94)
[12:40:09 INFO]: [STDERR]@.(null:-1):   at net.minecraft.server.MinecraftServer.g(SourceFile:789)
[12:40:09 INFO]: [STDERR]@.(null:-1):   at th.run(SourceFile:80)
[12:40:09 INFO]: [STDERR]@.(null:-1):   at java.lang.Thread.run(Unknown Source)
[12:40:09 INFO]: [Rcon: Saved the world]

It appears that qt.a(boolean) is not threadsafe, and modifies world data structures while the Rcon thread is attempting to read the same structures to save the world.

This should now be considered a child bug of MC-72390

Pavel

(Unassigned)

Community Consensus

Minecraft 14w34c, Minecraft 1.8

Retrieved