Back out 171c124a1402 (bug 961712) for debug b2g mochitest crashes after timeouts
authorPhil Ringnalda <philringnalda@gmail.com>
Mon, 20 Jan 2014 13:03:26 -0800
changeset 164317 7c2217054821886c3ceac919681c6d0193dcbf8a
parent 164316 30884a796fa9d98aef796c0af214c4a8a2ed1e61
child 164318 cf38b3d51ada6b16e2d79e2173c3de52b55b0f13
child 164366 99715b654c8728ffe179264009953df529da27cf
push id38674
push userphilringnalda@gmail.com
push dateMon, 20 Jan 2014 21:04:10 +0000
treeherdermozilla-inbound@7c2217054821 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs961712
milestone29.0a1
backs out171c124a1402d0cce34a811d0247ca550ebf208d
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Back out 171c124a1402 (bug 961712) for debug b2g mochitest crashes after timeouts
xpcom/glue/nsCRTGlue.cpp
--- a/xpcom/glue/nsCRTGlue.cpp
+++ b/xpcom/glue/nsCRTGlue.cpp
@@ -294,53 +294,17 @@ vprintf_stderr(const char *fmt, va_list 
 }
 
 #undef va_copy
 
 #elif defined(ANDROID)
 void
 vprintf_stderr(const char *fmt, va_list args)
 {
-  if (!fmt) {
-    return;
-  }
-
-  // Android's logging functions append new-lines to all output, so handle this
-  // by buffering between new-lines.
-
-  static char printf_buffer[2048];
-  static size_t printf_buffer_idx = 0;
-
-  size_t old_idx = printf_buffer_idx;
-  printf_buffer_idx +=
-    vsnprintf(printf_buffer + printf_buffer_idx,
-              sizeof(printf_buffer) - printf_buffer_idx,
-              fmt, args);
-
-  // Handle overflow. In this case, print the old buffer, the new format and
-  // clear the buffer for the next call.
-  if (printf_buffer_idx >= sizeof(printf_buffer)) {
-    printf_buffer[old_idx] = '\0';
-    printf_buffer_idx = 0;
-    __android_log_print(ANDROID_LOG_INFO, "Gecko", printf_buffer);
-    __android_log_vprint(ANDROID_LOG_INFO, "Gecko", fmt, args);
-    return;
-  }
-
-  // Print up to the last new-line, if there are any, and if there are, move
-  // the rest of the string back to the beginning.
-  char* last_newline = strrchr(printf_buffer + old_idx, '\n');
-  if (last_newline) {
-    last_newline[0] = '\0';
-    __android_log_print(ANDROID_LOG_INFO, "Gecko", printf_buffer);
-
-    char* remainder = last_newline + 1;
-    printf_buffer_idx = strlen(remainder);
-    memmove(printf_buffer, remainder, printf_buffer_idx);
-  }
+  __android_log_vprint(ANDROID_LOG_INFO, "Gecko", fmt, args);
 }
 #else
 void
 vprintf_stderr(const char *fmt, va_list args)
 {
   vfprintf(stderr, fmt, args);
 }
 #endif