heapdump14
heapdump14 copied to clipboard
panic at parser.go:1222
Loading...
inferring types...
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x28 pc=0x4db8ee]
goroutine 1 [running]:
github.com/randall77/heapdump14/read.dwarfTypeMap(0xc208060000, 0xc208032c00, 0xc208032c00)
/home/vmihailenco/workspace/gocode/src/github.com/randall77/heapdump14/read/parser.go:1222 +0xc6e
github.com/randall77/heapdump14/read.typePropagate(0xc208060000, 0x7fffa7d7a11e, 0x1d)
/home/vmihailenco/workspace/gocode/src/github.com/randall77/heapdump14/read/parser.go:1477 +0x15f
github.com/randall77/heapdump14/read.Read(0x7fffa7d7a0f7, 0x26, 0x7fffa7d7a11e, 0x1d, 0x0)
/home/vmihailenco/workspace/gocode/src/github.com/randall77/heapdump14/read/parser.go:2097 +0x6d
main.main()
/home/vmihailenco/workspace/gocode/src/github.com/randall77/heapdump14/hview/main.go:893 +0x1f2
exit status 2
It looks like app panics because you don't handle dwarf.TagCompileUnit when building map[dwarf.Offset]dwarfType. Is this info enough to fix the panic?
Minimal reproducible example that uses cgo: https://gist.github.com/vmihailenco/a1d0df3690636beba652
Thanks for the bug report. Yes, the heap dump parser needs some hardening for dwarf info coming from non-Go sources. It doesn't always conform to the invariants the reader expects.
On Wed, Dec 17, 2014 at 2:32 AM, Vladimir Mihailenco < [email protected]> wrote:
Minimal reproducible example that uses cgo: https://gist.github.com/vmihailenco/a1d0df3690636beba652
— Reply to this email directly or view it on GitHub https://github.com/randall77/heapdump14/issues/1#issuecomment-67304159.
panic: interface conversion: interface is nil, not int64
goroutine 1 [running]: 3rdparty/src/hprof/read.dwarfTypeMap(0xc20800c240, 0xc20856e800, 0xc20856e800) /home/projects/U4/trunkMobile/Server/MobileZ/src/3rdparty/src/hprof/read/parser.go:1199 +0x1b46 3rdparty/src/hprof/read.typePropagate(0xc20800c240, 0x7fffa423d674, 0xa) /home/projects/U4/trunkMobile/Server/MobileZ/src/3rdparty/src/hprof/read/parser.go:1500 +0x15f 3rdparty/src/hprof/read.Read(0x7fffa423d66b, 0x8, 0x7fffa423d674, 0xa, 0x410698) /home/projects/U4/trunkMobile/Server/MobileZ/src/3rdparty/src/hprof/read/parser.go:2120 +0x6d main.main() /home/projects/U4/trunkMobile/Server/MobileZ/src/3rdparty/src/hprof/dumptodot/main.go:14 +0xe7 It's panic at dwarf.AttrByteSize.The panic information shows "interface is nil",why?Is this info enough to fix the panic?
We're also hitting a panic with an app using cgo; I'm not very familiar with dwarf so I'm not sure where to start with the 'hardening' of the parser. Any tips/hope for a fix?
panic: interface conversion: interface is nil, not *read.dwarfArrayType
goroutine 1 [running]:
github.com/randall77/heapdump14/read.dwarfTypeMap(0xc20805c000, 0xc208060800, 0xc208060800)
/home/levi/gocode/src/github.com/randall77/heapdump14/read/parser.go:1254 +0x3fa
github.com/randall77/heapdump14/read.typePropagate(0xc20805c000, 0x7ffc008b0326, 0xf)
/home/levi/gocode/src/github.com/randall77/heapdump14/read/parser.go:1503 +0x15f
github.com/randall77/heapdump14/read.Read(0x7ffc008b0317, 0xe, 0x7ffc008b0326, 0xf, 0x0)
/home/levi/gocode/src/github.com/randall77/heapdump14/read/parser.go:2123 +0x6d
main.main()
/home/levi/gocode/src/github.com/randall77/heapdump14/hview/main.go:893 +0x1f2