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

Re: zsh 4.3.4 crashes in prompt-related code under Mac OS X



On 2007-08-30 16:12:27 +0100, Peter Stephenson wrote:
> On Thu, 30 Aug 2007 10:57:11 +0200
> Vincent Lefevre <vincent@xxxxxxxxxx> wrote:
> > zsh 4.3.4 sometimes crashes in prompt-related code under Mac OS X.
> 
> Is it possible to get this with debugging code with line numbers?

I recompiled zsh with --enable-zsh-debug and the attached patch, but
it crashed again at the same place, without any debugging information.
Again, this happened after a ssh that lasted several days, but this
time, I closed the connection with Ctrl-D.

If I understand correctly, the crash occurs here in preprompt():

        /* The PROMPT_SP heuristic will move the prompt down to a new line
         * if there was any dangling output on the line (assuming the terminal
         * has automatic margins, but we try even if hasam isn't set). */
        char *str;
        int percents = opts[PROMPTPERCENT];
        opts[PROMPTPERCENT] = 1;
        str = promptexpand("%B%S%#%s%b", 0, NULL, NULL);
        opts[PROMPTPERCENT] = percents;
        fprintf(shout, "%s%*s\r", str, (int)columns - 1 - !hasxn, "");
        free(str);
        ^^^^

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)



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