bug-bash
[Top][All Lists]
Advanced

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

[Fwd: Re: printf -v variable ignores nullglob]


From: Elmar Stellnberger
Subject: [Fwd: Re: printf -v variable ignores nullglob]
Date: Thu, 24 May 2007 11:49:19 +0200
User-agent: Thunderbird 2.0.0.0 (X11/20070418)

> printf -v var "%b" @(hugo); echo "x${var}x"
x/src/m3/libs/m3core/LINUXLIBC6/*.@(m3|i3|ig|mg)x
> set | grep "/src/ezm3/libs/m3core/LINUXLIBC6/*.@(m3|i3|ig|mg)"
> alias | grep "/src/ezm3/libs/m3core/LINUXLIBC6/*.@(m3|i3|ig|mg)"
> pwd
/
> dirs
/
>

    To me it does strongly look like a memory corruption.
* There is absolutely no hint where the string
"/src/m3/libs/m3core/LINUXLIBC6/" could permissibly come from.
*  "/src/m3/libs/m3core/LINUXLIBC6/" has been a previous working
directory but should be present nowhere in memory by now.
* The error occurs in a rather nondeterministic manner.
* It does not occur on startup but right after some time of working.

P.S.: Please do not wipe this under your table. It has occured more than
once.


--- Begin Message --- Subject: Re: printf -v variable ignores nullglob Date: Tue, 15 May 2007 22:06:06 +0200 User-agent: Thunderbird 2.0.0.0 (X11/20070418)
   Chet Ramey wrote:

Elmar Stellnberger wrote:
  

Configuration Information [Automatically generated, do not change]:
Machine: i586
OS: linux
Compiler: gcc -I/usr/src/packages/BUILD/bash-3.1
-L/usr/src/packages/BUILD/bash-3.1/../readline-5.1
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i586'
-DCONF_OSTYPE='linux' -DCONF_MACHTYPE='i586-suse-linux'
-DCONF_VENDOR='suse' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash'
-DSHELL -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib   -O2 -march=i586
-mtune=i686 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2 -g
-D_GNU_SOURCE -DRECYCLES_PIDS -Wall -pipe -g -fbranch-probabilities
uname output: Linux sonic 2.6.16.21-0.25-default #1 Tue Sep 19 07:26:15
UTC 2006 i686 i686 i386 GNU/Linux
Machine Type: i586-suse-linux

Bash Version: 3.1
Patch Level: 17
Release Status: release

Repeat By:
1. shopt -s nullglob extglob
2. echo "x$(printf "%b" @(hugo))x"
3. printf -v var "%b" @(hugo); echo "x${var}x"
# note: no file named hugo is allowed to reside in the current working
directory

Expected Behaviour:
2. xx
3. xx

Actual Behaviour:
2. xx
3. x/current/working/directory/*.@(m3|i3|ig|mg)x
    

I can't reproduce this with bash-3.1 or bash-3.2.
ez
Chet

  

   ** initial Konsole #0 **
   > shopt -s nullglob extglob
   > printf -v var "%b" @(hugo); echo "x${var}x"
   x/src/m3/libs/m3core/LINUXLIBC6/*.@(m3|i3|ig|mg)x
   > shopt nullglob extglob
   nullglob        on
   extglob         on
   This is in a fact strange since the error does not seem to occur in a newly
   opened bash session:
   ** Konsole #1 **
   > printf -v var "%b" @(hugo); echo "x${var}x"
   xx
   Nevertheless I have not shut my computer down since I have reported this bug
   and the konsole where the nullglob error occurs is still open (Konsole #0)!
   ** Konsole #2 **
   > printf -v var "%b" @(hugo); echo "x${var}x"
   x@(hugo)x
   > echo "x${var}x"
   x@(hugo)x
   Very strange!! I have not found out yet when it does occur and when not.
   The error has now arised in a another konsole session:
   ** initial Konsole #0 (still open; konsole of initial bug report) **
   > printf -v var "%b" @(hugo); echo "x${var}x"
   x/src/m3/libs/m3core/LINUXLIBC6/*.@(m3|i3|ig|mg)x
   > echo $var
   > ..
   Note: In this example the value of var is corrupted only if it is used
   within the same line of code!!
   In #2 var keeps the wrong value.

--- End Message ---

reply via email to

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