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: TestFloat64 test fails under arm64 qemu #29657

wizeman opened this issue Jan 10, 2019 · 3 comments

runtime: TestFloat64 test fails under arm64 qemu #29657

wizeman opened this issue Jan 10, 2019 · 3 comments


Copy link

@wizeman wizeman commented Jan 10, 2019

What version of Go are you using (go version)?


Does this issue reproduce with the latest release?


What operating system and processor architecture are you using (go env)?

I'm running qemu in system emulation mode. Host is (NixOS) Linux x86-64, guest is (NixOS) Linux arm64.

Relevant qemu command line arguments:

# qemu-system-aarch64 -machine virt,highmem=off -cpu cortex-a57 -smp cpus=4 -m 2048 -bios u-boot.bin (...)

What did you do?

Tried to build the go compiler as part of the standard Nix/NixOS build system, which includes running the tests.

What did you expect to see?

I expected all the tests to pass.

What did you see instead?

I ran into this failure:

--- FAIL: TestFloat64 (1.47s)
    softfloat64_test.go:131: 0.0021606686026376387 / -1.136016955471848 = sw -0.001901968621357591, hw -0.0019019686213575912
FAIL    runtime 902.126s

Seems to be some kind of rounding issue.

All other tests pass (although admittedly, NixOS disables some tests by default due to them being unreliable or requiring sandboxed features).

@ALTree ALTree changed the title TestFloat64 test fails under arm64 qemu runtime: TestFloat64 test fails under arm64 qemu Jan 10, 2019
@ALTree ALTree added this to the Go1.13 milestone Jan 10, 2019
Copy link

@cherrymui cherrymui commented Jan 11, 2019

Can we be sure that the QEMU implementation of the hardware floating point is correct and accurate?

Copy link

@wizeman wizeman commented Jan 11, 2019

You may be right that this could be a QEMU problem.
I found this bug report related to QEMU floating point division inaccuracy in IEEE-754 compliant mode:

I'm running QEMU 3.0.0 which doesn't seem to have the following commit, which is mentioned in the bug report and is supposed to fix it:;a=commitdiff;h=5dfbc9e4903c0121140f2

I will try applying it and see if it solves the issue.

Copy link

@wizeman wizeman commented Jan 12, 2019

I can confirm that the above QEMU patch seems to have solved this issue. Thanks!

@wizeman wizeman closed this Jan 12, 2019
@golang golang locked and limited conversation to collaborators Jan 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.