Integrated Dynamics

Integrated Dynamics

63M Downloads

NPE causing server crash

Xandaros opened this issue ยท 1 comments

commented

Issue type:

  • ๐Ÿ› Bug

Short description:

Server closed with a null pointer exception

Steps to reproduce the problem:

Not entirely sure what caused it or how to reproduce it, but here is some info that might help:
It was reading NBT Data from a Click Machine , but accessed it through a Capability Proxy
Originally, there was logic to output a redstone signal when a certain NBT value goes below a certain value. I was using the normal get to get the first item in the inventory and read its NBT. The inventory went empty and that logic failed.
I took the card out of the redstone writer and placed it back in once the inventory was filled again. I then replaced it with a simple "Inventory not empty". A short time after that, the server crashed.

After the crash, the entire system was unusable. I suspect this is to prevent repeated crashes. After replacing all the logic cable, everything started working again.
Went fine for a couple of minutes and then crashed again.

Edit:
After additional testing, this is the most minimal setup I've seen crash the server:

  • Empty Strongbox from Thermal Expansion or Auto Clicker from Click Machine (from here on "strongbox")
  • Capability Proxy ("proxy") adjacent to the strongbox
  • Inventory Reader on the proxy
  • Item Interface on the proxy
  • An empty chest away from the proxy
  • Item Exporter on the chest
  • Item Importer on the chest
  • A variable store on the network
  • A display panel on the network
  • Empty variable card in the item importer
  • A variable card reading the list of items from the inventory reader (itemlist)
  • Display panel displays this expression: NBT.integer(NBT(get_or_default(itemlist, 0, empty_item)), "Energy") where empty_item is just an item constant with nothing placed in the slot

Note that it sometimes takes quite a while to crash and sometimes crashes after just a few seconds. I'm never sure whether a given setup is safe or not... For example, right now I'm testing this setup without the item exporter (it is entirely useless), but it has been running stably for over 30 minutes.


Versions:

Log file:

Crash 1:

Crash 2:

commented

Thanks for reporting!