* How to debug a hang process if the hung process itself is gdb !
@ 2010-10-05 17:38 santoshp
2010-10-05 17:40 ` Michael Snyder
2010-10-05 18:00 ` Jan Kratochvil
0 siblings, 2 replies; 5+ messages in thread
From: santoshp @ 2010-10-05 17:38 UTC (permalink / raw)
To: gdb
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
--
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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How to debug a hang process if the hung process itself is gdb !
2010-10-05 17:38 How to debug a hang process if the hung process itself is gdb ! santoshp
@ 2010-10-05 17:40 ` Michael Snyder
2010-10-05 17:46 ` santoshp
[not found] ` <AANLkTino3CmSJ1gYGMoqWjauAggHoWwED=u8MukgNqGU@mail.gmail.com>
2010-10-05 18:00 ` Jan Kratochvil
1 sibling, 2 replies; 5+ messages in thread
From: Michael Snyder @ 2010-10-05 17:40 UTC (permalink / raw)
To: santoshp; +Cc: gdb
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?
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: How to debug a hang process if the hung process itself is gdb !
2010-10-05 17:40 ` Michael Snyder
@ 2010-10-05 17:46 ` santoshp
[not found] ` <AANLkTino3CmSJ1gYGMoqWjauAggHoWwED=u8MukgNqGU@mail.gmail.com>
1 sibling, 0 replies; 5+ messages in thread
From: santoshp @ 2010-10-05 17:46 UTC (permalink / raw)
To: gdb
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 <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?
>
>
>
>
--
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.
^ permalink raw reply [flat|nested] 5+ messages in thread[parent not found: <AANLkTino3CmSJ1gYGMoqWjauAggHoWwED=u8MukgNqGU@mail.gmail.com>]
* Re: How to debug a hang process if the hung process itself is gdb !
[not found] ` <AANLkTino3CmSJ1gYGMoqWjauAggHoWwED=u8MukgNqGU@mail.gmail.com>
@ 2010-10-05 17:47 ` Michael Snyder
0 siblings, 0 replies; 5+ messages in thread
From: Michael Snyder @ 2010-10-05 17:47 UTC (permalink / raw)
To: Santosh Pradhan; +Cc: gdb
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?
>
>
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How to debug a hang process if the hung process itself is gdb !
2010-10-05 17:38 How to debug a hang process if the hung process itself is gdb ! santoshp
2010-10-05 17:40 ` Michael Snyder
@ 2010-10-05 18:00 ` Jan Kratochvil
1 sibling, 0 replies; 5+ messages in thread
From: Jan Kratochvil @ 2010-10-05 18:00 UTC (permalink / raw)
To: santoshp; +Cc: gdb
On Tue, 05 Oct 2010 19:38:47 +0200, santoshp wrote:
> 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.
In various cases the process may be crashed a way no longer being able to
start that GDB. You should consider using /proc/sys/kernel/core_pattern to
run GDB externally, if possible. It is the method used by ABRT (Automatic Bug
Reporting Tool) in recent Fedoras (+unconfirmed in RHEL-6).
> GDb version: GNU gdb Red Hat Linux (6.5-37.el5_2.2rh),
This is RHEL-5.2.z. While troubleshooting you should try a build of one of:
http://www.gnu.org/software/gdb/download/
http://www.gnu.org/software/gdb/current/
Otherwise there is also more recent GDB in RHEL/CentOS-5.5: gdb-7.0.1-23.el5
Bugs of this kind for *.el5* GDBs should go rather to CentOS/RHEL Bugzilla
with a small reproducer, I would have to code the reproducer myself first.
Regards,
Jan
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-10-05 18:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-05 17:38 How to debug a hang process if the hung process itself is gdb ! 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
2010-10-05 18:00 ` Jan Kratochvil
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox