Although using the WaitGroup for synchronization, the goroutine is started but not executed #25583
Labels
FrozenDueToAge
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
Please answer these questions before submitting your issue. Thanks!
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/Mr.Liu/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/Mr.Liu/go"
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="0"
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build589254160=/tmp/go-build -gno-record-gcc-switches"
What did you do?
split list into a couple of sublist without break link and then respectively start goroutine to reverse it simultaneously.
runable code for reproducing error:
https://play.golang.org/p/xjsf7UayQuC
What did you expect to see?
the whole linked list was successfully reversed
What did you see instead?
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x450ae7]
goroutine 20 [running]:
main.reverse(0xc420088080, 0xc420090000, 0xc420092000)
/home/Mr.Liu/go/src/local/stackoverflow/tmp.go:71 +0xb7
created by main.(*LinkedList).Reverse
/home/Mr.Liu/go/src/local/stackoverflow/tmp.go:88 +0x119
The text was updated successfully, but these errors were encountered: