Skip to content

Support child_process in snapshot #50924

@H4ad

Description

@H4ad

Version

21.1.0

Platform

Linux h4ad 5.15.0-89-generic #99~20.04.1-Ubuntu SMP Thu Nov 2 15:16:47 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

child_process

What steps will reproduce the bug?

The following code:

// save as file.js
const child_process = require("node:child_process");
child_process.execSync("echo 1", { stdio: "inherit" });

Run with: node --snapshot-blob snapshot.blob --build-snapshot file.js

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior? Why is that the expected behavior?

The snapshot being created without core dumped.is

What do you see instead?

1
(node:136443) Warning: built-in module node:child_process is not yet supported in user snapshots
(Use `node --trace-warnings ...` to show where the warning was created)
Unknown external reference 0xf0e510.
<unresolved>
[1]    136443 trace trap (core dumped)  node --snapshot-blob snapshot.blob --build-snapshot file.js

Additional information

Found at https://github.com/mehulkar/bench-childprocess

Metadata

Metadata

Assignees

No one assigned

    Labels

    child_processIssues and PRs related to the child_process subsystem.feature requestIssues that request new features to be added to Node.js.never-staleMark issue so that it is never considered stalesnapshotIssues and PRs related to the startup snapshot

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions