You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
go1.24rc2 seems to cause some terminal prompt testing programs to block forever. These programs previously ran fine on go1.23.5.
git bisect points to https://go-review.googlesource.com/c/go/+/603295. Specifically, the added syscall logic written, err, handled = poll.SendFile(&f.pfd, int(fd), remain) isn't returning.
I ran the go program provided below in go1.23.5 and it runs to completion with the expected result.
$ GO111MODULE=on /home/user/src/go/bin/go version
go version go1.23.5 linux/amd64
$ GO111MODULE=on /home/user/src/go/bin/go run .
0xc000142780 0xc000142660 9223372036854775807
(0x0,0x0)
pass: true , error: <nil>
In go1.24rc2 this program blocks forever
$ GO111MODULE=on /home/user/gocode/src/github.com/golang/go/bin/go version
go version go1.24rc2 linux/amd64
$ GO111MODULE=on /home/user/gocode/src/github.com/golang/go/bin/go run .
0xc0001b86c0 0xc0001b85a0 9223372036854775807
(0x0,0x0)
Standalone Reproducing Go Program
package main
import (
"fmt"
"os"
expect "github.com/Netflix/go-expect"
"github.com/creack/pty"
"github.com/hinshun/vt10x"
survey "github.com/AlecAivazis/survey/v2"
)
const (
_prompt = "Name of the user"
_response = "gopher"
)
// A program to test the interactive prompts of our cli tools.
func main() {
tty := setupTTY()
var res string
err := survey.AskOne(&survey.Input{Message: _prompt}, &res, survey.WithStdio(tty, tty, tty))
fmt.Println("pass: ", res == _response, ", error: ", err)
}
func setupTTY() *os.File {
ptm, pts, err := pty.Open()
if err != nil {
panic(err)
}
term := vt10x.New(vt10x.WithWriter(pts))
console, err := expect.NewConsole(
expect.WithStdin(ptm),
expect.WithStdout(term),
expect.WithCloser(pts, ptm),
)
if err != nil {
panic(err)
}
go func() {
// console.ExpectString blocks forever on go1.24rc2
// git bisect points to https://go-review.googlesource.com/c/go/+/603295
// Specifically, the syscall never returns.
// ```written, err, handled = poll.SendFile(&f.pfd, int(fd), remain)```
// never returns.
_, err := console.ExpectString(_prompt)
if err != nil {
panic(err)
}
_, err = console.SendLine(_response)
if err != nil {
panic(err)
}
_, err = console.ExpectEOF()
if err != nil {
panic(err)
}
}()
return console.Tty()
}
PS: I tried creating a Go Playground but ran into timeouts.
What did you see happen?
On go1.24rc2 the program blocked.
What did you expect to see?
I expected the program to terminate with the expected result printed.
The text was updated successfully, but these errors were encountered:
Go version
go1.24rc2
Output of
go env
in your module/workspace:go env
What did you do?
go1.24rc2
seems to cause some terminal prompt testing programs to block forever. These programs previously ran fine ongo1.23.5
.git bisect points to https://go-review.googlesource.com/c/go/+/603295. Specifically, the added syscall logic
written, err, handled = poll.SendFile(&f.pfd, int(fd), remain)
isn't returning.I ran the go program provided below in go1.23.5 and it runs to completion with the expected result.
In go1.24rc2 this program blocks forever
Standalone Reproducing Go Program
PS: I tried creating a Go Playground but ran into timeouts.
What did you see happen?
On go1.24rc2 the program blocked.
What did you expect to see?
I expected the program to terminate with the expected result printed.
The text was updated successfully, but these errors were encountered: