Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deadlock error in documentation example code #41609

Closed
Xianic opened this issue Sep 24, 2020 · 2 comments
Closed

Deadlock error in documentation example code #41609

Xianic opened this issue Sep 24, 2020 · 2 comments

Comments

@Xianic
Copy link

Xianic commented Sep 24, 2020

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

1.14.8

(stated on about page of https://play.golang.org )

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

Whatever the go playground uses. I haven't found a way to exec the go binary to find out, I expect this is intentional.

What did you do?

Find the documentation for os/exec.Cmd.StdoutPipe() and run the example code.

What did you expect to see?

Bob is 32 years old

What did you see instead?

fatal error: all goroutines are asleep - deadlock!

goroutine 1 [IO wait]:
internal/poll.runtime_pollWait(0x7f3fdaba8ee8, 0x72, 0x53a0c0)
	/usr/local/go-faketime/src/runtime/netpoll.go:220 +0x55
internal/poll.(*pollDesc).wait(0xc000084198, 0x72, 0xc00009c001, 0x200, 0x200)
	/usr/local/go-faketime/src/internal/poll/fd_poll_runtime.go:87 +0x45
internal/poll.(*pollDesc).waitRead(...)
	/usr/local/go-faketime/src/internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Read(0xc000084180, 0xc00009c000, 0x200, 0x200, 0x0, 0x0, 0x0)
	/usr/local/go-faketime/src/internal/poll/fd_unix.go:159 +0x1b1
os.(*File).read(...)
	/usr/local/go-faketime/src/os/file_posix.go:31
os.(*File).Read(0xc000082018, 0xc00009c000, 0x200, 0x200, 0xc000066e60, 0x40ce10, 0xc000092160)
	/usr/local/go-faketime/src/os/file.go:116 +0x71
encoding/json.(*Decoder).refill(0xc000092160, 0xc000092160, 0x7f3fdaba04d0)
	/usr/local/go-faketime/src/encoding/json/stream.go:165 +0xeb
encoding/json.(*Decoder).readValue(0xc000092160, 0x0, 0x0, 0x50a2c0)
	/usr/local/go-faketime/src/encoding/json/stream.go:140 +0x1ff
encoding/json.(*Decoder).Decode(0xc000092160, 0x4efae0, 0xc0000980c0, 0x539f60, 0xc000082018)
	/usr/local/go-faketime/src/encoding/json/stream.go:63 +0x79
main.main()
	/tmp/sandbox568913125/prog.go:23 +0x237
@seankhliao

This comment has been minimized.

@prattmic
Copy link
Member

Duplicate of #41202

@prattmic prattmic marked this as a duplicate of #41202 Sep 24, 2020
@golang golang locked and limited conversation to collaborators Sep 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants