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

Re: _complete_debug crashes in zsh_directory_name



On Aug 3,  4:53pm, Mikael Magnusson wrote:
} Subject: Re: _complete_debug crashes in zsh_directory_name
}
} This is enough to reproduce the crash for me:
} % zsh -f
} localhost% PS1=%~
} ~autoload -U compinit
} ~compinit -D
} ~zsh_directory_name() { }
} ~<press C-x?>
} _complete_debug:9: failed to close file descriptor 3: bad file descriptor
} zsh:1: failed to close file descriptor 3: bad file descriptor
} zsh: segmentation fault  zsh -f

Program received signal SIGSEGV, Segmentation fault.
0x080e32ee in comp_wrapper (prog=0x8673ec0, w=0x0, 
    name=0xb7ceb5a8 "zsh_directory_name")
    at ../../../zsh-4.0/Src/Zle/complete.c:1434
1434                if ((m & 1) && ((*pp)->node.flags & PM_UNSET))
(gdb) p m
$1 = 511
(gdb) p pp
$2 = (Param *) 0x8617a90
(gdb) p *pp
$3 = 0x0
(gdb) where
#0  0x080e32ee in comp_wrapper (prog=0x8673ec0, w=0x0, 
    name=0xb7ceb5a8 "zsh_directory_name")
    at ../../../zsh-4.0/Src/Zle/complete.c:1434
#1  0x08069848 in runshfunc (prog=0x8673ec0, wrap=0x8149e40, 
    name=0xb7ceb5a8 "zsh_directory_name") at ../../zsh-4.0/Src/exec.c:4648
#2  0x08069612 in doshfunc (shfunc=0x866f870, doshargs=0xb7ceb530, 
    noreturnval=1) at ../../zsh-4.0/Src/exec.c:4557
#3  0x080c3c85 in subst_string_by_func (func=0x866f870, arg1=0x813c39c "d", 
    orig=0x85f7e58 "/usr/src/local/zsh/zsh-4.0-build")
    at ../../zsh-4.0/Src/utils.c:3229
#4  0x080c3cf3 in subst_string_by_hook (name=0x813c39e "zsh_directory_name", 
    arg1=0x813c39c "d", orig=0x85f7e58 "/usr/src/local/zsh/zsh-4.0-build")
    at ../../zsh-4.0/Src/utils.c:3253
#5  0x080bf6bd in finddir (s=0x85f6638 "/usr/src/local/zsh/zsh-4.0-build")
    at ../../zsh-4.0/Src/utils.c:931
#6  0x080adb2d in promptpath (p=0x85f6638 "/usr/src/local/zsh/zsh-4.0-build", 
    npath=0, tilde=1) at ../../zsh-4.0/Src/prompt.c:124
#7  0x080ae56b in putpromptchar (doprint=1, endchar=0, txtchangep=0x81627c0)
    at ../../zsh-4.0/Src/prompt.c:409
#8  0x080add83 in promptexpand (s=0x863e5f0 "%~ ", ns=1, rs=0x0, Rs=0x0, 
    txtchangep=0x81627c0) at ../../zsh-4.0/Src/prompt.c:212
#9  0x08115f1d in reexpandprompt () at ../../../zsh-4.0/Src/Zle/zle_main.c:1767
#10 0x0811ca29 in zrefresh () at ../../../zsh-4.0/Src/Zle/zle_refresh.c:1109
#11 0x081161e6 in zle_main_entry (cmd=5, 
    ap=0xbfede644 "\bæy\b\210æí¿$2\v\b\232,x")
    at ../../../zsh-4.0/Src/Zle/zle_main.c:1890
#12 0x0807d78b in zleentry (cmd=5) at ../../zsh-4.0/Src/init.c:1374
#13 0x080b32ee in dotrapargs (sig=0, sigtr=0xbfede6ac, sigfn=0x87716d0)
    at ../../zsh-4.0/Src/signals.c:1262
#14 0x080b2de6 in endtrapscope () at ../../zsh-4.0/Src/signals.c:1008
#15 0x0806973d in doshfunc (shfunc=0x8795898, doshargs=0x0, noreturnval=0)
    at ../../zsh-4.0/Src/exec.c:4600
#16 0x080e5678 in callcompfunc (s=0xb7ca7400 "", 
    fn=0x8796fc0 "_complete_debug") at ../../../zsh-4.0/Src/Zle/compcore.c:838

So it's attempting to redraw the prompt during the SIGEXIT trap at
at the end of calling _complete_debug, which causes an improper entry
into comp_wrapper while the global incompfunc == 1.



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