Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Fix server crash on 1.17 #8

Merged
merged 1 commit into from
Nov 22, 2021
Merged

Fix server crash on 1.17 #8

merged 1 commit into from
Nov 22, 2021

Conversation

Toshimichi0915
Copy link
Contributor

Leaving the server without completing the captcha will result in server crash in 1.17.1(both paper/spigot)
This PR fixes that issue.

@haq
Copy link
Owner

haq commented Nov 11, 2021

Leaving the server without completing the captcha will result in server crash in 1.17.1(both paper/spigot) This PR fixes that issue.

I am unable to get my 1.17.1 server to crash, can you provide a crash log?

@Toshimichi0915
Copy link
Contributor Author

Toshimichi0915 commented Nov 11, 2021

Crash log

java.util.ConcurrentModificationException
	at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1013)
	at java.base/java.util.ArrayList$Itr.next(ArrayList.java:967)
	at org.bukkit.craftbukkit.v1_17_R1.map.CraftMapView.render(CraftMapView.java:150)
	at app//net.minecraft.world.level.saveddata.maps.MapItemSavedData$HoldingPlayer.nextUpdatePacket(MapItemSavedData.java:630)
	at app//net.minecraft.world.level.saveddata.maps.MapItemSavedData.getUpdatePacket(MapItemSavedData.java:434)
	at app//net.minecraft.world.item.MapItem.getUpdatePacket(MapItem.java:370)
	at app//net.minecraft.server.level.ServerPlayer.doTick(ServerPlayer.java:679)
	at app//net.minecraft.server.players.PlayerList.disconnect(PlayerList.java:610)
	at app//net.minecraft.server.players.PlayerList.disconnect(PlayerList.java:592)
	at app//net.minecraft.server.network.ServerGamePacketListenerImpl.onDisconnect(ServerGamePacketListenerImpl.java:1967)
	at app//net.minecraft.server.network.ServerGamePacketListenerImpl.onDisconnect(ServerGamePacketListenerImpl.java:1947)
	at app//net.minecraft.network.Connection.handleDisconnection(Connection.java:743)
	at app//net.minecraft.server.network.ServerConnectionListener.tick(ServerConnectionListener.java:221)
	at app//net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1654)
	at app//net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:490)
	at app//net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1481)
	at app//net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1280)
	at app//net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319)
	at java.base/java.lang.Thread.run(Thread.java:831)

Paper org.bukkit.craftbukkit.map.CraftMapView line 159

150|        for (MapRenderer renderer : this.renderers) {
___|            ...
158|            try {
159|                renderer.render(this, canvas, player);
160|            } catch (Throwable ex) {
161|                Bukkit.getLogger().log(Level.SEVERE, "Could not render map using renderer " + renderer.getClass().getName(), ex);
162|            }
___|            ...
___|        }

Removing a renderer on render method will cause ConcurrentModificationException. I'm not sure why the server didn't crash in your case, though.

@haq haq merged commit 9e9c1eb into haq:master Nov 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants