Bug 432721 - pthread_create leaks memory
Summary: pthread_create leaks memory
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: glibc
Version: 4.0
Hardware: All
OS: Linux
low
high
Target Milestone: rc
: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-02-13 23:57 UTC by Julien Pierre
Modified: 2008-02-14 10:00 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-02-14 08:19:19 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Mozilla Foundation 367376 0 None None None Never

Description Julien Pierre 2008-02-13 23:57:47 UTC
Description of problem:

Calls to pthread_create cause the following leak :

==4020== 204 bytes in 3 blocks are possibly lost in loss record 5 of 7
==4020==    at 0x442AC82: calloc (vg_replace_malloc.c:279)
==4020==    by 0x410EDEB: _dl_allocate_tls (in /lib/ld-2.3.2.so)
==4020==    by 0x45C826D: allocate_stack (in /lib/tls/libpthread-0.60.so)
==4020==    by 0x45C7EF7: pthread_create@@GLIBC_2.1 (in
/lib/tls/libpthread-0.60.so)

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

We saw this on both RHEL 3 and RHEL 4, with glibc

Our RHEL4 box has
libc-2.3.4-2.25

And RHEL3 :
glibc-2.3.2-95.37

See https://bugzilla.mozilla.org/show_bug.cgi?id=367376 for more details.

Comment 1 Jakub Jelinek 2008-02-14 08:19:19 UTC
What makes you think this is a leak?  NPTL has a cache of thread stacks prepared
for reuse, so the memory is still accessible.  If you 1000 times pthread_create
followed by 1000 pthread_join calls, you won't get 1000 unfreed blocks.


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