]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: fix crash in GoroutineProfile
authorRuss Cox <rsc@golang.org>
Wed, 27 Jan 2016 03:58:59 +0000 (22:58 -0500)
committerRuss Cox <rsc@golang.org>
Wed, 27 Jan 2016 04:55:59 +0000 (04:55 +0000)
commit313fd1cb1343e46b563b6b8acfef7e58604b5b8f
tree25afafd92b7625d2fe0df3503454cdfb91a7a48a
parent4ec2fd3e6ac4f869d39348bf48016687b731d910
runtime: fix crash in GoroutineProfile

It was just completely broken if you gave it the number
of records it asked for. Make it impossible for that particular
inconsistency to happen again.

Also make it exclude system goroutines, to match both
NumGoroutine and Stack.

Fixes #14046.

Change-Id: Ic238c6b89934ba7b47cccd3440dd347ed11e4c3d
Reviewed-on: https://go-review.googlesource.com/18976
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/runtime/mprof.go
src/runtime/runtime_test.go