From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32306 invoked by alias); 5 Oct 2010 17:40:55 -0000 Received: (qmail 32297 invoked by uid 22791); 5 Oct 2010 17:40:54 -0000 X-SWARE-Spam-Status: No, hits=-4.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-outbound-1.vmware.com (HELO smtp-outbound-1.vmware.com) (65.115.85.69) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 05 Oct 2010 17:40:49 +0000 Received: from mailhost2.vmware.com (mailhost2.vmware.com [10.16.67.167]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 36F8D1303C; Tue, 5 Oct 2010 10:40:46 -0700 (PDT) Received: from msnyder-server.eng.vmware.com (promd-2s-dhcp138.eng.vmware.com [10.20.124.138]) by mailhost2.vmware.com (Postfix) with ESMTP id 286F28E5D7; Tue, 5 Oct 2010 10:40:46 -0700 (PDT) Message-ID: <4CAB631D.9000909@vmware.com> Date: Tue, 05 Oct 2010 17:40:00 -0000 From: Michael Snyder User-Agent: Thunderbird 2.0.0.24 (X11/20100903) MIME-Version: 1.0 To: santoshp CC: "gdb@sourceware.org" Subject: Re: How to debug a hang process if the hung process itself is gdb ! References: <29889557.post@talk.nabble.com> In-Reply-To: <29889557.post@talk.nabble.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-10/txt/msg00012.txt.bz2 santoshp wrote: > Hi All, > I have a problem, I have a signal handler for few fatal signals e.g. > sigsegv, sigill etc. The handler will dump the stack trace in the log when > those signals will be triggered using GDB in batch mode. What I do is fork() > a process and inside the child I exec() the gdb process to capture the stack > tarce. The command will be something like this: > > /usr/bin/gdb -batch -n -x > > cat $commandfile > > set pagination off > set width 65536 > thread apply all bt > detach > > But it seems the gdb itself hung and the process attached is also hung. How > to debug them ? > > Is there a way to see the stack trace for hung gdb process or the running > process to be debugged which was attached to gdb? > > If anybody knows of any known issues with GDB, please share. > > GDb version: GNU gdb Red Hat Linux (6.5-37.el5_2.2rh), > "x86_64-redhat-linux-gnu", OS is RHEL5 running on x86_64. Please let me know > if this is not the place to discuss this. Any help or pointer would be of > great help. > > > Thanks in advance. > > Regards, > Santosh > Have you tried attaching a fresh gdb to the hung gdb?