receiveStarlight() null pointer caused server crash
SoulOfAton opened this issue · 5 comments
This error crashed a SevTech server, astral sorcery mod version 1.10.19.
Error traced to:
BlockTransmutationHandler.java -> receiveStarlight() ->line 87
PacketChannel.CHANNEL.sendToAllAround(pkt, PacketChannel.pointFromPos(world, pos, 16));
The running theory is that the server tried to do a client type request such as getCurrentWorld().
The server isn't a player and doesn't have a world so this forced the nullcheck method to throw a null exception and crash the server.
If we're wrong, we're wrong. We just figured we should bring the error to dev attention since it crashed the server.
Cheers,
SoulOfAton
Another player from that server here, I brainstormed with Aton on the crash. The owner just woke up and told me that an Interdimensional Teleporter was set up on the Moon dimension of Galacticraft. As the dimensions are reset monthly, it got deleted and that's what most likely caused the crash. Might be a good idea to check for other dimension's Teleporters to actually exist as resets are a common thing on servers. Maybe the owner can give us the log, but I thought I'd share that as it's helpful probably.
I do not own the server, will update with the full log if they decide to disclose it.
Here is some important info from the server owner:
"The reason for the crash is due to me resetting the moon dimension.
Astral Sorcery was looking for the Starlight Interdimensional Teleporter (Astrsl gateway) on the moon which didn’t exist. We do this moon reset on a monthly basis"
The running theory is that the server tried to do a client type request such as getCurrentWorld().
The server isn't a player and doesn't have a world so this forced the nullcheck method to throw a null exception and crash the server.
While almost close already, it doesn't quite nail it down:
The server tries to send packets all around to each player nearby. However during that sending, between the timespan after packet being queue'd up AND before the target is selected (the OutboundTarget#selectNetworks line there) is a race condition where another packet is being queue'd up and has a different target. This causes my call to run into the problem as you described, a target that is supposed to have a player (or whatever) passed to find the target now has the NetworkTarget object (a wrapper around world + position + radius more or less). So at the offset where it would expect a player object now (due to the in a race condition changed outbound target) there is nothing, thus running into a null there.
That being said, this has appeared on a multitude of occasions already, without a real solution as to how to approach this issue. As this was discussed with cpw about a year ago, we don't have a solution for this, nor a reliably reproduceable scenario to be able to repeatedly in-depth debug this further. As it stands, i have no solution to this issue, and as it seems to be described as, the issue isn't a repeating occurance for you either, but rather a one-off thing?
The lead of "the server resets the dimension and that might cause it" is not the reason here unfortunately.
see #513
closing as duplicate