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: crashes with netpollBreak write failed with 14 [EFAULT] on openbsd-arm-jsing #51341

Open
bcmills opened this issue Feb 24, 2022 · 2 comments
Labels
arch-arm NeedsInvestigation OS-OpenBSD
Milestone

Comments

@bcmills
Copy link
Member

@bcmills bcmills commented Feb 24, 2022

greplogs --dashboard -md -l -e 'runtime: netpollBreak write failed with 14$'

runtime: netpollBreak write failed with 14
fatal error: runtime: netpollBreak write failed

goroutine 4 [running]:
runtime.throw({0x5de9f5, 0x22})
	/home/gopher/build/go/src/runtime/panic.go:992 +0x5c fp=0xc33ea4 sp=0xc33e90 pc=0x49104
runtime.netpollBreak()
	/home/gopher/build/go/src/runtime/netpoll_kqueue.go:97 +0xd8 fp=0xc33ec0 sp=0xc33ea4 pc=0x45474
runtime.wakeNetPoller(0x1f35d61568e097)
	/home/gopher/build/go/src/runtime/proc.go:3012 +0xb4 fp=0xc33ed0 sp=0xc33ec0 pc=0x52aec
runtime.modtimer(0xc18030, 0x1f35d61568e097, 0x0, 0x617d68, {0x0, 0x0}, 0x0)
	/home/gopher/build/go/src/runtime/time.go:499 +0x4e4 fp=0xc33f00 sp=0xc33ed0 pc=0x6b4ac
runtime.resettimer(...)
	/home/gopher/build/go/src/runtime/time.go:540
time.resetTimer(...)
	/home/gopher/build/go/src/runtime/time.go:230
runtime.scavengeSleep(0x3f94d330)
	/home/gopher/build/go/src/runtime/mgcscavenge.go:244 +0x94 fp=0xc33f34 sp=0xc33f00 pc=0x35188
runtime.bgscavenge(0xc260c0)
	/home/gopher/build/go/src/runtime/mgcscavenge.go:394 +0x1a0 fp=0xc33fe4 sp=0xc33f34 pc=0x353cc
runtime.gcenable.func2()
	/home/gopher/build/go/src/runtime/mgc.go:178 +0x28 fp=0xc33fec sp=0xc33fe4 pc=0x2a27c
runtime.goexit()
	/home/gopher/build/go/src/runtime/asm_arm.s:824 +0x4 fp=0xc33fec sp=0xc33fec pc=0x7b3ac
created by runtime.gcenable
	/home/gopher/build/go/src/runtime/mgc.go:178 +0xbc

2022-02-22T23:35:31-3517036/openbsd-arm-jsing
2021-12-17T03:28:06-3c49583/openbsd-arm-jsing

Similar stacks both times.

(CC @golang/runtime; attn @4a6f656c)

@bcmills bcmills added OS-OpenBSD NeedsInvestigation arch-arm labels Feb 24, 2022
@bcmills bcmills added this to the Go1.19 milestone Feb 24, 2022
@prattmic
Copy link
Member

@prattmic prattmic commented Feb 24, 2022

The most obvious reason for write to return EFAULT is if the passed buffer is bad. But the buffer here (unsafe.Pointer(&b)) is on the stack (confirmed in assembly), so it really shouldn't be bad. And note that the program didn't crash immediately on return from the syscall, so RSP must be OK.

My best guess here would be that we moved the stack and missed that this argument is a stack reference?

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Feb 25, 2022

The write function and all the functions it calls should be nosplit, and as far as I can tell that is in fact the case. So we shouldn't be moving the stack here.

I don't have any other suggestion, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-arm NeedsInvestigation OS-OpenBSD
Projects
None yet
Development

No branches or pull requests

3 participants