c28fcad Bug 604453 - SASL Stress and Server crash: Program quits with the assertion failure in PR_Poll

Authored and Committed by rmeggins 13 years ago
    Bug 604453 - SASL Stress and Server crash: Program quits with the assertion failure in PR_Poll
    
    https://bugzilla.redhat.com/show_bug.cgi?id=604453
    Resolves: bug 604453
    Bug Description: SASL Stress and Server crash: Program quits with the assertion failure in PR_Poll
    Reviewed by: nhosoi (Thanks!)
    Branch: Directory_Server_8_2_Branch
    Fix Description: When the server pushes the SASL IO layer on to the connection
    it must do so when there are no other references to the connection.  The only
    way to do this without introducing more locking is to have the saslbind code
    just register the intent to push SASL IO at the next available time.  This
    cannot be done in the sasl bind code (or any operation code for that matter)
    because connection_threadmain() will enable the connection for reading
    (and polling) after reading the PDU and before calling the operation
    function.  Therefore, during the operation function, the connection may be
    being actively polled, so we must not access the conn c_prfd.
    The best place to push the IO layer is in connection_threadmain, after the
    server has notified that there is read ready on the connection, but before
    we have actually attempted to read anything.  At this point,
    connection_threadmain is the only thread that will be accessing the
    connection, and if we push or pop the IO layer before calling the read
    function, we are guaranteed to have the correct IO layer to use.
    The code has been made generic enough to allow for use by the startTLS code
    if the need arises.
    I also added some more locking in the saslbind code, and changed the sasl IO
    code to more closely resemble the way that the NSS code deals with IO
    layer push/pop.
    Platforms tested: RHEL5 x86_64
    Flag Day: no
    Doc impact: no
    
        
file modified
+4 -1
file modified
+44 -19
file modified
+50 -32
file modified
+7 -0