shedaniel / RoughlyEnoughItems

Clean and Configurable. Your recipe viewer mod for 1.13+.
Other
327 stars 66 forks source link

[Bug] Crash on certain recipe lookups #1471

Closed HeraldOD closed 1 year ago

HeraldOD commented 1 year ago

What happened?

I updated REI today, version 9.1.641 on MC 1.19.2. Now when I click to get the recipe of an item, the game crashes. (in my case I clicked on "Birch Wood") The crash doesn't happen on version 9.1.636

What mod loaders are you seeing the problem on?

Fabric

What do you think this bug is of?

Relevant log output

---- Minecraft Crash Report ----
// This doesn't make any sense!

Time: 2023-08-09 00:13:22
Description: mouseReleased event handler

java.lang.NullPointerException: Cannot invoke "me.shedaniel.rei.api.common.display.Display.getCategoryIdentifier()" because "display" is null
    at Not Enough Crashes deobfuscated stack trace.(1.19.2+build.28)
    at me.shedaniel.rei.api.client.registry.display.DisplayCategory$1.hashOf(DisplayCategory.java:159)
    at me.shedaniel.rei.impl.client.view.ViewsImpl$1Wrapped.<init>(ViewsImpl.java:226)
    at me.shedaniel.rei.impl.client.view.ViewsImpl._buildMapFor(ViewsImpl.java:273)
    at me.shedaniel.rei.impl.client.view.ViewsImpl.buildMapFor(ViewsImpl.java:92)
    at me.shedaniel.rei.impl.client.ClientHelperImpl$ViewSearchBuilderImpl.lambda$new$0(ClientHelperImpl.java:397)
    at com.google.common.base.Suppliers$NonSerializableMemoizingSupplier.get(Suppliers.java:183)
    at me.shedaniel.rei.impl.client.ClientHelperImpl$ViewSearchBuilderImpl.buildMapInternal(ClientHelperImpl.java:470)
    at me.shedaniel.rei.impl.client.ClientHelperImpl.openView(ClientHelperImpl.java:329)
    at me.shedaniel.rei.api.client.view.ViewSearchBuilder.open(ViewSearchBuilder.java:228)
    at me.shedaniel.rei.impl.client.gui.widget.EntryWidget.doAction(EntryWidget.java:633)
    at me.shedaniel.rei.impl.client.gui.widget.DisplayedEntryWidget.doAction(DisplayedEntryWidget.java:85)
    at me.shedaniel.rei.impl.client.gui.widget.entrylist.EntryListStackEntry.doAction(EntryListStackEntry.java:171)
    at me.shedaniel.rei.impl.client.gui.widget.EntryWidget.mouseReleased(EntryWidget.java:581)
    at me.shedaniel.rei.impl.client.gui.widget.entrylist.EntryListWidget.mouseReleased(EntryListWidget.java:332)
    at net.minecraft.client.gui.ParentElement.method_20083(ParentElement:42)
    at java.util.Optional.filter(Optional.java:218)
    at net.minecraft.client.gui.ParentElement.mouseReleased(ParentElement:42)
    at me.shedaniel.rei.RoughlyEnoughItemsCoreClient.lambda$registerEvents$18(RoughlyEnoughItemsCoreClient.java:383)
    at net.minecraft.client.Mouse.handler$bab000$architectury$onGuiMouseReleased(Mouse:1133)
    at net.minecraft.client.Mouse.method_1605(Mouse)
    at net.minecraft.client.gui.screen.Screen.wrapScreenError(Screen:489)
    at net.minecraft.client.Mouse.onMouseButton(Mouse:96)
    at net.minecraft.client.Mouse.method_22686(Mouse:165)
    at net.minecraft.util.thread.ThreadExecutor.execute(ThreadExecutor:103)
    at net.minecraft.client.Mouse.method_22684(Mouse:165)
    at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:43)
    at org.lwjgl.system.JNI.invokeV(Native Method)
    at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3403)
    at com.mojang.blaze3d.systems.RenderSystem.flipFrame(RenderSystem:197)
    at net.minecraft.client.util.Window.swapBuffers(Window:315)
    at net.minecraft.client.MinecraftClient.render(MinecraftClient:1205)
    at net.minecraft.client.MinecraftClient.run(MinecraftClient:768)
    at net.minecraft.client.main.Main.main(Main:244)
    at net.minecraft.client.main.Main.main(Main:51)
    at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:468)
    at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
    at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
    at org.prismlauncher.launcher.impl.StandardLauncher.launch(StandardLauncher.java:88)
    at org.prismlauncher.EntryPoint.listen(EntryPoint.java:126)
    at org.prismlauncher.EntryPoint.main(EntryPoint.java:71)

Anything else?

No response

By submitting this issue, I have included the necessary logs by pasting the contents into the correct location or attaching the file as an upload.

By submitting this issue, I have confirmed my REI and REI's dependencies are up to date.

