1

A coworker ran into this issue twice and I don't know what's wrong. His ps command hangs, taking about 25% of the CPU.

   in_progress=1
   sleep 10

   while [ "$in_progress" -eq 1 ]; do
      num_isp=`ps -e | grep isputility | grep -v grep | wc -l`
      if [ "$num_isp" -eq 0 ]; then
         in_progress=0
      fi
      sleep 10
   done

Below is the output of the ps command that hung.

       F S   UID        PID       PPID  C PRI  NI ADDR    SZ WCHAN STIME TTY          TIME CMD
00100000 -     0   35672094    1204253  -  10   0    -  844K -     Apr16 ?        00:00:00 /bin/sh /home/customProgram
00100000 -     0   43548705   42545184  -  10   0    -  648K -     11:51 ?        00:00:00 ps –elf
00100000 -     0   41926696   35672094  -  10   0    -  648K -     Apr16 ?        03:53:01 ps -e
00100000 -     0   41926702   35672094  -  10   0    -  672K -     Apr16 ?        00:00:00 grep isputility
00100000 -     0   41926704   35672094  -  10   0    -  672K -     Apr16 ?        00:00:00 grep -v grep
00100000 -     0   41926706   35672094  -  10   0    -  640K -     Apr16 ?        00:00:00 wc -l

Running QNX hogs command (similar to top) shows ps is using ~25% of the CPU.

hogs -% 1 -n
PID             NAME  MSEC  PIDS SYSTEM
1            procnto  2116   71%    70%
41926696           ps   763   25%    25%

Can anyone point us in the right direction to figure out why ps hung and what we can do about it?

1

Try executing strace ps and see what system call it is hanging on and then take action accordingly.

  • 2
    That would very likely help. I wish QNX had strace. – kmort Apr 19 '13 at 12:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.