Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix several crashes in repair from corrupted pages #888

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

mconst
Copy link
Contributor

@mconst mconst commented Nov 4, 2024

During repair, it's normal to encounter a partially-written tree, which can contain arbitrary invalid data. We can't crash when that happens; we need to gracefully fail so the repair can try the other commit slot instead.

This first batch of fixes only covers the crashes most likely to occur in practice: the ones that can happen on a 64-bit machine, without malicious input. There are several more arithmetic overflows that can only happen on 32-bit machines, which are simple to fix but I haven't done yet (I can probably look at these after #878). There are also a number of trickier crashes that can only happen when there's corrupt data with a valid checksum, which is unlikely to happen accidentally but definitely possible with malicious input. #878 will greatly improve the situation there.

If it's useful, I have .redb files which will reproduce most of these crashes; if you'd like them, just let me know.

During repair, it's normal to encounter a partially-written tree, which
can contain arbitrary invalid data. We can't crash when that happens;
we need to gracefully fail so the repair can try the other commit slot
instead.

This first batch of fixes only covers the crashes most likely to occur in
practice: the ones that can happen on a 64-bit machine, without malicious
input.
Copy link
Owner

@cberner cberner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@cberner cberner merged commit 2388afc into cberner:master Nov 5, 2024
3 checks passed
@mconst mconst deleted the fix_repair_crashes branch November 5, 2024 07:07
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