1
0
mirror of https://github.com/golang/go synced 2024-10-02 06:18:32 -06:00
go/src/runtime/pprof
Austin Clements c34add780b runtime/pprof: don't produce 0 location in count profiles
profileBuilder.locForPC returns 0 to mean "no location" because 0 is
an invalid location index. However, the code to build count profiles
doesn't check the result of locForPC, so this 0 location index ends up
in the profile's location list. This, in turn, causes problems later
when we decode the profile because it puts a nil *Location in the
sample's location slice, which can later lead to a nil pointer panic.

Fix this by making printCountProfile correctly discard the result of
locForPC if it returns 0. This makes this call match the other two
calls of locForPC.

Updates #15156.

Change-Id: I4492b3652b513448bc56f4cfece4e37da5e42f94
Reviewed-on: https://go-review.googlesource.com/43630
Reviewed-by: Michael Matloob <matloob@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-05-17 18:58:31 +00:00
..
internal/profile runtime/pprof/internal/profile: move internal/pprof/profile here 2017-02-24 20:45:21 +00:00
testdata runtime/pprof: add GNU build IDs to Mappings recorded from /proc/self/maps 2017-03-08 01:09:18 +00:00
elf.go runtime/pprof: add GNU build IDs to Mappings recorded from /proc/self/maps 2017-03-08 01:09:18 +00:00
label_test.go all: fix minor misspellings 2017-04-03 23:19:07 +00:00
label.go runtime: add definitions for SetGoroutineLabels and Do 2017-02-06 20:29:37 +00:00
map.go runtime/pprof: use more efficient hash table for staging profile 2017-02-24 17:05:37 +00:00
mprof_test.go runtime/pprof: add streaming protobuf encoder 2017-02-24 20:15:56 +00:00
pprof_test.go runtime/pprof: deflake TestGoroutineCounts 2017-05-17 18:53:33 +00:00
pprof.go runtime/pprof: don't produce 0 location in count profiles 2017-05-17 18:58:31 +00:00
proto_test.go runtime/pprof: ignore dummy huge page mapping in /proc/self/maps 2017-04-26 19:34:56 +00:00
proto.go runtime/pprof: expand inlined frames in symbolized proto profiles 2017-05-15 18:20:23 +00:00
protobuf.go runtime/pprof: add streaming protobuf encoder 2017-02-24 20:15:56 +00:00
protomem_test.go runtime/pprof: clean up call/return PCs in memory profiles 2017-05-15 18:20:20 +00:00
protomem.go runtime/pprof: expand inlined frames in symbolized proto profiles 2017-05-15 18:20:23 +00:00
runtime_test.go runtime: add definitions for SetGoroutineLabels and Do 2017-02-06 20:29:37 +00:00
runtime.go runtime: add definitions for SetGoroutineLabels and Do 2017-02-06 20:29:37 +00:00