Bug 4934

Summary: Memory leak in pthread_mutext_timedlock
Product: uClibc Reporter: Markus Gilli <mgi255>
Component: ThreadsAssignee: unassigned
Status: NEW ---    
Severity: normal CC: buildroot, uclibc-cvs
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:
Attachments: leaking test application
patch to cleanup wait_node

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.