jubako / arx

Store files and directory in an archive. Like tar, but faster and with direct random access.
MIT License
151 stars 2 forks source link

arx crashed on my first archive... #88

Open mbridon opened 4 days ago

mbridon commented 4 days ago

So, I created my first arx archive ("arxive"? :zany_face:):

$ arx create Projects/ibus-cangjie/ -v -o ibus-cangjie

Then I tried to extract it;

$ arx extract ibus-cangjie
[... snip 49093 lines of errors ...]

Alright, that went well... :facepalm:

So, I now have 13389 files or error reports. Want to look at them one by one? :joy:

Here is one:

$ cat /tmp/report-fffde92d-da93-422f-a90d-b3a72af3d10a.toml
"name" = "arx"
"operating_system" = "Fedora 41.0.0 [64-bit]"
"crate_version" = "0.3.2"
"explanation" = """
Panic occurred in file '/home/bochecha/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libarx-0.3.2/src/tools.rs' at line 217
"""
"cause" = 'called `Result::unwrap()` on an `Err` value: Os { code: 17, kind: AlreadyExists, message: "File exists" }'
"method" = "Panic"
"backtrace" = """
   0:     0x561bd5110e64 - rust_begin_unwind
   1:     0x561bd4d24e83 - core::panicking::panic_fmt::h815ef412e87b03aa
   2:     0x561bd4d252f6 - core::result::unwrap_failed::h0a82129c7e885128
   3:     0x561bd4e5dd00 - rayon_core::scope::ScopeBase::execute_job_closure::h2cc325eb606b44e8
   4:     0x561bd4e4f498 - <rayon_core::job::HeapJob<BODY> as rayon_core::job::Job>::execute::hc72360b72d159738
   5:     0x561bd4d217e6 - rayon_core::registry::WorkerThread::wait_until_cold::h901a170b160c8aeb
   6:     0x561bd506a082 - rayon_core::registry::ThreadBuilder::run::h0dc8128d4faea263
   7:     0x561bd506fd5a - std::sys::backtrace::__rust_begin_short_backtrace::ha47dd9667ecf3f6b
   8:     0x561bd506ecf2 - core::ops::function::FnOnce::call_once{{vtable.shim}}::hcdbe244f1d4fa616
   9:     0x561bd511746b - std::sys::pal::unix::thread::Thread::new::thread_start::h8914793b525b6448
  10:     0x7f0768470cd7 - start_thread
  11:     0x7f07684f4c8c - __GI___clone3
  12:                0x0 - <unresolved>
"""
mgautierfr commented 4 days ago

I suspect you have tried to extract the archive in the same place than the source. So writing the files fails because (source) files already exist. And as writing files is done in threads this is not properly catched.

Thanks for the report. I will probably fix it by printing a proper message if the file already exists and also add an option to overwrite existing files or not.

mbridon commented 3 days ago

Ah, that's very possible indeed...

I was in my home directory when I created the archive with the path Projects/ibus-cangjie/.

Not knowing how arx would extract I ran in my home dir the command arx extract, and indeed, at that point the whole tree still exists...

mbridon commented 3 days ago

Ah, that's very possible indeed...

I was in my home directory when I created the archive with the path Projects/ibus-cangjie/.

Not knowing how arx would extract I ran in my home dir the command arx extract, and indeed, at that point the whole tree still exists...

And that was exactly the problem:

$ arx extract ibus-cangjie -C /tmp

And that worked perfectly. :wink:

So yes, a warning that the path already exists and what to do about it (overwrite, cancel) would work fine. :blush: