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 2008/05/28 00:28:59 UTC

[jira] Created: (DIRSERVER-1180) NPE and hanging search request when using a filter with empty substring sequence

NPE and hanging search request when using a filter with empty substring sequence
--------------------------------------------------------------------------------

                 Key: DIRSERVER-1180
                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1180
             Project: Directory ApacheDS
          Issue Type: Bug
    Affects Versions: 1.5.2, 1.5.3
            Reporter: Stefan Seelmann
            Priority: Blocker


When starting a search request using the seachfilter (cn=**) the request lasts forever. I testet with JNDI and ldapsearch command. 

Here is the server log:

[00:22:01] ERROR [org.apache.directory.shared.ldap.codec.actions.StoreAnyAction] - The substring any filter is empty
[00:22:01] WARN [org.apache.directory.server.ldap.LdapServer$LdapProtocolHandler] - [/127.0.0.1:47315] Unexpected exception from exceptionCaught handler.
java.lang.NullPointerException: message
	at org.apache.mina.common.IoFilter$WriteRequest.<init>(IoFilter.java:333)
	at org.apache.mina.common.support.BaseIoSession.write(BaseIoSession.java:177)
	at org.apache.mina.common.support.BaseIoSession.write(BaseIoSession.java:168)
	at org.apache.directory.server.ldap.LdapServer$LdapProtocolHandler.exceptionCaught(LdapServer.java:1104)
	at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.exceptionCaught(AbstractIoFilterChain.java:564)
	at org.apache.mina.common.support.AbstractIoFilterChain.callNextExceptionCaught(AbstractIoFilterChain.java:345)
	at org.apache.mina.common.support.AbstractIoFilterChain.access$1000(AbstractIoFilterChain.java:53)
	at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.exceptionCaught(AbstractIoFilterChain.java:643)
	at org.apache.mina.common.IoFilterAdapter.exceptionCaught(IoFilterAdapter.java:75)
	at org.apache.mina.common.support.AbstractIoFilterChain.callNextExceptionCaught(AbstractIoFilterChain.java:345)
	at org.apache.mina.common.support.AbstractIoFilterChain.access$1000(AbstractIoFilterChain.java:53)
	at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.exceptionCaught(AbstractIoFilterChain.java:643)
	at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:224)
	at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:636)


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


[jira] Commented: (DIRSERVER-1180) NPE and hanging search request when using a filter with empty substring sequence

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

Emmanuel Lecharny commented on DIRSERVER-1180:
----------------------------------------------

We have opened another issue for improving the messages. Right now, for 1.5.3, we wanted to fix this error, as it was bocking.

> NPE and hanging search request when using a filter with empty substring sequence
> --------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1180
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1180
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.3, 1.5.2
>            Reporter: Stefan Seelmann
>            Assignee: Emmanuel Lecharny
>            Priority: Blocker
>             Fix For: 1.5.3
>
>
> When starting a search request using the seachfilter (cn=**) the request lasts forever. I testet with JNDI and ldapsearch command. 
> Here is the server log:
> [00:22:01] ERROR [org.apache.directory.shared.ldap.codec.actions.StoreAnyAction] - The substring any filter is empty
> [00:22:01] WARN [org.apache.directory.server.ldap.LdapServer$LdapProtocolHandler] - [/127.0.0.1:47315] Unexpected exception from exceptionCaught handler.
> java.lang.NullPointerException: message
> 	at org.apache.mina.common.IoFilter$WriteRequest.<init>(IoFilter.java:333)
> 	at org.apache.mina.common.support.BaseIoSession.write(BaseIoSession.java:177)
> 	at org.apache.mina.common.support.BaseIoSession.write(BaseIoSession.java:168)
> 	at org.apache.directory.server.ldap.LdapServer$LdapProtocolHandler.exceptionCaught(LdapServer.java:1104)
> 	at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.exceptionCaught(AbstractIoFilterChain.java:564)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.callNextExceptionCaught(AbstractIoFilterChain.java:345)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.access$1000(AbstractIoFilterChain.java:53)
> 	at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.exceptionCaught(AbstractIoFilterChain.java:643)
> 	at org.apache.mina.common.IoFilterAdapter.exceptionCaught(IoFilterAdapter.java:75)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.callNextExceptionCaught(AbstractIoFilterChain.java:345)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.access$1000(AbstractIoFilterChain.java:53)
> 	at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.exceptionCaught(AbstractIoFilterChain.java:643)
> 	at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:224)
> 	at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> 	at java.lang.Thread.run(Thread.java:636)

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


[jira] Assigned: (DIRSERVER-1180) NPE and hanging search request when using a filter with empty substring sequence

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

Alex Karasulu reassigned DIRSERVER-1180:
----------------------------------------

    Assignee: Alex Karasulu

> NPE and hanging search request when using a filter with empty substring sequence
> --------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1180
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1180
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.3, 1.5.2
>            Reporter: Stefan Seelmann
>            Assignee: Alex Karasulu
>            Priority: Blocker
>             Fix For: 1.5.3
>
>
> When starting a search request using the seachfilter (cn=**) the request lasts forever. I testet with JNDI and ldapsearch command. 
> Here is the server log:
> [00:22:01] ERROR [org.apache.directory.shared.ldap.codec.actions.StoreAnyAction] - The substring any filter is empty
> [00:22:01] WARN [org.apache.directory.server.ldap.LdapServer$LdapProtocolHandler] - [/127.0.0.1:47315] Unexpected exception from exceptionCaught handler.
> java.lang.NullPointerException: message
> 	at org.apache.mina.common.IoFilter$WriteRequest.<init>(IoFilter.java:333)
> 	at org.apache.mina.common.support.BaseIoSession.write(BaseIoSession.java:177)
> 	at org.apache.mina.common.support.BaseIoSession.write(BaseIoSession.java:168)
> 	at org.apache.directory.server.ldap.LdapServer$LdapProtocolHandler.exceptionCaught(LdapServer.java:1104)
> 	at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.exceptionCaught(AbstractIoFilterChain.java:564)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.callNextExceptionCaught(AbstractIoFilterChain.java:345)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.access$1000(AbstractIoFilterChain.java:53)
> 	at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.exceptionCaught(AbstractIoFilterChain.java:643)
> 	at org.apache.mina.common.IoFilterAdapter.exceptionCaught(IoFilterAdapter.java:75)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.callNextExceptionCaught(AbstractIoFilterChain.java:345)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.access$1000(AbstractIoFilterChain.java:53)
> 	at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.exceptionCaught(AbstractIoFilterChain.java:643)
> 	at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:224)
> 	at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> 	at java.lang.Thread.run(Thread.java:636)

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


[jira] Assigned: (DIRSERVER-1180) NPE and hanging search request when using a filter with empty substring sequence

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

Alex Karasulu reassigned DIRSERVER-1180:
----------------------------------------

    Assignee: Emmanuel Lecharny  (was: Alex Karasulu)

Found the problem and it persists.  I have a few grips here:

    (1) the decoder code should be throwing or taking us out with an exception which causes normal error handling where the LDAP server tells the client that it encountered a protocol error due to the request using a proper healthy response.
    (2) the decoder and ASN.1 handling code is so hard to comprehend and maintain that I would have to spend at least a day analyzing the code to figure out how to fix this problem properly and the fix is not trivial

Considering #2 I've given up and chosen to continue processing as many bugs as I can as fast as I can while delegating this one to Emmanuel.  But this situation needs to be fixed so we can all easily work together on this region of the code.  Please help us get here Emmanuel.

As for the recommended fix:

    Cause string prep functionality to condense sequence of '* ' asterisk characters into a single character unless of course these are escaped.  Then, after this, condensing operation, a determination must be made as to whether the assertion is still a substring expression or an existence expression.  This should not be hard and requires only one more character read ahead to determine: must find out if the assertion ends after the last asterisk, if not then it's substring, if so it's an existence assertion. 

    Looking at the decoder code this can be done but you need to take some care when encountering an asterisk after the '=' inside the assertion before deciding to determine what kind of filter assertion node this is.  That's when the condensation of a series of '*' to a single asterisk must be performed.


