Bug 522528

Summary: pthread_join() hangs if a thread calls setuid()
Product: Red Hat Enterprise Linux 5 Reporter: Martin Osvald 🛹 <mosvald>
Component: glibcAssignee: Andreas Schwab <schwab>
Status: CLOSED ERRATA QA Contact: BaseOS QE <qe-baseos-auto>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.3CC: drepper, ebachalo, jakub, pmuller
Target Milestone: rcKeywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: glibc-2.5-44 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-30 09:05:11 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:
Attachments:
Description Flags
reproducer's source file
none
a patch which fixes the bug none

Description Martin Osvald 🛹 2009-09-10 15:42:35 UTC
Created attachment 360523 [details]
reproducer's source file

Description of problem:

When a program creates a thread which calls setuid() and terminates, the other
thread trying to wait for it hangs.


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

RHEL5 (2.5-34), also RHEL4 and the newest upstream sources


How reproducible:

always


Steps to Reproduce:

1. Compile attached source file of reproducer:

$ gcc -o reproducer reproducer.c -lpthread

2. and run it:

$ ./reproducer

  
Actual results:

program hangs


Expected results:

program should end without hanging


Additional info:

This bug has appeared quite a long ago, you can find it in a sourceware BZ with existing patch at:

http://sources.redhat.com/bugzilla/show_bug.cgi?id=3270#c2

The patch solves the problem, but I have no idea why this hasn't been applied in the upstream already. I have attached a slightly modiffied version of the patch to be able to be applied and built on RHEL5 glibc sources and it works and solves the problem.

There is also existing BZ for RHEL4:

https://bugzilla.redhat.com/show_bug.cgi?id=248671

Comment 1 Martin Osvald 🛹 2009-09-10 15:46:24 UTC
Created attachment 360525 [details]
a patch which fixes the bug

this is a slightly modified version of the original patch: http://sources.redhat.com/bugzilla/attachment.cgi?id=1330&action=view

Comment 4 Andreas Schwab 2009-11-05 12:55:23 UTC

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

Comment 9 errata-xmlrpc 2010-03-30 09:05:11 UTC
An advisory 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 therefore 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/RHBA-2010-0306.html