From owner-freebsd-current@FreeBSD.ORG Sat Jun 30 15:05:43 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CCC4D16A41F for ; Sat, 30 Jun 2007 15:05:43 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.208.78.105]) by mx1.freebsd.org (Postfix) with ESMTP id B0B5513C45E for ; Sat, 30 Jun 2007 15:05:43 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.1/8.13.8) with ESMTP id l5UF4mUC070837; Sat, 30 Jun 2007 08:04:48 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.1/8.13.8/Submit) id l5UF4mRM070836; Sat, 30 Jun 2007 08:04:48 -0700 (PDT) (envelope-from sgk) Date: Sat, 30 Jun 2007 08:04:48 -0700 From: Steve Kargl To: Michiel Boland Message-ID: <20070630150448.GA70741@troutmask.apl.washington.edu> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.2i Cc: freebsd-current@freebsd.org Subject: Re: tcsh hangs in sigsuspend X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jun 2007 15:05:43 -0000 On Sat, Jun 30, 2007 at 04:41:42PM +0200, Michiel Boland wrote: > Hi. I can no longer do simple things like > > kill `cat pidfile` > > in tcsh. > > After some debugging I noticed that tcsh hangs in sigsuspend in line 512 > of sh.proc.c. So I guess it (tcsh) executed 'cat pidfile', and now waits > for the process to terminate. But unless I'm not looking properly, there > appears to be a race condition here. Tcsh blocks the SIGCHLD signal > *after* it forks the child, not before. So the child could wel have exited > between the call to fork and the call to sigprocmask. In that case, would > not the sigsuspend hang forever? > > Also, I noticed that gdb gets very confused if I try to debug tcsh with > a backticked command like the one above. (I guess this is the same as > bin/112408) > I suspect it is the same problem. Unfortunately, the author of tcsh does not have a publicly available source tree, so one cannot determine if the problem is fixed. It looks like you've managed to go beyond the limited debugging I did in bin/112408. Hopefully, this gets addressed before 7.0 is released. -- Steve