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: SIGSEGV in selfConnect #50033

Closed
bcmills opened this issue Dec 7, 2021 · 3 comments
Closed

net: SIGSEGV in selfConnect #50033

bcmills opened this issue Dec 7, 2021 · 3 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. okay-after-beta1 Used by release team to mark a release-blocker issue as okay to resolve either before or after beta1 release-blocker
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented Dec 7, 2021

--- FAIL: TestListenerClose (0.00s)
    --- FAIL: TestListenerClose/tcp (0.00s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x55c936]

goroutine 4380 [running]:
panic({0x62ab00, 0x7d2000})
	/tmp/workdir-host-dragonfly-amd64-master/go/src/runtime/panic.go:941 +0x397 fp=0xc000379630 sp=0xc000379570 pc=0x4350b7
testing.tRunner.func1.2({0x62ab00, 0x7d2000})
	/tmp/workdir-host-dragonfly-amd64-master/go/src/testing/testing.go:1360 +0x24e fp=0xc0003796e0 sp=0xc000379630 pc=0x4d55ce
testing.tRunner.func1()
	/tmp/workdir-host-dragonfly-amd64-master/go/src/testing/testing.go:1363 +0x39f fp=0xc000379848 sp=0xc0003796e0 pc=0x4d505f
runtime.deferCallSave(0xc000379918, 0xc000329f90?)
	/tmp/workdir-host-dragonfly-amd64-master/go/src/runtime/panic.go:750 +0x82 fp=0xc000379858 sp=0xc000379848 pc=0x434cc2
runtime.runOpenDeferFrame(0xc00035d310?, 0xc00035d360)
	/tmp/workdir-host-dragonfly-amd64-master/go/src/runtime/panic.go:723 +0x1a5 fp=0xc0003798a0 sp=0xc000379858 pc=0x434ae5
panic({0x62ab00, 0x7d2000})
	/tmp/workdir-host-dragonfly-amd64-master/go/src/runtime/panic.go:838 +0x207 fp=0xc000379960 sp=0xc0003798a0 pc=0x434f27
runtime.panicmem(...)
	/tmp/workdir-host-dragonfly-amd64-master/go/src/runtime/panic.go:220
runtime.sigpanic()
	/tmp/workdir-host-dragonfly-amd64-master/go/src/runtime/signal_unix.go:797 +0x336 fp=0xc0003799b0 sp=0xc000379960 pc=0x44b4f6
net.selfConnect(0x0?, {0x0?, 0x0?})
	/tmp/workdir-host-dragonfly-amd64-master/go/src/net/tcpsock_posix.go:123 +0x56 fp=0xc0003799f0 sp=0xc0003799b0 pc=0x55c936
net.(*sysDialer).doDialTCP(0xc0001c4580, {0x6b5ed8, 0xc000016168}, 0x0, 0x9?)
	/tmp/workdir-host-dragonfly-amd64-master/go/src/net/tcpsock_posix.go:91 +0x19c fp=0xc000379a98 sp=0xc0003799f0 pc=0x55c6fc
net.(*sysDialer).dialTCP(0x1?, {0x6b5ed8?, 0xc000016168?}, 0xc000132480?, 0x6226e0?)
	/tmp/workdir-host-dragonfly-amd64-master/go/src/net/tcpsock_posix.go:61 +0x59 fp=0xc000379ad8 sp=0xc000379a98 pc=0x55c4f9
net.(*sysDialer).dialSingle(0xc0001c4580, {0x6b5ed8, 0xc000016168}, {0x6b5690?, 0xc0001c2780})
	/tmp/workdir-host-dragonfly-amd64-master/go/src/net/dial.go:583 +0x28b fp=0xc000379ba8 sp=0xc000379ad8 pc=0x532bcb
net.(*sysDialer).dialSerial(0xc0001c4580, {0x6b5ed8, 0xc000016168}, {0xc00016c350?, 0x1, 0x6618c1?})
	/tmp/workdir-host-dragonfly-amd64-master/go/src/net/dial.go:551 +0x312 fp=0xc000379cb0 sp=0xc000379ba8 pc=0x532512
net.(*Dialer).DialContext(0xc000379e38, {0x6b5ed8, 0xc000016168}, {0x661730, 0x3}, {0xc00009cb60, 0xf})
	/tmp/workdir-host-dragonfly-amd64-master/go/src/net/dial.go:428 +0x736 fp=0xc000379e00 sp=0xc000379cb0 pc=0x531396
net.(*Dialer).Dial(...)
	/tmp/workdir-host-dragonfly-amd64-master/go/src/net/dial.go:351
net.Dial({0x661730?, 0x3?}, {0xc00009cb60?, 0x4d4b00?})
	/tmp/workdir-host-dragonfly-amd64-master/go/src/net/dial.go:319 +0x7a fp=0xc000379ea8 sp=0xc000379e00 pc=0x530b7a
net.TestListenerClose.func1(0xc000414000)
	/tmp/workdir-host-dragonfly-amd64-master/go/src/net/net_test.go:275 +0x395 fp=0xc000379f70 sp=0xc000379ea8 pc=0x5b9b55
testing.tRunner(0xc000414000, 0xc0000960c0)
	/tmp/workdir-host-dragonfly-amd64-master/go/src/testing/testing.go:1410 +0x102 fp=0xc000379fc0 sp=0xc000379f70 pc=0x4d4c02
testing.(*T).Run.func1()
	/tmp/workdir-host-dragonfly-amd64-master/go/src/testing/testing.go:1457 +0x2a fp=0xc000379fe0 sp=0xc000379fc0 pc=0x4d5aaa
runtime.goexit()
	/tmp/workdir-host-dragonfly-amd64-master/go/src/runtime/asm_amd64.s:1571 +0x1 fp=0xc000379fe8 sp=0xc000379fe0 pc=0x465ca1
created by testing.(*T).Run
	/tmp/workdir-host-dragonfly-amd64-master/go/src/testing/testing.go:1457 +0x35f

The faulting line is here:
https://cs.opensource.google/go/go/+/master:src/net/tcpsock_posix.go;l=123;drc=f229e7031a6efb2f23241b5da000c3b3203081d6

Just a few lines above that, there is a // TODO: try to understand what's really going on. dating to CL 5687060 (2012-02-21). 😅
See previously #14124, #38700.

@bcmills
Copy link
Contributor Author

bcmills commented Dec 7, 2021

The only failure like this in the logs is after CL 366536, so it seems somewhat likely that that change resulted in a new failure mode (perhaps a different form of #38700). Given that we're in the freeze, I'll revert that change and try a different approach.

greplogs --dashboard -md -l -e 'FAIL: TestListenerClose .*\n(?:\s+.*\n)*panic: runtime error: invalid memory address'

2021-12-07T18:58:57-4300f10/dragonfly-amd64

@bcmills bcmills self-assigned this Dec 7, 2021
@bcmills bcmills added okay-after-beta1 Used by release team to mark a release-blocker issue as okay to resolve either before or after beta1 release-blocker labels Dec 7, 2021
@bcmills bcmills added this to the Go1.18 milestone Dec 7, 2021
@bcmills bcmills added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Dec 7, 2021
@gopherbot
Copy link

Change https://golang.org/cl/369982 mentions this issue: Revert "net: in (*netFD).dial, use the passed in local address if getsockname fails"

@bcmills
Copy link
Contributor Author

bcmills commented Dec 8, 2021

Yep, definitely looking like a regression. Submitting the revert.

greplogs --dashboard -md -l -e '^goroutine \d+ \[running\]:\npanic.*\n\t.+\n(?:.+\n\t.+\n)*net\.selfConnect' --since=2021-01-01

2021-12-08T01:23:09-016e6eb/aix-ppc64
2021-12-07T18:58:57-4300f10/dragonfly-amd64

@bcmills bcmills changed the title net: SIGSEGV in TestListenerClose/tcp via selfConnect net: SIGSEGV in selfConnect Dec 8, 2021
@rsc rsc unassigned bcmills Jun 22, 2022
@golang golang locked and limited conversation to collaborators Jun 22, 2023
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. okay-after-beta1 Used by release team to mark a release-blocker issue as okay to resolve either before or after beta1 release-blocker
Projects
None yet
Development

No branches or pull requests

2 participants