Multiline configuration for golang panic stacktraces

Has anyone come up with a multiline configuration for matching golang panic stacktraces?

FWIW, an example:

fatal error: runtime: out of memory

runtime stack:
runtime.throw(0x10daffb, 0x16)
        /tools/go/src/runtime/panic.go:608 +0x72
runtime.sysMap(0xdc84000000, 0x4000000, 0x1c04918)
        /tools/go/src/runtime/mem_linux.go:156 +0xc7
runtime.(*mheap).sysAlloc(0x1beaec0, 0x4000000, 0x435d5c, 0xc00503d800)
        /tools/go/src/runtime/malloc.go:619 +0x1c7
runtime.(*mheap).grow(0x1beaec0, 0x1, 0x0)
        /tools/go/src/runtime/mheap.go:920 +0x42
runtime.(*mheap).allocSpanLocked(0x1beaec0, 0x1, 0x1c04928, 0x400)
        /tools/go/src/runtime/mheap.go:848 +0x337
runtime.(*mheap).alloc_m(0x1beaec0, 0x1, 0x8, 0x7f9ad9810fff)
        /tools/go/src/runtime/mheap.go:692 +0x119
runtime.(*mheap).alloc.func1()
        /tools/go/src/runtime/mheap.go:759 +0x4c
runtime.(*mheap).alloc(0x1beaec0, 0x1, 0x7f9ad9010008, 0x7f9b8a47a1d8)
        /tools/go/src/runtime/mheap.go:758 +0x8a
runtime.(*mcentral).grow(0x1bec3f8, 0x0)
        /tools/go/src/runtime/mcentral.go:232 +0x94
runtime.(*mcentral).cacheSpan(0x1bec3f8, 0x7f9b8a47a1d8)
        /tools/go/src/runtime/mcentral.go:106 +0x2f8
runtime.(*mcache).refill(0x7fa3e86b1aa0, 0xc000091908)
        /tools/go/src/runtime/mcache.go:122 +0x95
runtime.(*mcache).nextFree.func1()
        /tools/go/src/runtime/malloc.go:749 +0x32
runtime.systemstack(0x0)
        /tools/go/src/runtime/asm_amd64.s:351 +0x66
runtime.mstart()
        /tools/go/src/runtime/proc.go:1229

Hmm not sure about the whitespace line but this multiline pattern seems to work on the go playground:

^runtime stack|^runtime.|/tools|^$

It should match the whitespace line and all the runtime stack, runtime., and /tools lines underneath the fatal error one

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.