Sodium

Sodium

61M Downloads

Crash when tabbing out

Zacgamingpro1234 opened this issue ยท 11 comments

commented

Bug Description

When tabbing out the game crashes, not everytime but when using Ixeris it is everytime. Specs: I5-5200U, HD Graphics 5500 (GPU used to run the game), R7 M260X. This is a laptop system

Reproduction Steps

Launch the game and start tabbing out (I used the show desktop button on my mouse). Most of the times it will crash.

Log File

imo the log doesn't provide any valuable info:

[14:31:15] [main/INFO]: Loading Minecraft 1.21.8 with Fabric Loader 0.17.2
[14:31:15] [main/INFO]: Loading 47 mods:
	- fabric-api 0.131.0+1.21.8
	   |-- fabric-api-base 0.5.0+cd8c0daa2c
	   |-- fabric-api-lookup-api-v1 1.6.101+946bf4c32c
	   |-- fabric-biome-api-v1 16.0.11+946bf4c32c
	   |-- fabric-block-api-v1 1.1.3+946bf4c32c
	   |-- fabric-block-view-api-v2 1.0.31+946bf4c32c
	   |-- fabric-command-api-v2 2.3.1+52fff9ec2c
	   |-- fabric-content-registries-v0 10.0.19+946bf4c32c
	   |-- fabric-convention-tags-v1 2.1.41+7f945d5b2c
	   |-- fabric-convention-tags-v2 2.15.6+eb5df52f2c
	   |-- fabric-crash-report-info-v1 0.3.15+946bf4c32c
	   |-- fabric-data-attachment-api-v1 1.8.11+946bf4c32c
	   |-- fabric-data-generation-api-v1 23.2.6+0b1ef9762c
	   |-- fabric-dimensions-v1 4.0.19+946bf4c32c
	   |-- fabric-entity-events-v1 2.1.2+c9e472732c
	   |-- fabric-events-interaction-v0 4.0.24+946bf4c32c
	   |-- fabric-game-rule-api-v1 1.0.73+c64c9c5b2c
	   |-- fabric-item-api-v1 11.5.0+02ce13f42c
	   |-- fabric-item-group-api-v1 4.2.14+c5f9bbc12c
	   |-- fabric-key-binding-api-v1 1.0.65+946bf4c32c
	   |-- fabric-lifecycle-events-v1 2.6.4+db4dfd852c
	   |-- fabric-loot-api-v2 3.0.56+3f89f5a52c
	   |-- fabric-loot-api-v3 2.0.3+946bf4c32c
	   |-- fabric-message-api-v1 6.1.2+946bf4c32c
	   |-- fabric-model-loading-api-v1 5.2.6+946bf4c32c
	   |-- fabric-networking-api-v1 5.0.2+946bf4c32c
	   |-- fabric-object-builder-api-v1 21.1.8+946bf4c32c
	   |-- fabric-particles-v1 4.1.8+946bf4c32c
	   |-- fabric-recipe-api-v1 8.1.15+946bf4c32c
	   |-- fabric-registry-sync-v0 6.1.28+946bf4c32c
	   |-- fabric-renderer-api-v1 7.0.3+208eed172c
	   |-- fabric-renderer-indigo 4.0.3+946bf4c32c
	   |-- fabric-rendering-fluids-v1 3.1.31+fa6cb72b2c
	   |-- fabric-rendering-v1 12.5.0+fbe231d52c
	   |-- fabric-resource-conditions-api-v1 5.0.25+98e6d6db2c
	   |-- fabric-resource-loader-v0 3.1.12+020423442c
	   |-- fabric-screen-api-v1 2.1.1+277ecf7d2c
	   |-- fabric-screen-handler-api-v1 1.3.137+946bf4c32c
	   |-- fabric-sound-api-v1 1.0.42+946bf4c32c
	   |-- fabric-tag-api-v1 1.2.2+946bf4c32c
	   |-- fabric-transfer-api-v1 6.0.6+946bf4c32c
	   \-- fabric-transitive-access-wideners-v1 6.4.1+ac3e15d12c
	- fabricloader 0.17.2
	   \-- mixinextras 0.5.0
	- java 24
	- minecraft 1.21.8
	- sodium 0.6.13+mc1.21.6
