1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
|
--- indra.orig/cmake/GoogleBreakpad.cmake
+++ indra/cmake/GoogleBreakpad.cmake
@@ -2,7 +2,7 @@
include(Prebuilt)
if (STANDALONE)
- set(BREAKPAD_EXCEPTION_HANDLER_FIND_REQUIRED ON)
+ set(BREAKPAD_EXCEPTION_HANDLER_FIND_REQUIRED OFF)
include(FindGoogleBreakpad)
else (STANDALONE)
use_prebuilt_binary(google_breakpad)
--- indra.orig/llcommon/llapp.cpp
+++ indra/llcommon/llapp.cpp
@@ -46,7 +46,9 @@
#include "llstring.h"
#include "lleventtimer.h"
+#if 0
#include "google_breakpad/exception_handler.h"
+#endif
//
// Signal handling
@@ -143,8 +145,6 @@
// Set the application to this instance.
sApplication = this;
- mExceptionHandler = 0;
-
// initialize the buffer to write the minidump filename to
// (this is used to avoid allocating memory in the crash handler)
memset(minidump_path, 0, MAX_MINDUMP_PATH_LENGTH);
@@ -177,8 +177,6 @@
mThreadErrorp = NULL;
}
- if(mExceptionHandler != 0) delete mExceptionHandler;
-
LLCommon::cleanupClass();
}
@@ -284,75 +282,7 @@
void LLApp::setupErrorHandling()
{
- // Error handling is done by starting up an error handling thread, which just sleeps and
- // occasionally checks to see if the app is in an error state, and sees if it needs to be run.
-
-#if LL_WINDOWS
- // This sets a callback to handle w32 signals to the console window.
- // The viewer shouldn't be affected, sicne its a windowed app.
- SetConsoleCtrlHandler( (PHANDLER_ROUTINE) ConsoleCtrlHandler, TRUE);
-
- // Install the Google Breakpad crash handler for Windows
- if(mExceptionHandler == 0)
- {
- llwarns << "adding breakpad exception handler" << llendl;
- mExceptionHandler = new google_breakpad::ExceptionHandler(
- L"C:\\Temp\\", 0, windows_post_minidump_callback, 0, google_breakpad::ExceptionHandler::HANDLER_ALL);
- }
-
-#else
- //
- // Start up signal handling.
- //
- // There are two different classes of signals. Synchronous signals are delivered to a specific
- // thread, asynchronous signals can be delivered to any thread (in theory)
- //
- setup_signals();
-
- // Add google breakpad exception handler configured for Darwin/Linux.
- bool installHandler = true;
-#ifdef LL_DARWIN
- // For the special case of Darwin, we do not want to install the handler if
- // the process is being debugged as the app will exit with value ABRT (6) if
- // we do. Unfortunately, the code below which performs that test relies on
- // the structure kinfo_proc which has been tagged by apple as an unstable
- // API. We disable this test for shipping versions to avoid conflicts with
- // future releases of Darwin. This test is really only needed for developers
- // starting the app from a debugger anyway.
- #ifndef LL_RELEASE_FOR_DOWNLOAD
- int mib[4];
- mib[0] = CTL_KERN;
- mib[1] = KERN_PROC;
- mib[2] = KERN_PROC_PID;
- mib[3] = getpid();
-
- struct kinfo_proc info;
- memset(&info, 0, sizeof(info));
-
- size_t size = sizeof(info);
- int result = sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, NULL, 0);
- if((result == 0) || (errno == ENOMEM))
- {
- // P_TRACED flag is set, so this process is being debugged; do not install
- // the handler
- if(info.kp_proc.p_flag & P_TRACED) installHandler = false;
- }
- else
- {
- // Failed to discover if the process is being debugged; default to
- // installing the handler.
- installHandler = true;
- }
- #endif
-#endif
- if(installHandler && (mExceptionHandler == 0))
- {
- std::string dumpPath = "/tmp/";
- mExceptionHandler = new google_breakpad::ExceptionHandler(dumpPath, 0, &unix_post_minidump_callback, 0, true);
- }
-#endif
-
- startErrorThread();
+ sDisableCrashlogger = TRUE;
}
void LLApp::startErrorThread()
@@ -403,20 +333,10 @@
void LLApp::setMiniDumpDir(const std::string &path)
{
- if(mExceptionHandler == 0) return;
-#ifdef LL_WINDOWS
- wchar_t buffer[MAX_MINDUMP_PATH_LENGTH];
- mbstowcs(buffer, path.c_str(), MAX_MINDUMP_PATH_LENGTH);
- mExceptionHandler->set_dump_path(std::wstring(buffer));
-#else
- mExceptionHandler->set_dump_path(path);
-#endif
}
void LLApp::writeMiniDump()
{
- if(mExceptionHandler == 0) return;
- mExceptionHandler->WriteMinidump();
}
// static
@@ -473,13 +393,6 @@
void LLApp::disableCrashlogger()
{
- // Disable Breakpad exception handler.
- if (mExceptionHandler != 0)
- {
- delete mExceptionHandler;
- mExceptionHandler = 0;
- }
-
sDisableCrashlogger = TRUE;
}
--- indra.orig/llcommon/llapp.h
+++ indra/llcommon/llapp.h
@@ -60,9 +60,11 @@
};
#endif
+#if 0
namespace google_breakpad {
class ExceptionHandler; // See exception_handler.h
}
+#endif
class LL_COMMON_API LLApp : public LLOptionInterface
{
@@ -330,9 +332,9 @@
private:
// the static application instance if it was created.
static LLApp* sApplication;
-
+#if 0
google_breakpad::ExceptionHandler * mExceptionHandler;
-
+#endif
#if !LL_WINDOWS
friend void default_unix_signal_handler(int signum, siginfo_t *info, void *);
|