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, cmd/link: darwin/amd64 occasionally hangs #25181

Closed
josharian opened this Issue Apr 30, 2018 · 6 comments

Comments

Projects
None yet
4 participants
@josharian
Copy link
Contributor

commented Apr 30, 2018

https://golang.org/cl/108679 seems to have broken the darwin/arm and darwin/arm64 builds.

Also, I am now experiencing occasional hangs during make.bash. Sample SIGQUIT output:

$ ./make.bash
Building Go cmd/dist using /Users/josh/go/1.4.
Building Go toolchain1 using /Users/josh/go/1.4.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
Building Go toolchain2 using go_bootstrap and Go toolchain1.
Building Go toolchain3 using go_bootstrap and Go toolchain2.
Building packages and commands for darwin/amd64.
# testing/iotest
SIGQUIT: quit
PC=0x1057115 m=1 sigcode=0

goroutine 0 [idle]:
runtime.usleep(0x5700002710, 0x0, 0x45d9ff8c62, 0x45d964b800, 0x271000000000, 0x576c68ca9e, 0x45d964b800, 0x2, 0x0, 0x45d9ff8c62, ...)
	/Users/josh/go/tip/src/runtime/sys_darwin_amd64.s:418 +0x45
runtime.sysmon()
	/Users/josh/go/tip/src/runtime/proc.go:4256 +0xd0
runtime.mstart1()
	/Users/josh/go/tip/src/runtime/proc.go:1229 +0xe6
runtime.mstart()
	/Users/josh/go/tip/src/runtime/proc.go:1195 +0x6e

goroutine 1 [runnable, locked to thread]:
runtime.gopark(0x183bec0, 0xc000066058, 0x1820255, 0xc, 0xc000020e17, 0x3)
	/Users/josh/go/tip/src/runtime/proc.go:291 +0x105
runtime.goparkunlock(0xc000066058, 0x1820255, 0xc, 0x17, 0x3)
	/Users/josh/go/tip/src/runtime/proc.go:297 +0x5e
runtime.chanrecv(0xc000066000, 0x0, 0xc000000101, 0x10167c8)
	/Users/josh/go/tip/src/runtime/chan.go:520 +0x2d1
runtime.chanrecv1(0xc000066000, 0x0)
	/Users/josh/go/tip/src/runtime/chan.go:402 +0x2b
runtime.gcenable()
	/Users/josh/go/tip/src/runtime/mgc.go:217 +0x6f
runtime.main()
	/Users/josh/go/tip/src/runtime/proc.go:161 +0x119
runtime.goexit()
	/Users/josh/go/tip/src/runtime/asm_amd64.s:1356 +0x1

rax    0x4
rbx    0x2
rcx    0xc000051e00
rdx    0x0
rdi    0x0
rsi    0x0
rbp    0xc000051e10
rsp    0xc000051e00
r8     0xc000051e00
r9     0x0
r10    0x0
r11    0x206
r12    0x85f8e928f07
r13    0x0
r14    0xb0000000
r15    0x0
rip    0x1057115
rflags 0x207
cs     0x7
fs     0x0
gs     0x0
go tool dist: FAILED: /Users/josh/go/tip/pkg/tool/darwin_amd64/go_bootstrap install -gcflags=all= -ldflags=all= std cmd: exit status 2

cc @randall77

@josharian josharian added the NeedsFix label Apr 30, 2018

@josharian josharian added this to the Go1.11 milestone Apr 30, 2018

@josharian

This comment has been minimized.

Copy link
Contributor Author

commented Apr 30, 2018

I suspect this darwin/amd64 failure from the dashboard is the same thing: https://build.golang.org/log/16b7534fc8d85a751999df12ffb24f7eb825e79a

@gopherbot

This comment has been minimized.

Copy link

commented Apr 30, 2018

Change https://golang.org/cl/110123 mentions this issue: runtime: fix newosproc darwin+arm/arm64

@randall77

This comment has been minimized.

Copy link
Contributor

commented Apr 30, 2018

CL 110123 already out for the arm64 fix.

gopherbot pushed a commit that referenced this issue Apr 30, 2018

runtime: fix newosproc darwin+arm/arm64
Missed conversion of newosproc for the parts of darwin that
weren't affected by my previous change.

Update #25181

Change-Id: I81a2935e192b6d0df358c59b7e785eb03c504c23
Reviewed-on: https://go-review.googlesource.com/110123
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>

@randall77 randall77 changed the title runtime, cmd/ld: darwin/arm and darwin/arm64 build failing, darwin/amd64 occasionally hangs runtime, cmd/ld: darwin/amd64 occasionally hangs Apr 30, 2018

@gopherbot

This comment has been minimized.

Copy link

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 changed the title runtime, cmd/ld: darwin/amd64 occasionally hangs runtime, cmd/link: darwin/amd64 occasionally hangs Jun 14, 2018

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Jun 14, 2018

Is this still a problem?

@josharian

This comment has been minimized.

Copy link
Contributor Author

commented Jun 14, 2018

I haven’t experienced it in a while. Closing until proven otherwise.

@josharian josharian closed this Jun 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.