[news.software.b] cnews checkgroups processing core-dumps

whna@ciba-geigy.ch (Heinz Naef) (07/18/90)

Processing of a checkgroups control message core-dumps, producing the
following alerts to $NEWSMASTER:

Relaynews: control message `PATH=/usr/lib/news/bin:/usr/lib/newsbin/ctl;checkgroups <control/6073' exited with status 0105400

cgch relaynews `bad/648248197' failed, status 16 (see errlog)

newsdaily (errlog):
sh: 18795 Memory fault - core dumped

recent bad input batches:
bad/648248197

[...]

Adb on the core file:
core file = problems/cnews/news.core --	program	``sh''
SIGSEGV	11: segmentation violation
d0    0x22e69
d1    0xffffffff
d2    0x2
d3    0x0
d4    0x0
d5    0x0
d6    0x0
d7    0x2004
a0    0x26000
a1    0x237f8
a2    0x0
a3    0xeffff48
a4    0x23744
a5    0x23800
a6    0xefffd58
sp    0xefffd50
pc    0x24ac
ps    0x0
      0x0

text address not found

The checkgroups report has been sent to $NEWSMASTER and is complete. However,
the work files are still in /tmp. That means for me that the crash happens
when checkgroups tries to execute the final 'rm -f /tmp/$$*' in the
$NEWSBIN/ctl/checkgroups script.

C News runs on a Sun 3/160 with SunOS 4.0.3 here. We guess that the problem
started to occur after the upgrade to C News Patch Level 25-May-1990.

Any idea what happens here? Could an earlier command in the script have
destroyed the environment?

Maybe someone else experienced the same problem. Hmm..?

Thanks in advance for any kind of help.
--
Heinz Naef, CIBA-GEIGY AG, R-1045.3.37, P.O.Box, CH-4002 Basel, Switzerland
 E-mail: whna@ciba-geigy.ch - Phone: +41 61 697 2675 - Fax: +41 61 697 3288

henry@zoo.toronto.edu (Henry Spencer) (07/18/90)

In article <1990Jul18.101929.23679@ciba-geigy.ch> whna@ciba-geigy.ch (Heinz Naef) writes:
>C News runs on a Sun 3/160 with SunOS 4.0.3 here. We guess that the problem
>started to occur after the upgrade to C News Patch Level 25-May-1990.

My guess would be that the timing was coincidental; I don't think we did
anything to checkgroups in that patch.  What might be significant is the
ever-growing number of newsgroups.  It looks like it hit some limit in
your shell.  Geoff has been heard to mutter about Sun shells; I wouldn't
know because we don't run them ourselves.  (Suns, yes, Sun shells, no.)
-- 
NFS:  all the nice semantics of MSDOS, | Henry Spencer at U of Toronto Zoology
and its performance and security too.  |  henry@zoo.toronto.edu   utzoo!henry

whna@ciba-geigy.ch (Heinz Naef) (07/19/90)

In article <1990Jul18.162721.951@zoo.toronto.edu> henry@zoo.toronto.edu (Henry Spencer) writes:
>
>My guess would be that the timing was coincidental; I don't think we did
>anything to checkgroups in that patch.  What might be significant is the
>ever-growing number of newsgroups.  It looks like it hit some limit in
>your shell.  Geoff has been heard to mutter about Sun shells; I wouldn't
>know because we don't run them ourselves.  (Suns, yes, Sun shells, no.)
>-- 

I modified $NEWSBIN/ctl/checkgroups specifying #!/bin/ksh instead of #!/bin/sh, and
inserted a 'set -vx' as follows:

	[...]

	#       for i in `cat /tmp/$$add`
	#       do
	# *** "Subject: cmsg " is a hideous botch of a kludge-hack; avoid it!
	#               inews -h <<!
	#Control: newgroup $i
	#Newsgroups: control
	#Subject: newgroup $i
	#Distribution: general
	#
	#Create $i locally.
	#!
	#       done

	fi 2>&1 >>/tmp/$$out

	set -vx

	if test -s /tmp/$$out; then
			(echo "Subject: Problems with your active file"; echo "";
			 cat /tmp/$$out) | mail $NEWSMASTER
	fi

	rm -f /tmp/$$*          # clean up temporaries

Running the following command causes the same crash as if relaynews would have
spawned the checkgroups script (login shell is /bin/ksh, too):

	/usr/lib/news> (PATH=$NEWSCTL/bin:$NEWSBIN/ctl;checkgroups </usr/spool/news/control/6073; echo "exit code $?")

	if test -s /tmp/$$out; then
			(echo "Subject: Problems with your active file"; echo "";
			 cat /tmp/$$out) | mail $NEWSMASTER
	fi
	+ test -s /tmp/2164out
	+ echo Subject: Problems with your active file
	+ mail usenet
	+ echo 
	+ cat /tmp/2164out

	rm -f /tmp/$$*          # clean up temporaries
	+ rm -f /tmp/2164a /tmp/2164add /tmp/2164b /tmp/2164out /tmp/2164remove
	Memory fault(coredump)
	/usr/lib/news> adb - core
	core file = core -- program ``ksh''
	SIGSEGV 11: segmentation violation
	/usr/lib/news> 

However, running the following command works (login shell is /bin/ksh, too):

	/usr/lib/news> (PATH=$NEWSCTL/bin:$NEWSBIN/ctl;checkgroups </usr/spool/news/control/6073; /bin/echo "exit code $?")

	if test -s /tmp/$$out; then
			(echo "Subject: Problems with your active file"; echo "";
			 cat /tmp/$$out) | mail $NEWSMASTER
	fi
	+ test -s /tmp/2322out
	+ echo Subject: Problems with your active file
	+ echo 
	+ mail usenet
	+ cat /tmp/2322out

	rm -f /tmp/$$*          # clean up temporaries
	+ rm -f /tmp/2322a /tmp/2322add /tmp/2322b /tmp/2322out /tmp/2322remove
	exit code 0
	/usr/lib/news> 

Would you agree that there must have something happened to the shell environment
the checkgroups script is running in? For the checkgroups script itself, it seems
to make no difference whether the script is processed by the Sun /bin/sh or our
/bin/ksh.

--
Heinz Naef, CIBA-GEIGY AG, R-1045.3.37, P.O.Box, CH-4002 Basel, Switzerland
 E-mail: whna@ciba-geigy.ch - Phone: +41 61 697 2675 - Fax: +41 61 697 3288

henry@zoo.toronto.edu (Henry Spencer) (07/20/90)

In article <1990Jul19.075348.2504@ciba-geigy.ch> whna@ciba-geigy.ch (Heinz Naef) writes:
>Running the following command causes the same crash as if relaynews would have
>spawned the checkgroups script (login shell is /bin/ksh, too):
>	/usr/lib/news> (PATH=$NEWSCTL/bin:$NEWSBIN/ctl;checkgroups </usr/spool/news/control/6073; echo "exit code $?")
> ...
>However, running the following command works (login shell is /bin/ksh, too):
>	/usr/lib/news> (PATH=$NEWSCTL/bin:$NEWSBIN/ctl;checkgroups </usr/spool/news/control/6073; /bin/echo "exit code $?")
>Would you agree that there must have something happened to the shell environment
>the checkgroups script is running in? ...

Ouch.  Something is really fouling up somewhere in your shell.  No idea
what it could be.
-- 
NFS:  all the nice semantics of MSDOS, | Henry Spencer at U of Toronto Zoology
and its performance and security too.  |  henry@zoo.toronto.edu   utzoo!henry