MineColonies

MineColonies

53M Downloads

CTL during coremod.colony.permissions.Permissions$View.hasPermission

TheQuadShot opened this issue · 21 comments

commented

Minecraft 1.10.2
Forge 2422
MincColonies Build: 3780

I also keep getting a corrupted colonies.dat file

CrashLog:
https://pastebin.com/nyVf0cC0

ModList:
https://pastebin.com/ZcMgN822

Colonies.dat
https://pastebin.com/Dn5nLQhX

commented
commented

No, I was running build 3765 and updated to build 3780 today. I also noticed that when I copied an older colonies.dat file I lost access to some of the buildings I have. May be because the version of the dat file was prior to building them.

commented
commented

I've supplied a complete list of mods and a copy of my colonies.dat file in the original post (links to paste.bin).

commented
commented

I have been looking into this: https://github.com/Minecolonies/minecolonies/blob/ba3126e7e8f79044c9cd21102296423360c93a6c/src/main/java/com/minecolonies/coremod/colony/permissions/Permissions.java#L950
Is the offending line here.

Some deduction produces the only scenario:

  • permissions (A Map instantiated on construction) cannot be null (by definition)
  • rank being null would not throw an exception
  • action has to be the offender. This is possible even though the source code supplies an @NotNull this does not prevent it from being null during runtime, the annotation is processed by your IDE and an null test is only inserted when it thinks it is needed. Our build system does not do any of this when it creates a Jar that players can play with. As such the only thing that might be null here is the Action parameter
commented

The call to the offending method further more originates from here:
https://github.com/Minecolonies/minecolonies/blob/ba3126e7e8f79044c9cd21102296423360c93a6c/src/main/java/com/minecolonies/coremod/colony/permissions/Permissions.java#L1057
As can be seen; the action parameter that is used as input for the offending parameter is here also a parameter and is not modified in any way.

commented

Looking into this even further reveals an other issue. The only parameter that could offend this would be the Action type parameter, yet it by definition (as it is an Enum) cannot be null, in the current context as an instance of it is passed into the before mentioned wrapping method here: https://github.com/Minecolonies/minecolonies/blob/ba3126e7e8f79044c9cd21102296423360c93a6c/src/main/java/com/minecolonies/coremod/event/ClientEventHandler.java#L104
So our original assumption is wrong. Leaving the permissions map or the rank to be the issue.

commented

Digging further: rank cannot be null either. When the rank is pulled from the player in the proxy check is made for null players. Null players get neutral rank, nonnull players come from the player list which is initialized directly by the constructor and populated by the deserialize method. Players cannot have an empty Rank since the valueOf method does not return null but throw an Exception if it cannot find the rank.

which means that the only thing that can be null is the permissions map, which is weird since it is automatically filled by the constructor, unless somebody force creates it by the use of reflection which is what we are doing, and this might be a side effect of that practice, not sure.

commented

@Raycoms @Kostronor @Asherslab I did nullability research on this call stack, see above comments, there is no way in normal object behaviour that this can occur, the only way this can happen is when the object (The Permissions.View in this case) was created by reflection and that failed silently for some reason, this can occur and might not be uncommon under certain conditions and is a negative side effect of reflectively calling the constructor to create an instance.

I am not sure how to proceed with this.

@TheQuadShot A full log would be nice. That way we can check if something went wrong during the Synchronisation of the Permissions data. (Also if this is on a dedicated server, a server log would be nice).

commented
commented

Here's the only other log I have. I'll be happy to change things and test if you would like, just ask. In the mean time I created a "bare-bones" environment (jei, waila, journeymap, and Minecolonies)with your mods debug enabled to try to repro this.

LatestLog:
https://pastebin.com/xuvRzBZc

commented

Sorry about that, this log file is the correct one that coincides with the crash log.
https://pastebin.com/nyVf0cC0

commented
commented

No definitly not. Netty (which is the network system MC (and with that Forge) is build upon) is a high level library that takes care of this. Under no circumstance will a bit flip cause. If you mean a corrupt message with data that is not correct (in a way that the server wrote something in the message that confuses the client): maybe, not sure.

commented

@TheQuadShot That is just the MC crash report. I will need the ENTIRE Log of that session.

commented

This is not the log with the crash. Right?

commented

@Raycoms, i was initially thinking that too. But why? The classes that are the problem are internal classes used only by minecolonies. There are no suspicious mods in his modlist. Hell most mods even are open source that said however it might be a combination, corrupt network combined with silent error in reflective construction, or something like that.

commented

Not sure these will be helpfull, but here are the logs from the crash I just had:
CrashLog:
https://pastebin.com/UvESmrqk

Latest.log
https://pastebin.com/0E9CWTWQ

commented

I will close this because this just can't happen, something must be going too bad. If it happens regularly please contact us.