summaryrefslogtreecommitdiff
path: root/tests/tail-2
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2013-12-08 21:43:49 +0000
committerPádraig Brady <P@draigBrady.com>2013-12-09 09:28:29 +0000
commit042780801c9ca765b633acc9dc7aebfa649fdbb1 (patch)
tree3bb1a0e270beb8cc4ddc3b48a860a750c74032a2 /tests/tail-2
parent402e8ecbc4bf3b3fe866338e77e21feceac910f0 (diff)
downloadcoreutils-042780801c9ca765b633acc9dc7aebfa649fdbb1.tar.xz
tests: fix false failure due to gdb inline function handling
Inline functions are awkward to breakpoint as mentioned at: https://sourceware.org/bugzilla/show_bug.cgi?id=10738 The normal case here was for the breakpoint on the inline function to fail, resulting in a 10s delay before skipping the test. However on GCC 4.7.2 on ppc64 at least it was seen that the test failed erroneously due to the breakpoint being successfully set on an "out of line" function, but an inline function was actually being called. * tests/tail-2/inotify-race.sh: Switch to a line based breakpoint, rather than a symbol base one, which avoids issues with breakpoints on inline functions. Also skip_ on the initial breakpoint check in case the breakpoint is not traversed which would be the case on remote file systems for example.
Diffstat (limited to 'tests/tail-2')
-rwxr-xr-xtests/tail-2/inotify-race.sh14
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/tail-2/inotify-race.sh b/tests/tail-2/inotify-race.sh
index cc0f61b32..53c7a7c5f 100755
--- a/tests/tail-2/inotify-race.sh
+++ b/tests/tail-2/inotify-race.sh
@@ -37,13 +37,17 @@ case $(cat gdb.out) in
*) skip_ "can't run gdb";;
esac
+break_src="$abs_top_builddir/src/tail.c"
+break_line=$(grep -n ^tail_forever_inotify "$break_src") || framework_failure_
+break_line=$(echo "$break_line" | cut -d: -f1) || framework_failure_
+
# See if gdb works and
-# tail_forever_inotify is compiled and not inlined
+# tail_forever_inotify is compiled and run
timeout 10s gdb -nx --batch-silent \
- --eval-command='break tail_forever_inotify' \
+ --eval-command="break $break_line" \
--eval-command='run -f file' \
--eval-command='quit' \
- tail < /dev/null > gdb.out 2>&1
+ tail < /dev/null > gdb.out 2>&1 || skip_ 'breakpoint not hit'
# FIXME: The above is seen to _intermittently_ fail with:
# warning: .dynamic section for "/lib/libc.so.6" is not at the expected address
@@ -54,9 +58,9 @@ test -s gdb.out && { cat gdb.out; skip_ "can't set breakpoints in tail"; }
# inotify initialization, and then continue. Before the fix,
# that just-appended line would never be output.
timeout 10s gdb -nx --batch-silent \
- --eval-command='break tail_forever_inotify' \
+ --eval-command="break $break_line" \
--eval-command='run -f file >> tail.out' \
- --eval-command="shell echo never-seen-with-tail-7.5 >> file" \
+ --eval-command='shell echo never-seen-with-tail-7.5 >> file' \
--eval-command='continue' \
--eval-command='quit' \
tail < /dev/null > /dev/null 2>&1 &