Strange behaviour of select() call when ^Z typed, (4.2BSD)

Bill Shannon shannon at sun.uucp
Tue Oct 1 18:02:03 AEST 1985


> When this [sample program] is executed, and ^Z is typed at the prompt (i.e. while the
> program is sitting in the select()), the program does stop, but then
> its status changes.  The csh detects a stopped state, but the program's
> process in fact exits.  This bug is (seemingly) intermittent.  I have
> other programs which sit on select()'s for input which may or may not
> die when a SIGTSTP signal is sent to them.
> 
> Does anyone out there know what is happening?  If so, I would appreciate
> hearing about it.

In sys_generic.c/selwakeup(), change the call to setrun(p) to unselect(p).
selwakeup() should not have started the process running without checking
to see if it was stopped.  By starting the process running, it ended up
actually getting the SIGTSTP signal and dieing, something that can not
normally happen.

					Bill Shannon
					Sun Microsystems, Inc.



More information about the Comp.unix.wizards mailing list