Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Unified Diff: base/process_util_posix.cc

Issue 11340054: Band-aid fix for test hangs: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed release build Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process_util_posix.cc
diff --git a/base/process_util_posix.cc b/base/process_util_posix.cc
index 6d41fe6cd66c034a26ce80848af7bdc76051eabd..a40d812607e6ea0eedf2d12addb2c01a6ebb5c41 100644
--- a/base/process_util_posix.cc
+++ b/base/process_util_posix.cc
@@ -141,16 +141,23 @@ void StackDumpSignalHandler(int signal, siginfo_t* info, ucontext_t* context) {
if (debug::BeingDebugged())
debug::BreakDebugger();
- DLOG(ERROR) << "Received signal " << signal;
- debug::StackTrace().PrintBacktrace();
+ char buf[1024];
+ size_t len;
+
+ // NOTE: Even |snprintf()| is not on the approved list for signal
+ // handlers, but buffered I/O is definitely not on the list due to
+ // potential for |malloc()|.
+ len = static_cast<size_t>(
+ snprintf(buf, sizeof(buf), "Received signal %d\n", signal));
+ ignore_result(write(STDERR_FILENO, buf, std::min(len, sizeof(buf) - 1)));
+
+ // TODO(phajdan.jr): Re-enable backtrace printing after fixing the hang.
+ // debug::StackTrace().PrintBacktrace();
// TODO(shess): Port to Linux.
#if defined(OS_MACOSX)
Scott Hess - ex-Googler 2012/10/30 23:47:59 I would prefer to have the PrintBacktrace() enable
// TODO(shess): Port to 64-bit.
#if ARCH_CPU_32_BITS
- char buf[1024];
- size_t len;
-
// NOTE: Even |snprintf()| is not on the approved list for signal
// handlers, but buffered I/O is definitely not on the list due to
// potential for |malloc()|.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698