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

Re: PATCH: Seg. fault in chpwd hook in a widget



On Mon, 09 Mar 2009 08:49:36 -0700
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Mar 9, 11:22am, Peter Stephenson wrote:
> } Subject: PATCH: Seg. fault in chpwd hook in a widget
> }
> } Just had a look at the Sourforge bug tracker, which normally I don't
> } have time to do (please feel free to forward things to the list if you
> } notice anything there which appears to be reproducible and hasn't been
> } fixed); issue 2338948 is this:
> 
> This was originally on zsh-workers, thread starting at 26089.  You even
> answered with a patch in 26091, which was applied 2008-11-25 or so says
> the ChangeLog, but you followed *that* by saying it might need deeper
> inspection.

Strange I obviously came to a different conclusion then forgot about it...

> I think you're right about lexsave(), although history has never really
> been my bit of the code [to the extent that I "have" any bit at all].

I've committed it---I think at the worst it can only be unnecessary
sometimes, but virtually all the other interaction with hbegin()/hend()
outside the main command loop has this anyway.

> So why *hasn't* the history mechanism exited by the time chpwd is
> called?  Aha; it's not direclty because of "source", it's because he's
> calling "cd" from inside a ZLE widget.  The hooks are invoked in a
> context from which they were never meant to be invoked.

The "cd -q" stuff is supposed to allow you to do this (and this is even in
use in some of the functions there), but yes, buried "chpwd" etc. calls
tend to cause trouble even when they don't trigger shell problems.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070



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