-
Notifications
You must be signed in to change notification settings - Fork 107
Open
Labels
bug:1-repro-availableBug reproduction is availableBug reproduction is availablekind:bugAn unexpected problem or behaviourAn unexpected problem or behaviourtopic:interfaceRelated to safe abstractions over the primitivesRelated to safe abstractions over the primitivestopic:runtimeRelated to the runtime objectRelated to the runtime objecttopic:safetyViolations of safety causing undefined behavioursViolations of safety causing undefined behaviours
Description
Hi there, thanks for all your work on this crate.
Came across an interesting one when trying to create a minimal working context to evaluate some code. Creating a AsyncContext with just the Eval intrinsic causes a seg fault when evaluating some code.
For example this seg faults:
let runtime = AsyncRuntime::new().unwrap();
let context = AsyncContext::builder()
.with::<intrinsic::Eval>()
.build_async(&runtime)
.await
.unwrap();
context
.with(|ctx| {
let code = "let x = 42;".to_string();
ctx.eval::<rquickjs::Value, _>(code.as_bytes()).unwrap();
})
.await;where as this does not:
let runtime = AsyncRuntime::new().unwrap();
let context = AsyncContext::builder()
.with::<intrinsic::Eval>()
.build_async(&runtime)
.await
.unwrap();
context
.with(|ctx| {
let code = "1 + 1;".to_string(); // <--- different code snippet
ctx.eval::<rquickjs::Value, _>(code.as_bytes()).unwrap();
})
.await;and this also does not seg fault:
let runtime = AsyncRuntime::new().unwrap();
let context = AsyncContext::full(&runtime).await.unwrap(); // <-- full context
context
.with(|ctx| {
let code = "let x = 42;".to_string(); // <--- same code snippet as seg fault
ctx.eval::<rquickjs::Value, _>(code.as_bytes()).unwrap();
})
.await;I have a full MRE repo here with all these examples.
EDIT: this is on arm64-apple-darwin24.5.0
richarddd
Metadata
Metadata
Assignees
Labels
bug:1-repro-availableBug reproduction is availableBug reproduction is availablekind:bugAn unexpected problem or behaviourAn unexpected problem or behaviourtopic:interfaceRelated to safe abstractions over the primitivesRelated to safe abstractions over the primitivestopic:runtimeRelated to the runtime objectRelated to the runtime objecttopic:safetyViolations of safety causing undefined behavioursViolations of safety causing undefined behaviours