Bug 113517 - RHEL 3.0 smp hang using prctl( PR_SET_PDEATHSIG
RHEL 3.0 smp hang using prctl( PR_SET_PDEATHSIG
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: kernel (Show other bugs)
3.0
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Ernie Petrides
: Security
Depends On:
Blocks: 107562
  Show dependency treegraph
 
Reported: 2004-01-14 16:28 EST by Jean Blouin
Modified: 2007-11-30 17:07 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-09-26 00:42:29 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jean Blouin 2004-01-14 16:28:05 EST
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 01:17:37 EST
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 (Product Security) 2004-02-18 06:58:55 EST
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 (Product Security) 2004-02-18 07:03:19 EST
(bug was automatically closed - reopening for RHEL3 errata)
Comment 5 Mark J. Cox (Product Security) 2004-02-18 13:15:19 EST
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 (Product Security) 2004-02-18 13:19:37 EST
(bug was automatically closed - reopening for RHEL3 errata)
Comment 8 Roland McGrath 2004-09-24 19:15:28 EDT
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 10:14:42 EDT
This is indeed fixed. My program now works fine. 

Note You need to log in before you can comment on or make changes to this bug.