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

Open
bcmills opened this issue Apr 9, 2020 · 4 comments
Open

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.

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
4 participants
You can’t perform that action at this time.