You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: rename and batch remove on a viewed index crash with SIGBUS #835
On an index opened with view, rename and remove with a list of keys crash the process with SIGBUS. Single-key remove and add correctly return "immutable index" errors.
The cause is in include/usearch/index_dense.hpp. Single-key remove checks typed_->is_immutable() (line 1649, added for #506). rename (line 1734) and the batch remove(begin, end) (line 1689) don't, so they write the new key into the read-only mapping.
Steps to reproduce
importnumpyasnpfromusearch.indeximportIndexindex=Index(ndim=4, metric="l2sq")
index.add(np.arange(5), np.eye(5, 4, dtype=np.float32))
index.save("view.usearch")
view=Index.restore("view.usearch", view=True)
view.remove(1) # ValueError: Can't remove from an immutable indexview.rename(2, 200) # Fatal Python error: Bus error# view.remove([1, 2]) # same crash
Expected behavior
The same error that single-key remove raises ("Can't remove from an immutable index"), with the index unchanged.
USearch version
v2.26.6
Operating System
macOS 26 (Apple clang 21, Python 3.11)
Hardware architecture
Arm
Which interface are you using?
C++ implementation
Contact Details
No response
Are you open to being tagged as a contributor?
I am open to being mentioned in the project .git history as a contributor
@FunHenaXTV, thanks for the report and the fix in #838! 3.0 has no rename or removal yet, on views or anywhere else, so this crash went with the 2.x code. Removal comes back in #846 as an exclusive operation that renumbers and reclaims, and views refuse it outright, so I'm closing this in its favor.
Activity
ashvardanian commentedon Nov 14, 2026
@FunHenaXTV, thanks for the report and the fix in #838! 3.0 has no rename or removal yet, on views or anywhere else, so this crash went with the 2.x code. Removal comes back in #846 as an exclusive operation that renumbers and reclaims, and views refuse it outright, so I'm closing this in its favor.