[crash] unexpected crash at WASM Voxel Game after destroying bedrock #70

Closed
opened 2026-05-05 13:22:10 +00:00 by enjin2310 · 1 comment

game crashed after i destroyed a bedrock block and i fell into the void for 20 tiles, i started flying and when i tried to go back to overworld game/browser crashed

game crashed after i destroyed a bedrock block and i fell into the void for 20 tiles, i started flying and when i tried to go back to overworld game/browser crashed
Owner

Fixed in spikerj/spikersoft-angular#6.

Root cause: each chunk holds a fixed stack of 16x16x16 sections. Destroying the world-floor block (bedrock) let the player fall into the void, where block/light/collision queries hit Y coordinates outside the section range. Chunk.getSection(y >> 4) returned undefined, and the next member access on it threw a TypeError that killed the render loop — white-screening and crashing the tab.

Fix: getSection() now returns a shared empty section for out-of-world Y, so void reads resolve to air and out-of-world writes are harmless no-ops. Added regression tests in Chunk.spec.ts.

Closing as resolved by the linked PR.

Fixed in spikerj/spikersoft-angular#6. Root cause: each chunk holds a fixed stack of 16x16x16 sections. Destroying the world-floor block (bedrock) let the player fall into the void, where block/light/collision queries hit Y coordinates outside the section range. `Chunk.getSection(y >> 4)` returned `undefined`, and the next member access on it threw a `TypeError` that killed the render loop — white-screening and crashing the tab. Fix: `getSection()` now returns a shared empty section for out-of-world Y, so void reads resolve to air and out-of-world writes are harmless no-ops. Added regression tests in `Chunk.spec.ts`. Closing as resolved by the linked PR.
Sign in to join this conversation.