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

Crash when dumping tar.gz or tar format from snapshot #1380

Closed
cultpony opened this issue Dec 6, 2024 · 1 comment · Fixed by rustic-rs/rustic_core#381
Closed

Crash when dumping tar.gz or tar format from snapshot #1380

cultpony opened this issue Dec 6, 2024 · 1 comment · Fixed by rustic-rs/rustic_core#381
Labels
A-core Area: Generally related to `rustic_core` C-bug Category: Something isn't working as expected

Comments

@cultpony
Copy link

cultpony commented Dec 6, 2024

name = "rustic-rs"
operating_system = "Ubuntu 24.4.0 (noble) [64-bit]"
crate_version = "0.9.5"
explanation = """
Panic occurred in file '/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rustic_core-0.7.2/src/vfs.rs' at line 540
"""
cause = "index out of bounds: the len is 1 but the index is 18446744073709551615"
method = "Panic"
backtrace = """
   0:     0x5584050da049 - <unresolved>
   1:     0x558405e2a077 - <unresolved>
   2:     0x558405f4eeaf - <unresolved>
   3:     0x558405f4ecc8 - <unresolved>
   4:     0x558405f4ec29 - <unresolved>
   5:     0x558405f4ec1c - <unresolved>
   6:     0x558404ecb31f - <unresolved>
   7:     0x558404ecb2f1 - <unresolved>
   8:     0x558405cdae02 - <unresolved>
   9:     0x558405cda893 - <unresolved>
  10:     0x558405f5c4eb - <unresolved>
  11:     0x558405cc4b1b - <unresolved>
  12:     0x558405e0ba04 - <unresolved>
  13:     0x558405e06744 - <unresolved>
  14:     0x558404f1e9f3 - <unresolved>
  15:     0x558404f213b8 - <unresolved>
  16:     0x558404f25463 - <unresolved>
  17:     0x558404f21ba3 - <unresolved>
  18:     0x558404f258e5 - <unresolved>
  19:     0x6ffed042a1ca - <unresolved>
  20:     0x6ffed042a28b - __libc_start_main
  21:     0x558404f152f5 - <unresolved>
  22:                0x0 - <unresolved>
"""

Reproducer:

A repository was created on a relatively fresh Ubuntu VM with no extra options on init other than password and local store.

A backup is created by configuring multiple snapshots with associated sources to backup the entire machine (one-file-system to restrict it to only disk data), make a mysql dump prior to one snapshot and backup the boot loader.

Forget is not configured.

When running rustic dump --archive tar --file dump.tar.gz <snapshot> (or with targz instead of tar), the command crashes, producing above crashdump;

[INFO] using config /root/.config/rustic/rustic.toml
[INFO] repository local:/var/backup: password is correct.
[INFO] using cache at /root/.cache/rustic/<id>
[00:00:00] reading index...  ████████████████████████████████████████          6/6
[00:00:00] getting snapshot...   ████████████████████████████████████████          0
[INFO] getting snapshot ...
Well, this is embarrassing.

rustic-rs had a problem and crashed. To help us diagnose the problem you can send us a crash report.

We have generated a report file at "/tmp/report-0161cd70-d755-4f45-b68e-5b861c7fea64.toml". Submit an issue or email with the subject of "rustic-rs Crash Report" and include the report as an attachment.

- Homepage: https://rustic.cli.rs/
- Authors: the rustic-rs team

We take privacy seriously, and do not perform any automated error collection. In order to improve the software, we rely on people to submit reports.

Thank you kindly!
Aborted (core dumped)

Disabling cache has no effect. The snapshot ID definitely exists and the mysql snapshot can be dumped this way, it's only the root filesystem snapshot that can't be dumped this way.

My goal with the configuration is to have a full restic repo locally on the machine, but due to some restrictions, I have to store the backup externally as a tar file, zips are only useful as a workaround.

Running rustic check --read-data doesn't indicate any corruption. This happens even when recreating the backup repository.

@github-actions github-actions bot added the S-triage Status: Waiting for a maintainer to triage this issue/PR label Dec 6, 2024
@aawsome
Copy link
Member

aawsome commented Dec 6, 2024

Thanks @cultpony for opening this issue - you have discovered a bug which appears when reading empty (0 size) files from the repository. I'll make a fix for this.

@aawsome aawsome added C-bug Category: Something isn't working as expected A-core Area: Generally related to `rustic_core` and removed S-triage Status: Waiting for a maintainer to triage this issue/PR labels Dec 6, 2024
github-merge-queue bot pushed a commit to rustic-rs/rustic_core that referenced this issue Dec 10, 2024
There was a bug when using partition_point which in that case does not
gave guarentees about its behavior. Hence the whole logic was refactored
and unit/integration tests were added.

closes rustic-rs/rustic#1380
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Generally related to `rustic_core` C-bug Category: Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants