Hello,
Pi with 1 M digits not equal 3563018237 NE
2188794840#### Qubes OS version (e.g., `R3.1`): QR32
#### Affected TemplateVMs (e.g., `fedora-23`, if applicable):
The test was done with a Standalone Machine, because of the Mathematica activation policy it is not possible to run it inside a AppVM.
uname -a
Linux localhost 4.4.14-11.pvops.qubes.x86_64 #1 SMP Tue Jul 19 01:14:58 UTC 2016 x86_64 GNU/Linux
user@localhost:~$ free -m
total used free shared buffers cached
Mem: 7179 1078 6101 10 28 421
-/+ buffers/cache: 628 6551
Swap: 1023 0 1023
---
### Expected behavior: Deterministic calculation of mathematical truth on any kind of system and especially Qubes.
Pi Black Box Testing:
Mathematica:
N[Pi,10^n]
Hash[%,"Adler32"]
or (in one line)
Hash[N[Pi, 10^6], "Adler32"]
1. Calculate the digits of Pi up to 10^n.
2. Calculate a hash
3. Do this on different machines and you should find always the same hashes.
### Actual behavior:
3563018237 NE
2188794840AMD Qubes R32:
n = 6
hash = 3563018237
Intel Win8
n = 6
hash =
2188794840NE not equal
3563018237 NE
2188794840Conclusion: One hash can be only the right one, because math is 100% deterministic.
Computer should be also deterministic, but it is sometimes hard to test them for 100%.
Here is a strong indicator, that at least one system, is not working correct.
Working-hypothesis: The hypervisor has some memory issues, which pop up here with long-integer-calculations.
Will it work for some n?
Yes, e.g. for 3:
680648812
(Let's assume that here all is right, in theory there might be some hash collision took place. There is an option to use other more long hashes, but this seems not bring us to another conclusion, that the calculations don't fit at all systems)
### Steps to reproduce the behavior:
1. Calculate Pi with 1 Million digits
2 Repeat this on different platforms (e.g. Windows versus Qubes versus native Debian)
3. compare the result (e.g. with a common hash)
### General notes:
Mathematica might be a useful tool, to check this out, but there are also many other math-libs or computer algebra programs (sage, maple), but the mathematical output is deterministic by definition and must be correct, otherwise there is some bug around.
Security Considerations: If the mathematical calculations will not lead to a deterministic result, cryptography functions can be affected because they are based on mathematical correct operations.
---
#### Related issues: Potential XEN MEM
Check last digits: 021 NE 149
Win: 021
Qubes: 149
Kind Regards