rabauke / trng4

state of the art C++ pseudo-random number generator library for sequential and parallel Monte Carlo simulations
https://www.numbercrunch.de/trng/
BSD 3-Clause "New" or "Revised" License
120 stars 21 forks source link

Version 4.26: Test uint128 i/o operations fails on aarch64 #32

Closed badshah400 closed 1 week ago

badshah400 commented 1 month ago

When building trng 4.26 on openSUSE for the aarch64 architecture, we notice that one of the tests fails when running ctest, with the following log:

[   59s]  5/59 Test  #5: uint128 i/o operations ........................***Failed    0.06 sec
[   59s] Filters: uint128 i/o operations
[   59s] 
[   59s] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[   59s] test_all is a Catch v2.13.10 host application.
[   59s] Run with -? for options
[   59s] 
[   59s] -------------------------------------------------------------------------------
[   59s] uint128 i/o operations
[   59s]   decimal output
[   59s] -------------------------------------------------------------------------------
[   59s] /home/abuild/rpmbuild/BUILD/trng4-4.26/tests/test_uint128.cc:432
[   59s] ...............................................................................
[   59s] 
[   59s] /home/abuild/rpmbuild/BUILD/trng4-4.26/tests/test_uint128.cc:444: FAILED:
[   59s]   REQUIRE( strstr.str() == a_y.y )
[   59s] with expansion:
[   59s]   "75594757214061742522368" == "0"
[   59s] 
[   59s] -------------------------------------------------------------------------------
[   59s] uint128 i/o operations
[   59s]   hex output
[   59s] -------------------------------------------------------------------------------
[   59s] /home/abuild/rpmbuild/BUILD/trng4-4.26/tests/test_uint128.cc:452
[   59s] ...............................................................................
[   59s] 
[   59s] /home/abuild/rpmbuild/BUILD/trng4-4.26/tests/test_uint128.cc:464: FAILED:
[   59s]   REQUIRE( strstr.str() == a_y.y )
[   59s] with expansion:
[   59s]   "10080000000000000000" == "0"
[   59s] 
[   59s] -------------------------------------------------------------------------------
[   59s] uint128 i/o operations
[   59s]   octal output
[   59s] -------------------------------------------------------------------------------
[   59s] /home/abuild/rpmbuild/BUILD/trng4-4.26/tests/test_uint128.cc:472
[   59s] ...............................................................................
[   59s] 
[   59s] /home/abuild/rpmbuild/BUILD/trng4-4.26/tests/test_uint128.cc:484: FAILED:
[   59s]   REQUIRE( strstr.str() == a_y.y )
[   59s] with expansion:
[   59s]   "20200000000000000000000000" == "0"
[   59s] 
[   59s] ===============================================================================
[   59s] test cases:  1 |  0 passed | 1 failed
[   59s] assertions: 33 | 30 passed | 3 failed

The test suite runs fine with version 4.25 on the same build environment.

Here is the full build log just in case: log.zip.

Thanks for the very useful library.

rabauke commented 2 weeks ago

@badshah400 Thanks for this report. Issues will be fixed in the next release.

rabauke commented 1 week ago

@badshah400 I tried to reproduce the issue on a Raspberry Pi 4 running Ubuntu 24.4 for ARM 64 using GCC 13.2.0. I am not able to reproduce the reported issues. All unit tests run without any failure. Though, the provided log file suggests that the issues have been observed on ARM 64 with a 32-bit ABI (instead of a 64bit ABI).

[    0s] Using BUILD_ROOT=/var/cache/obs/worker/root_26/.mount
[    0s] Using BUILD_ARCH=aarch64:aarch64_ilp32:armv8l
[    0s] Doing kvm build in /var/cache/obs/worker/root_26/root
[    0s] 
[    0s] 
[    0s] i03-armsrv2 started "build trng.spec" at Mon Jul 22 12:25:19 UTC 2024.
[    0s] 
rabauke commented 1 week ago

@badshah400 I am also not able to reproduce the issue on a Raspberry Pi 4 running Raspberry Pi OS (32-Bit, Raspbian GNU/Linux 12 (bookworm)) using GCC 12.2.0. All unit tests run without any failure.

rabauke commented 1 week ago

@badshah400 I am still unable to reproduce the issue. Though, I think I am able to understand the root cause from investigating the provided log files. Can you please check if the issue still occurs for the latest version from git master (which contains two fixes)?

badshah400 commented 1 week ago

Tested just now. Works perfectly with commits bb7f1ea1ff2b5030a184e3b0110dcf4bac599114 and a58e64b04a23260c55c8a344c550bea2bf7305a5 applied. Big thanks.

rabauke commented 1 week ago

@badshah400 Thanks for testing and feedback. I will prepare a new release soon.