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

Side by Side Diff: android_webview/common/aw_crash_handler.cc

Issue 1090083002: [android-webview] Skip signal handler registration on x86/64 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2311
Patch Set: Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "android_webview/common/aw_crash_handler.h" 5 #include "android_webview/common/aw_crash_handler.h"
6 6
7 #include <android/log.h> 7 #include <android/log.h>
8 #include <signal.h> 8 #include <signal.h>
9 #include <sys/prctl.h> 9 #include <sys/prctl.h>
10 #include <sys/syscall.h> 10 #include <sys/syscall.h>
11 #include <unistd.h> 11 #include <unistd.h>
12 12
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "build/build_config.h"
14 15
15 namespace { 16 namespace {
16 17
17 const int kExceptionSignals[] = { 18 const int kExceptionSignals[] = {
18 SIGSEGV, SIGABRT, SIGFPE, SIGILL, SIGBUS 19 SIGSEGV, SIGABRT, SIGFPE, SIGILL, SIGBUS
19 }; 20 };
20 21
21 struct sigaction old_handlers[arraysize(kExceptionSignals)]; 22 struct sigaction old_handlers[arraysize(kExceptionSignals)];
22 23
23 bool crash_handler_registered; 24 bool crash_handler_registered;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 } 60 }
60 } 61 }
61 } 62 }
62 63
63 } // namespace 64 } // namespace
64 65
65 namespace android_webview { 66 namespace android_webview {
66 namespace crash_handler { 67 namespace crash_handler {
67 68
68 void RegisterCrashHandler(const std::string& version) { 69 void RegisterCrashHandler(const std::string& version) {
70 #if defined(ARCH_CPU_X86_FAMILY)
71 // Don't install signal handler on X86/64 because this breaks binary
72 // translators that handle SIGSEGV in userspace and get chained after our
73 // handler. See crbug.com/477444
74 return;
75 #endif
76
69 if (crash_handler_registered) { 77 if (crash_handler_registered) {
70 NOTREACHED(); 78 NOTREACHED();
71 return; 79 return;
72 } 80 }
73 81
74 g_crash_msg = "### WebView " + version; 82 g_crash_msg = "### WebView " + version;
75 g_crash_msg_ptr = g_crash_msg.c_str(); 83 g_crash_msg_ptr = g_crash_msg.c_str();
76 84
77 // Fail if unable to store all the old handlers. 85 // Fail if unable to store all the old handlers.
78 for (uint32_t i = 0; i < arraysize(kExceptionSignals); ++i) { 86 for (uint32_t i = 0; i < arraysize(kExceptionSignals); ++i) {
(...skipping 22 matching lines...) Expand all
101 LOG(ERROR) << "Error while overriding handler for signal " 109 LOG(ERROR) << "Error while overriding handler for signal "
102 << kExceptionSignals[i]; 110 << kExceptionSignals[i];
103 } 111 }
104 } 112 }
105 113
106 crash_handler_registered = true; 114 crash_handler_registered = true;
107 } 115 }
108 116
109 } // namespace crash_handler 117 } // namespace crash_handler
110 } // namespace android_webview 118 } // namespace android_webview
OLDNEW
« 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