Repository navigation
Pin creack/pty past the lost-TIOCGPTN bug to fix a flaky pane start - #54
Merged
Merged
Conversation
TestCreatorEveryWayFromAfar failed in CI now and then with "fork/exec …: operation not permitted". creack/pty v1.1.20–v1.1.24 turned the pointer for TIOCGPTN into a uintptr before the call making the system call, so a GC shrinking the goroutine's stack in between had the kernel write the pty's number into the old stack: Open read 0, opened /dev/pts/0 — another pane's terminal — and TIOCSCTTY failed with EPERM. The fix (creack/pty#215) is merged upstream but unreleased, so go.mod pins the master pseudo-version. TestPtyOpenNamesItsOwnTerminal (Linux) opens ptys under GC pressure and checks each tty is the master's own: on v1.1.24 it fails within a run, on the pinned version 0 wrong in ~110k opens. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.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.
TestCreatorEveryWayFromAfar failed in CI now and then with
fork/exec …: operation not permitted.Cause. creack/pty v1.1.20–v1.1.24 turns the pointer for TIOCGPTN into a uintptr before the call that makes the system call. A GC that shrinks the goroutine's stack in between has the kernel write the pty's number into the old stack.
Openthen reads 0, opens/dev/pts/0(another pane's terminal), and TIOCSCTTY fails with EPERM.Fix. The upstream fix (creack/pty#215) is merged but not released, so
go.modpins the master pseudo-version, with a comment saying why.go mod tidyalso movespkg/sftpto a direct requirement.Test.
TestPtyOpenNamesItsOwnTerminal(Linux only) opens ptys under GC pressure and checks that each tty belongs to its own master.go test -race -count=1 ./...,go vet ./...andgofmt -l cmd internalpass on macOS.🤖 Generated with Claude Code