From owner-freebsd-questions@FreeBSD.ORG Fri May 21 22:39:30 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A8561065678 for ; Fri, 21 May 2010 22:39:30 +0000 (UTC) (envelope-from carlj@peak.org) Received: from redcondor2.peak.org (redcondor2.peak.org [69.59.192.56]) by mx1.freebsd.org (Postfix) with ESMTP id D57DD8FC16 for ; Fri, 21 May 2010 22:39:28 +0000 (UTC) Received: from peak-mail-gateway.peak.org ([69.59.192.41]) by redcondor2.peak.org ({e8dac926-1ec8-47e6-b410-31008b345fb7}) via TCP (outbound) with ESMTP id 20100521223927685 for ; Fri, 21 May 2010 22:39:27 +0000 X-RC-FROM: X-RC-RCPT: Received: from cjlinux.localnet (207.55.91.197.peak.org [207.55.91.197] (may be forged)) (authenticated bits=0) by peak-mail-gateway.peak.org (8.12.10/8.12.8) with ESMTP id o4LMdQLn061571 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Fri, 21 May 2010 15:39:27 -0700 (PDT) Received: from carlj by cjlinux.localnet with local (Exim 4.69) (envelope-from ) id 1OFasI-0003f7-HT for freebsd-questions@freebsd.org; Fri, 21 May 2010 15:39:26 -0700 To: freebsd-questions@freebsd.org References: <877hmzbi1f.fsf@cjlinux.localnet> <878w7d7qbb.fsf@kobe.laptop> <87pr0przea.fsf@cjlinux.localnet> <8739xlnhzz.fsf@kobe.laptop> From: Carl Johnson Date: Fri, 21 May 2010 15:39:26 -0700 In-Reply-To: <8739xlnhzz.fsf@kobe.laptop> (Giorgos Keramidas's message of "Fri\, 21 May 2010 22\:59\:28 +0300") Message-ID: <87k4qwswv5.fsf@cjlinux.localnet> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: Bash lockups X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 May 2010 22:39:30 -0000 Giorgos Keramidas writes: > On Fri, 21 May 2010 09:30:05 -0700, Carl Johnson wrote: >> Giorgos Keramidas writes: >>> Does this lock-up happen if you leave the shell 'idle' for too long >>> over an ssh session? There may be problems with stateful connection >>> tracking between your terminal and the remote shell :-/ >> >> No, I don't think that could be the problem. I am just using ssh >> between local machines and there is no firewall between them. It also >> often seems to happen to a shell as I switch away from it to another >> one. One suspicion is that something is sending a signal to the shell >> as it switches, and bash sometimes doesn't handle that signal >> properly. >> >> I also should have mentioned that I have been running bash as my >> default shell for years under Linux and have never seen this problem >> there. >> >> Thanks for the suggestion. > > That's ok. If you can attach to the bash process with ktrace please try > to grab a ktrace file from a deadlocked shell. We may be able to see > why it gets deadlocked by running kdump(8) on the shell trace file. > > You can run a second shell under ktrace (and hope that the parent > doesn't deadlock before the traced child shell), by running: > > bash$ ktrace -f bash.trace bash --login > > When you exit from the child shell you can dump ktrace(8) events from > the bash.trace file with: > > bash$ kdump -f bash.trace > logfile 2>&1 > > Looking near the last records dumped in 'logfile' should be quite > informative if the process is dead-locked or spinning around the same > code over and over again. Thanks for the detailed information. I have been mostly a linux user, so this is new for me. It hasn't been happening very often lately, so it might be a while now. I will definitely try to keep any hung processes around to try your suggestions. -- Carl Johnson carlj@peak.org