You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Keith Wall (JIRA)" <ji...@apache.org> on 2016/01/08 10:11:39 UTC

[jira] [Commented] (QPID-6963) [Java Broker] ArrayIndexOutOfBoundsException is thrown on some cases when decoding partially written frames

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

Keith Wall commented on QPID-6963:
----------------------------------

Stack trace is from a 0.32 derivative Java Broker.

I think AMQDecoder#decodable guarantees that the decoder will never start decoding a frame unless it believes it has sufficient bytes.  I think the issue here is the decoder goes awry because it is processing a stream from a client that has omitted a chunk of bytes (owing to a client with a defect such as QPID-6974 or QPID-6206).   

>From a functional perspective, there is no issue.  The Broker behaves correctly; the AMQP stream is illegal so it closes the connection.  The issue is that the appearance of a AIOOBE in the Broker logs suggests a Broker malfunction.  It would be preferable if the Broker could fail with a clearer error message.

btw. Change on QPID-6971 will mean a {{BufferUnderflowException}} will be thrown rather than the AIOOBE.

> [Java Broker] ArrayIndexOutOfBoundsException is thrown on some cases when decoding partially written frames
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: QPID-6963
>                 URL: https://issues.apache.org/jira/browse/QPID-6963
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Broker
>    Affects Versions: 0.26, 0.28, 0.30, 0.32, qpid-java-6.0
>            Reporter: Alex Rudyy
>
> ArrayIndexOutOfBoundsException is thrown instead of AMQFrameDecodingException  on decoding of partially written frames in some circumstances.
> 0-9 frame decoding functionally should be improved to prevent that from happening or re-throw ArrayIndexOutOfBoundsException  as AMQFrameDecodingException.
>  
> {noformat}
> 2015-12-29 23:28:23,198 ERROR [IoRcvr-/XXX.XXX.XXX.XXX:5677-/YYY.YYY.YYY.YYY:34735] v0_8.AMQProtocolEngine (AMQProtocolEngine.java:1216) - Exception caught in /YYY.YYY.YYY.YYY:34735(nrsdev), closing connection explicitly: java.lang.ArrayIndexOutOfBoundsException: 347
> java.lang.ArrayIndexOutOfBoundsException: 347
>         at org.apache.qpid.framing.ByteArrayDataInput.readByte(ByteArrayDataInput.java:71)
>         at org.apache.qpid.framing.EncodingUtils.readLongAsShortString(EncodingUtils.java:992)
>         at org.apache.qpid.framing.BasicContentHeaderProperties.decode(BasicContentHeaderProperties.java:382)
>         at org.apache.qpid.framing.BasicContentHeaderProperties.populatePropertiesFromBuffer(BasicContentHeaderProperties.java:331)
>         at org.apache.qpid.framing.ContentHeaderBody.process(ContentHeaderBody.java:175)
>         at org.apache.qpid.codec.AMQDecoder.processFrame(AMQDecoder.java:391)
>         at org.apache.qpid.server.protocol.v0_8.BrokerDecoder.doProcessFrame(BrokerDecoder.java:113)
>         at org.apache.qpid.server.protocol.v0_8.BrokerDecoder.access$000(BrokerDecoder.java:36)
>         at org.apache.qpid.server.protocol.v0_8.BrokerDecoder$1.run(BrokerDecoder.java:79)
>         at org.apache.qpid.server.protocol.v0_8.BrokerDecoder$1.run(BrokerDecoder.java:75)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at javax.security.auth.Subject.doAs(Subject.java:415)
>         at org.apache.qpid.server.protocol.v0_8.BrokerDecoder.processFrame(BrokerDecoder.java:74)
>         at org.apache.qpid.codec.AMQDecoder.processInput(AMQDecoder.java:370)
>         at org.apache.qpid.codec.AMQDecoder.decodeBuffer(AMQDecoder.java:259)
>         at org.apache.qpid.server.protocol.v0_8.AMQProtocolEngine$2.run(AMQProtocolEngine.java:334)
>         at org.apache.qpid.server.protocol.v0_8.AMQProtocolEngine$2.run(AMQProtocolEngine.java:311)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at javax.security.auth.Subject.doAs(Subject.java:356)
>         at org.apache.qpid.server.protocol.v0_8.AMQProtocolEngine.received(AMQProtocolEngine.java:310)
>         at org.apache.qpid.server.protocol.v0_8.AMQProtocolEngine.received(AMQProtocolEngine.java:95)
>         at org.apache.qpid.server.protocol.MultiVersionProtocolEngine.received(MultiVersionProtocolEngine.java:153)
>         at org.apache.qpid.server.protocol.MultiVersionProtocolEngine.received(MultiVersionProtocolEngine.java:51)
>         at org.apache.qpid.transport.network.io.IoReceiver.run(IoReceiver.java:163)
>         at java.lang.Thread.run(Thread.java:724)
> {noformat}



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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org