]> Cypherpunks repositories - gostls13.git/commit
cmd/trace: fix panic in goroutine profile
authorDmitry Vyukov <dvyukov@google.com>
Sun, 14 Jun 2015 20:58:54 +0000 (22:58 +0200)
committerDmitry Vyukov <dvyukov@google.com>
Sun, 14 Jun 2015 21:57:24 +0000 (21:57 +0000)
commit202de394f2f7864eb871d65b733479115cfabc39
tree533a3e3280e0df8d4ee30b8e65e3f3b497177b67
parent9a8750b2765184b3bfa555ac7cce6e28e45de03e
cmd/trace: fix panic in goroutine profile

In generateTrace we check that event timestamp is within the interesting range.
Then later in traceContext.time we double check event time.
However, for some events (e.g. emitSlice) we convert time of ev.Link (slice end) rather than ev itself (slice begin).
Slice end can be outside of the interesting time range, and so traceContext.time crashes.
Remove the check in traceContext.time, check in generateTrace loop is sufficient.

Change-Id: If94e93b5653c5816c0a8dcdd920f15df97616835
Reviewed-on: https://go-review.googlesource.com/11100
Reviewed-by: Andrew Gerrand <adg@golang.org>
src/cmd/trace/trace.go