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

go/src/net/lookup.go panic #42247

Closed
EdwardTanshuo opened this issue Oct 28, 2020 · 7 comments
Closed

go/src/net/lookup.go panic #42247

EdwardTanshuo opened this issue Oct 28, 2020 · 7 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@EdwardTanshuo
Copy link

EdwardTanshuo commented Oct 28, 2020

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

$ 1.13

Does this issue reproduce with the latest release?

It's very hard to reproduce, the project has run good in the product env for one year.

What did you do?

Our project uses official net library to connect to a remote server. It's weird to see a panic occurs in the online environment. We find out it's a panic thrown by the dnsWaitGroup (located in /go/src/net/lookup.go:266) which should only be waited in unit tests.

What did you expect to see?

no panic occur

What did you see instead?

err:sync: WaitGroup misuse: Add called concurrently with Wait

panic(0xf17d60, 0x12adb10)
	/usr/local/go/src/runtime/panic.go:679 +0x1b2
sync.(*WaitGroup).Add(0x1c4bcf8, 0x1)
	/usr/local/go/src/sync/waitgroup.go:77 +0x11d
net.(*Resolver).lookupIPAddr(0x1c2db00, 0x12e70e0, 0xc004724780, 0xc0001460fd, 0x3, 0xc000146101, 0x2b, 0xcea, 0x0, 0x0, ...)
	/usr/local/go/src/net/lookup.go:266 +0x49f
net.(*Resolver).internetAddrList(0x1c2db00, 0x12e70e0, 0xc004724780, 0xc0001460fd, 0x3, 0xc000146101, 0x30, 0x0, 0x0, 0x0, ...)
	/usr/local/go/src/net/ipsock.go:280 +0x605
net.(*Resolver).resolveAddrList(0x1c2db00, 0x12e70e0, 0xc004724780, 0x1136d15, 0x4, 0xc0001460fd, 0x3, 0xc000146101, 0x30, 0x0, ...)
	/usr/local/go/src/net/dial.go:220 +0x506
net.(*Dialer).DialContext(0xc0017520d8, 0x12e70a0, 0xc000040298, 0xc0001460fd, 0x3, 0xc000146101, 0x30, 0x0, 0x0, 0x0, ...)
	/usr/local/go/src/net/dial.go:402 +0x1fe
net.(*Dialer).Dial(...)
	/usr/local/go/src/net/dial.go:347
@davecheney
Copy link
Contributor

This looks like memory corruption. Have you tried running your program under the race detector? See https://blog.golang.org/race-detector .

@davecheney davecheney added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Oct 28, 2020
@davecheney
Copy link
Contributor

Please upgrade to go 1.15.3, go 1.13 is not longer supported

@EdwardTanshuo
Copy link
Author

This looks like memory corruption. Have you tried running your program under the race detector? See https://blog.golang.org/race-detector .

it's a very common code, gorm db client connect remote server and then panic when connections number grew up. I run our project with the race flag, it looks good.

@davecheney
Copy link
Contributor

Have you build and deployed a race enabled version of your program to verify that there are no races under production code?

@EdwardTanshuo
Copy link
Author

Have you build and deployed a race enabled version of your program to verify that there are no races under production code?

It's hard, the online deployment is build by CI, we could not incept into it

@davecheney
Copy link
Contributor

Then your best bet is to upgrade to a supported version of Go.

@ALTree
Copy link
Member

ALTree commented Jun 18, 2021

It seems likely this was caused by memory corruption or a data race, and we don't have a reproducer, so there's not much to investigate here. I'm closing the issue.

@ALTree ALTree closed this as completed Jun 18, 2021
@golang golang locked and limited conversation to collaborators Jun 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants