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

test: use JSON.stringify to trigger stack overflow #12481

Closed
wants to merge 1 commit into from

Conversation

hashseed
Copy link
Member

V8's interpreter performs stack checks both at the call site and at the
function entry. A recursive function could therefore trigger stack
overflow at two different source locations. Instead of recursion, call
JSON.stringify on a deeply nested array.

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

test

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Apr 18, 2017
@vsemozhetbyt
Copy link
Contributor

V8's interpreter performs stack checks both at the call site and at the
function entry. A recursive function could therefore trigger stack
overflow at two different source locations. Instead of recursion, call
JSON.stringify on a deeply nested array.
@hashseed hashseed changed the title test: use JSON.stringify trigger stack overflow test: use JSON.stringify to trigger stack overflow Apr 19, 2017
@hashseed
Copy link
Member Author

Fixed the commit title to add "to".

@fhinkel
Copy link
Member

fhinkel commented Apr 21, 2017

Thanks. Landed in b73b903

@fhinkel fhinkel closed this Apr 21, 2017
fhinkel pushed a commit that referenced this pull request Apr 21, 2017
V8's interpreter performs stack checks both at the call site and at the
function entry. A recursive function could therefore trigger stack
overflow at two different source locations. Instead of recursion, call
JSON.stringify on a deeply nested array.

PR-URL: #12481
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@hashseed hashseed deleted the stackoverflow-test branch April 25, 2017 05:08
evanlucas pushed a commit that referenced this pull request Apr 25, 2017
V8's interpreter performs stack checks both at the call site and at the
function entry. A recursive function could therefore trigger stack
overflow at two different source locations. Instead of recursion, call
JSON.stringify on a deeply nested array.

PR-URL: #12481
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@evanlucas evanlucas mentioned this pull request May 1, 2017
evanlucas pushed a commit that referenced this pull request May 1, 2017
V8's interpreter performs stack checks both at the call site and at the
function entry. A recursive function could therefore trigger stack
overflow at two different source locations. Instead of recursion, call
JSON.stringify on a deeply nested array.

PR-URL: #12481
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
evanlucas pushed a commit that referenced this pull request May 2, 2017
V8's interpreter performs stack checks both at the call site and at the
function entry. A recursive function could therefore trigger stack
overflow at two different source locations. Instead of recursion, call
JSON.stringify on a deeply nested array.

PR-URL: #12481
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@gibfahn
Copy link
Member

gibfahn commented May 16, 2017

Backported to v6.x, LMK if that was a mistake.

gibfahn pushed a commit that referenced this pull request May 16, 2017
V8's interpreter performs stack checks both at the call site and at the
function entry. A recursive function could therefore trigger stack
overflow at two different source locations. Instead of recursion, call
JSON.stringify on a deeply nested array.

PR-URL: #12481
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@hashseed
Copy link
Member Author

Not wrong, but not necessary either. This is to prepare for V8's new compiler pipeline, which doesn't land until Node 8.

MylesBorins pushed a commit that referenced this pull request May 18, 2017
V8's interpreter performs stack checks both at the call site and at the
function entry. A recursive function could therefore trigger stack
overflow at two different source locations. Instead of recursion, call
JSON.stringify on a deeply nested array.

PR-URL: #12481
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins MylesBorins mentioned this pull request May 23, 2017
andrew749 pushed a commit to michielbaird/node that referenced this pull request Jul 19, 2017
V8's interpreter performs stack checks both at the call site and at the
function entry. A recursive function could therefore trigger stack
overflow at two different source locations. Instead of recursion, call
JSON.stringify on a deeply nested array.

PR-URL: nodejs/node#12481
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants