Skip to content

EntityBulker SIGSEGV when create_entry attr_count 0#2224

Merged
prsunny merged 2 commits intosonic-net:masterfrom
arvbb:bulker_segfault
Aug 31, 2022
Merged

EntityBulker SIGSEGV when create_entry attr_count 0#2224
prsunny merged 2 commits intosonic-net:masterfrom
arvbb:bulker_segfault

Conversation

@arvbb
Copy link
Contributor

@arvbb arvbb commented Apr 5, 2022

What I did
Removed access to variable causing the segfault while create_entry with attr_count 0

Why I did it
When the bulker create_entry was called with attr_count as 0, the swss log would access the attr_list and try to print the id. This was causing the orchagent crash:

Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x000056230970734d in EntityBulker<_sai_nat_api_t>::create_entry (this=0x56230b31f988, object_status=0x56230b3e4a20, entry=, attr_count=0, attr_list=0x7ffcadbbbef0) at /usr/include/c++/8/bits/unordered_map.h:309

How I verified it
Verified orchagent does not segfault under this condition.

Details if related

@arvbb arvbb requested a review from prsunny as a code owner April 5, 2022 22:53
@prsunny prsunny requested a review from qiluo-msft April 6, 2022 01:17
@prsunny
Copy link
Collaborator

prsunny commented Apr 19, 2022

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@prsunny prsunny merged commit d41aebf into sonic-net:master Aug 31, 2022
@arvbb arvbb deleted the bulker_segfault branch August 31, 2022 16:46
Janetxxx pushed a commit to Janetxxx/sonic-swss that referenced this pull request Nov 10, 2025
*EntityBulker SIGSEGV when create_entry attr_count 0 (sonic-net#2224)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants