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

Comments

Projects
None yet
3 participants
@wizeman
Copy link

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 this to the Go1.13 milestone Jan 10, 2019

@cherrymui

This comment has been minimized.

Copy link
Contributor

commented Jan 11, 2019

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

@wizeman

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.