Skip to content

hashindex fixes 1.4#9575

Merged
ThomasWaldmann merged 1 commit intoborgbackup:1.4-maintfrom
ThomasWaldmann:hashindex-fixes-1.4
May 4, 2026
Merged

hashindex fixes 1.4#9575
ThomasWaldmann merged 1 commit intoborgbackup:1.4-maintfrom
ThomasWaldmann:hashindex-fixes-1.4

Conversation

@ThomasWaldmann
Copy link
Copy Markdown
Member

@ThomasWaldmann ThomasWaldmann commented Apr 20, 2026

No description provided.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.95%. Comparing base (86e6dd4) to head (cd2f5a0).
⚠️ Report is 1 commits behind head on 1.4-maint.

Additional details and impacted files
@@            Coverage Diff             @@
##           1.4-maint    #9575   +/-   ##
==========================================
  Coverage      81.95%   81.95%           
==========================================
  Files             38       38           
  Lines          11299    11299           
  Branches        1778     1778           
==========================================
  Hits            9260     9260           
  Misses          1453     1453           
  Partials         586      586           

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

@ThomasWaldmann ThomasWaldmann force-pushed the hashindex-fixes-1.4 branch from eb11772 to 8f6002a Compare May 4, 2026 17:54
- avoid buckets_length integer overflow on 32bit systems via huge num_buckets
- always initialize index-> min_empty and num_empty
- correctly free memory when header validation fails.
  this is a minor issue, because borg will terminate in that case anyway.
- make it possible to lookup in compacted hashtables
- deal safely with empty index: we must use num_buckets = 1 to avoid division
  by zero and sanity check in hashindex_read.
- reinitialize upper/lower limit and min_empty after compact
- fix size_idx / fit_size / grow_size / shrink_size (mind array bounds)
- deal with growing when already at max capacity
- hashindex_resize: replace num_entries assertion, rather return error
- BaseIndex.clear: always stay in valid state
  Do not free the old index before we successfully have allocated a new one.
  This is a minor issue as the Exception raised would terminate borg anyway.
@ThomasWaldmann ThomasWaldmann force-pushed the hashindex-fixes-1.4 branch from 8f6002a to cd2f5a0 Compare May 4, 2026 18:32
@ThomasWaldmann ThomasWaldmann changed the title _hashindex.c: more fixes hashindex fixes 1.4 May 4, 2026
@ThomasWaldmann ThomasWaldmann merged commit 8cbf259 into borgbackup:1.4-maint May 4, 2026
20 of 22 checks passed
@ThomasWaldmann ThomasWaldmann deleted the hashindex-fixes-1.4 branch May 4, 2026 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant