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: handle errors while printing error objects #25834

Closed
wants to merge 1 commit into from

Conversation

addaleax
Copy link
Member

Handle situations where accessing .name or .stack on an object
fails.

Fixes: #25718

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

Handle situations where accessing `.name` or `.stack` on an object
fails.

Fixes: nodejs#25718
@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Jan 30, 2019
@addaleax
Copy link
Member Author

addaleax commented Feb 1, 2019

@addaleax
Copy link
Member Author

addaleax commented Feb 3, 2019

Landed in f722540

@addaleax addaleax closed this Feb 3, 2019
@addaleax addaleax deleted the errors-maybe branch February 3, 2019 19:39
addaleax added a commit that referenced this pull request Feb 3, 2019
Handle situations where accessing `.name` or `.stack` on an object
fails.

Fixes: #25718

PR-URL: #25834
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
addaleax added a commit that referenced this pull request Feb 3, 2019
Handle situations where accessing `.name` or `.stack` on an object
fails.

Fixes: #25718

PR-URL: #25834
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
@jdalton
Copy link
Member

jdalton commented Feb 7, 2019

Nice @addaleax!

I was just going to report this as:

echo "var e = new Error;Reflect.defineProperty(e,'stack', { get() { throw new Error } });throw e" | node

could cause a hard crash. I believe this PR fixed it since I do not hit the issue when I build from master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FatalException handler SIGABRT from throw with .stack getter error
8 participants