You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/06/17 12:10:05 UTC

[jira] [Commented] (ARTEMIS-570) IllegalArguementException when using AMQP protocol

    [ https://issues.apache.org/jira/browse/ARTEMIS-570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15335935#comment-15335935 ] 

ASF GitHub Bot commented on ARTEMIS-570:
----------------------------------------

GitHub user mtaylor opened a pull request:

    https://github.com/apache/activemq-artemis/pull/583

    ARTEMIS-570 Fix buffer size overflow ProtonHandler

    There is a race condition in the ProtonHandlerImpl.outputBuffer()
    method.  The method checks to see how many bytes (n) are pending in the
    underlying ProtonJ buffer, then creates a Netty buffer of size n.  It
    then writes the contents of the pending ProtonJ head.  However, ProtonJ
    can still write to it's internal buffer, meaning that it's buffer.size >
    n causing an illegalArgumentException.  This patch fixes it by only
    writing 'n' bytes to the Netty buffer.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/mtaylor/activemq-artemis Artemis-570

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/activemq-artemis/pull/583.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #583
    
----
commit cc979b9de05588c58180d360cedecbdda208a9ea
Author: Martyn Taylor <mt...@redhat.com>
Date:   2016-06-16T15:02:23Z

    ARTEMIS-570 Fix buffer size overflow ProtonHandler
    
    There is a race condition in the ProtonHandlerImpl.outputBuffer()
    method.  The method checks to see how many bytes (n) are pending in the
    underlying ProtonJ buffer, then creates a Netty buffer of size n.  It
    then writes the contents of the pending ProtonJ head.  However, ProtonJ
    can still write to it's internal buffer, meaning that it's buffer.size >
    n causing an illegalArgumentException.  This patch fixes it by only
    writing 'n' bytes to the Netty buffer.

----


> IllegalArguementException when using AMQP protocol
> --------------------------------------------------
>
>                 Key: ARTEMIS-570
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-570
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>            Reporter: Martyn Taylor
>
> When using AMQP protocol the follow exception is sometimes thrown:
> java.lang.IllegalStateException: You called outputDone for more bytes than you actually received. numberOfBytes=665, outcome result=-320
>         at org.proton.plug.handler.impl.ProtonHandlerImpl.outputDone(ProtonHandlerImpl.java:229)
>         at org.proton.plug.context.AbstractConnectionContext.outputDone(AbstractConnectionContext.java:121)
>         at org.apache.activemq.artemis.core.protocol.proton.plug.ActiveMQProtonConnectionCallback.onTransport(ActiveMQProtonConnectionCallback.java:133)
>         at org.proton.plug.context.AbstractConnectionContext.flushBytes(AbstractConnectionContext.java:163)
>         at org.proton.plug.context.AbstractConnectionContext$LocalListener.onTransport(AbstractConnectionContext.java:185)
>         at org.proton.plug.handler.Events.dispatch(Events.java:97)
>         at org.proton.plug.handler.impl.ProtonHandlerImpl.dispatch(ProtonHandlerImpl.java:362)
>         at org.proton.plug.handler.impl.ProtonHandlerImpl.access$000(ProtonHandlerImpl.java:49)
>         at org.proton.plug.handler.impl.ProtonHandlerImpl$1.run(ProtonHandlerImpl.java:63)
>         at org.apache.activemq.artemis.utils.OrderedExecutorFactory$OrderedExecutor$ExecutorTask.run(OrderedExecutorFactory.java:103)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>         at java.lang.Thread.run(Thread.java:745)
> java.lang.IllegalArgumentException
>         at java.nio.Buffer.position(Buffer.java:244)
>         at org.proton.plug.handler.impl.ProtonHandlerImpl.outputBuffer(ProtonHandlerImpl.java:260)
>         at org.proton.plug.context.AbstractConnectionContext.flushBytes(AbstractConnectionContext.java:162)
>         at org.proton.plug.context.AbstractConnectionContext$LocalListener.onTransport(AbstractConnectionContext.java:185)
>         at org.proton.plug.handler.Events.dispatch(Events.java:97)
>         at org.proton.plug.handler.impl.ProtonHandlerImpl.dispatch(ProtonHandlerImpl.java:362)
>         at org.proton.plug.handler.impl.ProtonHandlerImpl.access$000(ProtonHandlerImpl.java:49)
>         at org.proton.plug.handler.impl.ProtonHandlerImpl$1.run(ProtonHandlerImpl.java:63)
>         at org.apache.activemq.artemis.utils.OrderedExecutorFactory$OrderedExecutor$ExecutorTask.run(OrderedExecutorFactory.java:103)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>         at java.lang.Thread.run(Thread.java:745)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)