[OPNFLWPLUG-41] Null Pointer exception during cbench run Created: 23/Jan/14  Updated: 27/Sep/21  Resolved: 25/Jan/14

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

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

Operating System: Mac OS
Platform: Macintosh


External issue ID: 347

 Description   

The following null pointer exceptions are being thrown during the cbench run (view in a wide editor):

Back traces

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

Name Count

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

+---org.opendaylight.openflowjava.protocol.impl.serialization.factories.OF10StatsRequestInputFactory.encodeFlowBody(MultipartRequestBody, ByteBuf) 1,353 100 %
     
+---org.opendaylight.openflowjava.protocol.impl.serialization.factories.OF10StatsRequestInputFactory.messageToBuffer(short, ByteBuf, MultipartRequestInput)  
     
+---org.opendaylight.openflowjava.protocol.impl.serialization.factories.OF10StatsRequestInputFactory.messageToBuffer(short, ByteBuf, DataObject)  
     
+---org.opendaylight.openflowjava.protocol.impl.serialization.SerializationFactory.messageToBuffer(short, ByteBuf, DataObject)  
     
+---org.opendaylight.openflowjava.protocol.impl.core.OFEncoder.encode(ChannelHandlerContext, OfHeader, ByteBuf)  
     
+---org.opendaylight.openflowjava.protocol.impl.core.OFEncoder.encode(ChannelHandlerContext, Object, ByteBuf)  
     
+---io.netty.handler.codec.MessageToByteEncoder.write(ChannelHandlerContext, Object, ChannelPromise)  
     
+---io.netty.channel.DefaultChannelHandlerContext.invokeWrite(Object, ChannelPromise)  
     
+---io.netty.channel.DefaultChannelHandlerContext.access$2000(DefaultChannelHandlerContext, Object, ChannelPromise)  
     
+---io.netty.channel.DefaultChannelHandlerContext$WriteTask.run()  
     
+---io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(long)  
     
+---io.netty.channel.nio.NioEventLoop.run()  

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

This constitues 37% of all exceptions during a cbench run



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

Hello,

any null pointer exception signalizes that there are some data missing in the DTO's passed to the library.

My guess is that the match is not filled. Needs further debugging.

Regards
Michal

Comment by Jan Medved [ 23/Jan/14 ]

It only happens when flow programming is initiated from two-phase commit. It does not happen when an app fills all flow data and sends an RPC

Comment by Michal Polkorab [ 24/Jan/14 ]

I have also tried to run Cbench with some logging. See the results below:

2014-01-24 16:55:05.306 CET [md-sal-binding-commit-68] INFO o.o.o.o.m.c.s.ModelDrivenSwitchImpl - Prepare statistics request to get stats for flow Match [_ethernetMatch=EthernetMatch [_ethernetDestination=null, _ethernetSource=EthernetSource [_address=MacAddress [_value=00:77:01:00:00:06], _mask=null, augmentation=[]], _ethernetType=null, augmentation=[]], _icmpv4Match=null, _icmpv6Match=null, _inPhyPort=null, _inPort=null, _ipMatch=null, _layer3Match=null, _layer4Match=null, _metadata=null, _protocolMatchFields=null, _tunnel=null, _vlanMatch=null, augmentation=[]] for switch tables null - Transaction id - 774
2014-01-24 16:55:05.306 CET [nioEventLoopGroup-8-6] WARN o.o.o.p.i.s.f.OF10StatsRequestInputFactory -

FLOWBODY METHOD
2014-01-24 16:55:05.306 CET [nioEventLoopGroup-8-6] WARN o.o.o.p.i.s.f.OF10StatsRequestInputFactory - tableid NULL
2014-01-24 16:55:05.306 CET [nioEventLoopGroup-8-6] ERROR o.o.o.protocol.impl.core.OFEncoder - Message serialization failed
2014-01-24 16:55:05.306 CET [nioEventLoopGroup-8-6] ERROR o.o.o.protocol.impl.core.OFEncoder - null
java.lang.NullPointerException: null
at org.opendaylight.openflowjava.protocol.impl.serialization.factories.OF10StatsRequestInputFactory.encodeFlowBody(OF10StatsRequestInputFactory.java:178) ~[bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.serialization.factories.OF10StatsRequestInputFactory.messageToBuffer(OF10StatsRequestInputFactory.java:85) ~[bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.serialization.factories.OF10StatsRequestInputFactory.messageToBuffer(OF10StatsRequestInputFactory.java:42) ~[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:722) [na:1.7.0_21]

Michal

Comment by Michal Rehak [ 24/Jan/14 ]

Fixed by filling table.id for flows added by dropAllPackages* provider - used by cbench testing.

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