denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
93.98k stars 5.23k forks source link

Deno crashes with fatal error in v1.46 #25160

Closed benStre closed 1 week ago

benStre commented 3 weeks ago

Version: Deno 1.46.0 +

Since the upgrade to version 1.46.0, I am getting this fatal error when starting a Deno project. I have not yet been able to track down where the problem originates from in my project because the project is quite complex.

#
# Fatal error in , line 0
# Check failed: module->status() == kLinked || module->status() == kEvaluated.
#
#
#
#FailureMessage Object: 0x3109f2930
==== C stack trace ===============================

    0   deno                                0x0000000104a3a993 v8::base::debug::StackTrace::StackTrace() + 19
    1   deno                                0x0000000104a40dbb v8::platform::(anonymous namespace)::PrintStackTrace() + 27
    2   deno                                0x0000000104a302a6 V8_Fatal(char const*, ...) + 390
    3   deno                                0x0000000104fee7e7 v8::internal::SourceTextModule::Evaluate(v8::internal::Isolate*, v8::internal::Handle<v8::internal::SourceTextModule>) + 535
    4   deno                                0x0000000104a9f459 v8::Module::Evaluate(v8::Local<v8::Context>) + 649
    5   deno                                0x000000010351f0e1 deno_core::modules::map::ModuleMap::poll_progress::h3bb5a8de16d1820e + 2977
    6   deno                                0x000000010351dff9 deno_core::runtime::jsruntime::JsRuntime::poll_event_loop::h0451364d1bc18a21 + 761
    7   deno                                0x0000000102f0dbcc _ZN9deno_core7runtime9jsruntime9JsRuntime14run_event_loop28_$u7b$$u7b$closure$u7d$$u7d$17he2225bfb920ed6dbE + 83
    8   deno                                0x0000000102c9751b _ZN12deno_runtime6worker10MainWorker14run_event_loop28_$u7b$$u7b$closure$u7d$$u7d$17h65fd5b7f4b9cad4bE + 59
    9   deno                                0x000000010319e939 _ZN4deno6worker13CliMainWorker33evaluate_module_possibly_with_npm28_$u7b$$u7b$closure$u7d$$u7d$17h716ca3bebb4b9f90E + 573
    10  deno                                0x000000010319d2ff _ZN4deno6worker13CliMainWorker37execute_main_module_possibly_with_npm28_$u7b$$u7b$closure$u7d$$u7d$17h4c3995a9e8d7eb4bE + 1167
    11  deno                                0x000000010319c280 _ZN4deno6worker13CliMainWorker3run28_$u7b$$u7b$closure$u7d$$u7d$17h3a7ead08531a2839E + 860
    12  deno                                0x00000001031c3bdf _ZN4deno14run_subcommand28_$u7b$$u7b$closure$u7d$$u7d$28_$u7b$$u7b$closure$u7d$$u7d$17he8704f9141337f7eE + 5115
    13  deno                                0x00000001031b2f12 _ZN4deno16spawn_subcommand28_$u7b$$u7b$closure$u7d$$u7d$17h45ab9dc83a9568f8E + 114
    14  deno                                0x0000000102c4666e _ZN100_$LT$deno_unsync..tokio..task..MaskFutureAsSend$LT$F$GT$$u20$as$u20$core..future..future..Future$GT$4poll17h8635d205975687beE + 30
    15  deno                                0x0000000102df0902 tokio::runtime::task::raw::poll::h3cc68b7fc84e51ec + 142
    16  deno                                0x00000001031c9ea1 deno::main::h41caf498bfbfb7f3 + 6177
    17  deno                                0x0000000102cf58c1 std::sys_common::backtrace::__rust_begin_short_backtrace::hf907f2e463ea9d3d + 6
    18  deno                                0x00000001032625f9 main + 681
    19  dyld                                0x0000000209ce7366 start + 1942
bartlomieju commented 3 weeks ago

Sorry for the problem, we'll most likely cut a patch release, once we identify the problem.

Is your repository open source so we could try it ourselves?

benStre commented 3 weeks ago

Thank you! The problem occurs when running a project with UIX (e.g. https://github.com/unyt-org/uix-base-project)

benStre commented 3 weeks ago

It can be reproduced by running this module with Deno: https://raw.githubusercontent.com/unyt-org/uix/uix-new/run.ts

deno run -A --import-map https://cdn.unyt.org/importmap.json https://raw.githubusercontent.com/unyt-org/uix/uix-new/run.ts
bartlomieju commented 3 weeks ago

Thanks, we're investigating right now.

sveisvei commented 3 weeks ago

If we throw errors as part of import (async/await) loading, this can be reproduced.

devsnek commented 3 weeks ago

It turns out there are several bugs in recent changes to V8's module loading, and I'm working on getting them fixed (e.g. https://chromium-review.googlesource.com/c/v8/v8/+/5807477). But on a slightly positive note, all these bugs are caused by throwing at the top level of a module that uses TLA (along with having complex module graphs), which means that this only affects code which ran unsuccessfully.

jonasstrehle commented 2 weeks ago

https://chromium-review.googlesource.com/c/v8/v8/+/5807477 seems to be resolved