> NPE and hanging search request when using a filter with empty substring sequence
> --------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1180
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1180
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.3, 1.5.2
>            Reporter: Stefan Seelmann
>            Assignee: Emmanuel Lecharny
>            Priority: Blocker
>             Fix For: 1.5.3
>
>
> When starting a search request using the seachfilter (cn=**) the request lasts forever. I testet with JNDI and ldapsearch command. 
> Here is the server log:
> [00:22:01] ERROR [org.apache.directory.shared.ldap.codec.actions.StoreAnyAction] - The substring any filter is empty
> [00:22:01] WARN [org.apache.directory.server.ldap.LdapServer$LdapProtocolHandler] - [/127.0.0.1:47315] Unexpected exception from exceptionCaught handler.
> java.lang.NullPointerException: message
> 	at org.apache.mina.common.IoFilter$WriteRequest.<init>(IoFilter.java:333)
> 	at org.apache.mina.common.support.BaseIoSession.write(BaseIoSession.java:177)
> 	at org.apache.mina.common.support.BaseIoSession.write(BaseIoSession.java:168)
> 	at org.apache.directory.server.ldap.LdapServer$LdapProtocolHandler.exceptionCaught(LdapServer.java:1104)
> 	at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.exceptionCaught(AbstractIoFilterChain.java:564)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.callNextExceptionCaught(AbstractIoFilterChain.java:345)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.access$1000(AbstractIoFilterChain.java:53)
> 	at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.exceptionCaught(AbstractIoFilterChain.java:643)
> 	at org.apache.mina.common.IoFilterAdapter.exceptionCaught(IoFilterAdapter.java:75)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.callNextExceptionCaught(AbstractIoFilterChain.java:345)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.access$1000(AbstractIoFilterChain.java:53)
> 	at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.exceptionCaught(AbstractIoFilterChain.java:643)
> 	at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:224)
> 	at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> 	at java.lang.Thread.run(Thread.java:636)

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


[jira] Updated: (DIRSERVER-1180) NPE and hanging search request when using a filter with empty substring sequence

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

Alex Karasulu updated DIRSERVER-1180:
-------------------------------------

    Fix Version/s: 1.5.3

I wonder if we fixed this.  I think Emmanuel may have.  Anyways we need to confirm this and fix quick in 1.5.3.

> NPE and hanging search request when using a filter with empty substring sequence
> --------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1180
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1180
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.3, 1.5.2
>            Reporter: Stefan Seelmann
>            Priority: Blocker
>             Fix For: 1.5.3
>
>
> When starting a search request using the seachfilter (cn=**) the request lasts forever. I testet with JNDI and ldapsearch command. 
> Here is the server log:
> [00:22:01] ERROR [org.apache.directory.shared.ldap.codec.actions.StoreAnyAction] - The substring any filter is empty
> [00:22:01] WARN [org.apache.directory.server.ldap.LdapServer$LdapProtocolHandler] - [/127.0.0.1:47315] Unexpected exception from exceptionCaught handler.
> java.lang.NullPointerException: message
> 	at org.apache.mina.common.IoFilter$WriteRequest.<init>(IoFilter.java:333)
> 	at org.apache.mina.common.support.BaseIoSession.write(BaseIoSession.java:177)
> 	at org.apache.mina.common.support.BaseIoSession.write(BaseIoSession.java:168)
> 	at org.apache.directory.server.ldap.LdapServer$LdapProtocolHandler.exceptionCaught(LdapServer.java:1104)
> 	at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.exceptionCaught(AbstractIoFilterChain.java:564)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.callNextExceptionCaught(AbstractIoFilterChain.java:345)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.access$1000(AbstractIoFilterChain.java:53)
> 	at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.exceptionCaught(AbstractIoFilterChain.java:643)
> 	at org.apache.mina.common.IoFilterAdapter.exceptionCaught(IoFilterAdapter.java:75)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.callNextExceptionCaught(AbstractIoFilterChain.java:345)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.access$1000(AbstractIoFilterChain.java:53)
> 	at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.exceptionCaught(AbstractIoFilterChain.java:643)
> 	at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:224)
> 	at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> 	at java.lang.Thread.run(Thread.java:636)

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


[jira] Closed: (DIRSERVER-1180) NPE and hanging search request when using a filter with empty substring sequence

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

Stefan Seelmann closed DIRSERVER-1180.
--------------------------------------


