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: -l=4 build fails on Solaris #23168

Open
bradfitz opened this Issue Dec 18, 2017 · 4 comments

Comments

Projects
None yet
5 participants
@bradfitz
Member

bradfitz commented Dec 18, 2017

Starting with @thanm's https://go-review.googlesource.com/c/go/+/83675, the cmd/link/internal/ld tests are failing on Solaris with:

https://build.golang.org/log/c7bc05a2441135a63ae2929882eeb166e17f9df8

--- FAIL: TestInlinedRoutineRecords (4.32s)
	dwarf_test.go:97: build: # command-line-arguments
		runtime.dopanic: nosplit stack overflow
			744	assumed on entry to runtime.cgocallbackg (nosplit)
			584	after runtime.cgocallbackg (nosplit) uses 160
			576	on entry to runtime.exitsyscall (nosplit)
			480	after runtime.exitsyscall (nosplit) uses 96
			472	on entry to runtime.casgstatus (nosplit)
			128	after runtime.casgstatus (nosplit) uses 344
			120	on entry to runtime.asmcgocall (nosplit)
			112	on entry to gosave (nosplit)
			104	on entry to runtime.badctxt (nosplit)
			80	after runtime.badctxt (nosplit) uses 24
			72	on entry to runtime.throw (nosplit)
			48	after runtime.throw (nosplit) uses 24
			40	on entry to runtime.dopanic (nosplit)
			-8	after runtime.dopanic (nosplit) uses 48
		runtime.dopanic: nosplit stack overflow
			744	assumed on entry to runtime.needm (nosplit)
			456	after runtime.needm (nosplit) uses 288
			448	on entry to runtime.casgstatus (nosplit)
			104	after runtime.casgstatus (nosplit) uses 344
			96	on entry to runtime.asmcgocall (nosplit)
			88	on entry to gosave (nosplit)
			80	on entry to runtime.badctxt (nosplit)
			56	after runtime.badctxt (nosplit) uses 24
			48	on entry to runtime.throw (nosplit)
			24	after runtime.throw (nosplit) uses 24
			16	on entry to runtime.dopanic (nosplit)
			-32	after runtime.dopanic (nosplit) uses 48
		runtime.dieFromSignal: nosplit stack overflow
			744	assumed on entry to runtime.sigtrampgo (nosplit)
			480	after runtime.sigtrampgo (nosplit) uses 264
			472	on entry to runtime.sigfwdgo (nosplit)
			416	after runtime.sigfwdgo (nosplit) uses 56
			408	on entry to runtime.dieFromSignal (nosplit)
			-80	after runtime.dieFromSignal (nosplit) uses 488
		runtime.morestack: nosplit stack overflow
			744	assumed on entry to runtime.dieFromSignal (nosplit)
			256	after runtime.dieFromSignal (nosplit) uses 488
			248	on entry to runtime.unblocksig (nosplit)
			144	after runtime.unblocksig (nosplit) uses 104
			136	on entry to runtime.asmcgocall (nosplit)
			128	on entry to gosave (nosplit)
			120	on entry to runtime.badctxt (nosplit)
			96	after runtime.badctxt (nosplit) uses 24
			88	on entry to runtime.throw (nosplit)
			64	after runtime.throw (nosplit) uses 24
			56	on entry to runtime.dopanic (nosplit)
			8	after runtime.dopanic (nosplit) uses 48
			0	on entry to runtime.systemstack (nosplit)
			-8	on entry to function pointer
			-16	on entry to runtime.morestack (nosplit)
		runtime.throw: nosplit stack overflow
			744	assumed on entry to runtime.badsignal (nosplit)
			720	after runtime.badsignal (nosplit) uses 24
			712	on entry to runtime.needm (nosplit)
			424	after runtime.needm (nosplit) uses 288
			416	on entry to runtime.casgstatus (nosplit)
			72	after runtime.casgstatus (nosplit) uses 344
			64	on entry to runtime.asmcgocall (nosplit)
			56	on entry to gosave (nosplit)
			48	on entry to runtime.badctxt (nosplit)
			24	after runtime.badctxt (nosplit) uses 24
			16	on entry to runtime.throw (nosplit)
			-8	after runtime.throw (nosplit) uses 24
		runtime.printlock: nosplit stack overflow
			744	assumed on entry to runtime.sigfwdgo (nosplit)
			688	after runtime.sigfwdgo (nosplit) uses 56
			680	on entry to runtime.dieFromSignal (nosplit)
			192	after runtime.dieFromSignal (nosplit) uses 488
			184	on entry to runtime.unblocksig (nosplit)
			80	after runtime.unblocksig (nosplit) uses 104
			72	on entry to runtime.asmcgocall (nosplit)
			64	on entry to gosave (nosplit)
			56	on entry to runtime.badctxt (nosplit)
			32	after runtime.badctxt (nosplit) uses 24
			24	on entry to runtime.throw (nosplit)
			0	after runtime.throw (nosplit) uses 24
			-8	on entry to runtime.printlock
		runtime.morestack: nosplit stack overflow
			744	assumed on entry to runtime.cgocallback_gofunc (nosplit)
			720	after runtime.cgocallback_gofunc (nosplit) uses 24
			712	on entry to runtime.cgocallbackg (nosplit)
			552	after runtime.cgocallbackg (nosplit) uses 160
			544	on entry to runtime.exitsyscall (nosplit)
			448	after runtime.exitsyscall (nosplit) uses 96
			440	on entry to runtime.casgstatus (nosplit)
			96	after runtime.casgstatus (nosplit) uses 344
			88	on entry to runtime.asmcgocall (nosplit)
			80	on entry to gosave (nosplit)
			72	on entry to runtime.badctxt (nosplit)
			48	after runtime.badctxt (nosplit) uses 24
			40	on entry to runtime.throw (nosplit)
			16	after runtime.throw (nosplit) uses 24
			8	on entry to runtime.systemstack (nosplit)
			0	on entry to function pointer
			-8	on entry to runtime.morestack (nosplit)
		runtime.dieFromSignal: nosplit stack overflow
			744	assumed on entry to runtime.sigtramp (nosplit)
			736	on entry to runtime.sigtrampgo (nosplit)
			472	after runtime.sigtrampgo (nosplit) uses 264
			464	on entry to runtime.sigfwdgo (nosplit)
			408	after runtime.sigfwdgo (nosplit) uses 56
			400	on entry to runtime.dieFromSignal (nosplit)
			-88	after runtime.dieFromSignal (nosplit) uses 488
		
	dwarf_test.go:98: build error: exit status 2
--- FAIL: TestAbstractOriginSanity (19.63s)
	dwarf_test.go:97: build: # command-line-arguments
		runtime.dopanic: nosplit stack overflow
			744	assumed on entry to runtime.cgocallbackg (nosplit)
			584	after runtime.cgocallbackg (nosplit) uses 160
			576	on entry to runtime.exitsyscall (nosplit)
			480	after runtime.exitsyscall (nosplit) uses 96
			472	on entry to runtime.casgstatus (nosplit)
			128	after runtime.casgstatus (nosplit) uses 344
			120	on entry to runtime.asmcgocall (nosplit)
			112	on entry to gosave (nosplit)
			104	on entry to runtime.badctxt (nosplit)
			80	after runtime.badctxt (nosplit) uses 24
			72	on entry to runtime.throw (nosplit)
			48	after runtime.throw (nosplit) uses 24
			40	on entry to runtime.dopanic (nosplit)
			-8	after runtime.dopanic (nosplit) uses 48
		runtime.dopanic: nosplit stack overflow
			744	assumed on entry to runtime.needm (nosplit)
			456	after runtime.needm (nosplit) uses 288
			448	on entry to runtime.casgstatus (nosplit)
			104	after runtime.casgstatus (nosplit) uses 344
			96	on entry to runtime.asmcgocall (nosplit)
			88	on entry to gosave (nosplit)
			80	on entry to runtime.badctxt (nosplit)
			56	after runtime.badctxt (nosplit) uses 24
			48	on entry to runtime.throw (nosplit)
			24	after runtime.throw (nosplit) uses 24
			16	on entry to runtime.dopanic (nosplit)
			-32	after runtime.dopanic (nosplit) uses 48
		runtime.dieFromSignal: nosplit stack overflow
			744	assumed on entry to runtime.sigtrampgo (nosplit)
			480	after runtime.sigtrampgo (nosplit) uses 264
			472	on entry to runtime.sigfwdgo (nosplit)
			416	after runtime.sigfwdgo (nosplit) uses 56
			408	on entry to runtime.dieFromSignal (nosplit)
			-80	after runtime.dieFromSignal (nosplit) uses 488
		runtime.morestack: nosplit stack overflow
			744	assumed on entry to runtime.dieFromSignal (nosplit)
			256	after runtime.dieFromSignal (nosplit) uses 488
			248	on entry to runtime.unblocksig (nosplit)
			144	after runtime.unblocksig (nosplit) uses 104
			136	on entry to runtime.asmcgocall (nosplit)
			128	on entry to gosave (nosplit)
			120	on entry to runtime.badctxt (nosplit)
			96	after runtime.badctxt (nosplit) uses 24
			88	on entry to runtime.throw (nosplit)
			64	after runtime.throw (nosplit) uses 24
			56	on entry to runtime.dopanic (nosplit)
			8	after runtime.dopanic (nosplit) uses 48
			0	on entry to runtime.systemstack (nosplit)
			-8	on entry to function pointer
			-16	on entry to runtime.morestack (nosplit)
		runtime.throw: nosplit stack overflow
			744	assumed on entry to runtime.badsignal (nosplit)
			720	after runtime.badsignal (nosplit) uses 24
			712	on entry to runtime.needm (nosplit)
			424	after runtime.needm (nosplit) uses 288
			416	on entry to runtime.casgstatus (nosplit)
			72	after runtime.casgstatus (nosplit) uses 344
			64	on entry to runtime.asmcgocall (nosplit)
			56	on entry to gosave (nosplit)
			48	on entry to runtime.badctxt (nosplit)
			24	after runtime.badctxt (nosplit) uses 24
			16	on entry to runtime.throw (nosplit)
			-8	after runtime.throw (nosplit) uses 24
		runtime.printlock: nosplit stack overflow
			744	assumed on entry to runtime.sigfwdgo (nosplit)
			688	after runtime.sigfwdgo (nosplit) uses 56
			680	on entry to runtime.dieFromSignal (nosplit)
			192	after runtime.dieFromSignal (nosplit) uses 488
			184	on entry to runtime.unblocksig (nosplit)
			80	after runtime.unblocksig (nosplit) uses 104
			72	on entry to runtime.asmcgocall (nosplit)
			64	on entry to gosave (nosplit)
			56	on entry to runtime.badctxt (nosplit)
			32	after runtime.badctxt (nosplit) uses 24
			24	on entry to runtime.throw (nosplit)
			0	after runtime.throw (nosplit) uses 24
			-8	on entry to runtime.printlock
		runtime.morestack: nosplit stack overflow
			744	assumed on entry to runtime.cgocallback_gofunc (nosplit)
			720	after runtime.cgocallback_gofunc (nosplit) uses 24
			712	on entry to runtime.cgocallbackg (nosplit)
			552	after runtime.cgocallbackg (nosplit) uses 160
			544	on entry to runtime.exitsyscall (nosplit)
			448	after runtime.exitsyscall (nosplit) uses 96
			440	on entry to runtime.casgstatus (nosplit)
			96	after runtime.casgstatus (nosplit) uses 344
			88	on entry to runtime.asmcgocall (nosplit)
			80	on entry to gosave (nosplit)
			72	on entry to runtime.badctxt (nosplit)
			48	after runtime.badctxt (nosplit) uses 24
			40	on entry to runtime.throw (nosplit)
			16	after runtime.throw (nosplit) uses 24
			8	on entry to runtime.systemstack (nosplit)
			0	on entry to function pointer
			-8	on entry to runtime.morestack (nosplit)
		runtime.dieFromSignal: nosplit stack overflow
			744	assumed on entry to runtime.sigtramp (nosplit)
			736	on entry to runtime.sigtrampgo (nosplit)
			472	after runtime.sigtrampgo (nosplit) uses 264
			464	on entry to runtime.sigfwdgo (nosplit)
			408	after runtime.sigfwdgo (nosplit) uses 56
			400	on entry to runtime.dieFromSignal (nosplit)
			-88	after runtime.dieFromSignal (nosplit) uses 488
		
	dwarf_test.go:98: build error: exit status 2
--- FAIL: TestAbstractOriginSanityWithLocationLists (26.22s)
	dwarf_test.go:97: build: # command-line-arguments
		runtime.dopanic: nosplit stack overflow
			744	assumed on entry to runtime.cgocallbackg (nosplit)
			584	after runtime.cgocallbackg (nosplit) uses 160
			576	on entry to runtime.exitsyscall (nosplit)
			480	after runtime.exitsyscall (nosplit) uses 96
			472	on entry to runtime.casgstatus (nosplit)
			128	after runtime.casgstatus (nosplit) uses 344
			120	on entry to runtime.asmcgocall (nosplit)
			112	on entry to gosave (nosplit)
			104	on entry to runtime.badctxt (nosplit)
			80	after runtime.badctxt (nosplit) uses 24
			72	on entry to runtime.throw (nosplit)
			48	after runtime.throw (nosplit) uses 24
			40	on entry to runtime.dopanic (nosplit)
			-8	after runtime.dopanic (nosplit) uses 48
		runtime.dopanic: nosplit stack overflow
			744	assumed on entry to runtime.needm (nosplit)
			456	after runtime.needm (nosplit) uses 288
			448	on entry to runtime.casgstatus (nosplit)
			104	after runtime.casgstatus (nosplit) uses 344
			96	on entry to runtime.asmcgocall (nosplit)
			88	on entry to gosave (nosplit)
			80	on entry to runtime.badctxt (nosplit)
			56	after runtime.badctxt (nosplit) uses 24
			48	on entry to runtime.throw (nosplit)
			24	after runtime.throw (nosplit) uses 24
			16	on entry to runtime.dopanic (nosplit)
			-32	after runtime.dopanic (nosplit) uses 48
		runtime.dieFromSignal: nosplit stack overflow
			744	assumed on entry to runtime.sigtrampgo (nosplit)
			480	after runtime.sigtrampgo (nosplit) uses 264
			472	on entry to runtime.sigfwdgo (nosplit)
			416	after runtime.sigfwdgo (nosplit) uses 56
			408	on entry to runtime.dieFromSignal (nosplit)
			-80	after runtime.dieFromSignal (nosplit) uses 488
		runtime.morestack: nosplit stack overflow
			744	assumed on entry to runtime.dieFromSignal (nosplit)
			256	after runtime.dieFromSignal (nosplit) uses 488
			248	on entry to runtime.unblocksig (nosplit)
			144	after runtime.unblocksig (nosplit) uses 104
			136	on entry to runtime.asmcgocall (nosplit)
			128	on entry to gosave (nosplit)
			120	on entry to runtime.badctxt (nosplit)
			96	after runtime.badctxt (nosplit) uses 24
			88	on entry to runtime.throw (nosplit)
			64	after runtime.throw (nosplit) uses 24
			56	on entry to runtime.dopanic (nosplit)
			8	after runtime.dopanic (nosplit) uses 48
			0	on entry to runtime.systemstack (nosplit)
			-8	on entry to function pointer
			-16	on entry to runtime.morestack (nosplit)
		runtime.throw: nosplit stack overflow
			744	assumed on entry to runtime.badsignal (nosplit)
			720	after runtime.badsignal (nosplit) uses 24
			712	on entry to runtime.needm (nosplit)
			424	after runtime.needm (nosplit) uses 288
			416	on entry to runtime.casgstatus (nosplit)
			72	after runtime.casgstatus (nosplit) uses 344
			64	on entry to runtime.asmcgocall (nosplit)
			56	on entry to gosave (nosplit)
			48	on entry to runtime.badctxt (nosplit)
			24	after runtime.badctxt (nosplit) uses 24
			16	on entry to runtime.throw (nosplit)
			-8	after runtime.throw (nosplit) uses 24
		runtime.printlock: nosplit stack overflow
			744	assumed on entry to runtime.sigfwdgo (nosplit)
			688	after runtime.sigfwdgo (nosplit) uses 56
			680	on entry to runtime.dieFromSignal (nosplit)
			192	after runtime.dieFromSignal (nosplit) uses 488
			184	on entry to runtime.unblocksig (nosplit)
			80	after runtime.unblocksig (nosplit) uses 104
			72	on entry to runtime.asmcgocall (nosplit)
			64	on entry to gosave (nosplit)
			56	on entry to runtime.badctxt (nosplit)
			32	after runtime.badctxt (nosplit) uses 24
			24	on entry to runtime.throw (nosplit)
			0	after runtime.throw (nosplit) uses 24
			-8	on entry to runtime.printlock
		runtime.morestack: nosplit stack overflow
			744	assumed on entry to runtime.cgocallback_gofunc (nosplit)
			720	after runtime.cgocallback_gofunc (nosplit) uses 24
			712	on entry to runtime.cgocallbackg (nosplit)
			552	after runtime.cgocallbackg (nosplit) uses 160
			544	on entry to runtime.exitsyscall (nosplit)
			448	after runtime.exitsyscall (nosplit) uses 96
			440	on entry to runtime.casgstatus (nosplit)
			96	after runtime.casgstatus (nosplit) uses 344
			88	on entry to runtime.asmcgocall (nosplit)
			80	on entry to gosave (nosplit)
			72	on entry to runtime.badctxt (nosplit)
			48	after runtime.badctxt (nosplit) uses 24
			40	on entry to runtime.throw (nosplit)
			16	after runtime.throw (nosplit) uses 24
			8	on entry to runtime.systemstack (nosplit)
			0	on entry to function pointer
			-8	on entry to runtime.morestack (nosplit)
		runtime.dieFromSignal: nosplit stack overflow
			744	assumed on entry to runtime.sigtramp (nosplit)
			736	on entry to runtime.sigtrampgo (nosplit)
			472	after runtime.sigtrampgo (nosplit) uses 264
			464	on entry to runtime.sigfwdgo (nosplit)
			408	after runtime.sigfwdgo (nosplit) uses 56
			400	on entry to runtime.dieFromSignal (nosplit)
			-88	after runtime.dieFromSignal (nosplit) uses 488
		
	dwarf_test.go:98: build error: exit status 2
