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

Re: Infinite loop (bug in wordcode evaluation?)



Bart Schaefer wrote:

> On Feb 4, 10:08am, Sven Wischnowsky wrote:
> } Subject: Re: Infinite loop (bug in wordcode evaluation?)
> }
> } Bart Schaefer wrote:
> } 
> } > } The problem is that none of the functions in loop.c check if retflag
> } > } is set and hence don't return.
> } > 
> } > I can't find any loop construct in 3.0.7 that produces this behavior,
> } > yet 3.0.7 does not have any of those extra retflag tests in loop.c.
> } > 
> } > Does anyone know what else might have changed to cause this problem?
> } 
> } Found it. getkey() in zle_main.c now resets `breaks' to the value it had 
> } before, so that the new value stored in bin_break() set by the signal
> } handler doesn't make it through to the execution code.
> } 
> } Dunno where this comes from, though.
> 
> It came from zsh-workers/7038, something to do with making _read_comp
> work correctly.

Yep. One could say that that patch explictly implemented the behaviour 
we now consider buggy. Almost. At least it makes a `break' in a signal 
handler have no effect if the signal arrives while we are reading with 
zle (and the handler for SIGINT has an implicit `break', breaking all
loops).

Hm. If 7038 is still considered to be correct, then my patch is
probably the right supplement for it to make `return' in signal
handlers work. At least I don't see another way out at the moment.

Bye
 Sven


--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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