diff options
author | Mathieu Chartier <mathieuc@google.com> | 2015-01-07 16:00:03 -0800 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2015-01-07 16:50:55 -0800 |
commit | 50c138f7f89ed03d49aa4bdde7351c26b3403e90 (patch) | |
tree | e87e85e58e782d7792c46927d2c6693fe507495a /runtime/entrypoints | |
parent | 4ea18c02148cffe72e025990e9b2727bfec563da (diff) | |
download | art-50c138f7f89ed03d49aa4bdde7351c26b3403e90.tar.gz art-50c138f7f89ed03d49aa4bdde7351c26b3403e90.tar.bz2 art-50c138f7f89ed03d49aa4bdde7351c26b3403e90.zip |
Fix signal test to work with gcstress
We now avoid running GC if we are handling a stack overflow, this
helps prevent running past the end of the stack overflow reserved
bytes.
Added logic in ThrowStackOverflowError to use a stack overflow
exception without a stack trace if we fail to allocate the stack
trace.
Bug: 16406852
Change-Id: Ib34e235cd0af6d7c4c93c9705fa822f2b9b23b38
Diffstat (limited to 'runtime/entrypoints')
-rw-r--r-- | runtime/entrypoints/entrypoint_utils.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/runtime/entrypoints/entrypoint_utils.cc b/runtime/entrypoints/entrypoint_utils.cc index e734d4512d..db51264861 100644 --- a/runtime/entrypoints/entrypoint_utils.cc +++ b/runtime/entrypoints/entrypoint_utils.cc @@ -183,14 +183,12 @@ void ThrowStackOverflowError(Thread* self) { env->SetObjectField(exc.get(), WellKnownClasses::java_lang_Throwable_stackTrace, stack_trace_elem.get()); - - // Throw the exception. - ThrowLocation throw_location = self->GetCurrentLocationForThrow(); - self->SetException(throw_location, - reinterpret_cast<mirror::Throwable*>(self->DecodeJObject(exc.get()))); } else { error_msg = "Could not create stack trace."; } + // Throw the exception. + self->SetException(self->GetCurrentLocationForThrow(), + reinterpret_cast<mirror::Throwable*>(self->DecodeJObject(exc.get()))); } else { // Could not allocate a string object. error_msg = "Couldn't throw new StackOverflowError because JNI NewStringUTF failed."; |