-
Notifications
You must be signed in to change notification settings - Fork 18k
time: NewTicker will not emit ticks at a frequency greater than 1/sec on qemu user mode ppc64le #36592
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
Further investigation reveals a related problem: all time.Sleep(duration) calls with a duration of less than 1 second seem to be having the same effect as time.Sleep(time.Second). |
I don't see this running on a POWER9 (go1.13.5):
Looks like an emulator problem. By the go versions you posted, it seems that the problem there started when I changed the time functions to use the VDSO rather than the syscall (commit dbd8af7). Btw, if you need access to POWER8/9 systems, please go to the OSU Open Source Lab website. You can request a VM there for development. We host our builders at OSU. |
cc @laboger |
It's much easier for users to set some Travis flags than request & configure an OSU OSL VM, so a workaround here might be nice. First I'd file a qemu bug (please do so and link it here), but if that proves too slow or hard to fix, perhaps we could detect that we're running under qemu-user and switch to using a syscall rather than the VDSO? |
This issue described a QEMU bug for ppc64le which could be related. Check the QEMU versions to see if you have one that includes the QEMU fix. |
The failing Travis CI build is pulling in the latest version of "multiarch/qemu-user-static", which is 4.2.0-2 as of writing. This packages version 4.2.0 of QEMU (the latest). The fix in the other thread appears to be in the v4.2.0 release: |
I think I found the bug. QEMU doesn't implement VDSO, so it falls back to the syscall. And there was a wrong offset when getting the syscall return. Could you please test this patch? If that works, I'll submit a CL. |
@ceseo, good find! That looks correct to me at least. Send the CL? It could make Go 1.14. (And we can backport it.) |
Change https://golang.org/cl/215397 mentions this issue: |
Verified with the provided |
Doesn't this CL need to be backported? |
@gopherbot please consider this for backport to 1.13, it's a regression. /cc @ianlancetaylor |
Backport issue(s) opened: #38236 (for 1.13). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases. |
Change https://golang.org/cl/227179 mentions this issue: |
@laboger It's already fixed in 1.14, send CL 227179 for 1.13. Thanks. |
… nanotime syscall There is a wrong offset when getting the results of a clock_gettime syscall. Although the syscall will never be called in native ppc64x, QEMU doesn't implement VDSO, so it will return wrong values. For #36592 Fixes #38236 Change-Id: Icf838075228dcdd62cf2c1279aa983e5993d66ee Reviewed-on: https://go-review.googlesource.com/c/go/+/215397 Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> (cherry picked from commit 71239b4) Reviewed-on: https://go-review.googlesource.com/c/go/+/227179 Reviewed-by: Carlos Eduardo Seo <cseo@linux.vnet.ibm.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
What version of Go are you using (
go version
)?Found on go version 1.12.15 and 1.13.6 but not 1.11.13.
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?ppc64le (run via Qemu user mode emulation in a docker container on an AMD64 machine provided by travis-ci.org).
This issue does not occur on amd64, 386, arm or arm64 architectures.
go env
Output (for host machine)What did you do?
Ran the following test:
Available here also as a playground link (code slightly modified to run from main() instead of as a test): https://play.golang.org/p/-zk7GR62pse (please note this produces the 'expected' output on playground rather than the broken output obtained from the ppc64le emulator).
What did you expect to see?
The playground output:
Or performance figures close to it (noting that this test isn't perfect and there are good reasons why the 100µs ticker may be observed as emitting somewhat fewer than 10000 ticks/sec).
What did you see instead?
On go 1.12.x on ppc64le (see this travis CI run, scroll down to "Running test suite under ppc64le", then to "TestTickerPerformance", line ~1077): https://travis-ci.org/godbus/dbus/jobs/637768665)
This go 1.13.x run has the same result: https://travis-ci.org/godbus/dbus/jobs/637768666
The go 1.11.x run does not have this issue:
This suggests to me that this may be a regression in golang and not due to a flawed emulator.
Comments
I wanted to independently verify this issue on an actual PowerPC device (rather only test on an emulator), but this is difficult for me to come across, so I have not done this.
The text was updated successfully, but these errors were encountered: