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

Re: Segfault in hrealloc somewhere between rpromts and syntax highlighting



On Sun, 06 Apr 2014 09:50:53 -0700
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> I suppose it's possible that this hunk of my patch is related:
> 
> > @@ -2795,6 +2795,7 @@ doexpandhist(void)
> >      if (!err) {
> >  	zlemetacs = excs;
> >  	if (strcmp(zlemetaline, ol)) {
> > +	    zle_restore_positions();
> >  	    unmetafy_line();
> >  	    /* For vi mode -- reset the beginning-of-insertion pointer   *
> >  	     * to the beginning of the line.  This seems a little silly, *
> 
> If the highlight positions were not properly restored, highlighting might
> reference non-existent parts of the line?  But then I would have expected
> that incorrect highlighting would be a visible symptom in some cases.
> 
> In any event, Peter, I'd appreciate it if you took a closer look at that
> particular change (zle_tricky.c) because it's the only one where I'm not
> certain I was able to repeat the steps that caused the complaint after I
> made the edit.

Looks unimpeachable --- save and restore have to be paired.

But yes, you might think a failure there would be pretty catastrophic,
certainly not just show hard to reproduce problems in hrealloc().

Still, it would be interesting to get a fresh report after this fix.

pws



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