runtime/pprof: handle empty stack traces in Profile.Add
If the caller passes a large number to Profile.Add, the list of pcs is empty, which results in junk (a nil pc) being recorded. Check for that explicitly, and replace such stack traces with a lostProfileEvent. Fixes #18836. Change-Id: I99c96aa67dd5525cd239ea96452e6e8fcb25ce02 Reviewed-on: https://go-review.googlesource.com/36891Reviewed-by: Russ Cox <rsc@golang.org>
Showing
Please register or sign in to comment