rjeczalik/notify

Test suite fails on OpenBSD

Opened this issue · 1 comments

On OpenBSD, I non-deterministically get this failure:

runtime: kevent on fd 18 failed with 9
fatal error: runtime: netpoll failed

runtime stack:
runtime.throw(0x5bee6f, 0x17)
	/usr/local/go/src/runtime/panic.go:774 +0x72
runtime.netpoll(0x95539be4f00, 0xd00000000)
	/usr/local/go/src/runtime/netpoll_kqueue.go:77 +0x253
runtime.sysmon()
	/usr/local/go/src/runtime/proc.go:4337 +0x298
runtime.mstart1()
	/usr/local/go/src/runtime/proc.go:1201 +0xd9
runtime.mstart()
	/usr/local/go/src/runtime/proc.go:1167 +0x6e

goroutine 1 [chan receive]:
testing.(*T).Run(0xc0003b4200, 0x5be37e, 0x15, 0x5c6b48, 0x47e001)
	/usr/local/go/src/testing/testing.go:961 +0x377
testing.runTests.func1(0xc00008e000)
	/usr/local/go/src/testing/testing.go:1202 +0x78
testing.tRunner(0xc00008e000, 0xc000068dc0)
	/usr/local/go/src/testing/testing.go:909 +0xc9
testing.runTests(0xc00000c0c0, 0x702180, 0x18, 0x18, 0x0)
	/usr/local/go/src/testing/testing.go:1200 +0x2a7
testing.(*M).Run(0xc00008c000, 0x0)
	/usr/local/go/src/testing/testing.go:1117 +0x176
main.main()
	_testmain.go:92 +0x135

goroutine 6 [syscall]:
syscall.Syscall6(0x48, 0x3, 0x0, 0x0, 0xc000030740, 0x1, 0x0, 0x705e00, 0x28ddb1008, 0x0)
	/usr/local/go/src/syscall/asm_unix_amd64.s:42 +0x5
syscall.kevent(0x3, 0x0, 0x0, 0xc000030740, 0x1, 0x0, 0x58c9c0, 0xc000046190, 0xc0000306f0)
	/usr/local/go/src/syscall/zsyscall_openbsd_amd64.go:202 +0x9a
syscall.Kevent(0x3, 0x0, 0x0, 0x0, 0xc000030740, 0x1, 0x1, 0x0, 0x8, 0xc000030750, ...)
	/usr/local/go/src/syscall/syscall_bsd.go:447 +0x71
github.com/rjeczalik/notify.(*kq).Wait(0xc00005e300, 0x0, 0x100000000000000, 0x0, 0x8)
	/home/edd/source/notify2/watcher_kqueue.go:133 +0x8d
github.com/rjeczalik/notify.(*trg).monitor(0xc00005e2a0)
	/home/edd/source/notify2/watcher_trigger.go:401 +0x38
created by github.com/rjeczalik/notify.newWatcher
	/home/edd/source/notify2/watcher_trigger.go:112 +0x224

goroutine 7 [chan receive]:
github.com/rjeczalik/notify.(*nonrecursiveTree).dispatch(0xc0000522a0, 0xc0000521e0)
	/home/edd/source/notify2/tree_nonrecursive.go:36 +0xb6
created by github.com/rjeczalik/notify.newNonrecursiveTree
	/home/edd/source/notify2/tree_nonrecursive.go:29 +0xdc

goroutine 8 [chan receive]:
github.com/rjeczalik/notify.(*nonrecursiveTree).internal(0xc0000522a0, 0xc000052240)
	/home/edd/source/notify2/tree_nonrecursive.go:81 +0x58
created by github.com/rjeczalik/notify.newNonrecursiveTree
	/home/edd/source/notify2/tree_nonrecursive.go:30 +0x108

goroutine 221 [runnable]:
syscall.Syscall6(0x48, 0x6, 0xc000103a98, 0x1, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0)
	/usr/local/go/src/syscall/asm_unix_amd64.s:42 +0x5
syscall.kevent(0x6, 0xc000103a98, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
	/usr/local/go/src/syscall/zsyscall_openbsd_amd64.go:202 +0x9a
syscall.Kevent(0x6, 0xc000103a98, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/usr/local/go/src/syscall/syscall_bsd.go:447 +0x71
github.com/rjeczalik/notify.(*kq).Watch(0xc00005f290, 0x5f42c0, 0xc000498240, 0xc0003e6600, 0x23, 0x1, 0x30)
	/home/edd/source/notify2/watcher_kqueue.go:122 +0x9a
github.com/rjeczalik/notify.(*trg).singlewatch(0xc00005f230, 0xc000430d90, 0x62, 0xf00, 0x1, 0x5f42c0, 0xc000498240, 0x5f11e0, 0xc0000463b0)
	/home/edd/source/notify2/watcher_trigger.go:166 +0x10b
github.com/rjeczalik/notify.(*trg).singleunwatch(0xc00005f230, 0xc000430d90, 0x62, 0x0, 0x584a40, 0xc0004bc9d8)
	/home/edd/source/notify2/watcher_trigger.go:385 +0x112
github.com/rjeczalik/notify.(*trg).unwatch(0xc00005f230, 0xc000430d90, 0x62, 0x5f42c0, 0xc000498240, 0x0, 0x0)
	/home/edd/source/notify2/watcher_trigger.go:248 +0x6a
github.com/rjeczalik/notify.(*trg).Close(0xc00005f230, 0x5f39e0, 0xc00005f230)
	/home/edd/source/notify2/watcher_trigger.go:126 +0x17b
github.com/rjeczalik/notify.(*W).Close(0xc000112180, 0x0, 0x0)
	/home/edd/source/notify2/testing_test.go:299 +0xa3
panic(0x58bd40, 0xc000188210)
	/usr/local/go/src/runtime/panic.go:679 +0x1b2
github.com/rjeczalik/notify.TestStopPathNotExists(0xc0003b4200)
	/home/edd/source/notify2/watcher_test.go:46 +0x333
testing.tRunner(0xc0003b4200, 0x5c6b48)
	/usr/local/go/src/testing/testing.go:909 +0xc9
created by testing.(*T).Run
	/usr/local/go/src/testing/testing.go:960 +0x350

goroutine 19 [chan receive]:
github.com/rjeczalik/notify.(*nonrecursiveTree).internal(0xc0000a4120, 0xc0000a40c0)
	/home/edd/source/notify2/tree_nonrecursive.go:81 +0x58
created by github.com/rjeczalik/notify.newNonrecursiveTree
	/home/edd/source/notify2/tree_nonrecursive.go:30 +0x108

goroutine 16 [chan receive]:
github.com/rjeczalik/notify.(*nonrecursiveTree).internal(0xc0001e5f20, 0xc0001e5ec0)
	/home/edd/source/notify2/tree_nonrecursive.go:81 +0x58
created by github.com/rjeczalik/notify.newNonrecursiveTree
	/home/edd/source/notify2/tree_nonrecursive.go:30 +0x108

goroutine 97 [chan receive]:
github.com/rjeczalik/notify.(*nonrecursiveTree).internal(0xc0000a54a0, 0xc0000af0e0)
	/home/edd/source/notify2/tree_nonrecursive.go:81 +0x58
created by github.com/rjeczalik/notify.newNonrecursiveTree
	/home/edd/source/notify2/tree_nonrecursive.go:30 +0x108

goroutine 81 [chan receive]:
github.com/rjeczalik/notify.NewNonrecursiveTreeTestC.func1(0xc0000af080, 0xc0000af0e0, 0xc0003b4000, 0xc0000af140)
	/home/edd/source/notify2/testing_test.go:736 +0x41
created by github.com/rjeczalik/notify.NewNonrecursiveTreeTestC
	/home/edd/source/notify2/testing_test.go:735 +0xc5
exit status 2
FAIL	github.com/rjeczalik/notify	18.054s

Any ideas?

I also occasionally see:

--- FAIL: TestWatcherKqueue (0.16s)
    testing_test.go:215: testing_test.go:371: readdirnames /home/edd/source/notify/testdata/729697611/src/github.com/ppknap/link/include/coost/link/detail: readdirent: bad file descriptor
    testing_test.go:219: testing_test.go:300: w.Watcher.Close()=Not all watches were removed: len(t.pthLkp) == 1