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

Handle missing opId gracefully #4122

Closed
bartlomieju opened this issue Feb 25, 2020 · 0 comments · Fixed by #4118
Closed

Handle missing opId gracefully #4122

bartlomieju opened this issue Feb 25, 2020 · 0 comments · Fixed by #4118
Assignees

Comments

@bartlomieju
Copy link
Member

This has been coming up several times already; I need to finally fix it. The problem is that we use unwrap when trying to cast opId to Uint32 - this panics if opId is undefined. Such situation should be handled gracefully by returning error to JS or adding assert on opId in Deno.core.dispatch - whichever will have smaller impact on performace.

https://github.com/denoland/deno/pull/4118/checks?check_run_id=466535527

##[error]thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: TryFromTypeError { expected_type: "Uint32" }', src/libcore/result.rs:1188:5
stack backtrace:
   0:        0x104176eb5 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h109831b4e69a3cdc
   1:        0x10419e4d0 - core::fmt::write::haefb4093ced4abcf
   2:        0x10417089b - std::io::Write::write_fmt::h32eef7193f012831
   3:        0x104179393 - std::panicking::default_hook::{{closure}}::hd11104060d683e7f
   4:        0x10417909a - std::panicking::default_hook::h3ac89e0bbec67847
   5:        0x104179a3b - std::panicking::rust_panic_with_hook::h497844b5b7d1708e
   6:        0x1041795d9 - rust_begin_unwind
   7:        0x1041bf4ec - core::panicking::panic_fmt::h2877d31f4cece04d
   8:        0x1041bf5c9 - core::result::unwrap_failed::h41045cf6a251332f
   9:        0x1036a1ddf - deno_core::bindings::send::h47170700ae11a5f0
  10:        0x1036b9e6d - <extern "C" fn(A0) .> R as rusty_v8::support::CFnFrom<F>>::mapping::c_fn::h1852c76360317199
  11:        0x10372af03 - _ZN2v88internal25FunctionCallbackArguments4CallENS0_15CallHandlerInfoE
  12:        0x10372a37d - _ZN2v88internal12_GLOBAL__N_119HandleApiCallHelperILb0EEENS0_11MaybeHandleINS0_6ObjectEEEPNS0_7IsolateENS0_6HandleINS0_10HeapObjectEEESA_NS8_INS0_20FunctionTemplateInfoEEENS8_IS4_EENS0_16BuiltinArgumentsE
  13:        0x103729911 - _ZN2v88internalL26Builtin_Impl_HandleApiCallENS0_16BuiltinArgumentsEPNS0_7IsolateE
fatal runtime error: failed to initiate panic, error 5

CC @ry

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

Successfully merging a pull request may close this issue.

1 participant