Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 3 product line. The current stable release is 3.9. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 113517

Summary: RHEL 3.0 smp hang using prctl( PR_SET_PDEATHSIG
Product: Red Hat Enterprise Linux 3 Reporter: Jean Blouin <blouin>
Component: kernelAssignee: Ernie Petrides <petrides>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3.0CC: barryn, blouin, mjc, petrides, riel, roland
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-09-26 04:42:29 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:
Bug Depends On:    
Bug Blocks: 107562    

Description Jean Blouin 2004-01-14 21:28:05 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20030925

Description of problem:
Using the following function in one of our program 
prctl(PR_SET_PDEATHSIG, SIGHUP, 0, 0); 
completely hangs the system.

RHEL 3.0. kernel 2.4.21-4.ELsmp.

The same program was running fine on RH8.0 kernel 2.4.20-20.8smp. 


The following test program reproduces the problem everytime, Note that
this is an SMP only issue, the same programs run fine on a uniprocessor.

//
// File       : pdeath.C
// Description: This test program, freeze the whole system
// by seting the prctl( PR_SET_PDEATHSIG, SIGHUP, 0, 0)
//
// compile using:
//  g++ -g -c pdeath.C  -o pdeath.o
//  g++ -g -o pdeath_Linux pdeath.o  -lpthread
//
// 

#include <sys/types.h>
#include <sys/prctl.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>

int main(int argc, char *argv[])
{
   if(pid_t pid = fork()) {
      // parent
      printf("Parent forked child = %d\n", pid);
      // sleep for 5 seconds
      sleep(5);
      printf("Parent committing suicide\n");
   } else {
      // child
      printf("Child forked\n");
      // setup signal to be sent if parent process die.
      prctl(PR_SET_PDEATHSIG, SIGHUP, 0, 0);
      // sleep 100 seconds
      sleep(100);
   }
   return EXIT_SUCCESS;
}

Our test system is a IBM Z-pro with 2 pentium 3.0Ghz with 3G. of RAM.


Version-Release number of selected component (if applicable):
kernel 2.4.21-4.ELsmp

How reproducible:
Always

Steps to Reproduce:
1.just compile and run the above program it will hang everytime.

    

Actual Results:  Completely freeze the OS.

Expected Results:  exit gracefully, system does not hang.

Additional info:

Comment 2 Ernie Petrides 2004-02-06 06:17:37 UTC
The fix for this problem has just been committed to the RHEL3 U2
patch pool tonight.  The first kernel version with the fix will
be 2.4.21-9.5.EL (which is an internal Red Hat Engineering build).


Comment 3 Mark J. Cox 2004-02-18 11:58:55 UTC
An errata has been issued which should help the problem described in this bug report. 
This report is therefore being closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files, please follow the link below. You may reopen 
this bug report if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2004-065.html


Comment 4 Mark J. Cox 2004-02-18 12:03:19 UTC
(bug was automatically closed - reopening for RHEL3 errata)

Comment 5 Mark J. Cox 2004-02-18 18:15:19 UTC
An errata has been issued which should help the problem described in this bug report. 
This report is therefore being closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files, please follow the link below. You may reopen 
this bug report if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2004-065.html


Comment 6 Mark J. Cox 2004-02-18 18:19:37 UTC
(bug was automatically closed - reopening for RHEL3 errata)

Comment 8 Roland McGrath 2004-09-24 23:15:28 UTC
This should have been closed as ERRATA when U2 went out, but it wasn't.
Is any more magic needed to tie the U2 release to this bug #?
Or should we just close this now by hand? 

Comment 11 Jean Blouin 2004-09-27 14:14:42 UTC
This is indeed fixed. My program now works fine.