From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5432 invoked by alias); 5 Oct 2010 17:46:35 -0000 Received: (qmail 5419 invoked by uid 22791); 5 Oct 2010 17:46:34 -0000 X-SWARE-Spam-Status: No, hits=0.0 required=5.0 tests=AWL,BAYES_00,DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,SPF_HELO_PASS,T_RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from kuber.nabble.com (HELO kuber.nabble.com) (216.139.236.158) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 05 Oct 2010 17:46:29 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1P3Bat-0001jF-Li for gdb@sourceware.org; Tue, 05 Oct 2010 10:46:27 -0700 Message-ID: <29889599.post@talk.nabble.com> Date: Tue, 05 Oct 2010 17:46:00 -0000 From: santoshp To: gdb@sourceware.org Subject: Re: How to debug a hang process if the hung process itself is gdb ! In-Reply-To: <4CAB631D.9000909@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit References: <29889557.post@talk.nabble.com> <4CAB631D.9000909@vmware.com> 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/msg00013.txt.bz2 Thanks for the quick reply. Yes tried to attach the hung gdb to a fresh gdb, but it says the PTRACE operation is not permitted. :( Thanks, Santosh Michael Snyder-6 wrote: > > 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? > > > > -- View this message in context: http://old.nabble.com/How-to-debug-a-hang-process-if-the-hung-process-itself-is-gdb-%21-tp29889557p29889599.html Sent from the Sourceware - gdb list mailing list archive at Nabble.com.