FAIL
FAIL	cmd/link/internal/ld	62.443s
2017/12/15 19:28:53 Failed: exit status 1

/cc @aclements

@thanm

This comment has been minimized.

Member

thanm commented Dec 18, 2017

The main thing those three tests have is that they compile a small Go program with "regular" optimization (as opposed to building with "-l -N"), in case that helps.

@gopherbot

This comment has been minimized.

gopherbot commented Dec 18, 2017

Change https://golang.org/cl/84655 mentions this issue: test: disable selected DWARF testpoints on Solaris

gopherbot pushed a commit that referenced this issue Dec 18, 2017

cmd/internal/link: disable selected DWARF tests on Solaris
Disable the three linker DWARF tests that invoke the compiler in
non-debug mode on Solaris, since this seems to trigger a split stack
overflow. These can be turned back on once the issue in question is
resolved.

Updates #23168.

Change-Id: I5be1b098e33e8bad3bc234a0964eab1dee7e7954
Reviewed-on: https://go-review.googlesource.com/84655
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Than McIntosh <thanm@google.com>
@aclements

This comment has been minimized.

Member

aclements commented Dec 19, 2017

This is essentially the same problem we had in #22797. Building the runtime with -l=4 seems to work fine everywhere except Solaris, where it causes nosplit overflows. We'll need to resolve that before we turn on -l=4 by default.

