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

src: prevent crash in TTYWrap::Initialize #26832

Closed
wants to merge 1 commit into from
Closed

src: prevent crash in TTYWrap::Initialize #26832

wants to merge 1 commit into from

Conversation

Hakerh400
Copy link
Contributor

@Hakerh400 Hakerh400 commented Mar 21, 2019

When console.log is called for the first time it initializes
TTYWrap object. However, if there is not enough space on the
V8 stack, creating function template fails and triggers
empty maybe local exception.

Fixes #26829

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

src/tty_wrap.cc Outdated Show resolved Hide resolved
@joyeecheung
Copy link
Member

@joyeecheung joyeecheung commented Mar 21, 2019

BTW, Environment::SetMethod() and Environment::SetMethodNoSideEffect() also does ToLocalChecked() on the maybe returned by FunctionTemplate::GetFunction() and also does FromJust() on the Maybe returned by Object::Set(), I wonder why this only crashes in the non-heplers here.

@joyeecheung
Copy link
Member

@joyeecheung joyeecheung commented Mar 23, 2019

CI: https://ci.nodejs.org/job/node-test-pull-request/21822/ (though it's rather flaky now)

test/parallel/test-ttywrap-stack.js Outdated Show resolved Hide resolved
Copy link
Member

@bnoordhuis bnoordhuis left a comment

LGTM with a suggestion.

src/tty_wrap.cc Outdated Show resolved Hide resolved
When console.log is called for the first time it initializes
TTYWrap object. However, if there is not enough space on the
V8 stack, creating function template fails and triggers
empty maybe local exception.
@Hakerh400
Copy link
Contributor Author

@Hakerh400 Hakerh400 commented Mar 29, 2019

CI was failing due to flaky test-worker-prof and the last run timed out for some reason. The failure seems unrelated to this PR.

@nodejs-github-bot
Copy link
Contributor

@nodejs-github-bot nodejs-github-bot commented Mar 30, 2019

BridgeAR added a commit to BridgeAR/node that referenced this issue Apr 4, 2019
When console.log is called for the first time it initializes
TTYWrap object. However, if there is not enough space on the
V8 stack, creating function template fails and triggers
empty maybe local exception.

PR-URL: nodejs#26832
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@BridgeAR
Copy link
Member

@BridgeAR BridgeAR commented Apr 4, 2019

Landed in 6fb32ac 🎉

@BridgeAR BridgeAR closed this Apr 4, 2019
@Hakerh400 Hakerh400 deleted the tty branch Apr 4, 2019
BethGriggs pushed a commit that referenced this issue Apr 9, 2019
When console.log is called for the first time it initializes
TTYWrap object. However, if there is not enough space on the
V8 stack, creating function template fails and triggers
empty maybe local exception.

PR-URL: #26832
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Signed-off-by: Beth Griggs <Bethany.Griggs@uk.ibm.com>
@BethGriggs BethGriggs mentioned this pull request Apr 9, 2019
BethGriggs pushed a commit that referenced this issue Apr 10, 2019
When console.log is called for the first time it initializes
TTYWrap object. However, if there is not enough space on the
V8 stack, creating function template fails and triggers
empty maybe local exception.

PR-URL: #26832
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Signed-off-by: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants