Usenet comp.unix.osf.misc (1992-2004)
 help / color / mirror / Atom feed
* Most shells don't handle SIGCHLD correctly
@ 1996-01-16  5:00 Claude Scarpelli
  1996-01-21  5:00 ` John Hascall
  0 siblings, 1 reply; 2+ messages in thread
From: Claude Scarpelli @ 1996-01-16  5:00 UTC (permalink / raw)


I just discovered some weird behaviour of most shell on most unix
system. here is a two lines test script:

lovelace$ cat tt 
sleep 1000
echo done....
lovelace$ 

I run this program with my favourite shell on my favorite unix system,
and I send the signal SIGSTOP to the 'sleep 1000' process.

lovelace$ sh tt&
[1] 16826
lovelace$ ps -fu claude | grep sleep
  claude 16834  4349  3 15:13:07 pts/6    0:00 grep sleep
  claude 16827 16826  3 15:12:56 pts/6    0:00 sleep 1000


I send SIGSTOP....


lovelace$ kill -STOP 16827
done....
lovelace$ 


The shell run the next line of the shell script ! 

Obviously, the shell receive the signal SIGCHLD because its child
changed its state (it is becoming stopped). 

I would say this is an incorrect behaviour : The shell should check
its child terminated or may be should call sigaction(SIGCHLD...) with
the SA_NOCLDSTOP flag.

Here is a small summary of system/shell which exhibit what I call a
bug, and those who seems to have the correct behaviour:

UNIX                           SHELL               BUGGY ?
-----------------------------------------------------------
SunOS 4.1.3		       /bin/sh		   No
SunOS 4.1.3		       Bash 1.12.1	   Yes
Solaris 2.4		       /bin/sh		   Yes
Solaris 2.4		       Bash 1.14.5(1)	   Yes
OSF1 V3.2		       /usr/ucb/sh	   No
OSF1 V3.2		       Bash 1.14.4(1)	   Yes

Can someone comment on that ?
-- 
------------------------------------------------------------------------------
Claude Scarpelli                        | Defenestrate: to exit a window
INFOBIOGEN ::= INFOrmatique appliqu�e � | onscreen. (Time International
l'�tude des BIOmol�cules et des G�Nomes	| Vol 146, No. 20, Nov 13, 1995)



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1996-01-21  5:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-01-16  5:00 Most shells don't handle SIGCHLD correctly Claude Scarpelli
1996-01-21  5:00 ` John Hascall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox