You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried 2.2.2 on a 100+GB zip file on a network storage, and get_metadata still scans large parts of the file because of this validation in central_header_to_zip_file:
if data_start > central_directory.directory_start{
returnErr(InvalidArchive(
"File data can't start after the central directory",
));
}
There might be a reason (an invariant) for this check to run already when opening the archive, but for random access of big files (especially over the network), it would be good if those checks would be deferred until the file is accessed.
Full stack trace:
3: zip::read::find_data_start
at /home/johannes/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zip-2.2.2/src/read.rs:352:5
4: zip::read::central_header_to_zip_file
at /home/johannes/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zip-2.2.2/src/read.rs:1071:22
5: zip::read::<impl zip::read::zip_archive::ZipArchive<R>>::read_central_header
at /home/johannes/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zip-2.2.2/src/read.rs:654:24
6: zip::read::<impl zip::read::zip_archive::ZipArchive<R>>::get_metadata::{{closure}}
at /home/johannes/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zip-2.2.2/src/read.rs:616:34
7: core::result::Result<T,E>::and_then
at /home/johannes/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:1348:22
8: zip::read::<impl zip::read::zip_archive::ZipArchive<R>>::get_metadata
at /home/johannes/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zip-2.2.2/src/read.rs:615:30
9: zip::read::<impl zip::read::zip_archive::ZipArchive<R>>::with_config
at /home/johannes/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zip-2.2.2/src/read.rs:714:22
10: zip::read::<impl zip::read::zip_archive::ZipArchive<R>>::new
at /home/johannes/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zip-2.2.2/src/read.rs:707:9
The text was updated successfully, but these errors were encountered:
Describe the bug
(I know about recently closed #231)
I tried 2.2.2 on a 100+GB zip file on a network storage, and
get_metadata
still scans large parts of the file because of this validation incentral_header_to_zip_file
:zip2/src/read.rs
Lines 1071 to 1077 in 7c20fa3
There might be a reason (an invariant) for this check to run already when opening the archive, but for random access of big files (especially over the network), it would be good if those checks would be deferred until the file is accessed.
Full stack trace:
The text was updated successfully, but these errors were encountered: