mojira.dev
MC-155345

ConcurrentModificationException when a player leaves an active raid

Exception that causes the server to crash.

1.14.3\: [^crash-2019-06-26_14.48.01-server.txt]

Description: Exception ticking world

java.util.ConcurrentModificationException
	at java.util.HashMap$HashIterator.nextNode(HashMap.java:1442)
	at java.util.HashMap$KeyIterator.next(HashMap.java:1466)
	at java.util.Collections$UnmodifiableCollection$1.next(Collections.java:1042)
	at axf.y(SourceFile:259)
	at axf.o(SourceFile:389)
	at axh.a(SourceFile:72)
	at vi.a(SourceFile:325)
	at net.minecraft.server.MinecraftServer.b(SourceFile:824)
	at ui.b(SourceFile:343)
	at net.minecraft.server.MinecraftServer.a(SourceFile:763)
	at net.minecraft.server.MinecraftServer.run(SourceFile:631)
	at java.lang.Thread.run(Thread.java:748)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Server thread
Stacktrace:
	at java.util.HashMap$HashIterator.nextNode(HashMap.java:1442)
	at java.util.HashMap$KeyIterator.next(HashMap.java:1466)
	at java.util.Collections$UnmodifiableCollection$1.next(Collections.java:1042)
	at axf.y(SourceFile:259)
	at axf.o(SourceFile:389)
	at axh.a(SourceFile:72)
	at vi.a(SourceFile:325)

-- Affected level --
Details:
	All players: 3 total; [vj['_toto128'/1745276, l='world', x=2868.05, y=80.80, z=-3932.27], vj['Ketcuz'/1815250, l='world', x=2804.96, y=77.00, z=-3841.55], vj['WinkBlue'/1672178, l='world', x=2877.93, y=79.00, z=-3933.09]]
	Chunk stats: ServerChunkCache: 4435
	Level dimension: minecraft:overworld
	Level name: world
	Level seed: -6615885059026489375
	Level generator: ID 00 - default, ver 1. Features enabled: true
	Level generator options: {}
	Level spawn location: World: (0,69,0), Chunk: (at 0,4,0 in 0,0; contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
	Level time: 96757759 game time, 26049762 day time
	Level storage version: 0x04ABD - Anvil
	Level weather: Rain time: 120214 (now: false), thunder time: 5569 (now: true)
	Level game mode: Game mode: survival (ID 0). Hardcore: false. Cheats: false
Stacktrace:
	at net.minecraft.server.MinecraftServer.b(SourceFile:824)
	at ui.b(SourceFile:343)
	at net.minecraft.server.MinecraftServer.a(SourceFile:763)
	at net.minecraft.server.MinecraftServer.run(SourceFile:631)
	at java.lang.Thread.run(Thread.java:748)

Linked issues

Attachments

Comments 9

pf alguem pode me dizer se tem como ( se tiver pf mandem ) achar essa seed da tela de login do mine ?  

[media]

What actions can be taken to cause this crash?

Honestly I don't know, we were playing with some cats and running towards each other, then it crashed.

The two duplicate tickets suggest that this happens when teleporting while a raid is active. I have renamed the ticket in order to reflect that.

same happening here. defended 3 raids, 1 yesterday and 2 today and crashed the three times.

 

[media]

I can assure you that no one was teleporting when the raid was active. However, yes, there was a raid going, not sure in what moment it crashed though. Let's assume at the end of it.

Maybe this could be caused by using nether portals as well? Maybe an entity walked into the portal while the raid was active.

Was going to create an issue about this a few days ago but the Jira was dying, spigot mappings here, but:

private void y() {
    Collection<EntityPlayer> var0 = this.r.getPlayers();// 256
    Set<EntityPlayer> var1 = Sets.newHashSet(var0);// 257
    Iterator var3 = var0.iterator();// 259

    while(var3.hasNext()) {
        EntityPlayer var3 = (EntityPlayer)var3.next();
        BlockPosition var4 = new BlockPosition(var3);// 260
        if (this.k.c_(var4) != this) {// 261
            var1.remove(var3);// 262
            this.r.removePlayer(var3);// 263
        }
    }

The getPlayers call returns an `UnmodifiableSet` of which the backing collection is modified in removePlayer, which ends up throwing a CME when next() is called, fix on our side was simply to use an iterator over the newly created HashSet

This issue would be caused whenever a player leaves a raid while it's running, once it's stopped all is fine, as the backing object for that set cleans up after the raid has finished

Can verify this still occurs in 1.14.3. Just had a crash with the exact same stack trace. 3 players online, they were trying to find the last pillager of a raid and then it crashed

Jack Reacher

migrated

Community Consensus

Important

Crash

Minecraft 1.14.3

Minecraft 1.14.4 Pre-Release 1

Retrieved