From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: =?iso-8859-1?Q?=22B=FCtow=2C_Michael=22?= Newsgroups: gmane.os.tru64.managers Subject: SUMMARY: Why does ksh coredump on kill -0 ? Date: Wed, 30 Jun 2004 15:42:27 +0200 Sender: tru64-unix-managers-owner@ornl.gov Message-ID: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1088602984 7950 80.91.224.253 (30 Jun 2004 13:43:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 30 Jun 2004 13:43:04 +0000 (UTC) Original-X-From: tru64-unix-managers-owner-gotm-tru64-unix-managers=m.gmane.org@sws1.ctd.ornl.gov Wed Jun 30 15:42:51 2004 Return-path: Original-Received: from sws1.ornl.gov ([160.91.1.101]) by deer.gmane.org with smtp (Exim 3.35 #1 (Debian)) id 1BffMQ-000368-00 for ; Wed, 30 Jun 2004 15:42:51 +0200 Original-Received: (qmail 14970 invoked by uid 5); 30 Jun 2004 13:42:42 -0000 Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 14955 invoked by uid 49501); 30 Jun 2004 13:42:42 -0000 Original-Received: from michael.buetow@comsoft.de by sws1 by uid 49491 with qmail-scanner-1.21 (clamdscan: 0.70-rc. iscan: v3.1/v5.600-1011/847/50540. spamassassin: 2.63. Clear:RC:0(160.91.4.119):SA:0(-4.9/5.0):. Processed in 1.763139 secs); 30 Jun 2004 13:42:42 -0000 Original-Received: from unknown (HELO emroute1.cind.ornl.gov) (160.91.4.119) by 0 with SMTP; 30 Jun 2004 13:42:39 -0000 Original-Received: from emroute1.cind.ornl.gov (localhost [127.0.0.1]) by emroute1.cind.ornl.gov (PMDF V6.2-X27 #30899) with ESMTP id <0I0400EDDJF1WG@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Wed, 30 Jun 2004 09:42:38 -0400 (EDT) Original-Received: from VIRUSCAN-DAEMON.emroute1.cind.ornl.gov by emroute1.cind.ornl.gov (PMDF V6.2-X27 #30899) id <0I0400J02JETLN@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Wed, 30 Jun 2004 09:42:31 -0400 (EDT) Original-Received: from csdc.comsoft.de (csdc.comsoft.de [212.86.205.70]) by emroute1.cind.ornl.gov (PMDF V6.2-X27 #30899) with SMTP id <0I0400DG6JERTL@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Wed, 30 Jun 2004 09:42:29 -0400 (EDT) Original-Received: from cspop.comsoft.de by csdc.comsoft.de via smtpd (for smtp.ornl.gov [160.91.4.118]) with ESMTP; Wed, 30 Jun 2004 15:42:28 +0200 Original-To: tru64-unix-managers@ornl.gov X-MIMEOLE: Produced By Microsoft Exchange V6.0.6249.0 Thread-Topic: Why does ksh coredump on kill -0 ? Thread-Index: AcRepF62UQbWDWxDSBCc2ucxws8O6QAAqVuA content-class: urn:content-classes:message X-MS-Has-Attach: X-MS-TNEF-Correlator: Xref: main.gmane.org gmane.os.tru64.managers:7205 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:7205 Thanks to Kris Smith, Roberto Romani, Bob Vickers and Dr Thomas Blinn = for their helpful answers. I overlooked that the Tru64 ksh has a builtin kill command. This builtin = kill seems to support the -0 option (for checking the existence of a = process), and indeed it works fine as long as you pass it one or more = process ID(s). But without process ID's, it causes the shell to dump core (probably = parsing error). In the end I just made sure to call the script with process IDs, but the = proper solution would be to use the /usr/bin/kill command which handles = the -0 without PIDs just fine. Roberto also suggested the use of=20 #!/bin/ksh -x =20 to track this sort of problem down more efficiently. I ended up simply = logging debug messages to a file from all sort of places in my script to = find out the command that caused the coredump :-) Best regards, Michael -----Urspr=FCngliche Nachricht----- Von: Bob Vickers [mailto:bobv@cs.rhul.ac.uk] Gesendet: Mittwoch, 30. Juni 2004 15:16 An: B=FCtow, Michael Betreff: Re: Why does ksh coredump on kill -0 ? Michael, Just for the record, you are looking in the wrong man page. 'kill' is a shell built-in, so you should look in the ksh man page. However, you won't find the right man page any more informative! It has = no mention of this behaviour. The 'kill' program does not have this feature: if you type /bin/kill -0 nothing happens. Bob On Wed, 30 Jun 2004, "B=FCtow, Michael" wrote: > Hello managers, > > I don't understand why the Tru64 ksh coredumps with the following = script: > > #!/bin/ksh > kill -0 > > > I believe this happens under V4.X up to V5.1B, and I can't find = anything in the kill manpage to indicate that this is on purpose. > Does anybody have an explanation for this apparent misbehavior? > > Best regards, > Michael > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Bob Vickers R.Vickers@cs.rhul.ac.uk Dept of Computer Science, Royal Holloway, University of London WWW: http://www.cs.rhul.ac.uk/home/bobv Phone: +44 1784 443691