Skip to content

[2.8] Fix a rare leak in GC - [MOD-11123]#7340

Merged
redisearch-backport-pull-request[bot] merged 1 commit into2.8from
backport-7315-to-2.8
Nov 12, 2025
Merged

[2.8] Fix a rare leak in GC - [MOD-11123]#7340
redisearch-backport-pull-request[bot] merged 1 commit into2.8from
backport-7315-to-2.8

Conversation

@redisearch-backport-pull-request
Copy link
Copy Markdown
Contributor

@redisearch-backport-pull-request redisearch-backport-pull-request bot commented Nov 12, 2025

Description

Backport of #7315 to 2.8.


Note

Fixes a leak in numeric GC by freeing cardValsArr on error, transferring ownership correctly, and simplifying recvCardvals assumptions.

  • GC (numeric index) leak fix:
    • recvCardvals: allocate target array directly without freeing/NULLing prior value; relies on zero-initialized inputs for ownership safety.
    • recvNumIdx: on error, free inverted index buffers and cardValsArr, then zero the struct.
    • resetCardinality: transfer ownership of cardValsArr to range->values and set the source pointer to NULL.
    • Add clarifying comments about zeroed/valid inputs for recvCardvals and recvNumIdx.

Written by Cursor Bugbot for commit dc68d16. This will update automatically on new commits. Configure here.

fix leak

(cherry picked from commit 81036bb)
@codecov
Copy link
Copy Markdown

codecov bot commented Nov 12, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 87.44%. Comparing base (c7933f2) to head (dc68d16).
⚠️ Report is 1 commits behind head on 2.8.

Files with missing lines Patch % Lines
src/fork_gc.c 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              2.8    #7340      +/-   ##
==========================================
- Coverage   87.48%   87.44%   -0.04%     
==========================================
  Files         203      203              
  Lines       34784    34782       -2     
==========================================
- Hits        30430    30415      -15     
- Misses       4354     4367      +13     
Flag Coverage Δ
flow 81.81% <0.00%> (-0.26%) ⬇️
unit 42.48% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@redisearch-backport-pull-request redisearch-backport-pull-request bot added this pull request to the merge queue Nov 12, 2025
Merged via the queue into 2.8 with commit d06815f Nov 12, 2025
13 of 14 checks passed
@redisearch-backport-pull-request redisearch-backport-pull-request bot deleted the backport-7315-to-2.8 branch November 12, 2025 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant