Bug#548493: test-yesno.sh failure

2009-09-28 Thread Jim Meyering
Bruno Haible wrote:
> Jim Meyering wrote:
>>  # Test with seekable stdin; the followon process must see remaining data.
>> -cat < ${p}in.tmp
>> +cat < ${p}in.tmp
>
> This can be simplified to:
>
>   tr @ '\177' < ${p}in.tmp

Of course!  Thanks.
I've pushed this:

>From a9ab119464cf6faa7551ff0b090072adc660eb67 Mon Sep 17 00:00:00 2001
From: Jim Meyering 
Date: Sun, 27 Sep 2009 08:41:55 +0200
Subject: [PATCH] test-yesno: work around sparc-dash here-document infelicity

Without this change, the literal \177 byte in a here document
would make dash 0.5.5.1-3 access uninitialized memory.
* tests/test-yesno.sh: Don't put the \177 byte in the here document.
Instead, use a marker, "@", and filter through tr to create the desired
contents.  Reported as  by Kurt Roeckx.
---
 ChangeLog   |9 +
 tests/test-yesno.sh |4 ++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 12962ec..f7ef1d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-09-27  Jim Meyering  
+
+   test-yesno: work around sparc-dash here-document infelicity
+   Without this change, the literal \177 byte in a here document
+   would make dash 0.5.5.1-3 access uninitialized memory.
+   * tests/test-yesno.sh: Don't put the \177 byte in the here document.
+   Instead, use a marker, "@", and filter through tr to create the desired
+   contents.  Reported as  by Kurt Roeckx.
+
 2009-09-27  Bruno Haible  

Disable untested support for new flavours of ACLs on AIX.
diff --git a/tests/test-yesno.sh b/tests/test-yesno.sh
index 52b94ef..b1a5b65 100755
--- a/tests/test-yesno.sh
+++ b/tests/test-yesno.sh
@@ -19,9 +19,9 @@ else
 fi

 # Test with seekable stdin; the followon process must see remaining data.
-cat < ${p}in.tmp
+tr @ '\177' < ${p}in.tmp
 n - entire line consumed
-yn - backspace does not change result
+...@n - backspace does not change result
 y
 does not match either yesexpr or noexpr
 n
--
1.6.5.rc2.177.ga9dd6



-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#548493: test-yesno.sh failure

2009-09-27 Thread Kurt Roeckx
On Sun, Sep 27, 2009 at 11:03:42PM +0200, Jim Meyering wrote:
> 
> Thanks for the details.
> Here's a patch that's more likely to work.
> That this failure is specific to the sparc build
> is a strong indication that it is a bug in dash or the compiler.
> Maybe a sign-extension bug?

I'm seeing this on alpha too and was able to reproduce it on
albeniz's sid chroot.

It also failed on armel.  And armel has char default to unsigned,
which most of the arches have it signed.

> FYI, I couldn't reproduce that failure on sparc64 (sperger/unstable)
> with dash built from git using gcc version 4.3.4 (Debian 4.3.4-2).

So do you think it's a bug in dash that's been fix in git, or a
bug in gcc that's been fixed?  In the first case, please clone
a bug against dash.  In the second case I can schedule a binNMU
to get dash built with the new gcc.  And I actually have to guess
it being the first.


Kurt




-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#548493: test-yesno.sh failure

2009-09-27 Thread Jim Meyering
Kurt Roeckx wrote:
> On Sun, Sep 27, 2009 at 08:51:48AM +0200, Jim Meyering wrote:
>> Thanks for the report.
>> Does the following change fix it?
>> If so, please tell me what version of bash it's using
>> so I can add that to the commit log.
>
> Note that /bin/sh points to dash, not bash.  And the same version
> of dash seems to work on other arches.
>
> Running the test with bash instead of dash seems to work.  Adding
> the \ also doesn't seem to have any effect.
>
> Removing the '^?' does fix it.
>
> If you believe this to be a bug in dash, please reassign the bug.
> This was tested using dash 0.5.5.1-3 and bash 4.0-7.

