You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Trustin Lee (JIRA)" <ji...@apache.org> on 2005/09/21 18:28:28 UTC

[jira] Created: (DIRMINA-91) BufferUnderflowException while calling ProtocolViolationException.getMessage()

BufferUnderflowException while calling ProtocolViolationException.getMessage()
------------------------------------------------------------------------------

         Key: DIRMINA-91
         URL: http://issues.apache.org/jira/browse/DIRMINA-91
     Project: Directory MINA
        Type: Bug
    Versions: 0.7    
    Reporter: Trustin Lee
 Assigned to: Trustin Lee 
    Priority: Minor
     Fix For: 0.8


This issues has been posted to MINA forum by Thomas:

http://gleamynode.net/dev/forum/read.php?1,146

Posted by: Thomas (aurorum10-0.aurorum.se)
Date: September 21, 2005 11:00PM

Hi. I'm running a server with mina 0.7.4 on linux and somtimes I get a BufferUnderflowException in my server. It dosn't seem to affect the server however.

java.nio.BufferUnderflowException
at java.nio.Buffer.nextGetIndex(Buffer.java:398)
at java.nio.DirectByteBuffer.get(DirectByteBuffer.java:205)
at org.apache.mina.common.ByteBuffer$DefaultByteBuffer.get(ByteBuffer.java:720)
at org.apache.mina.common.ByteBufferHexDumper.getHexdump(ByteBufferHexDumper.java:78)
at org.apache.mina.common.ByteBuffer$DefaultByteBuffer.getHexDump(ByteBuffer.java:1029)
at org.apache.mina.protocol.ProtocolViolationException.getMessage(ProtocolViolationException.java:84)
at com.agency9.network.masterserver.A9MasterProtocolHandler.exceptionCaught(A9MasterProtocolHandler.java:41)
at org.apache.mina.protocol.AbstractProtocolFilterChain$2.exceptionCaught(AbstractProtocolFilterChain.java:142)
at org.apache.mina.protocol.AbstractProtocolFilterChain.callNextExceptionCaught(AbstractProtocolFilterChain.java:405)
at org.apache.mina.protocol.AbstractProtocolFilterChain.access$900(AbstractProtocolFilterChain.java:50)
at org.apache.mina.protocol.AbstractProtocolFilterChain$Entry$1.exceptionCaught(AbstractProtocolFilterChain.java:518)
at org.apache.mina.protocol.AbstractProtocolFilterChain$1.exceptionCaught(AbstractProtocolFilterChain.java:93)
at org.apache.mina.protocol.AbstractProtocolFilterChain.callNextExceptionCaught(AbstractProtocolFilterChain.java:405)
at org.apache.mina.protocol.AbstractProtocolFilterChain.exceptionCaught(AbstractProtocolFilterChain.java:396)
at org.apache.mina.protocol.ProtocolSessionManagerFilterChain$1.exceptionCaught(ProtocolSessionManagerFilterChain.java:71)
at org.apache.mina.protocol.AbstractProtocolFilterChain.callNextExceptionCaught(AbstractProtocolFilterChain.java:405)
at org.apache.mina.protocol.AbstractProtocolFilterChain.access$900(AbstractProtocolFilterChain.java:50)
at org.apache.mina.protocol.AbstractProtocolFilterChain$Entry$1.exceptionCaught(AbstractProtocolFilterChain.java:518)
at org.apache.mina.protocol.filter.ProtocolThreadPoolFilter.processEvent(ProtocolThreadPoolFilter.java:116)
at org.apache.mina.util.BaseThreadPool$Worker.processEvents(BaseThreadPool.java:393)
at org.apache.mina.util.BaseThreadPool$Worker.run(BaseThreadPool.java:333) 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Re: [jira] Closed: (DIRMINA-91) BufferUnderflowException while calling ProtocolViolationException.getMessage()

Posted by Trustin Lee <tr...@gmail.com>.
Hi Rodrigo,

2005/9/22, Rodrigo Kumpera <ku...@gmail.com>:
>
> Wouldn´t this cause a resource leak when the exception is uncaught?


It doesn't cause resource leak, but it can cause GC of the allocated buffer
when ProtocolViolationException is caught. There is no resource leak when
you don't release the buffer properly because unreleased buffers are GC'd by
JVM.

Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/

Re: [jira] Closed: (DIRMINA-91) BufferUnderflowException while calling ProtocolViolationException.getMessage()

Posted by Rodrigo Kumpera <ku...@gmail.com>.
Wouldn´t this cause a resource leak when the exception is uncaught?


On 9/21/05, Trustin Lee (JIRA) <ji...@apache.org> wrote:
>      [ http://issues.apache.org/jira/browse/DIRMINA-91?page=all ]
>
> Trustin Lee closed DIRMINA-91:
> ------------------------------
>
>     Resolution: Fixed
>
> I found that IoAdapter don't delay the release of the buffer which caused decoding failure.  The buffer will be released immediately when IoAdapter.SessionHandlerAdapter.dataRead() method returns regardless ProtocolViolationException uses it or not.
>
> I fixed this issue by acquiring the buffer once more when I create ProtocolViolationException.
>
> > BufferUnderflowException while calling ProtocolViolationException.getMessage()
> > ------------------------------------------------------------------------------
> >
> >          Key: DIRMINA-91
> >          URL: http://issues.apache.org/jira/browse/DIRMINA-91
> >      Project: Directory MINA
> >         Type: Bug
> >     Versions: 0.7
> >     Reporter: Trustin Lee
> >     Assignee: Trustin Lee
> >     Priority: Minor
> >      Fix For: 0.8
>
> >
> > This issues has been posted to MINA forum by Thomas:
> > http://gleamynode.net/dev/forum/read.php?1,146
> > Posted by: Thomas (aurorum10-0.aurorum.se)
> > Date: September 21, 2005 11:00PM
> > Hi. I'm running a server with mina 0.7.4 on linux and somtimes I get a BufferUnderflowException in my server. It dosn't seem to affect the server however.
> > java.nio.BufferUnderflowException
> > at java.nio.Buffer.nextGetIndex(Buffer.java:398)
> > at java.nio.DirectByteBuffer.get(DirectByteBuffer.java:205)
> > at org.apache.mina.common.ByteBuffer$DefaultByteBuffer.get(ByteBuffer.java:720)
> > at org.apache.mina.common.ByteBufferHexDumper.getHexdump(ByteBufferHexDumper.java:78)
> > at org.apache.mina.common.ByteBuffer$DefaultByteBuffer.getHexDump(ByteBuffer.java:1029)
> > at org.apache.mina.protocol.ProtocolViolationException.getMessage(ProtocolViolationException.java:84)
> > at com.agency9.network.masterserver.A9MasterProtocolHandler.exceptionCaught(A9MasterProtocolHandler.java:41)
> > at org.apache.mina.protocol.AbstractProtocolFilterChain$2.exceptionCaught(AbstractProtocolFilterChain.java:142)
> > at org.apache.mina.protocol.AbstractProtocolFilterChain.callNextExceptionCaught(AbstractProtocolFilterChain.java:405)
> > at org.apache.mina.protocol.AbstractProtocolFilterChain.access$900(AbstractProtocolFilterChain.java:50)
> > at org.apache.mina.protocol.AbstractProtocolFilterChain$Entry$1.exceptionCaught(AbstractProtocolFilterChain.java:518)
> > at org.apache.mina.protocol.AbstractProtocolFilterChain$1.exceptionCaught(AbstractProtocolFilterChain.java:93)
> > at org.apache.mina.protocol.AbstractProtocolFilterChain.callNextExceptionCaught(AbstractProtocolFilterChain.java:405)
> > at org.apache.mina.protocol.AbstractProtocolFilterChain.exceptionCaught(AbstractProtocolFilterChain.java:396)
> > at org.apache.mina.protocol.ProtocolSessionManagerFilterChain$1.exceptionCaught(ProtocolSessionManagerFilterChain.java:71)
> > at org.apache.mina.protocol.AbstractProtocolFilterChain.callNextExceptionCaught(AbstractProtocolFilterChain.java:405)
> > at org.apache.mina.protocol.AbstractProtocolFilterChain.access$900(AbstractProtocolFilterChain.java:50)
> > at org.apache.mina.protocol.AbstractProtocolFilterChain$Entry$1.exceptionCaught(AbstractProtocolFilterChain.java:518)
> > at org.apache.mina.protocol.filter.ProtocolThreadPoolFilter.processEvent(ProtocolThreadPoolFilter.java:116)
> > at org.apache.mina.util.BaseThreadPool$Worker.processEvents(BaseThreadPool.java:393)
> > at org.apache.mina.util.BaseThreadPool$Worker.run(BaseThreadPool.java:333)
>
> --
> This message is automatically generated by JIRA.
> -
> If you think it was sent incorrectly contact one of the administrators:
>    http://issues.apache.org/jira/secure/Administrators.jspa
> -
> For more information on JIRA, see:
>    http://www.atlassian.com/software/jira
>
>

[jira] Closed: (DIRMINA-91) BufferUnderflowException while calling ProtocolViolationException.getMessage()

Posted by "Trustin Lee (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DIRMINA-91?page=all ]
     
Trustin Lee closed DIRMINA-91:
------------------------------

    Resolution: Fixed

I found that IoAdapter don't delay the release of the buffer which caused decoding failure.  The buffer will be released immediately when IoAdapter.SessionHandlerAdapter.dataRead() method returns regardless ProtocolViolationException uses it or not.

I fixed this issue by acquiring the buffer once more when I create ProtocolViolationException.

> BufferUnderflowException while calling ProtocolViolationException.getMessage()
> ------------------------------------------------------------------------------
>
>          Key: DIRMINA-91
>          URL: http://issues.apache.org/jira/browse/DIRMINA-91
>      Project: Directory MINA
>         Type: Bug
>     Versions: 0.7
>     Reporter: Trustin Lee
>     Assignee: Trustin Lee
>     Priority: Minor
>      Fix For: 0.8

>
> This issues has been posted to MINA forum by Thomas:
> http://gleamynode.net/dev/forum/read.php?1,146
> Posted by: Thomas (aurorum10-0.aurorum.se)
> Date: September 21, 2005 11:00PM
> Hi. I'm running a server with mina 0.7.4 on linux and somtimes I get a BufferUnderflowException in my server. It dosn't seem to affect the server however.
> java.nio.BufferUnderflowException
> at java.nio.Buffer.nextGetIndex(Buffer.java:398)
> at java.nio.DirectByteBuffer.get(DirectByteBuffer.java:205)
> at org.apache.mina.common.ByteBuffer$DefaultByteBuffer.get(ByteBuffer.java:720)
> at org.apache.mina.common.ByteBufferHexDumper.getHexdump(ByteBufferHexDumper.java:78)
> at org.apache.mina.common.ByteBuffer$DefaultByteBuffer.getHexDump(ByteBuffer.java:1029)
> at org.apache.mina.protocol.ProtocolViolationException.getMessage(ProtocolViolationException.java:84)
> at com.agency9.network.masterserver.A9MasterProtocolHandler.exceptionCaught(A9MasterProtocolHandler.java:41)
> at org.apache.mina.protocol.AbstractProtocolFilterChain$2.exceptionCaught(AbstractProtocolFilterChain.java:142)
> at org.apache.mina.protocol.AbstractProtocolFilterChain.callNextExceptionCaught(AbstractProtocolFilterChain.java:405)
> at org.apache.mina.protocol.AbstractProtocolFilterChain.access$900(AbstractProtocolFilterChain.java:50)
> at org.apache.mina.protocol.AbstractProtocolFilterChain$Entry$1.exceptionCaught(AbstractProtocolFilterChain.java:518)
> at org.apache.mina.protocol.AbstractProtocolFilterChain$1.exceptionCaught(AbstractProtocolFilterChain.java:93)
> at org.apache.mina.protocol.AbstractProtocolFilterChain.callNextExceptionCaught(AbstractProtocolFilterChain.java:405)
> at org.apache.mina.protocol.AbstractProtocolFilterChain.exceptionCaught(AbstractProtocolFilterChain.java:396)
> at org.apache.mina.protocol.ProtocolSessionManagerFilterChain$1.exceptionCaught(ProtocolSessionManagerFilterChain.java:71)
> at org.apache.mina.protocol.AbstractProtocolFilterChain.callNextExceptionCaught(AbstractProtocolFilterChain.java:405)
> at org.apache.mina.protocol.AbstractProtocolFilterChain.access$900(AbstractProtocolFilterChain.java:50)
> at org.apache.mina.protocol.AbstractProtocolFilterChain$Entry$1.exceptionCaught(AbstractProtocolFilterChain.java:518)
> at org.apache.mina.protocol.filter.ProtocolThreadPoolFilter.processEvent(ProtocolThreadPoolFilter.java:116)
> at org.apache.mina.util.BaseThreadPool$Worker.processEvents(BaseThreadPool.java:393)
> at org.apache.mina.util.BaseThreadPool$Worker.run(BaseThreadPool.java:333) 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira