$ go build test.go ; for k in 5 50 500 5000 50000 500000; do echo -n $k; time ./test $k > /dev/null; done
5
CPU: 0.00s Real: 0.00s RAM: 3972KB
50
CPU: 0.33s Real: 0.09s RAM: 49672KB
500
CPU: 4.21s Real: 0.95s RAM: 521536KB
5000panic: too many concurrent operations on a single file or socket (max 1048575)
goroutine 3364987 [running]:
internal/poll.(*fdMutex).rwlock(0xc0000680c0, 0x0, 0x0)
/usr/lib/go/src/internal/poll/fd_mutex.go:147 +0x13f
internal/poll.(*FD).writeLock(...)
/usr/lib/go/src/internal/poll/fd_mutex.go:239
internal/poll.(*FD).Write(0xc0000680c0, 0xc0b28575d0, 0x8, 0x8, 0x0, 0x0, 0x0)
/usr/lib/go/src/internal/poll/fd_unix.go:255 +0x4e
os.(*File).write(...)
/usr/lib/go/src/os/file_unix.go:280
os.(*File).Write(0xc00000e018, 0xc0b28575d0, 0x8, 0x8, 0x0, 0xc0b2b79f60, 0x40890b)
/usr/lib/go/src/os/file.go:145 +0x76
fmt.Fprintln(0x4d2300, 0xc00000e018, 0xc0b2b79fb0, 0x1, 0x1, 0x0, 0x0, 0x0)
/usr/lib/go/src/fmt/print.go:266 +0x8b
fmt.Println(...)
/usr/lib/go/src/fmt/print.go:275
main.main.func1(0xc000014130, 0x33583c)
/tmp/test.go:24 +0xac
created by main.main
/tmp/test.go:22 +0xe7
Command exited with non-zero status 2
What version of Go are you using (
go version)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env)?go envOutputWhat did you do?
Running old code that works on go 1.8 but failed on go 1.12
https://stackoverflow.com/questions/41894046/
What did you expect to see?
no error as previous version of go 1.8
What did you see instead?