nthxny commented 1 year ago

I'm also getting the same stack trace

Abalieno commented 1 year ago

Yep, confirming too. It's kind of erratic, it's not one recipe in particular, it just seem to happen randomly.

nthxny commented 1 year ago

the issue seems to be caused by the latest commit on 8.x/9.x, which caches hash values but does so before the class constructor runs, while display is still null.

image

BlackAures1 commented 1 year ago

Same crash

rei-issues.log rei.log latest.log crash-2023-08-09_06.15.34-client.txt

Shibva commented 1 year ago

is this fix in regard to another crash? I don't know if this is whats casing it, but sometimes when you join or open your inventory you get hit with LegacyRandomSource crashing from attempting to access multiple threads

anyhow; here's the stack that is deobfuscated courtesy of Not Enough Crashes for Fabric

---- Minecraft Crash Report ----
// There are four lights!

Time: 2023-08-09 03:16:15
Description: Unexpected error

java.lang.NullPointerException: Cannot invoke "me.shedaniel.rei.api.common.display.Display.getCategoryIdentifier()" because "display" is null
    at Not Enough Crashes deobfuscated stack trace.(1.19.2+build.28)
    at me.shedaniel.rei.api.client.registry.display.DisplayCategory$1.hashOf(DisplayCategory.java:159)
    at me.shedaniel.rei.impl.client.view.ViewsImpl$1Wrapped.<init>(ViewsImpl.java:226)
    at me.shedaniel.rei.impl.client.view.ViewsImpl._buildMapFor(ViewsImpl.java:273)
    at me.shedaniel.rei.impl.client.view.ViewsImpl.buildMapFor(ViewsImpl.java:92)
    at me.shedaniel.rei.impl.client.ClientHelperImpl$ViewSearchBuilderImpl.lambda$new$0(ClientHelperImpl.java:397)
    at com.google.common.base.Suppliers$NonSerializableMemoizingSupplier.get(Suppliers.java:183)
    at me.shedaniel.rei.impl.client.ClientHelperImpl$ViewSearchBuilderImpl.buildMapInternal(ClientHelperImpl.java:470)
    at me.shedaniel.rei.impl.client.ClientHelperImpl.openView(ClientHelperImpl.java:329)
    at me.shedaniel.rei.api.client.view.ViewSearchBuilder.open(ViewSearchBuilder.java:228)
    at me.shedaniel.rei.impl.client.gui.widget.EntryWidget.keyPressedIgnoreContains(EntryWidget.java:693)
    at me.shedaniel.rei.impl.client.gui.widget.DisplayedEntryWidget.keyPressedIgnoreContains(DisplayedEntryWidget.java:127)
    at me.shedaniel.rei.impl.client.gui.widget.EntryWidget.keyPressed(EntryWidget.java:664)
    at me.shedaniel.rei.impl.client.gui.widget.entrylist.EntryListWidget.keyPressed(EntryListWidget.java:236)
    at me.shedaniel.rei.impl.client.gui.ScreenOverlayImpl.keyPressed(ScreenOverlayImpl.java:387)
    at me.shedaniel.rei.RoughlyEnoughItemsCoreClient.lambda$registerEvents$22(RoughlyEnoughItemsCoreClient.java:440)
    at net.minecraft.client.Keyboard.handler$zpc000$architectury$onKey(Keyboard:1631)
    at net.minecraft.client.Keyboard.onKey(Keyboard:370)
    at net.minecraft.client.Keyboard.method_22678(Keyboard:462)
    at net.minecraft.util.thread.ThreadExecutor.execute(ThreadExecutor:103)
    at net.minecraft.client.Keyboard.method_22676(Keyboard:462)
    at org.lwjgl.glfw.GLFWKeyCallbackI.callback(GLFWKeyCallbackI.java:44)
    at org.lwjgl.system.JNI.invokeV(Native Method)
    at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3403)
    at com.mojang.blaze3d.systems.RenderSystem.flipFrame(RenderSystem:197)
    at net.minecraft.client.util.Window.swapBuffers(Window:315)
    at net.minecraft.client.MinecraftClient.render(MinecraftClient:1205)
    at net.minecraft.client.MinecraftClient.run(MinecraftClient:768)
    at net.minecraft.client.main.Main.main(Main:244)
    at net.minecraft.client.main.Main.main(Main:51)
    at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:468)
    at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
    at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
Shibva commented 1 year ago

@HeraldOD @Abalieno this forge or fabic

if at least one of your are forge then this change is causing issues on both ends

Abalieno commented 1 year ago

Fabric for me.

shedaniel commented 1 year ago

Please try the latest update.

QianFuv commented 1 year ago

problem stay https://github.com/shedaniel/RoughlyEnoughItems/issues/1472

Shibva commented 1 year ago

Please try the latest update.

It's now working for me_

QianFuv commented 1 year ago

work for me too