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

1
  • it can be another inner process running and the main one is waiting = no output. check it and try a different PID. Commented Aug 26, 2021 at 15:03

1 Answer 1

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).

4
  • 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. Commented Oct 14, 2010 at 3:56
  • You're probably right, hence the high cpu usage. Commented Oct 14, 2010 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 Commented Sep 6, 2016 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. Commented Sep 6, 2016 at 20:05

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.