Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: cd -s symlink hangs (sometimes?)



2009/3/23 Peter Stephenson <pws@xxxxxxx>:
> On Mon, 23 Mar 2009 00:05:10 +0100
> Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>> I just noticed (ls -l /proc/$$/fd) that with this last commit, zsh now keeps
>> all my old directories open, even when I don't use -s or anything special.
>
> Lucky you noticed.

I started noticing I couldn't unmount my ipod and memory cards, it
took a few tries until I made the connection with the change in zsh
though.

Trying the patch now and it does stop the leak... but you didn't think
this adventure was over yet, did you?

zsh -f
% chmod -x .
% cd -s /nonexisting
cd: no such file or directory: /nonexisting
% ls
ls: write error: Bad file descriptor

Oops, stdout is closed now. I can only get it to happen with -s and
the unexecutable dir though, so it's not really worse than the loop
:).

I looked at the code, and while I don't really have any idea what's
going on, the only place that closes d->dirfd without checking
close_dir seems to be restoredir()? I don't know if that is the guilty
party though.

-- 
Mikael Magnusson



Messages sorted by: Reverse Date, Date, Thread, Author