randall77 / heapdump14 Goto Github PK
View Code? Open in Web Editor NEWHeap dump reader & visualizer for Go 1.4
License: The Unlicense
Heap dump reader & visualizer for Go 1.4
License: The Unlicense
Hi,
I'm using go 1.5.1 and a fork that puts 1.5 in the expected header at https://github.com/cep21/heapdump14 (https://github.com/cep21/heapdump14/commit/1d13a6e5b26f5e2678caa105f22c40041eade8bd)
My program is a simple hello-world like app at https://github.com/cep21/heaptest/blob/master/main.go. I run it, then curl out a heap dump via
curl localhost:6060/debug/pprof/heapdump > /tmp/heapdump
which is an endpoint I wrote that calls WriteHeapDump().
When I run ./hview /tmp/heapdump ../../heaptest/heaptest
I get the following output:
Loading...
2015/09/16 23:07:09 unknown record kind 26311
Hi, I am trying to display a 1.7 heap dump using this tool. After some workarounds and fixes, I am struggling to get the types correctly named from the dwarf format.
One thing I don't understand is that the dump contains itabs for packages, e.g. net/http.
. These are always single pointer and have the interfaceptr
set to true. What are those for? There's no match in dwarf symbols.
I am having further issues with the 1.7 format since the iface/eface info is not present anymore, working on that.
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?
A panic occurs when using hview
against a dump generated by Hugo compiled with 1.4.
The full output:
Loading...
inferring types...
2015/09/18 20:42:00 Type *template.Template is ambiguous. Could be any of:
2015/09/18 20:42:00 *html/template.Template
2015/09/18 20:42:00 *text/template.Template
2015/09/18 20:42:00 Type *map.hdr[string]*template.Template is ambiguous. Could be any of:
2015/09/18 20:42:00 *map.hdr[string]*html/template.Template
2015/09/18 20:42:00 *map.hdr[string]*text/template.Template
2015/09/18 20:42:00 Type template.Template is ambiguous. Could be any of:
2015/09/18 20:42:00 text/template.Template
2015/09/18 20:42:00 html/template.Template
2015/09/18 20:42:00 Type map.iter[string]*template.Template is ambiguous. Could be any of:
2015/09/18 20:42:00 map.iter[string]*text/template.Template
2015/09/18 20:42:00 map.iter[string]*html/template.Template
2015/09/18 20:42:00 Type map.bucket[string]*template.Template is ambiguous. Could be any of:
2015/09/18 20:42:00 map.bucket[string]*text/template.Template
2015/09/18 20:42:00 map.bucket[string]*html/template.Template
2015/09/18 20:42:00 Type []*template.Template is ambiguous. Could be any of:
2015/09/18 20:42:00 []*text/template.Template
2015/09/18 20:42:00 []*html/template.Template
2015/09/18 20:42:00 Type [8]*template.Template is ambiguous. Could be any of:
2015/09/18 20:42:00 [8]*html/template.Template
2015/09/18 20:42:00 [8]*text/template.Template
2015/09/18 20:42:00 Type template.state is ambiguous. Could be any of:
2015/09/18 20:42:00 text/template.state
2015/09/18 20:42:00 html/template.state
2015/09/18 20:42:00 Type []val<*template.Template> is ambiguous. Could be any of:
2015/09/18 20:42:00 []val<*text/template.Template>
2015/09/18 20:42:00 []val<*html/template.Template>
2015/09/18 20:42:00 Type map.hdr[string]*template.Template is ambiguous. Could be any of:
2015/09/18 20:42:00 map.hdr[string]*html/template.Template
2015/09/18 20:42:00 map.hdr[string]*text/template.Template
2015/09/18 20:42:00 Type *map.bucket[string]*template.Template is ambiguous. Could be any of:
2015/09/18 20:42:00 *map.bucket[string]*text/template.Template
2015/09/18 20:42:00 *map.bucket[string]*html/template.Template
2015/09/18 20:42:00 Type template.FuncMap is ambiguous. Could be any of:
2015/09/18 20:42:00 text/template.FuncMap
2015/09/18 20:42:00 html/template.FuncMap
2015/09/18 20:42:00 Type map[string]*template.Template is ambiguous. Could be any of:
2015/09/18 20:42:00 map[string]*html/template.Template
2015/09/18 20:42:00 map[string]*text/template.Template
2015/09/18 20:42:00 Type *template.state is ambiguous. Could be any of:
2015/09/18 20:42:00 *text/template.state
2015/09/18 20:42:00 *html/template.state
2015/09/18 20:42:00 Type **template.Template is ambiguous. Could be any of:
2015/09/18 20:42:00 **html/template.Template
2015/09/18 20:42:00 **text/template.Template
panic: interface conversion: read.dwarfType is *read.dwarfBaseType, not *read.dwarfPtrType
goroutine 1 [running]:
github.com/randall77/heapdump14/read.typePropagate(0xc20805e000, 0x7fff7c06f517, 0x18)
/home/asd/code/go/src/github.com/randall77/heapdump14/read/parser.go:1546 +0x2598
github.com/randall77/heapdump14/read.Read(0x7fff7c06f4f6, 0x20, 0x7fff7c06f517, 0x18, 0x0)
/home/asd/code/go/src/github.com/randall77/heapdump14/read/parser.go:2120 +0x6d
main.main()
/home/asd/code/go/src/github.com/randall77/heapdump14/hview/main.go:893 +0x1f2
Loading...
panic: runtime error: index out of range
goroutine 1 [running]:
encoding/binary.littleEndian.Uint64(0x4c208457468, 0x0, 0x0, 0x4c20814fbc0)
/usr/lib/google-golang/src/encoding/binary/binary.go:71 +0x11c
encoding/binary.(*littleEndian).Uint64(0x9a5ed8, 0x4c208457468, 0x0, 0x0, 0x4c20814fbc0)
<autogenerated>:12 +0xb5
github.com/randall77/heapdump14/read.readPtr(0x4c20805e000, 0x4c208457468, 0x0, 0x0, 0x4eb650)
/home/aababilov/go/src/github.com/randall77/heapdump14/read/parser.go:2116 +0xc0
github.com/randall77/heapdump14/read.(*Dump).appendEdge(0x4c20805e000, 0x0, 0x0, 0x0, 0x4c208457468, 0x8, 0x8, 0x8, 0x2, 0x0, ...)
/home/aababilov/go/src/github.com/randall77/heapdump14/read/parser.go:1384 +0xb9
github.com/randall77/heapdump14/read.(*Dump).appendFields(0x4c20805e000, 0x0, 0x0, 0x0, 0x4c208457468, 0x8, 0x8, 0x4c20847c210, 0x1, 0x1, ...)
/home/aababilov/go/src/github.com/randall77/heapdump14/read/parser.go:1439 +0x5fc
github.com/randall77/heapdump14/read.link2(0x4c20805e000)
/home/aababilov/go/src/github.com/randall77/heapdump14/read/parser.go:1930 +0xf5
github.com/randall77/heapdump14/read.Read(0x7fffd5d46b86, 0x34, 0x0, 0x0, 0x0)
/home/aababilov/go/src/github.com/randall77/heapdump14/read/parser.go:2103 +0xab
main.main()
/home/aababilov/go/src/github.com/randall77/heapdump14/hview/main.go:893 +0x1f2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.