If you are seeing ‘root:root’ under /proc// for your process, it means the process is in Zombie state.
#include int main() { pid_t pid; int i; for (i = 0; ; i++) { pid = fork(); if (pid > 0) { break; } else { exit(0); } } while (1) { sleep(1); } return 0; } $ gcc -o zombie zombie.c $ ./zombie & $ ps aux | grep zombie sungju 12994 0.0 0.0 3924 340 pts/1 S 11:54 0:00 ./zombie sungju 12995 0.0 0.0 0 0 pts/1 Z 11:54 0:00 [zombie] sungju 13398 0.0 0.0 103320 848 pts/1 S+ 11:55 0:00 grep --color zombie $ ls -l /proc/12994 | head total 0 dr-xr-xr-x. 2 sungju sungju 0 Jan 30 11:55 attr -rw-r--r--. 1 sungju sungju 0 Jan 30 11:55 autogroup -r--------. 1 sungju sungju 0 Jan 30 11:55 auxv -r--r--r--. 1 sungju sungju 0 Jan 30 11:55 cgroup --w-------. 1 sungju sungju 0 Jan 30 11:55 clear_refs -r--r--r--. 1 sungju sungju 0 Jan 30 11:55 cmdline -rw-r--r--. 1 sungju sungju 0 Jan 30 11:55 comm -rw-r--r--. 1 sungju sungju 0 Jan 30 11:55 coredump_filter -r--r--r--. 1 sungju sungju 0 Jan 30 11:55 cpuset $ ls -l /proc/12995 | head ls: cannot read symbolic link /proc/12995/cwd: Permission denied ls: cannot read symbolic link /proc/12995/root: Permission denied ls: cannot read symbolic link /proc/12995/exe: Permission denied total 0 dr-xr-xr-x. 2 sungju sungju 0 Jan 30 11:55 attr -rw-r--r--. 1 root root 0 Jan 30 11:55 autogroup -r--------. 1 root root 0 Jan 30 11:55 auxv -r--r--r--. 1 root root 0 Jan 30 11:55 cgroup --w-------. 1 root root 0 Jan 30 11:55 clear_refs -r--r--r--. 1 root root 0 Jan 30 11:55 cmdline -rw-r--r--. 1 root root 0 Jan 30 11:55 comm -rw-r--r--. 1 root root 0 Jan 30 11:55 coredump_filter -r--r--r--. 1 root root 0 Jan 30 11:55 cpuset
Leave a Reply