Describe the bug
Game freezes and eventually hard-crashes on the render thread while a monster
spawner's mob preview is being rendered. EMF throws a repeated
IndexOutOfBoundsException while writing vertex data for a custom model cube
(EMFModelPartCustom$EMFCube), which appears to leave Minecraft's pose stack
unbalanced. About 14 of these exceptions get logged in the same tick, immediately
followed by a fatal IllegalStateException: Pose stack not empty on the render
thread, which freezes the game completely (had to be force-closed via Task Manager).
This seems to be very rare, it only happened once in this session, right as a
spawner's preview mob was rendering, and I can't reliably reproduce it on demand.
To Reproduce
Steps to reproduce the behavior:
- Load a save with a monster spawner nearby whose preview entity uses a custom
(CEM) model via EMF/ETF.
- Be in render range while the spawner renders its spinning mob preview.
- Crash occurs spontaneously (no direct player action needed), could not
reliably reproduce a second time.
- See error / freeze.
Expected behavior
Spawner preview renders normally without corrupting the pose stack.
Screenshots
N/A (game froze, no visual glitch before the freeze).
Crashlog
See attached latest.log. Relevant section starts at the first
IndexOutOfBoundsException in EMFModelPartCustom$EMFCube, ends with:
[Render thread/ERROR] [net.minecraft.client.Minecraft/FATAL]: Unreported exception thrown!
java.lang.IllegalStateException: Pose stack not empty
at net.minecraft.client.renderer.LevelRenderer.m_109588_(LevelRenderer.java:1431)
at net.minecraft.client.renderer.LevelRenderer.m_109599_(LevelRenderer.java:1282)
at net.minecraft.client.renderer.GameRenderer.m_109089_(GameRenderer.java:1126)
at net.minecraft.client.renderer.GameRenderer.m_109093_(GameRenderer.java:909)
at net.minecraft.client.Minecraft.m_91383_(Minecraft.java:1146)
(please complete the following information):
- Minecraft Version: 1.20.1
- Forge Version: 47.4.23
- EMF version: 3.3.5
- ETF version: 7.2.1
- Does the issue persist with only EMF installed?: Not tested yet, happened in a
large modpack.
- if applicable, provide your modlist or log: https://mclo.gs/joA3vSQ
Additional context
The exception fires inside SpawnerRenderer -> EntityRenderDispatcher ->
MobRenderer, i.e. while rendering the mob preview inside a monster spawner block,
not a "live" mob in the world. The repeated IndexOutOfBoundsException on the
vertex buffer suggests the custom model for whatever entity was in the spawner had
more vertices/cubes than the allocated buffer expected. The thrown exception then
appears to skip the matching popPose() call, corrupting the pose stack for the
rest of the frame and crashing the render thread shortly after.
Describe the bug
Game freezes and eventually hard-crashes on the render thread while a monster
spawner's mob preview is being rendered. EMF throws a repeated
IndexOutOfBoundsExceptionwhile writing vertex data for a custom model cube(
EMFModelPartCustom$EMFCube), which appears to leave Minecraft's pose stackunbalanced. About 14 of these exceptions get logged in the same tick, immediately
followed by a fatal
IllegalStateException: Pose stack not emptyon the renderthread, which freezes the game completely (had to be force-closed via Task Manager).
This seems to be very rare, it only happened once in this session, right as a
spawner's preview mob was rendering, and I can't reliably reproduce it on demand.
To Reproduce
Steps to reproduce the behavior:
(CEM) model via EMF/ETF.
reliably reproduce a second time.
Expected behavior
Spawner preview renders normally without corrupting the pose stack.
Screenshots
N/A (game froze, no visual glitch before the freeze).
Crashlog
See attached
latest.log. Relevant section starts at the firstIndexOutOfBoundsExceptioninEMFModelPartCustom$EMFCube, ends with:(please complete the following information):
large modpack.
Additional context
The exception fires inside
SpawnerRenderer->EntityRenderDispatcher->MobRenderer, i.e. while rendering the mob preview inside a monster spawner block,not a "live" mob in the world. The repeated
IndexOutOfBoundsExceptionon thevertex buffer suggests the custom model for whatever entity was in the spawner had
more vertices/cubes than the allocated buffer expected. The thrown exception then
appears to skip the matching
popPose()call, corrupting the pose stack for therest of the frame and crashing the render thread shortly after.