Bug 444495 - dhat/tests/copy fails on s390x
Summary: dhat/tests/copy fails on s390x
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: dhat (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-27 16:08 UTC by Mark Wielaard
Modified: 2021-10-27 19:46 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Add -fno-builtin to the compile options for dhat/tests/copy (1.02 KB, patch)
2021-10-27 16:53 UTC, Andreas Arnez
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Wielaard 2021-10-27 16:08:17 UTC
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.
Comment 1 Andreas Arnez 2021-10-27 16:28:51 UTC
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?
Comment 2 Paul Floyd 2021-10-27 16:31:31 UTC
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 ==
Comment 3 Andreas Arnez 2021-10-27 16:53:17 UTC
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.
Comment 4 Paul Floyd 2021-10-27 19:46:44 UTC
Patch committed