Skip to content

fix(ibverbs): prevent segfault when ibv_create_qp_ex fail to create qp#101

Open
dragonJACson wants to merge 1 commit intomainfrom
dev/fix-build-ex
Open

fix(ibverbs): prevent segfault when ibv_create_qp_ex fail to create qp#101
dragonJACson wants to merge 1 commit intomainfrom
dev/fix-build-ex

Conversation

@dragonJACson
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a helper function extended_qp_from_raw to centralize the conversion of raw queue pairs to extended queue pairs and refactors the QueuePairBuilder to use it. A review comment suggests simplifying the helper by removing an unnecessary null check on the result of ibv_qp_to_qp_ex, recommending the use of NonNull::new_unchecked with a safety comment instead.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a potential segfault path when ibv_create_qp_ex fails by ensuring null QP pointers are rejected before attempting ibv_qp_to_qp_ex conversion.

Changes:

  • Added extended_qp_from_raw helper to validate/create NonNull<ibv_qp_ex> from the raw QP pointer.
  • Updated QueuePairBuilder::build_ex to use the helper and early-return on failure.
  • Added a unit test covering the null-QP rejection path.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 29, 2026

Codecov Report

❌ Patch coverage is 57.14286% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/ibverbs/queue_pair.rs 57.14% 6 Missing ⚠️

❌ Your patch check has failed because the patch coverage (57.14%) is below the target coverage (60.00%). You can increase the patch coverage or adjust the target coverage.

Files with missing lines Coverage Δ
src/ibverbs/queue_pair.rs 70.41% <57.14%> (-0.19%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dragonJACson dragonJACson force-pushed the dev/fix-build-ex branch 2 times, most recently from 0d4dde1 to 314f451 Compare March 29, 2026 04:37
@dragonJACson dragonJACson requested a review from Copilot March 29, 2026 05:38
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dragonJACson dragonJACson requested a review from FujiZ March 29, 2026 07:41
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