pajowu / signal-backup-decode

Decode Signal Backups
GNU General Public License v3.0
217 stars 18 forks source link

Ubuntu 22.04 Support - thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: TryFromIntError(())' #59

Open kohms opened 1 year ago

kohms commented 1 year ago

Hi, I used to run signal-backup-decode a while ago (I think it was on Ubuntu 20.04). It worked perfectly fine, thanks for the great and simple tooling. Unfortunately, I upgraded to a new install of Ubuntu 22.04 and tried to decrypt a backup from today to archive my messages and offload them from my Android Phone. The decryption freezes, because a thread panics, is there something I can do to make it work on Ubuntu 22.04 again?

Details:

OS:

$ cat /etc/os-release 
PRETTY_NAME="Ubuntu 22.04.2 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.2 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

Signal version: 6.26.4

Steps to reproduce:

$ sudo apt install libsqlite3-dev libssl-dev pkg-config
$ cargo install signal-backup-decode
$ export PATH=$PATH:/home/xxx/.cargo/bin
$ signal-backup-decode --version
signal-backup-decode 0.2.3
$ export RUST_BACKTRACE=full
$ signal-backup-decode backups/signal-2023-07-27-19-10-12.backup -p xxx -o backups/signal-2023-07-27-19-10-12 -f
19:30:05 [INFO] Output path: backups/signal-2023-07-27-19-10-12
19:30:05 [INFO] Input file: backups/signal-2023-07-27-19-10-12.backup
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: TryFromIntError(())', /home/xxx/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-0.10.55/src/cipher_ctx.rs:565:50
stack backtrace:
   0:     0x55ed2c029fdf - std::backtrace_rs::backtrace::libunwind::trace::hf4179216f2af7039
                               at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x55ed2c029fdf - std::backtrace_rs::backtrace::trace_unsynchronized::hfa14eb12e4b8ce4f
                               at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x55ed2c029fdf - std::sys_common::backtrace::_print_fmt::hc81cbee2043ec868
                               at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x55ed2c029fdf - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h7b2be2009a6bcba2
                               at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x55ed2c04bd6e - core::fmt::write::hccee7882499b620f
                               at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/core/src/fmt/mod.rs:1209:17
   5:     0x55ed2c00d165 - std::io::Write::write_fmt::h69e1f37bb24a9f49
                               at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/std/src/io/mod.rs:1682:15
   6:     0x55ed2c029d95 - std::sys_common::backtrace::_print::h86df92192f156e4c
                               at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x55ed2c029d95 - std::sys_common::backtrace::print::h3b76d5113eea7ae3
                               at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x55ed2c01655f - std::panicking::default_hook::{{closure}}::h634bc187e8e58de8
                               at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/std/src/panicking.rs:267:22
   9:     0x55ed2c016218 - std::panicking::default_hook::h262aef5e4abfc826
                               at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/std/src/panicking.rs:286:9
  10:     0x55ed2c016b6b - std::panicking::rust_panic_with_hook::hedb8a8e4067bf251
                               at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/std/src/panicking.rs:688:13
  11:     0x55ed2c02a337 - std::panicking::begin_panic_handler::{{closure}}::hf501de419c9dcde3
                               at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/std/src/panicking.rs:579:13
  12:     0x55ed2c02a12c - std::sys_common::backtrace::__rust_end_short_backtrace::h8542e72ad556a307
                               at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/std/src/sys_common/backtrace.rs:137:18
  13:     0x55ed2c016712 - rust_begin_unwind
                               at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/std/src/panicking.rs:575:5
  14:     0x55ed2be58123 - core::panicking::panic_fmt::h1688e859668ba1d0
                               at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/core/src/panicking.rs:65:14
  15:     0x55ed2be58493 - core::result::unwrap_failed::h9f204f08b8ff9323
                               at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/core/src/result.rs:1791:5
  16:     0x55ed2bfb6423 - openssl::cipher_ctx::CipherCtxRef::cipher_update::h2406b399f101ef7b
  17:     0x55ed2bfb5e1d - openssl::symm::cipher::hf1e2ceda84d24777
  18:     0x55ed2bfb5d3c - openssl::symm::decrypt::h5f29f82e65c48171
  19:     0x55ed2be9ddbe - signal_backup_decode::decrypter::Decrypter::decrypt::h95894db11b65a627
  20:     0x55ed2be97299 - signal_backup_decode::input::InputFile::read_data::h45bfa15ec8b5930d
  21:     0x55ed2be975f1 - <signal_backup_decode::input::InputFile as core::iter::traits::iterator::Iterator>::next::ha9e16bf73700b59e
  22:     0x55ed2be92c3b - std::sys_common::backtrace::__rust_begin_short_backtrace::h84ed26dc5a626963
  23:     0x55ed2be74f9f - core::ops::function::FnOnce::call_once{{vtable.shim}}::ha0581d6705a2724e
  24:     0x55ed2c02dda3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hc3323dde5906bdc2
                               at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/alloc/src/boxed.rs:1987:9
  25:     0x55ed2c02dda3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h3b73c33abf11659b
                               at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/alloc/src/boxed.rs:1987:9
  26:     0x55ed2c02dda3 - std::sys::unix::thread::Thread::new::thread_start::h029e13c652d93bcf
                               at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/std/src/sys/unix/thread.rs:108:17
  27:     0x7f5411694b43 - start_thread
                               at ./nptl/./nptl/pthread_create.c:442:8
  28:     0x7f5411726a00 - clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
  29:                0x0 - <unknown>
Read vs. written frames: [00:00:46] [--------------------------------------------------]     0/1  

The process seem not to progress afterwards any more, it does not terminate, but it only consumes 35,5 MB memory and 0 CPU.

Is maybe some shared OS lib to recent in Ubuntu 22.04 and broke compatibility with signal-backup-decode?

Thanks for any hints

kohms commented 1 year ago

Hm, I saw the same behavior inside a ubuntu:20.04 docker container, maybe openssl introduced changes?

root@7a4869a7a72f:/work# signal-backup-decode backups/signal-2023-07-27-19-10-12.backup -p xxx -o backups/signal-2023-07-27-19-10-12 -f                           
19:55:40 [INFO] Output path: backups/signal-2023-07-27-19-10-12
19:55:40 [INFO] Input file: backups/signal-2023-07-27-19-10-12.backup
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: TryFromIntError(())', /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/openssl-0.10.55/src/cipher_ctx.rs:565:50
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Read vs. written frames: [00:00:40] [--------------------------------------------------]     0/1