Bug 522528 - pthread_join() hangs if a thread calls setuid()
Summary: pthread_join() hangs if a thread calls setuid()
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: glibc
Version: 5.3
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Andreas Schwab
QA Contact: BaseOS QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-09-10 15:42 UTC by Martin Osvald 🛹
Modified: 2010-03-30 09:05 UTC (History)
4 users (show)

Fixed In Version: glibc-2.5-44
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-03-30 09:05:11 UTC


Attachments (Terms of Use)
reproducer's source file (535 bytes, text/plain)
2009-09-10 15:42 UTC, Martin Osvald 🛹
no flags Details
a patch which fixes the bug (5.14 KB, patch)
2009-09-10 15:46 UTC, Martin Osvald 🛹
no flags Details | Diff


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2010:0306 normal SHIPPED_LIVE glibc bug fix and enhancement update 2010-03-29 14:34:54 UTC
Sourceware 3270 None None None Never

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


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