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 into
sonic-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 into
sonic-net:masterfrom
fkong-cisco:cisco-sync-pr2-model

Conversation

@fkong-cisco
Copy link
Copy Markdown

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
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@FengPan-Frank
Copy link
Copy Markdown
Collaborator

/azpw run

@mssonicbld
Copy link
Copy Markdown
Collaborator

⚠️ Notice: /azpw run only runs failed jobs now. If you want to trigger a whole pipline run, please rebase your branch or close and reopen the PR.
💡 Tip: You can also use /azpw retry to retry failed jobs directly.

Retrying failed(or canceled) jobs...

@mssonicbld
Copy link
Copy Markdown
Collaborator

No Azure DevOps builds found for #33.

@FengPan-Frank
Copy link
Copy Markdown
Collaborator

/azpw run Azure.sonic-bmp

@mssonicbld
Copy link
Copy Markdown
Collaborator

⚠️ Notice: /azpw run only runs failed jobs now. If you want to trigger a whole pipline run, please rebase your branch or close and reopen the PR.
💡 Tip: You can also use /azpw retry to retry failed jobs directly.

Retrying failed(or canceled) jobs...

@mssonicbld
Copy link
Copy Markdown
Collaborator

No Azure DevOps builds found for #33.

@fkong-cisco
Copy link
Copy Markdown
Author

close and re-open to restart /azpw job

@fkong-cisco fkong-cisco reopened this Apr 30, 2026
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

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.

3 participants