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
Labels

Comments

@Xianic
Copy link

@Xianic 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 hidden.

@prattmic
Copy link
Member

@prattmic prattmic commented Sep 24, 2020

Duplicate of #41202

@prattmic prattmic marked this as a duplicate of #41202 Sep 24, 2020
@prattmic prattmic closed this Sep 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.