Sodium

Sodium

44M Downloads

JVM crash occasionally on world load

hexadecimal233 opened this issue ยท 11 comments

commented

Version information

sodium-fabric-mc1.20-0.4.10+build.27

Reproduction Steps

  1. Join a local world, if this does not happen, restart the game, then enter again, this will happen randomly

Crash Report file

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffe4c31c706, pid=292, tid=12352
#
# JRE version: OpenJDK Runtime Environment (Alibaba Dragonwell Standard Edition)-17.0.7.0.7+7-GA (17.0.8+7) (build 17.0.8+7)
# Java VM: OpenJDK 64-Bit Server VM (Alibaba Dragonwell Standard Edition)-17.0.7.0.7+7-GA (17.0.8+7, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64)
# Problematic frame:
# C  [jemalloc.dll+0x1c706]
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit:
#   mailto:[email protected]
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

Current thread (0x00000134ca850090):  JavaThread "Render thread" [_thread_in_native, id=12352, stack(0x0000001d41f00000,0x0000001d42000000)]

Stack: [0x0000001d41f00000,0x0000001d42000000],  sp=0x0000001d41ffe070,  free space=1016k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [jemalloc.dll+0x1c706]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
J 19582  org.lwjgl.system.JNI.invokePV(JJ)V (0 bytes) @ 0x00000134da630fec [0x00000134da630fa0+0x000000000000004c]
J 19786 c1 org.lwjgl.system.jemalloc.JEmalloc.nje_free(J)V (10 bytes) @ 0x00000134d3f8dc84 [0x00000134d3f8dc20+0x0000000000000064]
J 38768 c1 me.jellysquid.mods.sodium.client.util.NativeBuffer.deallocate(Lme/jellysquid/mods/sodium/client/util/NativeBuffer$BufferReference;)V (29 bytes) @ 0x00000134d58dd51c [0x00000134d58dd4c0+0x000000000000005c]
J 39862 c1 me.jellysquid.mods.sodium.client.render.chunk.compile.ChunkBuildResult.delete()V (45 bytes) @ 0x00000134d5bec584 [0x00000134d5bec480+0x0000000000000104]
j  me.jellysquid.mods.sodium.client.render.chunk.region.RenderRegionManager.upload(Lme/jellysquid/mods/sodium/client/gl/device/CommandList;Ljava/util/Iterator;)V+112
j  me.jellysquid.mods.sodium.client.render.chunk.RenderSectionManager.performPendingUploads()Z+32
j  me.jellysquid.mods.sodium.client.render.chunk.RenderSectionManager.updateChunks(Z)V+54
j  me.jellysquid.mods.sodium.client.render.chunk.RenderSectionManager.updateChunks()V+2
j  me.jellysquid.mods.sodium.client.render.SodiumWorldRenderer.updateChunks(Lnet/minecraft/class_4184;Lme/jellysquid/mods/sodium/client/util/frustum/Frustum;IZ)V+273
j  net.minecraft.class_761.method_3273(Lnet/minecraft/class_4184;Lnet/minecraft/class_4604;ZZ)V+35
j  net.minecraft.class_761.method_22710(Lnet/minecraft/class_4587;FJZLnet/minecraft/class_4184;Lnet/minecraft/class_757;Lnet/minecraft/class_765;Lorg/joml/Matrix4f;)V+734
j  net.minecraft.class_757.method_3188(FJLnet/minecraft/class_4587;)V+680
J 39799 c1 net.minecraft.class_757.method_3192(FJZ)V (1197 bytes) @ 0x00000134d5bcff0c [0x00000134d5bcea20+0x00000000000014ec]
J 34635 c1 net.minecraft.class_310.method_1523(Z)V (1147 bytes) @ 0x00000134d519c01c [0x00000134d519b3c0+0x0000000000000c5c]
j  net.minecraft.class_310.method_1514()V+123
j  net.minecraft.client.main.Main.main([Ljava/lang/String;)V+1564
j  java.lang.invoke.LambdaForm$DMH+0x00000008012a8000.invokeStaticInit(Ljava/lang/Object;Ljava/lang/Object;)V+10 [email protected]
j  java.lang.invoke.LambdaForm$MH+0x00000008012a8400.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V+19 [email protected]
j  net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(Ljava/lang/ClassLoader;)V+74
j  net.fabricmc.loader.impl.launch.knot.Knot.launch([Ljava/lang/String;Lnet/fabricmc/api/EnvType;)V+40
j  net.fabricmc.loader.impl.launch.knot.KnotClient.main([Ljava/lang/String;)V+4
v  ~StubRoutines::call_stub

siginfo: EXCEPTION_ACCESS_VIOLATION (0xc0000005), reading address 0x0000000000000000
Current thread (0x000002267ff6ef70):  JavaThread "Render thread" [_thread_in_native, id=20636, stack(0x000000ce50e00000,0x000000ce50f00000)]

Stack: [0x000000ce50e00000,0x000000ce50f00000],  sp=0x000000ce50efdd00,  free space=1015k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [jemalloc.dll+0x1c706]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
J 17123  org.lwjgl.system.JNI.invokePV(JJ)V (0 bytes) @ 0x0000022610349b6c [0x0000022610349b20+0x000000000000004c]
J 17122 c1 org.lwjgl.system.jemalloc.JEmalloc.nje_free(J)V (10 bytes) @ 0x000002260904f17c [0x000002260904f120+0x000000000000005c]
J 40039 c1 me.jellysquid.mods.sodium.client.gl.buffer.IndexedVertexData.delete()V (15 bytes) @ 0x000002260acafbec [0x000002260acafb60+0x000000000000008c]
j  me.jellysquid.mods.sodium.client.render.chunk.compile.ChunkBuildResult.delete()V+38
j  me.jellysquid.mods.sodium.client.render.chunk.region.RenderRegionManager.upload(Lme/jellysquid/mods/sodium/client/gl/device/CommandList;Ljava/util/Iterator;)V+112
j  me.jellysquid.mods.sodium.client.render.chunk.RenderSectionManager.performPendingUploads()Z+32
j  me.jellysquid.mods.sodium.client.render.chunk.RenderSectionManager.updateChunks(Z)V+54
j  me.jellysquid.mods.sodium.client.render.chunk.RenderSectionManager.updateChunks()V+2
j  me.jellysquid.mods.sodium.client.render.SodiumWorldRenderer.updateChunks(Lnet/minecraft/class_4184;Lme/jellysquid/mods/sodium/client/util/frustum/Frustum;IZ)V+273
j  net.minecraft.class_761.method_3273(Lnet/minecraft/class_4184;Lnet/minecraft/class_4604;ZZ)V+35
j  net.minecraft.class_761.method_22710(Lnet/minecraft/class_4587;FJZLnet/minecraft/class_4184;Lnet/minecraft/class_757;Lnet/minecraft/class_765;Lorg/joml/Matrix4f;)V+734
j  net.minecraft.class_757.method_3188(FJLnet/minecraft/class_4587;)V+680
j  net.minecraft.class_757.method_3192(FJZ)V+277
J 37294 c1 net.minecraft.class_310.method_1523(Z)V (1147 bytes) @ 0x000002260a530274 [0x000002260a52d8a0+0x00000000000029d4]
J 23761% c1 net.minecraft.class_310.method_1514()V (316 bytes) @ 0x00000226081fc084 [0x00000226081fb240+0x0000000000000e44]
j  net.minecraft.client.main.Main.main([Ljava/lang/String;)V+1564
j  java.lang.invoke.LambdaForm$DMH+0x00000008012a8000.invokeStaticInit(Ljava/lang/Object;Ljava/lang/Object;)V+10 [email protected]
j  java.lang.invoke.LambdaForm$MH+0x00000008012a8400.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V+19 [email protected]
j  net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(Ljava/lang/ClassLoader;)V+74
j  net.fabricmc.loader.impl.launch.knot.Knot.launch([Ljava/lang/String;Lnet/fabricmc/api/EnvType;)V+40
j  net.fabricmc.loader.impl.launch.knot.KnotClient.main([Ljava/lang/String;)V+4
v  ~StubRoutines::call_stub

siginfo: EXCEPTION_ACCESS_VIOLATION (0xc0000005), reading address 0x0000000000000000

Additional information

No response

commented

Doubt it was, just making sure

commented

Oh god, what GPU do you have? If you are on windows, you should be able to see it by going to task manager and then in the performance tab(?)

commented

I am sure that this is not an nvidia gpu issue, the dll caused crash is jemalloc.dll, not nvoglv64.dll.
nvidia driver version 535.98

commented

I doubt this could be lwjgl or jvm related, but this could also be sodium issue

commented

Update: Things got tricky here, this time without sodium in the stack trace, the game still crashed
Doubt this is lwjgl issue

Current thread (0x0000023d4cb750e0):  JavaThread "Render thread" [_thread_in_native, id=29432, stack(0x000000f40c800000,0x000000f40c900000)]

Stack: [0x000000f40c800000,0x000000f40c900000],  sp=0x000000f40c8fe160,  free space=1016k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [jemalloc.dll+0x15f8f]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
J 29818  org.lwjgl.stb.STBImage.nstbi_image_free(J)V (0 bytes) @ 0x0000023d5cb21f69 [0x0000023d5cb21f20+0x0000000000000049]
J 29822 c2 net.minecraft.class_1011.close()V (39 bytes) @ 0x0000023d5d2e75e8 [0x0000023d5d2e75a0+0x0000000000000048]
j  net.minecraft.class_1043.close()V+11
j  net.minecraft.class_1060.method_30299(Lnet/minecraft/class_2960;Lnet/minecraft/class_1044;)V+19
j  net.minecraft.class_1060.method_4616(Lnet/minecraft/class_2960;Lnet/minecraft/class_1044;)V+41
j  net.minecraft.class_8573.method_52199(Lnet/minecraft/class_1011;)V+96
j  net.minecraft.class_4267$class_4270.method_49300([B)Z+22
j  net.minecraft.class_4267$class_4270.method_25343(Lnet/minecraft/class_332;IIIIIIIZF)V+648
J 49007 c2 net.minecraft.class_350.method_25311(Lnet/minecraft/class_332;IIF)V (96 bytes) @ 0x0000023d5f0058c4 [0x0000023d5f005780+0x0000000000000144]
J 49065 c1 net.minecraft.class_350.method_25394(Lnet/minecraft/class_332;IIF)V (519 bytes) @ 0x0000023d574cdc8c [0x0000023d574cc640+0x000000000000164c]
J 21684 c1 net.minecraft.class_4267.method_25394(Lnet/minecraft/class_332;IIF)V (237 bytes) @ 0x0000023d55ec22dc [0x0000023d55ec2220+0x00000000000000bc]
J 21612 c1 net.minecraft.class_500.method_25394(Lnet/minecraft/class_332;IIF)V (86 bytes) @ 0x0000023d5621ae0c [0x0000023d5621ac80+0x000000000000018c]
j  net.minecraft.class_425.method_25394(Lnet/minecraft/class_332;IIF)V+228
j  net.minecraft.class_757.method_3192(FJZ)V+719
j  net.minecraft.class_310.method_1523(Z)V+446
J 47147% c1 net.minecraft.class_310.method_1514()V (316 bytes) @ 0x0000023d576c3b34 [0x0000023d576c2d40+0x0000000000000df4]
j  net.minecraft.client.main.Main.main([Ljava/lang/String;)V+1569
j  java.lang.invoke.LambdaForm$DMH+0x0000000801002800.invokeStaticInit(Ljava/lang/Object;Ljava/lang/Object;)V+10 [email protected]
j  java.lang.invoke.LambdaForm$MH+0x0000000801003000.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V+19 [email protected]
j  net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(Ljava/lang/ClassLoader;)V+74
j  net.fabricmc.loader.impl.launch.knot.Knot.launch([Ljava/lang/String;Lnet/fabricmc/api/EnvType;)V+40
j  net.fabricmc.loader.impl.launch.knot.KnotClient.main([Ljava/lang/String;)V+4
v  ~StubRoutines::call_stub

siginfo: EXCEPTION_ACCESS_VIOLATION (0xc0000005), reading address 0x0000000000000000


Register to memory mapping:

RIP=0x00007ffe9f865f8f jemalloc.dll
RAX=0x0000023d05379640 points into unknown readable memory: 0x00e8000000000000 | 00 00 00 00 00 00 e8 00
RBX=0x0000023d00ff0008 points into unknown readable memory: 0x0000004100000100 | 00 01 00 00 41 00 00 00
RCX=0x0000023d00ff0008 points into unknown readable memory: 0x0000004100000100 | 00 01 00 00 41 00 00 00
RDX=0x0 is NULL
RSP=0x000000f40c8fe160 is pointing into the stack for thread: 0x0000023d4cb750e0
RBP=0x0000023d2f2b0200 is an unknown value
RSI=0x0000023d00ff01f8 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00
RDI=0x0000023d00ff01f8 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00
R8 =0x0000023d00ff0038 points into unknown readable memory: 0x0000000000000001 | 01 00 00 00 00 00 00 00
R9 =0x000000000002f2b0 is an unknown value
R10=0x0000023d00ff0038 points into unknown readable memory: 0x0000000000000001 | 01 00 00 00 00 00 00 00
R11=0x0000023d00000000 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00
R12=0x0 is NULL
R13=0x000000f40c8fe448 is pointing into the stack for thread: 0x0000023d4cb750e0
R14=0x000000f40c8fe400 is pointing into the stack for thread: 0x0000023d4cb750e0
R15=0x0000023d4cb750e0 is a thread


Registers:
RAX=0x0000023d05379640, RBX=0x0000023d00ff0008, RCX=0x0000023d00ff0008, RDX=0x0000000000000000
RSP=0x000000f40c8fe160, RBP=0x0000023d2f2b0200, RSI=0x0000023d00ff01f8, RDI=0x0000023d00ff01f8
R8 =0x0000023d00ff0038, R9 =0x000000000002f2b0, R10=0x0000023d00ff0038, R11=0x0000023d00000000
R12=0x0000000000000000, R13=0x000000f40c8fe448, R14=0x000000f40c8fe400, R15=0x0000023d4cb750e0
RIP=0x00007ffe9f865f8f, EFLAGS=0x0000000000010206

Top of Stack: (sp=0x000000f40c8fe160)
0x000000f40c8fe160:   0000023d00000000 00007ffe00000000
0x000000f40c8fe170:   0000000000000040 00007ffe00000040
0x000000f40c8fe180:   0000023d00ff01f8 00007ffe9f851dec
0x000000f40c8fe190:   0000023d00ff0008 0000023d2f2b0200
0x000000f40c8fe1a0:   0000023d00ff01f8 0000023d00ff01f8
0x000000f40c8fe1b0:   0000000000000001 0000000000000000
0x000000f40c8fe1c0:   000000f40c8fe520 0000023d0b610000
0x000000f40c8fe1d0:   0000023d0b610000 00007ffe3ee891bb
0x000000f40c8fe1e0:   0000000000000000 0000000000000de1
0x000000f40c8fe1f0:   0000000000000000 0000000000000de1
0x000000f40c8fe200:   000000f400000000 0000023d00000000
0x000000f40c8fe210:   0000023d00000000 00007ffe00000040
0x000000f40c8fe220:   0000023d00000040 0000023d00001908
0x000000f40c8fe230:   0000023d00001401 0000023d86420600
0x000000f40c8fe240:   0000000000000000 00007ffe3ee5c9f1
0x000000f40c8fe250:   0000023d4cb750e0 000000f40c8fe358 

commented

Please also upload your client log after the game crashes, specifically .minecraft/logs/latest.log.

commented

It is JVM crash, no info in latest.log(Just normally loads, no errors/warnings), but I can provide my mod list

3dskinlayers-fabric-1.5.4-mc1.20.1
advancementinfo-1.20-fabric0.83.0-1.4
appleskin-fabric-mc1.20-2.5.0
architectury-9.1.10-fabric
armor_visibility-fabric-9.0.0+1.20.1
ash_api-fabric-3.0.0+1.20.1
authme-7.0.2+1.20
autofish-0.9.10-SNAPSHOT
autohud-6.1+1.20-fabric
autoswitch-7.0.1
bedrock-miner-1.20.1-1.1.7
beenfo-1.20-fabric0.83.0-1.3.3-spigot
BetterF3-7.0.1-Fabric-1.20.1
blockmeter-1.10.1-HEAD
borderless-mining-1.1.8+1.20.1
carpet-extra-1.20-1.4.115
carpet-tis-addition-mc1.20.1-v1.49.0
chat_heads-0.10.16-fabric-1.20
chatpatches-201.5.2
CITResewn-1.1.3+1.20
clientcommands-2.8.3
Controlling-fabric-1.20.1-12.0.1
CreativeCore_FABRIC_v2.10.28_mc1.20.1
CustomSkinLoader_Fabric-14.17
dashloader-5.0.0-beta.1+1.20.0
Debugify-1.20.1+2.0
draggable_lists-mc1.20-1.0.0-build.5
durabilityviewer-1.20-fabric0.83.0-1.10.5
easiervillagertrading-1.20-fabric0.83.0-1.5.4
entityculling-fabric-1.6.2-mc1.20
ExtraPlayerRenderer-1.20.1-2.3.1
fabric-api-0.85.0+1.20.1
fabric-carpet-1.20-1.4.112+v230608
fabric-language-kotlin-1.10.0+kotlin.1.9.0
ferritecore-6.0.0-fabric
firstperson-fabric-2.2.3-mc1.20
FpsReducer2-fabric-1.20-2.5
Gamma-Utils-1.7.15-mc1.20.1
held-item-info-1.5.0
IBEEditor-1.20-2.2.3-fabric
IMBlocker
ImmediatelyFast-1.1.16+1.20.1
indium-1.0.21+mc1.20.1
InventoryProfilesNext-fabric-1.20-1.10.6
iris-mc1.20-1.6.4
ItemPhysicLite_FABRIC_v1.6.2_mc1.20.1
Jade-1.20-fabric-11.2.2
language-reload-1.5.8+1.20.1
libIPN-fabric-1.20-3.0.2
litematica-fabric-1.20.1-0.15.3
litematica-printer-1.20.1-3.2.1
lithium-fabric-mc1.20.1-0.11.2
magiclib-1.20.1-0.7.346+e235d92-stable
malilib-fabric-1.20.1-0.16.1
MasaGadget-1.20.1-3.2.311+aae0554-stable
memoryleakfix-fabric-1.17+-1.1.1
minihud-fabric-1.20.1-0.27.0
modelfix-1.14-fabric
modmenu-7.1.0
moreculling-1.20-0.18.1
mousewheelie-1.11.1+mc1.20-pre2
NBTac-FABRIC-1.20.1-1.1.2
Neat-1.20-35-FABRIC
NoChatReports-FABRIC-1.20.1-v2.2.2
Notebook-3.1.0+1.20.1
notenoughanimations-fabric-1.6.4-mc1.20
pistorder-mc1.20-v1.5.0-fabric
reeses_sodium_options-1.5.1+mc1.20-build.74
RoughlyEnoughItems-12.0.626
Searchables-fabric-1.20.1-1.0.1
shulkerboxtooltip-fabric-4.0.4+1.20.1
sodium-extra-0.4.20+mc1.20-build.103
sodium-fabric-mc1.20-0.4.10+build.27
sodium-shadowy-path-blocks-3.1.0
spark-1.10.42-fabric
threadtweak-fabric-1.20.1-0.1.0
tweakermore-mc1.20.1-v3.13.1
tweakeroo-fabric-1.20.1-0.17.1
viafabricplus-2.7.8
WorldEditCUI-1.20+01
worldedit-mod-7.2.15
wraith-colormeoutlines-1.1.2
Xaeros_Minimap_23.5.0_Fabric_1.20
XaerosWorldMap_1.30.6_Fabric_1.20
yet-another-config-lib-fabric-3.0.3+1.20
Zoomify-2.10.0

I guess some of my mods is causing the null pointer crash.

commented

It's possible that it's one of your mods, however, you should probably first make sure that it is not a hardware error by using something like OCCT to test the RAM and CPU before you start troubleshooting your mods.

commented

I ran the tests and no problems were found, and when I laucnh the game with the argument, it crashed with code 0xc0000374
PS: Game starts normally with vanilla minecraft, so I doubt one of my mods caused this crash

Problems found, the startup crash disappeared, guess all the issues above got fixed

commented

I'm not sure it's a hardware issue... The crashes are all related to de-allocating memory. But a lot of these instances have nothing to do with Sodium, and the locations of the crashes is seemingly random. Maybe there is some weird interaction with Jemalloc and Windows here.

Can you try telling Minecraft to use the system allocator by adding -Dorg.lwjgl.system.allocator=system as a JVM argument, and see if it fixes the crashes?

commented

That was odd. But I think I have fixed the problem by myself, one of my mod is using native LWJGL lib and caused this crash, I have reported this issue in their repo.