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 in Client::head with automatic GZIP decompression #82

Closed
GyrosOfWar opened this issue May 5, 2017 · 0 comments
Closed

Panic in Client::head with automatic GZIP decompression #82

GyrosOfWar opened this issue May 5, 2017 · 0 comments

Comments

@GyrosOfWar
Copy link

When using reqwest::Client to make a HEAD request with GZIP decompression enabled (which is the default), a panic happens in the library.

Code to reproduce:

use reqwest::Client;
fn main() {
    let url = "https://www.google.com/";
    let client = Client::new().unwrap();
    client.head(url).send();
}

Backtrace:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { repr: Custom(Custom { kind: UnexpectedEof, error: StringError("failed to fill whole buffer") }) }', /checkout/src/libcore/result.rs:859
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
             at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at /checkout/src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at /checkout/src/libstd/sys_common/backtrace.rs:60
             at /checkout/src/libstd/panicking.rs:355
   3: std::panicking::default_hook
             at /checkout/src/libstd/panicking.rs:371
   4: std::panicking::rust_panic_with_hook
             at /checkout/src/libstd/panicking.rs:549
   5: std::panicking::begin_panic
             at /checkout/src/libstd/panicking.rs:511
   6: std::panicking::begin_panic_fmt
             at /checkout/src/libstd/panicking.rs:495
   7: rust_begin_unwind
             at /checkout/src/libstd/panicking.rs:471
   8: core::panicking::panic_fmt
             at /checkout/src/libcore/panicking.rs:69
   9: core::result::unwrap_failed
             at /checkout/src/libcore/macros.rs:29
  10: <core::result::Result<T, E>>::unwrap
             at /checkout/src/libcore/result.rs:737
  11: reqwest::client::Decoder::from_hyper_response
             at /home/martin/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/reqwest-0.5.1/src/client.rs:458
  12: reqwest::client::RequestBuilder::send
             at /home/martin/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/reqwest-0.5.1/src/client.rs:331
  13: main::bug_repro
             at ./src/main.rs:41
  14: main::main
             at ./src/main.rs:47
  15: std::panicking::try::do_call
             at /checkout/src/libstd/panicking.rs:454
  16: __rust_maybe_catch_panic
             at /checkout/src/libpanic_unwind/lib.rs:98
  17: std::rt::lang_start
             at /checkout/src/libstd/panicking.rs:433
             at /checkout/src/libstd/panic.rs:361
             at /checkout/src/libstd/rt.rs:57
  18: main
  19: __libc_start_main
  20: _start

Here's the debug log: log.txt
When I disable automatic decompression (client.gzip(false)), it works fine.

seanmonstar added a commit that referenced this issue May 5, 2017
seanmonstar added a commit that referenced this issue May 5, 2017
seanmonstar added a commit that referenced this issue May 5, 2017
repi pushed a commit to EmbarkStudios/reqwest that referenced this issue Dec 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant