GNU bug report logs - #8074
Fix sparse-pipe test on 2.6.26 kernel

Previous Next

Package: coreutils;

Reported by: "Gilles Espinasse" <g.esp <at> free.fr>

Date: Fri, 18 Feb 2011 08:57:01 UTC

Severity: normal

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 8074 in the body.
You can then email your comments to 8074 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#8074; Package coreutils. (Fri, 18 Feb 2011 08:57:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Gilles Espinasse" <g.esp <at> free.fr>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Fri, 18 Feb 2011 08:57:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Gilles Espinasse" <g.esp <at> free.fr>
To: <bug-coreutils <at> gnu.org>
Cc: Jim Meyering <jim <at> meyering.net>
Subject: Fix sparse-pipe test on 2.6.26 kernel
Date: Fri, 18 Feb 2011 09:48:52 +0100
[Message part 1 (text/plain, inline)]
I send 2 messages to bug-coreutils <at> gnu.org in last 2 weeks but that never
reach the list.
I don't know why as this had work in the past and I receive message from
that same address and was able to reply. Isn't the antispam too good? So I
am a bit forced to try with a direct coreutils message.

Anyway, here is the issue. I compile the same code on different machines and
that's made in a chroot a la LFS. With sparse-fiemap-test.patch, all tests
are ok on three machines but randomly fail on the fourth (all x86 32-bits).
The only difference at this stage between the different machines should be
the running kernel (same glibc-2.11.3 is compiled before coreutils).
This work on ubuntu 2.6.32-26-generic, 2.6.27.57 vanilia kernel, Centos-5.5
2.6.18-194.32.1.el5 but fail in debian v5 2.6.26-2-686

Tested as root with
for i in {1..20}; do make -s check -C tests TESTS=cp/sparse-to-pipe
2>/dev/null;done | grep '1 test'
show this result on the debian machine
1 of 1 test failed
1 of 1 test failed
1 test passed
1 test passed
1 of 1 test failed
1 of 1 test failed
1 of 1 test failed
1 of 1 test failed
1 test passed
1 test passed
1 of 1 test failed
1 test passed
1 test passed
1 of 1 test failed
1 of 1 test failed
1 of 1 test failed
1 test passed
1 test passed
1 of 1 test failed
1 of 1 test failed

FS is ext3
failure is
+ require_sparse_support_
+ test 0 = 0
+ t=sparse.17085
+ dd bs=1 seek=128K of=sparse.17085
++ du -sk sparse.17085
+ set x 0 sparse.17085
+ kb_size=0
+ rm -f sparse.17085
+ test 0 -ge 128
+ mkfifo_or_skip_ pipe
+ test 1 = 1
+ mkfifo pipe
+ timeout 10 cat pipe
+ truncate -s1M sparse
+ cp sparse pipe
+ cmp sparse copy
cmp: EOF on copy
+ fail=1
+ Exit 1

The fun is that if I try to strace the cmp, this change the cmp test to
reliabily work

If I add a dd if=/dev/null of=pipe conv=notrunc,fdatasync, test reliabily
work too.
So I added that in attached patch.

Gilles
[Fix-unreliable-sparse-to-pipe-test-on-cmp-on-debian-2.6.26.patch (application/octet-stream, attachment)]

Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#8074; Package coreutils. (Fri, 18 Feb 2011 10:59:02 GMT) Full text and rfc822 format available.

Message #8 received at 8074 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Gilles Espinasse <g.esp <at> free.fr>
Cc: Jim Meyering <jim <at> meyering.net>, 8074 <at> debbugs.gnu.org
Subject: Re: bug#8074: Fix sparse-pipe test on 2.6.26 kernel
Date: Fri, 18 Feb 2011 10:54:36 +0000
On 18/02/11 08:48, Gilles Espinasse wrote:
> I compile the same code on different machines and
> that's made in a chroot a la LFS. With sparse-fiemap-test.patch, all tests
> are ok on three machines but randomly fail on the fourth (all x86 32-bits).
> The only difference at this stage between the different machines should be
> the running kernel (same glibc-2.11.3 is compiled before coreutils).
> This work on ubuntu 2.6.32-26-generic, 2.6.27.57 vanilia kernel, Centos-5.5
> 2.6.18-194.32.1.el5 but fail in debian v5 2.6.26-2-686
> 
> Tested as root with
> for i in {1..20}; do make -s check -C tests TESTS=cp/sparse-to-pipe
> 2>/dev/null;done | grep '1 test'
> show this result on the debian machine
> 1 of 1 test failed
> 1 of 1 test failed
> 1 test passed
> 1 test passed
> 1 of 1 test failed
> 1 of 1 test failed
> 1 of 1 test failed
> 1 of 1 test failed
> 1 test passed
> 1 test passed
> 1 of 1 test failed
> 1 test passed
> 1 test passed
> 1 of 1 test failed
> 1 of 1 test failed
> 1 of 1 test failed
> 1 test passed
> 1 test passed
> 1 of 1 test failed
> 1 of 1 test failed
> 
> FS is ext3
> failure is
> + require_sparse_support_
> + test 0 = 0
> + t=sparse.17085
> + dd bs=1 seek=128K of=sparse.17085
> ++ du -sk sparse.17085
> + set x 0 sparse.17085
> + kb_size=0
> + rm -f sparse.17085
> + test 0 -ge 128
> + mkfifo_or_skip_ pipe
> + test 1 = 1
> + mkfifo pipe
> + timeout 10 cat pipe
> + truncate -s1M sparse
> + cp sparse pipe
> + cmp sparse copy
> cmp: EOF on copy
> + fail=1
> + Exit 1
> 
> The fun is that if I try to strace the cmp, this change the cmp test to
> reliabily work
> 
> If I add a dd if=/dev/null of=pipe conv=notrunc,fdatasync, test reliabily
> work too.
> So I added that in attached patch.

