-
Notifications
You must be signed in to change notification settings - Fork 18
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
Rustic crashes, when reading from /proc, on Android/Termux #377
Comments
Hello, First of all, thanks for using rustic and for reporting this bug. A first look at the report file shows a |
Out of curiosity, I tried backing up
I haven't done any thorough investigation to see if this could lead to @vmlemon's panic in std, with how release builds make integer underflows wrap around. This could potentially be a different issue altogether. In Although backing up |
Thanks a lot @chenxiaolong for your analysis. I'm not sure if this is the same problem as the original one, however I added a fix to that over/underflow problem in #378. |
Thanks for looking into this. I managed to reproduce the issue, with a new repository, and was able to catch some output, using
Looks like the final overflow of data, is 94.09 GiB (the scanned amount claims to be 430.98 KiB), and there's quite a lot of Attaching that crash report, and the GNU rustic_crash.txt.gz |
Out of interest, are the debugging builds available, anywhere? Or, is it just a case of passing some flag, to the usual Cargo install command, to enable debug mode? |
Just run |
Thanks. After installing
I'll probably have to revisit this, later on, since my SSH connection, to my phone dropped, and it's getting fairly late, here... |
Hey, please try installing it with |
Thanks. That gets me further, but even after installing some of the prerequisites (rhai, if I remember correctly), from Cargo manually, it looks like Termux runs out of RAM, and crashes, towards the end of the process, reliably. I might have to see if I can reproduce this, in another way, but I suspect that it's caused by the underflow issue that chenxiaolong discovered. |
You might be running into Android's process killer, which activates when an app spawns an external process (like everything that runs in Termux) that consumes excessive CPU. If you're on Android 13 or newer, try turning on Alternatively, if you don't mind installing the Android NDK on your laptop and cross compiling, this is what I did to compile my debug build:
|
Thanks. I don't know if it's a Samsung OneUI thing, but it looks like the build of Android 14, on this Galaxy S22 has the "Disable child process restrictions" option, so I'll see if it makes a difference... |
Seems that it only gets as far as package 555/561 (rustic-core?), before I get the crash, even with that option enabled, and my phone sitting on a Qi charger, in the path of an aircon, whilst constantly pecking "Enter", on the OSK, to stop it from sleeping. I guess I might have to try cross-compiling it, for Linux/ARM64, since my only other ARM64 device (an M1 MacBook Air), is out of action, at the moment. |
The underflow problem is now solved in rustic_core; it will be contained in the next rustic release - then we can see, if this also fixes the |
Thanks! I guess this will appear, in the next nightly build? If so, I'll test it, and report back, with the results. |
Not sure of how often, the rustic-core package, in the nightly builds is updated, but with the current one, it gets this far:
[WARN] ignoring error: Error: Failed to map Directory entry to ReadSourceEntry. (kind: related to internal operations): caused by: Error acquiring metadata for `slabinfo`: `WithPath { path: "/proc/slabinfo", err: Io(Custom { kind: PermissionDenied, error: Error { depth: 1, inner: Io { path: Some("/proc/slabinfo"), err: Os { code: 13, kind: PermissionDenied, message: "Permission denied" } } } }) }` : (source: /proc/slabinfo: IO error for operation on /proc/slabinfo: Permission denied (os error 13)) [WARN] ignoring error: Error: Failed to map Directory entry to ReadSourceEntry. (kind: related to internal operations): caused by: Error acquiring metadata for `softirqs`: `WithPath { path: "/proc/softirqs", err: Io(Custom { kind: PermissionDenied, error: Error { depth: 1, inner: Io { path: Some("/proc/softirqs"), err: Os { code: 13, kind: PermissionDenied, message: "Permission denied" } } } }) }` : (source: /proc/softirqs: IO error for operation on /proc/softirqs: Permission denied (os error 13)) [WARN] ignoring error: Error: Failed to map Directory entry to ReadSourceEntry. (kind: related to internal operations): caused by: Error acquiring metadata for `store_lastkmsg`: `WithPath { path: "/proc/store_lastkmsg", err: Io(Custom { kind: PermissionDenied, error: Error { depth: 1, inner: Io { path: Some("/proc/store_lastkmsg"), err: Os { code: 13, kind: PermissionDenied, message: "Permission denied" } } } }) }` : (source: /proc/store_lastkmsg: IO error for operation on /proc/store_lastkmsg: Permission denied (os error 13)) [WARN] ignoring error: Error: Failed to map Directory entry to ReadSourceEntry. (kind: related to internal operations): caused by: Error acquiring metadata for `swaps`: `WithPath { path: "/proc/swaps", err: Io(Custom { kind: PermissionDenied, error: Error { depth: 1, inner: Io { path: Some("/proc/swaps"), err: Os { code: 13, kind: PermissionDenied, message: "Permission denied" } } } }) }` : (source: /proc/swaps: IO error for operation on /proc/sw[00:03:22] backing up... ████████████████████████████████████████ 94.10 GiB/457.17 KiB 362.59 MiB/s (ETA -)[WARN] ignoring error: Error: Failed to map Directory entry to ReadSourceEntry. (kind: related to internal operations): caused by: Error acquiring metadata for `cp15_barrier`: `WithPath { path: "/proc/sys/abi/cp15_barrier", err: Io(Custom { kind: PermissionDenied, error: Error { depth: 3, inner: Io { path: Some("/proc/sys/abi/cp15_barrier"), err: Os { code: 13, kind: PermissionDenied, message: "Permission denied" } } } }) }` : (source: /proc/sys/abi/cp15_barrier: IO error for operation on /proc/sys/abi/cp15_barrier: Permission denied (os error 13)) [WARN] ignoring error: Error: Failed to map Directory entry to ReadSourceEntry. (kind: related to internal operations): caused by: Error acquiring metadata for `setend`: `WithPath { path: "/proc/sys/abi/setend", err: Io(Custom { kind: PermissionDenied, error: Error { depth: 3, inner: Io { path: Some("/proc/sys/abi/setend"), err: Os { code: 13, kind: PermissionDenied, message: "Permission denied" } } } }) }` : (source: /proc/sys/abi/setend: IO error for operation on /proc/sys/abi/setend: Permission denied (os error 13)) [WARN] ignoring error: Error: Failed to map Directory entry to ReadSourceEntry. (kind: related to internal operations): caused by: Error acquiring metadata for `sve_default_vector_length`: `WithPath { path: "/proc/sys/abi/sve_default_vector_length", err: Io(Custom { kind: PermissionDenied, error: Error { depth: 3, inner: Io { path: Some("/proc/sys/abi/sve_default_vector_length"), err: Os { code: 13, kind: PermissionDenied, message: "Permission denied" } } } }) }` : (source: /proc/sys/abi/sve_default_vector_length: IO error for operation on /proc/sys/abi/sve_default_vector_length: Permission denied (os error 13)) [WARN] ignoring error: Error: Failed to map Directory entry to ReadSourceEntry. (kind: related to internal operations): caused by: Error acquiring metadata for `swp`: `WithPath { path: "/proc/sys/abi/swp", err: Io(Custom { kind: PermissionDenied, error: Error { depth: 3, inner: Io { path: Some("/proc/sys/abi/swp"), err: Os { code: 13, kind: PermissionDenied, message: "Permission denied" } } } }) }` : (source: /proc/sys/abi/swp: IO error for operation on /proc/sys/abi/swp: Permission denied (os error 13)) [WARN] ignoring error: Error: Failed to map Directory entry to ReadSourceEntry. (kind: related to internal operations): caused by: Error acquiring metadata for `tagged_addr_disabled`: `WithPath { path: "/proc/sys/abi/tagged_addr_disabled", err: Io(Custom { kind: PermissionDenied, error: Error { depth: 3, inner: Io { path: Some("/proc/sys/abi/tagged_addr_disabled"), err: Os { code: 13, kind: PermissionDenied, message: "Permission denied" } } } }) }` : (source: /proc/sys/abi/tagged_addr_disabled: IO error for operation on /proc/sys/abi/tagged_addr_disabled: Permission denied (os error 13)) Segmentation fault root@localhost:~#
|
Interestingly, if I add individual files, and directories to a set of archives, and then, do an archive of /proc, it will eventually run, without crashing:
eration[00:03:41] backing up... ████████████████████████████████████████ 497.73 KiB/497.73 KiB 2.25 KiB/s (ETA -)Files: 18188 new, 0 changed, 0 unchanged Dirs: 2482 new, 0 changed, 0 unchanged Added to the repo: 3.9 MiB (raw: 243.1 MiB) processed 18188 files, 103.1 GiB snapshot 7a9016c8 successfully saved. [INFO] backup of /proc done.
There doesn't seem to be any singular file, that causes problems, in isolation, despite the deluge of tree-walking errors, due to permissions, and Rustic doesn't seem too fazed, by /proc/kperfmon, which usually causes BorgBackup, and Restic to take eons, reading, so I'm unsure of what's going on. |
And, after updating to the latest versions of MacOS, and XCode, fighting with PATH values, and discovering https://github.com/messense/homebrew-macos-cross-toolchains, it looks like I can at least cross-compile from Darwin/ARM64, to Linux/ARM64, but the result doesn't link, with the latest master top-of-tree:
I might just wait, for the next release, and retry, at this point... |
Out of curiosity, I tried to run the latest ARM64 release of Rustic, inside an Ubuntu chroot, on my Android phone.
It seems that I was able to create an archive, in an existing Restic repository, without issues,
but when I attempted to add /proc, as a stress test (/proc/kcore usually either ends up being read, for a very long time, or gets handled in an optimised manner, given its size, by various tools).
Version information, for Ubuntu, and Android Linux kernel:
Attaching the report file generated, after processing about 100GB of data, before it crashed:
report-55e94011-5b01-4ad7-8dd1-bd92a4cb3c65.toml.gz
The text was updated successfully, but these errors were encountered: