[OPNFLWJAVA-14] ActionsSerializer#computeLengthOfActions throws NullPointerException Created: 16/Jan/14  Updated: 18/Jan/14  Resolved: 18/Jan/14

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

Type: Bug
Reporter: Moiz Raja Assignee: Michal Polkorab
Resolution: Won't Do 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: 315

 Description   

2014-01-16 14:48:19.226 PST [nioEventLoopGroup-8-1] ERROR o.o.o.protocol.impl.core.OFEncoder - null
java.lang.NullPointerException: null
at org.opendaylight.openflowjava.protocol.impl.util.ActionsSerializer.computeLengthOfActions(ActionsSerializer.java:325) ~[bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.util.InstructionsSerializer.computeInstructionsLength(InstructionsSerializer.java:169) ~[bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.serialization.factories.FlowModInputMessageFactory.computeLength(FlowModInputMessageFactory.java:69) ~[bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.serialization.factories.FlowModInputMessageFactory.computeLength(FlowModInputMessageFactory.java:28) ~[bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.util.ByteBufUtils.writeOFHeader(ByteBufUtils.java:114) ~[bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.serialization.factories.FlowModInputMessageFactory.messageToBuffer(FlowModInputMessageFactory.java:50) ~[bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.serialization.factories.FlowModInputMessageFactory.messageToBuffer(FlowModInputMessageFactory.java:28) ~[bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.serialization.SerializationFactory.messageToBuffer(SerializationFactory.java:36) ~[bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.core.OFEncoder.encode(OFEncoder.java:39) [bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.core.OFEncoder.encode(OFEncoder.java:25) [bundlefile:na]
at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:111) [bundlefile:na]
at io.netty.channel.DefaultChannelHandlerContext.invokeWrite(DefaultChannelHandlerContext.java:644) [bundlefile:na]
at io.netty.channel.DefaultChannelHandlerContext.access$2000(DefaultChannelHandlerContext.java:28) [bundlefile:na]
at io.netty.channel.DefaultChannelHandlerContext$WriteTask.run(DefaultChannelHandlerContext.java:891) [bundlefile:na]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:354) [bundlefile:na]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:348) [bundlefile:na]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [bundlefile:na]
at java.lang.Thread.run(Thread.java:744) [na:1.7.0_45]

It looks like an element in the list (which is another list) is null and that is why this happens.

It looks like the NPE happens quite often but when it is invoked from OFEncoder#encode it is not being properly logged (I mean the stack trace is not being logged).

We need to ensure that the logging is prominent to ensure that such problems are identified faster.

To reproduce this problem do the following,

1. Build a controller distribution from the openflow plugin
2. Add a topology with mininet
3. h1 ping h2

You should see a NPE occur



 Comments   
Comment by Michal Polkorab [ 17/Jan/14 ]

Hi Moiz,

I have tried to reproduce this issue, but I was unable to do so.

There was an issue with the drop action (in instruction structure, which is used in FlowMod message), where this error was occuring. However it has been fixed with https://git.opendaylight.org/gerrit/#/c/4303/

Please try pulling new code and let me know if it helped.

Regards
Michal Polkorab

Comment by Michal Polkorab [ 18/Jan/14 ]

Issue fixed in OFPlugin and after further communication it was agreed that this issue should be closed (and the funcionality should remain the same)

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