Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Issue 213023: Adds an API for changing the default stack size limit. (Closed)

Created:
11 years, 3 months ago by dominic.cooney
Modified:
7 years ago
Reviewers:
Erik Corry
CC:
dominicc1
Visibility:
Public.

Description

Deprecated in favor of <http://codereview.chromium.org/242014>;. Adds an API for changing the default stack size limit. The current 512K/1M default, kLimitSize, isn't appropriate for OS X. OS X has a 512K default thread stack size.

Patch Set 1 #

Patch Set 2 : Makes the ResourceConstraints::set_stack_limit API work in practice. #

Patch Set 3 : Makes the SetResourceConstraints test simulator-friendly. #

Patch Set 4 : Makes the SetResourceConstraints test run both on simulators and off. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+77 lines, -20 lines) Patch
M src/execution.cc View 1 3 chunks +23 lines, -20 lines 0 comments Download
M test/cctest/test-api.cc View 1 2 3 2 chunks +54 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
dominic.cooney_gmail.com
Here's a proposed minimal patch. It turns out to be convenient for workers, which can ...
11 years, 3 months ago (2009-09-18 09:05:12 UTC) #1
dominic.cooney_gmail.com
OK, here's another take on this--making the ResourceConstraints::set_stack_limit API actually work. Just apply the test ...
11 years, 3 months ago (2009-09-22 09:30:01 UTC) #2
dominic.cooney_gmail.com
11 years, 3 months ago (2009-09-23 19:42:57 UTC) #3
Let me recap what's going on:

Runaway recursion in workers crash with C++ stack overflows on OS X because the
default stack limit is too large for OS X threads.

There's an API--ResourceConstraints::set_stack_limit/SetResourceConstraints that
looks like it is intended to let users set up a stack limit manually. This API
doesn't work--in debug mode, the initial StackGuard::StackGuard invocation
CHECKS that the limits are still uninitialized (kIllegalLimit). In release mode
StackGuard::StackGuard goes ahead and overwrites any configured limits.

If you just patch the updated test-api.cc and run the SetResourceConstraints
test in debug mode and release mode you'll see these two problems exhibit.

In theory, if the v8::internal::StackGuard::SetStackLimit method was accessible,
external callers could call this after the first StackGuard is established to
re-set the limit. But that API isn't accessible. SetResourceConstraints isn't
usable because it also checks that Heap is not initialized.

This changelist makes the SetResourceConstraints API work, but I argue this
isn't what we want: this doesn't provide any way to set a stack limit per thread
(and consequently it breaks Threading and Threading2 tests.)

What would you like to see here?

Powered by Google App Engine
This is Rietveld 408576698