fix: the retrieve plan on heap is used after free when reduce (#38841)

issue: #38731
pr: #38840

Signed-off-by: chyezh <chyezh@outlook.com>
pull/38853/head
Zhen Ye 2024-12-30 15:52:51 +08:00 committed by GitHub
parent ef400227ad
commit 04f07f00b7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -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
}