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

Re: zsh-3.1.9-dev-6 crashes occassionally



Peter Stephenson wrote:

> Sven wrote:
> > +	ALLOWTRAPS {
> > +	    while ((r = read(SHTTY, &cc, 1)) != 1) {
> 
> I suppose you've thought this through more than I have, but wouldn't it be
> safer just to run traps every time the read returns?  I'm assuming a signal
> arriving will interrupt the read in any case, so as far as I can see it's
> pretty much equivalent in practise.  There's nothing too nasty in the block
> underneath, but it does call zrefresh() and attachtty() which are probably
> best treated as black boxes.

Hmhm. I was about to say that traps are only insecure when they can
execute code the non-trap code currently executes, but, yes, since one 
can invoke more and more code from shell code...

Maybe I should have a second (third, fourth,...) look to see if we can 
get rid of this ALLOWTRAPS { ... } DISALLOWTRAPS stuff altogether. That 
would make me more comfortable, I think.

Unless someone knows of a system where signals don't interrupt things
like read.

Bye
 Sven


--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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