Bash bug

goodoldmarty at gmail.com goodoldmarty at gmail.com
Mon Oct 29 08:00:20 PDT 2007


WRONG-INCORRECT

>>>>> > >> > Rebuilding bash with the fixes-5 patch resolved my ridiculous bash
>>>>> > >> > problems. Obviously bash-3.2-fixes-6.patch did not pass my review.
>>>>> > >> > Thanks anyway.
>>>>> > >> > Marty B

I was a bit hasty in making that statement. This bug applies to previous 
versions of HLFS as well and the patches only seem to amplify issues. 
This is not good news, however I have a method where it was easily 
repeatable on all my HLFS systems. Got 15 min to spare?

Here is my test method:

1. You need some disk space and a work dir.
We will install to the work dir to keep from populating our system with 
all the test junk. Assuming we start at /usr/src/bash_test do this:

#################################################################
cd /usr/src/
mkdir bash_test
cd bash_test
export XORG_PREFIX="/usr/src/bash_test/X11"
export XORG_CONFIG="--prefix=$XORG_PREFIX \
     --sysconfdir=$XORG_PREFIX/etc \
     --mandir=$XORG_PREFIX/share/man \
     --localstatedir=$XORG_PREFIX/var"
export PKG_CONFIG_PATH=$XORG_PREFIX/lib/pkgconfig

#check your environment
env
#################################################################

Copy and paste each following build script individually into a term 
while in the build directory. After each install completes, manually 
issue a invalid command like "arise-unholy-bash-demon".
When bash responds and changes directory you have seen this bug.
(Should see it after second package, but I added many more)
If you continue the test builds, check your environment variables too...

( Note-you may need to fix these URLS if the email gets mangled)

#############################################
# package config
#############################################
mkdir pkgconfig
cd pkgconfig
wget http://pkgconfig.freedesktop.org/releases/pkg-config-0.20.tar.gz
tar -zxf pkg-config-0.20.tar.gz
cd pkg-config-0.20
./configure --prefix=/usr &&
make
make install
cd ..
rm -rf pkg-config-0.20
cd ..

#############################################
# xorg protocol headers
#############################################
wget http://anduin.linuxfromscratch.org/files/BLFS/xorg/proto-7.1.wget &&
mkdir proto &&
cd proto &&
wget -B http://xorg.freedesktop.org/releases/individual/proto/ \
      -i ../proto-7.1.wget
# build loop
bash -e #exit on all errors
for package in $(cat ../proto-7.1.wget)
do
   packagedir=$(echo $package | sed 's/.tar.bz2//')
   tar -jxf $package
echo "######################"
echo $packagedir
echo "######################"
   cd $packagedir
   ./configure $XORG_CONFIG
   make
   make install
   cd ..
   rm -rf $packagedir
   #rm -f $package
done 2>&1 | tee -a ../xorg-compile.log #log the entire loop
cd ..

    ##############
#SAW BUG HERE FIRST
#bash jumps back to proto on invalid input
    ##############

#############################################
# Xorg utilities
#############################################

wget http://anduin.linuxfromscratch.org/files/BLFS/xorg/util-7.1.wget &&
mkdir util &&
cd util &&
wget -B http://xorg.freedesktop.org/releases/individual/util/ \
      -i ../util-7.1.wget
tar -jxf xorg-cf-files-1.0.2.tar.bz2
cd xorg-cf-files-1.0.2
sed -i "s@/usr/X11R6@$XORG_PREFIX@" X11.tmpl &&
./configure $XORG_CONFIG --with-config-dir=$XORG_PREFIX/lib/X11/config
make install
cd ..
tar -jxf imake-1.0.2.tar.bz2
cd imake-1.0.2
./configure $XORG_CONFIG --with-config-dir=$XORG_PREFIX/lib/X11/config &&
make
make install
cd ..
tar -jxf gccmakedep-1.0.2.tar.bz2
cd gccmakedep-1.0.2
./configure $XORG_CONFIG &&
make
make install
cd ..
tar -jxf lndir-1.0.1.tar.bz2
cd lndir-1.0.1
./configure $XORG_CONFIG &&
make
make install
cd ..
tar -jxf makedepend-1.0.0.tar.bz2
cd makedepend-1.0.0
./configure $XORG_CONFIG &&
make
make install
cd ..
tar -jxf util-macros-1.0.2.tar.bz2
cd util-macros-1.0.2
./configure $XORG_CONFIG &&
make
make install
cd ../..


#############################################
#freetype needed for libs and fontconfig
#############################################
cd freetype
tar -jxf freetype-2.1.10.tar.bz2
cd freetype-2.1.10
sed -i -r 's:.*(#.*BYTE.*) .*:\1:' \
      include/freetype/config/ftoption.h &&
./configure --prefix=/usr &&
make
make install &&
install -v -m755 -d /usr/share/doc/freetype-2.1.10 &&
cp -v -R docs/* /usr/share/doc/freetype-2.1.10
cd ..
rm -rf freetype-2.1.10
cd ..

#############################################
# expat needed for fontconfig
#############################################
mkdir expat
cd expat
wget http://downloads.sourceforge.net/expat/expat-2.0.0.tar.gz
tar -zxf expat-2.0.0.tar.gz
cd expat-2.0.0
./configure --prefix=/usr &&
make
make install
cd ..
rm -rf expat-2.0.0
cd ..

#############################################
# fontconfig
#############################################
mkdir fontconfig
cd fontconfig
wget http://fontconfig.org/release/fontconfig-2.3.2.tar.gz
tar -zxf fontconfig-2.3.2.tar.gz
cd fontconfig-2.3.2
./configure --prefix=/usr --sysconfdir=/etc \
     --disable-docs --without-add-fonts \
     --with-docdir=/usr/share/doc/fontconfig-2.3.2 &&
make
make install &&
install -v -m644 doc/*.3 /usr/share/man/man3 &&
install -v -m644 doc/*.5 /usr/share/man/man5 &&
install -v -m755 \
         -d /usr/share/doc/fontconfig-2.3.2/fontconfig-devel &&
install -v -m644 doc/*.{html,pdf,txt} \
         /usr/share/doc/fontconfig-2.3.2 &&
install -v -m644 doc/fontconfig-devel/* \
         /usr/share/doc/fontconfig-2.3.2/fontconfig-devel
cd ..
rm -rf  fontconfig-2.3.2
cd ..

#############################################
# xorg libraries
#############################################
export PKG_CONFIG_PATH=$XORG_PREFIX/lib/pkgconfig
wget http://anduin.linuxfromscratch.org/files/BLFS/xorg/lib-7.1.wget &&
mkdir lib &&
cd lib &&
wget -B http://xorg.freedesktop.org/releases/individual/lib/ \
      -i ../lib-7.1.wget
wget 
http://www.linuxfromscratch.org/patches/blfs/6.2.0/libXfont-1.1.0-cidfonts-1.patch
# apply security patch first
tar -jxf libXfont-1.1.0.tar.bz2
cd libXfont-1.1.0
patch -Np1 -i ../libXfont-1.1.0-cidfonts-1.patch
cd ..
rm libXfont-1.1.0.tar.bz2 # remove original
tar -cf libXfont-1.1.0.tar libXfont-1.1.0
bzip2 libXfont-1.1.0.tar # replace with patched version
rm -rf libXfont-1.1.0 # remove dir
# build loop
bash -e #exit on all errors
for package in $(cat ../lib-7.1.wget)
do
   packagedir=$(echo $package | sed 's/.tar.bz2//')
   tar -xf $package
   cd $packagedir
echo "######################"
echo $packagedir
echo "######################"
   ./configure $XORG_CONFIG
   make
   make install &&
   ldconfig
   cd ..
   rm -rf $packagedir
#  rm -f $package
done 2>&1 | tee -a ../xorg-compile.log #log the entire loop
cd ..
#rm -rf lib
ln -sv $XORG_PREFIX/lib/X11 /usr/lib/X11 &&
ln -sv $XORG_PREFIX/include/X11 /usr/include/X11
############################################################
Works for me. Wish it didn't.
Marty B



More information about the hlfs-dev mailing list