zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: segfault due to chpwd_function
Date: Fri, 11 Dec 2009 11:01:58 -0800	[thread overview]
Message-ID: <091211110158.ZM18722@torch.brasslantern.com> (raw)
In-Reply-To: <200912111841.nBBIfJDp007685@news01.csr.com>

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)

Program received signal SIGSEGV, Segmentation fault.
0x0807226c in hasher (str=0x10 <Address 0x10 out of bounds>)
    at ../../zsh-4.0/Src/hashtable.c:85
85          while ((c = *((unsigned char *) str++)))
(gdb) where
#0  0x0807226c in hasher (str=0x10 <Address 0x10 out of bounds>)
    at ../../zsh-4.0/Src/hashtable.c:85
#1  0x080725ab in gethashnode (ht=0xa0bf8e8, 
    nam=0x10 <Address 0x10 out of bounds>) at ../../zsh-4.0/Src/hashtable.c:231
#2  0x080c2580 in getshfunc (nam=0x10 <Address 0x10 out of bounds>)
    at ../../zsh-4.0/Src/utils.c:3007
#3  0x080be9e5 in callhookfunc (name=0x8148760 "precmd", lnklst=0x0, arrayp=1, 
    retval=0x0) at ../../zsh-4.0/Src/utils.c:1185
#4  0x080bebca in preprompt () at ../../zsh-4.0/Src/utils.c:1246
#5  0x0807b1ed in loop (toplevel=1, justonce=0) at ../../zsh-4.0/Src/init.c:121
#6  0x0807e2c6 in zsh_main (argc=2, argv=0xbff0cbd4)
    at ../../zsh-4.0/Src/init.c:1455
#7  0x0804cbea in main (argc=2, argv=0xbff0cbd4) at ../../zsh-4.0/Src/main.c:93


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.


  reply	other threads:[~2009-12-11 20:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-11 17:36 Joel Bernstein
2009-12-11 17:52 ` Joel Bernstein
2009-12-11 18:11 ` Bart Schaefer
2009-12-11 18:41 ` Peter Stephenson
2009-12-11 19:01   ` Bart Schaefer [this message]
2009-12-11 22:16     ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=091211110158.ZM18722@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).