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

[Canary] Deno test panicking #22148

Closed
jerome-benoit opened this issue Jan 27, 2024 · 4 comments
Closed

[Canary] Deno test panicking #22148

jerome-benoit opened this issue Jan 27, 2024 · 4 comments
Labels
bug Something isn't working correctly testing related to deno test and coverage

Comments

@jerome-benoit
Copy link
Contributor

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: windows x86_64
Version: 1.40.2+d9191db
Args: ["C:\\hostedtoolcache\\windows\\deno\\0.0.0-d9191db0ce50b62cf54de9046d8c504599e30ae0\\x64\\deno.exe", "test", "-A", "--parallel", "--coverage=./coverage"]

thread 'tokio-runtime-worker' panicked at C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\deno_core-0.256.0\gotham_state.rs:82:3:
required type std::collections::hash::map::HashMap<deno_runtime::web_worker::WorkerId, deno_runtime::ops::worker_host::WorkerThread> is not present in GothamState container
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Extracted from https://github.com/poolifier/poolifier-deno/actions/runs/7678076145/job/20927551728

I will extract the backtrace when time permits, but in the meantime running deno task test after cloning the poolifier-deno repo reliability reproduce the panic.

@bartlomieju
Copy link
Member

Thanks for catching this.

I did a bisect and found that the problematic PR is #22125. We'll need to work on a reproduction for this crash, so we'll probably revert the PR in the meantime.

@bartlomieju bartlomieju added bug Something isn't working correctly testing related to deno test and coverage labels Jan 27, 2024
@bartlomieju
Copy link
Member

I confirmed that reverting that PR fixes the problem.

@bartlomieju
Copy link
Member

The full backtrace:

/tests/pools/abstract-pool.test.mjs => Abstract pool test suite ... Verify that multiple task functions worker is working ... ok (47ms)
./tests/pools/abstract-pool.test.mjs => Abstract pool test suite ... Verify sendKillMessageToWorker() ... ok (30ms)
./tests/pools/abstract-pool.test.mjs => Abstract pool test suite ... Verify sendTaskFunctionOperationToWorker() ... ok (30ms)
./tests/pools/abstract-pool.test.mjs => Abstract pool test suite ... Verify sendTaskFunctionOperationToWorkers() ... ok (30ms)
./tests/pools/abstract-pool.test.mjs => Abstract pool test suite ... ok (5s)

============================================================
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 aarch64
Version: 1.40.2
Args: ["/Users/ib/dev/poolifier-deno/../deno/target/debug/deno", "test", "-A", "--parallel"]

