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

x/playground: Faking the network example periodically deadlocks #48394

Open
matthewmueller opened this issue Sep 15, 2021 · 4 comments
Open

x/playground: Faking the network example periodically deadlocks #48394

matthewmueller opened this issue Sep 15, 2021 · 4 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@matthewmueller
Copy link

matthewmueller commented Sep 15, 2021

Problem

While reading about how "Faking the Network" works on the Go playground at https://go.dev/blog/playground, I'm running into the following error almost every time.

fatal error: all goroutines are asleep - deadlock!

goroutine 1 [IO wait]:
internal/poll.runtime_pollWait(0x7f5332a0ee88, 0x72)
	/usr/local/go-faketime/src/runtime/netpoll.go:229 +0x89
internal/poll.(*pollDesc).wait(0xc0000c0000, 0x0, 0x0)
	/usr/local/go-faketime/src/internal/poll/fd_poll_runtime.go:84 +0x32
internal/poll.(*pollDesc).waitRead(...)
	/usr/local/go-faketime/src/internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Accept(0xc0000c0000)
	/usr/local/go-faketime/src/internal/poll/fd_unix.go:402 +0x22c
net.(*netFD).accept(0xc0000c0000)
	/usr/local/go-faketime/src/net/fd_unix.go:173 +0x35
net.(*TCPListener).accept(0xc0000ac030)
	/usr/local/go-faketime/src/net/tcpsock_posix.go:140 +0x28
net.(*TCPListener).Accept(0xc0000ac030)
	/usr/local/go-faketime/src/net/tcpsock.go:262 +0x3d
main.main()
	/tmp/sandbox825819739/prog.go:24 +0x102

You can reproduce this by clicking on the Run button in the blog post a couple times. It does occasionally work and responds with with Hello, network. Maybe 1 in 5 times.

Screenshot

CleanShot 2021-09-14 at 22 40 49

@gopherbot gopherbot added this to the Unreleased milestone Sep 15, 2021
@matthewmueller matthewmueller changed the title x/playground: Faking the network example periodically deadlocking x/playground: Faking the network example periodically deadlocks Sep 15, 2021
@seankhliao seankhliao added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Sep 15, 2021
@seankhliao
Copy link
Member

cc @toothrot

@toothrot
Copy link
Contributor

Thanks, this is likely a bug in the faketime patch, as you mentioned. Our new(-ish) sandbox containers do not require the faketime patch anymore, but we've yet to remove it from Go, or update the playground for its removal, as it also impacts how program output is parsed.

I'm not positive on any ETA for resolving this.

@bcap
Copy link

bcap commented Oct 12, 2022

Recent reddit thread on r/golang about this: https://www.reddit.com/r/golang/comments/y1z0he/headscratching_deadlock_problem/

@bcap
Copy link

bcap commented Oct 12, 2022

Our new(-ish) sandbox containers do not require the faketime patch anymore, but we've yet to remove it from Go, or update the playground for its removal, as it also impacts how program output is parsed.

@toothrot this was roughly 1y ago. How is the situation now? Can faketime be removed from the golang playground?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

5 participants