Bug 211956

Summary: top goes into hard loop on xterm exit
Product: Red Hat Enterprise Linux 4 Reporter: Major <major>
Component: procpsAssignee: Karel Zak <kzak>
Status: CLOSED WONTFIX QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.4   
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-10-24 10:26:22 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 Major 2006-10-24 04:16:51 UTC
Description of problem:
top run as root goes into hard loop if the xterm it is running under exits

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

How reproducible:
100%

Steps to Reproduce:
1. Start an xterm
2. su to root
3. run top
4. kill the xterm
  
Actual results:
top process goes into hard loop consuming 100% of available cpu

Expected results:
top process terminates

Additional info:

Comment 1 Karel Zak 2006-10-24 10:17:17 UTC
*** Bug 211957 has been marked as a duplicate of this bug. ***

Comment 2 Karel Zak 2006-10-24 10:26:22 UTC
Your xterm runs with non-root permissions and it can't send SIGHUP to the su
which runs with root permissions. This problem cannot be fixed. Sorry.

BTW, I you want to run the top with root permissions in a xterm, you can start
it by: su -c "xterm -e top".

Comment 3 Albert Cahalan 2006-12-25 19:08:15 UTC
This is actually a kernel bug.

The xterm itself DOES NOT send the SIGHUP. The SIGHUP is sent by the kernel
itself, automatically as the xterm dies.

On a real BSD system, where this whole idea originates AFAIK, the signal will
always get sent. Linux used to do this too, but broke when some other changes
went it. I believe it was the SE Linux merge that caused this, but note that the
bug shows up even when SE Linux is not compiled into the kernel. In other words,
I think the SE Linux changes broke non-SE systems.

I've been unable to find the bug from an examination of the kernel source. As
far as I can tell, the signal is sent in a way that will bypass permission
checking. Somehow though, this isn't working.

Please reopen this bug and assign it to the kernel.