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

illegal hardware instruction on importing deleted file #1545

Closed
hayd opened this issue Jan 17, 2019 · 2 comments
Closed

illegal hardware instruction on importing deleted file #1545

hayd opened this issue Jan 17, 2019 · 2 comments

Comments

@hayd
Copy link
Contributor

hayd commented Jan 17, 2019

Example:

 % cat bar.ts
import "./baz.ts";

 % cat baz.ts
console.log("hello");

 % ../deno/target/debug/deno bar.ts
hello
 % mv baz.ts baz.orig.ts
 % ../deno/target/debug/deno bar.ts
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: DenoError { repr: Simple(NotFound, "Cannot resolve module \"./baz.ts\" from \"/Users/hayd/OSS/deno_std/bar.ts\"") }', libcore/result.rs:1009:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.

#
# Fatal error in v8::Isolate::Dispose()
# Disposing the isolate that is entered by a thread.
#

[1]    28433 illegal hardware instruction  ../deno/target/debug/deno bar.ts
@kevinkassimo
Copy link
Contributor

kevinkassimo commented Jan 18, 2019

The illegal hardware instruction happens when some unexpected panic happens.
#1498 (comment)
I guess my original assumption there is not right...
Since the script for bar.ts is already compiled, the step for TS compiler dependency graph building is skipped. Thus, this .unwrap would explode:

deno/src/isolate.rs

Lines 406 to 407 in d06c956

let out =
code_fetch_and_maybe_compile(&isolate.state, specifier, referrer).unwrap();

@kevinkassimo
Copy link
Contributor

kevinkassimo commented Jan 18, 2019

In comparison to what #1498 is trying to fix, we can deduce the location of the import using GetModuleRequestsLength() and GetModuleRequestLocation() to deduce the origin, create an exception, and handle as a JSError.

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

2 participants