Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime/pprof: inline frames may not use combined location [1.14 backport] #37447

Closed
gopherbot opened this issue Feb 25, 2020 · 4 comments
Closed
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge
Milestone

Comments

@gopherbot
Copy link

@hyangah requested issue #37446 to be considered for backport to the next 1.14 minor release.

@gopherbot please consider this for backport to 1.14, it's a regression.

@gopherbot gopherbot added the CherryPickCandidate Used during the release process for point releases label Feb 25, 2020
@gopherbot gopherbot added this to the Go1.14.1 milestone Feb 26, 2020
@hyangah
Copy link
Contributor

hyangah commented Mar 6, 2020

@prattmic can you create a cherry-pick cl for this? I tried but I don't have the right permission to forge author. :-)

https://github.com/golang/go/wiki/MinorReleases#making-cherry-pick-cls

@gopherbot
Copy link
Author

Change https://golang.org/cl/222762 mentions this issue: [release-branch.go1.14] runtime/pprof: expand final stack frame to avoid truncation

@dmitshur
Copy link
Contributor

Approving as this is a serious issue and there is no reasonable workaround.

@dmitshur dmitshur added CherryPickApproved Used during the release process for point releases and removed CherryPickCandidate Used during the release process for point releases labels Mar 10, 2020
@gopherbot
Copy link
Author

Closed by merging 9c41c1d to release-branch.go1.14.

gopherbot pushed a commit that referenced this issue Mar 10, 2020
…oid truncation

When generating stacks, the runtime automatically expands inline
functions to inline all inline frames in the stack. However, due to the
stack size limit, the final frame may be truncated in the middle of
several inline frames at the same location.

As-is, we assume that the final frame is a normal function, and emit and
cache a Location for it. If we later receive a complete stack frame, we
will first use the cached Location for the inlined function and then
generate a new Location for the "caller" frame, in violation of the
pprof requirement to merge inlined functions into the same Location.

As a result, we:

1. Nondeterministically may generate a profile with the different stacks
combined or split, depending on which is encountered first. This is
particularly problematic when performing a diff of profiles.

2. When split stacks are generated, we lose the inlining information.

We avoid both of these problems by performing a second expansion of the
last stack frame to recover additional inline frames that may have been
lost. This expansion is a bit simpler than the one done by the runtime
because we don't have to handle skipping, and we know that the last
emitted frame is not an elided wrapper, since it by definition is
already included in the stack.

Fixes #37447

Change-Id: If3ca2af25b21d252cf457cc867dd932f107d4c61
Reviewed-on: https://go-review.googlesource.com/c/go/+/221577
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
(cherry picked from commit fadbf74)
Reviewed-on: https://go-review.googlesource.com/c/go/+/222762
@golang golang locked and limited conversation to collaborators Mar 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge
Projects
None yet
Development

No branches or pull requests

3 participants