bug-bash
[Top][All Lists]
Advanced

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

bash segfaults processing a certain .bashrc file on AMD 64-bit machine


From: Chris Rodgers
Subject: bash segfaults processing a certain .bashrc file on AMD 64-bit machine
Date: Wed, 17 Nov 2004 14:37:28 +0000

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: x86_64-redhat-linux-gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-redhat-linu\x-gnu'
-DCONF_VENDOR='redhat' -DSHELL -DHAVE_CONFIG_H  -I.  -I. -I./include
-I./lib  -O2 -g -pipe
uname output: Linux hadamard.chem.ox.ac.uk 2.6.8-1.521 #1 Mon Aug 16
09:01:00 EDT 2004 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-redhat-linux-gnu
                                                                                
                                             
Bash Version: 2.05b
Patch Level: 0
Release Status: release
                                                                                
                                             
Description: If my .bashrc file contains the lines below, then newly
invoked copies of bash segfault on my new Redhat FC2 AMD 64-bit
machine. The same code works fine on a variety of i386 32-bit machine
(single, dual CPU) and on 64-bit Sun machines. I got the cleanpath
function off the web, so it is conceivable that the problem is in
there. In that case, sorry for wasting your time... In any case, could
you give me some pointers to fixing this?
                                                                                
                                             
Repeat-By:
                                                                                
                                             
Set the .bashrc file to contain exactly the following:
function cleanpath {
    local var="${1:-PATH}" oldpath newpath=: entry
    oldpath="${!var}:"
    while [ -n "$oldpath" ]; do
        entry="${oldpath%%:*}"
        oldpath="${oldpath#*:}"
        [ "${entry:0:1}" = / ] && [ -n "${newpath##*:$entry:*}" ] &&
        [ -d "$entry" ] && newpath="$newpath$entry:"
    done
    newpath="${newpath#:}"
    eval "$var"'="${newpath%:}"'
}
                                                                                
                                             
export
PATH=/home/stieltjes/rodgers/bin:/home/stieltjes/.rodgers-pub/bin:/home/stieltjes/.rodgers-pub/bin/wineexecbin/bin:$P\ATH;
cleanpath PATH;
                                                                                
                                             
Then try to log in.
                                                                                
                                             
N.B. the exact contents of this path line seem quite critically
related to whether bash segfaults.
                                                                                
                                           





reply via email to

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