dhat/tests/copy.vgtest fails as follows on s390x: --- copy.stderr.exp 2021-01-21 10:09:33.000000000 -0500 +++ copy.stderr.out 2021-10-25 04:01:35.812588098 -0400 @@ -1 +1 @@ -Total: 1,000,... bytes in 1,0.. blocks +Total: 900,181 bytes in 912 blocks It is not completely clear whether s390x is missing some bytes/blocks or if these are some internal copies (in glibc?) that are just not there on s390x.
In my testing Valgrind displays the expected number of bytes copied when "copy" is compiled with -fno-builtin: ==16069== Total: 1,000,181 bytes in 1,012 blocks Perhaps we should add that to the compile flags for this test case?
This isn't s390 specific. On amd64 RHEL which a self-rolled GCC 9.2.0 I get --- copy.stderr.exp 2020-12-07 10:17:28.466858000 +0100 +++ copy.stderr.out 2021-10-27 18:21:13.353747000 +0200 @@ -1 +1 @@ -Total: 1,000,... bytes in 1,0.. blocks +Total: 700,629 bytes in 756 blocks If I compile the file by hand: gcc -g -o copy copy.c -fno-builtin Then rerun the test it passes perl tests/vg_regtest dhat/tests/copy copy: valgrind --mode=copy --dhat-out-file=dhat.out ./copy == 1 test, 0 stderr failures, 0 stdout failures, 0 stderrB failures, 0 stdoutB failures, 0 post failures ==
Created attachment 142946 [details] Add -fno-builtin to the compile options for dhat/tests/copy This patch avoids the issue by compiling the test case with -fno-builtin, as discussed above.
Patch committed