Refined Storage

Refined Storage

77M Downloads

[1.14.4-1.7] NPE while ticking screen

kreezxil opened this issue ยท 7 comments

commented

Issue description:

One of my players on World of Dragons - A New Age is getting a client crash while viewing the crafting grid.

What happens:

client crash

What you expected to happen:

client not crash

Steps to reproduce:

  1. not reliable steps to reproduce happens randomly, we don't know the exact circumstances.

Version (make sure you are on the latest version before reporting):

  • Minecraft: 1.14.4
  • Forge: 28.1.79
  • Refined Storage: 1.7

Does this issue occur on a server? [yes/no]
yes it's happening on a server, the server has no crash report

If a (crash)log is relevant for this issue, link it here:

[pastebin/gist/etc link here]
https://pastebin.com/PQnxe7px

commented

I just got the same thing on my end. against my pack.

https://pastebin.com/f4Wvh60g

What I was doing:

I noticed the refined storage wasn't acknowledging what was in the system, so I broke the crafting grid and then replaced it to make refresh itself.

and that's when my client crashed.

commented

I'm having the same crashlog on the client-side only. I believe it's connected to autocrafting operations running at the moment you open the Grid GUI (pretty sure it requires crafting using items displaying on the Grid's screen when you open the Grid GUI, but that's a bit difficult for me to confirm).

Edit: also appears to occur when the Network was "exporting" items (keeping an interface stocked which was actively being pulled away by another mod) that was in the Grid's display. Once my Network no longer had the items to keep the interface stocked, the crashes stopped.

commented

Linking PR #2379

commented

Update: we MIGHT have found the cause.

The problem was that the Grid is sending delta packets when the client is watching the screen.

It stops sending those as soon as the client closes the screen. But as this is serverside, there is some latency till the server knows the client has closen the screen.

This means that the server might still be sending delta packets when the client has closen the screen.

Due to our screen executeLater system, those "rogue" old packets would still be handled as soon as we open the Grid screen again moments later.

Because postChange (delta packet) would be called before setStacks (initial update packet), it would crash with that NPE because the map is still empty.

commented

Would this still occur if the Grid hasn't been opened since MC Launched? Some of my crashes were literally "start MC, log into server, try to open the Grid and crash." Would these deltapackets persist across player sessions on a server?

commented

I just did a second commit, changing the check to use containsKey instead of isEmpty. This is to fix issues with multiple data packets instead of one. The analysis of the issue should remain valid (we hope).

Me and @Darkere have been debugging this and it should be gone now.

Big thanks to @Darkere for helping me fix this issue.

commented

@LezChap Good point. I encourage (aka beg) you to try the latest build on our Jenkins (https://jenkins.raoulvdberge.com/job/refinedstorage-mc1.14/31/) and let us know if it has been fixed or not.

We hope it is :D