Repository navigation
fix: check page 0 by CRC alone, not the data-page trailer rule - #30
Merged
Merged
Conversation
Synthetic pages only. Page 0 carries rolled fingerprint text in
0x400..0xFFC (SPECIFICATION.md section 3.4), so 0xFF3 and 0xFF8..0xFFB
are text, while the trailer rule is for pages 1..N (section 4.1).
Seen failing before the fix: `cargo test -p opensqlany --lib` reports
2 failed (store::tests::page_zero_with_a_text_tail_passes_on_crc_alone
with `BadTrailer { page: 0 }` from page_verified, and
ap::tests::integrity_check_treats_page_zero_by_crc_alone, panicking on
the same BadTrailer from check_integrity). The bad-CRC and data-page
tests already pass and guard against over-relaxing the fix.
Page 0 is the superblock. Its 0x400..0xFFC holds the rolled fingerprint text (SPECIFICATION.md section 3.4), so 0xFF3 and 0xFF8..0xFFB are text and failed the reserved-zero trailer rule on real files. Page::verify_trailer now returns Ok for page 0; PageStore::page_verified, verified_pages and the ApModel integrity checks keep the CRC check on page 0 and both checks on pages 1..N. SPECIFICATION.md sections 2 and 4.1 state the page-0 scope.
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
opensqlanywhere-docs | e63a4bd | Oct 31 2026, 05:14 PM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
Page 0 is the superblock. Its
0x400..0xFFCholds the rolled engine fingerprint text (SPECIFICATION.md section 3.4), so0xFF3and0xFF8..0xFFBare text, not a trailer. The reserved-zero trailer rule was applied to every page and failed page 0 on real QuickBooks files (opyright (c)at0xFF0..0xFFB). The trailer was measured on pages 1..N only (section 4.1).Page 0 now gets the CRC check but not the trailer rule. Pages 1..N keep both. SPECIFICATION.md sections 2 and 4.1 state the page-0 scope; CHANGELOG has an Unreleased "Fixed" entry.
API / behavior changes
Page::verify_trailerreturnsOk(())for page 0.PageStore::page_verified,PageStore::verified_pagesand theApModelintegrity checks (learn,deobfuscate, calibration page selection) no longer reportError::BadTrailer/WarningKind::BadTrailerfor page 0. A bad CRC on page 0 still fails.Test
Synthetic bytes only. The first commit adds the tests and fails without the fix (
BadTrailer { page: 0 }); the second makes them pass.page_verifiedBadCrc0xFF3set fails withBadTrailerApModel's integrity check treats page 0 the same waycargo fmt --all,cargo clippy --workspace --all-targets -- -D warningsandcargo test --workspacepass. A real QuickBooks file was checked by hand (not committed):page_verified(0)is Ok and all 10773 pages verify.