Good testing!
Interesting to see that fdatasync flushes the pipe to disk.
However it might be more portable/robust to use `wait`
rather than that dd command?

cheers,
Pádraig.




Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#8074; Package coreutils. (Fri, 18 Feb 2011 12:46:02 GMT) Full text and rfc822 format available.

Message #11 received at 8074 <at> debbugs.gnu.org (full text, mbox):

From: "Gilles Espinasse" <g.esp <at> free.fr>
To: Pádraig Brady <P <at> draigBrady.com>
Cc: Jim Meyering <jim <at> meyering.net>, 8074 <at> debbugs.gnu.org
Subject: Re: bug#8074: Fix sparse-pipe test on 2.6.26 kernel
Date: Fri, 18 Feb 2011 13:40:49 +0100
[Message part 1 (text/plain, inline)]
----- Original Message ----- 
From: "Pádraig Brady" <P <at> draigBrady.com>
To: "Gilles Espinasse" <g.esp <at> free.fr>
Cc: "Jim Meyering" <jim <at> meyering.net>; <8074 <at> debbugs.gnu.org>
Sent: Friday, February 18, 2011 11:54 AM
Subject: bug#8074: Fix sparse-pipe test on 2.6.26 kernel


...
> >
> > If I add a dd if=/dev/null of=pipe conv=notrunc,fdatasync, test
reliabily
> > work too.
> > So I added that in attached patch.
>
> Good testing!
> Interesting to see that fdatasync flushes the pipe to disk.
> However it might be more portable/robust to use `wait`
> rather than that dd command?
>
> cheers,
> Pádraig.
>
wait work fine
Find v2 attached

Gilles
[v2-Fix-unreliable-sparse-to-pipe-test-on-cmp-on-debian-2.6.26.patch (application/octet-stream, attachment)]

Reply sent to Jim Meyering <jim <at> meyering.net>:
You have taken responsibility. (Fri, 18 Feb 2011 12:55:01 GMT) Full text and rfc822 format available.

Notification sent to "Gilles Espinasse" <g.esp <at> free.fr>:
bug acknowledged by developer. (Fri, 18 Feb 2011 12:55:02 GMT) Full text and rfc822 format available.

Message #16 received at 8074-done <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: "Gilles Espinasse" <g.esp <at> free.fr>
Cc: Pádraig Brady <P <at> draigBrady.com>,
	8074-done <at> debbugs.gnu.org
Subject: Re: bug#8074: Fix sparse-pipe test on 2.6.26 kernel
Date: Fri, 18 Feb 2011 13:54:22 +0100
Gilles Espinasse wrote:

> ----- Original Message -----
> From: "Pádraig Brady" <P <at> draigBrady.com>
> To: "Gilles Espinasse" <g.esp <at> free.fr>
> Cc: "Jim Meyering" <jim <at> meyering.net>; <8074 <at> debbugs.gnu.org>
> Sent: Friday, February 18, 2011 11:54 AM
> Subject: bug#8074: Fix sparse-pipe test on 2.6.26 kernel
>
>
> ...
>> >
>> > If I add a dd if=/dev/null of=pipe conv=notrunc,fdatasync, test
> reliabily
>> > work too.
>> > So I added that in attached patch.
>>
>> Good testing!
>> Interesting to see that fdatasync flushes the pipe to disk.
>> However it might be more portable/robust to use `wait`
>> rather than that dd command?
>>
>> cheers,
>> Pádraig.
>>
> wait work fine
> Find v2 attached

Thanks to both of you.
That was just a buggy (racy) test, independent of kernel
or distro, so I've adjusted comments accordingly:

From e6067bcb040f110238bd7cbf9f3781f2e149e0c0 Mon Sep 17 00:00:00 2001
From: Gilles Espinasse <g.esp <at> free.fr>
Date: Fri, 18 Feb 2011 13:52:21 +0100
Subject: [PATCH] tests: correct racy sparse-to-pipe test

* tests/cp/sparse-to-pipe: Wait for backgrounded "cat" to complete
before comparing the results.
---
 tests/cp/sparse-to-pipe |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/tests/cp/sparse-to-pipe b/tests/cp/sparse-to-pipe
index 4d39458..9bbaafa 100755
--- a/tests/cp/sparse-to-pipe
+++ b/tests/cp/sparse-to-pipe
@@ -25,7 +25,11 @@ mkfifo_or_skip_ pipe
 timeout 10 cat pipe > copy &

 truncate -s1M sparse || framework_failure_
 cp sparse pipe || fail=1
+
+# Ensure that the cat has completed before comparing.
+wait
+
 cmp sparse copy || fail=1

 Exit $fail
--
1.7.4.1.16.g759e8




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 19 Mar 2011 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 14 years and 98 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.