Skip to content

fix(create): defer pty setup to preserve nsenter logs - #972

Open
srinivasr wants to merge 1 commit into
urunc-dev:mainfrom
srinivasr:fix/961-nsenter-pty-setup
Open

fix(create): defer pty setup to preserve nsenter logs#972
srinivasr wants to merge 1 commit into
urunc-dev:mainfrom
srinivasr:fix/961-nsenter-pty-setup

Conversation

@srinivasr

Copy link
Copy Markdown

Description

urunc create previously created a PTY and attached it to nsenter immediately. if nsenter crashed 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.Start from createUnikontainer completely. nsenter now runs with standard streams so its errors propagate. terminal setup (opening the PTY, setsid, ioctl, dup2) has been deferred to the reexecUnikontainer process right before the final execve handoff. this matches the POSIX-compliant OCI standard.

Related issues

How was this tested?

ran make unittest locally.
verified compilation using nix shell and validated type safety across unix and pty syscalls.

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

  • I have read the contribution guide.
  • The linter passes locally (make lint).
  • The e2e tests of at least one tool pass locally (make test_ctr, make test_nerdctl, make test_docker, make test_crictl).
  • If LLMs were used: I have read the llm policy.

@netlify

netlify Bot commented Aug 14, 2026

Copy link
Copy Markdown

Deploy Preview for urunc canceled.

Name Link
🔨 Latest commit 90dce68
🔍 Latest deploy log https://app.netlify.com/projects/urunc/deploys/6a8308803a238300080abeed

@cmainas cmainas added invalid This doesn't seem right do-not-merge labels Aug 14, 2026
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
srinivasr force-pushed the fix/961-nsenter-pty-setup branch from 242b25c to 90dce68 Compare August 17, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge invalid This doesn't seem right

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Premature PTY setup in urunc create swallows nsenter failure logs

2 participants