[GH-ISSUE #1705] macOS: integrated server panics with 'failed printing to stdout: Broken pipe' when the launcher has exited, world creation hangs #522

Closed
opened 2026-11-02 15:39:43 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @Louistuis on GitHub (Oct 25, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/1705

Version: Horizon v0.2.50, launcher 0.2.5, macOS 26 on Apple Silicon (M3, Metal)

What happened
I installed the launcher and prepared v0.2.50 without problems. After I pressed Play and created a new world, the game stayed on the world-creating loading screen and never entered the world.

Log (logs/latest.log)

[Server thread/INFO]: Player42810[/127.0.0.1:0] logged in with entity id 2 at (0.5, 115.0, 0.5)
[Server thread/ERROR]: Caught previously unhandled exception in thread Server thread: panicked at library/std/src/io/stdio.rs:1168:9:
failed printing to stdout: Broken pipe (os error 32)
[Render thread/INFO]: Horizon: disconnected: Connection closed by the server
[Render thread/WARN]: Horizon: the integrated server panicked

Cause (as far as I can tell)
The horizon-client process was orphaned (parent PID 1): the launcher window that started it had exited, so the client's stdout pipe was closed. The integrated server prints to stdout when the player logs in (println!), and Rust's println! panics on a broken pipe, which killed the server thread and left the client waiting.

Workaround
Killing the client and starting it by hand with its output redirected (horizon-client --resources <...>/.local/horizon-client/26.3 </dev/null >client.log 2>&1) works: the world logs in normally.

Suggested fix
Don't let a closed stdout/stderr take the game down: use a logging path that ignores EPIPE (or write with writeln!(...).ok()) in the server/client logging code, and/or have the launcher start the client with stdout and stderr redirected to a file or /dev/null instead of a pipe it may close. I did not look at the source to find the exact println! call.

I have not tried whether keeping the launcher window open avoids it.

Originally created by @Louistuis on GitHub (Oct 25, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/1705 **Version:** Horizon v0.2.50, launcher 0.2.5, macOS 26 on Apple Silicon (M3, Metal) **What happened** I installed the launcher and prepared v0.2.50 without problems. After I pressed Play and created a new world, the game stayed on the world-creating loading screen and never entered the world. **Log (`logs/latest.log`)** ``` [Server thread/INFO]: Player42810[/127.0.0.1:0] logged in with entity id 2 at (0.5, 115.0, 0.5) [Server thread/ERROR]: Caught previously unhandled exception in thread Server thread: panicked at library/std/src/io/stdio.rs:1168:9: failed printing to stdout: Broken pipe (os error 32) [Render thread/INFO]: Horizon: disconnected: Connection closed by the server [Render thread/WARN]: Horizon: the integrated server panicked ``` **Cause (as far as I can tell)** The `horizon-client` process was orphaned (parent PID 1): the launcher window that started it had exited, so the client's stdout pipe was closed. The integrated server prints to stdout when the player logs in (`println!`), and Rust's `println!` panics on a broken pipe, which killed the server thread and left the client waiting. **Workaround** Killing the client and starting it by hand with its output redirected (`horizon-client --resources <...>/.local/horizon-client/26.3 </dev/null >client.log 2>&1`) works: the world logs in normally. **Suggested fix** Don't let a closed stdout/stderr take the game down: use a logging path that ignores `EPIPE` (or write with `writeln!(...).ok()`) in the server/client logging code, and/or have the launcher start the client with stdout and stderr redirected to a file or `/dev/null` instead of a pipe it may close. I did not look at the source to find the exact `println!` call. I have not tried whether keeping the launcher window open avoids it.
Author
Owner

@rdbtCVS commented on GitHub (Oct 26, 2026):

🤖 Agent: rdbt's AI agent (OpenCode, GPT-6.1 Sol) is taking this issue in an isolated worktree. Current main still routes player login through game/lan.rs into dedicated::log_from, which uses println! on stdout. I'll make the smallest complete broken-pipe repair, verify the closed-output case, and run the required quick self-check. Kira claims are currently rate-limited, so this comment reserves the task.

<!-- gh-comment-id:6418593368 --> @rdbtCVS commented on GitHub (Oct 26, 2026): 🤖 Agent: rdbt's AI agent (OpenCode, GPT-6.1 Sol) is taking this issue in an isolated worktree. Current main still routes player login through game/lan.rs into dedicated::log_from, which uses println! on stdout. I'll make the smallest complete broken-pipe repair, verify the closed-output case, and run the required quick self-check. Kira claims are currently rate-limited, so this comment reserves the task.
Author
Owner

@kacpherek commented on GitHub (Oct 27, 2026):

This looks fixed by #2272 (the server's console log no longer panics when the launcher closes stdout, so the integrated server stays up).

<!-- gh-comment-id:6434368978 --> @kacpherek commented on GitHub (Oct 27, 2026): This looks fixed by #2272 (the server's console log no longer panics when the launcher closes stdout, so the integrated server stays up).
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#522
No description provided.