summaryrefslogtreecommitdiffstats
path: root/runtime/runtime.cc
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2014-03-30 15:25:44 -0700
committerMathieu Chartier <mathieuc@google.com>2014-04-01 10:58:22 -0700
commitc751fdcc9491c1b60c3db517fbc41bb98e92441f (patch)
treea59258cf4b9c46e928e547216554149635e6d4f2 /runtime/runtime.cc
parente0309ad355e778fe692beb8968bf8aa7edbd3302 (diff)
downloadart-c751fdcc9491c1b60c3db517fbc41bb98e92441f.zip
art-c751fdcc9491c1b60c3db517fbc41bb98e92441f.tar.gz
art-c751fdcc9491c1b60c3db517fbc41bb98e92441f.tar.bz2
Add handler for printing java stack traces for compiled code SIGSEGV.
Added a new FaultHandler which attempts to print a java stack trace when a SIGSEGV occurse in generated code. This should help debugging compiler and GC related heap corruption. Bug: 13725693 Bug: 12934910 Change-Id: Id54d83ea180c222eb86d449c61926e83f0b026ad
Diffstat (limited to 'runtime/runtime.cc')
-rw-r--r--runtime/runtime.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index f016189..3e3b5e4 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -77,6 +77,7 @@
namespace art {
+static constexpr bool kEnableJavaStackTraceHandler = true;
Runtime* Runtime::instance_ = NULL;
Runtime::Runtime()
@@ -523,12 +524,11 @@ bool Runtime::Init(const Options& raw_options, bool ignore_unrecognized) {
if (options->explicit_checks_ != (ParsedOptions::kExplicitSuspendCheck |
ParsedOptions::kExplicitNullCheck |
- ParsedOptions::kExplicitStackOverflowCheck)) {
- // Initialize the fault manager.
+ ParsedOptions::kExplicitStackOverflowCheck) || kEnableJavaStackTraceHandler) {
fault_manager.Init();
- // These need to be in a specific order. The null point check must be
- // the last in the list.
+ // These need to be in a specific order. The null point check handler must be
+ // after the suspend check and stack overflow check handlers.
if ((options->explicit_checks_ & ParsedOptions::kExplicitSuspendCheck) == 0) {
suspend_handler_ = new SuspensionHandler(&fault_manager);
}
@@ -540,6 +540,10 @@ bool Runtime::Init(const Options& raw_options, bool ignore_unrecognized) {
if ((options->explicit_checks_ & ParsedOptions::kExplicitNullCheck) == 0) {
null_pointer_handler_ = new NullPointerHandler(&fault_manager);
}
+
+ if (kEnableJavaStackTraceHandler) {
+ new JavaStackTraceHandler(&fault_manager);
+ }
}
heap_ = new gc::Heap(options->heap_initial_size_,