From: Russ Cox Date: Mon, 23 Sep 2013 20:05:36 +0000 (-0400) Subject: runtime/pprof: fix profile parser in test X-Git-Tag: go1.2rc2~135 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=05ff4d7a1aa18811d12e9ccaa774b6e71dc613b8;p=gostls13.git runtime/pprof: fix profile parser in test Fixes #6417. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/13843043 --- diff --git a/src/pkg/runtime/pprof/pprof_test.go b/src/pkg/runtime/pprof/pprof_test.go index 419178415a..d4f9f633bc 100644 --- a/src/pkg/runtime/pprof/pprof_test.go +++ b/src/pkg/runtime/pprof/pprof_test.go @@ -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)