mojira.dev
MC-126302

Game freezes if splash text 231 is the only one in splashes.txt

The bug

The game freezes because of being caught in an endless loop if splash text 231 (This message will never appear on the splash screen, isn't that weird?) is the only splash text in the splashes.txt file.

How to reproduce

  1. Download the attached resource pack

  2. Put the resource pack into the resource pack folder of Minecraft

  3. Start up Minecraft and activate the resource pack

  4. Restart Minecraft; the game will freeze as soon as it tries to load into the main menu

(Simply remove the resource pack from the resource pack folder to get Minecraft to work again)

Code analysis

The following code analysis is based on a decompiled version of Minecraft 1.12.2 using MCP 9.40pre-1 with new mappings.

@unknown: The constructor of net.minecraft.client.gui.GuiMainMenu simply picks a random splash from the splashes.txt file until it finds one which doesn't have the Java hashCode() "125780783". So, if there is only one splash text in the splashes file and it has this hash code, the game will stay in a while(true)-loop forever. (or until the JVM process is killed, heh)

Suggested fix

Splash texts which should be ignored (like the one with hash code 125780783) should already be skipped when filling the list of splash texts from the text file. Then there is no loop needed when randomly picking a text from this list.

Attachments

Comments 5

Please note that the fix in the code analysis part probably won't solve the problem if the splashes.txt file only contains splash text 231, but more than once.

@unknown You're right. Updated the suggested fix, thanks!

I made a pack with nothing but line 231 as the only splash there (says "test") and the game didn't lock up. I guess they fixed it in 1.13 but I may be wrong/did something incorrectly.

I'm still able to reproduce using the attached resource pack (jstack for 18w30b). You need to use the contents of the existing splash 231, which is "This message will never appear on the splash screen, isn't that weird?" or similar. Note that when using the attached resource pack, you'll need to restart the game after enabling it (I think).

Confirmed for 1.13.1.

bemoty

Nathan Adams

Confirmed

Minecraft 1.12.2, Minecraft 18w08b, Minecraft 18w09a, Minecraft 18w10c, Minecraft 18w10d, ..., Minecraft 18w16a, Minecraft 1.13-pre1, Minecraft 1.13, Minecraft 18w30b, Minecraft 1.13.1

Minecraft 19w06a

Retrieved