qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rob Godfrey (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (QPID-6055) [Java Broker] BDB Message Store can thow java.lang.IndexOutOfBoundsException on trying to retrieve the message content
Date Fri, 29 Aug 2014 19:43:54 GMT

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

Rob Godfrey commented on QPID-6055:
-----------------------------------

Can you give a little more information on how to reproduce this error?

Looking at the stack trace the error occurs here 

{noformat}
1336                return ByteBuffer.wrap(data,offsetInMessage,Math.min(size,data.length-offsetInMessage));
{noformat}

which comes (via one intermediate call) from here in MessageContentSourceBody.writePayload:

{noformat}
249         public void writePayload(DataOutput buffer) throws IOException
250         {
251             ByteBuffer buf = _message.getContent(_offset, _length);
252 
{noformat}

and the MessageContentSourceBody would come from line 202 here (because the path up from the
exception leads through line 207

{noformat}
195             int maxBodySize = (int) getProtocolSession().getMaxFrameSize() - AMQFrame.getFrameOverhead();
196 
197 
198             int capacity = bodySize > maxBodySize ? maxBodySize : bodySize;
199 
200             int writtenSize = capacity;
201 
202             AMQBody firstContentBody = new MessageContentSourceBody(message, 0, capacity);
203 
204             CompositeAMQBodyBlock
205                     compositeBlock =
206                     new CompositeAMQBodyBlock(channelId, deliverBody, contentHeaderBody,
firstContentBody);
207             writeFrame(compositeBlock);
{noformat}

which would imply that the MessageContentSourceBody encountering the error is the one created
with offset 0 and length capacity.  To get an index out of bounds that would mean that the
data array is smaller than capacity.  But capacity is defined to be less than bodySize from
line 198 above... so something very fishy would appear to be going on :-(



> [Java Broker] BDB Message Store can thow java.lang.IndexOutOfBoundsException on trying
to retrieve the message content
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: QPID-6055
>                 URL: https://issues.apache.org/jira/browse/QPID-6055
>             Project: Qpid
>          Issue Type: Bug
>    Affects Versions: 0.30
>            Reporter: Alex Rudyy
>            Priority: Blocker
>
> Perftests failed because Broker crashed and disconnected the clients in result of the
following Exception:
> {noformat}
> 2014-08-28 06:36:00,595 ERROR [IoReceiver - /127.0.0.1:43858] (v0_8.AMQProtocolEngine)
- Error informing channel that receiving is complete. Channel: (false, false, false) [/127.0.0.1:43858(guest):1]
> java.lang.IndexOutOfBoundsException
>         at java.nio.ByteBuffer.wrap(ByteBuffer.java:371)
>         at org.apache.qpid.server.store.berkeleydb.AbstractBDBMessageStore$StoredBDBMessage.getContent(AbstractBDBMessageStore.java:1336)
>         at org.apache.qpid.server.message.AbstractServerMessageImpl.getContent(AbstractServerMessageImpl.java:171)
>         at org.apache.qpid.server.protocol.v0_8.output.ProtocolOutputConverterImpl$MessageContentSourceBody.writePayload(ProtocolOutputConverterImpl.java:251)
>         at org.apache.qpid.framing.AMQFrame.writeFrames(AMQFrame.java:123)
>         at org.apache.qpid.server.protocol.v0_8.output.ProtocolOutputConverterImpl$CompositeAMQBodyBlock.writePayload(ProtocolOutputConverterImpl.java:461)
>         at org.apache.qpid.server.protocol.v0_8.AMQProtocolEngine.asByteBuffer(AMQProtocolEngine.java:590)
>         at org.apache.qpid.server.protocol.v0_8.AMQProtocolEngine.writeFrame(AMQProtocolEngine.java:704)
>         at org.apache.qpid.server.protocol.v0_8.output.ProtocolOutputConverterImpl.writeFrame(ProtocolOutputConverterImpl.java:423)
>         at org.apache.qpid.server.protocol.v0_8.output.ProtocolOutputConverterImpl.writeMessageDeliveryUnchanged(ProtocolOutputConverterImpl.java:207)
>         at org.apache.qpid.server.protocol.v0_8.output.ProtocolOutputConverterImpl.writeMessageDelivery(ProtocolOutputConverterImpl.java:141)
>         at org.apache.qpid.server.protocol.v0_8.output.ProtocolOutputConverterImpl.writeMessageDelivery(ProtocolOutputConverterImpl.java:101)
>         at org.apache.qpid.server.protocol.v0_8.output.ProtocolOutputConverterImpl.writeDeliver(ProtocolOutputConverterImpl.java:78)
>         at org.apache.qpid.server.protocol.v0_8.AMQProtocolEngine$WriteDeliverMethod.deliverToClient(AMQProtocolEngine.java:1621)
>         at org.apache.qpid.server.protocol.v0_8.ConsumerTarget_0_8.sendToClient(ConsumerTarget_0_8.java:513)
>         at org.apache.qpid.server.protocol.v0_8.ConsumerTarget_0_8$AckConsumer.send(ConsumerTarget_0_8.java:317)
>         at org.apache.qpid.server.queue.QueueConsumerImpl.send(QueueConsumerImpl.java:474)
>         at org.apache.qpid.server.queue.AbstractQueue.deliverMessage(AbstractQueue.java:1252)
>         at org.apache.qpid.server.queue.AbstractQueue.deliverToConsumer(AbstractQueue.java:1166)
>         at org.apache.qpid.server.queue.AbstractQueue.tryDeliverStraightThrough(AbstractQueue.java:1122)
>         at org.apache.qpid.server.queue.AbstractQueue.access$100(AbstractQueue.java:96)
>         at org.apache.qpid.server.queue.AbstractQueue$6.run(AbstractQueue.java:1010)
>         at org.apache.qpid.server.queue.AbstractQueue$6.run(AbstractQueue.java:1006)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at javax.security.auth.Subject.doAs(Subject.java:356)
>         at org.apache.qpid.server.queue.AbstractQueue.doEnqueue(AbstractQueue.java:1004)
>         at org.apache.qpid.server.queue.SortedQueueImpl.doEnqueue(SortedQueueImpl.java:61)
>         at org.apache.qpid.server.queue.AbstractQueue.enqueue(AbstractQueue.java:953)
>         at org.apache.qpid.server.exchange.AbstractExchange$2.postCommit(AbstractExchange.java:560)
>         at org.apache.qpid.server.protocol.v0_8.AMQChannel$AsyncCommand.complete(AMQChannel.java:1696)
>         at org.apache.qpid.server.protocol.v0_8.AMQChannel.sync(AMQChannel.java:1666)
>         at org.apache.qpid.server.protocol.v0_8.AMQChannel.receivedComplete(AMQChannel.java:266)
>         at org.apache.qpid.server.protocol.v0_8.AMQProtocolEngine.receivedComplete(AMQProtocolEngine.java:368)
>         at org.apache.qpid.server.protocol.v0_8.AMQProtocolEngine.access$1200(AMQProtocolEngine.java:89)
>         at org.apache.qpid.server.protocol.v0_8.AMQProtocolEngine$2.run(AMQProtocolEngine.java:328)
>         at org.apache.qpid.server.protocol.v0_8.AMQProtocolEngine$2.run(AMQProtocolEngine.java:283)
>         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:282)
>         at org.apache.qpid.server.protocol.v0_8.AMQProtocolEngine.received(AMQProtocolEngine.java:89)
>         at org.apache.qpid.server.protocol.MultiVersionProtocolEngine.received(MultiVersionProtocolEngine.java:133)
>         at org.apache.qpid.server.protocol.MultiVersionProtocolEngine.received(MultiVersionProtocolEngine.java:49)
>         at org.apache.qpid.transport.network.io.IoReceiver.run(IoReceiver.java:161)
>         at java.lang.Thread.run(Thread.java:745)
> 2014-08-28 06:36:00,598 ERROR [IoReceiver - /127.0.0.1:43858] (v0_8.AMQProtocolEngine)
- Exception caught in /127.0.0.1:43858(guest), closing connection explicitly: java.lang.IndexOutOfBoundsException
> java.lang.IndexOutOfBoundsException
>         at java.nio.ByteBuffer.wrap(ByteBuffer.java:371)
>         at org.apache.qpid.server.store.berkeleydb.AbstractBDBMessageStore$StoredBDBMessage.getContent(AbstractBDBMessageStore.java:1336)
>         at org.apache.qpid.server.message.AbstractServerMessageImpl.getContent(AbstractServerMessageImpl.java:171)
>         at org.apache.qpid.server.protocol.v0_8.output.ProtocolOutputConverterImpl$MessageContentSourceBody.writePayload(ProtocolOutputConverterImpl.java:251)
>         at org.apache.qpid.framing.AMQFrame.writeFrames(AMQFrame.java:123)
>         at org.apache.qpid.server.protocol.v0_8.output.ProtocolOutputConverterImpl$CompositeAMQBodyBlock.writePayload(ProtocolOutputConverterImpl.java:461)
>         at org.apache.qpid.server.protocol.v0_8.AMQProtocolEngine.asByteBuffer(AMQProtocolEngine.java:590)
>         at org.apache.qpid.server.protocol.v0_8.AMQProtocolEngine.writeFrame(AMQProtocolEngine.java:704)
>         at org.apache.qpid.server.protocol.v0_8.output.ProtocolOutputConverterImpl.writeFrame(ProtocolOutputConverterImpl.java:423)
>         at org.apache.qpid.server.protocol.v0_8.output.ProtocolOutputConverterImpl.writeMessageDeliveryUnchanged(ProtocolOutputConverterImpl.java:207)
>         at org.apache.qpid.server.protocol.v0_8.output.ProtocolOutputConverterImpl.writeMessageDelivery(ProtocolOutputConverterImpl.java:141)
>         at org.apache.qpid.server.protocol.v0_8.output.ProtocolOutputConverterImpl.writeMessageDelivery(ProtocolOutputConverterImpl.java:101)
>         at org.apache.qpid.server.protocol.v0_8.output.ProtocolOutputConverterImpl.writeDeliver(ProtocolOutputConverterImpl.java:78)
>         at org.apache.qpid.server.protocol.v0_8.AMQProtocolEngine$WriteDeliverMethod.deliverToClient(AMQProtocolEngine.java:1621)
>         at org.apache.qpid.server.protocol.v0_8.ConsumerTarget_0_8.sendToClient(ConsumerTarget_0_8.java:513)
>         at org.apache.qpid.server.protocol.v0_8.ConsumerTarget_0_8$AckConsumer.send(ConsumerTarget_0_8.java:317)
>         at org.apache.qpid.server.queue.QueueConsumerImpl.send(QueueConsumerImpl.java:474)
>         at org.apache.qpid.server.queue.AbstractQueue.deliverMessage(AbstractQueue.java:1252)
>         at org.apache.qpid.server.queue.AbstractQueue.deliverToConsumer(AbstractQueue.java:1166)
>         at org.apache.qpid.server.queue.AbstractQueue.tryDeliverStraightThrough(AbstractQueue.java:1122)
>         at org.apache.qpid.server.queue.AbstractQueue.access$100(AbstractQueue.java:96)
>         at org.apache.qpid.server.queue.AbstractQueue$6.run(AbstractQueue.java:1010)
>         at org.apache.qpid.server.queue.AbstractQueue$6.run(AbstractQueue.java:1006)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at javax.security.auth.Subject.doAs(Subject.java:356)
>         at org.apache.qpid.server.queue.AbstractQueue.doEnqueue(AbstractQueue.java:1004)
>         at org.apache.qpid.server.queue.SortedQueueImpl.doEnqueue(SortedQueueImpl.java:61)
>         at org.apache.qpid.server.queue.AbstractQueue.enqueue(AbstractQueue.java:953)
>         at org.apache.qpid.server.exchange.AbstractExchange$2.postCommit(AbstractExchange.java:560)
>         at org.apache.qpid.server.protocol.v0_8.AMQChannel$AsyncCommand.complete(AMQChannel.java:1696)
>         at org.apache.qpid.server.protocol.v0_8.AMQChannel.sync(AMQChannel.java:1666)
>         at org.apache.qpid.server.protocol.v0_8.AMQChannel.receivedComplete(AMQChannel.java:266)
>         at org.apache.qpid.server.protocol.v0_8.AMQProtocolEngine.receivedComplete(AMQProtocolEngine.java:368)
>         at org.apache.qpid.server.protocol.v0_8.AMQProtocolEngine.access$1200(AMQProtocolEngine.java:89)
>         at org.apache.qpid.server.protocol.v0_8.AMQProtocolEngine$2.run(AMQProtocolEngine.java:328)
>         at org.apache.qpid.server.protocol.v0_8.AMQProtocolEngine$2.run(AMQProtocolEngine.java:283)
>         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:282)
>         at org.apache.qpid.server.protocol.v0_8.AMQProtocolEngine.received(AMQProtocolEngine.java:89)
>         at org.apache.qpid.server.protocol.MultiVersionProtocolEngine.received(MultiVersionProtocolEngine.java:133)
>         at org.apache.qpid.server.protocol.MultiVersionProtocolEngine.received(MultiVersionProtocolEngine.java:49)
>         at org.apache.qpid.transport.network.io.IoReceiver.run(IoReceiver.java:161)
>         at java.lang.Thread.run(Thread.java:745)
> {noformat}
> {noformat}
> 2014-08-28 06:37:30,624 ERROR [pool-3-thread-13] (server.Main) - Uncaught exception,
shutting down.
> java.lang.IndexOutOfBoundsException
>         at java.nio.ByteBuffer.wrap(ByteBuffer.java:371)
>         at org.apache.qpid.server.store.berkeleydb.AbstractBDBMessageStore$StoredBDBMessage.getContent(AbstractBDBMessageStore.java:1336)
>         at org.apache.qpid.server.message.AbstractServerMessageImpl.getContent(AbstractServerMessageImpl.java:171)
>         at org.apache.qpid.server.protocol.v0_8.output.ProtocolOutputConverterImpl$MessageContentSourceBody.writePayload(ProtocolOutputConverterImpl.java:251)
>         at org.apache.qpid.framing.AMQFrame.writeFrames(AMQFrame.java:123)
>         at org.apache.qpid.server.protocol.v0_8.output.ProtocolOutputConverterImpl$CompositeAMQBodyBlock.writePayload(ProtocolOutputConverterImpl.java:461)
>         at org.apache.qpid.server.protocol.v0_8.AMQProtocolEngine.asByteBuffer(AMQProtocolEngine.java:590)
>         at org.apache.qpid.server.protocol.v0_8.AMQProtocolEngine.writeFrame(AMQProtocolEngine.java:704)
>         at org.apache.qpid.server.protocol.v0_8.output.ProtocolOutputConverterImpl.writeFrame(ProtocolOutputConverterImpl.java:423)
>         at org.apache.qpid.server.protocol.v0_8.output.ProtocolOutputConverterImpl.writeMessageDeliveryUnchanged(ProtocolOutputConverterImpl.java:207)
>         at org.apache.qpid.server.protocol.v0_8.output.ProtocolOutputConverterImpl.writeMessageDelivery(ProtocolOutputConverterImpl.java:141)
>         at org.apache.qpid.server.protocol.v0_8.output.ProtocolOutputConverterImpl.writeMessageDelivery(ProtocolOutputConverterImpl.java:101)
>         at org.apache.qpid.server.protocol.v0_8.output.ProtocolOutputConverterImpl.writeDeliver(ProtocolOutputConverterImpl.java:78)
>         at org.apache.qpid.server.protocol.v0_8.AMQProtocolEngine$WriteDeliverMethod.deliverToClient(AMQProtocolEngine.java:1621)
>         at org.apache.qpid.server.protocol.v0_8.ConsumerTarget_0_8.sendToClient(ConsumerTarget_0_8.java:513)
>         at org.apache.qpid.server.protocol.v0_8.ConsumerTarget_0_8$NoAckConsumer.send(ConsumerTarget_0_8.java:213)
>         at org.apache.qpid.server.queue.QueueConsumerImpl.send(QueueConsumerImpl.java:474)
>         at org.apache.qpid.server.queue.AbstractQueue.deliverMessage(AbstractQueue.java:1252)
>         at org.apache.qpid.server.queue.AbstractQueue.attemptDelivery(AbstractQueue.java:2007)
>         at org.apache.qpid.server.queue.AbstractQueue.processQueue(AbstractQueue.java:2178)
>         at org.apache.qpid.server.queue.QueueRunner$1.run(QueueRunner.java:77)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at javax.security.auth.Subject.doAs(Subject.java:356)
>         at org.apache.qpid.server.queue.QueueRunner.run(QueueRunner.java:68)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>         at java.lang.Thread.run(Thread.java:745)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

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


Mime
View raw message