runtime/pprof: fix profile parser in test

Fixes #6417.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/13843043
This commit is contained in:
Russ Cox 2013-09-23 16:05:36 -04:00
parent bc2c3388f4
commit 05ff4d7a1a

View file

@ -58,7 +58,8 @@ func parseProfile(t *testing.T, bytes []byte, f func(uintptr, []uintptr)) {
val := *(*[]uintptr)(unsafe.Pointer(&bytes))
val = val[:l]
if l < 13 {
// 5 for the header, 2 for the per-sample header on at least one sample, 3 for the trailer.
if l < 5+2+3 {
t.Logf("profile too short: %#x", val)
if badOS[runtime.GOOS] {
t.Skipf("ignoring failure on %s; see golang.org/issue/6047", runtime.GOOS)