Skip to content

os/exec: hungup error on Plan 9 while copying stdin #35753

@fhs

Description

@fhs

What version of Go are you using (go version)?

$ go version
go version devel +master Thu Nov 21 01:22:38 EST 2019 plan9/386

What did you do?

Run this program:

package main

import (
	"log"
	"os"
	"os/exec"
	"strings"
)

func main() {
	cmd := exec.Command("date")
	cmd.Stdin = strings.NewReader("hello\n")
	cmd.Stdout = os.Stdout
	cmd.Stderr = os.Stderr
	if err := cmd.Run(); err != nil {
		log.Fatalf("Run failed: %v", err)
	}
}

What did you expect to see?

No error

What did you see instead?

cpu% go run main.go
Thu Nov 21 12:33:54 EST 2019
2019/11/21 12:33:54 Run failed: write |1: i/o on hungup channel
exit status: 'main 100206: 1'

Note: This issue is causing some go/packages tests to fail. See https://build.golang.org/log/f8afda4bf9009c118c39705ccf38712f705ab249

I propose ignoring this error, similar to how EPIPE is currently being ignored in unix.

@gopherbot Please add labels OS-Plan9, NeedsFix

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.OS-Plan9

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions