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

runtime: unexpected SIGSEGV in goSchedImpl during build on freebsd-amd64-race #38334

Closed
bcmills opened this issue Apr 9, 2020 · 8 comments
Closed
Assignees
Milestone

Comments

@bcmills
Copy link
Member

@bcmills bcmills commented Apr 9, 2020

2020-04-09T01:17:53-0a18cbc/freebsd-amd64-race

fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0xd8 pc=0x43b791]

runtime stack:
runtime.throw(0xa4d8e9, 0x2a)
	/tmp/workdir/go/src/runtime/panic.go:1116 +0x72
runtime.sigpanic()
	/tmp/workdir/go/src/runtime/signal_unix.go:703 +0x45a
runtime.schedule()
	/tmp/workdir/go/src/runtime/proc.go:2647 +0x1a1
runtime.goschedImpl(0xc000983b00)
	/tmp/workdir/go/src/runtime/proc.go:2798 +0xda
runtime.gopreempt_m(0xc000983b00)
	/tmp/workdir/go/src/runtime/proc.go:2826 +0x34
runtime.newstack()
	/tmp/workdir/go/src/runtime/stack.go:1030 +0x1ae
runtime.morestack()
	/tmp/workdir/go/src/runtime/asm_amd64.s:449 +0x8f

CC @aclements @mknyszek @randall77

@randall77
Copy link
Contributor

@randall77 randall77 commented Apr 9, 2020

Looks like a nil goroutine pointer. Crashes here:

	if gp.lockedm != 0 {

It should never be nil, given this code, previous to the above:

	if gp == nil {
		gp, inheritTime = findrunnable() // blocks until work is available
	}

Possibly findrunnable is returning nil when it shouldn't.
It finds work from a bunch of places. Most have obvious if gp != nil { return gp } guards, or would have crashed with a nil gp, but the one that returns the result of globrunqget doesn't. And it looks like it can return nil, if there's no global work.

I have a possible fix.

@randall77
Copy link
Contributor

@randall77 randall77 commented Apr 9, 2020

Nope, nevermind, that path doesn't actually return the nil gp...

@randall77
Copy link
Contributor

@randall77 randall77 commented Apr 9, 2020

Maybe somehow sched.runq and sched.runqsize are getting out of sync? Or there is a nil entryin sched.runq?

@erifan
Copy link
Contributor

@erifan erifan commented Apr 10, 2020

I'm not sure if this is the same issue as #37257, but I feel they are related.

@toothrot
Copy link
Contributor

@toothrot toothrot commented Jun 11, 2020

@bcmills @randall77 Friendly ping for an update on this, as it's a release blocking issue for Go 1.15.

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Jun 11, 2020

Possibly related:

2020-05-28T21:13:51-5a00adf/linux-mips64le-mengzhuo
2020-05-07T04:45:51-9e81578/linux-mips64le-mengzhuo

I don't see any other occurrences in the build logs.

@cherrymui
Copy link
Contributor

@cherrymui cherrymui commented Jun 11, 2020

2020-05-28T21:13:51-5a00adf/linux-mips64le-mengzhuo

runtime.throw(0x12066fa9e, 0x2a)
/tmp/workdir-host-linux-mipsle-mengzhuo/go/src/runtime/panic.go:1116 +0x6c
runtime.sigpanic()
/tmp/workdir-host-linux-mipsle-mengzhuo/go/src/runtime/signal_unix.go:704 +0x5f0
runtime.osyield(0x1e, 0x0, 0x0, 0x1, 0x4, 0x0, 0x3, 0x12004bff8, 0x120a01718, 0x100000002, ...)
/tmp/workdir-host-linux-mipsle-mengzhuo/go/src/runtime/sys_linux_mips64x.s:495 +0x8

The faulting line is a RET instruction. The only possibility is the link register gets corrupted. I don't see how that could be possible...

@aclements
Copy link
Member

@aclements aclements commented Jun 25, 2020

Given that this only happened once and various people have determined that it appears impossible, this is almost certainly a flake. If it's not a flake, that's unfortunate, but there also doesn't appear to be anywhere near enough information to make further progress.

@aclements aclements closed this Jun 25, 2020
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
8 participants
You can’t perform that action at this time.