Bug 107701

Summary: ps and top do not show no-exec children
Product: [Retired] Red Hat Linux Reporter: Jan Christiaan van Winkel <jc>
Component: procpsAssignee: Daniel Walsh <dwalsh>
Status: CLOSED DUPLICATE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 9   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-02-21 18:59:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jan Christiaan van Winkel 2003-10-22 10:08:39 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225

Description of problem:
if a program fork()s but the child does not exec, ps will not show it, and add
all CPU time to the parent.  Killing the parent will then show the child in top
and ps.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
Compile rabbit.c:

#include <stdio.h>
#include <unistd.h>
 
int main() {
 
  fork();
  fork();
 
  printf("Rabbit PID=%d\n", getpid());
 
  while (1) {}
 
}

[jc@minioreo TEST]$ make rabbit
cc     rabbit.c   -o rabbit
[jc@minioreo TEST]$ ./rabbit &
[1] 12126
Rabbit PID=12128
Rabbit PID=12127
[jc@minioreo TEST]$ Rabbit PID=12129
Rabbit PID=12126
ps
  PID TTY          TIME CMD
 8991 pts/3    00:00:00 bash
12126 pts/3    00:00:02 rabbit
12130 pts/3    00:00:00 ps
[jc@minioreo TEST]$ kill 12126    # this will kill parent, not babies
[jc@minioreo TEST]$ ps
  PID TTY          TIME CMD
 8991 pts/3    00:00:00 bash
12127 pts/3    00:00:04 rabbit
12129 pts/3    00:00:02 rabbit
12131 pts/3    00:00:00 ps


top does the same thing.

Actual Results:  ps and top *incorrectly* do not show the baby-rabbits.

Expected Results:  I want to see all processes running.  If even a ps -e will
not show these ``hidden'' processes, what ps-flag would I need?

Additional info:

Comment 1 Daniel Walsh 2004-02-11 13:51:25 UTC

*** This bug has been marked as a duplicate of 107705 ***

Comment 2 Red Hat Bugzilla 2006-02-21 18:59:19 UTC
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.