You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Stefan Seelmann (JIRA)" <ji...@apache.org> on 2010/09/20 21:49:33 UTC

[jira] Created: (DIRAPI-30) Sporadic NullPointerException during SASL bind

Sporadic NullPointerException during SASL bind
----------------------------------------------

                 Key: DIRAPI-30
                 URL: https://issues.apache.org/jira/browse/DIRAPI-30
             Project: Directory client API
          Issue Type: Bug
    Affects Versions: 0.2.0
            Reporter: Stefan Seelmann
             Fix For: 0.2.0


There is a sporadic NullPointerException in the SaslBindIT tests. First, it didn't occur on my Mac, but on Linux and Windows CI builds. Now I created a test that binds 1000 times (sequential) with CRAM-MD5, Digest-MD5 and GSSAPI, and I can reproduce the exception on my Mac.

Most time the exception occurs during a GSSAPI bind, but also sometimes during a Digest-MD5 for Cram-MD5 SASL bind.

Here is the thrown exception:

java.lang.NullPointerException
	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindSasl(LdapNetworkConnection.java:3534)
	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindSasl(LdapNetworkConnection.java:3437)
	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1213)
	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1239)
	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1192)
	at org.apache.directory.server.operations.bind.SaslBindIT.testSequentialBinds(SaslBindIT.java:439)


Before the exception is thrown the test hangs for some time. The BindFuture then times out and returns null. Is that a problem with available resources?


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRAPI-30) Sporadic NullPointerException during SASL bind

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRAPI-30?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12912951#action_12912951 ] 

Emmanuel Lecharny commented on DIRAPI-30:
-----------------------------------------

Not necessarilly a MINA bug, but may be a pb with the way we use MINA. Typically, we have a BindResponse which is not completely decoded, but we don't have the remaining bytes yet.

I may have badly handled split messages in the client (if the message is received in more than one piece).

I will investigate this. Hopefully, we can get it working soon.

> Sporadic NullPointerException during SASL bind
> ----------------------------------------------
>
>                 Key: DIRAPI-30
>                 URL: https://issues.apache.org/jira/browse/DIRAPI-30
>             Project: Directory client API
>          Issue Type: Bug
>    Affects Versions: 0.2.0
>            Reporter: Stefan Seelmann
>             Fix For: 0.2.0
>
>
> There is a sporadic NullPointerException in the SaslBindIT tests. First, it didn't occur on my Mac, but on Linux and Windows CI builds. Now I created a test that binds 1000 times (sequential) with CRAM-MD5, Digest-MD5 and GSSAPI, and I can reproduce the exception on my Mac.
> Most time the exception occurs during a GSSAPI bind, but also sometimes during a Digest-MD5 for Cram-MD5 SASL bind.
> Here is the thrown exception:
> java.lang.NullPointerException
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindSasl(LdapNetworkConnection.java:3534)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindSasl(LdapNetworkConnection.java:3437)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1213)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1239)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1192)
> 	at org.apache.directory.server.operations.bind.SaslBindIT.testSequentialBinds(SaslBindIT.java:439)
> Before the exception is thrown the test hangs for some time. The BindFuture then times out and returns null. Is that a problem with available resources?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRAPI-30) Sporadic NullPointerException during SASL bind

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRAPI-30?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12912802#action_12912802 ] 

Emmanuel Lecharny commented on DIRAPI-30:
-----------------------------------------

Debugging with WireShark after having added a hell lots of logs, which at some point disturb the scenario : the more logs you add, the more likely the test to pass !

> Sporadic NullPointerException during SASL bind
> ----------------------------------------------
>
>                 Key: DIRAPI-30
>                 URL: https://issues.apache.org/jira/browse/DIRAPI-30
>             Project: Directory client API
>          Issue Type: Bug
>    Affects Versions: 0.2.0
>            Reporter: Stefan Seelmann
>             Fix For: 0.2.0
>
>
> There is a sporadic NullPointerException in the SaslBindIT tests. First, it didn't occur on my Mac, but on Linux and Windows CI builds. Now I created a test that binds 1000 times (sequential) with CRAM-MD5, Digest-MD5 and GSSAPI, and I can reproduce the exception on my Mac.
> Most time the exception occurs during a GSSAPI bind, but also sometimes during a Digest-MD5 for Cram-MD5 SASL bind.
> Here is the thrown exception:
> java.lang.NullPointerException
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindSasl(LdapNetworkConnection.java:3534)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindSasl(LdapNetworkConnection.java:3437)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1213)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1239)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1192)
> 	at org.apache.directory.server.operations.bind.SaslBindIT.testSequentialBinds(SaslBindIT.java:439)
> Before the exception is thrown the test hangs for some time. The BindFuture then times out and returns null. Is that a problem with available resources?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRAPI-30) Sporadic NullPointerException during SASL bind

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRAPI-30?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12913135#action_12913135 ] 

Emmanuel Lecharny commented on DIRAPI-30:
-----------------------------------------

completely off base. The map is different as the LdapConnection is a new object.

We have to find another reason for the problem...

> Sporadic NullPointerException during SASL bind
> ----------------------------------------------
>
>                 Key: DIRAPI-30
>                 URL: https://issues.apache.org/jira/browse/DIRAPI-30
>             Project: Directory client API
>          Issue Type: Bug
>    Affects Versions: 0.2.0
>            Reporter: Stefan Seelmann
>             Fix For: 0.2.0
>
>
> There is a sporadic NullPointerException in the SaslBindIT tests. First, it didn't occur on my Mac, but on Linux and Windows CI builds. Now I created a test that binds 1000 times (sequential) with CRAM-MD5, Digest-MD5 and GSSAPI, and I can reproduce the exception on my Mac.
> Most time the exception occurs during a GSSAPI bind, but also sometimes during a Digest-MD5 for Cram-MD5 SASL bind.
> Here is the thrown exception:
> java.lang.NullPointerException
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindSasl(LdapNetworkConnection.java:3534)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindSasl(LdapNetworkConnection.java:3437)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1213)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1239)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1192)
> 	at org.apache.directory.server.operations.bind.SaslBindIT.testSequentialBinds(SaslBindIT.java:439)
> Before the exception is thrown the test hangs for some time. The BindFuture then times out and returns null. Is that a problem with available resources?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRAPI-30) Sporadic NullPointerException during SASL bind

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRAPI-30?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12912913#action_12912913 ] 

Emmanuel Lecharny commented on DIRAPI-30:
-----------------------------------------

Sounds to me like a bug in MINA : we never receive any byte to decode...

Damn it !

> Sporadic NullPointerException during SASL bind
> ----------------------------------------------
>
>                 Key: DIRAPI-30
>                 URL: https://issues.apache.org/jira/browse/DIRAPI-30
>             Project: Directory client API
>          Issue Type: Bug
>    Affects Versions: 0.2.0
>            Reporter: Stefan Seelmann
>             Fix For: 0.2.0
>
>
> There is a sporadic NullPointerException in the SaslBindIT tests. First, it didn't occur on my Mac, but on Linux and Windows CI builds. Now I created a test that binds 1000 times (sequential) with CRAM-MD5, Digest-MD5 and GSSAPI, and I can reproduce the exception on my Mac.
> Most time the exception occurs during a GSSAPI bind, but also sometimes during a Digest-MD5 for Cram-MD5 SASL bind.
> Here is the thrown exception:
> java.lang.NullPointerException
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindSasl(LdapNetworkConnection.java:3534)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindSasl(LdapNetworkConnection.java:3437)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1213)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1239)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1192)
> 	at org.apache.directory.server.operations.bind.SaslBindIT.testSequentialBinds(SaslBindIT.java:439)
> Before the exception is thrown the test hangs for some time. The BindFuture then times out and returns null. Is that a problem with available resources?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRAPI-30) Sporadic NullPointerException during SASL bind

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRAPI-30?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12913117#action_12913117 ] 

Emmanuel Lecharny commented on DIRAPI-30:
-----------------------------------------

Seems like the issue is due to the fact that we don't wait until the connection is fully closed before starting a new connection :

- start connection
- send a bindRequest ( the futureMaps is being fed with <messageId, bindFuture> )
- received the bindResponse
- get the bindFuture from the futureMaps, then close the session
- start another connection
- send a bindRequest ( the futureMaps is being fed with <messageId, bindFuture> )
- the sessionClosed() event is *now* being received, and it does :
    public void sessionClosed( IoSession session ) throws Exception
    {
        ...
        clearMaps();
        ...

which clear the futureMaps
- then the messageReceived() event is being processed, and tries to read the bindFuture from the map, but as it has been cleaned, we don't find anything => bug !

> Sporadic NullPointerException during SASL bind
> ----------------------------------------------
>
>                 Key: DIRAPI-30
>                 URL: https://issues.apache.org/jira/browse/DIRAPI-30
>             Project: Directory client API
>          Issue Type: Bug
>    Affects Versions: 0.2.0
>            Reporter: Stefan Seelmann
>             Fix For: 0.2.0
>
>
> There is a sporadic NullPointerException in the SaslBindIT tests. First, it didn't occur on my Mac, but on Linux and Windows CI builds. Now I created a test that binds 1000 times (sequential) with CRAM-MD5, Digest-MD5 and GSSAPI, and I can reproduce the exception on my Mac.
> Most time the exception occurs during a GSSAPI bind, but also sometimes during a Digest-MD5 for Cram-MD5 SASL bind.
> Here is the thrown exception:
> java.lang.NullPointerException
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindSasl(LdapNetworkConnection.java:3534)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindSasl(LdapNetworkConnection.java:3437)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1213)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1239)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1192)
> 	at org.apache.directory.server.operations.bind.SaslBindIT.testSequentialBinds(SaslBindIT.java:439)
> Before the exception is thrown the test hangs for some time. The BindFuture then times out and returns null. Is that a problem with available resources?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRAPI-30) Sporadic NullPointerException during SASL bind

Posted by "Stefan Seelmann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRAPI-30?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12912678#action_12912678 ] 

Stefan Seelmann commented on DIRAPI-30:
---------------------------------------

Committed test here:
  http://svn.apache.org/viewvc?rev=999091&view=rev


> Sporadic NullPointerException during SASL bind
> ----------------------------------------------
>
>                 Key: DIRAPI-30
>                 URL: https://issues.apache.org/jira/browse/DIRAPI-30
>             Project: Directory client API
>          Issue Type: Bug
>    Affects Versions: 0.2.0
>            Reporter: Stefan Seelmann
>             Fix For: 0.2.0
>
>
> There is a sporadic NullPointerException in the SaslBindIT tests. First, it didn't occur on my Mac, but on Linux and Windows CI builds. Now I created a test that binds 1000 times (sequential) with CRAM-MD5, Digest-MD5 and GSSAPI, and I can reproduce the exception on my Mac.
> Most time the exception occurs during a GSSAPI bind, but also sometimes during a Digest-MD5 for Cram-MD5 SASL bind.
> Here is the thrown exception:
> java.lang.NullPointerException
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindSasl(LdapNetworkConnection.java:3534)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindSasl(LdapNetworkConnection.java:3437)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1213)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1239)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1192)
> 	at org.apache.directory.server.operations.bind.SaslBindIT.testSequentialBinds(SaslBindIT.java:439)
> Before the exception is thrown the test hangs for some time. The BindFuture then times out and returns null. Is that a problem with available resources?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DIRAPI-30) Sporadic NullPointerException during SASL bind

Posted by "Kiran Ayyagari (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRAPI-30?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kiran Ayyagari updated DIRAPI-30:
---------------------------------

    Attachment: dirapi30.patch

Looks like a reused bind request message ID while doing the SASL bind negotiation is causing the issue here.
I have tried with a fix, which increments the bind request message ID during SASL negotiation and the test passes.
However the fix increments the message id several times from what user sees as a single operation (i.e bind)

Note: apply the patch from within the ldap-client-api module

> Sporadic NullPointerException during SASL bind
> ----------------------------------------------
>
>                 Key: DIRAPI-30
>                 URL: https://issues.apache.org/jira/browse/DIRAPI-30
>             Project: Directory client API
>          Issue Type: Bug
>    Affects Versions: 0.2.0
>            Reporter: Stefan Seelmann
>             Fix For: 0.2.0
>
>         Attachments: dirapi30.patch
>
>
> There is a sporadic NullPointerException in the SaslBindIT tests. First, it didn't occur on my Mac, but on Linux and Windows CI builds. Now I created a test that binds 1000 times (sequential) with CRAM-MD5, Digest-MD5 and GSSAPI, and I can reproduce the exception on my Mac.
> Most time the exception occurs during a GSSAPI bind, but also sometimes during a Digest-MD5 for Cram-MD5 SASL bind.
> Here is the thrown exception:
> java.lang.NullPointerException
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindSasl(LdapNetworkConnection.java:3534)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindSasl(LdapNetworkConnection.java:3437)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1213)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1239)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1192)
> 	at org.apache.directory.server.operations.bind.SaslBindIT.testSequentialBinds(SaslBindIT.java:439)
> Before the exception is thrown the test hangs for some time. The BindFuture then times out and returns null. Is that a problem with available resources?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRAPI-30) Sporadic NullPointerException during SASL bind

Posted by "Stefan Seelmann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRAPI-30?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12913153#action_12913153 ] 

Stefan Seelmann commented on DIRAPI-30:
---------------------------------------

Is this a global map or per connection?

> Sporadic NullPointerException during SASL bind
> ----------------------------------------------
>
>                 Key: DIRAPI-30
>                 URL: https://issues.apache.org/jira/browse/DIRAPI-30
>             Project: Directory client API
>          Issue Type: Bug
>    Affects Versions: 0.2.0
>            Reporter: Stefan Seelmann
>             Fix For: 0.2.0
>
>
> There is a sporadic NullPointerException in the SaslBindIT tests. First, it didn't occur on my Mac, but on Linux and Windows CI builds. Now I created a test that binds 1000 times (sequential) with CRAM-MD5, Digest-MD5 and GSSAPI, and I can reproduce the exception on my Mac.
> Most time the exception occurs during a GSSAPI bind, but also sometimes during a Digest-MD5 for Cram-MD5 SASL bind.
> Here is the thrown exception:
> java.lang.NullPointerException
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindSasl(LdapNetworkConnection.java:3534)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindSasl(LdapNetworkConnection.java:3437)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1213)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1239)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1192)
> 	at org.apache.directory.server.operations.bind.SaslBindIT.testSequentialBinds(SaslBindIT.java:439)
> Before the exception is thrown the test hangs for some time. The BindFuture then times out and returns null. Is that a problem with available resources?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRAPI-30) Sporadic NullPointerException during SASL bind

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRAPI-30?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12912711#action_12912711 ] 

Emmanuel Lecharny commented on DIRAPI-30:
-----------------------------------------

I checked the code two days ago, and the NPE is due to the fact that the response is null when  the timeout is reached.

We have first to handle this case on the client side, to avoid the NPE, and also to determinate why we wait such a long time we get a timeout instead of a response.

Thanks for the test, I'll investigate it.

> Sporadic NullPointerException during SASL bind
> ----------------------------------------------
>
>                 Key: DIRAPI-30
>                 URL: https://issues.apache.org/jira/browse/DIRAPI-30
>             Project: Directory client API
>          Issue Type: Bug
>    Affects Versions: 0.2.0
>            Reporter: Stefan Seelmann
>             Fix For: 0.2.0
>
>
> There is a sporadic NullPointerException in the SaslBindIT tests. First, it didn't occur on my Mac, but on Linux and Windows CI builds. Now I created a test that binds 1000 times (sequential) with CRAM-MD5, Digest-MD5 and GSSAPI, and I can reproduce the exception on my Mac.
> Most time the exception occurs during a GSSAPI bind, but also sometimes during a Digest-MD5 for Cram-MD5 SASL bind.
> Here is the thrown exception:
> java.lang.NullPointerException
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindSasl(LdapNetworkConnection.java:3534)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindSasl(LdapNetworkConnection.java:3437)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1213)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1239)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1192)
> 	at org.apache.directory.server.operations.bind.SaslBindIT.testSequentialBinds(SaslBindIT.java:439)
> Before the exception is thrown the test hangs for some time. The BindFuture then times out and returns null. Is that a problem with available resources?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRAPI-30) Sporadic NullPointerException during SASL bind

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRAPI-30?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12912890#action_12912890 ] 

Emmanuel Lecharny commented on DIRAPI-30:
-----------------------------------------

The problem seems to be on the client side. The last packet I see being sent from the server is a SASL bind Response, containing :
30 43 (LdapMessage)
  02 01 01 (Message Nb 1)
  61 3e (BindResponse)
    0a 01 0e (SASL bind in progress)
    04 00 (matchedDN)
    04 00 (errorMessage)
    87 35  (SASL credentials)
      60 33 (credentials)
        06 09 
          2a 86 48 86 f7 12 01 02 02 (OID 1.2.840.113554.1.2.2 KRB5)
          02 01 (krb5_tok_id : KRB5 GSS Wrap)
          00  00 (krb5_sgn_alg : DES MAC DS5)
          ff ff ff ff (krb5_seal_alg : none)
          13 37 1c 13 2f 2a 73 e6 (krb5_snd_seq)
          a3 ff 10  48 e2 fb c0 8e (krb5_sgn_cksum)
          70 f6 26 2c 2c 76 c4 03 (krb5confounder)


(Those bytes have been read with wireshark, so they actually have been sent by the server)

Let's see what's wrong on the client side...


> Sporadic NullPointerException during SASL bind
> ----------------------------------------------
>
>                 Key: DIRAPI-30
>                 URL: https://issues.apache.org/jira/browse/DIRAPI-30
>             Project: Directory client API
>          Issue Type: Bug
>    Affects Versions: 0.2.0
>            Reporter: Stefan Seelmann
>             Fix For: 0.2.0
>
>
> There is a sporadic NullPointerException in the SaslBindIT tests. First, it didn't occur on my Mac, but on Linux and Windows CI builds. Now I created a test that binds 1000 times (sequential) with CRAM-MD5, Digest-MD5 and GSSAPI, and I can reproduce the exception on my Mac.
> Most time the exception occurs during a GSSAPI bind, but also sometimes during a Digest-MD5 for Cram-MD5 SASL bind.
> Here is the thrown exception:
> java.lang.NullPointerException
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindSasl(LdapNetworkConnection.java:3534)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindSasl(LdapNetworkConnection.java:3437)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1213)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1239)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1192)
> 	at org.apache.directory.server.operations.bind.SaslBindIT.testSequentialBinds(SaslBindIT.java:439)
> Before the exception is thrown the test hangs for some time. The BindFuture then times out and returns null. Is that a problem with available resources?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRAPI-30) Sporadic NullPointerException during SASL bind

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRAPI-30?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12912770#action_12912770 ] 

Emmanuel Lecharny commented on DIRAPI-30:
-----------------------------------------

This is really strange. I get an error after some iterations (as expected,, hmmm), and as I added some logs, here is what I get :

...
try 576
SERVER : SASL bind request :     BindRequest
        Version : '3'
        Name : 'uid=hnelson,ou=users,dc=example,dc=com'
        Sasl credentials
            Mechanism :'GSSAPI'
            Credentials : (omitted-for-safety)
SERVER : SASL bind response challenge:     BindResponse
        Ldap Result
            Result code : (SASL_BIND_IN_PROGRESS) saslBindInProgress -- new
            Matched DN : 'null'
            Error message : 'null'
        Server sasl credentials : ''

CLIENT : ----------------> response =     BindResponse
        Ldap Result
            Result code : (SASL_BIND_IN_PROGRESS) saslBindInProgress -- new
            Matched DN : ''
            Error message : ''
        Server sasl credentials : ''

SERVER : SASL bind request :     BindRequest
        Version : '3'
        Name : 'uid=hnelson,ou=users,dc=example,dc=com'
        Sasl credentials
            Mechanism :'GSSAPI'
            Credentials : (omitted-for-safety)
