Skip to content

TOOLS: fix scatterv perftest#1234

Merged
Sergei-Lebedev merged 1 commit intoopenucx:masterfrom
Sergei-Lebedev:topic/fix_scatterv
Jan 5, 2026
Merged

TOOLS: fix scatterv perftest#1234
Sergei-Lebedev merged 1 commit intoopenucx:masterfrom
Sergei-Lebedev:topic/fix_scatterv

Conversation

@Sergei-Lebedev
Copy link
Copy Markdown
Contributor

What

Fix early memory free in scatterv perftest. In inplace mode root rank doesn't exit from coll args init function and goes to memory free label which causes segfaults.

fixes internal issue 4450742

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Dec 12, 2025

Greptile Summary

This PR fixes a critical control flow bug in the scatterv perftest that caused segfaults in inplace mode. The root cause was a misplaced return UCC_OK; statement inside an if-block at line 80. When the root rank was running in inplace mode without root_shift, it would skip the destination buffer allocation (correctly) but then fall through to the free_src: label, prematurely freeing the just-allocated source buffer that was still needed.

The fix moves the return UCC_OK; statement outside the if-block (now at line 82), ensuring all successful initialization paths return before reaching the cleanup labels. This prevents the premature memory free and resolves the segfault issue.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The fix is surgical and correct - it moves a return statement to the proper scope, preventing a clear control flow bug that caused premature memory deallocation. The change is minimal (2 lines), well-understood, and directly addresses the reported segfault issue.
  • No files require special attention

Important Files Changed

Filename Overview
tools/perf/ucc_pt_coll_scatterv.cc Fixed critical control flow bug preventing premature memory free in inplace mode for root rank

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Jan 5, 2026

Greptile's behavior is changing!

From now on, if a review finishes with no comments, we will not post an additional "statistics" comment to confirm that our review found nothing to comment on. However, you can confirm that we reviewed your changes in the status check section.

This feature can be toggled off in your Code Review Settings by deselecting "Create a status check for each PR".

@Sergei-Lebedev
Copy link
Copy Markdown
Contributor Author

/build

@Sergei-Lebedev Sergei-Lebedev merged commit 0bded41 into openucx:master Jan 5, 2026
11 checks passed
@Sergei-Lebedev Sergei-Lebedev deleted the topic/fix_scatterv branch January 5, 2026 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants