[SPIGOT-2888] ConcurrentModificationException in Created: 04/Dec/16  Updated: 04/Dec/16  Resolved: 04/Dec/16

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: vtcakavsmoace Assignee: Unassigned
Resolution: Invalid Votes: 0
Labels: bug, crash, entity, spigot, ticking
Environment:

Minecraft Version: 1.11
Operating System: Linux (amd64) version 4.4.0-51-generic
Java Version: 1.8.0_111, Oracle Corporation
Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 3542908688 bytes (3378 MB) / 4460642304 bytes (4254 MB) up to 7635730432 bytes (7282 MB)
JVM Flags: 3 total; -Xss8m -Xmx8G -Xms2G
IntCache: cache: 1, tcache: 1, allocated: 12, tallocated: 94


Attachments: Text File crash-2016-12-04_09.36.56-server.txt    
Plugin: N/A

 Description   

Exception in tick loop (java.util.ConcurrentModificationException) caused by changing while iterating through a HashMap (caused by net.minecraft.server.v1_11_R1.EntityTracker.untrackEntity, if I'm reading this right).

Full crash report is attached. We use one plugin (that's located on a server-related organization, with no intent to advertise) that alters the CommandMap in both the SimplePluginManager instance and the CraftBukkit instance reflectively, as well as altering display names every async chat event. Neither of those appears to be directly related to this crash, but that's just full disclosure. No other alterations to the server are made.



 Comments   
Comment by vtcakavsmoace [ 04/Dec/16 ]

>_> I'm dumb sometimes

Sorry 'bout that.

Let us never speak of this Event >.>

Comment by md_5 [ 04/Dec/16 ]

Aaand your plugin is manipulating the scoreboard in an asyncchatevent.
Thats probably your crash source right there.
Please read:
http://wiki.bukkit.org/Scheduler_Programming#Tips_for_thread_safety

Comment by md_5 [ 04/Dec/16 ]

I don't think its outside the scope of a plugin at all.
If its a ConcurrentModificationException it can be caused by plugins doing async things in a thread you can't see the stack trace for.
You mentioned you had plugins doing async things.

Comment by vtcakavsmoace [ 04/Dec/16 ]

@md_5: The exception occurs outside of the scope of the plugin, and it would be incredibly difficult for me to replicate this crash as I cannot disable the plugin in the production server, but cannot simulate the number of players (and thereby entities) without altering the server configuration.

The exception occurs here:

java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextNode(HashMap.java:1437)
at java.util.HashMap$KeyIterator.next(HashMap.java:1461)
at net.minecraft.server.v1_11_R1.EntityTracker.untrackEntity(EntityTracker.java:160)
at net.minecraft.server.v1_11_R1.WorldManager.b(WorldManager.java:29)
at net.minecraft.server.v1_11_R1.World.c(World.java:1096)
at net.minecraft.server.v1_11_R1.WorldServer.c(WorldServer.java:1149)
at net.minecraft.server.v1_11_R1.World.kill(World.java:1132)
at net.minecraft.server.v1_11_R1.PlayerList.disconnect(PlayerList.java:412)
at net.minecraft.server.v1_11_R1.PlayerConnection.a(PlayerConnection.java:1045)
at net.minecraft.server.v1_11_R1.NetworkManager.handleDisconnection(NetworkManager.java:316)
at net.minecraft.server.v1_11_R1.ServerConnection.c(ServerConnection.java:174)
at net.minecraft.server.v1_11_R1.MinecraftServer.D(MinecraftServer.java:834)
at net.minecraft.server.v1_11_R1.DedicatedServer.D(DedicatedServer.java:399)
at net.minecraft.server.v1_11_R1.MinecraftServer.C(MinecraftServer.java:675)
at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.java:574)
at java.lang.Thread.run(Thread.java:745)

which does not have any relation to any adjustments made by the plugin.

Comment by md_5 [ 04/Dec/16 ]

Please reproduce without plugins

Comment by vtcakavsmoace [ 04/Dec/16 ]

Accidentally fired it off without filling in the description. That was supposed to say "ConcurrentModificationException in main server thread causing fatal crash."

Generated at Sat Dec 13 13:41:50 UTC 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.