You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
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".
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
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.
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