Re: Program crashes - debugging suggestions?

From: Joe Seigh (jseigh_01_at_xemaps.com)
Date: 06/29/04


Date: Tue, 29 Jun 2004 00:47:05 GMT


Mark wrote:
>
> Hi, I was hoping to get some suggestions on debugging a multi-threaded Linux
> program that crashes about every 10-12 hours. The program coordinates the
> behaviour between several (about 4)attached devices (serial and ethernet).
> There is generally one thread for each attached device. Unfortunately when
> it crashes the threads stop responding one-by-one, no seg fault or other
> obvious error occurs, making it very hard to pin down. What I suspect is
> happening is one thread is gradually overwriting memory and it crashes as
> soon as the memory being overwritten is in use by another thread. It
> currently has a 4k guard between threads.
>
> Does anyone have any suggestions for how to figure out which code is the
> source of the problem? I've inspected the most likely areas but haven't
> been successful in fixing it. Any techniques using gdb/ddd, or other tools?
> If it generated a seg fault it would be easy......
>
> Thanks in advance for any help, this is really driving me nuts!
>

Sound like deadlock or race condition (losing condvar signals). Try pstack
with unstripped binaries to see where the threads are stopped. man pstack
for more details.

Joe Seigh



Relevant Pages

  • Re: Program crashes - debugging suggestions?
    ... > program that crashes about every 10-12 hours. ... The program coordinates the ... > happening is one thread is gradually overwriting memory and it crashes as ... Try pstack ...
    (comp.os.linux.embedded)
  • Re: Program crashes - debugging suggestions?
    ... > program that crashes about every 10-12 hours. ... The program coordinates the ... > happening is one thread is gradually overwriting memory and it crashes as ... Try pstack ...
    (comp.unix.programmer)
  • Re: Program crashes - debugging suggestions?
    ... I was hoping to get some suggestions on debugging a multi-threaded Linux ... > program that crashes about every 10-12 hours. ... The program coordinates the ... > happening is one thread is gradually overwriting memory and it crashes as ...
    (comp.os.linux.embedded)
  • Re: Program crashes - debugging suggestions?
    ... I was hoping to get some suggestions on debugging a multi-threaded Linux ... > program that crashes about every 10-12 hours. ... The program coordinates the ... > happening is one thread is gradually overwriting memory and it crashes as ...
    (comp.unix.programmer)
  • Re: Program crashes - debugging suggestions?
    ... I was hoping to get some suggestions on debugging a multi-threaded Linux ... > program that crashes about every 10-12 hours. ... The program coordinates the ... > happening is one thread is gradually overwriting memory and it crashes as ...
    (comp.os.linux.development.apps)