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

Issue 2680123004: VM: Teach GetAndValidateIsolateStackBounds(...) to fallback to OS thread stack bounds. (Closed)

Created:
3 years, 10 months ago by Vyacheslav Egorov (Google)
Modified:
3 years, 10 months ago
Reviewers:
rmacnak, Cutch
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

VM: Teach GetAndValidateIsolateStackBounds(...) to fallback to OS thread stack bounds. Currently it relies on OSThread::stack_base_ which is explicitly set. However if we encounter a crash or assertion failure early we don't have stack_base_ set yet. This CL allows us to get correct stack dump even if OSThread::stack_base_ is not set yet by falling back to low-level APIs: * On Linux and Android we fallback to pthread_attr_getstack * On Mac OS X we use pthread_get_stackaddr_np/pthread_get_stacksize_np. * On Windows we read limits from TIB. This code is mostly a port of the battle tested thread limits code from Oilpan GC inside Blink. The only differences is that we don't fallback to __libc_stack_end for the main thread. We also cleanup GetAndValidateIsolateStackBounds a bit to avoid duplication there. (This change is motivated by https://github.com/dart-lang/sdk/issues/28692 where crash in bootstrapping does not produce any useful stack trace) BUG= R=johnmccutchan@google.com Committed: https://github.com/dart-lang/sdk/commit/5ef40e6091988f0f5e21de9363df2fd823fc698f

Patch Set 1 #

Patch Set 2 : Update #

Patch Set 3 : Done #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+97 lines, -25 lines) Patch
M runtime/vm/os_thread.h View 1 chunk +2 lines, -0 lines 0 comments Download
M runtime/vm/os_thread_android.cc View 1 chunk +20 lines, -0 lines 0 comments Download
M runtime/vm/os_thread_fuchsia.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M runtime/vm/os_thread_linux.cc View 1 1 chunk +20 lines, -0 lines 0 comments Download
M runtime/vm/os_thread_macos.cc View 1 chunk +7 lines, -0 lines 0 comments Download
M runtime/vm/os_thread_win.cc View 1 2 1 chunk +15 lines, -0 lines 0 comments Download
M runtime/vm/profiler.cc View 2 chunks +28 lines, -25 lines 4 comments Download

Messages

Total messages: 11 (6 generated)
Vyacheslav Egorov (Google)
Hi Ryan, Please take a look.
3 years, 10 months ago (2017-02-09 15:37:24 UTC) #3
Cutch
LGTM w/c https://codereview.chromium.org/2680123004/diff/40001/runtime/vm/profiler.cc File runtime/vm/profiler.cc (right): https://codereview.chromium.org/2680123004/diff/40001/runtime/vm/profiler.cc#newcode804 runtime/vm/profiler.cc:804: static bool GetAndValidateIsolateStackBounds( While you're here, this ...
3 years, 10 months ago (2017-02-09 16:45:24 UTC) #7
Vyacheslav Egorov (Google)
Thanks for the review! https://codereview.chromium.org/2680123004/diff/40001/runtime/vm/profiler.cc File runtime/vm/profiler.cc (right): https://codereview.chromium.org/2680123004/diff/40001/runtime/vm/profiler.cc#newcode804 runtime/vm/profiler.cc:804: static bool GetAndValidateIsolateStackBounds( On 2017/02/09 ...
3 years, 10 months ago (2017-02-09 17:19:20 UTC) #8
Vyacheslav Egorov (Google)
Committed patchset #3 (id:40001) manually as 5ef40e6091988f0f5e21de9363df2fd823fc698f (presubmit successful).
3 years, 10 months ago (2017-02-09 18:46:14 UTC) #10
rmacnak
3 years, 10 months ago (2017-02-09 19:17:49 UTC) #11
Message was sent while issue was closed.
Nice!

Powered by Google App Engine
This is Rietveld 408576698