Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <dirent.h> | 5 #include <dirent.h> |
| 6 #include <errno.h> | 6 #include <errno.h> |
| 7 #include <fcntl.h> | 7 #include <fcntl.h> |
| 8 #include <signal.h> | 8 #include <signal.h> |
| 9 #include <stdlib.h> | 9 #include <stdlib.h> |
| 10 #include <sys/resource.h> | 10 #include <sys/resource.h> |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 134 | 134 |
| 135 return status; | 135 return status; |
| 136 } | 136 } |
| 137 | 137 |
| 138 // Android has built-in crash handling. | 138 // Android has built-in crash handling. |
| 139 #if !defined(OS_ANDROID) | 139 #if !defined(OS_ANDROID) |
| 140 void StackDumpSignalHandler(int signal, siginfo_t* info, ucontext_t* context) { | 140 void StackDumpSignalHandler(int signal, siginfo_t* info, ucontext_t* context) { |
| 141 if (debug::BeingDebugged()) | 141 if (debug::BeingDebugged()) |
| 142 debug::BreakDebugger(); | 142 debug::BreakDebugger(); |
| 143 | 143 |
| 144 #if defined(OS_MACOSX) | |
| 145 // TODO(phajdan.jr): Fix hangs caused by using malloc below. | |
|
Scott Hess - ex-Googler
2012/10/30 23:59:55
Ref a tracking bug for this, and maybe s/malloc/tc
| |
| 144 DLOG(ERROR) << "Received signal " << signal; | 146 DLOG(ERROR) << "Received signal " << signal; |
| 145 debug::StackTrace().PrintBacktrace(); | 147 debug::StackTrace().PrintBacktrace(); |
| 148 #endif | |
| 146 | 149 |
| 147 // TODO(shess): Port to Linux. | 150 // TODO(shess): Port to Linux. |
| 148 #if defined(OS_MACOSX) | 151 #if defined(OS_MACOSX) |
| 149 // TODO(shess): Port to 64-bit. | 152 // TODO(shess): Port to 64-bit. |
| 150 #if ARCH_CPU_32_BITS | 153 #if ARCH_CPU_32_BITS |
| 151 char buf[1024]; | 154 char buf[1024]; |
| 152 size_t len; | 155 size_t len; |
| 153 | 156 |
| 154 // NOTE: Even |snprintf()| is not on the approved list for signal | 157 // NOTE: Even |snprintf()| is not on the approved list for signal |
| 155 // handlers, but buffered I/O is definitely not on the list due to | 158 // handlers, but buffered I/O is definitely not on the list due to |
| (...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1338 if (IsChildDead(process)) | 1341 if (IsChildDead(process)) |
| 1339 return; | 1342 return; |
| 1340 | 1343 |
| 1341 BackgroundReaper* reaper = new BackgroundReaper(process, 0); | 1344 BackgroundReaper* reaper = new BackgroundReaper(process, 0); |
| 1342 PlatformThread::CreateNonJoinable(0, reaper); | 1345 PlatformThread::CreateNonJoinable(0, reaper); |
| 1343 } | 1346 } |
| 1344 | 1347 |
| 1345 #endif // !defined(OS_MACOSX) | 1348 #endif // !defined(OS_MACOSX) |
| 1346 | 1349 |
| 1347 } // namespace base | 1350 } // namespace base |
| OLD | NEW |