fix(create): defer pty setup to preserve nsenter logs - #972
Open
srinivasr wants to merge 1 commit into
Open
Conversation
✅ Deploy Preview for urunc canceled.
|
Remove premature PTY creation from urunc create and defer terminal setup to the reexec process before execve, preventing swallowed nsenter errors. Also remove redundant error initialization. Fixes: urunc-dev#961 Signed-off-by: B Srinivas Reddy <[email protected]>
srinivasr
force-pushed
the
fix/961-nsenter-pty-setup
branch
from
August 17, 2026 13:11
242b25c to
90dce68
Compare
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.
Description
urunc createpreviously created a PTY and attached it tonsenterimmediately. ifnsentercrashed or failed to join a namespace, its failure logs were swallowed by the prematurely attached PTY, resulting in a silent crash with zero debugging info.removed
pty.StartfromcreateUnikontainercompletely.nsenternow runs with standard streams so its errors propagate. terminal setup (opening the PTY,setsid,ioctl,dup2) has been deferred to thereexecUnikontainerprocess right before the finalexecvehandoff. this matches the POSIX-compliant OCI standard.Related issues
How was this tested?
ran
make unittestlocally.verified compilation using nix shell and validated type safety across
unixandptysyscalls.LLM usage
I used Gemini 3.1 Pro to help debug the terminal inheritance lifecycle. The final patch and testing were completed entirely by me.
Checklist
make lint).make test_ctr,make test_nerdctl,make test_docker,make test_crictl).