On 14/03/2023 22:54, Bruno Haible wrote:
On AIX 7.1 (64-bit mode, with AIX xlc), there are
   - 5 test failures, reported as 'FAIL: 4',
   - 5 errors.

# FAIL:  4
FAIL: tests/misc/help-version
FAIL: [
FAIL: tests/misc/cksum-raw
FAIL: tests/misc/sort-continue
FAIL: tests/misc/tee

# ERROR: 5
ERROR: tests/rm/rm-readdir-fail
ERROR: tests/cp/nfs-removal-race
ERROR: tests/df/no-mtab-status
ERROR: tests/df/skip-duplicates
ERROR: tests/ls/getxattr-speedup

Find attached the log file.

The tee and cksum-raw tests at least, are new issues.
A fix for the cksum-raw issue is attached
(and tested to work on sparc64).

It would be good to get output from
make TESTS=tests/misc/tee.sh VERBOSE=yes SUBDIRS=. check
to get more info on the tee one,
though the new part of that test is a bit involved
so may be tricky to debug without access.

thanks for all the testing!
Pádraig
From a8e6e627f1a1142ec9cb273cfadc3f9aa2aa412a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <p...@draigbrady.com>
Date: Wed, 15 Mar 2023 13:57:37 +0000
Subject: [PATCH] cksum: fix --raw on 64 bit big endian systems

* src/sum.c (output_bsd): On sparc64 for example,
a crc of 0 was output due to casting an int variable
to uint16_t and thus operating on the wrong end of the variable.
Instead use explicit assignment to the narrower type
to ensure we get the appropriate data.
(output_sysv): Likewise.
Reported by Bruno Haible.
---
 src/sum.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/sum.c b/src/sum.c
index 5046bb3f0..36464cacf 100644
--- a/src/sum.c
+++ b/src/sum.c
@@ -197,7 +197,8 @@ output_bsd (char const *file, int binary_file, void const *digest,
   if (raw)
     {
       /* Output in network byte order (big endian).  */
-      uint16_t out_int = SWAP (*(uint16_t *)digest);
+      uint16_t out_int = *(int *)digest;
+      out_int = SWAP (out_int);
       fwrite (&out_int, 1, 16/8, stdout);
       return;
     }
@@ -221,7 +222,8 @@ output_sysv (char const *file, int binary_file, void const *digest,
   if (raw)
     {
       /* Output in network byte order (big endian).  */
-      uint16_t out_int = SWAP (*(uint16_t *)digest);
+      uint16_t out_int = *(int *)digest;
+      out_int = SWAP (out_int);
       fwrite (&out_int, 1, 16/8, stdout);
       return;
     }
-- 
2.26.2

Reply via email to