| Zombies Being Created ( Bug? ) Hello All,
I'm seeing a zombie problem in Redhat 5 that does not occur in Redhat 4.
My version info is: Red Hat Enterprise Linux Server release 5.1 (Tikanga)
My Linux kernel is: Linux 2.6.18-53.1.6.el5 #1 SMP Wed Jan 16 03:56:15 EST 2008 x86_64
The following script produces zombies of the "ls" program. The "ls" is nested in sub-shell backquotes.
#!/bin/ksh
trap "" 17
which gzip
FOUND=0
while [ $FOUND = 0 ]
do retval=`ls *.log 2>/dev/null | wc -l `
echo "retval=$retval"
sleep 1
done
/nss/rtns/v_running/scripts> ./nss_test &
retval= 0
retval= 0
retval= 0
ps -f
UID PID PPID C STIME TTY TIME CMD
rtns 15084 31190 0 Jul03 pts/6 00:00:00 /bin/ksh -i
rtns 16458 15084 0 10:26 pts/6 00:00:09 xterm -n xterm -ls -sl 900 -T Xterm900
rtns 19229 15084 0 16:12 pts/6 00:00:00 /bin/ksh ./nss_test
rtns 19231 19229 0 16:12 pts/6 00:00:00 [ls] <defunct>
rtns 19232 19229 0 16:12 pts/6 00:00:00 [ls] <defunct>
rtns 19235 19229 0 16:12 pts/6 00:00:00 [ls] <defunct>
rtns 19236 15084 0 16:12 pts/6 00:00:00 ps -f
...
Now, if I comment out the "which gzip" or if I give "trap" a non-null string argument, it won't spawn zombies..
#!/bin/ksh
trap "echo sigchld.. >/dev/null" SIGCHLD
which gzip
FOUND=0
while [ $FOUND = 0 ]
do
retval=`ls *.log 2>/dev/null | wc -l `
echo "retval=$retval"
sleep 1
done
/nss/rtns/v_running/scripts> ./nss_test &
[3] 19244
/nss/rtns/v_running/scripts> /bin/gzip
retval= 0
retval= 0
retval= 0
retval= 0
retval= 0
/nss/rtns/v_running/scripts> retval= 0
ps -f
UID PID PPID C STIME TTY TIME CMD
rtns 15084 31190 0 Jul03 pts/6 00:00:00 /bin/ksh -i
rtns 16458 15084 0 10:26 pts/6 00:00:09 xterm -n xterm -ls -sl 900 -T Xterm900
rtns 19244 15084 0 16:16 pts/6 00:00:00 /bin/ksh ./nss_test
rtns 19250 15084 0 16:16 pts/6 00:00:00 ps -f
If I comment out the "which gzip" zombies do not occur..
If I replace the "which gzip" with "echo abc" or something else, the zombies do not occur. There seems to be something about the "which" program that causes corruption.
Any advice as to the reasons why I'm seeing this?
Thanks in advanced..
Joe |