Re: Bash-3.2 Official Patch 10

2007-03-09 Thread Chet Ramey
Kevin F. Quinn wrote:
> On Mon, 5 Mar 2007 17:49:47 -0500
> Chet Ramey <[EMAIL PROTECTED]> wrote:
> 
>> Bash-Release: 3.2
>> Patch-ID: bash32-010
> 
> I'm still seeing a difference in behaviour:

Yes.  That's the difference between the undefined quoting semantics
in bash-3.1 and the defined semantics in bash-3.2.  In bash-3.2, the
quoting removes all meaning from any characters special to the regular
expression engine.

> 
> To get the 3.2 results, I expected to have to write:
> 
> [[ ${v} =~ "\^Alpha" ]] && echo match 4 || echo no match 4
> [[ ${v} =~ '\^Alpha' ]] && echo match 5 || echo no match 5

Why?  The 3.2 behavior means that the match is performed on the literal
string `\^Alpha', with the backslash and circumflex quoted to protect
them from interpretation by the regexp matching engine. That's the
difference.


> I tried reading the posix standard (well, the single-unix specification
> at opengroup.org, base definitions chapter 9 and shells & utilitis
> chapter 2) but things are not so clear to me.

Posix isn't really relevant here, because [[ is not standardized, and
the Posix utilities that match regular expressions are not shell constructs
or builtin commands.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
   Live Strong.  No day but today.
Chet Ramey, ITS, CWRU[EMAIL PROTECTED]http://cnswww.cns.cwru.edu/~chet/


___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


Re: Bash uses 100% CPU time (when started by "su")

2007-03-09 Thread Chet Ramey
Thomas Loeber wrote:
> Configuration Information:
> Machine: i686
> OS: linux-gnu
> Compiler: i686-pc-linux-gnu-gcc
> Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' 
> -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' 
> -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL 
> -DHAVE_CONFIG_H -I. -I. -I./include -I./lib -march=athlon-xp -O2 
> -fomit-frame-pointer -pipe
> uname output: Linux schlumpfine 2.6.19-gentoo-r5 #3 PREEMPT Sun Feb 11 
> 11:26:54 CET 2007 i686 AMD Athlon(tm) XP 2600+ AuthenticAMD GNU/Linux
> Machine Type: i686-pc-linux-gnu
> 
> Bash Version: 3.1
> Patch Level: 17
> Release Status: release
> 
> Description:
> When using bash and then starting a second bash by using "su", the bash
> started by "su" will use 100% CPU time if it is in reverse-i-search
> mode and the first bash process is killed with SIGHUP (using "kill" or
> e. g. by closing the xterm window).
> 
> This also happens with Bash 3.2_p9 and Readline 5.2_p1.
> I'm using su from shadow version 4.0.18.1.
> 
> Repeat-By:
> 1) log in to a console or open an xterm/konsole/...
> 2) echo $$ (keep this in mind as PID#1)
> 3) su $USER
> 4) echo $$ (keep this in mind as PID#2)
> 5) Hit Ctrl+R (bash is in reverse-i-search mode now)
> 6) On a different console type: kill -HUP 
> 7) The bash with PID#2 now runs endlessly with 100% CPU usage
> 8) kill -9 

Thanks for the report.  This problem is caused by readline's i-search code
not handling read errors appropriately.  There were a number of those
cases in the code; they will all be fixed for the next release.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
   Live Strong.  No day but today.
Chet Ramey, ITS, CWRU[EMAIL PROTECTED]http://cnswww.cns.cwru.edu/~chet/


___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash