Skip to content

Fix bmp crash by putting rBMP in context for try..catch for client_thread.cpp#33

Open
fkong-cisco wants to merge 4 commits intosonic-net:masterfrom
fkong-cisco:cisco-sync-pr2-model
Open

Fix bmp crash by putting rBMP in context for try..catch for client_thread.cpp#33
fkong-cisco wants to merge 4 commits intosonic-net:masterfrom
fkong-cisco:cisco-sync-pr2-model

Conversation

@fkong-cisco
Copy link

Description

Summary:
Fixes a bmp crash because rBMP is used out of context in server/src/client_thread.cpp

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Back port request

  • 201911
  • 202012
  • 202205
  • 202305
  • 202311

Approach

What is the motivation for this PR?

Occasional crash of bmp was reported, with traceback pointing to this area. Analysis found that rBMP was declared in the "try" but referred to in the "catch"

How did you do it?

Moved the declaration just above the "try" so it has wider scope to cover its uses.

How did you verify/test it?

Tested the script with lots of bmp connection flaps. No more crashes.

Any platform specific information?

…p PR (modeled after whitebox PR sonic-net#2)

Made-with: Cursor
Keep rBMP in scope for the full ClientThread lifetime so the
std::thread that uses &rBMP does not reference an object that has
gone out of scope when the try block exits. Moved from inside try
to just after pthread_cleanup_push.

Made-with: Cursor
@mssonicbld
Copy link

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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