Skip to content

IndexError (RangeError (byteOffset) ... error on iOS #656

Open
@JaffaKetchup

Description

@JaffaKetchup

This report is based on a 3rd party private report to https://github.com/JaffaKetchup/flutter_map_tile_caching. As much info is supplied as is known, let me know if more is required!

Is there an existing issue?

Build info

  • objectbox version: 4.0.1
  • Flutter/Dart version: unsure
  • Build OS: 2020 Mac Mini M1
  • Deployment OS or device: iOS 17.4 (iPhone 11 & SE)

Steps to reproduce

FMTC allows users to export parts of the database, then re-import them. There is practically no difference to a standard read/write operation though. Note that an import is not the same as a complete replacement of the existing 'data.mdb' file with a new one. Both databases are open at the same time, and the needed data is transferred manually between them.

When importing the attached database into the OP's app, or the FMTC example app (https://github.com/JaffaKetchup/flutter_map_tile_caching), the following error is thrown, on iOS only:

image (1)

Raw ObjectBox file: https://drive.google.com/file/d/133UXCBJDydiN_kYlbQjrHYygdK16S82V/view?usp=sharing (do not distribute)

FMTC compatible file (contains the ObjectBox file, but with extra footer information): https://drive.google.com/file/d/1x5JoqnTvqD_QRr2bpIVcYuh6tQKt3KXu/view?usp=sharing (do not distribute)

To reproduce with the example app, clone the repo, run the example app, then follow the screenshots:

step1 step2

Select to import the FMTC compatible file, choose any conflict resolution mode (skip/merge/etc.), then tap the FAB.

Expected behavior

The same behaviour should occur on the iOS platform as on other platforms: that is, the import operation succeeds without error.

Actual behavior

The error in the screenshot is thrown.

Code

It is difficult to provide an MRE. The import algorithm can be found at https://github.com/JaffaKetchup/flutter_map_tile_caching/blob/9268675e19d246da2a9bb298aa00812e09c5891e/lib/src/backend/impls/objectbox/backend/internal_workers/standard/worker.dart#L874-L1279, but it is somewhat context dependent (note, for example, 'store' in FMTC terminology is not the same as an ObjectBox 'store'). The code runs within an isolate.

Logs, stack traces

As well as the screenshot above, see these screenshots as well - not sure if they're useful or not:

image (2)

image (3)

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions