-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: GODEBUG gctrace bug with time ran on Mac #21554
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
cc @aclements |
It took me some work, but I was able to reproduce this on a gomote
In another terminal:
|
Ah, the problem is we have two different time bases in the runtime as of e4371fb. That commit made |
Change https://golang.org/cl/58690 mentions this issue: |
Re-opening for cherry-pick to Go 1.9.1 |
Is this worth cherry picking? It seems a very minor problem. |
Rick and I pretty frequently ask people for gctrace output when debugging performance issues. This could make that harder to interpret. It's also a simple fix, so I think whenever 1.9.1 happens we might as well include it. |
I am teaching this stuff and now that 1.9 has been released, this bug makes things difficult for training. So please consider getting this in sooner rather then later.
… On Aug 25, 2017, at 1:35 PM, Austin Clements ***@***.***> wrote:
Rick and I pretty frequently ask people for gctrace output when debugging performance issues. This could make that harder to interpret. It's also a simple fix, so I think whenever 1.9.1 happens we might as well include it.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#21554 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ACLKRcnSRKERiW9tx1J2gDcoFouGe2Bgks5sbwXHgaJpZM4O-kOz>.
|
CL 58690 OK for Go 1.9.2. |
Change https://golang.org/cl/70848 mentions this issue: |
…e is initialized CL 36428 changed the way nanotime works so on Darwin and Windows it now depends on runtime.startNano, which is computed at runtime.init time. Unfortunately, the `runtimeInitTime = nanotime()` initialization happened *before* runtime.init, so on these platforms runtimeInitTime is set incorrectly. The one (and only) consequence of this is that the start time printed in gctrace lines is bogus: gc 1 18446653480.186s 0%: 0.092+0.47+0.038 ms clock, 0.37+0.15/0.81/1.8+0.15 ms cpu, 4->4->1 MB, 5 MB goal, 8 P To fix this, this commit moves the runtimeInitTime initialization to shortly after runtime.init, at which point nanotime is safe to use. This also requires changing the condition in newproc1 that currently uses runtimeInitTime != 0 simply to detect whether or not the main M has started. Since runtimeInitTime could genuinely be 0 now, this introduces a separate flag to newproc1. Fixes #21554. Change-Id: Id874a4b912d3fa3d22f58d01b31ffb3548266d3b Reviewed-on: https://go-review.googlesource.com/58690 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rick Hudson <rlh@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-on: https://go-review.googlesource.com/70848 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Austin Clements <austin@google.com>
go1.9.2 has been packaged and includes: The release is posted at golang.org/dl. — golang.org/x/build/cmd/releasebot, Oct 26 21:09:07 UTC |
Just tried it out on darwin and it looks good! Thank You. Is there anyway this can get fixed as well for 1.9? It is broken on both darwin and linux. |
@ardan-bkennedy, this isn't really the place to ask about the other issue. If you're interested in having #21697 fixed in 1.9, you should argue that on that issue (and understand that whether or not the fix gets backported also depends on the risk involved in the actual fix). |
New to all this so thanks for laying out the policy I am supposed to follow. It won’t happen again. |
What version of Go are you using (
go version
)?go version go1.9rc2 darwin/amd64
Does this issue reproduce with the latest release?
Yes, only in 1.9 and since beta.
What operating system and processor architecture are you using (
go env
)?What did you do?
Using this program:
https://github.com/ardanlabs/gotraining/tree/master/topics/go/profiling/project
Build the code and run it using:
$ GODEBUG=gctrace=1 ./project > /dev/null
Then open the browser and run a search. Be sure to check the three boxes for cnn, bbc and nyt and you get some results.
http://localhost:5000/search
This will produce a gctrace immediately.
What did you expect to see?
gc 1 @1.186s 0%: 0.092+0.47+0.038 ms clock, 0.37+0.15/0.81/1.8+0.15 ms cpu, 4->4->1 MB, 5 MB goal, 8 P
What did you see instead?
gc 1 18446653480.186s 0%: 0.092+0.47+0.038 ms clock, 0.37+0.15/0.81/1.8+0.15 ms cpu, 4->4->1 MB, 5 MB goal, 8 P
The text was updated successfully, but these errors were encountered: