bug-bash
[Top][All Lists]
Advanced

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

$(pwd) != $(/bin/pwd)


From: Leonid Evdokimov
Subject: $(pwd) != $(/bin/pwd)
Date: Sun, 03 Jan 2010 19:02:13 +0600

Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: i686-pc-linux-gnu-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  
-DDEFAULT_PATH_VALUE='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
 -DSTANDARD_UTILS_PATH='/bin:/usr/bin:/sbin:/usr/sbin' 
-DSYS_BASHRC='/etc/bash/bashrc' -DSYS_BASH_LOGOUT='/etc/bash/bash_logout' 
-DNON_INTERACTIVE_LOGIN_SHELLS -DSSH_SOURCE_BASHRC -O2 -march=pentium-m -pipe
uname output: Linux thinkpad 2.6.31-gentoo-r6 #2 PREEMPT Fri Dec 18 13:16:52 
OMST 2009 i686 Intel(R) Pentium(R) M processor 1600MHz GenuineIntel GNU/Linux
Machine Type: i686-pc-linux-gnu

Bash Version: 4.0
Patch Level: 35
Release Status: release

Description:

`pwd` may return incorrect value, moreover, `pwd` output differs from /bin/pwd
output.

Repeat-By:

darkk@thinkpad ~ $ cd foo
darkk@thinkpad ~/foo $ touch foo-files
darkk@thinkpad ~/foo $ ls
foo-files
darkk@thinkpad ~/foo $ mv ~/foo ~/bar
darkk@thinkpad ~/foo $ ls
foo-files
darkk@thinkpad ~/foo $ echo $PWD
/home/darkk/foo
darkk@thinkpad ~/foo $ pwd
/home/darkk/foo
darkk@thinkpad ~/foo $ /bin/pwd
/home/darkk/bar
darkk@thinkpad ~/foo $ cd .
darkk@thinkpad ~/bar $ echo $PWD
/home/darkk/bar
darkk@thinkpad ~/bar $ pwd
/home/darkk/bar
darkk@thinkpad ~/bar $ /bin/pwd
/home/darkk/bar

Strace of this bash session may be found at
http://darkk.net.ru/tmp/bash-pwd-bug.strace.log

Fix:

This problem may be fixed if bash does not optimise number of getcwd() calls,
but I'm not sure if the bug is really a _bug_, but not a sort of strange
feature.




reply via email to

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