Thanks for the details.
Here's a patch that's more likely to work.
That this failure is specific to the sparc build
is a strong indication that it is a bug in dash or the compiler.
Maybe a sign-extension bug?

FYI, I couldn't reproduce that failure on sparc64 (sperger/unstable)
with dash built from git using gcc version 4.3.4 (Debian 4.3.4-2).

Jim

>From 6ffca52a1b2d0c43241c101d847a20cf7875c2fd Mon Sep 17 00:00:00 2001
From: Jim Meyering 
Date: Sun, 27 Sep 2009 08:41:55 +0200
Subject: [PATCH] test-yesno: work around sparc-dash here-document infelicity

Without this change, the literal \177 byte in a here document
would make Debian's dash 0.5.5.1-3 (sparc only) misbehave.
* tests/test-yesno.sh: Don't put the \177 byte in the here document.
Instead, use a marker, "@", and filter through tr to create the desired
contents.  Reported as  by Kurt Roeckx.
---
 ChangeLog   |9 +
 tests/test-yesno.sh |4 ++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 12962ec..6043957 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-09-27  Jim Meyering  
+
+   test-yesno: work around sparc-dash here-document infelicity
+   Without this change, the literal \177 byte in a here document
+   would make Debian's dash 0.5.5.1-3 (sparc only) misbehave.
+   * tests/test-yesno.sh: Don't put the \177 byte in the here document.
+   Instead, use a marker, "@", and filter through tr to create the desired
+   contents.  Reported as  by Kurt Roeckx.
+
 2009-09-27  Bruno Haible  

Disable untested support for new flavours of ACLs on AIX.
diff --git a/tests/test-yesno.sh b/tests/test-yesno.sh
index 52b94ef..6791f1b 100755
--- a/tests/test-yesno.sh
+++ b/tests/test-yesno.sh
@@ -19,9 +19,9 @@ else
 fi

 # Test with seekable stdin; the followon process must see remaining data.
-cat < ${p}in.tmp
+cat < ${p}in.tmp
 n - entire line consumed
-yn - backspace does not change result
+...@n - backspace does not change result
 y
 does not match either yesexpr or noexpr
 n
--
1.6.5.rc2.177.ga9dd6



-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#548493: test-yesno.sh failure

2009-09-27 Thread Bruno Haible
Jim Meyering wrote:
>  # Test with seekable stdin; the followon process must see remaining data.
> -cat < ${p}in.tmp
> +cat < ${p}in.tmp

This can be simplified to:

  tr @ '\177' < ${p}in.tmp

Bruno



-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#548493: test-yesno.sh failure

2009-09-27 Thread Kurt Roeckx
On Sun, Sep 27, 2009 at 08:51:48AM +0200, Jim Meyering wrote:
> 
> Thanks for the report.
> Does the following change fix it?
> If so, please tell me what version of bash it's using
> so I can add that to the commit log.

Note that /bin/sh points to dash, not bash.  And the same version
of dash seems to work on other arches.

Running the test with bash instead of dash seems to work.  Adding
the \ also doesn't seem to have any effect.

Removing the '^?' does fix it.

If you believe this to be a bug in dash, please reassign the bug.
This was tested using dash 0.5.5.1-3 and bash 4.0-7.

Output of bash and dash using -x:

$ dash -x test-yesno.sh
+ tmpfiles=
+ trap rm -fr $tmpfiles 1 2 3 15
+ p=t-yesno-
+ tmpfiles=t-yesno-in.tmp t-yesno-xout.tmp t-yesno-out1.tmp
t-yesno-out.tmp t-yesno-err.tmp
+ LC_ALL=C
+ export LC_ALL
+ echo solaris
+ tr -d \r
+ grep solais
+ cr=\r
+ cat
+ n - backspace does not change result
test-yesno.sh: 1: n: not found
+ y
t-yesno.sh: 1: y: not found
+ does not match either yesexpr or noexpr
test-yesno.sh: 1: does: not found
+ n
test-yesno.sh: 1: n: not found
+ EOF
test-yesno.sh: 1: EOF: not found
+ cat
+ ./test-yesno
+ ./test-yesno 3
+ cat
+ LC_ALL=C tr -d \r
+ cmp t-yesno-xout.tmp t-yesno-out.tmp
t-yesno-xout.tmp t-yesno-out.tmp differ: char 3, line 2
+ exit 1