> NPE and hanging search request when using a filter with empty substring sequence
> --------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1180
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1180
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.3, 1.5.2
>            Reporter: Stefan Seelmann
>            Assignee: Emmanuel Lecharny
>            Priority: Blocker
>             Fix For: 1.5.3
>
>
> When starting a search request using the seachfilter (cn=**) the request lasts forever. I testet with JNDI and ldapsearch command. 
> Here is the server log:
> [00:22:01] ERROR [org.apache.directory.shared.ldap.codec.actions.StoreAnyAction] - The substring any filter is empty
> [00:22:01] WARN [org.apache.directory.server.ldap.LdapServer$LdapProtocolHandler] - [/127.0.0.1:47315] Unexpected exception from exceptionCaught handler.
> java.lang.NullPointerException: message
> 	at org.apache.mina.common.IoFilter$WriteRequest.<init>(IoFilter.java:333)
> 	at org.apache.mina.common.support.BaseIoSession.write(BaseIoSession.java:177)
> 	at org.apache.mina.common.support.BaseIoSession.write(BaseIoSession.java:168)
> 	at org.apache.directory.server.ldap.LdapServer$LdapProtocolHandler.exceptionCaught(LdapServer.java:1104)
> 	at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.exceptionCaught(AbstractIoFilterChain.java:564)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.callNextExceptionCaught(AbstractIoFilterChain.java:345)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.access$1000(AbstractIoFilterChain.java:53)
> 	at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.exceptionCaught(AbstractIoFilterChain.java:643)
> 	at org.apache.mina.common.IoFilterAdapter.exceptionCaught(IoFilterAdapter.java:75)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.callNextExceptionCaught(AbstractIoFilterChain.java:345)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.access$1000(AbstractIoFilterChain.java:53)
> 	at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.exceptionCaught(AbstractIoFilterChain.java:643)
> 	at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:224)
> 	at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> 	at java.lang.Thread.run(Thread.java:636)

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


[jira] Resolved: (DIRSERVER-1180) NPE and hanging search request when using a filter with empty substring sequence

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

Emmanuel Lecharny resolved DIRSERVER-1180.
------------------------------------------

    Resolution: Fixed

Fixed in http://svn.apache.org/viewvc?rev=674863&view=rev

We now throw a ProtocolError, instead of writing an empty message back to the client.

> NPE and hanging search request when using a filter with empty substring sequence
> --------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1180
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1180
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.3, 1.5.2
>            Reporter: Stefan Seelmann
>            Assignee: Emmanuel Lecharny
>            Priority: Blocker
>             Fix For: 1.5.3
>
>
> When starting a search request using the seachfilter (cn=**) the request lasts forever. I testet with JNDI and ldapsearch command. 
> Here is the server log:
> [00:22:01] ERROR [org.apache.directory.shared.ldap.codec.actions.StoreAnyAction] - The substring any filter is empty
> [00:22:01] WARN [org.apache.directory.server.ldap.LdapServer$LdapProtocolHandler] - [/127.0.0.1:47315] Unexpected exception from exceptionCaught handler.
> java.lang.NullPointerException: message
> 	at org.apache.mina.common.IoFilter$WriteRequest.<init>(IoFilter.java:333)
> 	at org.apache.mina.common.support.BaseIoSession.write(BaseIoSession.java:177)
> 	at org.apache.mina.common.support.BaseIoSession.write(BaseIoSession.java:168)
> 	at org.apache.directory.server.ldap.LdapServer$LdapProtocolHandler.exceptionCaught(LdapServer.java:1104)
> 	at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.exceptionCaught(AbstractIoFilterChain.java:564)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.callNextExceptionCaught(AbstractIoFilterChain.java:345)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.access$1000(AbstractIoFilterChain.java:53)
> 	at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.exceptionCaught(AbstractIoFilterChain.java:643)
> 	at org.apache.mina.common.IoFilterAdapter.exceptionCaught(IoFilterAdapter.java:75)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.callNextExceptionCaught(AbstractIoFilterChain.java:345)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.access$1000(AbstractIoFilterChain.java:53)
> 	at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.exceptionCaught(AbstractIoFilterChain.java:643)
> 	at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:224)
> 	at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> 	at java.lang.Thread.run(Thread.java:636)

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


[jira] Commented: (DIRSERVER-1180) NPE and hanging search request when using a filter with empty substring sequence

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

Stefan Seelmann commented on DIRSERVER-1180:
--------------------------------------------

Thanks for fixing this. Now I receive an extended response with protocol error 2 and message "The server will disconnect". I'm not sure if it would be possible to receive a nicer error message.

> NPE and hanging search request when using a filter with empty substring sequence
> --------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1180
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1180
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.3, 1.5.2
>            Reporter: Stefan Seelmann
>            Assignee: Emmanuel Lecharny
>            Priority: Blocker
>             Fix For: 1.5.3
>
>
> When starting a search request using the seachfilter (cn=**) the request lasts forever. I testet with JNDI and ldapsearch command. 
> Here is the server log:
> [00:22:01] ERROR [org.apache.directory.shared.ldap.codec.actions.StoreAnyAction] - The substring any filter is empty
> [00:22:01] WARN [org.apache.directory.server.ldap.LdapServer$LdapProtocolHandler] - [/127.0.0.1:47315] Unexpected exception from exceptionCaught handler.
> java.lang.NullPointerException: message
> 	at org.apache.mina.common.IoFilter$WriteRequest.<init>(IoFilter.java:333)
> 	at org.apache.mina.common.support.BaseIoSession.write(BaseIoSession.java:177)
> 	at org.apache.mina.common.support.BaseIoSession.write(BaseIoSession.java:168)
> 	at org.apache.directory.server.ldap.LdapServer$LdapProtocolHandler.exceptionCaught(LdapServer.java:1104)
> 	at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.exceptionCaught(AbstractIoFilterChain.java:564)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.callNextExceptionCaught(AbstractIoFilterChain.java:345)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.access$1000(AbstractIoFilterChain.java:53)
> 	at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.exceptionCaught(AbstractIoFilterChain.java:643)
> 	at org.apache.mina.common.IoFilterAdapter.exceptionCaught(IoFilterAdapter.java:75)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.callNextExceptionCaught(AbstractIoFilterChain.java:345)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.access$1000(AbstractIoFilterChain.java:53)
> 	at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.exceptionCaught(AbstractIoFilterChain.java:643)
> 	at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:224)
> 	at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> 	at java.lang.Thread.run(Thread.java:636)

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


[jira] Commented: (DIRSERVER-1180) NPE and hanging search request when using a filter with empty substring sequence

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

Emmanuel Lecharny commented on DIRSERVER-1180:
----------------------------------------------

After having debugged the sserver, here is what is happening :

The PDU is incorrect. It contains those bytes :
A4 06  // A substring filter, length 6
  04 02 C N // The attribute being filtered (cn)
  30 00  // No initial, no Any and no final. This is totally wrong.

1) JNDI don't parser invalid filters correctly, so it sends bad PDU
2) The bad PDU is correctly handled by the decoder, which corretcly throws a DecodingException
3) The LdapServer ProtocolHandler exceptionCautgh method is supposed to send back a message

This is where things get tricky. The response iss null, so MINA does not send back any kind of message, and the client is waiting forever for a response.

The correct way to handle this case is to close the session, sending back a ProtocolError message (as requested by the LDAP protocl, when the PDU is incorrect).

> NPE and hanging search request when using a filter with empty substring sequence
> --------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1180
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1180
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.3, 1.5.2
>            Reporter: Stefan Seelmann
>            Assignee: Emmanuel Lecharny
>            Priority: Blocker
>             Fix For: 1.5.3
>
>
> When starting a search request using the seachfilter (cn=**) the request lasts forever. I testet with JNDI and ldapsearch command. 
> Here is the server log:
> [00:22:01] ERROR [org.apache.directory.shared.ldap.codec.actions.StoreAnyAction] - The substring any filter is empty
> [00:22:01] WARN [org.apache.directory.server.ldap.LdapServer$LdapProtocolHandler] - [/127.0.0.1:47315] Unexpected exception from exceptionCaught handler.
> java.lang.NullPointerException: message
> 	at org.apache.mina.common.IoFilter$WriteRequest.<init>(IoFilter.java:333)
> 	at org.apache.mina.common.support.BaseIoSession.write(BaseIoSession.java:177)
> 	at org.apache.mina.common.support.BaseIoSession.write(BaseIoSession.java:168)
> 	at org.apache.directory.server.ldap.LdapServer$LdapProtocolHandler.exceptionCaught(LdapServer.java:1104)
> 	at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.exceptionCaught(AbstractIoFilterChain.java:564)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.callNextExceptionCaught(AbstractIoFilterChain.java:345)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.access$1000(AbstractIoFilterChain.java:53)
> 	at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.exceptionCaught(AbstractIoFilterChain.java:643)
> 	at org.apache.mina.common.IoFilterAdapter.exceptionCaught(IoFilterAdapter.java:75)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.callNextExceptionCaught(AbstractIoFilterChain.java:345)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.access$1000(AbstractIoFilterChain.java:53)
> 	at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.exceptionCaught(AbstractIoFilterChain.java:643)
> 	at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:224)
> 	at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> 	at java.lang.Thread.run(Thread.java:636)

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


[jira] Commented: (DIRSERVER-1180) NPE and hanging search request when using a filter with empty substring sequence

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

Emmanuel Lecharny commented on DIRSERVER-1180:
----------------------------------------------

The test is blocking during the search, but as far as I can say, we don't receive anything on the server side. It seems that we are blocked on the Sun JNDI layer, while trying to parse the (cn=**) string.

I will try to characterize this.

> NPE and hanging search request when using a filter with empty substring sequence
> --------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1180
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1180
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.3, 1.5.2
>            Reporter: Stefan Seelmann
>            Assignee: Emmanuel Lecharny
>            Priority: Blocker
>             Fix For: 1.5.3
>
>
> When starting a search request using the seachfilter (cn=**) the request lasts forever. I testet with JNDI and ldapsearch command. 
> Here is the server log:
> [00:22:01] ERROR [org.apache.directory.shared.ldap.codec.actions.StoreAnyAction] - The substring any filter is empty
> [00:22:01] WARN [org.apache.directory.server.ldap.LdapServer$LdapProtocolHandler] - [/127.0.0.1:47315] Unexpected exception from exceptionCaught handler.
> java.lang.NullPointerException: message
> 	at org.apache.mina.common.IoFilter$WriteRequest.<init>(IoFilter.java:333)
> 	at org.apache.mina.common.support.BaseIoSession.write(BaseIoSession.java:177)
> 	at org.apache.mina.common.support.BaseIoSession.write(BaseIoSession.java:168)
> 	at org.apache.directory.server.ldap.LdapServer$LdapProtocolHandler.exceptionCaught(LdapServer.java:1104)
> 	at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.exceptionCaught(AbstractIoFilterChain.java:564)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.callNextExceptionCaught(AbstractIoFilterChain.java:345)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.access$1000(AbstractIoFilterChain.java:53)
> 	at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.exceptionCaught(AbstractIoFilterChain.java:643)
> 	at org.apache.mina.common.IoFilterAdapter.exceptionCaught(IoFilterAdapter.java:75)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.callNextExceptionCaught(AbstractIoFilterChain.java:345)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.access$1000(AbstractIoFilterChain.java:53)
> 	at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.exceptionCaught(AbstractIoFilterChain.java:643)
> 	at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:224)
> 	at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> 	at java.lang.Thread.run(Thread.java:636)

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


[jira] Commented: (DIRSERVER-1180) NPE and hanging search request when using a filter with empty substring sequence

Posted by "Alex Karasulu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRSERVER-1180?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12600311#action_12600311 ] 

Alex Karasulu commented on DIRSERVER-1180:
------------------------------------------

The substring expression decoding is hung in this case.  It gets into a state it cannot recover from it seems and the exception is not bubbled back up with an error response.  

I'd like to figure out how other servers behave in this case.  Using common sense I would condense multiple sequential wildcards into a single wildcard then process.  The tricky part here in this special case, is this heuristic will convert a substring filter AVA into a presence AVA.  How this is handled in the code is going to be a little bit of a challenge.


> NPE and hanging search request when using a filter with empty substring sequence
> --------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1180
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1180
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.3, 1.5.2
>            Reporter: Stefan Seelmann
>            Priority: Blocker
>
> When starting a search request using the seachfilter (cn=**) the request lasts forever. I testet with JNDI and ldapsearch command. 
> Here is the server log:
> [00:22:01] ERROR [org.apache.directory.shared.ldap.codec.actions.StoreAnyAction] - The substring any filter is empty
> [00:22:01] WARN [org.apache.directory.server.ldap.LdapServer$LdapProtocolHandler] - [/127.0.0.1:47315] Unexpected exception from exceptionCaught handler.
> java.lang.NullPointerException: message
> 	at org.apache.mina.common.IoFilter$WriteRequest.<init>(IoFilter.java:333)
> 	at org.apache.mina.common.support.BaseIoSession.write(BaseIoSession.java:177)
> 	at org.apache.mina.common.support.BaseIoSession.write(BaseIoSession.java:168)
> 	at org.apache.directory.server.ldap.LdapServer$LdapProtocolHandler.exceptionCaught(LdapServer.java:1104)
> 	at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.exceptionCaught(AbstractIoFilterChain.java:564)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.callNextExceptionCaught(AbstractIoFilterChain.java:345)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.access$1000(AbstractIoFilterChain.java:53)
> 	at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.exceptionCaught(AbstractIoFilterChain.java:643)
> 	at org.apache.mina.common.IoFilterAdapter.exceptionCaught(IoFilterAdapter.java:75)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.callNextExceptionCaught(AbstractIoFilterChain.java:345)
> 	at org.apache.mina.common.support.AbstractIoFilterChain.access$1000(AbstractIoFilterChain.java:53)
> 	at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.exceptionCaught(AbstractIoFilterChain.java:643)
> 	at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:224)
> 	at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> 	at java.lang.Thread.run(Thread.java:636)

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