Narigo/keepass-diff

Thread main panick at Option::unwrap

sed11q opened this issue · 4 comments

keepass-diff version: 1.0.0

I get the following error on keepass-diff file1.kdbx file2.kdbx

thread 'main' panicked at 'called Option::unwrap() on a None value', /usr/src/rustc-1.41.0/src/libcore/macros/mod.rs:15:40
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace.

Stack backtrace (1):
stack backtrace:
0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
1: core::fmt::write
2: std::io::Write::write_fmt
3: std::panicking::default_hook::{{closure}}
4: std::panicking::default_hook
5: std::panicking::rust_panic_with_hook
6: rust_begin_unwind
7: core::panicking::panic_fmt
8: core::panicking::panic
9: keepass::xml_parse::parse_xml_block
10: keepass::parse::kdbx3::parse
11: keepass::db::Database::open
12: keepass_diff::kdbx_to_group
13: keepass_diff::main
14: std::rt::lang_start::{{closure}}
15: std::panicking::try::do_call
16: __rust_maybe_catch_panic
17: std::rt::lang_start_internal
18: main
19: __libc_start_main
20: _start

Stack backtrace (full):
stack backtrace:
0: 0x55c4a855ec33 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h1c7dc9d13b6f4ff7
1: 0x55c4a85746ed - core::fmt::write::he7f9bcb1b13e2a6d
2: 0x55c4a855dd35 - std::io::Write::write_fmt::h8db74c72e5bf9ed8
3: 0x55c4a856078e - std::panicking::default_hook::{{closure}}::h6ad58ac30a23c7db
4: 0x55c4a85604a0 - std::panicking::default_hook::hd8f32a4f20deeefb
5: 0x55c4a8560e6b - std::panicking::rust_panic_with_hook::h8818572c15a230c1
6: 0x55c4a8560a1e - rust_begin_unwind
7: 0x55c4a8576b1e - core::panicking::panic_fmt::h8889eb235bce60d6
8: 0x55c4a8576a6a - core::panicking::panic::h659a21287d217925
9: 0x55c4a84c2a60 - keepass::xml_parse::parse_xml_block::h55049f9ac6f76147
10: 0x55c4a84bcb12 - keepass::parse::kdbx3::parse::hf247c4cb5d21183f
11: 0x55c4a84ae1a1 - keepass::db::Database::open::h2be73775cf9cf781
12: 0x55c4a84a4f1f - keepass_diff::kdbx_to_group::h9fe3e77858a978d9
13: 0x55c4a84a420e - keepass_diff::main::hb8dfe707d6ab44e2
14: 0x55c4a84996a2 - std::rt::lang_start::{{closure}}::he34e77fb0be4fd18
15: 0x55c4a85608b3 - std::panicking::try::do_call::h988c445d1d833997
16: 0x55c4a85616aa - __rust_maybe_catch_panic
17: 0x55c4a8554a2c - std::rt::lang_start_internal::h191dbef2487fd2cf
18: 0x55c4a84a51c2 - main
19: 0x7f78a44b4b97 - __libc_start_main
20: 0x55c4a848dada - _start
21: 0x0 -

Is there anything I'm doing wrong?

Sed11q

Sorry for getting back to you this late.
Can you provide reproducer files for this?
Does it work with the example/test files in this repository for you?

Older versions had trouble when comparing in one direction but worked in the other due to a bug. I thought that was fixed, but you could also test keepass-diff file2.kdbx file1.kdbx instead of keepass-diff file1.kdbx file2.kdbx and see if that helps. Otherwise it would be great to have a reproducer for this issue and I can have a look

@sed11q maybe it's caused by this bug here: #18
Does your file have entries without a title maybe?

@sed11q did you have a chance to check whether your test file has entries without a title?

@sed11q if you have a chance to confirm that it's working with the latest release, that would be great :)
I'll close this issue now and will reopen if there still is an issue.