I'll re-title this issue and milestone it to 1.11.

@aclements aclements changed the title from runtime: build broken on Solaris to runtime: -l=4 build fails on Solaris Dec 19, 2017

@aclements aclements added this to the Go1.11 milestone Dec 19, 2017

@gopherbot

This comment has been minimized.

gopherbot commented May 3, 2018

Change https://golang.org/cl/111258 mentions this issue: runtime: fix darwin 386/amd64 stack switches

gopherbot pushed a commit that referenced this issue May 19, 2018

runtime: fix darwin 386/amd64 stack switches
A few libc_ calls were missing stack switches.

Unfortunately, adding the stack switches revealed a deeper problem.
systemstack() is fundamentally flawed because when you do

    systemstack(func() { ... })

There's no way to mark the anonymous function as nosplit.  At first I
thought it didn't matter, as that function runs on the g0 stack.  But
nosplit is still required, because some syscalls are done when stack
bounds are not set up correctly (e.g. in a signal handler, which runs
on the g0 stack, but g is still pointing at the g stack).  Instead use
asmcgocall and funcPC, so we can be nosplit all the way down.

Mid-stack inlining now pushes darwin over the nosplit limit also.
Leaving that as a TODO.
Update #23168

This might fix the cause of occasional darwin hangs.
Update #25181

Update #17490

Change-Id: If9c3ef052822c7679f5a1dd192443f714483327e
Reviewed-on: https://go-review.googlesource.com/111258
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

@ianlancetaylor ianlancetaylor modified the milestones: Go1.11, Go1.12 Jul 6, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment