Bug 432721 - pthread_create leaks memory
pthread_create leaks memory
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: glibc (Show other bugs)
4.0
All Linux
low Severity high
: rc
: ---
Assigned To: Jakub Jelinek
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-02-13 18:57 EST by Julien Pierre
Modified: 2008-02-14 05:00 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-02-14 03:19:19 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Mozilla Foundation 367376 None None None Never

  None (edit)
Description Julien Pierre 2008-02-13 18:57:47 EST
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 03:19:19 EST
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.