-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime/trace: TestTraceCPUProfile failures with runtime._System
sample not present in execution trace
#53378
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
Comments
Marking as release-blocker for Go 1.19 because this failure mode affects |
The missing samples are both Perhaps this is more mundane: the test disables tracing before CPU profiling, so there is a race between disabling tracing and disabling profiling during which a sample could end up in the pprof profile but not the trace. @rhysh perhaps we should only complain about mismatched cpuHogger samples, which should be strictly bound inside tracing and profiling being enabled? |
In the android/amd64 failure: The top-level error message is In the windows/amd64-race failure: The top-level error message is Calls from The execution tracer and the CPU profiler do their symbolization in rather different ways: a single call to runtime.CallersFrames (the allFrames function in src/runtime/trace.go), or a more involved approach that eventually leads to a separate runtime.CallersFrames call for each single address (the allFrames function in src/runtime/pprof/proto.go). Maybe that explains the difference? These two-frame call stacks are faked by runtime.sigprof, and built in a way that is known to render correctly with the CPU profiler's approach of splitting addresses and symbolizing each separately, and might (I don't know the details of CallersFrames' operation) not deal well with being symbolized as a pair as the new code does. Should we try to change the execution tracer's profile stacks to include more info on reported callees of I don't think it's the mundane race, @prattmic : the test filters the CPU profile samples down to the ones that include the "tracing:[on]" label, which has a fairly well-controlled start and end time. That should make the order of the Start/Stop function calls not matter. |
By "special-case" in the test, you mean ignore, right? I think that is fine. It would be nice to get the execution trace symbolization to match up with pprof a bit better in the these cases, but I certainly don't think it is high priority or something that needs to be in 1.19.
Apologies, I did not pay close enough attention and missed that. |
Change https://go.dev/cl/413457 mentions this issue: |
When runtime.sigprof encounters a stack that gentraceback is unable to process, it synthesizes a call stack with a sentinel function (such as runtime._System) at the leaf. The test to confirm that runtime/trace and runtime/pprof have similar views of CPU profile samples has trouble with those stacks. The test confirms that the samples match by confirming that their symbolized forms match, and the symbolization procedure is very different for the two packages. Skip the samples that the CPU profiler's view symbolizes to include one of runtime.sigprof's sentinel functions at the leaf. (The test design expects the CPU profiler to under-report samples relative to the execution tracer.) Fixes golang#53378 Change-Id: I60c27de4c69b454057d28a3b6e12d70369de4c4f Reviewed-on: https://go-review.googlesource.com/c/go/+/413457 Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Rhys Hiltner <rhys@justin.tv> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Pratt <mpratt@google.com>
greplogs -l -e 'runtime\._System:\d+" not present in execution trace'
2022-06-06T19:55:16-7271a0a/android-amd64-emu
2022-05-05T15:43:29-fdb640b/windows-amd64-race
TestTraceCPUProfile
was previously believed to have been fixed in #52693 (attn @rhysh @cherrymui @prattmic; CC @golang/runtime).The text was updated successfully, but these errors were encountered: