Skip to content

Loading an older bndb from inside a container fails with "attempt to write a readonly database" #8183

@bpotchik

Description

@bpotchik

Bug Description:
When a bndb is extracted from a container (e.g. a .zip) it is deserialized into SQLite in-memory with SQLITE_DESERIALIZE_READONLY. If the bndb is from an older Binary Ninja version that
requires a schema upgrade, UpdateSchema then tries to write to that read-only handle and the load aborts with attempt to write a readonly database. Direct on-disk loads of the same bndb upgrade and open fine. The failure is specific to the container-extracted path.

Steps To Reproduce:

  1. Take an older bndb (e.g. one produced by Binary Ninja v1.0.730).
  2. Place it inside a zip archive.
  3. Open the zip in Binary Ninja so the container extraction path runs.

** Expected Behavior **
The bndb is upgraded in memory and opens normally, just like the on-disk case. Persistence to the original container is not required.

Metadata

Metadata

Assignees

Labels

Component: DatabaseIssue needs changes to BNDBsEffort: LowIssues require < 1 week of workImpact: LowIssue is a papercut or has a good, supported workaround

Type

No fields configured for Bug.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions