[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bash crashes with segfault on certain script constructs
From: |
Karlheinz Nolte |
Subject: |
Bash crashes with segfault on certain script constructs |
Date: |
Sun, 1 Aug 2004 22:00:58 +0200 |
User-agent: |
Mutt/1.5.6+20040523i |
Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: 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 -O3 -mtune=athlon-xp
-mcpu=athlon-xp -mfpmath=sse -funroll-loops -fforce-addr -falign-functions=4
-mpreferred-stack-boundary=2 -msse -m3dnow -mmmx
uname output: Linux solfire 2.6.8-rc2-bk10 #1 Sun Aug 1 08:15:00 CEST 2004
i686 AuthenticAMD unknown GNU/Linux
Machine Type: i686-pc-linux-gnu
Bash Version: 3.0
Patch Level: 0
Release Status: release
Description:
Bash crashes on Execution of FireHOL 196, which is a shell script.
No shell script should be able to crash a shell.
Repeat-By:
The following script triggers the segfault.
This was found by Costa Tsaousis the author of FireHOL.
He wrotes:
"I think I have found the bug. The script bellow crashes at the
third echo (UNSET). It seems to be a problem of the "unset" BASH
function when erasing arrays. It leaves something behind so that if
the array just unset is referenced, it produces a segmentation fault.
According to the documentation the first and the third expansions
should be exactly the same."
-----------------------------------------------------------
!/bin/sh
rule() {
echo "1. BEFORE SET:" "${s[@]}"
local -a s=()
echo "2. SET TO EMPTY:" "${s[@]}"
unset s
echo "3. UNSET:" "${s[@]}"
}
rule
-----------------------------------------------------------
Also see Gentoo Bugzilla Bug 58961
- Bash crashes with segfault on certain script constructs,
Karlheinz Nolte <=