Change wtf errors from ASSERT to ERROR.

Calling println_native with the value of ASSERT will set the abort
message. Unfortunately, there are numerous cases where one thread aborts,
but before that thread can communicate with debuggerd, another thread
calls wtf, which overwrites the abort message from the original
failing thread.

Fix this by changing this to an error level log message.

Bug: 21490722
(cherry picked from commit 2d073ba83c)

Change-Id: Ib9daedf114a2e0ecc424641e4929cc4d15b0c776
This commit is contained in:
Christopher Ferris
2015-06-09 10:51:43 -07:00
parent c521b10854
commit 70e23e0d14

View File

@@ -289,7 +289,10 @@ public final class Log {
static int wtf(int logId, String tag, String msg, Throwable tr, boolean localStack,
boolean system) {
TerribleFailure what = new TerribleFailure(msg, tr);
int bytes = println_native(logId, ASSERT, tag, msg + '\n'
// Only mark this as ERROR, do not use ASSERT since that should be
// reserved for cases where the system is guaranteed to abort.
// The onTerribleFailure call does not always cause a crash.
int bytes = println_native(logId, ERROR, tag, msg + '\n'
+ getStackTraceString(localStack ? what : tr));
sWtfHandler.onTerribleFailure(tag, what, system);
return bytes;