Skip to content

fix(runtime): append new VamanaIndex virtuals instead of inserting them - #385

Merged
ahuber21 merged 2 commits into
intel:mainfrom
ahuber21:fix/vamana-index-vtable-append
Sep 9, 2026
Merged

fix(runtime): append new VamanaIndex virtuals instead of inserting them#385
ahuber21 merged 2 commits into
intel:mainfrom
ahuber21:fix/vamana-index-vtable-append

Conversation

@ahuber21

@ahuber21 ahuber21 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

get_memory_usage() and get_memory_breakdown() were added between reconstruct_at() and save() in #345, shifting every later vtable slot. VamanaIndex is a pure abstract interface passed across the shared-library boundary, so a consumer compiled against v0.4.0 dispatches save() to get_memory_usage(), leaves the returned Status unconstructed, and frees a garbage pointer in its destructor. Observed as a SIGSEGV inside jemalloc during index serialization in Milvus, whose knowhere is built against a 0.4.0-era runtime-bindings nightly.

Nothing catches this at link time: virtual dispatch never resolves by symbol name, so ldd -r and exported-symbol comparison both pass. SOVERSION is PROJECT_VERSION_MAJOR, which stays 0 across 0.4.0 and 0.5.0, so a v0.4.0 consumer resolves SONAME libsvs_runtime.so.0 to a 0.5.0 library and loads it.

Moving both declarations after save() restores the v0.4.0 slot indices. No tagged release carries the inserted order -- it has shipped only in nightlies and on rls/v0.5.0 -- so consumers built against those nightlies need a rebuild.

get_memory_usage() and get_memory_breakdown() were added between
reconstruct_at() and save() in intel#345, shifting every later vtable slot.
VamanaIndex is a pure abstract interface passed across the shared-library
boundary, so a consumer compiled against v0.4.0 dispatches save() to
get_memory_usage(), leaves the returned Status unconstructed, and frees a
garbage pointer in its destructor. Observed as a SIGSEGV inside jemalloc
during index serialization in Milvus, whose knowhere is built against a
0.4.0-era runtime-bindings nightly.

Nothing catches this at link time: virtual dispatch never resolves by symbol
name, so ldd -r and exported-symbol comparison both pass. SOVERSION is
PROJECT_VERSION_MAJOR, which stays 0 across 0.4.0 and 0.5.0, so a v0.4.0
consumer resolves SONAME libsvs_runtime.so.0 to a 0.5.0 library and loads it.

Moving both declarations after save() restores the v0.4.0 slot indices. No
tagged release carries the inserted order -- it has shipped only in nightlies
and on rls/v0.5.0 -- so consumers built against those nightlies need a rebuild.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ahuber21
ahuber21 force-pushed the fix/vamana-index-vtable-append branch from 0dcdfe2 to 08a335c Compare September 9, 2026 11:16

@rfsaliev rfsaliev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGFM

@mergify

mergify Bot commented Sep 9, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@ahuber21
ahuber21 enabled auto-merge (squash) September 9, 2026 16:34
@ahuber21
ahuber21 merged commit 9980bd2 into intel:main Sep 9, 2026
20 checks passed
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