Skip to content

fix(storage): bounds-check disk array updates in release builds - #1115

Merged
adsharma merged 1 commit into
LadybugDB:mainfrom
kory-io:fix/disk-array-update-bounds
Oct 5, 2026
Merged

adsharma merged 1 commit into
LadybugDB:mainfrom
kory-io:fix/disk-array-update-bounds

Conversation

@kory-io

@kory-io kory-io commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Description

Follow-up to #1095. DiskArrayInternal::get calls checkOutOfBoundAccess directly, so a corrupt slot id throws in a release build. update still wrapped that call in DASSERT. In a release build DASSERT is void(0), so the throw was compiled out and an index past numElements was written.

update now calls checkOutOfBoundAccess the same way get does. The other DASSERTs in disk_array.cpp are unchanged.

Test. DiskArrayCollectionTest.RejectsElementIndexOutsideDiskArray also calls update at numElements and at a far index. Built Release with ENABLE_RUNTIME_CHECKS off:

  • Before the change, both update calls threw nothing (the existing get assertions already threw).
  • After the change, disk_array_collection_test passes 5/5, including those two update calls.

Types of changes

  • Bug fix
  • New feature
  • Breaking change
  • Documentation Update

Checklist

  • I have changed storage version if on disk format has changed.
  • I have requested a review from a maintainer.
  • I have updated the documentation (if needed).

DiskArrayInternal::get already rejects an out-of-range index in release
builds. update() still wrapped that check in DASSERT, which release
builds compile out, so the throw never ran.
@adsharma
adsharma merged commit 08c9789 into LadybugDB:main Oct 5, 2026
4 checks passed
@kory-io
kory-io deleted the fix/disk-array-update-bounds branch October 5, 2026 22:46
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.

2 participants