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

Thread safety issues with LongHashMap replacement when looking at BlockRenderer preview #445

Open
1 task done
wlhlm opened this issue Nov 27, 2024 · 0 comments
Open
1 task done

Comments

@wlhlm
Copy link
Member

wlhlm commented Nov 27, 2024

Your GTNH Discord Username

rw0lc3 (original reporter on Discord), rot13 (me)

Mod Version

2.5.79

Bug Report

(filing this on behalf of the player reporting it on Discord)

The game crashes with an ArrayIndexOutOfBoundsException in the fastutil library:

java.lang.ArrayIndexOutOfBoundsException: Index 61 out of bounds for length 33
    at it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap.containsKey(Long2ObjectOpenHashMap.java:343)
    at com.mitchej123.hodgepodge.util.FastUtilLongHashMap.containsItem(FastUtilLongHashMap.java:30)
    at blockrenderer6343.api.utils.world.DummyChunkProvider.provideChunk(DummyChunkProvider.java:37)
    at net.minecraft.world.World.getChunkFromChunkCoords(World.java:419)
    at net.minecraft.world.World.getBlock(World.java:345)
    at blockrenderer6343.client.world.TrackedDummyWorld.getBlock(TrackedDummyWorld.java:87)
    at blockrenderer6343.client.renderer.WorldSceneRenderer.drawWorld(WorldSceneRenderer.java:281)
    at blockrenderer6343.client.renderer.WorldSceneRenderer.render(WorldSceneRenderer.java:143)
    at blockrenderer6343.integration.nei.GUI_MultiblockHandler.drawMultiblock(GUI_MultiblockHandler.java:434)
    at blockrenderer6343.integration.nei.MultiblockHandler.drawBackground(MultiblockHandler.java:54)
    at codechicken.nei.recipe.GuiRecipe.drawGuiContainerBackgroundLayer(GuiRecipe.java:1173)
    at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:78)
    at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1061)
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1001)
    at net.minecraft.client.Minecraft.run(Minecraft.java:6110)
    at net.minecraft.client.main.Main.main(SourceFile:148)
    at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at net.minecraft.launchwrapper.Launch.rfb$realLaunch(Launch.java:250)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:35)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:60)
    at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.gtnewhorizons.retrofuturabootstrap.Main.main(Main.java:207)
    at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:243)
    at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:278)
    at org.multimc.EntryPoint.listen(EntryPoint.java:143)
    at org.multimc.EntryPoint.main(EntryPoint.java:34)

Full crashlog: crash-2024-11-26_23.04.37-client.txt

This seems to happen when inspecting the BlockRenderer multiblock preview.

Raven mentioned this is caused by thread unsafety in the hashmap implementation.

Original PR: #382

Java Version

Java 21

Mod List or GTNH Pack Version

GTNH 2.7-beta4

Final Checklist

  • I have searched the issues and haven't found a similar issue.
@wlhlm wlhlm changed the title Threading issues with LongHashMap replacement when looking at BlockRenderer preview Thread safety issues with LongHashMap replacement when looking at BlockRenderer preview Nov 27, 2024
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

1 participant