zsh-workers
 help / color / mirror / code / Atom feed
* Re: zsh sometimes sets $PWD to "." when executed
       [not found] <20031224182536.GU1501@ay.nerim.net>
@ 2004-07-23 17:40 ` Clint Adams
  2004-07-23 18:03   ` Bart Schaefer
  2004-07-23 18:34   ` Vincent Lefevre
  0 siblings, 2 replies; 3+ messages in thread
From: Clint Adams @ 2004-07-23 17:40 UTC (permalink / raw)
  To: zsh-workers; +Cc: Vincent Lefevre, 221875-forwarded

Is this still happening?  What does "pwd -P" return in such
circumstances?

> I'm reassigning the bug to zsh, as I now know that the problem doesn't
> come from screen. However it has always occurred in screen (but this
> isn't necessarily meaningful).
> 
> This time, the bug occurred on another account (but still in screen and
> still in an NFS directory). Instead of opening a new screen window, I did
> the following, where z is:
> 
> alias z='if [[ -o login ]]
>   then exec $SHELL -l;
>   else exec $SHELL;
>   fi'
> 
> liberte:~/oldtests[130]> z                                            <18:13:16
> zshenv...
> zshrc...
> Shell level: 2 (login shell)
> The tty is frozen
> zlogin...
> liberte:.> pwd                                                        <18:13:19
> .
> liberte:.> ll /proc/$$                                                <18:14:00
> total 0
> -r--r--r--    1 vlefevre lip             0 Dec 24 18:14 cantmove
> -r--r--r--    1 vlefevre lip             0 Dec 24 18:14 cmdline
> -r--r--r--    1 vlefevre lip             0 Dec 24 18:14 cpu
> lrwxrwxrwx    1 vlefevre lip             0 Dec 24 18:14 cwd -> /home/vlefevre/
> -rw-r--r--    1 vlefevre lip             0 Dec 24 18:14 disclosure
> -r--------    1 vlefevre lip             0 Dec 24 18:14 environ
> lrwxrwxrwx    1 vlefevre lip             0 Dec 24 18:14 exe -> /home/vlefevre/bin-i386/zsh*
> dr-x------    2 vlefevre lip             0 Dec 24 18:14 fd/
> --w--w--w-    1 vlefevre lip             0 Dec 24 18:14 goto
> -rw-r--r--    1 vlefevre lip             0 Dec 24 18:14 lock
> -r--r--r--    1 vlefevre lip             0 Dec 24 18:14 maps
> -rw-------    1 vlefevre lip             0 Dec 24 18:14 mem
> -rw-r--r--    1 vlefevre lip             0 Dec 24 18:14 migfilter
> -rw-r--r--    1 vlefevre lip             0 Dec 24 18:14 miggroup
> -rw-r--r--    1 vlefevre lip             0 Dec 24 18:14 mignodes
> -rw-r--r--    1 vlefevre lip             0 Dec 24 18:14 migpolicy
> --w-------    1 vlefevre lip             0 Dec 24 18:14 migrate
> -r--r--r--    1 vlefevre lip             0 Dec 24 18:14 mounts
> -r--r--r--    1 vlefevre lip             0 Dec 24 18:14 nmigs
> lrwxrwxrwx    1 vlefevre lip             0 Dec 24 18:14 root -> //
> -rw-r--r--    1 vlefevre lip             0 Dec 24 18:14 selected
> -rw-r--r--    1 vlefevre lip             0 Dec 24 18:14 sigmig
> -r--r--r--    1 vlefevre lip             0 Dec 24 18:14 stat
> -r--r--r--    1 vlefevre lip             0 Dec 24 18:14 statm
> -r--r--r--    1 vlefevre lip             0 Dec 24 18:14 status
> -r--r--r--    1 vlefevre lip             0 Dec 24 18:14 where
> 
> Both $PWD and the cwd are incorrect. They should both have been
> "/home/vlefevre/oldtests".
> 
> Or is it a bug in the Linux kernel for the cwd part? FYI, for both
> machines where the bug occurred, the kernel is respectively 2.4.20
> and 2.4.22.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: zsh sometimes sets $PWD to "." when executed
  2004-07-23 17:40 ` zsh sometimes sets $PWD to "." when executed Clint Adams
@ 2004-07-23 18:03   ` Bart Schaefer
  2004-07-23 18:34   ` Vincent Lefevre
  1 sibling, 0 replies; 3+ messages in thread
From: Bart Schaefer @ 2004-07-23 18:03 UTC (permalink / raw)
  To: zsh-workers; +Cc: Vincent Lefevre, 221875-forwarded

This happens when zsh gets a failure return from stat(".", &sbuf), e.g. 
because of a permission problem.  If zsh can't stat() the current 
directory, it sets its internal pwd string to dot and gives up.

Try compiling this:

	#include <stdio.h>
	#include <sys/stat.h>
	main() {
	  struct stat sbuf;
	  if (stat(".", &sbuf) < 0) perror("");
	}

Then run it in the same circumstance in which zsh fails.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: zsh sometimes sets $PWD to "." when executed
  2004-07-23 17:40 ` zsh sometimes sets $PWD to "." when executed Clint Adams
  2004-07-23 18:03   ` Bart Schaefer
@ 2004-07-23 18:34   ` Vincent Lefevre
  1 sibling, 0 replies; 3+ messages in thread
From: Vincent Lefevre @ 2004-07-23 18:34 UTC (permalink / raw)
  To: Clint Adams; +Cc: zsh-workers, 221875-forwarded

On 2004-07-23 13:40:44 -0400, Clint Adams wrote:
> Is this still happening?  What does "pwd -P" return in such
> circumstances?

No, but I haven't had any NFS problem since.

-- 
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/>
100% validated (X)HTML - Acorn / RISC OS / ARM, free software, YP17,
Championnat International des Jeux Mathématiques et Logiques, etc.
Work: CR INRIA - computer arithmetic / SPACES project at LORIA


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-07-23 18:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20031224182536.GU1501@ay.nerim.net>
2004-07-23 17:40 ` zsh sometimes sets $PWD to "." when executed Clint Adams
2004-07-23 18:03   ` Bart Schaefer
2004-07-23 18:34   ` Vincent Lefevre

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).