From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18447 invoked by alias); 11 Dec 2009 20:02:32 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 27502 Received: (qmail 27516 invoked from network); 11 Dec 2009 20:02:30 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <091211110158.ZM18722@torch.brasslantern.com> Date: Fri, 11 Dec 2009 11:01:58 -0800 In-reply-to: <200912111841.nBBIfJDp007685@news01.csr.com> Comments: In reply to Peter Stephenson "Re: segfault due to chpwd_function" (Dec 11, 6:41pm) References: <0742D8B8-F67E-48F7-BCCC-3F578A78D4B7@fysh.org> <200912111841.nBBIfJDp007685@news01.csr.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: segfault due to chpwd_function MIME-version: 1.0 Content-type: text/plain; charset=us-ascii 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
) at ../../zsh-4.0/Src/hashtable.c:85 85 while ((c = *((unsigned char *) str++))) (gdb) where #0 0x0807226c in hasher (str=0x10
) at ../../zsh-4.0/Src/hashtable.c:85 #1 0x080725ab in gethashnode (ht=0xa0bf8e8, nam=0x10
) at ../../zsh-4.0/Src/hashtable.c:231 #2 0x080c2580 in getshfunc (nam=0x10
) 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.