You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[26.2] Hard game crash (EXCEPTION_ACCESS_VIOLATION in AMD driver) while chest editor is open – glReadPixels in MagnifierRenderer #7
Minecraft crashes hard (the whole Java process dies, no Minecraft crash report) whenever the Absolute Order chest editor is open. It doesn't only happen when using the magnifier – clicking buttons or doing anything else in the editor can trigger it too.
The crash happens inside the AMD OpenGL driver (atio6axx.dll), but in all 3 crashes the call comes from the same place in Absolute Order: glReadPixels in MagnifierRenderer.render.
So the driver is writing past the end of the ByteBuffer passed to glReadPixels.
Why it crashes on "random" clicks
EditorRenderer.render calls renderMagnifier every frame while the editor is open, so glReadPixels runs every frame – not only when the magnifier is actually used. Whatever I click last just happens to be the frame where it crashes.
Possible cause (my guess)
The buffer size itself looks right (size*size*4, GL_RGBA / GL_UNSIGNED_BYTE). But the pixel pack state is never set before the read, so if something else (vanilla 26.2 or another mod like Sodium/Iris) left a different state, the driver writes more data than the buffer can hold:
GL_PACK_ROW_LENGTH not 0 → driver uses a larger row stride → overflow
GL_PACK_SKIP_ROWS / GL_PACK_SKIP_PIXELS not 0
a GL_PIXEL_PACK_BUFFER still bound
the read happens during extractRenderState (26.2), where the bound read framebuffer isn't guaranteed
Also, Window.getWidth()/getHeight() are used for clamping – the actual framebuffer size can differ from that.
Suggested fix
Before glReadPixels: unbind GL_PIXEL_PACK_BUFFER, set GL_PACK_ALIGNMENT = 1 (or 4), GL_PACK_ROW_LENGTH = 0, GL_PACK_SKIP_ROWS = 0, GL_PACK_SKIP_PIXELS = 0 – and restore the old values afterwards
Bind the main render target as read framebuffer and use its real size
Only read pixels when the magnifier is actually active, not every frame (also better for performance – glReadPixels stalls the GPU)
Ideally use Minecraft's own readback API (copy texture to buffer) instead of raw GL calls
The crash comes from the two glReadPixels calls (loupe in MagnifierRenderer and eyedropper in ColorPickerGradients). They rely on the current GL pixel-pack state – if another mod leaves e.g. GL_PACK_ROW_LENGTH or a pixel pack buffer bound, the AMD driver writes past the end of the buffer and the JVM dies. That's also why it seemed to crash on "random" clicks: the loupe reads the framebuffer every frame while drawing in the editor.
I opened a PR with a fix: #8
It adds a small SafePixelReader that resets (and afterwards restores) the pack state, unbinds any pack buffer and uses the bounds-checked glReadnPixels when available. Nothing else in the mod is changed.
I've tested the patched build in-game with my full modpack (~124 mods, AMD GPU) – the editor, loupe and eyedropper all work perfectly and the crash is gone.
Thanks for the mod, it's really useful and fun! 👍 😁
Hi @DaPiCu, thank you so much for this report — it's honestly one of the best bug reports I've ever received. The hs_err analysis, the possible causes and even a working PR made it very easy to understand what's going on. 🙏
You're right that the editor reads the framebuffer with raw glReadPixels for the loupe and the eyedropper, and that it relies on whatever pixel-pack state is current. I really appreciate the fix in #8.
I won't merge it straight away though: the loupe and eyedropper exist in all 10 versions of the mod, and I want to take this as a chance to review every raw OpenGL call the editor makes, only read pixels when the loupe/eyedropper is actually in use, and test on AMD, NVIDIA and Intel (with Sodium/Iris too), so the fix covers more than this one case. I'll use your PR as the starting point for that.
The fix will ship in the next big update (2.1.0) for every Minecraft version and loader. I'll keep this issue open and update it when it's out. In the meantime, your patched build is the best workaround if you want to keep using the editor on your AMD card.
Thanks again, and I'm really glad you're enjoying the mod! 😁
Activity
DaPiCu commentedon Oct 20, 2026
Small update: I found the cause and fixed it.
The crash comes from the two
glReadPixelscalls (loupe inMagnifierRendererand eyedropper inColorPickerGradients). They rely on the current GL pixel-pack state – if another mod leaves e.g.GL_PACK_ROW_LENGTHor a pixel pack buffer bound, the AMD driver writes past the end of the buffer and the JVM dies. That's also why it seemed to crash on "random" clicks: the loupe reads the framebuffer every frame while drawing in the editor.I opened a PR with a fix: #8
It adds a small
SafePixelReaderthat resets (and afterwards restores) the pack state, unbinds any pack buffer and uses the bounds-checkedglReadnPixelswhen available. Nothing else in the mod is changed.I've tested the patched build in-game with my full modpack (~124 mods, AMD GPU) – the editor, loupe and eyedropper all work perfectly and the crash is gone.
Thanks for the mod, it's really useful and fun! 👍 😁
marcsanz-dev commentedon Oct 25, 2026
Hi @DaPiCu, thank you so much for this report — it's honestly one of the best bug reports I've ever received. The hs_err analysis, the possible causes and even a working PR made it very easy to understand what's going on. 🙏
You're right that the editor reads the framebuffer with raw glReadPixels for the loupe and the eyedropper, and that it relies on whatever pixel-pack state is current. I really appreciate the fix in #8.
I won't merge it straight away though: the loupe and eyedropper exist in all 10 versions of the mod, and I want to take this as a chance to review every raw OpenGL call the editor makes, only read pixels when the loupe/eyedropper is actually in use, and test on AMD, NVIDIA and Intel (with Sodium/Iris too), so the fix covers more than this one case. I'll use your PR as the starting point for that.
The fix will ship in the next big update (2.1.0) for every Minecraft version and loader. I'll keep this issue open and update it when it's out. In the meantime, your patched build is the best workaround if you want to keep using the editor on your AMD card.
Thanks again, and I'm really glad you're enjoying the mod! 😁