Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: segfault due to chpwd_function
- X-seq: zsh-workers 27503
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: segfault due to chpwd_function
- Date: Fri, 11 Dec 2009 22:16:15 +0000
- In-reply-to: <091211110158.ZM18722@xxxxxxxxxxxxxxxxxxxxxx>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <0742D8B8-F67E-48F7-BCCC-3F578A78D4B7@xxxxxxxx> <200912111841.nBBIfJDp007685@xxxxxxxxxxxxxx> <091211110158.ZM18722@xxxxxxxxxxxxxxxxxxxxxx>
On Fri, 11 Dec 2009 11:01:58 -0800
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Dec 11, 6:41pm, Peter Stephenson wrote:
> }
> } Are you able to post a self-contained function that shows the problem,
> } with no external depenencies?
>
> This seems to do it:
>
> autoload -U promptinit
> promptinit
> prompt_chpwd() {
> ((RANDOM % 2)) && prompt bart || prompt zefram
> }
> precmd_functions=(prompt_chpwd)
Yes, that's pretty effective.
> Note that I don't get the crash if I change from precmd_functions to
> chpwd_functions, so my suspicion about "add-zsh-hook -D" seems to be
> correct.
Right, this seems to make it go away...
Index: Src/utils.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/utils.c,v
retrieving revision 1.234
diff -u -r1.234 utils.c
--- Src/utils.c 3 Nov 2009 10:00:34 -0000 1.234
+++ Src/utils.c 11 Dec 2009 22:14:53 -0000
@@ -1181,6 +1181,7 @@
memcpy(arrnam + namlen, HOOK_SUFFIX, HOOK_SUFFIX_LEN);
if ((arrptr = getaparam(arrnam))) {
+ arrptr = arrdup(arrptr);
for (; *arrptr; arrptr++) {
if ((shfunc = getshfunc(*arrptr))) {
int newret = doshfunc(shfunc, lnklst, 1);
--
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author