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

exception handling crash #4079

Closed
programmerjake opened this issue Dec 1, 2015 · 7 comments
Closed

exception handling crash #4079

programmerjake opened this issue Dec 1, 2015 · 7 comments
Labels
v8 engine Issues and PRs related to the V8 dependency.

Comments

@programmerjake
Copy link

node 5.1.0 crashes on windows 7 when running:
node -e "throw {toString:function(){throw this;}}"

@Fishrock123 Fishrock123 added the v8 engine Issues and PRs related to the V8 dependency. label Dec 1, 2015
@Fishrock123
Copy link
Contributor

Smells like a v8 issue.

@programmerjake
Copy link
Author

google chrome doesn't exhibit this issue

@evanlucas
Copy link
Contributor

what behavior does chrome exhibit?

On v4+:

$ node -e "throw {toString: function() { throw this; }}"

[eval]:1
throw {toString: function() { throw this; }}
^
Ƕ?b?

0.10 aborts

@targos
Copy link
Member

targos commented Dec 1, 2015

in Chrome's console:

image

@mscdex
Copy link
Contributor

mscdex commented Dec 1, 2015

On Linux with node v5.1.0 I just get:

[eval]:1
throw {toString:function(){throw this;}}
^

No weird/junk characters below the caret.

@alexlamsl
Copy link

Node 5.1.0, Windows Server 2012 R2:

C:\>node -e "throw {toString:function(){throw this;}}"

[eval]:1
throw {toString:function(){throw this;}}
^
 Er?O?☻

@alexlamsl
Copy link

C:\>node
> throw {toString:function(){throw this;}}

repl:1
throw {toString:function(){throw this;}}
                           ^
 ??b=~

@cjihrig cjihrig closed this as completed in 1ec09b0 Dec 5, 2015
cjihrig added a commit that referenced this issue Dec 8, 2015
If JS throws an object whose toString() method throws, then Node
attempts to print an empty message, but actually prints garbage.
This commit checks for this case, and prints a message instead.

Fixes: #4079
PR-URL: #4112
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
cjihrig added a commit that referenced this issue Dec 29, 2015
If JS throws an object whose toString() method throws, then Node
attempts to print an empty message, but actually prints garbage.
This commit checks for this case, and prints a message instead.

Fixes: #4079
PR-URL: #4112
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
MylesBorins pushed a commit that referenced this issue Jan 19, 2016
If JS throws an object whose toString() method throws, then Node
attempts to print an empty message, but actually prints garbage.
This commit checks for this case, and prints a message instead.

Fixes: #4079
PR-URL: #4112
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
scovetta pushed a commit to scovetta/node that referenced this issue Apr 2, 2016
If JS throws an object whose toString() method throws, then Node
attempts to print an empty message, but actually prints garbage.
This commit checks for this case, and prints a message instead.

Fixes: nodejs#4079
PR-URL: nodejs#4112
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v8 engine Issues and PRs related to the V8 dependency.
Projects
None yet
Development

No branches or pull requests

6 participants