bug-autoconf
[Top][All Lists]
Advanced

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

Re: [GNU Autoconf 2.63] testsuite: 51 failed


From: Eric Blake
Subject: Re: [GNU Autoconf 2.63] testsuite: 51 failed
Date: Wed, 25 Feb 2009 21:52:39 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Bert Timmerman <bert.timmerman <at> xs4all.nl> writes:

> > Thanks for the followup; that's an older version of bash, but no one else
> > has reported this bug with that version, so I'm wondering what else might
> > be the problem.  What does 'echo $BASH_VERSION' output (so we can
> > determine the patch level)?  
> 
> 3.1.17(1)-release
> lrwxrwxrwx 1 root root 4 Nov  4  2006 /bin/sh -> bash

Good to know.  Hopefully it won't take me too long to dig up a working bash 
3.1.17 (I think I a pre-built copy of it lying around somewhere), to verify my 
analysis.

> > /bin/sh -vx tests/testsuite.dir/051/script
> > 
> 
> Output attached as file: output.txt
> 
> I hope this helps.

Yes it does.  Here's what your bash 3.1 did:

> test "X$echo" = 'Xabcd\c' ||
>   echo "AS_ECHO_N('"'abcd\c'"') outputs '$echo'" >&2
> + test 'Xabcd\c' = 'Xabcd\c'
> echo=`$as_echo '\a\b\c\f\n\r\t\v\"\'`
> test "X$echo" = 'X\a\b\c\f\n\r\t\v\"\' ||
>   echo "AS_ECHO('"'\a\b\c\f\n\r\t\v\"\'"') outputs '$echo'" >&2
> 
> echo=`$as_echo_n '\a\b\c\f\n\r\t\v\"\'`
> test "X$echo" = 'X\a\b\c\f\n\r\t\v\"\' ||
...

vs. bash 3.2:

+ test 'Xabcd\c' = 'Xabcd\c'
echo=`$as_echo '\a\b\c\f\n\r\t\v\"\'`
$as_echo '\a\b\c\f\n\r\t\v\"\'
++ printf '%s\n' '\a\b\c\f\n\r\t\v\"\'
+ echo='\a\b\c\f\n\r\t\v\"\'
test "X$echo" = 'X\a\b\c\f\n\r\t\v\"\' ||
  echo "AS_ECHO('"'\a\b\c\f\n\r\t\v\"\'"') outputs '$echo'" >&2
+ test 'X\a\b\c\f\n\r\t\v\"\' = 'X\a\b\c\f\n\r\t\v\"\'

If I'm reading correctly, POSIX says that `\"` is undefined:

"The search for the matching backquote shall be satisfied by the first unquoted 
non-escaped backquote; during this search, if a non-escaped backquote is 
encountered within... a quoted string, undefined results occur."

Bash 3.1 sees the unbalanced \" after the leading `, but since \ is not quoted, 
it represents itself, and then assumes " starts a quoted string, leaving the 
second ` as a non-escaped backquote encountered within a quoted string.  
Whereas bash 3.2 is able to recognize that the \ means the " won't really form 
a quoted string, and proceeds to recognize the second ` as the end of the 
command substitution.  But neither bash behavior is a bug since there is no 
POSIX-mandated behavior.

Which means this must be a testsuite bug instead.  I think that adding a 
judicious use of AS_ESCAPE to the testsuite will resolve it; patch coming up 
soon once I dig up my bash 3.1 binary for testing my approach.

-- 
Eric Blake






reply via email to

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