Skip to content

Commit

Permalink
fix: probabilistic trigger v8 crash
Browse files Browse the repository at this point in the history
There is a probability of triggering a v8 crash when running the `yarn list --prod --json` command. Related discussion: nodejs/node#51555

This issue does not always occur. When we build `vscode-reh-linux-arm64` in the Dockerfile, there is more than a 50% chance of failure.

If this PR is merged, the code related to DISABLE_V8_COMPILE_CACHE in vscode can also be removed (https://github.com/search?q=repo%3Amicrosoft%2Fvscode%20DISABLE_V8_COMPILE_CACHE&type=code).

Globally setting `DISABLE_V8_COMPILE_CACHE=1` will increase the entire build time by 3 to 5 minutes.

Signed-off-by: Kevin Cui <[email protected]>
  • Loading branch information
BlackHole1 committed Aug 12, 2024
1 parent cf0bc32 commit 0087719
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/npm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ async function getYarnProductionDependencies(cwd: string, packagedDependencies?:
const raw = await new Promise<string>((c, e) =>
cp.exec(
'yarn list --prod --json',
{ cwd, encoding: 'utf8', env: { ...process.env }, maxBuffer: 5000 * 1024 },
{ cwd, encoding: 'utf8', env: { ...process.env, DISABLE_V8_COMPILE_CACHE: 1 }, maxBuffer: 5000 * 1024 },
(err, stdout) => (err ? e(err) : c(stdout))
)
);
Expand Down

0 comments on commit 0087719

Please sign in to comment.