Skip to content
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

Arx crash if given path doesn't exist. #66

Open
mathe00 opened this issue Sep 24, 2024 · 1 comment
Open

Arx crash if given path doesn't exist. #66

mathe00 opened this issue Sep 24, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@mathe00
Copy link

mathe00 commented Sep 24, 2024

Hi,

I'd like to report a crash in arx. Apologies if this is a duplicate issue, I’m reporting it quickly.

Steps to Reproduce:

  1. Tried running the following command:

    arx create --outfile ExampleArchive ExampleArchive.arx
  2. arx crashed with the following error message:

    Well, this is embarrassing.
    arx had a problem and crashed...
  3. Retried with:

    arx create --outfile ExampleArchive/ ExampleArchive.arx

    It crashed again with a similar error.

Environment:

  • OS: Arch Linux [64-bit]
  • arx version: 0.2.1
  • Crate version: 0.2.1

Error Details:

  • The crash occurred in the file /libarx-0.2.1/src/create/fs_adder.rs at line 143.
  • Cause: called Result::unwrap() on an Err value: Error { depth: 0, inner: Io { path: Some("ExampleArchive.arx"), err: Os { code: 2, kind: NotFound, message: "No such file or directory" } } }.

Crash Report (as extracted):

"name" = "arx"
"operating_system" = "Arch Linux [64-bit]"
"crate_version" = "0.2.1"
"explanation" = """
Panic occurred in file '/home/temo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libarx-0.2.1/src/create/fs_adder.rs' at line 143
"""
"cause" = 'called `Result::unwrap()` on an `Err` value: Error { depth: 0, inner: Io { path: Some("ExampleArchive.arx"), err: Os { code: 2, kind: NotFound, message: "No such file or directory" } } }'
"method" = "Panic"
"backtrace" = """

   0: 0x5e85a33ebce6 - core::result::unwrap_failed::h635713c629d81684
   1: 0x5e85a33ff8d7 - libarx::create::fs_adder::FsAdder::add_from_path_with_filter::h3eaec6ef31c11959
   2: 0x5e85a34071cc - arx::create::create::hb3e18840522cc531
   3: 0x5e85a3423601 - arx::main::h417fd83e1d4276d2
   4: 0x5e85a3416b03 - std::sys_common::backtrace::__rust_begin_short_backtrace::h95ea882ff6bfd673
   5: 0x5e85a3426a39 - std::rt::lang_start::{{closure}}::ha16fb5f386b2120b
   6: 0x5e85a377ab40 - std::rt::lang_start_internal::h5add80e16e4e0045
   7: 0x5e85a3426a25 - main
   8: 0x73b12df7de08 - <unresolved>
   9: 0x73b12df7decc - __libc_start_main
  10: 0x5e85a33ebf05 - _start
  11:        0x0 - <unresolved>"""

Thanks for looking into this! Let me know if you need further details.

@mgautierfr
Copy link
Member

This is because the value after the option --outfile must be the name of the archive to create. Here you pass the directory to archive as outfile. And arx try to archive the archive itself (which doesn't exist yet)
The syntax is arx create --outfile archive_path.arx directory/to/archive

But anyway, arx should properly exit with an error message and not crash as it is now. Thanks for the report, I will fix it.

@mgautierfr mgautierfr changed the title Bug Report: arx Crash on File Creation Arx crash if given path doesn't exist. Sep 25, 2024
@mgautierfr mgautierfr added the bug Something isn't working label Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants