Crash: IndexOutOfBoundsException on Tesselating block in world
When ever I load a certain area of my world the attached crash happens.
If the world is started as a server only the client crashes, but the crash report should speak for itself.
Steps to reproduce:
1. Download the attached world file
2. Log into this world
3. Look down
Description: Tesselating block in world java.lang.IndexOutOfBoundsException at java.nio.Buffer.checkIndex(Buffer.java:538) at java.nio.DirectByteBuffer.putFloat(DirectByteBuffer.java:887) at bfd.b(SourceFile:414) at bge.a(SourceFile:225) at bgd.a(SourceFile:67) at bht.b(SourceFile:176) at bhp.a(SourceFile:78) at bho.b(SourceFile:121) at bfr.a(SourceFile:842)
Note that this crash might be environment dependent.
How the world got corrupted like this
I had the world open to LAN and when I left it Minecraft hung (MC-72943). After forcing the process to stop and restarting the crash happened when ever joining the world again.
Search disclaimer
The only unresolved issue I could find which might be related to this one is MC-81252, but it has a completely different stack trace. There is many other issues about the same/similar crashes but as they are resolved I just assume that they have different causes.
Potential Fix
The reason for the exception is that a buffer for rendering overflows.
package net.minecraft.client.renderer; ... public class WorldRenderer { ... private void growBuffer(int p_178983_1_) { LogManager.getLogger().warn("Needed to grow BufferBuilder buffer: Old size " + this.bufferSize * 4 + " bytes, new size " + (this.bufferSize * 4 + p_178983_1_) + " bytes."); this.bufferSize += p_178983_1_ / 4; ByteBuffer var2 = GLAllocation.createDirectByteBuffer(this.bufferSize * 4); this.rawIntBuffer.position(0); var2.asIntBuffer().put(this.rawIntBuffer); this.byteBuffer = var2; this.rawIntBuffer = this.byteBuffer.asIntBuffer(); this.rawFloatBuffer = this.byteBuffer.asFloatBuffer(); } public void setVertexState(WorldRenderer.State p_178993_1_) { this.rawIntBuffer.clear(); // This call causes the crash. Calling growBuffer() when needed fixes the crash for me. this.rawIntBuffer.put(p_178993_1_.func_179013_a()); this.rawBufferIndex = p_178993_1_.getRawBufferIndex(); this.vertexCount = p_178993_1_.getVertexCount(); this.vertexFormat = new VertexFormat(p_178993_1_.func_179016_d()); } ... }
Growing the buffer might be the right fix, but it could also be that the reason why it overflows is a bug in the first place.