[GH-ISSUE #69] RangeError: Offset is outside the bounds of the DataView #48

Closed
opened 2026-05-23 08:28:09 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @appy-one on GitHub (Feb 9, 2022).
Original GitHub issue: https://github.com/appy-one/acebase/issues/69

Originally assigned to: @appy-one on GitHub.

While performing automated tests to solve #65, this error appeared: RangeError: Offset is outside the bounds of the DataView in storage-acebase.js:602.

While debugging this, I found out that my bulk data import test causes the FST (Free Space Table) to be flooded with tiny ranges of 2 records each, because they are not being allocated in my particular tests. At one point, there are just too many ranges to store in the FST and it fails. Funny detail is that I anticipated on this ever happening (line 613) but did not realize the actual crash would be before my own check..

There's space for 8191 ranges in the FST. I'm going to fix this by enforcing this limit, removing the smallest ranges when needed. That means some free space in the db file will be lost forever, but the chance of this actually happening in a real-world database is fairly small.

Originally created by @appy-one on GitHub (Feb 9, 2022). Original GitHub issue: https://github.com/appy-one/acebase/issues/69 Originally assigned to: @appy-one on GitHub. While performing automated tests to solve #65, this error appeared: `RangeError: Offset is outside the bounds of the DataView` in [storage-acebase.js:602](https://github.com/appy-one/acebase/blob/15e42e3fdd530275573f203e659b604ffcb1b829/src/storage-acebase.js#L602). While debugging this, I found out that my bulk data import test causes the FST (Free Space Table) to be flooded with tiny ranges of 2 records each, because they are not being allocated in my particular tests. At one point, there are just too many ranges to store in the FST and it fails. Funny detail is that I anticipated on this ever happening ([line 613](https://github.com/appy-one/acebase/blob/15e42e3fdd530275573f203e659b604ffcb1b829/src/storage-acebase.js#L613)) but did not realize the actual crash would be before my own check.. There's space for 8191 ranges in the FST. I'm going to fix this by enforcing this limit, removing the smallest ranges when needed. That means some free space in the db file will be lost forever, but the chance of this actually happening in a real-world database is fairly small.
gitea-mirror 2026-05-23 08:28:09 -06:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@appy-one commented on GitHub (Feb 21, 2022):

Fix published in acebase version 1.15.0

<!-- gh-comment-id:1047096038 --> @appy-one commented on GitHub (Feb 21, 2022): Fix published in acebase version 1.15.0
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/acebase#48
No description provided.