activemq-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ARTEMIS-570) IllegalArguementException when using AMQP protocol
Date Fri, 17 Jun 2016 19:05:05 GMT

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

ASF subversion and git services commented on ARTEMIS-570:
---------------------------------------------------------

Commit 432e2ce17849ed18ac9dd1d79ea2e935c160da3e in activemq-artemis's branch refs/heads/master
from [~martyntaylor]
[ https://git-wip-us.apache.org/repos/asf?p=activemq-artemis.git;h=432e2ce ]

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)

Mime
View raw message