gouring icon indicating copy to clipboard operation
gouring copied to clipboard

unexpected fault address in queue tests

Open syhpoon opened this issue 3 years ago • 1 comments

:wave:

I've been trying to use this library for my project but I'm having issues, which, are easily reproducible in the repo itself. Basically I just cloned the repo, then did cd gouring/queue && go test ./... And got a SIGSEGV

{skipped passed tests}

queue pls!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!127
wrk(11): cqe: &gouring.CQEntry{UserData:0x7e, Res:139, Flags:0x0}
wrk(11): cqe: &gouring.CQEntry{UserData:0x7f, Res:140, Flags:0x0}
unexpected fault address 0x7f8d2423d080
fatal error: fault
[signal SIGSEGV: segmentation violation code=0x1 addr=0x7f8d2423d080 pc=0x592d4b]

goroutine 20 [running]:
runtime.throw({0x5e43d8?, 0x46fcc7?})
	/go/src/runtime/panic.go:992 +0x71 fp=0xc00018cd88 sp=0xc00018cd58 pc=0x436dd1
runtime.sigpanic()
	/go/src/runtime/signal_unix.go:825 +0x305 fp=0xc00018cdd8 sp=0xc00018cd88 pc=0x44cdc5
github.com/ii64/gouring/queue.(*Queue).cqPeek(...)
	/tmp/gouring/queue/queue.go:147
github.com/ii64/gouring/queue.(*Queue).GetCQEntryWait(0xc000128370, 0x1, 0x0)
	/tmp/gouring/queue/queue.go:172 +0xcb fp=0xc00018ceb8 sp=0xc00018cdd8 pc=0x592d4b
github.com/ii64/gouring/queue.(*Queue).GetCQEntry(...)
	/tmp/gouring/queue/queue.go:161
github.com/ii64/gouring/queue.(*QueueLocks).GetCQEntry(0x7f8d2423d930?, 0x0?)
	/tmp/gouring/queue/queue_lock.go:40 +0xa5 fp=0xc00018cf28 sp=0xc00018ceb8 pc=0x5934a5
github.com/ii64/gouring/queue.(*QueueLocks).Run(0xc00000e1f8, 0x0?, 0xc00018cf80)
	/tmp/gouring/queue/queue_lock.go:69 +0x8e fp=0xc00018cf68 sp=0xc00018cf28 pc=0x59360e
github.com/ii64/gouring/queue.TestQueueMultiConsumer.func3(0x0?)
	/tmp/gouring/queue/queue_lock_test.go:63 +0x85 fp=0xc00018cfc8 sp=0xc00018cf68 pc=0x593ea5
github.com/ii64/gouring/queue.TestQueueMultiConsumer.func4()
	/tmp/gouring/queue/queue_lock_test.go:75 +0x2a fp=0xc00018cfe0 sp=0xc00018cfc8 pc=0x593dea
runtime.goexit()
	/go/src/runtime/asm_amd64.s:1571 +0x1 fp=0xc00018cfe8 sp=0xc00018cfe0 pc=0x468221
created by github.com/ii64/gouring/queue.TestQueueMultiConsumer
	/tmp/gouring/queue/queue_lock_test.go:62 +0x537

Am I doing something wrong?

# go version
go version go1.18.3 linux/amd64
# uname -r
5.18.9-arch1-1

syhpoon avatar Jul 06 '22 02:07 syhpoon

Hi, I can reproduce the error, and it got SEGV at the same place (previous successful id 127, it stops at 128), i've checked that this is not caused by GC, suspected a bug in CQ ring implementation.

I started to implement new API on https://github.com/ii64/gouring/commits/v0.4. it passed this 128 CQ entry limit. Thanks

ii64 avatar Jul 07 '22 01:07 ii64