[fdborch] Fixed Orchagent crash in FDB flush on port disable.#1369
Merged
prsunny merged 2 commits intosonic-net:masterfrom Jul 29, 2020
rajkumar38:fdb_bug
Merged
[fdborch] Fixed Orchagent crash in FDB flush on port disable.#1369prsunny merged 2 commits intosonic-net:masterfrom rajkumar38:fdb_bug
prsunny merged 2 commits intosonic-net:masterfrom
rajkumar38:fdb_bug
Conversation
Signed-off-by: Rajkumar Pennadam Ramamoorthy <rpennadamram@marvell.com>
Contributor
Author
vasant17
reviewed
Jul 29, 2020
| vlanName.c_str(), update.port.m_alias.c_str()); | ||
|
|
||
| for (const auto& itr : m_entries) | ||
| for (auto itr = m_entries.begin(); itr != m_entries.end();) |
Contributor
There was a problem hiding this comment.
Looks good to me.
Just a suggestion, can we just update the for loop to the below, instead of increment iterator at multiple places?
for (auto itr = m_entries.begin(); itr != m_entries.end(); itr = next_item)
{
auto next_item = std::next(itr, 1);
.....
....
}
Contributor
Author
There was a problem hiding this comment.
Avoided multiple iterator increment. Updated patch. Pls check.
Fixed review comments. Signed-off-by: Rajkumar Pennadam Ramamoorthy <rpennadamram@marvell.com>
vasant17
approved these changes
Jul 29, 2020
prsunny
approved these changes
Jul 29, 2020
EdenGri
pushed a commit
to EdenGri/sonic-swss
that referenced
this pull request
Feb 28, 2022
**- What I did** Add information related to updating firmware image from sonic-installer. fix sonic-net/sonic-buildimage#6264 **- How I did it** Replace click.echo with a function that combines echo and logger functions **- How to verify it** Start the sonic-installer process and then grep syslog $ sonic-installer install http://not_exist.com $ tail -n 100 /var/log/syslog | grep "sonic-installer"
Janetxxx
pushed a commit
to Janetxxx/sonic-swss
that referenced
this pull request
Nov 10, 2025
…net#1369) * [fdborch] Fixed Orchagent crash in FDB flush on port disable. Signed-off-by: Rajkumar Pennadam Ramamoorthy <rpennadamram@marvell.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Signed-off-by: Rajkumar Pennadam Ramamoorthy rpennadamram@marvell.com
What I did
Fixed Orchagent crash in FDB flush on port disable.
Steps to reproduce:
In fdborch.cpp:485, "m_entries" element is erased (from function "storeFdbEntryState") inside range based loop.
Iterators or references to erased element are invalidated. Hence update the iterator before removing the element.
Why I did it
How I verified it
Validate the above testcase with fix.
Details if related
Logs:
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
Core was generated by `/usr/bin/orchagent -d /var/log/swss -b 8192 -m 00:50:b6:50:51:51'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0xb6b5676c in std::local_Rb_tree_increment (__x=0x3633240a, __x@entry=0x69b2e0) at ../../../../../src/libstdc++-v3/src/c++98/tree.cc:65
65 ../../../../../src/libstdc++-v3/src/c++98/tree.cc: No such file or directory.
[Current thread is 1 (Thread 0xb6f69000 (LWP 44))]
(gdb) bt
#0 0xb6b5676c in std::local_Rb_tree_increment (__x=0x3633240a, __x@entry=0x69b2e0) at ../../../../../src/libstdc++-v3/src/c++98/tree.cc:65
#1 std::_Rb_tree_increment (__x=__x@entry=0x69b2e0) at ../../../../../src/libstdc++-v3/src/c++98/tree.cc:91
#2 0x004bfea0 in std::_Rb_tree_const_iterator::operator++ (this=) at /usr/include/c++/6/bits/stl_tree.h:288
#3 FdbOrch::update (this=this@entry=0x5ace68, type=, entry=, bridge_port_id=16325548649219474) at fdborch.cpp:235
#4 0x004c0746 in FdbOrch::doTask (this=0x5ace68, consumer=...) at fdborch.cpp:485
#5 0x004684a6 in OrchDaemon::start (this=0x59b57c) at orchdaemon.cpp:467
#6 0x00458e10 in main (argc=, argv=) at main.cpp:346
(gdb) p * __x
Cannot access memory at address 0x3633240a
(gdb) p __x
$1 = (std::_Rb_tree_node_base ) 0x3633240a
(gdb) fr 1
#1 std::_Rb_tree_increment (__x=__x@entry=0x69b2e0) at ../../../../../src/libstdc++-v3/src/c++98/tree.cc:91
91 in ../../../../../src/libstdc++-v3/src/c++98/tree.cc
(gdb) p __x
$2 = (const std::_Rb_tree_node_base ) 0x69b2e0
(gdb) p __x
$3 = {_M_color = (unknown: 11347552), _M_parent = 0xa0d3324, _M_left = 0xd4c4544, _M_right = 0x3633240a}
(gdb) p __x->_M_right
$4 = (std::_Rb_tree_node_base::_Base_ptr) 0x3633240a
(gdb) p __x->_M_right
Cannot access memory at address 0x3633240a
(gdb) p/x m_entries
$1 = std::set with 4159 elements = {[0] = {mac = {m_mac = {0x0, 0x0, 0x0, 0xaa, 0x11, 0x12}}, bv_id = 0x26000000000591, port_name = "Ethernet0"}, [1] = {