[OPNFLWJAVA-35] IndexOutOfBoundsException while deserializing MultipartReplyMessage Created: 18/Sep/14  Updated: 03/May/18  Resolved: 18/Sep/14

Status: Resolved
Project: openflowjava
Component/s: General
Affects Version/s: unspecified
Fix Version/s: None

Type: Bug
Reporter: Michal Polkorab Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 1947

 Description   

I see IndexOutOfBounds exception on MultipartReplyMessage deserialization when using extensions. Please see attached log below:

2014-09-18 11:04:58.227 CEST [nioEventLoopGroup-11-12] ERROR o.o.o.protocol.impl.core.OFDecoder - Message deserialization failed
Listening for transport dt_socket at address: 8000
2014-09-18 11:04:58.228 CEST [nioEventLoopGroup-11-12] ERROR o.o.o.protocol.impl.core.OFDecoder - readerIndex(116) + length(4) exceeds writerIndex(118): SlicedByteBuf(ridx:
116, widx: 118, cap: 118/118, unwrapped: PooledUnsafeDirectByteBuf(ridx: 216, widx: 216, cap: 4096))
java.lang.IndexOutOfBoundsException: readerIndex(116) + length(4) exceeds writerIndex(118): SlicedByteBuf(ridx: 116, widx: 118, cap: 118/118, unwrapped: PooledUnsafeDirectByteBuf(ridx: 216, widx: 216, cap: 4096))
at io.netty.buffer.AbstractByteBuf.checkReadableBytes(AbstractByteBuf.java:1175) ~[bundlefile:4.0.23.Final]
at io.netty.buffer.AbstractByteBuf.readInt(AbstractByteBuf.java:619) ~[bundlefile:4.0.23.Final]
at io.netty.buffer.AbstractByteBuf.readUnsignedInt(AbstractByteBuf.java:627) ~[bundlefile:4.0.23.Final]
at org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF13OutputActionDeserializer.deserialize(OF13OutputActionDeserializer.java:37) ~[bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.deserialization.action.OF13OutputActionDeserializer.deserialize(OF13OutputActionDeserializer.java:29) ~[bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.util.ListDeserializer.deserializeList(ListDeserializer.java:44) ~[bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.deserialization.instruction.AbstractActionInstructionDeserializer.deserialize(AbstractActionInstructionDeserializer.java:48) ~[bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.deserialization.instruction.AbstractActionInstructionDeserializer.deserialize(AbstractActionInstructionDeserializer.java:33) ~[bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.util.ListDeserializer.deserializeList(ListDeserializer.java:44) ~[bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.deserialization.factories.MultipartReplyMessageFactory.setFlow(MultipartReplyMessageFactory.java:287) ~[bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.deserialization.factories.MultipartReplyMessageFactory.deserialize(MultipartReplyMessageFactory.java:194) ~[bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.deserialization.factories.MultipartReplyMessageFactory.deserialize(MultipartReplyMessageFactory.java:146) ~[bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializationFactory.deserialize(DeserializationFactory.java:53) ~[bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.core.OFDecoder.decode(OFDecoder.java:48) [bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.core.OFDecoder.decode(OFDecoder.java:26) [bundlefile:na]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89) [bundlefile:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [bundlefile:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [bundlefile:4.0.23.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:163) [bundlefile:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [bundlefile:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [bundlefile:4.0.23.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:163) [bundlefile:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [bundlefile:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [bundlefile:4.0.23.Final]
at io.netty.handler.timeout.ReadTimeoutHandler.channelRead(ReadTimeoutHandler.java:150) [bundlefile:4.0.23.Final]
at org.opendaylight.openflowjava.protocol.impl.core.IdleHandler.channelRead(IdleHandler.java:39) [bundlefile:na]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [bundlefile:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [bundlefile:4.0.23.Final]
at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86) [bundlefile:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [bundlefile:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [bundlefile:4.0.23.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) [bundlefile:4.0.23.Final]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:130) [bundlefile:4.0.23.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511) [bundlefile:4.0.23.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468) [bundlefile:4.0.23.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) [bundlefile:4.0.23.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:349) [bundlefile:4.0.23.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [bundlefile:4.0.23.Final]
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137) [bundlefile:4.0.23.Final]
at java.lang.Thread.run(Thread.java:722) [na:1.7.0_21]



 Comments   
Comment by Michal Polkorab [ 18/Sep/14 ]

Problem was incorrect OutputReg action handling in OutputRegCodec. Codec didn't skip padding in OutputReg action structure.

Issue should be fixed by https://git.opendaylight.org/gerrit/#/c/11309/

Generated at Wed Feb 07 20:28:47 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.