bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: coreutils-8.4: strace induced test failure


From: Jim Meyering
Subject: Re: coreutils-8.4: strace induced test failure
Date: Thu, 25 Feb 2010 09:18:44 +0100

Bruno Haible wrote:
> Trying to install coreutils 8.4 on a x86_64 Linux/glibc system, I get a test 
> failure.
> Relevant parts of test-suite.log:
...
> FAIL: ls/stat-free-symlinks (exit: 1)
> =====================================
> ...
> + strace -qe stat ls -F --color=always x link-to-x
> ...
> + compare out exp
> + diff -u out exp
> --- out       2010-02-23 23:26:44.000000000 +0100
> +++ exp       2010-02-23 23:26:44.000000000 +0100
> @@ -1,3 +1,3 @@
>  link-to-x@
>  x*
> -[ Process PID=22612 runs in 32 bit mode. ]
> +
> \ No newline at end of file
> + fail=1
> + Exit 1
> + set +e
> + exit 1
> + exit 1
> + remove_tmp_
> + __st=1
> + cleanup_
> + :
> + cd /home/bruno/data/build/coreutils-8.4/tests
> + chmod -R u+rwx 
> /home/bruno/data/build/coreutils-8.4/tests/cu-stat-free-symlinks.vtWekPYmKd
> + rm -rf 
> /home/bruno/data/build/coreutils-8.4/tests/cu-stat-free-symlinks.vtWekPYmKd
> + exit 1
>
>
> I had configured coreutils like this (native 32-bit mode build on a 64-bit
> system):
> $ ./configure --host=i686-pc-linux-gnu --prefix=/arch/x86-linux/gnu \
>   CC="gcc -m32 -march=i586" CXX="g++ -m32 -march=i586" LDFLAGS="-m32" \
>   CPPFLAGS=-Wall

Thanks for the report.
This should fix it.

>From 4bce731edc73eeac6918859bf53b61cc6c701976 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Thu, 25 Feb 2010 09:12:15 +0100
Subject: [PATCH] tests: avoid spurious failure on 32-bit-in-64-bit-system 
environment

* tests/ls/stat-free-symlinks: Handle the fact that some versions of
strace print an extra "[ Process PID=... runs in 32 bit mode. ]" line.
Tell strace to look for both stat and stat64, and adjust the test
to search for both function names in its output.
Reported by Bruno Haible in
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/19972
---
 tests/ls/stat-free-symlinks |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/ls/stat-free-symlinks b/tests/ls/stat-free-symlinks
index 6843b97..e106015 100755
--- a/tests/ls/stat-free-symlinks
+++ b/tests/ls/stat-free-symlinks
@@ -36,11 +36,11 @@ ln -s x link-to-x || framework_failure
 # symlink and an executable file properly.

 LS_COLORS='or=0:mi=0:ex=01;32:ln=01;35' \
-  strace -qe stat ls -F --color=always x link-to-x > out 2> err || fail=1
+  strace -qe stat,stat64 ls -F --color=always x link-to-x > out 2> err || 
fail=1

 # With coreutils 6.9 and earlier, this file would contain a
 # line showing ls had called stat on "x".
-grep '^stat("x"' err && fail=1
+grep -E '^stat(64)?\("x"' err && fail=1

 # Check that output is colorized, as requested, too.
 {
@@ -48,6 +48,10 @@ grep '^stat("x"' err && fail=1
   printf '\033[01;32mx\033[0m*\n'
 } > exp || fail=1

+# Filter out a line like this:
+# [ Process PID=22612 runs in 32 bit mode. ]
+grep -v '^\[ Process PID=[0-9]* runs in 32 bit mode\.' out > k; mv k out
+
 compare out exp || fail=1

 Exit $fail
--
1.7.0.401.g84adb




reply via email to

[Prev in Thread] Current Thread [Next in Thread]