Fix data race in on_switch_shutdown_request()#2931
Merged
prsunny merged 2 commits intosonic-net:masterfrom Oct 13, 2023
Merged
Conversation
The data race in on_switch_shutdown_request() is the following: * the on_switch_shutdown_request() calls exit() which calls the destructors for global static variables (e.g.BufferOrch::m_buffer_type_maps) * in parallel to that, orchagent accesses the global static variables A fix is to avoid calling the destructors by using quick_exit() instead of exit() Signed-off-by: Yakiv Huryk <yhuryk@nvidia.com>
dgsudharsan
approved these changes
Oct 13, 2023
qiluo-msft
approved these changes
Oct 13, 2023
prsunny
approved these changes
Oct 13, 2023
Contributor
|
@Yakiv-Huryk have you tested 202305 with this PR? @prsunny could we have ADO to support this cherry pick? |
Collaborator
|
@StormLiangMS This is fix for the bug sonic-net/sonic-buildimage#15966 This is not branch specific flow and we have verified this in general. In addition we ran the sanity testing on 202305. |
Contributor
|
ADO:25592769 |
StormLiangMS
pushed a commit
that referenced
this pull request
Oct 25, 2023
The data race in on_switch_shutdown_request() is the following: * the on_switch_shutdown_request() calls exit() which calls the destructors for global static variables (e.g.BufferOrch::m_buffer_type_maps) * in parallel to that, orchagent accesses the global static variables A fix is to avoid calling the destructors by using quick_exit() instead of exit()
Janetxxx
pushed a commit
to Janetxxx/sonic-swss
that referenced
this pull request
Nov 10, 2025
The data race in on_switch_shutdown_request() is the following: * the on_switch_shutdown_request() calls exit() which calls the destructors for global static variables (e.g.BufferOrch::m_buffer_type_maps) * in parallel to that, orchagent accesses the global static variables A fix is to avoid calling the destructors by using quick_exit() instead of exit()
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.
The data race in on_switch_shutdown_request() is the following:
A fix is to avoid calling the destructors by using quick_exit() instead of exit()
What I did
Changed exit() -> quick_exit() in on_switch_shutdown_request().
Added __lsan_do_leak_check() call for ASAN build.
Why I did it
To address a data race in the on_switch_shutdown_request()
How I verified it
Details if related