diff options
| author | Dianne Hackborn <hackbod@google.com> | 2014-10-02 00:23:17 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-10-02 00:23:18 +0000 |
| commit | c338784bf6bfcce3cd7db40f46b0e6c815e9ed3a (patch) | |
| tree | 44a5c84c61dec9711094c0978bfbb913cb6542bb /core/java/android/os | |
| parent | 4d82c46ef5df06e1b92f3574e41b38a62ec0e607 (diff) | |
| parent | 8d05172112436a81bed6e4a0810f8914509d8a4d (diff) | |
| download | frameworks_base-c338784bf6bfcce3cd7db40f46b0e6c815e9ed3a.zip frameworks_base-c338784bf6bfcce3cd7db40f46b0e6c815e9ed3a.tar.gz frameworks_base-c338784bf6bfcce3cd7db40f46b0e6c815e9ed3a.tar.bz2 | |
Merge "More work on issue #17656716: Unhandled exception in Window Manager" into lmp-dev
Diffstat (limited to 'core/java/android/os')
| -rw-r--r-- | core/java/android/os/StrictMode.java | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/core/java/android/os/StrictMode.java b/core/java/android/os/StrictMode.java index 0e561bd..0ee8d86f 100644 --- a/core/java/android/os/StrictMode.java +++ b/core/java/android/os/StrictMode.java @@ -1725,10 +1725,25 @@ public final class StrictMode { for (int i = 0; i < numViolations; ++i) { 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.length() > 5000) { - RuntimeException here = new RuntimeException("here"); - here.fillInStackTrace(); - Slog.w(TAG, "Stack is getting large: " + info.crashInfo.stackTrace, here); + if (info.crashInfo.stackTrace.length() > 10000) { + // 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 + // more and more stacks on to the violations. Looks like we're in this casse, + // so we'll report it and bail on all of the current strict mode violations + // we currently are maintaining for this thread. + // First, drain the remaining violations from the parcel. + while (i < numViolations) { + info = new ViolationInfo(p, !currentlyGathering); + i++; + } + // Next clear out all gathered violations. + clearGatheredViolations(); + // Now report the problem. + Slog.wtfStack(TAG, "Stack is too large: numViolations=" + numViolations + + " policy=#" + Integer.toHexString(policyMask) + + " front=" + info.crashInfo.stackTrace.substring(256)); + return; } info.crashInfo.stackTrace += "# via Binder call with stack:\n" + ourStack; BlockGuard.Policy policy = BlockGuard.getThreadPolicy(); |
