diff options
author | John Spurlock <jspurlock@google.com> | 2014-10-06 17:54:40 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-10-06 17:54:41 +0000 |
commit | 78cc93ec80f5dcc487db697a1f9a545890745847 (patch) | |
tree | f5292dc17c497abbd19bddf7d3a522aa1fcac7ed | |
parent | 2dd86d50ae19efa071d83e02545b2767c351fdd6 (diff) | |
parent | 9bb3dacbf9da4dae2cc0585c2e382c8b29476d32 (diff) | |
download | frameworks_base-78cc93ec80f5dcc487db697a1f9a545890745847.zip frameworks_base-78cc93ec80f5dcc487db697a1f9a545890745847.tar.gz frameworks_base-78cc93ec80f5dcc487db697a1f9a545890745847.tar.bz2 |
Merge "Fix NPE in StrictMode handling." into lmp-dev
-rw-r--r-- | core/java/android/os/StrictMode.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/java/android/os/StrictMode.java b/core/java/android/os/StrictMode.java index 47ea732..6db5f67 100644 --- a/core/java/android/os/StrictMode.java +++ b/core/java/android/os/StrictMode.java @@ -1726,6 +1726,7 @@ public final class StrictMode { if (LOG_V) Log.d(TAG, "strict mode violation stacks read from binder call. i=" + i); ViolationInfo info = new ViolationInfo(p, !currentlyGathering); if (info.crashInfo.stackTrace != null && info.crashInfo.stackTrace.length() > 10000) { + String front = info.crashInfo.stackTrace.substring(256); // 10000 characters is way too large for this to be any sane kind of // strict mode collection of stacks. We've had a problem where we leave // strict mode violations associated with the thread, and it keeps tacking @@ -1742,7 +1743,7 @@ public final class StrictMode { // Now report the problem. Slog.wtfStack(TAG, "Stack is too large: numViolations=" + numViolations + " policy=#" + Integer.toHexString(policyMask) - + " front=" + info.crashInfo.stackTrace.substring(256)); + + " front=" + front); return; } info.crashInfo.stackTrace += "# via Binder call with stack:\n" + ourStack; |