autoconf-patches
[Top][All Lists]
Advanced

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

Re: patch for problems with echo '-...' and echo '...\...'


From: Eric Blake
Subject: Re: patch for problems with echo '-...' and echo '...\...'
Date: Mon, 27 Nov 2006 21:00:17 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Paul Eggert <eggert <at> CS.UCLA.EDU> writes:

> 
> I fixed the problems that Ralf spotted in my pre-2.61 proposal (at
> least, the problems I understood...  and installed this patch.
> 
> 2006-11-17  Paul Eggert  <eggert <at> cs.ucla.edu>
> 
>       'echo' has some portability problems, when given a first argument
>       with a leading '-', or when given any argument containing '\'.
>       Avoid using 'echo' in these cases.
...
>       * lib/autotest/general.m4 (_AT_CREATE_DEBUGGING_SCRIPT, AT_INIT):
>       (AT_CLEANUP, _AT_DECIDE_TRACEABLE, _AT_CHECK): Likewise.


This patch triggers a coredump in bash 3.2.5, as detected by the m4 testsuite:

$ bash --version
GNU bash, version 3.2.5(6)-release (i686-pc-cygwin)
Copyright (C) 2005 Free Software Foundation, Inc.
$ bash
$ as_echo='printf %s\n'
$ : $as_echo "m4debug: module m4: opening file
m4debug: module m4: init hook called
m4debug: module m4: opened
m4debug: module m4: builtins loaded
m4debug: module gnu: opening file
m4debug: module gnu: opened
m4debug: module gnu: builtins loaded
m4debug: module gnu: macros loaded
m4debug: path search for \`in' found \`in'
m4debug: input read from in
m4trace:in:1: -1- id 1: include ... = <include>{m4}
m4debug:in:1: path search for \`nested' found \`nested'
m4debug:in:1: input read from nested
m4trace:in:1: -1- id 1: include(\`nested') -> <file: nested>
m4trace:nested:1: -1- id 2: m4wrap ... = <m4wrap>{m4}
m4trace:nested:1: -1- id 2: m4wrap(\`divnum
') -> \`'
m4trace:nested:2: -1- id 3: dnl ... = <dnl>{m4}
m4trace:nested:2: -1- id 3: dnl -> \`'
m4debug:nested:3: input reverted to in, line 1
m4trace:in:1: -1- id 4: dnl ... = <dnl>{m4}
m4trace:in:1: -1- id 4: dnl -> \`'
m4trace:in:2: -1- id 5: len ... = <len>{m4}
m4trace:in:2: -1- id 5: len(\`abc') -> \`3'
m4debug:in:3: input exhausted
m4debug: input from m4wrap recursion level 1
m4trace:nested:1: -1- id 6: divnum ... = <divnum>{m4}
m4trace:nested:1: -1- id 6: divnum -> \`0'
m4debug: input from m4wrap exhausted
m4debug: module gnu: symbols unloaded
m4debug: module gnu: finish hook called
m4debug: module gnu: closed
m4debug: module m4: symbols unloaded
m4debug: module m4: resident module not closed
"
$ $as_echo "m4debug: module m4: opening file
m4debug: module m4: init hook called
m4debug: module m4: opened
m4debug: module m4: builtins loaded
m4debug: module gnu: opening file
m4debug: module gnu: opened
m4debug: module gnu: builtins loaded
m4debug: module gnu: macros loaded
m4debug: path search for \`in' found \`in'
m4debug: input read from in
m4trace:in:1: -1- id 1: include ... = <include>{m4}
m4debug:in:1: path search for \`nested' found \`nested'
m4debug:in:1: input read from nested
m4trace:in:1: -1- id 1: include(\`nested') -> <file: nested>
m4trace:nested:1: -1- id 2: m4wrap ... = <m4wrap>{m4}
m4trace:nested:1: -1- id 2: m4wrap(\`divnum
') -> \`'
m4trace:nested:2: -1- id 3: dnl ... = <dnl>{m4}
m4trace:nested:2: -1- id 3: dnl -> \`'
m4debug:nested:3: input reverted to in, line 1
m4trace:in:1: -1- id 4: dnl ... = <dnl>{m4}
m4trace:in:1: -1- id 4: dnl -> \`'
m4trace:in:2: -1- id 5: len ... = <len>{m4}
m4trace:in:2: -1- id 5: len(\`abc') -> \`3'
m4debug:in:3: input exhausted
m4debug: input from m4wrap recursion level 1
m4trace:nested:1: -1- id 6: divnum ... = <divnum>{m4}
m4trace:nested:1: -1- id 6: divnum -> \`0'
m4debug: input from m4wrap exhausted
m4debug: module gnu: symbols unloaded
m4debug: module gnu: finish hook called
m4debug: module gnu: closed
m4debug: module m4: symbols unloaded
m4debug: module m4: resident module not closed
"
m4debug: module m4: opening file
m4debug: module m4: init hook called
m4debug: module m4: opened
m4debug: module m4: builtins loaded
m4debug: module gnu: opening file
m4debug: module gnu: opened
m4debug: module gnu: builtins loaded
m4debug: module gnu: macros loaded
m4debug: path search for `in' found `in'
m4debug: input read from in
m4trace:in:1: -1- id 1: include ... = <include>{m4}
m4debug:in:1: path search for `nested' found `nested'
m4debug:in:1: input read from nested
m4trace:in:1: -1- id 1: include(`nested') -> <file: nested>
m4trace:nested:1: -1- id 2: m4wrap ... = <m4wrap>{m4}
m4trace:nested:1: -1- id 2: m4wrap(`divnum
') -> `'
m4trace:nested:2: -1- id 3: dnl ... = <dnl>{m4}
m4trace:nested:2: -1- id 3: dnl -> `'
m4debug:nested:3: input reverted to in, line 1
m4trace:in:1: -1- id 4: dnl ... = <dnl>{m4}
m4trace:in:1: -1- id 4: dnl -> `'
m4trace:in:2: -1- id 5: len ... = <len>{m4}
m4trace:in:2: -1- id 5: len(`abc') -> `3'
m4debug:in:3: input exhausted
m4debug: input from m4wrap recursion level 1
m4trace:nested:1: -1- id 6: divnum ... = <divnum>{m4}
m4trace:nested:1: -1- id 6: divnum -> `0'
m4debug: input from m4wrap exhausted
m4debug: module gnu: symbols unloaded
m4debug: module gnu: finish hook called
m4debug: module gnu: closed
m4debug: module m4: symbols unloaded
m4debug: module m4: resident module not closed
Aborted (core dumped)

I'm still trying to further analyze why bash is crashing on this input, and 
whether it is just limited to cygwin or visible from other platforms.

-- 
Eric Blake






reply via email to

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