Skip to content

Conversation

meiravgri
Copy link
Collaborator

backport #784 to 8.2

* rename dataSize->getStoredDataSize

* missing rename

* format

* add input blob size to AbstractIndexInitParams

in VecSimIndexAbstract move data members to private when possible

DONT FIX LEAK YET

Factories:
move NewAbstractInitParams to a general location (new file factory_utils)
replace it in all factories

* try sanitizer

* run sanitizer

* runanyway

* rervt task unit test
use sanitizer in pull request

* fix leak in input bob size

* fix int8/uint8 elementSizeEstimation tests

This caused a buffer overflow because setup<TieredIndexParams> didn't set the data type to INT8, creating a float32 index instead.
DataBlock::addElement() tries to copy dim * sizeof(float) bytes, but the allocated buffer is only dim * sizeof(int8) bytes, causing a read overflow.

* run codecov with sanitizer (also intek)

* some fixes and assertion

* fix uint8

* fix again

* fix possible warning abour divison by zero by checking quantBits with constexpr

* TO REVERT!

fix leaks that will be moved to a separate PR
it was failing only with codecov becuase only there we use FP64_TESTS=1

Prevent template deduction errors in GenerateAndAddVector by making data_t parameter non-deducible

Used std::type_identity<data_t>::type for the value parameter to force explicit template specification (e.g., GenerateAndAddVector<double>()) instead of allowing compiler to incorrectly deduce int from literal values, which caused buffer overflows when index expected different data types.

* Revert "TO REVERT!"

This reverts commit af844ec.

* rever ci changes

* calculate EstimateElementSize accroding to the stored vector size
add tests

* revert unrelated change in cmake.san

* add batch itertor blob correctness to int8 tests

fix getQueryBlob in tiered
add getHNSWIterator to tiered batch itertor if its BUILD_TESTS

* apply suggesting

(cherry picked from commit 9fb223a)
@meiravgri meiravgri requested a review from GuyAv46 October 9, 2025 04:49
@meiravgri meiravgri enabled auto-merge October 9, 2025 04:49
@meiravgri meiravgri requested a review from ofiryanai October 9, 2025 05:10
Copy link

codecov bot commented Oct 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.67%. Comparing base (3814aaa) to head (4579913).
⚠️ Report is 1 commits behind head on 8.2.

Additional details and impacted files
@@            Coverage Diff             @@
##              8.2     #794      +/-   ##
==========================================
- Coverage   96.67%   96.67%   -0.01%     
==========================================
  Files         125      126       +1     
  Lines        7680     7663      -17     
==========================================
- Hits         7425     7408      -17     
  Misses        255      255              

☔ 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.

@GuyAv46 GuyAv46 changed the title [8.2[ [MOD-11650] Fix Out-of-Bounds Write in Vector Preprocessing [8.2] [MOD-11650] Fix Out-of-Bounds Write in Vector Preprocessing Oct 9, 2025
@meiravgri meiravgri added this pull request to the merge queue Oct 9, 2025
Merged via the queue into 8.2 with commit 1d696c4 Oct 9, 2025
17 checks passed
@meiravgri meiravgri deleted the backport-784-to-8.2 branch October 9, 2025 10:10
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.

3 participants