alucryd / oxyromon

Rusty ROM OrgaNizer
Other
111 stars 13 forks source link

traceback when importing "Non-Game - Audiobooks (Audio CD)" from no-intro #69

Closed anderbubble closed 1 year ago

anderbubble commented 1 year ago

current version: b48c0192d72a1fdae62ad6e8e9c1b1e3c91f980e

Processing "Non-Game - Audiobooks (Audio CD) (20230125-135311).dat"
System: Non-Game - Audiobooks (Audio CD)
Version: 20230125-135311
Games: 163
Processing system
Deleting old games
Processing games
⠁                                                                                                                          0/163 0/s 00:00:05 (00:00:00) [--------------------------------------------------------------------------------]
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/database.rs:849:36
stack backtrace:
   0:     0x55fcdbcf05d3 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::he6993616c48c046d
   1:     0x55fcdbd1b13c - core::fmt::write::h015f848e7775ab2c
   2:     0x55fcdbcea3d5 - std::io::Write::write_fmt::h8250842fca990ce5
   3:     0x55fcdbcf1f41 - std::panicking::default_hook::{{closure}}::h7810480484374dd6
   4:     0x55fcdbcf1c13 - std::panicking::default_hook::hfea8dba4e7fe6742
   5:     0x55fcdbcf25f3 - std::panicking::rust_panic_with_hook::h8de7948a9082b958
   6:     0x55fcdbcf24a9 - std::panicking::begin_panic_handler::{{closure}}::h3bab450da5856916
   7:     0x55fcdbcf0a84 - std::sys_common::backtrace::__rust_end_short_backtrace::h2949d295702156bb
   8:     0x55fcdbcf2202 - rust_begin_unwind
   9:     0x55fcdb698b93 - core::panicking::panic_fmt::hbf4d9acd002fc8ef
  10:     0x55fcdb698a5d - core::panicking::panic::hf8046a8a4311daf8
  11:     0x55fcdb82cc7b - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::hc4574b4f5eb26bab
  12:     0x55fcdb868f26 - oxyromon::import_dats::import_dat::{{closure}}::h75693b2536cd0639
  13:     0x55fcdb8d4950 - oxyromon::main::main::{{closure}}::h9a520e8d13a7288f
  14:     0x55fcdb81e708 - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h9ace8a95a2378252
  15:     0x55fcdb6c9b8f - std::thread::local::LocalKey<T>::with::h27c1f64c0f3000ea
  16:     0x55fcdb7f838f - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h180476fb7a635e66
  17:     0x55fcdb78c823 - async_global_executor::reactor::block_on::h3d655afd4bf4c949
  18:     0x55fcdb8db65a - async_global_executor::executor::block_on::he7e212b23b0a1e64
  19:     0x55fcdb6ccf0a - std::thread::local::LocalKey<T>::with::hdab315f51dd0929f
  20:     0x55fcdb6ce628 - std::thread::local::LocalKey<T>::with::hfc6659e23c4eb614
  21:     0x55fcdb77f819 - async_std::task::builder::Builder::blocking::h8f9cd187888d1974
  22:     0x55fcdb783d91 - oxyromon::main::h744abdc3b683f514
  23:     0x55fcdb731ca6 - std::sys_common::backtrace::__rust_begin_short_backtrace::h91e703cb4b681908
  24:     0x55fcdb6c8835 - std::rt::lang_start::{{closure}}::h364add4fddc8527b
  25:     0x55fcdbce2832 - std::rt::lang_start_internal::hed0e237781f1c66f
  26:     0x55fcdb783dc8 - main
  27:     0x7f7f60a1eeb0 - __libc_start_call_main
  28:     0x7f7f60a1ef60 - __libc_start_main@GLIBC_2.2.5
  29:     0x55fcdb6992e5 - _start
  30:                0x0 - <unknown>
alucryd commented 1 year ago

Weird, I can't reproduce here. That would happen if one of the roms were missing its CRC in the DAT file, but it looks fine (I downloaded the daily P/C pack). Can you post the DAT so I can have a look?

alucryd commented 1 year ago

https://github.com/alucryd/oxyromon/commit/acbe6f66b491ce7c08be30ca7ae198c620052c8a should print the name of the faulty game (if any) when importing.

anderbubble commented 1 year ago

Non-Game - Audiobooks (Audio CD) (20230125-135311).dat.gz

alucryd commented 1 year ago

That's it, the DAT I downloaded didn't list the cue files, for some reason the parent/clone one doesn't, but the standard one does. The cue files don't have any CRC information, only SHA1. That's unfortunate, up until now every DAT I've encountered has had CRC information :/

Processing "Non-Game - Audiobooks (Audio CD) (20230125-135311).dat"
System: Non-Game - Audiobooks (Audio CD)
Version: 20230125-135311
Games: 163
Processing system
Deleting old games
Processing games
⠁                           0/163 0/s 00:00:00 (00:00:00) [--------------------------------------------------------------------------------]thread 'main' panicked at 'Game "Chabon, Michael - The Yiddish Policemen's Union (USA) (Disc 01).cue" has no CRC', src/database.rs:928:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I could make CRC optional like MD5 and SHA1, but then the import process would need another rework, matching files will take significantly more time if I need to compute all 3 checksums and hope there's at least one of them in the database.

Or I could just display in the web ui what type of checksum is available in the roms card, and let users adjust their import command accordingly. Making the whole process worse for a single non-standard DAT doesn't seem like a good idea.

anderbubble commented 1 year ago

imo just logging something like "can't process {entry}: no CRC" and ignoring the entry would be fine, just not crashing out.

alucryd commented 1 year ago

Let's go with that then, I'll implement it probably tomorrow.

alucryd commented 1 year ago

Fixed in develop :) ROMs without CRC are now skipped.

anderbubble commented 1 year ago

Thanks!