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

internal/poll: inconsistent poll.fdMutex while println string #25558

Closed
ayanamist opened this issue May 25, 2018 · 3 comments
Closed

internal/poll: inconsistent poll.fdMutex while println string #25558

ayanamist opened this issue May 25, 2018 · 3 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@ayanamist
Copy link

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

go version go1.10.2 linux/amd64

Does this issue reproduce with the latest release?

yes

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

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/ayanamist/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/ayanamist/go"
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build627852526=/tmp/go-build -gno-record-gcc-switches"

What did you do?

https://play.golang.org/p/TJrrijlC1Db
It can not be run in playground because "process took too long"
In my laptop, server and my mates' laptop, it can be reproduced.

What did you expect to see?

No panic

What did you see instead?

panic: inconsistent poll.fdMutex

goroutine 3002369 [running]:
internal/poll.(*fdMutex).rwlock(0xc420090050, 0x4b2400, 0x1)
        /usr/local/go/src/internal/poll/fd_mutex.go:145 +0x13f
internal/poll.(*FD).writeLock(0xc420090050, 0xc509628400, 0x2dcfbf)
        /usr/local/go/src/internal/poll/fd_mutex.go:237 +0x32
internal/poll.(*FD).Write(0xc420090050, 0xc5096200f0, 0xa, 0x10, 0x0, 0x0, 0x0)
        /usr/local/go/src/internal/poll/fd_unix.go:243 +0x46
os.(*File).write(0xc42000c018, 0xc5096200f0, 0xa, 0x10, 0xc5096200e8, 0x76, 0xc5096283c0)
        /usr/local/go/src/os/file_unix.go:243 +0x4e
os.(*File).Write(0xc42000c018, 0xc5096200f0, 0xa, 0x10, 0x8, 0xc509572630, 0x0)
        /usr/local/go/src/os/file.go:144 +0x6f
fmt.Fprintln(0x4c3ec0, 0xc42000c018, 0xc44b17d7a0, 0x2, 0x2, 0x492320, 0xc420098000, 0xc5096200e8)
        /usr/local/go/src/fmt/print.go:255 +0x8b
fmt.Println(0xc44b17d7a0, 0x2, 0x2, 0xc5096200e8, 0xc420098088, 0x0)
        /usr/local/go/src/fmt/print.go:264 +0x57
main.main.func1(0xc420014080, 0x2dcfbf)
        /home/ayanamist/test.go:18 +0xfe
created by main.main
        /home/ayanamist/test.go:17 +0xf6
exit status 2
@ianlancetaylor ianlancetaylor changed the title inconsistent poll.fdMutex while println string internal/poll: inconsistent poll.fdMutex while println string May 25, 2018
@ianlancetaylor
Copy link
Contributor

My first guess is that the program gets up to 0xfffff simultaneous writes, which the fdMutex code does not support.

@ianlancetaylor ianlancetaylor added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label May 25, 2018
@ianlancetaylor ianlancetaylor added this to the Go1.11 milestone May 25, 2018
@ayanamist
Copy link
Author

Can it provide a more friendly panic message?

@gopherbot
Copy link

Change https://golang.org/cl/119956 mentions this issue: internal/poll: better panic message for lock overflow

@golang golang locked and limited conversation to collaborators Jun 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge 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

3 participants