mojira.dev
MC-248200

Stack overflow caused by player action no longer handled gracefully

Prior to 1.18-Pre2 a user action which resulted in a stack overflow was handled gracefully by the server side of the game, either the embedded (single player) server or the standalone (multiplayer) server.

With the transition to Java 17 this is no longer the case and the exception

java.lang.NoClassDefFoundError: Could not initialize class org.apache.logging.log4j.util.PrivateSecurityManagerStackTraceUtil

is generated and the server stops.

Higher up in the stack trace there is a StackOverflow exception, but this appears to be swallowed up by this further exception while attempting to handle an exception.

This is reproduceable by having a line of powered rails bud powered and then updating on of the rails, this happens in a device known as an update suppressor, however this does occur in normal play as well when a large number of updates occur within the same action.

Attachments

Comments 6

Note that the stack trace provided is for 1.18-pre2, not 1.18.1 from what I can tell.

That is correct, the "affected versions" doesn't allow anything other than 1.18.1, this first occurred in 1.18-pre2 and continues in all releases since.

It's recommended to put the stack trace for the latest version, since it's easier to look up the code.

Ok I've just done some additional testing, this bug seems to be a rendering issue in singleplayer. I loaded up a singleplayer world with an update suppressor on my modded client which has fabric loader, carpet and some other client mods. When I tested the suppressor it behaved as it does in previous versions, where a player interaction update does nothing and any other type of update causes the game to crash. I then loaded up the same world in singleplayer on a fully vanilla client and suddenly I was getting the world closing with player interaction updates. However this was not the game crashing as it would simply close the world and bring me to the main menu. Normally with an update suppressor the game would fully crash and I would have to re-launch.

I started adding mods one by one. I added the fabric loader, still closes, I added carpet, still closes. It wasn't until I finally added optifine that the game would work perfectly fine running the update suppressor with player interaction updates. Using any other type of update resulted in the usual game crash. I then moved my test setup to a server, albeit a non-vanilla server as it also had fabric. But given that I did not observe a change in behaviour until I added optifine to my client, this issue appears to be client related. Testing the update suppressor on the server and my client would not crash even if I did not have optifine installed. This issue appears to be a rendering issue that only happens in singleplayer. As optifine is a client optimisation mod for the way the game renders and resulted in an immediate change in behaviour when it was installed.

I believe this is no longer an issue, since stack-overflows are no longer easy to cause from within the game.
In case it still is, please add new steps to reproduce the issue 🙂

Alan Mullett

(Unassigned)

Community Consensus

Important

Crash

1.18.1, 22w03a

Retrieved