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

fix: crash when V8 tries to JIT compilation in the PKU-supported environment #227

Merged
merged 1 commit into from
Dec 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions crates/base/src/commands.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::server::{Server, ServerCodes, WorkerEntrypoints};
use anyhow::Error;
use deno_core::JsRuntime;
use tokio::sync::mpsc::Sender;

#[allow(clippy::too_many_arguments)]
Expand All @@ -13,6 +14,11 @@ pub async fn start_server(
callback_tx: Option<Sender<ServerCodes>>,
entrypoints: WorkerEntrypoints,
) -> Result<(), Error> {
// NOTE(denoland/deno/20495): Due to the new PKU (Memory Protection Keys)
// feature introduced in V8 11.6, We need to initialize the V8 platform on
// the main thread that spawns V8 isolates.
JsRuntime::init_platform(None);

let mut server = Server::new(
ip,
port,
Expand Down