MarkusBordihn / BOs-Easy-NPC

Create easily NPC for your world or for your mod.
Other
20 stars 8 forks source link

[Crash Report] 1.20.1 FABRIC version causes crash on startup #203

Closed jacobgrau closed 5 months ago

jacobgrau commented 5 months ago

Description of the crash πŸ’₯ So I make modpacks for MC on modrinth and curseforge. And it seems the issue persists inside both of these environments. It appears it doesn't matter what mods I import with EASY NPC, but it happens ONLY when I have EASY NPC activated within the modpack.

I get a LWGCL crash report, saying that the OPENGL isnt properly installed or is missing. Which, let me tell you, I have done literally everything referring to my OPENGL. As I thought that was the issue (but everything works when I simply disable EASY NPC).

Now, to make this a little more complex, the crash can be reversed if you cleanly install the mods inside of a new instance. Then, the modpack opens and runs PERFECTLY fine. Until you close the game and try to reopen it. Then you get the error.

Steps to reproduce the crash βš™οΈ

  1. Download any sequence of mods, make sure that the FABRIC version of EASY NPC is also installed. To reproduce my exact crash I recommend modrinth or curseforge.
  2. Startup the pack and let it run for a short minute. Then close the pack.
  3. Try to reopen the pack as if you are coming back to play again, and open the logs to see the crash.

Expected behavior before the crash βœ”οΈ I expected to the pack to simply open and work. It works perfectly well on my server (with easy NPC's installed). Even after restarts. But it does not work after the 1st startup when I install the mod. I'm totally perplexed.

Logs πŸ“ Please provide the following logs:

Additional context πŸ“‹

NOTE: That everything works fine when I create a new pack and reinstall everything, OR I disable EASY NPC. I have checked all of my OPENGL files. I do not believe I have any issues with that.

MarkusBordihn commented 5 months ago

Thanks for the report. Unfortunately the logs give no clear indicator about the issue is in this case.

The error messages like:

957 | [12:08:06] [Render thread/INFO]: [Texture Manager] Registering texture fe6b766d-94a4-4e82-b4cf-4ca869131476.png with UUID fe6b766d-94a4-4e82-b4cf-4ca869131476.
--
958 | [12:08:06] [Render thread/INFO]: [STDERR]: Loading JNI library: lwjgl_stb
959 | [12:08:06] [Render thread/INFO]: [STDERR]:    Module: org.lwjgl.stb
960 | [12:08:06] [Render thread/INFO]: [STDERR]:    Loaded from org.lwjgl.librarypath: C:\Users\********\AppData\Roaming\com.modrinth.theseus\meta\natives\1.20.1-0.15.11\lwjgl_stb.dll

Seems not really related, because otherwise the mod would display an processing error if the texture could not be processed. The mod use only javax.imageio.ImageIO and com.mojang.blaze3d.platform.NativeImage for processing texture files.

I currently assume that a "optimization" mod like Sodium is causing this issues, because normally the used library are just using the CPU for processing and not any GPU and could not cause any Open GL error at all.

Do you have any CurseForge reference mod pack, where I could try to reproduce the issue ?

jacobgrau commented 5 months ago

So i've done a bit more testing. Even testing on other hardware. The issue consistently pops up when EASY NPC is active in ANY modpack I run. On every computer. I can attach a list of a sequence of mods. But essentially what I have been doing is picking a premade modpack on curseforge or modrinth and simply enabling editing and adding EASY NPC. It loads the first time, but then after I shut it down and try to reopen it, I get the error above. Drivers are updated, everything is fine. AND the same modpacks that dont work, work perfectly fine if EASY NPC isn't active. If I turn it off everything works fine. Even if I remove every single mod and just have easy NPC, it crashes the profile in which it was initially loaded up into.

If you want some exact modpacks I tested things on: The cobblemon modpack Bigchagguys Plus cobblemon Prominence II Create Official modpack

MarkusBordihn commented 5 months ago

Thanks a lot for the feedback I will run some test with the provided mod packs to see if I could isolate the issue.

MarkusBordihn commented 5 months ago

I tried "Dungeon Heros" (waited 5 min in the game) with several restarts, works fine: image image

I tried "Prominence II" (waited 5 min in the game) with several restarts, works fine: image image

Which mean I not really able to reproduce the issue and see no indicator that this mod is responsible for the crashes.

jacobgrau commented 5 months ago

I've started to narrow down the issue and it certainly is a conflict with specific types of mods. I'm going to get a general list (Some of these mods have millions of downloads, so I'm not sure if you want to specifically work on compatibility. But, i'll post them here at a later date.

Thank you very much for your help.

MarkusBordihn commented 5 months ago

I ran some automated test over the night and found the reason for these crashes.

java.lang.IllegalStateException: There is no OpenGL context current in the current thread.
    at org.lwjgl.opengl.GL.createCapabilities(GL.java:378) ~[lwjgl-opengl-3.2.2.jar:build 10]
    at org.lwjgl.opengl.GL.createCapabilities(GL.java:322) ~[lwjgl-opengl-3.2.2.jar:build 10]
    at de.markusbordihn.easynpc.client.texture.TextureManager.registerTexture(TextureManager.java:118) ~[main/:?]
    at de.markusbordihn.easynpc.client.texture.TextureManager.addCustomTexture(TextureManager.java:95) ~[main/:?]
    at de.markusbordihn.easynpc.client.texture.RemoteTextureManager.registerTexture(RemoteTextureManager.java:145) ~[main/:?]
    at de.markusbordihn.easynpc.client.texture.RemoteTextureManager.registerTexture(RemoteTextureManager.java:140) ~[main/:?]
    at de.markusbordihn.easynpc.io.RemoteSkinDataFiles.registerRemoteSkinData(RemoteSkinDataFiles.java:58) ~[main/:?]
    at de.markusbordihn.easynpc.io.DataFileHandler.registerDataFiles(DataFileHandler.java:49) ~[main/:?]
    at de.markusbordihn.easynpc.EasyNPCClient.onInitializeClient(EasyNPCClient.java:56) ~[main/:?]
    at net.fabricmc.loader.impl.FabricLoaderImpl.invokeEntrypoints(FabricLoaderImpl.java:383) [fabric-loader-0.14.24.jar:?]
    at net.fabricmc.loader.impl.game.minecraft.Hooks.startClient(Hooks.java:53) [fabric-loader-0.14.24.jar:?]
    at net.minecraft.client.Minecraft.<init>(Minecraft.java:452) [minecraft-project-@Fabric-merged-named.jar:?]
    at net.minecraft.client.main.Main.main(Main.java:197) [minecraft-project-@Fabric-merged-named.jar:?]
    at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470) [fabric-loader-0.14.24.jar:?]
    at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) [fabric-loader-0.14.24.jar:?]
    at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) [fabric-loader-0.14.24.jar:?]
    at net.fabricmc.devlaunchinjector.Main.main(Main.java:86) [dev-launch-injector-0.2.1+build.8.jar:?]

When the client is starting to slow or on a slow computer it could be that the screen is not loaded yet and so the game itself is not able to register the texture, which requires an already loaded screen.

I will move the texture registration to an later state and when this fixes the issue, I will provide a hotfix for this. Thanks again for your report and the provided details.