DescriptionVM: 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
Messages
Total messages: 11 (6 generated)
|