fix(tty): preserve OPOST chars when output is full#1987
Merged
fslongjin merged 2 commits intoJun 25, 2026
Conversation
Member
Author
|
@codex review |
Signed-off-by: longjin <longjin@dragonos.org>
45a3f3f to
140b043
Compare
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Signed-off-by: longjin <longjin@dragonos.org>
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
n_tty/bin/trueand/bin/falsefrom coreutils in the rootfs for Linux-compatible absolute paths used by gVisor testsRoot Cause
process_output_char_to_buf()returnedENOBUFSwith an empty temporary output buffer whenOPOST | ONLCRneeded to expand\ninto\r\nbut only one output byte of room was available. The caller then treated the empty buffer as a valid consumed-without-output character and advanced the input offset, silently dropping the input newline.Linux
n_ttykeeps these states distinct: output full means retry without consuming input, whileONOCRat column zero is a valid zero-output consume.The follow-up Integration Test failure in
Waiters/WaitSpecificChildTest.AfterChildExecve/{0,1}matched the currentorigin/masterbaseline failure ate7331811004d725d8303b2ee01878d425ebba63d: the test execs/bin/true, while the DragonOS rootfs only installed coreutilstrueunder/usr/local/bin/true. The child therefore exited withENOENT(2), and wait observed status512/2.Validation
make kernelmake useruser/dadk/config/all/core_utils-9.4.0.tomlbin/dadk_cache/build/core_utils_9_4_0/bin/truebin/dadk_cache/build/core_utils_9_4_0/bin/falsebin/sysroot/bin/truebin/sysroot/bin/falsemake fmtFORCE_UNSAFE_CONFIGURE=1 DUNITEST_PATTERN=normal/tty_pty_hangup make test-dunitDUNITEST_PATTERNinto the guest, so this ran full dunitest.TtyPtyHangup.TciflushDoesNotDiscardLargeOpostSlaveOutputpassed in 27 ms.