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

Re: zsh-3.1.9-dev-6 crashes occassionally



Bart Schaefer wrote:

> On Oct 31,  1:51pm, Peter Stephenson wrote:
> } Subject: Re: zsh-3.1.9-dev-6 crashes occassionally
> }
> } 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.
> 
> On Oct 31,  3:01pm, Sven Wischnowsky wrote:
> }
> } Unless someone knows of a system where signals don't interrupt things
> } like read.
> 
> Ever heard of BSD restartable system calls?

Yes, of course. But we set S[AV]_INTERRUPT on our signal handlers, so...

> Signals don't always interrupt things like read.  On systems that have
> the sigaction() interface, you can choose to turn restartable-ness on and
> off, but on an older BSD system the only way out of a system call from a
> signal handler is with setjmp/longjmp. 

...are there still such systems? Hm.

Anyway, the way the patch handles this should be ok, because (if I've
found all the places where a possibly blocking system call is made)
traps are called during such system calls.

> That's what I was talking about
> before in my last message.

Aha, I admit I was wondering... No, I definitely think we shouldn't
even start to think about using that as long as the way the patch
handles it works. If it works.


Bye
 Sven


--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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