Bug 4934 - Memory leak in pthread_mutext_timedlock
Summary: Memory leak in pthread_mutext_timedlock
Status: NEW
Alias: None
Product: uClibc
Classification: Unclassified
Component: Threads (show other bugs)
Version: unspecified
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-16 09:02 UTC by Markus Gilli
Modified: 2015-04-16 08:43 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:


Attachments
leaking test application (654 bytes, text/plain)
2012-03-16 09:03 UTC, Markus Gilli
Details
patch to cleanup wait_node (1.41 KB, patch)
2012-03-16 15:43 UTC, Markus Gilli
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Gilli 2012-03-16 09:02:11 UTC
There is a memory leak in pthread_mutext_timedlock when the lock fails because of the given timeout. I wrote a small test application to reproduce it.

I'm using OpenWRT on a ARM CPU, which in fact used 0.9.29 of uclibc. But i checked the code behind "pthread_mutext_timedlock" and it's identical. So i guess the bug is still in there.
Comment 1 Markus Gilli 2012-03-16 09:03:58 UTC
Created attachment 4148 [details]
leaking test application
Comment 2 Markus Gilli 2012-03-16 15:43:18 UTC
Created attachment 4160 [details]
patch to cleanup wait_node

i've found the leak in __pthread_alt_timedlock. The cleanup was missing if the timeout happens.