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 ext/fetch during WPT #12236

Closed
lucacasonato opened this issue Sep 26, 2021 · 2 comments · Fixed by #12244
Closed

Panic in ext/fetch during WPT #12236

lucacasonato opened this issue Sep 26, 2021 · 2 comments · Fixed by #12244
Labels
bug Something isn't working correctly

Comments

@lucacasonato
Copy link
Member

https:/denoland/deno/pull/12232/checks?check_run_id=3713550001#step:39:14378

Error: thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: InvalidHeaderValue', /home/runner/work/deno/deno/ext/fetch/lib.rs:224:49
stack backtrace:
   0:     0x55b8dee051e0 - std::backtrace_rs::backtrace::libunwind::trace::ha0ad43e8a952bfe7
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
   1:     0x55b8dee051e0 - std::backtrace_rs::backtrace::trace_unsynchronized::h6830419c0c4130dc
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x55b8dee051e0 - std::sys_common::backtrace::_print_fmt::h8f3516631ffa1ef5
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x55b8dee051e0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::he1640d5f0d93f618
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x55b8dee2f0bc - core::fmt::write::h88012e1f01caeebf
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/fmt/mod.rs:1115:17
   5:     0x55b8dedfca85 - std::io::Write::write_fmt::h360fa85b30182555
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/io/mod.rs:1665:15
   6:     0x55b8dee07c1b - std::sys_common::backtrace::_print::ha1f00492f406a015
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x55b8dee07c1b - std::sys_common::backtrace::print::hd54561b13feb6af3
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x55b8dee07c1b - std::panicking::default_hook::{{closure}}::h84fe124cd0864662
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:208:50
   9:     0x55b8dee076f1 - std::panicking::default_hook::h5a8e74a76ce290a7
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:225:9
  10:     0x55b8d9cf5a33 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h3c9c2f37fca056b9
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/alloc/src/boxed.rs:1586:9
  11:     0x55b8d967aa3b - deno::setup_exit_process_panic_hook::{{closure}}::h6765d3421184ad6d
                               at /home/runner/work/deno/deno/cli/main.rs:1200:5
  12:     0x55b8dee08309 - std::panicking::rust_panic_with_hook::h67c812a4fe9d4c91
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:626:17
  13:     0x55b8dee07dc7 - std::panicking::begin_panic_handler::{{closure}}::h33f9c1b96af300d7
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:519:13
  14:     0x55b8dee056dc - std::sys_common::backtrace::__rust_end_short_backtrace::h51bae64be5921f0e
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs:141:18
  15:     0x55b8dee07d29 - rust_begin_unwind
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:515:5
  16:     0x55b8d9634d11 - core::panicking::panic_fmt::h12a3a3c256485fca
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/panicking.rs:92:14
  17:     0x55b8d9634e03 - core::result::unwrap_failed::h2d8d0952e3250de9
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/result.rs:1599:5
  18:     0x55b8dc7e721e - core::result::Result<T,E>::unwrap::h282726454d1b587c
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/result.rs:1281:23
  19:     0x55b8db5948d3 - deno_fetch::op_fetch::h20d98880e0231830
                               at /home/runner/work/deno/deno/ext/fetch/lib.rs:224:17
  20:     0x55b8db5b4835 - core::ops::function::Fn::call::haca3653fddba6a98
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/ops/function.rs:70:5
  21:     0x55b8db504f20 - deno_core::ops_json::op_sync::{{closure}}::{{closure}}::h1ef9412f552ba81e
                               at /home/runner/work/deno/deno/core/ops_json.rs:74:26
  22:     0x55b8db6f824a - core::result::Result<T,E>::and_then::h4e5f78e8e5ba760f
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/result.rs:948:22
  23:     0x55b8db4fd3b0 - deno_core::ops_json::op_sync::{{closure}}::h0a4c4cd4c28d6452
                               at /home/runner/work/deno/deno/core/ops_json.rs:72:18
  24:     0x55b8dd0c7b52 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h42da9721bae441ce
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/alloc/src/boxed.rs:1586:9
  25:     0x55b8db4bbf09 - deno_runtime::metrics::metrics_op::{{closure}}::h2fe0fdd0330a21eb
                               at /home/runner/work/deno/deno/runtime/metrics.rs:163:14
  26:     0x55b8dd0c7b52 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h42da9721bae441ce
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/alloc/src/boxed.rs:1586:9
  27:     0x55b8dd0d5678 - deno_core::ops::OpTable::route_op::h9a55939ce0e4406c
                               at /home/runner/work/deno/deno/core/ops.rs:157:18
  28:     0x55b8dd198c13 - deno_core::bindings::opcall::h47885e6726142b09
                               at /home/runner/work/deno/deno/core/bindings.rs:358:12
  29:     0x55b8dd15b4e4 - core::ops::function::Fn::call::h699f3525a582c175
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/ops/function.rs:70:5
  30:     0x55b8dd18dd1c - rusty_v8::function::<impl rusty_v8::support::MapFnFrom<F> for extern "C" fn(*const rusty_v8::function::FunctionCallbackInfo)>::mapping::{{closure}}::he6b6d1def62add12
                               at /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/rusty_v8-0.30.0/src/function.rs:282:7
  31:     0x55b8dd0b54fb - <extern "C" fn(A0) .> R as rusty_v8::support::CFnFrom<F>>::mapping::c_fn::h3123c7251c7ef917
                               at /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/rusty_v8-0.30.0/src/support.rs:724:11
  32:     0x55b8dda4a2bd - _ZN2v88internal25FunctionCallbackArguments4CallENS0_15CallHandlerInfoE
                               at ./../../../../v8/src/api/api-arguments-inl.h:152:3
  33:     0x55b8dda4985b - _ZN2v88internal12_GLOBAL__N_119HandleApiCallHelperILb0EEENS0_11MaybeHandleINS0_6ObjectEEEPNS0_7IsolateENS0_6HandleINS0_10HeapObjectEEESA_NS8_INS0_20FunctionTemplateInfoEEENS8_IS4_EENS0_16BuiltinArgumentsE
                               at ./../../../../v8/src/builtins/builtins-api.cc:112:36
  34:     0x55b8dda48dde - _ZN2v88internalL26Builtin_Impl_HandleApiCallENS0_16BuiltinArgumentsEPNS0_7IsolateE
                               at ./../../../../v8/src/builtins/builtins-api.cc:142:5
  35:     0x55b8dd903ad8 - Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit
@lucacasonato lucacasonato added the bug Something isn't working correctly label Sep 26, 2021
@ahabhgk
Copy link
Contributor

ahabhgk commented Sep 27, 2021

The panic is caused by the difference between fetching spec and http rfc on header value definition, and the http crate which deno depends didn't follow the fetch spec.
I reviewed my PR and found that, should I implement a new HeaderValue::from_bytes follow the fetch spec? Any suggestions?

@lucacasonato
Copy link
Member Author

No, let's wait for this to be fixed upstream in hyper. It would be great if you could add a small unit test to your PR that shows that characters that are really invalid in headers, actually result in an error now instead of panicking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants