bug-bash
[Top][All Lists]
Advanced

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

Bash Segmentation fault within lastpipe mode


From: scorp . dev . null
Subject: Bash Segmentation fault within lastpipe mode
Date: Thu, 19 Jun 2014 12:43:12 +0400

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL 
-DHAVE_CONFIG_H   -I.  -I../bash -I../bash/include -I../bash/lib  
-D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat 
-Werror=format-security -Wall
uname output: Linux PCM14 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9 16:20:46 
UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu

Bash Version: 4.2
Patch Level: 45
Release Status: release

Description:

in case use overwrite variables within "while loop" in  lastpipe mode i get 
"Segmentation fault"

## example script ##
#!/bin/bash
shopt -s lastpipe

allUsersArray=( a b c d e d g)
allActiveArray=( a b )
allSuspendArray=( address@hidden )

for i in address@hidden
do 
  echo ${i} ${allSuspendArray[${i}]} | 
    while read _USER_ID _USER_NAME
      do 
        for _activeUser in address@hidden
        do 
          echo ${_activeUser} | 
            grep -E "^${_USER_NAME}$" && unset allSuspendArray[${_USER_ID}]
        done 
      done 

done

echo allUsersArray address@hidden
echo allSuspendArray address@hidden
## END example script ##

## trace ##
bash -x  ts.sh
+ shopt -s lastpipe
+ allUsersArray=(a b c d e d g)
+ allActiveArray=(a b)
+ allSuspendArray=(address@hidden)
+ for i in 'address@hidden'
+ read _USER_ID _USER_NAME
+ echo 0 a
+ for _activeUser in 'address@hidden'
+ grep -E '^a$'
+ echo a
a
+ for _activeUser in 'address@hidden'
+ grep -E '^a$'
+ echo b
+ read _USER_ID _USER_NAME
Segmentation fault
## END trace ##




reply via email to

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