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

Panic over libarchive_seek_callback when using compress-tools with tokio #96

Open
YaxinCheng opened this issue Jan 2, 2023 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@YaxinCheng
Copy link
Contributor

I am trying to list content from this
test.zip. However, it gives me error like this

internal error: entered unreachable code: We need to use libarchive_seek_callback() underlying.
thread 'tokio-runtime-worker' panicked at 'internal error: entered unreachable code: We need to use libarchive_seek_callback() underlying.'

Here is my Cargo.toml and code

#Cargo.toml

[dependencies]
compress-tools = { version = "0.14", features = ["tokio_support"] }
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
#[tokio::test]
async fn test_list() -> Result<()> {
    let test_zip = concat!(env!("CARGO_MANIFEST_DIR"), "/test_resources/test.zip");
    let zip_file = File::open(test_zip).await?;
    let content = compress_tools::tokio_support::list_archive_files(zip_file).await?;
    println!("content={:?}", content);
    Ok(())
}

Environment:

  • OS: macOS 13.1
  • libarchive: 3.6.2 (installed from brew)

Any help is appreciated

@otavio
Copy link
Member

otavio commented Jan 3, 2023

Thanks for reporting this. I added a draft PR (#97) which adds the integration tests to trigger the error.

The panic happens inside the common async code. Unfortunately, it lacks the real Seek implementation for the wrapper, so we see the error. Would you be willing to look at it?

@YaxinCheng
Copy link
Contributor Author

YaxinCheng commented Jan 4, 2023

The PR looks right. Thanks.

Would it be possible to fix this bug? I am not quite sure about the Seek implementation or the feasibility of implementing it

@otavio otavio added the help wanted Extra attention is needed label Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Development

No branches or pull requests

2 participants