Skip to content

src: handle errors while printing error objects #25834

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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 <targos@protonmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
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 <targos@protonmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@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.

# for free to join this conversation on GitHub. Already have an account? # 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