-
Notifications
You must be signed in to change notification settings - Fork 26
Description
Using secure-exec with @secure-exec/v8 in AWS Lambda, the V8 runtime crashes during startup before sending the socket path back to the parent process.
Environment
- AWS Lambda
- Node.js 20
- secure-exec@0.2.0-rc.2
- @secure-exec/v8@0.2.0-rc.2
Context
This does not appear to be a packaging issue. The deployed artifact contains the expected packages, including the Linux native package.
Observed errors
Error: V8 runtime process closed stdout before sending socket path
at Interface. (file:///var/task/node_modules/@secure-exec/v8/dist/runtime.js:458:24)
Then:
ReferenceError: Cannot access 'sessionHandlers' before initialization
at rejectPendingSessions (file:///var/task/node_modules/@secure-exec/v8/dist/runtime.js:183:26)
at ChildProcess. (file:///var/task/node_modules/@secure-exec/v8/dist/runtime.js:99:9)
Minimal usage
const { NodeRuntime, createNodeDriver, createNodeRuntimeDriverFactory } =
await import("secure-exec");
const runtime = new NodeRuntime({
systemDriver: createNodeDriver({
permissions: {
fs: () => ({ allow: false }),
network: () => ({ allow: true }),
},
}),
runtimeDriverFactory: createNodeRuntimeDriverFactory(),
memoryLimit: 64,
cpuTimeLimitMs: 10_000,
});
const runResult = await runtime.run(wrappedCode);
Expected
- the V8 runtime starts successfully
- if startup fails, cleanup should not throw a secondary ReferenceError