[R2.20 Build 64] contrail-vrouter-agent crash while doing router-gateway-clear

Bug #1474272 reported by Prakash Bailkeri
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R2.20
Fix Committed
High
Divakar Dharanalakota
Trunk
Fix Committed
High
Divakar Dharanalakota

Bug Description

Exception causes agent to core.

Steps to recreate:
     1. neutron router-create lr1
     2. neutron router-interface-add lr1 <subnet>
     3. neutron router-gateway-set lr1 public
     4. neutron router-gateway-clear lr1;

Easy way to recreate: to run set and clear in loop.
while true; do neutron router-gateway-set lr1 public; sleep 1; neutron router-gateway-clear lr1; done

Ran vrouter in gdb to catch the exception:
(gdb) catch throw
(gdb) bt
#0 0x00007ffff5e5a910 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#1 0x00007ffff5e07987 in std::__throw_out_of_range(char const*) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#2 0x000000000098e1bf in _M_range_check (__n=0, this=<optimized out>) at /usr/include/c++/4.6/bits/stl_vector.h:719
#3 at (this=<optimized out>, __n=<optimized out>) at /usr/include/c++/4.6/bits/stl_vector.h:755
#4 FindAndSetInterfaces (graph=<optimized out>, vm_node=<optimized out>, properties=0x7ffff50b8ba0, svc_instance=<optimized out>) at controller/src/vnsw/agent/oper/service_instance.cc:231
#5 0x000000000098e40c in ServiceInstance::CalculateProperties (this=0x7fffec1c8100, graph=0x7fffe8002930, properties=0x7ffff50b8ba0) at controller/src/vnsw/agent/oper/service_instance.cc:644
#6 0x000000000099146d in CalculateProperties (properties=0x7ffff50b8ba0, graph=0x7fffe8002930, this=0x7fffec1c8100) at controller/src/vnsw/agent/oper/service_instance.cc:633
#7 ServiceInstanceTable::ChangeEventHandler (this=0x7fffe801a6b0, entry=<optimized out>) at controller/src/vnsw/agent/oper/service_instance.cc:766
#8 0x000000000090f0eb in operator() (a0=<optimized out>, this=0x7fffe801abc8) at build/include/boost/function/function_template.hpp:763
#9 IFMapDependencyManager::ProcessChangeList (this=0x7fffe8002a50) at controller/src/vnsw/agent/oper/ifmap_dependency_manager.cc:195
#10 0x000000000101b6ab in operator() (this=<optimized out>) at build/include/boost/function/function_template.hpp:763
#11 TaskTrigger::WorkerTask::Run (this=<optimized out>) at controller/src/base/task_trigger.cc:19
#12 0x0000000001013d45 in TaskImpl::execute (this=0x7ffff0061ac0) at controller/src/base/task.cc:238
#13 0x00007ffff60c3e52 in ?? () from /usr/lib/libtbb.so.2
#14 0x00007ffff60bfc2d in ?? () from /usr/lib/libtbb.so.2
#15 0x00007ffff60bf0db in ?? () from /usr/lib/libtbb.so.2
#16 0x00007ffff60bcc1f in ?? () from /usr/lib/libtbb.so.2
#17 0x00007ffff60bce59 in ?? () from /usr/lib/libtbb.so.2
#18 0x00007ffff62dae9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#19 0x00007ffff55c838d in clone () from /lib/x86_64-linux-gnu/libc.so.6
#20 0x0000000000000000 in ?? ()

Tags: vrouter
Revision history for this message
Prakash Bailkeri (prakashmb) wrote :
Changed in juniperopenstack:
assignee: nobody → Divakar Dharanalakota (ddivakar)
milestone: none → r2.30-fcs
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R2.20

Review in progress for https://review.opencontrail.org/12711
Submitter: Divakar Dharanalakota (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/12711
Committed: http://github.org/Juniper/contrail-controller/commit/b11d74cdec0a189687394204d166769f4674122c
Submitter: Zuul
Branch: R2.20

commit b11d74cdec0a189687394204d166769f4674122c
Author: Divakar <email address hidden>
Date: Wed Jul 29 21:56:29 2015 +0530

Check size of MAC vector before reading the element

While clearing the neutron router, Agent some times receives NULL object
without any properties. As this is not a delete operation
ServiceInstance attempts to calcualte the properties of the instance by
traversing the node grpah. When VMI is seen, it attempts to read the mac
address which as such is not preset leading to crash.

As a fix, the mac address is read only if the Mac vector has some
element in it.

Change-Id: Idd2afde67f56728408e5c553d772f30d00a246af
closes-bug: #1474272

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/12584
Submitter: Divakar Dharanalakota (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/12584
Committed: http://github.org/Juniper/contrail-controller/commit/513b28967f698ff0954fb1d6083e2ad64cf26e10
Submitter: Zuul
Branch: master

commit 513b28967f698ff0954fb1d6083e2ad64cf26e10
Author: Divakar <email address hidden>
Date: Mon Aug 3 10:07:05 2015 +0530

Check size of MAC vector before reading the element

While clearing the neutron router, Agent some times receives NULL object
without any properties. As this is not a delete operation
ServiceInstance attempts to calcualte the properties of the instance by
traversing the node grpah. When VMI is seen, it attempts to read the mac
address which as such is not preset leading to crash.

As a fix, the mac address is read only if the Mac vector has some
element in it.

Change-Id: Idd2afde67f56728408e5c553d772f30d00a246af
closes-bug: #1474272

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R2.22-dev

Review in progress for https://review.opencontrail.org/13927
Submitter: Vinay Vithal Mahuli (<email address hidden>)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.