-
Notifications
You must be signed in to change notification settings - Fork 30k
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
readline: fix question stack overflow #43320
readline: fix question stack overflow #43320
Conversation
This commit fixes readline interface's question callback wrapping when it is being called with `signal` option. Previous version completely overwrites passed callback and throws "Maximum call stack size exceeded" error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! Can you also add a test to test/parallel/test-readline-promises-interface.js
please?
1357094
to
35fda91
Compare
@aduh95 yes, just added an identical test to the readline/promises suite UPD: Also added a similar test for the promisified question (it wasn't covered). |
/cc @nodejs/readline |
Commit Queue failed- Loading data for nodejs/node/pull/43320 ✔ Done loading data for nodejs/node/pull/43320 ----------------------------------- PR info ------------------------------------ Title readline: fix question stack overflow (#43320) ⚠ Could not retrieve the email or name of the PR author's from user's GitHub profile! Branch chapko:fix-readline-stackoverflow -> nodejs:master Labels readline, author ready, needs-ci Commits 2 - readline: fix question stack overflow - readline: add test for promisified question Committers 1 - Eugene Chapko PR-URL: https://github.com/nodejs/node/pull/43320 Reviewed-By: Antoine du Hamel Reviewed-By: Colin Ihrig ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/43320 Reviewed-By: Antoine du Hamel Reviewed-By: Colin Ihrig -------------------------------------------------------------------------------- ℹ This PR was created on Sun, 05 Jun 2022 07:24:05 GMT ✔ Approvals: 2 ✔ - Antoine du Hamel (@aduh95) (TSC): https://github.com/nodejs/node/pull/43320#pullrequestreview-996012891 ✔ - Colin Ihrig (@cjihrig) (TSC): https://github.com/nodejs/node/pull/43320#pullrequestreview-996013510 ✔ Last GitHub CI successful ℹ Last Full PR CI on 2022-06-05T15:05:39Z: https://ci.nodejs.org/job/node-test-pull-request/44369/ - Querying data for job/node-test-pull-request/44369/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ No git cherry-pick in progress ✔ No git am in progress ✔ No git rebase in progress -------------------------------------------------------------------------------- - Bringing origin/master up to date... From https://github.com/nodejs/node * branch master -> FETCH_HEAD ✔ origin/master is now up-to-date - Downloading patch for 43320 From https://github.com/nodejs/node * branch refs/pull/43320/merge -> FETCH_HEAD ✔ Fetched commits as 595ce9dac63c..473f03c07014 -------------------------------------------------------------------------------- [master da9e2e4e2c] readline: fix question stack overflow Author: Eugene Chapko Date: Sun Jun 5 10:51:55 2022 +0400 3 files changed, 24 insertions(+), 1 deletion(-) [master c979bdf2f7] readline: add test for promisified question Author: Eugene Chapko Date: Sun Jun 5 16:22:34 2022 +0400 2 files changed, 15 insertions(+), 2 deletions(-) ✔ Patches applied There are 2 commits in the PR. Attempting autorebase. Rebasing (2/4)https://github.com/nodejs/node/actions/runs/2467622683 |
Commit Queue failed- Loading data for nodejs/node/pull/43320 ✔ Done loading data for nodejs/node/pull/43320 ----------------------------------- PR info ------------------------------------ Title readline: fix question stack overflow (#43320) ⚠ Could not retrieve the email or name of the PR author's from user's GitHub profile! Branch chapko:fix-readline-stackoverflow -> nodejs:master Labels readline, author ready, needs-ci, commit-queue-failed Commits 2 - readline: fix question stack overflow - readline: add test for promisified question Committers 1 - Eugene Chapko PR-URL: https://github.com/nodejs/node/pull/43320 Reviewed-By: Antoine du Hamel Reviewed-By: Colin Ihrig Reviewed-By: James M Snell ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/43320 Reviewed-By: Antoine du Hamel Reviewed-By: Colin Ihrig Reviewed-By: James M Snell -------------------------------------------------------------------------------- ℹ This PR was created on Sun, 05 Jun 2022 07:24:05 GMT ✔ Approvals: 3 ✔ - Antoine du Hamel (@aduh95) (TSC): https://github.com/nodejs/node/pull/43320#pullrequestreview-996012891 ✔ - Colin Ihrig (@cjihrig) (TSC): https://github.com/nodejs/node/pull/43320#pullrequestreview-996013510 ✔ - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/43320#pullrequestreview-1003513187 ✔ Last GitHub CI successful ℹ Last Full PR CI on 2022-06-09T10:19:18Z: https://ci.nodejs.org/job/node-test-pull-request/44369/ - Querying data for job/node-test-pull-request/44369/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ No git cherry-pick in progress ✔ No git am in progress ✔ No git rebase in progress -------------------------------------------------------------------------------- - Bringing origin/master up to date... From https://github.com/nodejs/node * branch master -> FETCH_HEAD ✔ origin/master is now up-to-date - Downloading patch for 43320 From https://github.com/nodejs/node * branch refs/pull/43320/merge -> FETCH_HEAD ✔ Fetched commits as fab676ec5536..473f03c07014 -------------------------------------------------------------------------------- Auto-merging lib/readline.js [master 214108da34] readline: fix question stack overflow Author: Eugene Chapko Date: Sun Jun 5 10:51:55 2022 +0400 3 files changed, 24 insertions(+), 1 deletion(-) [master ebad194dac] readline: add test for promisified question Author: Eugene Chapko Date: Sun Jun 5 16:22:34 2022 +0400 2 files changed, 15 insertions(+), 2 deletions(-) ✔ Patches applied There are 2 commits in the PR. Attempting autorebase. Rebasing (2/4)https://github.com/nodejs/node/actions/runs/2483034882 |
Landed in 2efeb5c |
This commit fixes readline interface's question callback wrapping when it is being called with `signal` option. Previous version completely overwrites passed callback and throws "Maximum call stack size exceeded" error. PR-URL: nodejs#43320 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit fixes readline interface's question callback wrapping when it is being called with `signal` option. Previous version completely overwrites passed callback and throws "Maximum call stack size exceeded" error. PR-URL: #43320 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit fixes readline interface's question callback wrapping when it is being called with `signal` option. Previous version completely overwrites passed callback and throws "Maximum call stack size exceeded" error. PR-URL: #43320 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit fixes readline interface's question callback wrapping when it is being called with
signal
option. Previous version completely overwrites passed callback and throws "Maximum call stack size exceeded" error.Reproducible example: