From owner-freebsd-threads@FreeBSD.ORG Mon Jun 21 05:11:20 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1C24B16A4CE for ; Mon, 21 Jun 2004 05:11:20 +0000 (GMT) Received: from mail.mcneil.com (rrcs-west-24-199-45-54.biz.rr.com [24.199.45.54]) by mx1.FreeBSD.org (Postfix) with ESMTP id E4F5B43D58 for ; Mon, 21 Jun 2004 05:11:19 +0000 (GMT) (envelope-from sean@mcneil.com) Received: from localhost (localhost.mcneil.com [127.0.0.1]) by mail.mcneil.com (Postfix) with ESMTP id 43B73FD067 for ; Sun, 20 Jun 2004 22:11:19 -0700 (PDT) Received: from mail.mcneil.com ([127.0.0.1]) by localhost (server.mcneil.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 25599-06 for ; Sun, 20 Jun 2004 22:11:18 -0700 (PDT) Received: from [24.199.45.54] (mcneil.com [24.199.45.54]) by mail.mcneil.com (Postfix) with ESMTP id 53DAEFD03A for ; Sun, 20 Jun 2004 22:11:18 -0700 (PDT) From: Sean McNeil To: freebsd-threads@freebsd.org Content-Type: text/plain Message-Id: <1087794678.46146.4.camel@server.mcneil.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Sun, 20 Jun 2004 22:11:18 -0700 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at mcneil.com Subject: kill(pid,0) sends a signal or not? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2004 05:11:20 -0000 I'm trying to trace down an issue with kse threads and firefox. There is an odd "trick" I haven't seen before: // kill(pid,0) is a neat trick to check if a // process exists if (kill(pid, 0) == 0 || errno != ESRCH) Does this really work? It is kind of odd that it I appear to get a signal (if the traceback is accurate) with the signal set to 0: #10 0x0000000202bc7a80 in thr_resume_wrapper (sig=0, siginfo=0x4, ucp=0x7fffffffd4c0) at /usr/src/lib/libpthread/thread/thr_kern.c:1112 This later causes a sig 11 and the program core dumps. Any info on how threads are suppose to behave when a process does a kill(pid,0) would be greatly appreciated. Cheers, Sean