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

Deno has panicked while using defineProperty on "Object" #742

Closed
vdata1 opened this issue May 14, 2024 · 1 comment · Fixed by #746
Closed

Deno has panicked while using defineProperty on "Object" #742

vdata1 opened this issue May 14, 2024 · 1 comment · Fixed by #746
Labels
bug Something isn't working

Comments

@vdata1
Copy link

vdata1 commented May 14, 2024

Hi,
I want to report the following bug found while using defineProperty on Deno's built-in "Object":

Details:

Platform: macos x86_64
Version: Deno 1.43.3

============================================================
Deno has panicked. This is a bug in Deno. Please report this
at https://github.com/denoland/deno/issues/new.
If you can reliably reproduce this panic, include the
reproduction steps and re-run with the RUST_BACKTRACE=1 env
var set and include the backtrace in your report.

Platform: macos x86_64
Version: 1.43.3
Args: ["deno", "run", "19.js"]

thread 'main' panicked at /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/deno_core-0.280.0/runtime/jsruntime.rs:1866:3:
internal error: entered unreachable code: Expected at least one stalled top-level await
stack backtrace:
0: _rust_begin_unwind
1: core::panicking::panic_fmt
2: deno_core::runtime::jsruntime::JsRuntime::poll_event_loop
3: deno_core::runtime::jsruntime::JsRuntime::run_event_loop::{{closure}}
4: deno_runtime::worker::MainWorker::run_event_loop::{{closure}}
5: deno::worker::CliMainWorker::run::{{closure}}
6: deno::tools::run::run_script::{{closure}}
7: deno::spawn_subcommand::{{closure}}
8: <deno_unsync::task::MaskFutureAsSend as core::future::future::Future>::poll
9: tokio::runtime::task::raw::poll
10: deno::main
note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.

How To Reproduce:

Run the following line of code to trigger Deno Panic:

Object.defineProperty(Promise, Symbol.species, { value: 0 });  
@mmastrac
Copy link
Contributor

This appears to be an issue in deno_core as well:

$ target/debug/dcore /tmp/test.ts 
🛑 deno_core binary is meant for development and testing purposes.
Run /tmp/test.ts
thread 'main' panicked at core/runtime/jsruntime.rs:1866:3:
internal error: entered unreachable code: Expected at least one stalled top-level await
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@bartlomieju bartlomieju added the bug Something isn't working label May 14, 2024
@bartlomieju bartlomieju transferred this issue from denoland/deno May 16, 2024
devsnek added a commit that referenced this issue May 21, 2024
Fixes: #742
Fixes: #743

`pending_mod_evaluation` is set before calling Module::Evaluate, and
unset in the promise handlers for the promise returned by evaluate. If
setting up those promise handlers fails for some reason, we can end up
in a case where evaluation has finished but we haven't unset
`pending_mod_evaluation`, which makes the core event loop assume that
there is a pending stalled tla message, and it ends up 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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants