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

net: concurrent map write in DNS resolution #50440

Open
Saner-Lee opened this issue Jan 5, 2022 · 3 comments
Open

net: concurrent map write in DNS resolution #50440

Saner-Lee opened this issue Jan 5, 2022 · 3 comments

Comments

@Saner-Lee
Copy link

@Saner-Lee Saner-Lee commented Jan 5, 2022

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

$ go version

1.17.5

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

fatal error: concurrent map writes

goroutine 303 [running]:
runtime.throw({0x1801301, 0x8})
	/opt/hostedtoolcache/go/1.17.5/x64/src/runtime/panic.go:1198 +0x71 fp=0xc000508980 sp=0xc000508950 pc=0x434291
runtime.mapassign_faststr(0x15dce00, 0xc0003dc7e0, {0xc00003f200, 0x3a})
	/opt/hostedtoolcache/go/1.17.5/x64/src/runtime/map_faststr.go:294 +0x38b fp=0xc0005089e8 sp=0xc000508980 pc=0x412c4b
internal/singleflight.(*Group).DoChan(0xc000300370, {0xc00003f200, 0x1e4a805a7b18}, 0xc0003bcd40)
	/opt/hostedtoolcache/go/1.17.5/x64/src/internal/singleflight/singleflight.go:85 +0x213 fp=0xc000508a58 sp=0xc0005089e8 pc=0x5fbd53
net.(*Resolver).lookupIPAddr(0xc000300360, {0x1a0b028, 0xc0000b0000}, {0x17f1a5e, 0x0}, {0xc00003f180, 0x37})
	/opt/hostedtoolcache/go/1.17.5/x64/src/net/lookup.go:294 +0x50b fp=0xc000508bd8 sp=0xc000508a58 pc=0x6150cb
net.(*Resolver).internetAddrList(0x1a0b028, {0x1a0b028, 0xc0000b0000}, {0x17f1a5e, 0x2}, {0xc00003f180, 0x1a0b028})
	/opt/hostedtoolcache/go/1.17.5/x64/src/net/ipsock.go:288 +0x67a fp=0xc000508cf8 sp=0xc000508bd8 pc=0x6130da
net.(*Resolver).LookupIP(0xc000508e10, {0x1a0b028, 0xc0000b0000}, {0x17f1a5e, 0x2}, {0xc00003f180, 0x37})
	/opt/hostedtoolcache/go/1.17.5/x64/src/net/lookup.go:224 +0xf9 fp=0xc000508d90 sp=0xc000508cf8 pc=0x6148f9
github.com/ymatrix-data/matrixpod/dns.(*consistentIPChecker).WaitForIP(0xc000300360, {0x1a0b028, 0xc0000b0000}, {0xc00003f180, 0x37}, {0xc00031af80, 0x10, 0x10})
	/home/runner/work/matrixdb-ci/matrixdb-ci/dns/check.go:37 +0x155 fp=0xc000508e48 sp=0xc000508d90 pc=0x13b7b35
github.com/ymatrix-data/matrixpod/dns.WaitUntilResultAvailable({0xc00003f180, 0x37}, {0xc0003de4d0, 0x9})
	/home/runner/work/matrixdb-ci/matrixdb-ci/dns/check.go:78 +0xf4 fp=0xc000508ec0 sp=0xc000508e48 pc=0x13b7ef4
github.com/ymatrix-data/matrixpod/ssh.scanHostKeys.func1.1(0xc0002b3aa0)
	/home/runner/work/matrixdb-ci/matrixdb-ci/ssh/controller.go:35 +0x14b fp=0xc000508fc8 sp=0xc000508ec0 pc=0x145d04b
github.com/ymatrix-data/matrixpod/ssh.scanHostKeys.func1·dwrap·1()
	/home/runner/work/matrixdb-ci/matrixdb-ci/ssh/controller.go:48 +0x2d fp=0xc000508fe0 sp=0xc000508fc8 pc=0x145cecd
runtime.goexit()
	/opt/hostedtoolcache/go/1.17.5/x64/src/runtime/asm_amd64.s:1581 +0x1 fp=0xc000508fe8 sp=0xc000508fe0 pc=0x464381
created by github.com/ymatrix-data/matrixpod/ssh.scanHostKeys.func1
	/home/runner/work/matrixdb-ci/matrixdb-ci/ssh/controller.go:29 +0x25e

What did you do?

Found in the process of github action ci/cd, no recurring method was found

What did you expect to see?

no panic.

What did you see instead?

concurrent fault in singleflight.

@ianlancetaylor ianlancetaylor changed the title affected/package: net: concurrent map write in DNS resolution Jan 5, 2022
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Jan 5, 2022

Does this happen repeatedly? Can you show us code to recreate the problem? Thanks.

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Jan 5, 2022

This is odd. The code is clearly using a lock around the map writes. I don't see how this is possible. Unless there is something corrupting memory.

@Saner-Lee
Copy link
Author

@Saner-Lee Saner-Lee commented Jan 5, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants