Pádraig Brady wrote: > On 13/01/10 10:51, Jim Meyering wrote: >> Christophe LYON wrote: >>> I have built coreutils-8.3 and ran 'make check' on a few systems and I >>> have noticed some FAILs as follows. Given their old age, I am not sure >>> it is worth reporting, though. >>> >>> * Linux RedHat 3/x86: tail-2/inotify-hash-abuse, log extract: >>> + kill -HUP 15829 >>> [1]+ Hangup tail $debug -qF $(seq $n)>out 2>&1 >>> + wait 15829 >>> ./tail-2/inotify-hash-abuse: line 59: wait: pid 15829 is not a child >>> of this shell >>> + st=127 >>> + echo tail died via unexpected signal: 127 >>> tail died via unexpected signal: 127 >>> + fail=1 >>> >>> * Linux RedHat 3/x86: tail-2/inotify-hash-abuse2, log extract: >>> + kill -HUP 16044 >>> ./tail-2/inotify-hash-abuse2: line 40: kill: (16044) - No such process >>> + wait 16044 >>> + st=124 >>> + echo tail died via unexpected signal: 124 >>> tail died via unexpected signal: 124 >>> + fail=1 >>> >>> * Linux RedHat 3/x86_64: test-utimens (test-utimens.h:101: assertion failed) >>> >>> * Linux RedHat 4/x86: test-nanosleep (test-nanosleep.c:78: assertion failed) >>> * Linux RedHat 4/x86: test-sleep (test-sleep.c:53: assertion failed) >> >> Thanks for the report. >> Can you repeat the tests with the very latest snapshot? >> >> http://meyering.net/cu/coreutils-ss.tar.gz 9.4 MB >> http://meyering.net/cu/coreutils-ss.tar.xz 4.0 MB >> >> If any of those failures persist, we *might* have time to address >> one or two before coreutils-8.4, which is slated to be released today. > > I think we may be encountering shell issues here? > > We get 127 rather than 129 under dash > once the "hangup" message is displayed before > `wait` is called > > $ /bin/sleep 20 & bg=$! > $ kill -HUP $bg > [1] + Hangup /bin/sleep 20 > $ wait $bg > $ echo $? > 127
I think so to, and had just been working on that. What do you think of these changes? >From 2eb54470541557fd89b934a7b2245fe4b1515b82 Mon Sep 17 00:00:00 2001 From: Jim Meyering <[email protected]> Date: Wed, 13 Jan 2010 12:46:25 +0100 Subject: [PATCH] tests: decrease risk of race in tail-2/inotify-hash-abuse2 * tests/tail-2/inotify-hash-abuse2: Try to avoid killing the tail process before we start waiting for it to die. Also, don't assume that kill -HUP is the same as kill -1. Use the latter. Also, always use tail's -s .001 option, to make the non-inotify case act more like the inotify-enabled one. --- tests/tail-2/inotify-hash-abuse2 | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/tail-2/inotify-hash-abuse2 b/tests/tail-2/inotify-hash-abuse2 index 4fe080b..5966b03 100755 --- a/tests/tail-2/inotify-hash-abuse2 +++ b/tests/tail-2/inotify-hash-abuse2 @@ -26,9 +26,9 @@ fi touch f || framework_failure -debug='---disable-inotify -s .001' +debug='---disable-inotify' debug= -timeout 10 tail $debug -F f & pid=$! +timeout 10 tail $debug -s .001 -F f & pid=$! for i in $(seq 200); do kill -0 $pid || break; @@ -37,8 +37,14 @@ for i in $(seq 200); do done # Fixed tail will not have aborted. Kill it. -kill -HUP $pid +( touch witness; sleep 1; kill -1 $pid ) & +# Wait for the killer subshell to start, so that we decrease the +# risk of 'wait'ing *after* the tail process has been killed. +until test -f witness; do :; done + +# Hope that we begin to wait for $pid before it is killed. +# FIXME: this is racy... wait $pid st=$? -- 1.6.6.511.gf46c4