SERVER : SASL bind response challenge:     BindResponse
        Ldap Result
            Result code : (SASL_BIND_IN_PROGRESS) saslBindInProgress -- new
            Matched DN : 'null'
            Error message : 'null'
        Server sasl credentials : '0x60 0x33 0x06 0x09 0x2A 0x86 0x48 0x86 0xF7 0x12 0x01 0x02 0x02 0x02 0x01 0x00 0x00 0xFF 0xFF 0xFF 0xFF 0xFD 0x59 0x76 0xBA 0xEB 0x4D 0x0A 0x17 0xCF 0x09 0x3C 0xF6 0x3D 0x70 0x8D 0x7B 0xC7 0xCE 0x13 0xA5 0x9E 0x05 0xC9 0x77 0x07 0x01 0x00 0x00 0x04 0x04 0x04 0x04 '

and we never get the message on the client side. Now, the problem is to determinate if the problem is on the encoding part, the decoding part of somewhere deep in MINA.

> Sporadic NullPointerException during SASL bind
> ----------------------------------------------
>
>                 Key: DIRAPI-30
>                 URL: https://issues.apache.org/jira/browse/DIRAPI-30
>             Project: Directory client API
>          Issue Type: Bug
>    Affects Versions: 0.2.0
>            Reporter: Stefan Seelmann
>             Fix For: 0.2.0
>
>
> There is a sporadic NullPointerException in the SaslBindIT tests. First, it didn't occur on my Mac, but on Linux and Windows CI builds. Now I created a test that binds 1000 times (sequential) with CRAM-MD5, Digest-MD5 and GSSAPI, and I can reproduce the exception on my Mac.
> Most time the exception occurs during a GSSAPI bind, but also sometimes during a Digest-MD5 for Cram-MD5 SASL bind.
> Here is the thrown exception:
> java.lang.NullPointerException
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindSasl(LdapNetworkConnection.java:3534)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindSasl(LdapNetworkConnection.java:3437)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1213)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1239)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1192)
> 	at org.apache.directory.server.operations.bind.SaslBindIT.testSequentialBinds(SaslBindIT.java:439)
> Before the exception is thrown the test hangs for some time. The BindFuture then times out and returns null. Is that a problem with available resources?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (DIRAPI-30) Sporadic NullPointerException during SASL bind

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRAPI-30?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Lecharny resolved DIRAPI-30.
-------------------------------------

    Resolution: Fixed

Applied the fix from Kiran in http://svn.apache.org/viewvc?rev=999888&view=rev

great work, Kiran !


> Sporadic NullPointerException during SASL bind
> ----------------------------------------------
>
>                 Key: DIRAPI-30
>                 URL: https://issues.apache.org/jira/browse/DIRAPI-30
>             Project: Directory client API
>          Issue Type: Bug
>    Affects Versions: 0.2.0
>            Reporter: Stefan Seelmann
>             Fix For: 0.2.0
>
>         Attachments: dirapi30.patch
>
>
> There is a sporadic NullPointerException in the SaslBindIT tests. First, it didn't occur on my Mac, but on Linux and Windows CI builds. Now I created a test that binds 1000 times (sequential) with CRAM-MD5, Digest-MD5 and GSSAPI, and I can reproduce the exception on my Mac.
> Most time the exception occurs during a GSSAPI bind, but also sometimes during a Digest-MD5 for Cram-MD5 SASL bind.
> Here is the thrown exception:
> java.lang.NullPointerException
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindSasl(LdapNetworkConnection.java:3534)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindSasl(LdapNetworkConnection.java:3437)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1213)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1239)
> 	at org.apache.directory.ldap.client.api.LdapNetworkConnection.bindDigestMd5(LdapNetworkConnection.java:1192)
> 	at org.apache.directory.server.operations.bind.SaslBindIT.testSequentialBinds(SaslBindIT.java:439)
> Before the exception is thrown the test hangs for some time. The BindFuture then times out and returns null. Is that a problem with available resources?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.