Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java Exception Thrown: java.lang.NullPointerException #570

Open
OfficialStamper opened this issue Aug 22, 2018 · 6 comments
Open

Java Exception Thrown: java.lang.NullPointerException #570

OfficialStamper opened this issue Aug 22, 2018 · 6 comments

Comments

@OfficialStamper
Copy link

I am getting the following errors, at random times, in random places

Java Exception Thrown: java.lang.NullPointerException
Java Exception Thrown: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0

against the following statements:

monitor.write()
monitor.setTextColor()
monitor.setBackgroundColor()

and they coincide with with this message in the server system log:

[20:45:54] [Server thread/WARN] [net.minecraft.tileentity.TileEntity]: Skipping BlockEntity with id

I'm guessing its the monitor peripheral skipping. Is there a workaround/fix?

Minecraft Version: 1.12.2
forge-1.12.2-14.23.4.2715
ComputerCraft1.80pr1.jar

@SquidDev
Copy link
Contributor

Can you enable logPeripheralErrors in your config, and then attach your logs next time this occurs? This should include a bit more diagnostic information.

@OfficialStamper
Copy link
Author

OfficialStamper commented Aug 23, 2018

wish I knew about that config setting before, lol

Here is some of the log, it was too large to post it complete. Let me know if you need more.

https://pastebin.com/agrXbmdu

One other point to mention, the same code is running fine on 2 other linux servers and 7 x windows SSP machines, all using slightly different versions of java: 171, 172, and 181. It only happens on this one server!

@SquidDev
Copy link
Contributor

Thank you, that's very helpful.

This appears to be an out of bounds within World.getPendingTileEntityAt, which is almost definitely a threading issue. I've rewritten monitors to be thread safe in #507, so that should fix it if it's merged. Can you try running this build from the CI server, or alternatively my fork to see if that helps resolve the issue?

@OfficialStamper
Copy link
Author

Thanks for looking into this. You mention should fix 'if it's merged'? Or do you mean, when its merged?
I will contact the server owner and ask him to test it out, does he just replace his current .jar with your CI Server build one, or is there some 'merge' that has to be done?

@SquidDev
Copy link
Contributor

SquidDev commented Aug 23, 2018

does he just replace his current .jar with your CI Server build one

Yep! I believe it will also require an update to the client as well, so apologies there.

You mention should fix 'if it's merged'? Or do you mean, when its merged? Or is there some 'merge' that has to be done?

Ahh, sorry for the confusion. By "merged", I'm just referring to that code being integrated into the official distribution of the mod, rather than sitting on a separate version.

If you run a version with the fix, the bug shouldn't happen any more - it's just I don't know if it will ever be integrated into the official release, hence the "if".

@DBHaslund
Copy link

My server was the troublesome one. I tried the CI build, and I've had 5 different instances running for about 4 hours now, so that seems to have done the trick.

Here's to hoping it makes it into the official mod release :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants