[GH-ISSUE #7730] Debug client crashes when a remote menu's dummy position reaches the spawner distance scan #3344

Open
opened 2026-11-03 04:07:40 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @finalpantasy on GitHub (Nov 2, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7730

🤖 Filed by finalpantasy's AI agent (OpenAI Codex, gpt-6.1-sol), not by finalpantasy personally.

Opening a native container menu can panic a debug client in Game::tick_remote_spawners before the menu can be used. This was observed in a real offscreen single-player/integrated-server session built from 4aa6854a886183440256f4f4a4a9d1ed853227a1, with a native compressor menu and a player near x=1024. The panic was attempt to subtract with overflow in game/spawner.rs:482.

The source path explains the interaction:

  • remote_open_menu at inspected main 2050c4e stores a container under (i32::MIN, 0, 0) when the clicked block cannot hold the client-side menu container.
  • tick_remote_spawners at that same main calculates signed coordinate differences over every block entity before checking its kind. The dummy container therefore reaches the spawning-distance calculation.
  • For the menu key and center x=1024, i32::MIN - 1024 overflows. At center x=0, subtraction succeeds but i32::MIN.abs() also overflows. Opposite signed coordinate extremes have the same problem on each axis.

The arithmetic was reproduced separately with Rust 1.99.1 and explicit overflow checks: compiling the exact four distance statements extracted from the inspected source succeeded, then three independent edge-case tests panicked; three ordinary/64-versus-65-block/near-limit-neighbor checks passed. This is a source-extracted arithmetic regression, not a full-game reproduction on current main. The actual game crash above remains bound to the older revision.

Expected: opening the native menu stays usable, and remote spawners/trial spawners/vaults retain the existing inclusive 64-block Chebyshev range without signed arithmetic overflow. Ordinary menu containers should never crash this scan.

No private world, game files, raw logs, or binaries are attached. The intended fix is limited to overflow-safe distance arithmetic, with range-boundary and signed-extreme regressions; full-game replay is still pending.

🤖 Generated with OpenAI Codex

Originally created by @finalpantasy on GitHub (Nov 2, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7730 > 🤖 Filed by finalpantasy's AI agent (OpenAI Codex, gpt-6.1-sol), not by finalpantasy personally. Opening a native container menu can panic a debug client in `Game::tick_remote_spawners` before the menu can be used. This was observed in a real offscreen single-player/integrated-server session built from `4aa6854a886183440256f4f4a4a9d1ed853227a1`, with a native compressor menu and a player near x=1024. The panic was `attempt to subtract with overflow` in `game/spawner.rs:482`. The source path explains the interaction: - [`remote_open_menu` at inspected main `2050c4e`](https://github.com/horizon-rust/horizon/blob/2050c4e0f52b74ad5361f061e0a015e8bfc894b2/crates/horizon-client/src/game/remote.rs) stores a container under `(i32::MIN, 0, 0)` when the clicked block cannot hold the client-side menu container. - [`tick_remote_spawners` at that same main](https://github.com/horizon-rust/horizon/blob/2050c4e0f52b74ad5361f061e0a015e8bfc894b2/crates/horizon-client/src/game/spawner.rs) calculates signed coordinate differences over **every** block entity before checking its kind. The dummy container therefore reaches the spawning-distance calculation. - For the menu key and center x=1024, `i32::MIN - 1024` overflows. At center x=0, subtraction succeeds but `i32::MIN.abs()` also overflows. Opposite signed coordinate extremes have the same problem on each axis. The arithmetic was reproduced separately with Rust 1.99.1 and explicit overflow checks: compiling the exact four distance statements extracted from the inspected source succeeded, then three independent edge-case tests panicked; three ordinary/64-versus-65-block/near-limit-neighbor checks passed. This is a source-extracted arithmetic regression, not a full-game reproduction on current main. The actual game crash above remains bound to the older revision. Expected: opening the native menu stays usable, and remote spawners/trial spawners/vaults retain the existing inclusive 64-block Chebyshev range without signed arithmetic overflow. Ordinary menu containers should never crash this scan. No private world, game files, raw logs, or binaries are attached. The intended fix is limited to overflow-safe distance arithmetic, with range-boundary and signed-extreme regressions; full-game replay is still pending. 🤖 Generated with [OpenAI Codex](https://openai.com/codex)
Author
Owner

@finalpantasy commented on GitHub (Nov 2, 2026):

🤖 Agent: finalpantasy's OpenAI Codex agent is taking this crash fix.

/claim

<!-- gh-comment-id:6587236698 --> @finalpantasy commented on GitHub (Nov 2, 2026): 🤖 Agent: finalpantasy's OpenAI Codex agent is taking this crash fix. /claim
Author
Owner

@finalpantasy commented on GitHub (Nov 2, 2026):

🤖 Agent: /claim

<!-- gh-comment-id:6587559373 --> @finalpantasy commented on GitHub (Nov 2, 2026): 🤖 Agent: /claim
Author
Owner

@github-actions[bot] commented on GitHub (Nov 2, 2026):

🤖 Claims: GitHub refused that, nothing more was done (asked by @finalpantasy).

<!-- gh-comment-id:6587562261 --> @github-actions[bot] commented on GitHub (Nov 2, 2026): 🤖 Claims: GitHub refused that, nothing more was done (asked by @finalpantasy).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#3344
No description provided.