term: clamp zero window size from Docker PTY#959
Open
tomholford wants to merge 1 commit intourbit:developfrom
Open
term: clamp zero window size from Docker PTY#959tomholford wants to merge 1 commit intourbit:developfrom
tomholford wants to merge 1 commit intourbit:developfrom
Conversation
When Docker allocates a PTY (tty: true + stdin_open: true) but nobody is attached, TIOCGWINSZ succeeds but reports 0x0. This causes unsigned underflow in row_l - 1 calculations throughout term.c and a decrement-underflow crash in Arvo's drum when it receives %blew [0 0]. Clamp to 80x24 defaults when ioctl returns zero dimensions, matching the existing fallback when ioctl fails. Also fix the initial default row_l from 0 to 24 to match col_l. Resolves urbit#159.
Fang-
approved these changes
Feb 9, 2026
Collaborator
Fang-
left a comment
There was a problem hiding this comment.
Regardless of where the dimensions come from, zeroes in %blew are bogus, so clamping like this is good. Arguably 0 == col_l instead of !col_l would be semantically clearer, but it's C, so readers know.
Collaborator
|
What version of vere are you running when you blow up with your reproduction commands? We've been unable to reproduce on linux-x86_64 and linux-aarch64. |
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.
Summary
tty: true+stdin_open: true) but nobody is attached,TIOCGWINSZsucceeds but reports 0x0row_l - 1calculations throughout term.c and adecrement-underflowcrash in drum when it receives%blew [0 0]row_lfrom 0 to 24Resolves #159.
Test plan
zig buildzig build -Dtarget=aarch64-linux-musl -Doptimize=ReleaseFasttty: true+stdin_open: trueand nodocker attach— ship boots without crashingdocker attach/ detach still works after bootReproduction steps