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

sea: don't set code cache flags when snapshot is used #54120

Merged
merged 1 commit into from
Aug 5, 2024

Conversation

joyeecheung
Copy link
Member

@joyeecheung joyeecheung commented Jul 30, 2024

When both useCodeCache and useSnapshot are set, we generate the snapshot and skip the generation of the code cache since the snapshot already includes the code cache. But we previously still persist the code cache setting in the flags that got serialized into the SEA, so the resulting executable would still try to read the code cache even if it's not added to the SEA, leading to a flaky crash caused by OOB on some platforms.

This patch fixes the crash by ignoring the code cache setting when generating the flag if both snapshot and code cache is configured.

Fixes: #50740

When both useCodeCache and useSnapshot are set, we generate the
snapshot and skip the generation of the code cache since the
snapshot already includes the code cache. But we previously still
persist the code cache setting in the flags that got serialized
into the SEA, so the resulting executable would still try to read
the code cache even if it's not added to the SEA, leading to a flaky
crash caused by OOB on some platforms.

This patch fixes the crash by ignoring the code cache setting when
generating the flag if both snapshot and code cache is configured.
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/single-executable

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. single-executable Issues and PRs related to single-executable applications labels Jul 30, 2024
@joyeecheung joyeecheung added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 30, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 30, 2024
@nodejs-github-bot
Copy link
Collaborator

Copy link

codecov bot commented Jul 30, 2024

Codecov Report

Attention: Patch coverage is 70.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 87.07%. Comparing base (01cf9bc) to head (d6ed160).
Report is 57 commits behind head on main.

Files Patch % Lines
src/node_sea.cc 70.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #54120   +/-   ##
=======================================
  Coverage   87.07%   87.07%           
=======================================
  Files         643      643           
  Lines      181583   181588    +5     
  Branches    34886    34888    +2     
=======================================
+ Hits       158114   158122    +8     
- Misses      16751    16754    +3     
+ Partials     6718     6712    -6     
Files Coverage Δ
src/node_sea.cc 91.25% <70.00%> (-0.03%) ⬇️

... and 34 files with indirect coverage changes

@joyeecheung joyeecheung added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 5, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 5, 2024
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@joyeecheung joyeecheung added the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 5, 2024
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Aug 5, 2024
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/54120
✔  Done loading data for nodejs/node/pull/54120
----------------------------------- PR info ------------------------------------
Title      sea: don't set code cache flags when snapshot is used (#54120)
Author     Joyee Cheung <[email protected]> (@joyeecheung)
Branch     joyeecheung:fix-snapshot-codecache -> nodejs:main
Labels     needs-ci, single-executable
Commits    1
 - sea: don't set code cache flags when snapshot is used
Committers 1
 - Joyee Cheung <[email protected]>
PR-URL: https://github.com/nodejs/node/pull/54120
Fixes: https://github.com/nodejs/node/issues/50740
Reviewed-By: Chengzhong Wu <[email protected]>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/54120
Fixes: https://github.com/nodejs/node/issues/50740
Reviewed-By: Chengzhong Wu <[email protected]>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Tue, 30 Jul 2024 10:56:15 GMT
   ✔  Approvals: 1
   ✔  - Chengzhong Wu (@legendecas) (TSC): https://github.com/nodejs/node/pull/54120#pullrequestreview-2208090806
   ✘  This PR needs to wait 18 more hours to land (or 0 hours if there is one more approval)
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2024-08-05T15:39:09Z: https://ci.nodejs.org/job/node-test-pull-request/60885/
- Querying data for job/node-test-pull-request/60885/
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/10252668602

@richardlau richardlau added commit-queue Add this label to land a pull request using GitHub Actions. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Aug 5, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 5, 2024
@nodejs-github-bot nodejs-github-bot merged commit c6aeddf into nodejs:main Aug 5, 2024
72 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in c6aeddf

targos pushed a commit that referenced this pull request Aug 14, 2024
When both useCodeCache and useSnapshot are set, we generate the
snapshot and skip the generation of the code cache since the
snapshot already includes the code cache. But we previously still
persist the code cache setting in the flags that got serialized
into the SEA, so the resulting executable would still try to read
the code cache even if it's not added to the SEA, leading to a flaky
crash caused by OOB on some platforms.

This patch fixes the crash by ignoring the code cache setting when
generating the flag if both snapshot and code cache is configured.

PR-URL: #54120
Fixes: #50740
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
@RafaelGSS RafaelGSS mentioned this pull request Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ci PRs that need a full CI run. single-executable Issues and PRs related to single-executable applications
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SEA tests run into SIGSEGV during SEA execution
4 participants