3

I am using strace to see what certain processes are doing. I have an Apache process that seems to be running forever, taking up 97.8% of a core and almost 2GB of RAM.

Now when I run strace on this process there is no output at all. Does this mean that the process is dead and sitting in there taking up resources? Can I kill the process without worrying about doing something bad?

I am running strace in the following way:

strace -p6873

Thanks

Josh Pennington

Josh Pennington
  • 288
  • 1
  • 6
  • 21

1 Answers1

4

The process seems to be stuck in a single long-running syscall. Since strace doesn't show the syscall that was running, when it attached the process, you get no output. You could maybe get more info using a debugger like gdb and running a stack trace (gdb command: bt).

al.
  • 925
  • 6
  • 17
  • 3
    It also might be doing internal processing; strace only sees syscalls, but not all calls are syscalls... a tight infinite loop (bug) would also just hang as above. – pjz Oct 14 '10 at 03:56
  • You're probably right, hence the high cpu usage. – al. Oct 14 '10 at 11:16
  • "Since strace doesn't show the syscall that was running" -- I disagree; when I strace a process blocked in a syscall I see a partial line like `write(1, "y\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\ny\n"..., 4096` or `futex(0x7f2b3c14fe54, FUTEX_WAIT_PRIVATE, 59, NULL` – sqweek Sep 06 '16 at 10:03
  • No, what you do see is `restart_syscall(<... resuming interrupted xyz ...>)` where xyz is the syscall. See pjz's comment for the more correct explanation. – al. Sep 06 '16 at 20:05