Semaphore handle leaks in WindowMaker with latest Xorg distribution

Jon TURNEY jon.turney@dronecode.org.uk
Wed Jan 28 14:37:00 GMT 2009


Yaakov (Cygwin/X) wrote:
> Jon TURNEY wrote:
>> So I guess suspicion first falls that this leak is somewhere in one of
>> the updated X DLLs...
> 
> The question is then, how can we track this down?

This actually turned out to be easier to track down than I thought.  Using 
process explorer on 'wmaker --for-real --no-polling --static' shows that the 
only thing of interest it's doing is calling XSync().

A simple test-case (attached) which just calls XSync() shows exactly the same 
behaviour, leaking 3 semaphores per call.

The call stack looks like

pthread_cond_init
xcondition_init at Xthreads.h
insert_pending_request at xcb_io.c:343
_XReply at xcb_io.c:368
XSync at Sync.c:48
main at test_xsync.c:19

After some staring at the code, I think the attached patch is perhaps the 
correct place to add a matching xcondition_clear.

Entered into bugzilla
http://sourceware.org/bugzilla/show_bug.cgi?id=9795
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test_xsync.c
URL: <http://cygwin.com/pipermail/cygwin-xfree/attachments/20090128/a0522953/attachment.c>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: semaphore_leak.fix.patch
URL: <http://cygwin.com/pipermail/cygwin-xfree/attachments/20090128/a0522953/attachment.ksh>
-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


More information about the Cygwin-xfree mailing list