Repository navigation
Backport Ghostty opener-stderr fix (3b8141f): stop the CPU-pinning log loop - #1015
Merged
Merged
Conversation
Pin ThirdParty/ghostty to scgopi/ghostty graphcode-patches (ff98ec4), which is the current pin 30e1f3bb plus upstream 3b8141fbd8e2. Without it, an opener that writes a line to stderr leaves openThread spinning on an empty slice forever, one pinned core and a log flood per link opened. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: scgopi <scgopireddy@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1014.
Ghostty's
os/open.zigdrains the URL/file opener's stderr withtakeDelimiterExclusive('\n'), which never consumes the\n. Once the opener writes one line, for example after an OSC 8 link with an unknown scheme, every later read returns an empty slice. The detached thread spins forever: it pins a core, floods the unified log withos-open: open stderr=, and never reaps the child. Each link opened adds another stuck thread.Change
ThirdParty/ghosttynow points atscgopi/ghosttybranchgraphcode-patches(ff98ec4), which is the old pin30e1f3bbplus upstream3b8141fbd8e2and nothing else. It switches totakeDelimiterInclusiveand trims the\nbefore logging..gitmodulesURL moves to the fork, with a comment like the one on the zmx entry. Drop the fork once the pin moves past3b8141f.I picked this over bumping the pin because upstream is 1033 commits ahead, with unrelated Zig API migrations (
std.Io).Evidence
I tested a standalone Zig 0.15.2 copy of
openThread's loop. It drains a child that writes two stderr lines, capped at 1000 iterations.RED: zig test repro.zig, exclusive variant -> loop hits the 1000-iteration cap (spins without advancing)
GREEN: zig test repro.zig, inclusive variant -> exactly 2 lines read, EndOfStream, child reaped
REGRESSION: zig ast-check ThirdParty/ghostty/src/os/open.zig -> ok; takeDelimiterInclusive and std.mem.trimEnd both exist in the pinned zig 0.15.2 std