Skip to content

Commit

Permalink
fix: the retrieve plan on heap is used after free when reduce (#38840)
Browse files Browse the repository at this point in the history
issue: #38731

Signed-off-by: chyezh <[email protected]>
  • Loading branch information
chyezh authored Dec 30, 2024
1 parent 56c5b66 commit 07c1f43
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/querynodev2/segments/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,9 @@ func MergeSegcoreRetrieveResults(ctx context.Context, retrieveResults []*segcore
})
futures = append(futures, future)
}
if err := conc.AwaitAll(futures...); err != nil {
// Must be BlockOnAll operation here.
// If we perform a fast fail here, the cgo struct like `plan` will be used after free, unsafe memory access happens.
if err := conc.BlockOnAll(futures...); err != nil {
return nil, err
}

Expand Down

0 comments on commit 07c1f43

Please sign in to comment.