$ bash -x test-yesno.sh
+ tmpfiles=
+ trap 'rm -fr $tmpfiles' 1 2 3 15
+ p=t-yesno-
+ tmpfiles='t-yesno-in.tmp t-yesno-xout.tmp t-yesno-out1.tmp
t-yesno-out.tmp t-yesno-err.tmp'
+ LC_ALL=C
+ export LC_ALL
+ echo solaris
+ tr -d '\r'
+ grep solais
+ cr='\r'
+ cat
+ cat
+ ./test-yesno
+ ./test-yesno 3
+ cat
+ LC_ALL=C
+ tr -d '\r'
+ cmp t-yesno-xout.tmp t-yesno-out.tmp
+ ./test-yesno 3
+ ./test-yesno
+ cat
+ LC_ALL=C
+ tr -d '\r'
+ cmp t-yesno-xout.tmp t-yesno-out.tmp
+ cat
+ echo yes
+ ./test-yesno 2
[...]




-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#548493: test-yesno.sh failure

2009-09-27 Thread Jim Meyering
Kurt Roeckx wrote:
> Source: coreutils
> Version: 7.5-1
...
>> Build-Depends: gettext (>= 0.10.37), debhelper, dh-buildinfo, texinfo (>= 
>> 4.2), groff, dpatch, libattr1-dev | not+linux-gnu, libacl1-dev | 
>> not+linux-gnu, libselinux1-dev (>= 1.32) | not+linux-gnu, gperf, bison
>
> [...]
>
>> Toolchain package versions: libc6.1-dev_2.9-26 linux-libc-dev_2.6.30-6 
>> g++-4.3_4.3.4-2 gcc-4.3_4.3.4-2 binutils_2.19.91.20090910-1 
>> libstdc++6_4.4.1-4 libstdc++6-4.3-dev_4.3.4-2
>
> [...]
>
>> FAIL: test-yesno.sh (exit: 1)
>> =
>>
>> ./test-yesno.sh: 24: n: not found
>> ./test-yesno.sh: 25: y: not found
>> ./test-yesno.sh: 26: does: not found
>> ./test-yesno.sh: 27: n: not found
>> ./test-yesno.sh: 28: EOF: not found
>> t-yesno-xout.tmp t-yesno-out.tmp differ: char 3, line 2
>> ==
>> 1 of 128 tests failed
...
> A full build log can be found at:
> http://buildd.debian.org/build.php?arch=alpha&pkg=coreutils&ver=7.5-6

Thanks for the report.
Does the following change fix it?
If so, please tell me what version of bash it's using
so I can add that to the commit log.

>From 0f02aaf44de2d5dc0470bc9ca979f047df7df024 Mon Sep 17 00:00:00 2001
From: Jim Meyering 
Date: Sun, 27 Sep 2009 08:41:55 +0200
Subject: [PATCH] test-yesno: use here document *without* parameter 
substitution...

to prevent the interpretation of ^?.
* tests/test-yesno.sh: Use <<\EOF, not  by Kurt Roeckx.
---
 ChangeLog   |7 +++
 tests/test-yesno.sh |2 +-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f1bcf69..f3e39c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-09-27  Jim Meyering  
+
+   test-yesno: use here document *without* parameter substitution...
+   to prevent the interpretation of ^?.
+   * tests/test-yesno.sh: Use <<\EOF, not <

argp: fix compilation of getopt
diff --git a/tests/test-yesno.sh b/tests/test-yesno.sh
index 52b94ef..0926683 100755
--- a/tests/test-yesno.sh
+++ b/tests/test-yesno.sh
@@ -19,7 +19,7 @@ else
 fi

 # Test with seekable stdin; the followon process must see remaining data.
-cat < ${p}in.tmp
+cat <<\EOF > ${p}in.tmp
 n - entire line consumed
 yn - backspace does not change result
 y
--
1.6.5.rc2.177.ga9dd6



-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org