https://bugzilla.novell.com/show_bug.cgi?id=436775


           Summary: LDAP Connect throws: Connection.freeWriteSemaphore(-2):
                    semaphore not owned by any thread
           Product: Mono: Class Libraries
           Version: 1.9
          Platform: x86-64
        OS/Version: Ubuntu
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: CORLIB
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]
         QAContact: [email protected]
          Found By: DeveloperNet


Created an attachment (id=246431)
 --> (https://bugzilla.novell.com/attachment.cgi?id=246431)
Patch for the bug

When a connection is refused by an LDAP server the 
Novell.Directory.Ldap.LdapConnection throws a System.Exception with "semaphore
not owned by any thread". This is unrelated to the real error, which should be
a connection refused. 

Looking at the code in mono, it actually should throw an "LdapException",
however, the freeWriteSemaphore method is called twice in a row, once in the
catch block, and then afterwards again in the finally block. Which causes the
semaphore to be freed twice, which causes the unwanted "semaphore not owned by
any thread".

Unit test and patch attached. The duplicate freeWriteSempaphore call is removed
as the method is allready executed from within the finally block.


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to