[14:31:15] [main/INFO]: SpongePowered MIXIN Subsystem Version=0.8.7 Source=file:/C:/Users/zacve/AppData/Roaming/.minecraft/libraries/net/fabricmc/sponge-mixin/0.16.3+mixin.0.8.7/sponge-mixin-0.16.3+mixin.0.8.7.jar Service=Knot/Fabric Env=CLIENT
[14:31:16] [main/INFO]: Compatibility level set to JAVA_21
[14:31:16] [main/INFO]: Loaded configuration file for Sodium: 43 options available, 0 override(s) found
[14:31:17] [main/INFO]: Searching for graphics cards...
[14:31:18] [main/INFO]: Found graphics adapter: AdapterInfo{vendor=AMD, description='AMD Radeon R7 M260X', adapterType=0x00002313, openglIcdFilePath='C:\WINDOWS\System32\DriverStore\FileRepository\u0369996.inf_amd64_341b825757693c75\B369942\atig6pxx.dll', openglIcdVersion=27.20.20904.1004}
[14:31:18] [main/INFO]: Found graphics adapter: AdapterInfo{vendor=INTEL, description='Intel(R) HD Graphics 5500', adapterType=0x0000202B, openglIcdFilePath='ig8icd64.dll', openglIcdVersion=20.19.15.5166}
[14:31:18] [main/WARN]: Sodium has applied one or more workarounds to prevent crashes or other issues on your system: [INTEL_FRAMEBUFFER_BLIT_CRASH_WHEN_UNFOCUSED, INTEL_DEPTH_BUFFER_COMPARISON_UNRELIABLE]
[14:31:18] [main/WARN]: This is not necessarily an issue, but it may result in certain features or optimizations being disabled. You can sometimes fix these issues by upgrading your graphics driver.
[14:31:18] [main/INFO]: Initializing MixinExtras via com.llamalad7.mixinextras.service.MixinExtrasServiceImpl(version=0.5.0).
[14:31:23] [Datafixer Bootstrap/INFO]: 269 Datafixer optimizations took 2635 milliseconds
[14:31:35] [Render thread/INFO]: Environment: Environment[sessionHost=https://sessionserver.mojang.com, servicesHost=https://api.minecraftservices.com, name=PROD]
[14:31:35] [Render thread/INFO]: Setting user: Zacgamingpro1234
[14:31:36] [Render thread/INFO]: [Indigo] Different rendering plugin detected; not applying Indigo.
[14:31:37] [Render thread/INFO]: Backend library: LWJGL version 3.3.3-snapshot
[14:31:37] [Render thread/WARN]: Detected unexpected shutdown during last game startup: resetting fullscreen mode
[14:31:38] [Render thread/INFO]: OpenGL Vendor: Intel
[14:31:38] [Render thread/INFO]: OpenGL Renderer: Intel(R) HD Graphics 5500
[14:31:38] [Render thread/INFO]: OpenGL Version: 3.2.0 - Build 20.19.15.5166
[14:31:38] [Render thread/INFO]: Using optional rendering extensions: GL_ARB_buffer_storage, GL_KHR_debug, GL_ARB_vertex_attrib_binding
[14:31:38] [Render thread/WARN]: Removed resource pack ixeris from options because it doesn't seem to exist anymore
[14:31:39] [Render thread/INFO]: Reloading ResourceManager: vanilla, fabric, fabric-api, fabric-api-base, fabric-api-lookup-api-v1, fabric-biome-api-v1, fabric-block-api-v1, fabric-block-view-api-v2, fabric-command-api-v2, fabric-content-registries-v0, fabric-convention-tags-v1, fabric-convention-tags-v2, fabric-crash-report-info-v1, fabric-data-attachment-api-v1, fabric-data-generation-api-v1, fabric-dimensions-v1, fabric-entity-events-v1, fabric-events-interaction-v0, fabric-game-rule-api-v1, fabric-item-api-v1, fabric-item-group-api-v1, fabric-key-binding-api-v1, fabric-lifecycle-events-v1, fabric-loot-api-v2, fabric-loot-api-v3, fabric-message-api-v1, fabric-model-loading-api-v1, fabric-networking-api-v1, fabric-object-builder-api-v1, fabric-particles-v1, fabric-recipe-api-v1, fabric-registry-sync-v0, fabric-renderer-api-v1, fabric-renderer-indigo, fabric-rendering-fluids-v1, fabric-rendering-v1, fabric-resource-conditions-api-v1, fabric-resource-loader-v0, fabric-screen-api-v1, fabric-screen-handler-api-v1, fabric-sound-api-v1, fabric-tag-api-v1, fabric-transfer-api-v1, fabric-transitive-access-wideners-v1, fabricloader, sodium
[14:31:40] [Worker-Main-2/INFO]: Found unifont_all_no_pua-16.0.03.hex, loading
[14:31:40] [Worker-Main-3/INFO]: Found unifont_pua-16.0.03.hex, loading
[14:31:40] [Worker-Main-1/INFO]: Found unifont_jp_patch-16.0.03.hex, loading

it says Sodium has applied one or more workarounds to prevent crashes or other issues on your system: [INTEL_FRAMEBUFFER_BLIT_CRASH_WHEN_UNFOCUSED and in the pid crash log below it says something about glBlitFramebuffer which makes me think this workaround isn't being applied correctly
latest.log

Crash Report

Weirdly no crash-report was generated but a hs_err_pid****.log file was generated with this seeming to be the only readable info:

---------------  T H R E A D  ---------------

Current thread (0x000002ddb1da2360):  JavaThread "Render thread"        [_thread_in_native, id=14024, stack(0x000000dfd2300000,0x000000dfd2400000) (1024K)]

Stack: [0x000000dfd2300000,0x000000dfd2400000],  sp=0x000000dfd23fe4d0,  free space=1017k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [ig8icd64.dll+0x1b4926]  (no source info available)
C  [ig8icd64.dll+0x2132ff]  (no source info available)
C  [ig8icd64.dll+0x1bc55e]  (no source info available)
C  [ig8icd64.dll+0x21a42]  (no source info available)
C  [lwjgl_opengl.dll+0xf8fe]  (no source info available)
C  0x000002ddc840c960  (no source info available)

The last pc belongs to native method entry point (kind = native) (printed below).
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  org.lwjgl.opengl.GL30C.glBlitFramebuffer(IIIIIIIIII)V+0
j  org.lwjgl.opengl.GL30.glBlitFramebuffer(IIIIIIIIII)V+16
j  com.mojang.blaze3d.opengl.GlStateManager._glBlitFrameBuffer(IIIIIIIIII)V+19
j  net.minecraft.class_10874$class_10930.method_68812(IIIIIIIIIIII)V+45
j  net.minecraft.class_10860.presentTexture(Lcom/mojang/blaze3d/textures/GpuTextureView;)V+186
j  net.minecraft.class_276.method_1237()V+29
j  net.minecraft.class_310.method_1523(Z)V+455
j  net.minecraft.class_310.method_1514()V+102
j  net.minecraft.client.main.Main.main([Ljava/lang/String;)V+1645
j  java.lang.invoke.LambdaForm$DMH+0x000002ddde014400.invokeStaticInit(Ljava/lang/Object;Ljava/lang/Object;)V+10 java.base@24
j  java.lang.invoke.LambdaForm$MH+0x000002ddde1bcc00.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V+19 java.base@24
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 0x000002ddc8400fcd

siginfo: EXCEPTION_ACCESS_VIOLATION (0xc0000005), reading address 0x0000000000000010
commented

Does this also happen when you aren't using sodium (with or without ixeris)?

commented

So it happens when using Ixeris alone and also Sodium alone but when not using either of them it doesn't happen. So it slightly makes sense why it happens more often with both together?

commented

This is a bug in the Intel graphics driver. A while back, Sodium could detect this bug and apply a workaround to prevent the crashes (hence what you're seeing in the log file.) The workaround was removed from Sodium because Mojang themselves implemented the fix, but it seems they've since removed it and re-introduced the problem.

commented

oh rip still isn't fixed on sodiums side....

commented

Would it be feasible for us to reintroduce our workarounds for this? Or has Minecraft since once again fixed this on their end?

commented

I think you should, ixeris has added their own workaround for quite a while...

commented

Before we do that we'd need to know whether Minecraft has fixed this. Recent updates did include a number of fixes to performance bugs.

commented

Before we do that we'd need to know whether Minecraft has fixed this. Recent updates did include a number of fixes to performance bugs.

The issue is that I can't seem to be able to reproduce this in vanilla, according to decce6 in this issue comment he says:

Minecraft seems to be working around the Intel issue by skipping blitting when the window is minimized, which they track using the GLFW framebuffer size callback.

Which from my understanding means Minecraft has essentially fixed the issue which may be the reason I can't reproduce it in vanilla.

commented

So Minecraft has mitigated the bug but you're saying Sodium regresses it?

commented

So Minecraft has mitigated the bug but you're saying Sodium regresses it?

I guess so...

commented

Not very so, the vanilla fix for the issue is fundamentally broken as I said, because it uses the state from the last poll instead of actually asking the OS whether the window is minimized. If the window is minimized after the last glfwPollEvents and before blitting, it will crash. Sodium does not make any regression here.

I think there are two possible fixes for this issue:

  • Replace the call to Window#isMinimized with glfwGetWindowAttrib(window, GLFW_ICONIFIED)
    • We cannot guarantee the window is not be minimized between the check and the blit call, so this is only a band-aid fix that should make the issue mostly unnoticeable
  • When the Sodium's workaround for the specific Intel GPU is applied, replace the blit call with plain texture drawing with shader

The workaround I added to Ixeris is specific to it - I call glfwPollEvents much more frequent than vanilla, so the cached state can be used.