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

Closed
wizeman opened this issue Jan 10, 2019 · 3 comments
Closed

runtime: TestFloat64 test fails under arm64 qemu #29657

wizeman opened this issue Jan 10, 2019 · 3 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@wizeman
Copy link

wizeman commented Jan 10, 2019

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

1.11.4

Does this issue reproduce with the latest release?

Yes.

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
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 the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jan 10, 2019
@ALTree ALTree added this to the Go1.13 milestone Jan 10, 2019
@cherrymui
Copy link
Member

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

@wizeman
Copy link
Author

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: https://bugs.launchpad.net/qemu/+bug/1793119

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: https://git.qemu.org/?p=qemu.git;a=commitdiff;h=5dfbc9e4903c0121140f2

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

@wizeman
Copy link
Author

wizeman commented Jan 12, 2019

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

@wizeman wizeman closed this as completed 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.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants