Fix in script to avoid orchagent crash when port down followed by fdb… #1340
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What I did
Observed that sometimes orchagent is hitting seg fault with below stack when port down followed by FDB delete.
Crash:
Thread 1 "orchagent" received signal SIGSEGV, Segmentation fault.
0x00007f8f742aebb3 in std::_Rb_tree_increment(std::_Rb_tree_node_base const*) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
(gdb) bt
#0 0x00007f8f742aebb3 in std::_Rb_tree_increment(std::_Rb_tree_node_base const*) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#1 0x000055c07f1f1078 in std::_Rb_tree_const_iterator::operator++ (this=) at /usr/include/c++/6/bits/stl_tree.h:288
#2 FdbOrch::update (this=this@entry=0x55c07f89f6d0, type=, entry=, bridge_port_id=) at fdborch.cpp:235
#3 0x000055c07f1f2002 in FdbOrch::doTask (this=0x55c07f89f6d0, consumer=...) at fdborch.cpp:485
#4 0x000055c07f15d712 in OrchDaemon::start (this=0x55c07f882e80) at orchdaemon.cpp:467
#5 0x000055c07f148322 in main (argc=, argv=) at main.cpp:346
Why I did it
Fixed in script to avoid this as it may be hitting some timing issue.
How I verified it
Ran script 50 times without any issue.
Details if related