thread 'tokio-runtime-worker' panicked at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/deno_core-0.255.0/gotham_state.rs:82:3:
required type std::collections::hash::map::HashMap<deno_runtime::web_worker::WorkerId, deno_runtime::ops::worker_host::WorkerThread> is not present in GothamState container
stack backtrace:
   0: rust_begin_unwind
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/panicking.rs:72:14
   2: deno_core::gotham_state::missing
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/deno_core-0.255.0/gotham_state.rs:82:3
   3: deno_core::gotham_state::GothamState::borrow_mut::{{closure}}
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/deno_core-0.255.0/gotham_state.rs:54:45
   4: core::option::Option<T>::unwrap_or_else
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/option.rs:976:21
   5: deno_core::gotham_state::GothamState::borrow_mut
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/deno_core-0.255.0/gotham_state.rs:54:5
   6: deno_runtime::ops::worker_host::close_channel
             at /Users/ib/dev/deno/runtime/ops/worker_host.rs:253:17
   7: deno_runtime::ops::worker_host::op_host_recv_ctrl::call::{{closure}}
             at /Users/ib/dev/deno/runtime/ops/worker_host.rs:311:7
   8: <deno_core::runtime::op_driver::future_arena::DynFutureInfo<T,C,M,F> as core::future::future::Future>::poll
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/deno_core-0.255.0/runtime/op_driver/future_arena.rs:68:11
   9: <deno_core::runtime::op_driver::future_arena::FutureAllocation<T,C> as core::future::future::Future>::poll
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/deno_core-0.255.0/runtime/op_driver/future_arena.rs:106:11
  10: <futures_util::stream::futures_unordered::FuturesUnordered<Fut> as futures_core::stream::Stream>::poll_next
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-util-0.3.29/src/stream/futures_unordered/mod.rs:518:17
  11: <futures_util::stream::futures_unordered::FuturesUnordered<F> as deno_core::runtime::op_driver::futures_unordered_driver::SubmissionQueueFutures>::poll_next_unpin
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/deno_core-0.255.0/runtime/op_driver/futures_unordered_driver.rs:261:24
  12: deno_core::runtime::op_driver::futures_unordered_driver::SubmissionQueueResults<F>::poll_next_unpin
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/deno_core-0.255.0/runtime/op_driver/futures_unordered_driver.rs:291:5
  13: deno_core::runtime::op_driver::futures_unordered_driver::poll_task::{{closure}}::{{closure}}
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/deno_core-0.255.0/runtime/op_driver/futures_unordered_driver.rs:38:30
  14: <futures_util::future::poll_fn::PollFn<F> as core::future::future::Future>::poll
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-util-0.3.29/src/future/poll_fn.rs:56:9
  15: deno_core::runtime::op_driver::futures_unordered_driver::poll_task::{{closure}}
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/deno_core-0.255.0/runtime/op_driver/futures_unordered_driver.rs:38:59
  16: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/future/future.rs:125:9
  17: <deno_unsync::task::MaskFutureAsSend<F> as core::future::future::Future>::poll
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/deno_unsync-0.3.2/src/task.rs:129:13
  18: tokio::runtime::task::core::Core<T,S>::poll::{{closure}}
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/task/core.rs:328:17
  19: tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/loom/std/unsafe_cell.rs:16:9
  20: tokio::runtime::task::core::Core<T,S>::poll
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/task/core.rs:317:13
  21: tokio::runtime::task::harness::poll_future::{{closure}}
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/task/harness.rs:485:19
  22: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/panic/unwind_safe.rs:272:9
  23: std::panicking::try::do_call
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:552:40
  24: ___rust_try
  25: std::panicking::try
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:516:19
  26: std::panic::catch_unwind
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panic.rs:142:14
  27: tokio::runtime::task::harness::poll_future
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/task/harness.rs:473:18
  28: tokio::runtime::task::harness::Harness<T,S>::poll_inner
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/task/harness.rs:208:27
  29: tokio::runtime::task::harness::Harness<T,S>::poll
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/task/harness.rs:153:15
  30: tokio::runtime::task::raw::poll
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/task/raw.rs:271:5
  31: tokio::runtime::task::raw::RawTask::poll
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/task/raw.rs:201:18
  32: tokio::runtime::task::LocalNotified<S>::run
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/task/mod.rs:408:9
  33: tokio::runtime::scheduler::current_thread::CoreGuard::block_on::{{closure}}::{{closure}}
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/current_thread/mod.rs:706:25
  34: tokio::runtime::coop::with_budget
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/coop.rs:107:5
  35: tokio::runtime::coop::budget
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/coop.rs:73:5
  36: tokio::runtime::scheduler::current_thread::Context::run_task::{{closure}}
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/current_thread/mod.rs:343:43
  37: tokio::runtime::scheduler::current_thread::Context::enter
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/current_thread/mod.rs:410:19
  38: tokio::runtime::scheduler::current_thread::Context::run_task
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/current_thread/mod.rs:343:23
  39: tokio::runtime::scheduler::current_thread::CoreGuard::block_on::{{closure}}
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/current_thread/mod.rs:705:35
  40: tokio::runtime::scheduler::current_thread::CoreGuard::enter::{{closure}}
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/current_thread/mod.rs:743:68
  41: tokio::runtime::context::scoped::Scoped<T>::set
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/context/scoped.rs:40:9
  42: tokio::runtime::context::set_scheduler::{{closure}}
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/context.rs:176:26
  43: std::thread::local::LocalKey<T>::try_with
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/thread/local.rs:270:16
  44: std::thread::local::LocalKey<T>::with
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/thread/local.rs:246:9
  45: tokio::runtime::context::set_scheduler
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/context.rs:176:9
  46: tokio::runtime::scheduler::current_thread::CoreGuard::enter
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/current_thread/mod.rs:743:27
  47: tokio::runtime::scheduler::current_thread::CoreGuard::block_on
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/current_thread/mod.rs:652:19
  48: tokio::runtime::scheduler::current_thread::CurrentThread::block_on::{{closure}}
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/current_thread/mod.rs:175:28
  49: tokio::runtime::context::runtime::enter_runtime
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/context/runtime.rs:65:16
  50: tokio::runtime::scheduler::current_thread::CurrentThread::block_on
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/current_thread/mod.rs:167:9
  51: tokio::runtime::runtime::Runtime::block_on
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/runtime.rs:348:47
  52: deno_runtime::tokio_util::create_and_run_current_thread_inner
             at /Users/ib/dev/deno/runtime/tokio_util.rs:102:3
  53: deno_runtime::tokio_util::create_and_run_current_thread
             at /Users/ib/dev/deno/runtime/tokio_util.rs:111:3
  54: deno::tools::test::test_specifiers::{{closure}}::{{closure}}::{{closure}}
             at /Users/ib/dev/deno/cli/tools/test/mod.rs:964:7
  55: deno_unsync::task::spawn_blocking::{{closure}}
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/deno_unsync-0.3.2/src/task.rs:71:74
  56: <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/blocking/task.rs:42:21
  57: tokio::runtime::task::core::Core<T,S>::poll::{{closure}}
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/task/core.rs:328:17
  58: tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/loom/std/unsafe_cell.rs:16:9
  59: tokio::runtime::task::core::Core<T,S>::poll
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/task/core.rs:317:13
  60: tokio::runtime::task::harness::poll_future::{{closure}}
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/task/harness.rs:485:19
  61: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/panic/unwind_safe.rs:272:9
  62: std::panicking::try::do_call
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:552:40
  63: ___rust_try
  64: std::panicking::try
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:516:19
  65: std::panic::catch_unwind
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panic.rs:142:14
  66: tokio::runtime::task::harness::poll_future
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/task/harness.rs:473:18
  67: tokio::runtime::task::harness::Harness<T,S>::poll_inner
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/task/harness.rs:208:27
  68: tokio::runtime::task::harness::Harness<T,S>::poll
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/task/harness.rs:153:15
  69: tokio::runtime::task::raw::poll
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/task/raw.rs:271:5
  70: tokio::runtime::task::raw::RawTask::poll
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/task/raw.rs:201:18
  71: tokio::runtime::task::UnownedTask<S>::run
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/task/mod.rs:445:9
  72: tokio::runtime::blocking::pool::Task::run
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/blocking/pool.rs:159:9
  73: tokio::runtime::blocking::pool::Inner::run
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/blocking/pool.rs:513:17
  74: tokio::runtime::blocking::pool::Spawner::spawn_thread::{{closure}}
             at /Users/ib/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/blocking/pool.rs:471:13
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Panic is raised just before the process exits.

@bartlomieju
Copy link
Member

This is now fixed with #22153 landed.

mmastrac added a commit that referenced this issue Feb 5, 2024
Originally in #22125
Reverted in #22153 because of #22148

Fixed in deno_core denoland/deno_core#538

Test plan: 

1. Check out: https://github.com/poolifier/poolifier-deno.git

2. `PATH=.../deno/target/release/:$PATH deno task test`

3. `ok | 13 passed (188 steps) | 0 failed (18s)`
littledivy pushed a commit that referenced this issue Feb 8, 2024
Originally in #22125
Reverted in #22153 because of #22148

Fixed in deno_core denoland/deno_core#538

Test plan: 

1. Check out: https://github.com/poolifier/poolifier-deno.git

2. `PATH=.../deno/target/release/:$PATH deno task test`

3. `ok | 13 passed (188 steps) | 0 failed (18s)`
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 testing related to deno test and coverage
Projects
None yet
Development

No branches or pull requests

2 participants