GDB and sleeping processes

From: Aleksi Asikainen (aleksi.asikainen_at_infire.com)
Date: 08/26/03

  • Next message: L: "Re: SOS - why does an application work fine with a hub but not a switch box?"
    Date: Tue, 26 Aug 2003 18:07:09 +0300
    
    

    Hi,

    I have a server with a couple hundred of processes which I need attach with
    gdb every now and then. The processes being 'live', I can't start them from
    gdb, and I believe this is somewhat part of the problem; Linux wishes to
    keenly put all of these processes to sleeping state and once they've gotten
    to the sleeping state, gdb naturally has problems attaching itself to them.

    Google suggested that sending SIGALRM to the process might wake it up, but
    this doesn't seem to be so; if kill -s SIGALRM is sent to a process that
    doesn't handle the signal, the process will quit. If it's sent to a process
    that does handle the signal ('handle' here means using the signal(2) call),
    then the process does not wake up.

    What should I do to make sure the process will wake up? I'm running on
    RedHat 7.3 with 2.4.20-13.8smp.

    Aleksi Asikainen


  • Next message: L: "Re: SOS - why does an application work fine with a hub but not a switch box?"

    Relevant Pages

    • Re: sigsuspend() and ptrace()
      ... > My program uses gdb to attach to a process and make it execute a specific ... > function thanks to the gdb 'call' command. ... > attached process is sleeping in sigsuspend(). ... the SIGSTOP even though there is no handler. ...
      (Linux-Kernel)
    • Re: 6-CURRENT, threads, hangs are still there
      ... Running sim, psi, xmms, mozilla etc. hangs on startup, ... > GDB is unable to attach, process is unkillable even with SIGKILL. ...
      (freebsd-current)
    • 6-CURRENT, threads, hangs are still there
      ... Running sim, psi, xmms, mozilla etc. hangs on startup, ... unless `libpthread' mapped to `libc_r' via /etc/libmap.conf. ... GDB is unable to attach, process is unkillable even with SIGKILL. ...
      (freebsd-current)
    • Re: debugging dlls with gdb
      ... > to the top of DllMainor something, allowing you to attach to the ... > You can attach to a running process in gdb - either ... Or should I not move my DLL ...
      (comp.programming)
    • sigsuspend() and ptrace()
      ... My program uses gdb to attach to a process and make it execute a specific ... the target process receives a SIGSTOP but there ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)