Skip to content

src: improve error message for invalid child stdio type in spawn_sync #57589

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

Conversation

dario-piotrowicz
Copy link
Member

This is pretty minor, but as I was looking into #52776 (which I still am) and I noticed that the current error message that users see is not super helpful:

  #  Assertion failed: "Unreachable code reached" __VA_OPT__(": ") "invalid child stdio type"

What I'm doing in here is simply updating this so that instead what the user sees the following:

invalid child stdio type: wrap

  #  <node binary location>[192863]: v8::Maybe<int> node::SyncProcessRunner::ParseStdioOption(int, v8::Local<v8::Object>) at ../src/spawn_sync.cc:1061
  #  Assertion failed: "Unreachable code reached"

(where wrap is the problematic stdio type I get for #52776)

I'm not really good at C++ (I'm still learning), so if there is a better way of doing the above I would really love
some suggestions 🙂

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. child_process Issues and PRs related to the child_process subsystem. needs-ci PRs that need a full CI run. labels Mar 22, 2025
Copy link

codecov bot commented Mar 22, 2025

Codecov Report

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

Project coverage is 90.24%. Comparing base (86f86a2) to head (d7cf57b).
Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
src/spawn_sync.cc 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #57589      +/-   ##
==========================================
+ Coverage   90.22%   90.24%   +0.01%     
==========================================
  Files         630      630              
  Lines      185481   185483       +2     
  Branches    36364    36366       +2     
==========================================
+ Hits       167357   167382      +25     
+ Misses      11004    10992      -12     
+ Partials     7120     7109      -11     
Files with missing lines Coverage Δ
src/spawn_sync.cc 68.57% <0.00%> (-0.19%) ⬇️

... and 23 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@anonrig anonrig requested review from jasnell and anonrig and removed request for jasnell March 24, 2025 20:07
@anonrig anonrig added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. review wanted PRs that need reviews. labels Mar 24, 2025
@anonrig
Copy link
Member

anonrig commented Mar 24, 2025

cc @nodejs/cpp-reviewers

@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 1, 2025
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@dario-piotrowicz dario-piotrowicz force-pushed the dario/spawn_sync_invalid_child_stdio_type_error_message branch from fb26425 to d7cf57b Compare April 12, 2025 15:46
@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Apr 12, 2025

jasnell pushed a commit that referenced this pull request Apr 13, 2025
PR-URL: #57589
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Ethan Arrowood <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
@jasnell
Copy link
Member

jasnell commented Apr 13, 2025

Landed in a4843f4

@jasnell jasnell closed this Apr 13, 2025
@dario-piotrowicz dario-piotrowicz deleted the dario/spawn_sync_invalid_child_stdio_type_error_message branch April 13, 2025 17:20
RafaelGSS pushed a commit that referenced this pull request May 1, 2025
PR-URL: #57589
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Ethan Arrowood <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
RafaelGSS pushed a commit that referenced this pull request May 2, 2025
PR-URL: #57589
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Ethan Arrowood <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
aduh95 pushed a commit that referenced this pull request May 6, 2025
PR-URL: #57589
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Ethan Arrowood <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
aduh95 pushed a commit that referenced this pull request May 6, 2025
PR-URL: #57589
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Ethan Arrowood <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
RafaelGSS pushed a commit that referenced this pull request May 14, 2025
PR-URL: #57589
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Ethan Arrowood <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
aduh95 pushed a commit that referenced this pull request May 16, 2025
PR-URL: #57589
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Ethan Arrowood <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
aduh95 pushed a commit that referenced this pull request May 17, 2025
PR-URL: #57589
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Ethan Arrowood <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
aduh95 pushed a commit that referenced this pull request May 17, 2025
PR-URL: #57589
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Ethan Arrowood <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
aduh95 pushed a commit that referenced this pull request May 17, 2025
PR-URL: #57589
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Ethan Arrowood <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
aduh95 pushed a commit that referenced this pull request May 18, 2025
PR-URL: #57589
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Ethan Arrowood <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
aduh95 pushed a commit that referenced this pull request May 19, 2025
PR-URL: #57589
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Ethan Arrowood <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. child_process Issues and PRs related to the child_process subsystem. needs-ci PRs that need a full CI run. review wanted PRs that need reviews.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants