panicwrap icon indicating copy to clipboard operation
panicwrap copied to clipboard

failed to track some other panic msgs

Open LinkShen opened this issue 5 years ago • 3 comments

Hi, recently I found that some specific panic type will be ignored. As the code shown below:

func trackPanic(r io.Reader, w io.Writer, dur time.Duration, result chan<- string) {
	...
	panicHeaders := [][]byte{
		[]byte("panic:"),
		[]byte("fatal error: fault"),
	}
	...
}

panicwrap only deal with these two kinds panic msgs. But I met: "fatal error: concurrent map iteration and map write" these kinds of panic will be ignored.

LinkShen avatar Oct 13 '20 12:10 LinkShen

Another one: fatal error: sync: unlock of unlocked mutex.

powerman avatar Aug 10 '22 07:08 powerman

Complete list of fatal error: for Go 1.19:

$ rg 'fatal[(]"' | sed 's/.*fatal("\(.*\)")/\1/' | sort -u
all goroutines are asleep - deadlock!
AllThreadsSyscall6 results differ between threads; runtime corrupted
concurrent map iteration and map write
concurrent map read and map write
concurrent map writes
go of nil func value
no goroutines (main called runtime.Goexit) - deadlock!
sync: RUnlock of unlocked RWMutex
sync: unlock of unlocked mutex
sync: Unlock of unlocked RWMutex

powerman avatar Aug 10 '22 07:08 powerman

Well, actually it's not a complete list. There are a several hundreds throw("…") calls which also output as a fatal error:, e.g.:

$ ulimit -H -v 100000; ./app
fatal error: failed to reserve page summary memory

runtime stack:
runtime.throw({0xe06faa?, 0x7ffc50bc35a0?})
	/usr/lib/go/src/runtime/panic.go:1047 +0x5d fp=0x7ffc50bc3550 sp=0x7ffc50bc3520 pc=0x43b59d
runtime.(*pageAlloc).sysInit(0x16a65f0)
	/usr/lib/go/src/runtime/mpagealloc_64bit.go:82 +0x18d fp=0x7ffc50bc35d8 sp=0x7ffc50bc3550 pc=0x43030d
runtime.(*pageAlloc).init(0x16a65f0, 0x16a65e0, 0x0?)
	/usr/lib/go/src/runtime/mpagealloc.go:324 +0x70 fp=0x7ffc50bc3600 sp=0x7ffc50bc35d8 pc=0x42df50
runtime.(*mheap).init(0x16a65e0)
	/usr/lib/go/src/runtime/mheap.go:721 +0x13f fp=0x7ffc50bc3638 sp=0x7ffc50bc3600 pc=0x42b37f
runtime.mallocinit()
	/usr/lib/go/src/runtime/malloc.go:407 +0xb2 fp=0x7ffc50bc3660 sp=0x7ffc50bc3638 pc=0x40e1f2
runtime.schedinit()
	/usr/lib/go/src/runtime/proc.go:693 +0xab fp=0x7ffc50bc36c0 sp=0x7ffc50bc3660 pc=0x43ef6b
runtime.rt0_go()
	/usr/lib/go/src/runtime/asm_amd64.s:345 +0x189 fp=0x7ffc50bc36c8 sp=0x7ffc50bc36c0 pc=0x46d669

powerman avatar Aug 10 '22 07:08 powerman