From: Michael Snyder <msnyder@vmware.com>
To: Santosh Pradhan <santosh.pradhan@gmail.com>
Cc: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: Re: How to debug a hang process if the hung process itself is gdb !
Date: Tue, 05 Oct 2010 17:47:00 -0000 [thread overview]
Message-ID: <4CAB64BE.4030403@vmware.com> (raw)
In-Reply-To: <AANLkTino3CmSJ1gYGMoqWjauAggHoWwED=u8MukgNqGU@mail.gmail.com>
Attach is the only way I know of.
Santosh Pradhan wrote:
> Hi Mike,
> Thanks for the quick response. I tried to attach the hung gdb to fresh gdb and it says _PTRACE operation not permitted. :( IS there any way to debug the hung gdb?
>
> Thanks,
> Santosh
>
> On Tue, Oct 5, 2010 at 11:10 PM, Michael Snyder <msnyder@vmware.com<mailto:msnyder@vmware.com>> 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 <binary path> <running pid> -batch -n -x <command file>
>
> 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?
>
>
>
>
next prev parent reply other threads:[~2010-10-05 17:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-05 17:38 santoshp
2010-10-05 17:40 ` Michael Snyder
2010-10-05 17:46 ` santoshp
[not found] ` <AANLkTino3CmSJ1gYGMoqWjauAggHoWwED=u8MukgNqGU@mail.gmail.com>
2010-10-05 17:47 ` Michael Snyder [this message]
2010-10-05 18:00 ` Jan Kratochvil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4CAB64BE.4030403@vmware.com \
--to=msnyder@vmware.com \
--cc=gdb@sourceware.org \
--cc=santosh.pradhan@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox