From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30894 invoked by alias); 5 Oct 2010 17:38:53 -0000 Received: (qmail 30797 invoked by uid 22791); 5 Oct 2010 17:38:52 -0000 X-SWARE-Spam-Status: No, hits=1.1 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:38:48 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1P3BTT-0000zY-3O for gdb@sourceware.org; Tue, 05 Oct 2010 10:38:47 -0700 Message-ID: <29889557.post@talk.nabble.com> Date: Tue, 05 Oct 2010 17:38:00 -0000 From: santoshp To: gdb@sourceware.org Subject: How to debug a hang process if the hung process itself is gdb ! MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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/msg00011.txt.bz2 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 -- View this message in context: http://old.nabble.com/How-to-debug-a-hang-process-if-the-hung-process-itself-is-gdb-%21-tp29889557p29889557.html Sent from the Sourceware - gdb list mailing list archive at Nabble.com.