Bug Summary

File:root/firefox-clang/obj-x86_64-pc-linux-gnu/toolkit/crashreporter/google-breakpad/src/processor/./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc
Warning:line 94, column 8
Value stored to 'has_process_create_time' during its initialization is never read

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-pc-linux-gnu -O2 -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name Unified_cpp_src_processor0.cpp -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=cplusplus -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -analyzer-config-compatibility-mode=true -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=all -relaxed-aliasing -ffp-contract=off -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/root/firefox-clang/obj-x86_64-pc-linux-gnu/toolkit/crashreporter/google-breakpad/src/processor -fcoverage-compilation-dir=/root/firefox-clang/obj-x86_64-pc-linux-gnu/toolkit/crashreporter/google-breakpad/src/processor -resource-dir /usr/lib/llvm-23/lib/clang/23 -include /root/firefox-clang/config/gcc_hidden.h -include /root/firefox-clang/obj-x86_64-pc-linux-gnu/mozilla-config.h -D _GLIBCXX_ASSERTIONS=1 -I /root/firefox-clang/obj-x86_64-pc-linux-gnu/dist/system_wrappers -U _FORTIFY_SOURCE -D _FORTIFY_SOURCE=2 -D DEBUG=1 -D BPLOG_MINIMUM_SEVERITY=SEVERITY_CRITICAL -D NO_STABS_SUPPORT -I /root/firefox-clang/toolkit/crashreporter/google-breakpad/src/processor -I /root/firefox-clang/obj-x86_64-pc-linux-gnu/toolkit/crashreporter/google-breakpad/src/processor -I /root/firefox-clang/toolkit/crashreporter/breakpad-client -I /root/firefox-clang/toolkit/crashreporter/google-breakpad/src -I /root/firefox-clang/obj-x86_64-pc-linux-gnu/dist/include -I /root/firefox-clang/obj-x86_64-pc-linux-gnu/dist/include/nspr -I /root/firefox-clang/obj-x86_64-pc-linux-gnu/dist/include/nss -D MOZILLA_CLIENT -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/16/../../../../include/c++/16 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/16/../../../../include/x86_64-linux-gnu/c++/16 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/16/../../../../include/c++/16/backward -internal-isystem /usr/lib/llvm-23/lib/clang/23/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/16/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wno-error=pessimizing-move -Wno-error=large-by-value-copy=128 -Wno-error=implicit-int-float-conversion -Wno-error=thread-safety-analysis -Wno-error=tautological-type-limit-compare -Wno-invalid-offsetof -Wno-range-loop-analysis -Wno-deprecated-anon-enum-enum-conversion -Wno-deprecated-enum-enum-conversion -Wno-inline-new-delete -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=free-nonheap-object -Wno-error=atomic-alignment -Wno-error=deprecated-builtins -Wno-psabi -Wno-error=builtin-macro-redefined -Wno-vla-cxx-extension -Wno-unknown-warning-option -Wno-character-conversion -Wno-unused-local-typedefs -Wno-deprecated-declarations -Wno-bool-compare -Wno-unused-but-set-variable -Wno-c++11-narrowing -Wno-implicit-fallthrough -std=gnu++20 -fdeprecated-macro -ferror-limit 19 -fstrict-flex-arrays=1 -stack-protector 2 -fstack-clash-protection -ftrivial-auto-var-init=pattern -fno-rtti -fgnuc-version=4.2.1 -fno-implicit-modules -fskip-odr-check-in-gmf -fno-sized-deallocation -fno-aligned-allocation -fdiagnostics-absolute-paths -vectorize-loops -vectorize-slp -analyzer-checker optin.performance.Padding -analyzer-output=html -analyzer-config stable-report-filename=true -mllvm -dwarf-linkage-names=Abstract -faddrsig -fdwarf2-cfi-asm -o /tmp/scan-build-2026-09-01-224014-2642839-1 -x c++ Unified_cpp_src_processor0.cpp
1// Copyright (c) 2006, Google Inc.
2// All rights reserved.
3//
4// Redistribution and use in source and binary forms, with or without
5// modification, are permitted provided that the following conditions are
6// met:
7//
8// * Redistributions of source code must retain the above copyright
9// notice, this list of conditions and the following disclaimer.
10// * Redistributions in binary form must reproduce the above
11// copyright notice, this list of conditions and the following disclaimer
12// in the documentation and/or other materials provided with the
13// distribution.
14// * Neither the name of Google Inc. nor the names of its
15// contributors may be used to endorse or promote products derived from
16// this software without specific prior written permission.
17//
18// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
30#include "google_breakpad/processor/minidump_processor.h"
31
32#include <assert.h>
33
34#include <string>
35
36#include "common/scoped_ptr.h"
37#include "common/stdio_wrapper.h"
38#include "common/using_std_string.h"
39#include "google_breakpad/processor/call_stack.h"
40#include "google_breakpad/processor/minidump.h"
41#include "google_breakpad/processor/process_state.h"
42#include "google_breakpad/processor/exploitability.h"
43#include "google_breakpad/processor/stack_frame_symbolizer.h"
44#include "processor/logging.h"
45#include "processor/stackwalker_x86.h"
46#include "processor/symbolic_constants_win.h"
47
48namespace google_breakpad {
49
50MinidumpProcessor::MinidumpProcessor(SymbolSupplier *supplier,
51 SourceLineResolverInterface *resolver)
52 : frame_symbolizer_(new StackFrameSymbolizer(supplier, resolver)),
53 own_frame_symbolizer_(true),
54 enable_exploitability_(false),
55 enable_objdump_(false) {
56}
57
58MinidumpProcessor::MinidumpProcessor(SymbolSupplier *supplier,
59 SourceLineResolverInterface *resolver,
60 bool enable_exploitability)
61 : frame_symbolizer_(new StackFrameSymbolizer(supplier, resolver)),
62 own_frame_symbolizer_(true),
63 enable_exploitability_(enable_exploitability),
64 enable_objdump_(false) {
65}
66
67MinidumpProcessor::MinidumpProcessor(StackFrameSymbolizer *frame_symbolizer,
68 bool enable_exploitability)
69 : frame_symbolizer_(frame_symbolizer),
70 own_frame_symbolizer_(false),
71 enable_exploitability_(enable_exploitability),
72 enable_objdump_(false) {
73 assert(frame_symbolizer_)(static_cast <bool> (frame_symbolizer_) ? void (0) : __assert_fail
("frame_symbolizer_", __builtin_FILE (), __builtin_LINE (), __extension__
__PRETTY_FUNCTION__))
;
74}
75
76MinidumpProcessor::~MinidumpProcessor() {
77 if (own_frame_symbolizer_) delete frame_symbolizer_;
78}
79
80ProcessResult MinidumpProcessor::Process(
81 Minidump *dump, ProcessState *process_state) {
82 assert(dump)(static_cast <bool> (dump) ? void (0) : __assert_fail (
"dump", __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__
))
;
83 assert(process_state)(static_cast <bool> (process_state) ? void (0) : __assert_fail
("process_state", __builtin_FILE (), __builtin_LINE (), __extension__
__PRETTY_FUNCTION__))
;
84
85 process_state->Clear();
86
87 const MDRawHeader *header = dump->header();
88 if (!header) {
89 BPLOG(ERROR)!(((google_breakpad::LogStream::SEVERITY_ERROR) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
cerr, google_breakpad::LogStream::SEVERITY_ERROR, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 89))
<< "Minidump " << dump->path() << " has no header";
90 return PROCESS_ERROR_NO_MINIDUMP_HEADER;
91 }
92 process_state->time_date_stamp_ = header->time_date_stamp;
93
94 bool has_process_create_time =
Value stored to 'has_process_create_time' during its initialization is never read
95 GetProcessCreateTime(dump, &process_state->process_create_time_);
96
97 bool has_cpu_info = GetCPUInfo(dump, &process_state->system_info_);
98 bool has_os_info = GetOSInfo(dump, &process_state->system_info_);
99
100 uint32_t dump_thread_id = 0;
101 bool has_dump_thread = false;
102 uint32_t requesting_thread_id = 0;
103 bool has_requesting_thread = false;
104
105 MinidumpBreakpadInfo *breakpad_info = dump->GetBreakpadInfo();
106 if (breakpad_info) {
107 has_dump_thread = breakpad_info->GetDumpThreadID(&dump_thread_id);
108 has_requesting_thread =
109 breakpad_info->GetRequestingThreadID(&requesting_thread_id);
110 }
111
112 MinidumpException *exception = dump->GetException();
113 if (exception) {
114 process_state->crashed_ = true;
115 has_requesting_thread = exception->GetThreadID(&requesting_thread_id);
116
117 process_state->crash_reason_ = GetCrashReason(
118 dump, &process_state->crash_address_);
119
120 process_state->exception_record_.set_code(
121 exception->exception()->exception_record.exception_code,
122 // TODO(ivanpe): Populate description.
123 /* description = */ "");
124 process_state->exception_record_.set_flags(
125 exception->exception()->exception_record.exception_flags,
126 // TODO(ivanpe): Populate description.
127 /* description = */ "");
128 process_state->exception_record_.set_nested_exception_record_address(
129 exception->exception()->exception_record.exception_record);
130 process_state->exception_record_.set_address(process_state->crash_address_);
131 for (uint32_t i = 0;
132 i < exception->exception()->exception_record.number_parameters; i++) {
133 process_state->exception_record_.add_parameter(
134 exception->exception()->exception_record.exception_information[i],
135 // TODO(ivanpe): Populate description.
136 /* description = */ "");
137 }
138 }
139
140 MinidumpMacCrashInfo *crash_info = dump->GetMacCrashInfo();
141 if (crash_info) {
142 process_state->mac_crash_info_ = crash_info->description();
143 process_state->mac_crash_info_records_ = crash_info->records();
144 }
145
146 // This will just return an empty string if it doesn't exist.
147 process_state->assertion_ = GetAssertion(dump);
148
149 MinidumpModuleList *module_list = dump->GetModuleList();
150
151 // Put a copy of the module list into ProcessState object. This is not
152 // necessarily a MinidumpModuleList, but it adheres to the CodeModules
153 // interface, which is all that ProcessState needs to expose.
154 if (module_list) {
155 process_state->modules_ = module_list->Copy();
156 process_state->shrunk_range_modules_ =
157 process_state->modules_->GetShrunkRangeModules();
158 for (unsigned int i = 0;
159 i < process_state->shrunk_range_modules_.size();
160 i++) {
161 linked_ptr<const CodeModule> module =
162 process_state->shrunk_range_modules_[i];
163 BPLOG(INFO)!(((google_breakpad::LogStream::SEVERITY_INFO) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
clog, google_breakpad::LogStream::SEVERITY_INFO, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 163))
<< "The range for module " << module->code_file()
164 << " was shrunk down by " << HexString(
165 module->shrink_down_delta()) << " bytes. ";
166 }
167 }
168
169 MinidumpUnloadedModuleList *unloaded_module_list =
170 dump->GetUnloadedModuleList();
171 if (unloaded_module_list) {
172 process_state->unloaded_modules_ = unloaded_module_list->Copy();
173 }
174
175 MinidumpMemoryList *memory_list = dump->GetMemoryList();
176 if (memory_list) {
177 BPLOG(INFO)!(((google_breakpad::LogStream::SEVERITY_INFO) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
clog, google_breakpad::LogStream::SEVERITY_INFO, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 177))
<< "Found " << memory_list->region_count()
178 << " memory regions.";
179 }
180
181 MinidumpThreadNamesList* thread_names_list = dump->GetThreadNamesList();
182 if (thread_names_list) {
183 BPLOG(INFO)!(((google_breakpad::LogStream::SEVERITY_INFO) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
clog, google_breakpad::LogStream::SEVERITY_INFO, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 183))
<< "Found " << thread_names_list->name_count()
184 << " thread names.";
185 }
186
187 MinidumpThreadList *threads = dump->GetThreadList();
188 if (!threads) {
189 BPLOG(ERROR)!(((google_breakpad::LogStream::SEVERITY_ERROR) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
cerr, google_breakpad::LogStream::SEVERITY_ERROR, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 189))
<< "Minidump " << dump->path() << " has no thread list";
190 return PROCESS_ERROR_NO_THREAD_LIST;
191 }
192
193 BPLOG(INFO)!(((google_breakpad::LogStream::SEVERITY_INFO) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
clog, google_breakpad::LogStream::SEVERITY_INFO, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 193))
<< "Minidump " << dump->path() << " has " <<
194 (has_cpu_info ? "" : "no ") << "CPU info, " <<
195 (has_os_info ? "" : "no ") << "OS info, " <<
196 (breakpad_info != NULL__null ? "" : "no ") << "Breakpad info, " <<
197 (exception != NULL__null ? "" : "no ") << "exception, " <<
198 (module_list != NULL__null ? "" : "no ") << "module list, " <<
199 (threads != NULL__null ? "" : "no ") << "thread list, " <<
200 (has_dump_thread ? "" : "no ") << "dump thread, " <<
201 (has_requesting_thread ? "" : "no ") << "requesting thread, and " <<
202 (has_process_create_time ? "" : "no ") << "process create time";
203
204 bool interrupted = false;
205 bool found_requesting_thread = false;
206 unsigned int thread_count = threads->thread_count();
207
208 // Reset frame_symbolizer_ at the beginning of stackwalk for each minidump.
209 frame_symbolizer_->Reset();
210
211 for (unsigned int thread_index = 0;
212 thread_index < thread_count;
213 ++thread_index) {
214 char thread_string_buffer[64];
215 snprintf(thread_string_buffer, sizeof(thread_string_buffer), "%d/%d",
216 thread_index, thread_count);
217 string thread_string = dump->path() + ":" + thread_string_buffer;
218
219 MinidumpThread *thread = threads->GetThreadAtIndex(thread_index);
220 if (!thread) {
221 BPLOG(ERROR)!(((google_breakpad::LogStream::SEVERITY_ERROR) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
cerr, google_breakpad::LogStream::SEVERITY_ERROR, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 221))
<< "Could not get thread for " << thread_string;
222 return PROCESS_ERROR_GETTING_THREAD;
223 }
224
225 uint32_t thread_id;
226 if (!thread->GetThreadID(&thread_id)) {
227 BPLOG(ERROR)!(((google_breakpad::LogStream::SEVERITY_ERROR) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
cerr, google_breakpad::LogStream::SEVERITY_ERROR, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 227))
<< "Could not get thread ID for " << thread_string;
228 return PROCESS_ERROR_GETTING_THREAD_ID;
229 }
230
231 thread_string += " id " + HexString(thread_id);
232 BPLOG(INFO)!(((google_breakpad::LogStream::SEVERITY_INFO) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
clog, google_breakpad::LogStream::SEVERITY_INFO, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 232))
<< "Looking at thread " << thread_string;
233
234 // If this thread is the thread that produced the minidump, don't process
235 // it. Because of the problems associated with a thread producing a
236 // dump of itself (when both its context and its stack are in flux),
237 // processing that stack wouldn't provide much useful data.
238 if (has_dump_thread && thread_id == dump_thread_id) {
239 continue;
240 }
241
242 MinidumpContext *context = thread->GetContext();
243
244 if (has_requesting_thread && thread_id == requesting_thread_id) {
245 if (found_requesting_thread) {
246 // There can't be more than one requesting thread.
247 BPLOG(ERROR)!(((google_breakpad::LogStream::SEVERITY_ERROR) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
cerr, google_breakpad::LogStream::SEVERITY_ERROR, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 247))
<< "Duplicate requesting thread: " << thread_string;
248 return PROCESS_ERROR_DUPLICATE_REQUESTING_THREADS;
249 }
250
251 // Use processed_state->threads_.size() instead of thread_index.
252 // thread_index points to the thread index in the minidump, which
253 // might be greater than the thread index in the threads vector if
254 // any of the minidump's threads are skipped and not placed into the
255 // processed threads vector. The thread vector's current size will
256 // be the index of the current thread when it's pushed into the
257 // vector.
258 process_state->requesting_thread_ = process_state->threads_.size();
259
260 found_requesting_thread = true;
261
262 if (process_state->crashed_) {
263 // Use the exception record's context for the crashed thread, instead
264 // of the thread's own context. For the crashed thread, the thread's
265 // own context is the state inside the exception handler. Using it
266 // would not result in the expected stack trace from the time of the
267 // crash. If the exception context is invalid, however, we fall back
268 // on the thread context.
269 MinidumpContext *ctx = exception->GetContext();
270 context = ctx ? ctx : thread->GetContext();
271 }
272 }
273
274 // If the memory region for the stack cannot be read using the RVA stored
275 // in the memory descriptor inside MINIDUMP_THREAD, try to locate and use
276 // a memory region (containing the stack) from the minidump memory list.
277 MinidumpMemoryRegion *thread_memory = thread->GetMemory();
278 if (!thread_memory && memory_list) {
279 uint64_t start_stack_memory_range = thread->GetStartOfStackMemoryRange();
280 if (start_stack_memory_range) {
281 thread_memory = memory_list->GetMemoryRegionForAddress(
282 start_stack_memory_range);
283 }
284 }
285 if (!thread_memory) {
286 BPLOG(ERROR)!(((google_breakpad::LogStream::SEVERITY_ERROR) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
cerr, google_breakpad::LogStream::SEVERITY_ERROR, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 286))
<< "No memory region for " << thread_string;
287 }
288
289 // Use process_state->modules_ instead of module_list, because the
290 // |modules| argument will be used to populate the |module| fields in
291 // the returned StackFrame objects, which will be placed into the
292 // returned ProcessState object. module_list's lifetime is only as
293 // long as the Minidump object: it will be deleted when this function
294 // returns. process_state->modules_ is owned by the ProcessState object
295 // (just like the StackFrame objects), and is much more suitable for this
296 // task.
297 scoped_ptr<Stackwalker> stackwalker(
298 Stackwalker::StackwalkerForCPU(process_state->system_info(),
299 context,
300 thread_memory,
301 process_state->modules_,
302 process_state->unloaded_modules_,
303 frame_symbolizer_));
304
305 scoped_ptr<CallStack> stack(new CallStack());
306 if (stackwalker.get()) {
307 if (!stackwalker->Walk(stack.get(),
308 &process_state->modules_without_symbols_,
309 &process_state->modules_with_corrupt_symbols_)) {
310 BPLOG(INFO)!(((google_breakpad::LogStream::SEVERITY_INFO) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
clog, google_breakpad::LogStream::SEVERITY_INFO, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 310))
<< "Stackwalker interrupt (missing symbols?) at "
311 << thread_string;
312 interrupted = true;
313 }
314 } else {
315 // Threads with missing CPU contexts will hit this, but
316 // don't abort processing the rest of the dump just for
317 // one bad thread.
318 BPLOG(ERROR)!(((google_breakpad::LogStream::SEVERITY_ERROR) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
cerr, google_breakpad::LogStream::SEVERITY_ERROR, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 318))
<< "No stackwalker for " << thread_string;
319 }
320 stack->set_tid(thread_id);
321 stack->set_last_error(thread->GetLastError());
322 if (thread_names_list) {
323 stack->set_name(thread_names_list->GetNameForThreadId(thread_id));
324 }
325 process_state->threads_.push_back(stack.release());
326 process_state->thread_memory_regions_.push_back(thread_memory);
327 }
328
329 if (interrupted) {
330 BPLOG(INFO)!(((google_breakpad::LogStream::SEVERITY_INFO) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
clog, google_breakpad::LogStream::SEVERITY_INFO, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 330))
<< "Processing interrupted for " << dump->path();
331 return PROCESS_SYMBOL_SUPPLIER_INTERRUPTED;
332 }
333
334 // If a requesting thread was indicated, it must be present.
335 if (has_requesting_thread && !found_requesting_thread) {
336 // Don't mark as an error, but invalidate the requesting thread
337 BPLOG(ERROR)!(((google_breakpad::LogStream::SEVERITY_ERROR) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
cerr, google_breakpad::LogStream::SEVERITY_ERROR, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 337))
<< "Minidump indicated requesting thread " <<
338 HexString(requesting_thread_id) << ", not found in " <<
339 dump->path();
340 process_state->requesting_thread_ = -1;
341 }
342
343 // Exploitability defaults to EXPLOITABILITY_NOT_ANALYZED
344 process_state->exploitability_ = EXPLOITABILITY_NOT_ANALYZED;
345
346 // If an exploitability run was requested we perform the platform specific
347 // rating.
348 if (enable_exploitability_) {
349 scoped_ptr<Exploitability> exploitability(
350 Exploitability::ExploitabilityForPlatform(dump,
351 process_state,
352 enable_objdump_));
353 // The engine will be null if the platform is not supported
354 if (exploitability != NULL__null) {
355 process_state->exploitability_ = exploitability->CheckExploitability();
356 } else {
357 process_state->exploitability_ = EXPLOITABILITY_ERR_NOENGINE;
358 }
359 }
360
361 BPLOG(INFO)!(((google_breakpad::LogStream::SEVERITY_INFO) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
clog, google_breakpad::LogStream::SEVERITY_INFO, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 361))
<< "Processed " << dump->path();
362 return PROCESS_OK;
363}
364
365ProcessResult MinidumpProcessor::Process(
366 const string &minidump_file, ProcessState *process_state) {
367 BPLOG(INFO)!(((google_breakpad::LogStream::SEVERITY_INFO) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
clog, google_breakpad::LogStream::SEVERITY_INFO, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 367))
<< "Processing minidump in file " << minidump_file;
368
369 Minidump dump(minidump_file);
370 if (!dump.Read()) {
371 BPLOG(ERROR)!(((google_breakpad::LogStream::SEVERITY_ERROR) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
cerr, google_breakpad::LogStream::SEVERITY_ERROR, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 371))
<< "Minidump " << dump.path() << " could not be read";
372 return PROCESS_ERROR_MINIDUMP_NOT_FOUND;
373 }
374
375 return Process(&dump, process_state);
376}
377
378// Returns the MDRawSystemInfo from a minidump, or NULL if system info is
379// not available from the minidump. If system_info is non-NULL, it is used
380// to pass back the MinidumpSystemInfo object.
381static const MDRawSystemInfo* GetSystemInfo(Minidump *dump,
382 MinidumpSystemInfo **system_info) {
383 MinidumpSystemInfo *minidump_system_info = dump->GetSystemInfo();
384 if (!minidump_system_info)
385 return NULL__null;
386
387 if (system_info)
388 *system_info = minidump_system_info;
389
390 return minidump_system_info->system_info();
391}
392
393static uint64_t GetAddressForArchitecture(const MDCPUArchitecture architecture,
394 size_t raw_address)
395{
396 switch (architecture) {
397 case MD_CPU_ARCHITECTURE_X86:
398 case MD_CPU_ARCHITECTURE_MIPS:
399 case MD_CPU_ARCHITECTURE_PPC:
400 case MD_CPU_ARCHITECTURE_SHX:
401 case MD_CPU_ARCHITECTURE_ARM:
402 case MD_CPU_ARCHITECTURE_X86_WIN64:
403 // 32-bit architectures, mask the upper bits.
404 return raw_address & 0xffffffffULL;
405
406 default:
407 // All other architectures either have 64-bit pointers or it's impossible
408 // to tell from the minidump (e.g. MSIL or SPARC) so use 64-bits anyway.
409 return raw_address;
410 }
411}
412
413// Extract CPU info string from ARM-specific MDRawSystemInfo structure.
414// raw_info: pointer to source MDRawSystemInfo.
415// cpu_info: address of target string, cpu info text will be appended to it.
416static void GetARMCpuInfo(const MDRawSystemInfo* raw_info,
417 string* cpu_info) {
418 assert(raw_info != NULL && cpu_info != NULL)(static_cast <bool> (raw_info != __null && cpu_info
!= __null) ? void (0) : __assert_fail ("raw_info != NULL && cpu_info != NULL"
, __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__
))
;
419
420 // Write ARM architecture version.
421 char cpu_string[32];
422 snprintf(cpu_string, sizeof(cpu_string), "ARMv%d",
423 raw_info->processor_level);
424 cpu_info->append(cpu_string);
425
426 // There is no good list of implementer id values, but the following
427 // pages provide some help:
428 // http://comments.gmane.org/gmane.linux.linaro.devel/6903
429 // http://forum.xda-developers.com/archive/index.php/t-480226.html
430 const struct {
431 uint32_t id;
432 const char* name;
433 } vendors[] = {
434 { 0x41, "ARM" },
435 { 0x51, "Qualcomm" },
436 { 0x56, "Marvell" },
437 { 0x69, "Intel/Marvell" },
438 };
439 const struct {
440 uint32_t id;
441 const char* name;
442 } parts[] = {
443 { 0x4100c050, "Cortex-A5" },
444 { 0x4100c080, "Cortex-A8" },
445 { 0x4100c090, "Cortex-A9" },
446 { 0x4100c0f0, "Cortex-A15" },
447 { 0x4100c140, "Cortex-R4" },
448 { 0x4100c150, "Cortex-R5" },
449 { 0x4100b360, "ARM1136" },
450 { 0x4100b560, "ARM1156" },
451 { 0x4100b760, "ARM1176" },
452 { 0x4100b020, "ARM11-MPCore" },
453 { 0x41009260, "ARM926" },
454 { 0x41009460, "ARM946" },
455 { 0x41009660, "ARM966" },
456 { 0x510006f0, "Krait" },
457 { 0x510000f0, "Scorpion" },
458 };
459
460 const struct {
461 uint32_t hwcap;
462 const char* name;
463 } features[] = {
464 { MD_CPU_ARM_ELF_HWCAP_SWP, "swp" },
465 { MD_CPU_ARM_ELF_HWCAP_HALF, "half" },
466 { MD_CPU_ARM_ELF_HWCAP_THUMB, "thumb" },
467 { MD_CPU_ARM_ELF_HWCAP_26BIT, "26bit" },
468 { MD_CPU_ARM_ELF_HWCAP_FAST_MULT, "fastmult" },
469 { MD_CPU_ARM_ELF_HWCAP_FPA, "fpa" },
470 { MD_CPU_ARM_ELF_HWCAP_VFP, "vfpv2" },
471 { MD_CPU_ARM_ELF_HWCAP_EDSP, "edsp" },
472 { MD_CPU_ARM_ELF_HWCAP_JAVA, "java" },
473 { MD_CPU_ARM_ELF_HWCAP_IWMMXT, "iwmmxt" },
474 { MD_CPU_ARM_ELF_HWCAP_CRUNCH, "crunch" },
475 { MD_CPU_ARM_ELF_HWCAP_THUMBEE, "thumbee" },
476 { MD_CPU_ARM_ELF_HWCAP_NEON, "neon" },
477 { MD_CPU_ARM_ELF_HWCAP_VFPv3, "vfpv3" },
478 { MD_CPU_ARM_ELF_HWCAP_VFPv3D16, "vfpv3d16" },
479 { MD_CPU_ARM_ELF_HWCAP_TLS, "tls" },
480 { MD_CPU_ARM_ELF_HWCAP_VFPv4, "vfpv4" },
481 { MD_CPU_ARM_ELF_HWCAP_IDIVA, "idiva" },
482 { MD_CPU_ARM_ELF_HWCAP_IDIVT, "idivt" },
483 };
484
485 uint32_t cpuid = raw_info->cpu.arm_cpu_info.cpuid;
486 if (cpuid != 0) {
487 // Extract vendor name from CPUID
488 const char* vendor = NULL__null;
489 uint32_t vendor_id = (cpuid >> 24) & 0xff;
490 for (size_t i = 0; i < sizeof(vendors)/sizeof(vendors[0]); ++i) {
491 if (vendors[i].id == vendor_id) {
492 vendor = vendors[i].name;
493 break;
494 }
495 }
496 cpu_info->append(" ");
497 if (vendor) {
498 cpu_info->append(vendor);
499 } else {
500 snprintf(cpu_string, sizeof(cpu_string), "vendor(0x%x)", vendor_id);
501 cpu_info->append(cpu_string);
502 }
503
504 // Extract part name from CPUID
505 uint32_t part_id = (cpuid & 0xff00fff0);
506 const char* part = NULL__null;
507 for (size_t i = 0; i < sizeof(parts)/sizeof(parts[0]); ++i) {
508 if (parts[i].id == part_id) {
509 part = parts[i].name;
510 break;
511 }
512 }
513 cpu_info->append(" ");
514 if (part != NULL__null) {
515 cpu_info->append(part);
516 } else {
517 snprintf(cpu_string, sizeof(cpu_string), "part(0x%x)", part_id);
518 cpu_info->append(cpu_string);
519 }
520 }
521 uint32_t elf_hwcaps = raw_info->cpu.arm_cpu_info.elf_hwcaps;
522 if (elf_hwcaps != 0) {
523 cpu_info->append(" features: ");
524 const char* comma = "";
525 for (size_t i = 0; i < sizeof(features)/sizeof(features[0]); ++i) {
526 if (elf_hwcaps & features[i].hwcap) {
527 cpu_info->append(comma);
528 cpu_info->append(features[i].name);
529 comma = ",";
530 }
531 }
532 }
533}
534
535// static
536bool MinidumpProcessor::GetCPUInfo(Minidump *dump, SystemInfo *info) {
537 assert(dump)(static_cast <bool> (dump) ? void (0) : __assert_fail (
"dump", __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__
))
;
538 assert(info)(static_cast <bool> (info) ? void (0) : __assert_fail (
"info", __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__
))
;
539
540 info->cpu.clear();
541 info->cpu_info.clear();
542
543 MinidumpSystemInfo *system_info;
544 const MDRawSystemInfo *raw_system_info = GetSystemInfo(dump, &system_info);
545 if (!raw_system_info)
546 return false;
547
548 switch (raw_system_info->processor_architecture) {
549 case MD_CPU_ARCHITECTURE_X86:
550 case MD_CPU_ARCHITECTURE_AMD64: {
551 if (raw_system_info->processor_architecture ==
552 MD_CPU_ARCHITECTURE_X86)
553 info->cpu = "x86";
554 else
555 info->cpu = "amd64";
556
557 const string *cpu_vendor = system_info->GetCPUVendor();
558 if (cpu_vendor) {
559 info->cpu_info = *cpu_vendor;
560 info->cpu_info.append(" ");
561 }
562
563 char x86_info[36];
564 snprintf(x86_info, sizeof(x86_info), "family %u model %u stepping %u",
565 raw_system_info->processor_level,
566 raw_system_info->processor_revision >> 8,
567 raw_system_info->processor_revision & 0xff);
568 info->cpu_info.append(x86_info);
569 break;
570 }
571
572 case MD_CPU_ARCHITECTURE_PPC: {
573 info->cpu = "ppc";
574 break;
575 }
576
577 case MD_CPU_ARCHITECTURE_PPC64: {
578 info->cpu = "ppc64";
579 break;
580 }
581
582 case MD_CPU_ARCHITECTURE_SPARC: {
583 info->cpu = "sparc";
584 break;
585 }
586
587 case MD_CPU_ARCHITECTURE_ARM: {
588 info->cpu = "arm";
589 GetARMCpuInfo(raw_system_info, &info->cpu_info);
590 break;
591 }
592
593 case MD_CPU_ARCHITECTURE_ARM64:
594 case MD_CPU_ARCHITECTURE_ARM64_OLD: {
595 info->cpu = "arm64";
596 break;
597 }
598
599 case MD_CPU_ARCHITECTURE_MIPS: {
600 info->cpu = "mips";
601 break;
602 }
603 case MD_CPU_ARCHITECTURE_MIPS64: {
604 info->cpu = "mips64";
605 break;
606 }
607
608 default: {
609 // Assign the numeric architecture ID into the CPU string.
610 char cpu_string[7];
611 snprintf(cpu_string, sizeof(cpu_string), "0x%04x",
612 raw_system_info->processor_architecture);
613 info->cpu = cpu_string;
614 break;
615 }
616 }
617
618 info->cpu_count = raw_system_info->number_of_processors;
619
620 return true;
621}
622
623// static
624bool MinidumpProcessor::GetOSInfo(Minidump *dump, SystemInfo *info) {
625 assert(dump)(static_cast <bool> (dump) ? void (0) : __assert_fail (
"dump", __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__
))
;
626 assert(info)(static_cast <bool> (info) ? void (0) : __assert_fail (
"info", __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__
))
;
627
628 info->os.clear();
629 info->os_short.clear();
630 info->os_version.clear();
631
632 MinidumpSystemInfo *system_info;
633 const MDRawSystemInfo *raw_system_info = GetSystemInfo(dump, &system_info);
634 if (!raw_system_info)
635 return false;
636
637 info->os_short = system_info->GetOS();
638
639 switch (raw_system_info->platform_id) {
640 case MD_OS_WIN32_NT: {
641 info->os = "Windows NT";
642 break;
643 }
644
645 case MD_OS_WIN32_WINDOWS: {
646 info->os = "Windows";
647 break;
648 }
649
650 case MD_OS_MAC_OS_X: {
651 info->os = "Mac OS X";
652 break;
653 }
654
655 case MD_OS_IOS: {
656 info->os = "iOS";
657 break;
658 }
659
660 case MD_OS_LINUX: {
661 info->os = "Linux";
662 break;
663 }
664
665 case MD_OS_SOLARIS: {
666 info->os = "Solaris";
667 break;
668 }
669
670 case MD_OS_ANDROID: {
671 info->os = "Android";
672 break;
673 }
674
675 case MD_OS_PS3: {
676 info->os = "PS3";
677 break;
678 }
679
680 case MD_OS_NACL: {
681 info->os = "NaCl";
682 break;
683 }
684
685 case MD_OS_FUCHSIA: {
686 info->os = "Fuchsia";
687 break;
688 }
689
690 default: {
691 // Assign the numeric platform ID into the OS string.
692 char os_string[11];
693 snprintf(os_string, sizeof(os_string), "0x%08x",
694 raw_system_info->platform_id);
695 info->os = os_string;
696 break;
697 }
698 }
699
700 char os_version_string[33];
701 snprintf(os_version_string, sizeof(os_version_string), "%u.%u.%u",
702 raw_system_info->major_version,
703 raw_system_info->minor_version,
704 raw_system_info->build_number);
705 info->os_version = os_version_string;
706
707 const string *csd_version = system_info->GetCSDVersion();
708 if (csd_version) {
709 info->os_version.append(" ");
710 info->os_version.append(*csd_version);
711 }
712
713 return true;
714}
715
716// static
717bool MinidumpProcessor::GetProcessCreateTime(Minidump* dump,
718 uint32_t* process_create_time) {
719 assert(dump)(static_cast <bool> (dump) ? void (0) : __assert_fail (
"dump", __builtin_FILE (), __builtin_LINE (), __extension__ __PRETTY_FUNCTION__
))
;
720 assert(process_create_time)(static_cast <bool> (process_create_time) ? void (0) : __assert_fail
("process_create_time", __builtin_FILE (), __builtin_LINE ()
, __extension__ __PRETTY_FUNCTION__))
;
721
722 *process_create_time = 0;
723
724 MinidumpMiscInfo* minidump_misc_info = dump->GetMiscInfo();
725 if (!minidump_misc_info) {
726 return false;
727 }
728
729 const MDRawMiscInfo* md_raw_misc_info = minidump_misc_info->misc_info();
730 if (!md_raw_misc_info) {
731 return false;
732 }
733
734 if (!(md_raw_misc_info->flags1 & MD_MISCINFO_FLAGS1_PROCESS_TIMES)) {
735 return false;
736 }
737
738 *process_create_time = md_raw_misc_info->process_create_time;
739 return true;
740}
741
742// static
743string MinidumpProcessor::GetCrashReason(Minidump *dump, uint64_t *address) {
744 MinidumpException *exception = dump->GetException();
745 if (!exception)
746 return "";
747
748 const MDRawExceptionStream *raw_exception = exception->exception();
749 if (!raw_exception)
750 return "";
751
752 if (address)
753 *address = raw_exception->exception_record.exception_address;
754
755 // The reason value is OS-specific and possibly CPU-specific. Set up
756 // sensible numeric defaults for the reason string in case we can't
757 // map the codes to a string (because there's no system info, or because
758 // it's an unrecognized platform, or because it's an unrecognized code.)
759 char reason_string[24];
760 char flags_string[11];
761 uint32_t exception_code = raw_exception->exception_record.exception_code;
762 uint32_t exception_flags = raw_exception->exception_record.exception_flags;
763 snprintf(flags_string, sizeof(flags_string), "0x%08x", exception_flags);
764 snprintf(reason_string, sizeof(reason_string), "0x%08x / %s", exception_code,
765 flags_string);
766 string reason = reason_string;
767
768 const MDRawSystemInfo *raw_system_info = GetSystemInfo(dump, NULL__null);
769 if (!raw_system_info)
770 return reason;
771
772 switch (raw_system_info->platform_id) {
773 case MD_OS_FUCHSIA: {
774 switch (exception_code) {
775 case MD_EXCEPTION_CODE_FUCHSIA_GENERAL:
776 reason = "GENERAL / ";
777 reason.append(flags_string);
778 break;
779 case MD_EXCEPTION_CODE_FUCHSIA_FATAL_PAGE_FAULT:
780 reason = "FATAL_PAGE_FAULT / ";
781 reason.append(flags_string);
782 break;
783 case MD_EXCEPTION_CODE_FUCHSIA_UNDEFINED_INSTRUCTION:
784 reason = "UNDEFINED_INSTRUCTION / ";
785 reason.append(flags_string);
786 break;
787 case MD_EXCEPTION_CODE_FUCHSIA_SW_BREAKPOINT:
788 reason = "SW_BREAKPOINT / ";
789 reason.append(flags_string);
790 break;
791 case MD_EXCEPTION_CODE_FUCHSIA_HW_BREAKPOINT:
792 reason = "HW_BREAKPOINT / ";
793 reason.append(flags_string);
794 break;
795 case MD_EXCEPTION_CODE_FUCHSIA_UNALIGNED_ACCESS:
796 reason = "UNALIGNED_ACCESS / ";
797 reason.append(flags_string);
798 break;
799 case MD_EXCEPTION_CODE_FUCHSIA_THREAD_STARTING:
800 reason = "THREAD_STARTING / ";
801 reason.append(flags_string);
802 break;
803 case MD_EXCEPTION_CODE_FUCHSIA_THREAD_EXITING:
804 reason = "THREAD_EXITING / ";
805 reason.append(flags_string);
806 break;
807 case MD_EXCEPTION_CODE_FUCHSIA_POLICY_ERROR:
808 reason = "POLICY_ERROR / ";
809 reason.append(flags_string);
810 break;
811 case MD_EXCEPTION_CODE_FUCHSIA_PROCESS_STARTING:
812 reason = "PROCESS_STARTING / ";
813 reason.append(flags_string);
814 break;
815 default:
816 BPLOG(INFO)!(((google_breakpad::LogStream::SEVERITY_INFO) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
clog, google_breakpad::LogStream::SEVERITY_INFO, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 816))
<< "Unknown exception reason " << reason;
817 }
818 break;
819 }
820
821 case MD_OS_MAC_OS_X:
822 case MD_OS_IOS: {
823 switch (exception_code) {
824 case MD_EXCEPTION_MAC_BAD_ACCESS:
825 reason = "EXC_BAD_ACCESS / ";
826 switch (exception_flags) {
827 case MD_EXCEPTION_CODE_MAC_INVALID_ADDRESS:
828 reason.append("KERN_INVALID_ADDRESS");
829 break;
830 case MD_EXCEPTION_CODE_MAC_PROTECTION_FAILURE:
831 reason.append("KERN_PROTECTION_FAILURE");
832 break;
833 case MD_EXCEPTION_CODE_MAC_NO_ACCESS:
834 reason.append("KERN_NO_ACCESS");
835 break;
836 case MD_EXCEPTION_CODE_MAC_MEMORY_FAILURE:
837 reason.append("KERN_MEMORY_FAILURE");
838 break;
839 case MD_EXCEPTION_CODE_MAC_MEMORY_ERROR:
840 reason.append("KERN_MEMORY_ERROR");
841 break;
842 case MD_EXCEPTION_CODE_MAC_CODESIGN_ERROR:
843 reason.append("KERN_CODESIGN_ERROR");
844 break;
845 default:
846 // arm and ppc overlap
847 if (raw_system_info->processor_architecture ==
848 MD_CPU_ARCHITECTURE_ARM ||
849 raw_system_info->processor_architecture ==
850 MD_CPU_ARCHITECTURE_ARM64_OLD) {
851 switch (exception_flags) {
852 case MD_EXCEPTION_CODE_MAC_ARM_DA_ALIGN:
853 reason.append("EXC_ARM_DA_ALIGN");
854 break;
855 case MD_EXCEPTION_CODE_MAC_ARM_DA_DEBUG:
856 reason.append("EXC_ARM_DA_DEBUG");
857 break;
858 default:
859 reason.append(flags_string);
860 BPLOG(INFO)!(((google_breakpad::LogStream::SEVERITY_INFO) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
clog, google_breakpad::LogStream::SEVERITY_INFO, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 860))
<< "Unknown exception reason " << reason;
861 break;
862 }
863 } else if (raw_system_info->processor_architecture ==
864 MD_CPU_ARCHITECTURE_PPC) {
865 switch (exception_flags) {
866 case MD_EXCEPTION_CODE_MAC_PPC_VM_PROT_READ:
867 reason.append("EXC_PPC_VM_PROT_READ");
868 break;
869 case MD_EXCEPTION_CODE_MAC_PPC_BADSPACE:
870 reason.append("EXC_PPC_BADSPACE");
871 break;
872 case MD_EXCEPTION_CODE_MAC_PPC_UNALIGNED:
873 reason.append("EXC_PPC_UNALIGNED");
874 break;
875 default:
876 reason.append(flags_string);
877 BPLOG(INFO)!(((google_breakpad::LogStream::SEVERITY_INFO) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
clog, google_breakpad::LogStream::SEVERITY_INFO, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 877))
<< "Unknown exception reason " << reason;
878 break;
879 }
880 } else if (raw_system_info->processor_architecture ==
881 MD_CPU_ARCHITECTURE_X86 ||
882 raw_system_info->processor_architecture ==
883 MD_CPU_ARCHITECTURE_AMD64) {
884 switch (exception_flags) {
885 case MD_EXCEPTION_CODE_MAC_X86_GENERAL_PROTECTION_FAULT:
886 reason.append("EXC_I386_GPFLT");
887 break;
888 default:
889 reason.append(flags_string);
890 BPLOG(INFO)!(((google_breakpad::LogStream::SEVERITY_INFO) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
clog, google_breakpad::LogStream::SEVERITY_INFO, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 890))
<< "Unknown exception reason " << reason;
891 break;
892 }
893 } else {
894 reason.append(flags_string);
895 BPLOG(INFO)!(((google_breakpad::LogStream::SEVERITY_INFO) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
clog, google_breakpad::LogStream::SEVERITY_INFO, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 895))
<< "Unknown exception reason " << reason;
896 }
897 break;
898 }
899 break;
900 case MD_EXCEPTION_MAC_BAD_INSTRUCTION:
901 reason = "EXC_BAD_INSTRUCTION / ";
902 switch (raw_system_info->processor_architecture) {
903 case MD_CPU_ARCHITECTURE_ARM:
904 case MD_CPU_ARCHITECTURE_ARM64_OLD: {
905 switch (exception_flags) {
906 case MD_EXCEPTION_CODE_MAC_ARM_UNDEFINED:
907 reason.append("EXC_ARM_UNDEFINED");
908 break;
909 default:
910 reason.append(flags_string);
911 BPLOG(INFO)!(((google_breakpad::LogStream::SEVERITY_INFO) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
clog, google_breakpad::LogStream::SEVERITY_INFO, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 911))
<< "Unknown exception reason " << reason;
912 break;
913 }
914 break;
915 }
916 case MD_CPU_ARCHITECTURE_PPC: {
917 switch (exception_flags) {
918 case MD_EXCEPTION_CODE_MAC_PPC_INVALID_SYSCALL:
919 reason.append("EXC_PPC_INVALID_SYSCALL");
920 break;
921 case MD_EXCEPTION_CODE_MAC_PPC_UNIMPLEMENTED_INSTRUCTION:
922 reason.append("EXC_PPC_UNIPL_INST");
923 break;
924 case MD_EXCEPTION_CODE_MAC_PPC_PRIVILEGED_INSTRUCTION:
925 reason.append("EXC_PPC_PRIVINST");
926 break;
927 case MD_EXCEPTION_CODE_MAC_PPC_PRIVILEGED_REGISTER:
928 reason.append("EXC_PPC_PRIVREG");
929 break;
930 case MD_EXCEPTION_CODE_MAC_PPC_TRACE:
931 reason.append("EXC_PPC_TRACE");
932 break;
933 case MD_EXCEPTION_CODE_MAC_PPC_PERFORMANCE_MONITOR:
934 reason.append("EXC_PPC_PERFMON");
935 break;
936 default:
937 reason.append(flags_string);
938 BPLOG(INFO)!(((google_breakpad::LogStream::SEVERITY_INFO) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
clog, google_breakpad::LogStream::SEVERITY_INFO, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 938))
<< "Unknown exception reason " << reason;
939 break;
940 }
941 break;
942 }
943 case MD_CPU_ARCHITECTURE_AMD64:
944 case MD_CPU_ARCHITECTURE_X86: {
945 switch (exception_flags) {
946 case MD_EXCEPTION_CODE_MAC_X86_INVALID_OPERATION:
947 reason.append("EXC_I386_INVOP");
948 break;
949 case MD_EXCEPTION_CODE_MAC_X86_INVALID_TASK_STATE_SEGMENT:
950 reason.append("EXC_I386_INVTSSFLT");
951 break;
952 case MD_EXCEPTION_CODE_MAC_X86_SEGMENT_NOT_PRESENT:
953 reason.append("EXC_I386_SEGNPFLT");
954 break;
955 case MD_EXCEPTION_CODE_MAC_X86_STACK_FAULT:
956 reason.append("EXC_I386_STKFLT");
957 break;
958 case MD_EXCEPTION_CODE_MAC_X86_GENERAL_PROTECTION_FAULT:
959 reason.append("EXC_I386_GPFLT");
960 break;
961 case MD_EXCEPTION_CODE_MAC_X86_ALIGNMENT_FAULT:
962 reason.append("EXC_I386_ALIGNFLT");
963 break;
964 default:
965 reason.append(flags_string);
966 BPLOG(INFO)!(((google_breakpad::LogStream::SEVERITY_INFO) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
clog, google_breakpad::LogStream::SEVERITY_INFO, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 966))
<< "Unknown exception reason " << reason;
967 break;
968 }
969 break;
970 }
971 default:
972 reason.append(flags_string);
973 BPLOG(INFO)!(((google_breakpad::LogStream::SEVERITY_INFO) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
clog, google_breakpad::LogStream::SEVERITY_INFO, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 973))
<< "Unknown exception reason " << reason;
974 break;
975 }
976 break;
977 case MD_EXCEPTION_MAC_ARITHMETIC:
978 reason = "EXC_ARITHMETIC / ";
979 switch (raw_system_info->processor_architecture) {
980 case MD_CPU_ARCHITECTURE_PPC: {
981 switch (exception_flags) {
982 case MD_EXCEPTION_CODE_MAC_PPC_OVERFLOW:
983 reason.append("EXC_PPC_OVERFLOW");
984 break;
985 case MD_EXCEPTION_CODE_MAC_PPC_ZERO_DIVIDE:
986 reason.append("EXC_PPC_ZERO_DIVIDE");
987 break;
988 case MD_EXCEPTION_CODE_MAC_PPC_FLOAT_INEXACT:
989 reason.append("EXC_FLT_INEXACT");
990 break;
991 case MD_EXCEPTION_CODE_MAC_PPC_FLOAT_ZERO_DIVIDE:
992 reason.append("EXC_PPC_FLT_ZERO_DIVIDE");
993 break;
994 case MD_EXCEPTION_CODE_MAC_PPC_FLOAT_UNDERFLOW:
995 reason.append("EXC_PPC_FLT_UNDERFLOW");
996 break;
997 case MD_EXCEPTION_CODE_MAC_PPC_FLOAT_OVERFLOW:
998 reason.append("EXC_PPC_FLT_OVERFLOW");
999 break;
1000 case MD_EXCEPTION_CODE_MAC_PPC_FLOAT_NOT_A_NUMBER:
1001 reason.append("EXC_PPC_FLT_NOT_A_NUMBER");
1002 break;
1003 case MD_EXCEPTION_CODE_MAC_PPC_NO_EMULATION:
1004 reason.append("EXC_PPC_NOEMULATION");
1005 break;
1006 case MD_EXCEPTION_CODE_MAC_PPC_ALTIVEC_ASSIST:
1007 reason.append("EXC_PPC_ALTIVECASSIST");
1008 break;
1009 default:
1010 reason.append(flags_string);
1011 BPLOG(INFO)!(((google_breakpad::LogStream::SEVERITY_INFO) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
clog, google_breakpad::LogStream::SEVERITY_INFO, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 1011))
<< "Unknown exception reason " << reason;
1012 break;
1013 }
1014 break;
1015 }
1016 case MD_CPU_ARCHITECTURE_AMD64:
1017 case MD_CPU_ARCHITECTURE_X86: {
1018 switch (exception_flags) {
1019 case MD_EXCEPTION_CODE_MAC_X86_DIV:
1020 reason.append("EXC_I386_DIV");
1021 break;
1022 case MD_EXCEPTION_CODE_MAC_X86_INTO:
1023 reason.append("EXC_I386_INTO");
1024 break;
1025 case MD_EXCEPTION_CODE_MAC_X86_NOEXT:
1026 reason.append("EXC_I386_NOEXT");
1027 break;
1028 case MD_EXCEPTION_CODE_MAC_X86_EXTOVR:
1029 reason.append("EXC_I386_EXTOVR");
1030 break;
1031 case MD_EXCEPTION_CODE_MAC_X86_EXTERR:
1032 reason.append("EXC_I386_EXTERR");
1033 break;
1034 case MD_EXCEPTION_CODE_MAC_X86_EMERR:
1035 reason.append("EXC_I386_EMERR");
1036 break;
1037 case MD_EXCEPTION_CODE_MAC_X86_BOUND:
1038 reason.append("EXC_I386_BOUND");
1039 break;
1040 case MD_EXCEPTION_CODE_MAC_X86_SSEEXTERR:
1041 reason.append("EXC_I386_SSEEXTERR");
1042 break;
1043 default:
1044 reason.append(flags_string);
1045 BPLOG(INFO)!(((google_breakpad::LogStream::SEVERITY_INFO) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
clog, google_breakpad::LogStream::SEVERITY_INFO, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 1045))
<< "Unknown exception reason " << reason;
1046 break;
1047 }
1048 break;
1049 }
1050 default:
1051 reason.append(flags_string);
1052 BPLOG(INFO)!(((google_breakpad::LogStream::SEVERITY_INFO) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
clog, google_breakpad::LogStream::SEVERITY_INFO, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 1052))
<< "Unknown exception reason " << reason;
1053 break;
1054 }
1055 break;
1056 case MD_EXCEPTION_MAC_EMULATION:
1057 reason = "EXC_EMULATION / ";
1058 reason.append(flags_string);
1059 break;
1060 case MD_EXCEPTION_MAC_SOFTWARE:
1061 reason = "EXC_SOFTWARE / ";
1062 switch (exception_flags) {
1063 case MD_EXCEPTION_CODE_MAC_ABORT:
1064 reason.append("SIGABRT");
1065 break;
1066 case MD_EXCEPTION_CODE_MAC_NS_EXCEPTION:
1067 reason.append("UNCAUGHT_NS_EXCEPTION");
1068 break;
1069 // These are ppc only but shouldn't be a problem as they're
1070 // unused on x86
1071 case MD_EXCEPTION_CODE_MAC_PPC_TRAP:
1072 reason.append("EXC_PPC_TRAP");
1073 break;
1074 case MD_EXCEPTION_CODE_MAC_PPC_MIGRATE:
1075 reason.append("EXC_PPC_MIGRATE");
1076 break;
1077 default:
1078 reason.append(flags_string);
1079 BPLOG(INFO)!(((google_breakpad::LogStream::SEVERITY_INFO) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
clog, google_breakpad::LogStream::SEVERITY_INFO, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 1079))
<< "Unknown exception reason " << reason;
1080 break;
1081 }
1082 break;
1083 case MD_EXCEPTION_MAC_BREAKPOINT:
1084 reason = "EXC_BREAKPOINT / ";
1085 switch (raw_system_info->processor_architecture) {
1086 case MD_CPU_ARCHITECTURE_ARM:
1087 case MD_CPU_ARCHITECTURE_ARM64_OLD: {
1088 switch (exception_flags) {
1089 case MD_EXCEPTION_CODE_MAC_ARM_DA_ALIGN:
1090 reason.append("EXC_ARM_DA_ALIGN");
1091 break;
1092 case MD_EXCEPTION_CODE_MAC_ARM_DA_DEBUG:
1093 reason.append("EXC_ARM_DA_DEBUG");
1094 break;
1095 case MD_EXCEPTION_CODE_MAC_ARM_BREAKPOINT:
1096 reason.append("EXC_ARM_BREAKPOINT");
1097 break;
1098 default:
1099 reason.append(flags_string);
1100 BPLOG(INFO)!(((google_breakpad::LogStream::SEVERITY_INFO) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
clog, google_breakpad::LogStream::SEVERITY_INFO, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 1100))
<< "Unknown exception reason " << reason;
1101 break;
1102 }
1103 break;
1104 }
1105 case MD_CPU_ARCHITECTURE_PPC: {
1106 switch (exception_flags) {
1107 case MD_EXCEPTION_CODE_MAC_PPC_BREAKPOINT:
1108 reason.append("EXC_PPC_BREAKPOINT");
1109 break;
1110 default:
1111 reason.append(flags_string);
1112 BPLOG(INFO)!(((google_breakpad::LogStream::SEVERITY_INFO) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
clog, google_breakpad::LogStream::SEVERITY_INFO, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 1112))
<< "Unknown exception reason " << reason;
1113 break;
1114 }
1115 break;
1116 }
1117 case MD_CPU_ARCHITECTURE_AMD64:
1118 case MD_CPU_ARCHITECTURE_X86: {
1119 switch (exception_flags) {
1120 case MD_EXCEPTION_CODE_MAC_X86_SGL:
1121 reason.append("EXC_I386_SGL");
1122 break;
1123 case MD_EXCEPTION_CODE_MAC_X86_BPT:
1124 reason.append("EXC_I386_BPT");
1125 break;
1126 default:
1127 reason.append(flags_string);
1128 BPLOG(INFO)!(((google_breakpad::LogStream::SEVERITY_INFO) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
clog, google_breakpad::LogStream::SEVERITY_INFO, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 1128))
<< "Unknown exception reason " << reason;
1129 break;
1130 }
1131 break;
1132 }
1133 default:
1134 reason.append(flags_string);
1135 BPLOG(INFO)!(((google_breakpad::LogStream::SEVERITY_INFO) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
clog, google_breakpad::LogStream::SEVERITY_INFO, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 1135))
<< "Unknown exception reason " << reason;
1136 break;
1137 }
1138 break;
1139 case MD_EXCEPTION_MAC_SYSCALL:
1140 reason = "EXC_SYSCALL / ";
1141 reason.append(flags_string);
1142 break;
1143 case MD_EXCEPTION_MAC_MACH_SYSCALL:
1144 reason = "EXC_MACH_SYSCALL / ";
1145 reason.append(flags_string);
1146 break;
1147 case MD_EXCEPTION_MAC_RPC_ALERT:
1148 reason = "EXC_RPC_ALERT / ";
1149 reason.append(flags_string);
1150 break;
1151 case MD_EXCEPTION_MAC_RESOURCE:
1152 reason = "EXC_RESOURCE / ";
1153 {
1154 uint32_t type = (exception_flags >> 29) & 0x7ULL;
1155 uint32_t flavor = (exception_flags >> 26) & 0x7ULL;
1156 char flavor_string[6] = {};
1157 switch (type) {
1158 case MD_MAC_EXC_RESOURCE_TYPE_CPU:
1159 reason.append("RESOURCE_TYPE_CPU / ");
1160 switch (flavor) {
1161 case MD_MAC_EXC_RESOURCE_FLAVOR_CPU_MONITOR:
1162 reason.append("FLAVOR_CPU_MONITOR");
1163 break;
1164 case MD_MAC_EXC_RESOURCE_FLAVOR_CPU_MONITOR_FATAL:
1165 reason.append("FLAVOR_CPU_MONITOR_FATAL");
1166 break;
1167 default:
1168 snprintf(flavor_string, sizeof(flavor_string), "%#3x", flavor);
1169 reason.append(flavor_string);
1170 break;
1171 }
1172 break;
1173 case MD_MAC_EXC_RESOURCE_TYPE_WAKEUPS:
1174 reason.append("RESOURCE_TYPE_WAKEUPS / ");
1175 if (flavor == MD_MAC_EXC_RESOURCE_FLAVOR_WAKEUPS_MONITOR) {
1176 reason.append("FLAVOR_WAKEUPS_MONITOR");
1177 } else {
1178 snprintf(flavor_string, sizeof(flavor_string), "%#3x", flavor);
1179 reason.append(flavor_string);
1180 }
1181 break;
1182 case MD_MAC_EXC_RESOURCE_TYPE_MEMORY:
1183 reason.append("RESOURCE_TYPE_MEMORY / ");
1184 if (flavor == MD_MAC_EXC_RESOURCE_FLAVOR_HIGH_WATERMARK) {
1185 reason.append("FLAVOR_HIGH_WATERMARK");
1186 } else {
1187 snprintf(flavor_string, sizeof(flavor_string), "%#3x", flavor);
1188 reason.append(flavor_string);
1189 }
1190 break;
1191 case MD_MAC_EXC_RESOURCE_TYPE_IO:
1192 reason.append("EXC_RESOURCE_TYPE_IO / ");
1193 switch (flavor) {
1194 case MD_MAC_EXC_RESOURCE_FLAVOR_IO_PHYSICAL_WRITES:
1195 reason.append("FLAVOR_IO_PHYSICAL_WRITES");
1196 break;
1197 case MD_MAC_EXC_RESOURCE_FLAVOR_IO_LOGICAL_WRITES:
1198 reason.append("FLAVOR_IO_LOGICAL_WRITES");
1199 break;
1200 default:
1201 snprintf(flavor_string, sizeof(flavor_string), "%#3x", flavor);
1202 reason.append(flavor_string);
1203 break;
1204 }
1205 break;
1206 case MD_MAC_EXC_RESOURCE_TYPE_THREADS:
1207 reason.append("EXC_RESOURCE_TYPE_THREADS / ");
1208 if (flavor == MD_MAC_EXC_RESOURCE_FLAVOR_THREADS_HIGH_WATERMARK) {
1209 reason.append("FLAVOR_THREADS_HIGH_WATERMARK");
1210 } else {
1211 snprintf(flavor_string, sizeof(flavor_string), "%#3x", flavor);
1212 reason.append(flavor_string);
1213 }
1214 break;
1215 default:
1216 reason.append(flags_string);
1217 break;
1218 }
1219 }
1220 break;
1221 case MD_EXCEPTION_MAC_GUARD:
1222 reason = "EXC_GUARD / ";
1223 {
1224 uint32_t type = (exception_flags >> 29) & 0x7ULL;
1225 uint32_t flavor = exception_flags & 0x1FFFFFFFULL;
1226 switch (type) {
1227 case MD_MAC_EXC_GUARD_TYPE_NONE:
1228 reason.append("GUARD_TYPE_NONE");
1229 break;
1230 case MD_MAC_EXC_GUARD_TYPE_MACH_PORT:
1231 reason.append("GUARD_TYPE_MACH_PORT");
1232
1233 if (flavor) {
1234 std::vector<std::string> flavors;
1235
1236 if (flavor & MD_MAC_EXC_GUARD_MACH_PORT_FLAVOR_GUARD_EXC_DESTROY) {
1237 flavors.push_back("GUARD_EXC_DESTROY");
1238 }
1239
1240 if (flavor & MD_MAC_EXC_GUARD_MACH_PORT_FLAVOR_GUARD_EXC_MOD_REFS) {
1241 flavors.push_back("GUARD_EXC_MOD_REFS");
1242 }
1243
1244 if (flavor & MD_MAC_EXC_GUARD_MACH_PORT_FLAVOR_GUARD_EXC_SET_CONTEXT) {
1245 flavors.push_back("GUARD_EXC_SET_CONTEXT");
1246 }
1247
1248 if (flavor & MD_MAC_EXC_GUARD_MACH_PORT_FLAVOR_GUARD_EXC_SET_CONTEXT) {
1249 flavors.push_back("GUARD_EXC_SET_CONTEXT");
1250 }
1251
1252 if (flavor & MD_MAC_EXC_GUARD_MACH_PORT_FLAVOR_GUARD_EXC_UNGUARDED) {
1253 flavors.push_back("GUARD_EXC_UNGUARDED");
1254 }
1255
1256 if (flavor & MD_MAC_EXC_GUARD_MACH_PORT_FLAVOR_GUARD_EXC_INCORRECT_GUARD) {
1257 flavors.push_back("GUARD_EXC_INCORRECT_GUARD");
1258 }
1259
1260 if (flavor & MD_MAC_EXC_GUARD_MACH_PORT_FLAVOR_GUARD_EXC_IMMOVABLE) {
1261 flavors.push_back("GUARD_EXC_IMMOVABLE");
1262 }
1263
1264 if (flavor & MD_MAC_EXC_GUARD_MACH_PORT_FLAVOR_GUARD_EXC_STRICT_REPLY) {
1265 flavors.push_back("GUARD_EXC_STRICT_REPLY");
1266 }
1267
1268 if (flavor & MD_MAC_EXC_GUARD_MACH_PORT_FLAVOR_GUARD_EXC_MSG_FILTERED) {
1269 flavors.push_back("GUARD_EXC_MSG_FILTERED");
1270 }
1271
1272 if (flavor & MD_MAC_EXC_GUARD_MACH_PORT_FLAVOR_GUARD_EXC_INVALID_RIGHT) {
1273 flavors.push_back("GUARD_EXC_INVALID_RIGHT");
1274 }
1275
1276 if (flavor & MD_MAC_EXC_GUARD_MACH_PORT_FLAVOR_GUARD_EXC_INVALID_NAME) {
1277 flavors.push_back("GUARD_EXC_INVALID_NAME");
1278 }
1279
1280 if (flavor & MD_MAC_EXC_GUARD_MACH_PORT_FLAVOR_GUARD_EXC_INVALID_VALUE) {
1281 flavors.push_back("GUARD_EXC_INVALID_VALUE");
1282 }
1283
1284 if (flavor & MD_MAC_EXC_GUARD_MACH_PORT_FLAVOR_GUARD_EXC_INVALID_ARGUMENT) {
1285 flavors.push_back("GUARD_EXC_INVALID_ARGUMENT");
1286 }
1287
1288 if (flavor & MD_MAC_EXC_GUARD_MACH_PORT_FLAVOR_GUARD_EXC_RIGHT_EXISTS) {
1289 flavors.push_back("GUARD_EXC_RIGHT_EXISTS");
1290 }
1291
1292 if (flavor & MD_MAC_EXC_GUARD_MACH_PORT_FLAVOR_GUARD_EXC_KERN_NO_SPACE) {
1293 flavors.push_back("GUARD_EXC_KERN_NO_SPACE");
1294 }
1295
1296 if (flavor & MD_MAC_EXC_GUARD_MACH_PORT_FLAVOR_GUARD_EXC_KERN_FAILURE) {
1297 flavors.push_back("GUARD_EXC_KERN_FAILURE");
1298 }
1299
1300 if (flavor & MD_MAC_EXC_GUARD_MACH_PORT_FLAVOR_GUARD_EXC_KERN_RESOURCE) {
1301 flavors.push_back("GUARD_EXC_KERN_RESOURCE");
1302 }
1303
1304 if (flavor & MD_MAC_EXC_GUARD_MACH_PORT_FLAVOR_GUARD_EXC_SEND_INVALID_REPLY) {
1305 flavors.push_back("GUARD_EXC_SEND_INVALID_REPLY");
1306 }
1307
1308 if (flavor & MD_MAC_EXC_GUARD_MACH_PORT_FLAVOR_GUARD_EXC_SEND_INVALID_VOUCHER) {
1309 flavors.push_back("GUARD_EXC_SEND_INVALID_VOUCHER");
1310 }
1311
1312 if (flavor & MD_MAC_EXC_GUARD_MACH_PORT_FLAVOR_GUARD_EXC_SEND_INVALID_RIGHT) {
1313 flavors.push_back("GUARD_EXC_SEND_INVALID_RIGHT");
1314 }
1315
1316 if (flavor & MD_MAC_EXC_GUARD_MACH_PORT_FLAVOR_GUARD_EXC_RCV_INVALID_NAME) {
1317 flavors.push_back("GUARD_EXC_RCV_INVALID_NAME");
1318 }
1319
1320 if (flavor & MD_MAC_EXC_GUARD_MACH_PORT_FLAVOR_GUARD_EXC_RCV_GUARDED_DESC) {
1321 flavors.push_back("GUARD_EXC_RCV_GUARDED_DESC");
1322 }
1323
1324 if (flavor & MD_MAC_EXC_GUARD_MACH_PORT_FLAVOR_GUARD_EXC_MOD_REFS_NON_FATAL) {
1325 flavors.push_back("GUARD_EXC_MOD_REFS_NON_FATAL");
1326 }
1327
1328 if (flavor & MD_MAC_EXC_GUARD_MACH_PORT_FLAVOR_GUARD_EXC_IMMOVABLE_NON_FATAL) {
1329 flavors.push_back("GUARD_EXC_IMMOVABLE_NON_FATAL");
1330 }
1331
1332 reason.append(" / ");
1333 for (size_t i = 0; i < flavors.size(); i++) {
1334 if (i > 0) {
1335 reason.append(" | ");
1336 }
1337
1338 reason.append(flavors[i]);
1339 }
1340 }
1341
1342 break;
1343 case MD_MAC_EXC_GUARD_TYPE_FD:
1344 reason.append("GUARD_TYPE_FD");
1345
1346 if (flavor) {
1347 std::vector<std::string> flavors;
1348
1349 if (flavor & MD_MAC_EXC_GUARD_FD_FLAVOR_GUARD_EXC_CLOSE) {
1350 flavors.push_back("GUARD_EXC_CLOSE");
1351 }
1352
1353 if (flavor & MD_MAC_EXC_GUARD_FD_FLAVOR_GUARD_EXC_DUP) {
1354 flavors.push_back("GUARD_EXC_DUP");
1355 }
1356
1357 if (flavor & MD_MAC_EXC_GUARD_FD_FLAVOR_GUARD_EXC_NOCLOEXEC) {
1358 flavors.push_back("GUARD_EXC_NOCLOEXEC");
1359 }
1360
1361 if (flavor & MD_MAC_EXC_GUARD_FD_FLAVOR_GUARD_EXC_SOCKET_IPC) {
1362 flavors.push_back("GUARD_EXC_SOCKET_IPC");
1363 }
1364
1365 if (flavor & MD_MAC_EXC_GUARD_FD_FLAVOR_GUARD_EXC_FILEPORT) {
1366 flavors.push_back("GUARD_EXC_FILEPORT");
1367 }
1368
1369 if (flavor & MD_MAC_EXC_GUARD_FD_FLAVOR_GUARD_EXC_MISMATCH) {
1370 flavors.push_back("GUARD_EXC_MISMATCH");
1371 }
1372
1373 if (flavor & MD_MAC_EXC_GUARD_FD_FLAVOR_GUARD_EXC_WRITE) {
1374 flavors.push_back("GUARD_EXC_WRITE");
1375 }
1376
1377 reason.append(" / ");
1378 for (size_t i = 0; i < flavors.size(); i++) {
1379 if (i > 0) {
1380 reason.append(" | ");
1381 }
1382
1383 reason.append(flavors[i]);
1384 }
1385 }
1386
1387 break;
1388 case MD_MAC_EXC_GUARD_TYPE_USER:
1389 reason.append("GUARD_TYPE_USER");
1390 break;
1391 case MD_MAC_EXC_GUARD_TYPE_VN:
1392 reason.append("GUARD_TYPE_VN");
1393
1394 if (flavor) {
1395 std::vector<std::string> flavors;
1396
1397 if (flavor & MD_MAC_EXC_GUARD_FD_FLAVOR_GUARD_EXC_RENAME_TO) {
1398 flavors.push_back("GUARD_EXC_RENAME_TO");
1399 }
1400
1401 if (flavor & MD_MAC_EXC_GUARD_FD_FLAVOR_GUARD_EXC_RENAME_FROM) {
1402 flavors.push_back("GUARD_EXC_RENAME_FROM");
1403 }
1404
1405 if (flavor & MD_MAC_EXC_GUARD_FD_FLAVOR_GUARD_EXC_UNLINK) {
1406 flavors.push_back("GUARD_EXC_UNLINK");
1407 }
1408
1409 if (flavor & MD_MAC_EXC_GUARD_FD_FLAVOR_GUARD_EXC_WRITE_OTHER) {
1410 flavors.push_back("GUARD_EXC_WRITE_OTHER");
1411 }
1412
1413 if (flavor & MD_MAC_EXC_GUARD_FD_FLAVOR_GUARD_EXC_TRUNC_OTHER) {
1414 flavors.push_back("GUARD_EXC_TRUNC_OTHER");
1415 }
1416
1417 if (flavor & MD_MAC_EXC_GUARD_FD_FLAVOR_GUARD_EXC_LINK) {
1418 flavors.push_back("GUARD_EXC_LINK");
1419 }
1420
1421 if (flavor & MD_MAC_EXC_GUARD_FD_FLAVOR_GUARD_EXC_EXCHDATA) {
1422 flavors.push_back("GUARD_EXC_EXCHDATA");
1423 }
1424
1425 reason.append(" / ");
1426 for (size_t i = 0; i < flavors.size(); i++) {
1427 if (i > 0) {
1428 reason.append(" | ");
1429 }
1430
1431 reason.append(flavors[i]);
1432 }
1433 }
1434
1435 break;
1436 case MD_MAC_EXC_GUARD_TYPE_VIRT_MEMORY:
1437 reason.append("GUARD_TYPE_VIRT_MEMORY");
1438
1439 if (flavor & MD_MAC_EXC_GUARD_VIRT_MEMORY_FLAVOR_GUARD_EXC_DEALLOC_GAP) {
1440 reason.append(" / GUARD_EXC_DEALLOC_GAP");
1441 }
1442
1443 break;
1444 default:
1445 reason.append(flags_string);
1446 break;
1447 }
1448 }
1449 break;
1450 case MD_EXCEPTION_MAC_SIMULATED:
1451 reason = "Simulated Exception";
1452 break;
1453 }
1454 break;
1455 }
1456
1457 case MD_OS_WIN32_NT:
1458 case MD_OS_WIN32_WINDOWS: {
1459 switch (exception_code) {
1460 case MD_EXCEPTION_CODE_WIN_GUARD_PAGE_VIOLATION:
1461 reason = "EXCEPTION_GUARD_PAGE";
1462 break;
1463 case MD_EXCEPTION_CODE_WIN_DATATYPE_MISALIGNMENT:
1464 reason = "EXCEPTION_DATATYPE_MISALIGNMENT";
1465 break;
1466 case MD_EXCEPTION_CODE_WIN_BREAKPOINT:
1467 reason = "EXCEPTION_BREAKPOINT";
1468 break;
1469 case MD_EXCEPTION_CODE_WIN_SINGLE_STEP:
1470 reason = "EXCEPTION_SINGLE_STEP";
1471 break;
1472 case MD_EXCEPTION_CODE_WIN_ACCESS_VIOLATION:
1473 // For EXCEPTION_ACCESS_VIOLATION, Windows puts the address that
1474 // caused the fault in exception_information[1].
1475 // exception_information[0] is 0 if the violation was caused by
1476 // an attempt to read data, 1 if it was an attempt to write data,
1477 // and 8 if this was a data execution violation.
1478 // This information is useful in addition to the code address, which
1479 // will be present in the crash thread's instruction field anyway.
1480 if (raw_exception->exception_record.number_parameters >= 1) {
1481 MDAccessViolationTypeWin av_type =
1482 static_cast<MDAccessViolationTypeWin>
1483 (raw_exception->exception_record.exception_information[0]);
1484 switch (av_type) {
1485 case MD_ACCESS_VIOLATION_WIN_READ:
1486 reason = "EXCEPTION_ACCESS_VIOLATION_READ";
1487 break;
1488 case MD_ACCESS_VIOLATION_WIN_WRITE:
1489 reason = "EXCEPTION_ACCESS_VIOLATION_WRITE";
1490 break;
1491 case MD_ACCESS_VIOLATION_WIN_EXEC:
1492 reason = "EXCEPTION_ACCESS_VIOLATION_EXEC";
1493 break;
1494 default:
1495 reason = "EXCEPTION_ACCESS_VIOLATION";
1496 break;
1497 }
1498 } else {
1499 reason = "EXCEPTION_ACCESS_VIOLATION";
1500 }
1501 if (address &&
1502 raw_exception->exception_record.number_parameters >= 2) {
1503 *address =
1504 raw_exception->exception_record.exception_information[1];
1505 }
1506 break;
1507 case MD_EXCEPTION_CODE_WIN_IN_PAGE_ERROR:
1508 // For EXCEPTION_IN_PAGE_ERROR, Windows puts the address that
1509 // caused the fault in exception_information[1].
1510 // exception_information[0] is 0 if the violation was caused by
1511 // an attempt to read data, 1 if it was an attempt to write data,
1512 // and 8 if this was a data execution violation.
1513 // exception_information[2] contains the underlying NTSTATUS code,
1514 // which is the explanation for why this error occured.
1515 // This information is useful in addition to the code address, which
1516 // will be present in the crash thread's instruction field anyway.
1517 if (raw_exception->exception_record.number_parameters >= 1) {
1518 MDInPageErrorTypeWin av_type =
1519 static_cast<MDInPageErrorTypeWin>
1520 (raw_exception->exception_record.exception_information[0]);
1521 switch (av_type) {
1522 case MD_IN_PAGE_ERROR_WIN_READ:
1523 reason = "EXCEPTION_IN_PAGE_ERROR_READ";
1524 break;
1525 case MD_IN_PAGE_ERROR_WIN_WRITE:
1526 reason = "EXCEPTION_IN_PAGE_ERROR_WRITE";
1527 break;
1528 case MD_IN_PAGE_ERROR_WIN_EXEC:
1529 reason = "EXCEPTION_IN_PAGE_ERROR_EXEC";
1530 break;
1531 default:
1532 reason = "EXCEPTION_IN_PAGE_ERROR";
1533 break;
1534 }
1535 } else {
1536 reason = "EXCEPTION_IN_PAGE_ERROR";
1537 }
1538 if (address &&
1539 raw_exception->exception_record.number_parameters >= 2) {
1540 *address =
1541 raw_exception->exception_record.exception_information[1];
1542 }
1543 if (raw_exception->exception_record.number_parameters >= 3) {
1544 uint32_t ntstatus =
1545 static_cast<uint32_t>
1546 (raw_exception->exception_record.exception_information[2]);
1547 reason.append(" / ");
1548 const char* ntstatus_str = NTStatusToString(ntstatus);
1549 if (ntstatus_str) {
1550 reason.append(ntstatus_str);
1551 } else {
1552 snprintf(reason_string, sizeof(reason_string), "%#010x", ntstatus);
1553 reason.append(reason_string);
1554 }
1555 }
1556 break;
1557 case MD_EXCEPTION_CODE_WIN_INVALID_HANDLE:
1558 reason = "EXCEPTION_INVALID_HANDLE";
1559 break;
1560 case MD_EXCEPTION_CODE_WIN_ILLEGAL_INSTRUCTION:
1561 reason = "EXCEPTION_ILLEGAL_INSTRUCTION";
1562 break;
1563 case MD_EXCEPTION_CODE_WIN_NONCONTINUABLE_EXCEPTION:
1564 reason = "EXCEPTION_NONCONTINUABLE_EXCEPTION";
1565 break;
1566 case MD_EXCEPTION_CODE_WIN_INVALID_DISPOSITION:
1567 reason = "EXCEPTION_INVALID_DISPOSITION";
1568 break;
1569 case MD_EXCEPTION_CODE_WIN_ARRAY_BOUNDS_EXCEEDED:
1570 reason = "EXCEPTION_ARRAY_BOUNDS_EXCEEDED";
1571 break;
1572 case MD_EXCEPTION_CODE_WIN_FLOAT_DENORMAL_OPERAND:
1573 reason = "EXCEPTION_FLT_DENORMAL_OPERAND";
1574 break;
1575 case MD_EXCEPTION_CODE_WIN_FLOAT_DIVIDE_BY_ZERO:
1576 reason = "EXCEPTION_FLT_DIVIDE_BY_ZERO";
1577 break;
1578 case MD_EXCEPTION_CODE_WIN_FLOAT_INEXACT_RESULT:
1579 reason = "EXCEPTION_FLT_INEXACT_RESULT";
1580 break;
1581 case MD_EXCEPTION_CODE_WIN_FLOAT_INVALID_OPERATION:
1582 reason = "EXCEPTION_FLT_INVALID_OPERATION";
1583 break;
1584 case MD_EXCEPTION_CODE_WIN_FLOAT_OVERFLOW:
1585 reason = "EXCEPTION_FLT_OVERFLOW";
1586 break;
1587 case MD_EXCEPTION_CODE_WIN_FLOAT_STACK_CHECK:
1588 reason = "EXCEPTION_FLT_STACK_CHECK";
1589 break;
1590 case MD_EXCEPTION_CODE_WIN_FLOAT_UNDERFLOW:
1591 reason = "EXCEPTION_FLT_UNDERFLOW";
1592 break;
1593 case MD_EXCEPTION_CODE_WIN_INTEGER_DIVIDE_BY_ZERO:
1594 reason = "EXCEPTION_INT_DIVIDE_BY_ZERO";
1595 break;
1596 case MD_EXCEPTION_CODE_WIN_INTEGER_OVERFLOW:
1597 reason = "EXCEPTION_INT_OVERFLOW";
1598 break;
1599 case MD_EXCEPTION_CODE_WIN_PRIVILEGED_INSTRUCTION:
1600 reason = "EXCEPTION_PRIV_INSTRUCTION";
1601 break;
1602 case MD_EXCEPTION_CODE_WIN_STACK_OVERFLOW:
1603 reason = "EXCEPTION_STACK_OVERFLOW";
1604 break;
1605 case MD_EXCEPTION_CODE_WIN_BAD_FUNCTION_TABLE:
1606 reason = "EXCEPTION_BAD_FUNCTION_TABLE";
1607 break;
1608 case MD_EXCEPTION_CODE_WIN_POSSIBLE_DEADLOCK:
1609 reason = "EXCEPTION_POSSIBLE_DEADLOCK";
1610 break;
1611 case MD_NTSTATUS_WIN_STATUS_STACK_BUFFER_OVERRUN:
1612 reason = "STATUS_STACK_BUFFER_OVERRUN";
1613 if (raw_exception->exception_record.number_parameters > 0) {
1614 uint32_t fast_fail_code =
1615 static_cast<uint32_t>
1616 (raw_exception->exception_record.exception_information[0]);
1617 char fast_fail_buff[13] = {};
1618 const char* fast_fail_string = FastFailToString(fast_fail_code);
1619 if (!fast_fail_string) {
1620 snprintf(fast_fail_buff, sizeof(fast_fail_buff), "%#010x",
1621 fast_fail_code);
1622 fast_fail_string = fast_fail_buff;
1623 }
1624
1625 reason.append(" / ");
1626 reason.append(fast_fail_string);
1627 }
1628
1629 break;
1630 case MD_EXCEPTION_OUT_OF_MEMORY:
1631 reason = "Out of Memory";
1632 break;
1633 case MD_EXCEPTION_CODE_WIN_UNHANDLED_CPP_EXCEPTION:
1634 reason = "Unhandled C++ Exception";
1635 break;
1636 case MD_EXCEPTION_CODE_WIN_SIMULATED:
1637 reason = "Simulated Exception";
1638 break;
1639 default:
1640 fprintf(stderrstderr, "exception_code = %u\n", exception_code);
1641 const char* exception_str = NTStatusToString(exception_code);
1642 fprintf(stderrstderr, "exception_str = %s\n", exception_str);
1643 if (exception_str == nullptr) {
1644 exception_str = WinErrorToString(exception_code);
1645 }
1646 if (exception_str != nullptr) {
1647 reason = exception_str;
1648 }
1649 break;
1650 }
1651 break;
1652 }
1653
1654 case MD_OS_ANDROID:
1655 case MD_OS_LINUX: {
1656 switch (exception_code) {
1657 case MD_EXCEPTION_CODE_LIN_SIGHUP:
1658 reason = "SIGHUP";
1659 break;
1660 case MD_EXCEPTION_CODE_LIN_SIGINT:
1661 reason = "SIGINT";
1662 break;
1663 case MD_EXCEPTION_CODE_LIN_SIGQUIT:
1664 reason = "SIGQUIT";
1665 break;
1666 case MD_EXCEPTION_CODE_LIN_SIGILL:
1667 reason = "SIGILL / ";
1668 switch (exception_flags) {
1669 case MD_EXCEPTION_FLAG_LIN_ILL_ILLOPC:
1670 reason.append("ILL_ILLOPC");
1671 break;
1672 case MD_EXCEPTION_FLAG_LIN_ILL_ILLOPN:
1673 reason.append("ILL_ILLOPN");
1674 break;
1675 case MD_EXCEPTION_FLAG_LIN_ILL_ILLADR:
1676 reason.append("ILL_ILLADR");
1677 break;
1678 case MD_EXCEPTION_FLAG_LIN_ILL_ILLTRP:
1679 reason.append("ILL_ILLTRP");
1680 break;
1681 case MD_EXCEPTION_FLAG_LIN_ILL_PRVOPC:
1682 reason.append("ILL_PRVOPC");
1683 break;
1684 case MD_EXCEPTION_FLAG_LIN_ILL_PRVREG:
1685 reason.append("ILL_PRVREG");
1686 break;
1687 case MD_EXCEPTION_FLAG_LIN_ILL_COPROC:
1688 reason.append("ILL_COPROC");
1689 break;
1690 case MD_EXCEPTION_FLAG_LIN_ILL_BADSTK:
1691 reason.append("ILL_BADSTK");
1692 break;
1693 default:
1694 reason.append(flags_string);
1695 BPLOG(INFO)!(((google_breakpad::LogStream::SEVERITY_INFO) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
clog, google_breakpad::LogStream::SEVERITY_INFO, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 1695))
<< "Unknown exception reason " << reason;
1696 break;
1697 }
1698 break;
1699 case MD_EXCEPTION_CODE_LIN_SIGTRAP:
1700 reason = "SIGTRAP";
1701 break;
1702 case MD_EXCEPTION_CODE_LIN_SIGABRT:
1703 reason = "SIGABRT";
1704 break;
1705 case MD_EXCEPTION_CODE_LIN_SIGBUS:
1706 reason = "SIGBUS / ";
1707 switch (exception_flags) {
1708 case MD_EXCEPTION_FLAG_LIN_SI_USER:
1709 reason.append("SI_USER");
1710 break;
1711 case MD_EXCEPTION_FLAG_LIN_SI_KERNEL:
1712 reason.append("SI_KERNEL");
1713 break;
1714 case MD_EXCEPTION_FLAG_LIN_BUS_ADRALN:
1715 reason.append("BUS_ADRALN");
1716 break;
1717 case MD_EXCEPTION_FLAG_LIN_BUS_ADRERR:
1718 reason.append("BUS_ADRERR");
1719 break;
1720 case MD_EXCEPTION_FLAG_LIN_BUS_OBJERR:
1721 reason.append("BUS_OBJERR");
1722 break;
1723 case MD_EXCEPTION_FLAG_LIN_BUS_MCEERR_AR:
1724 reason.append("BUS_MCEERR_AR");
1725 break;
1726 case MD_EXCEPTION_FLAG_LIN_BUS_MCEERR_AO:
1727 reason.append("BUS_MCEERR_AO");
1728 break;
1729 default:
1730 reason.append(flags_string);
1731 BPLOG(INFO)!(((google_breakpad::LogStream::SEVERITY_INFO) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
clog, google_breakpad::LogStream::SEVERITY_INFO, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 1731))
<< "Unknown exception reason " << reason;
1732 break;
1733 }
1734 break;
1735 case MD_EXCEPTION_CODE_LIN_SIGFPE:
1736 reason = "SIGFPE / ";
1737 switch (exception_flags) {
1738 case MD_EXCEPTION_FLAG_LIN_FPE_INTDIV:
1739 reason.append("FPE_INTDIV");
1740 break;
1741 case MD_EXCEPTION_FLAG_LIN_FPE_INTOVF:
1742 reason.append("FPE_INTOVF");
1743 break;
1744 case MD_EXCEPTION_FLAG_LIN_FPE_FLTDIV:
1745 reason.append("FPE_FLTDIV");
1746 break;
1747 case MD_EXCEPTION_FLAG_LIN_FPE_FLTOVF:
1748 reason.append("FPE_FLTOVF");
1749 break;
1750 case MD_EXCEPTION_FLAG_LIN_FPE_FLTUND:
1751 reason.append("FPE_FLTUND");
1752 break;
1753 case MD_EXCEPTION_FLAG_LIN_FPE_FLTRES:
1754 reason.append("FPE_FLTRES");
1755 break;
1756 case MD_EXCEPTION_FLAG_LIN_FPE_FLTINV:
1757 reason.append("FPE_FLTINV");
1758 break;
1759 case MD_EXCEPTION_FLAG_LIN_FPE_FLTSUB:
1760 reason.append("FPE_FLTSUB");
1761 break;
1762 default:
1763 reason.append(flags_string);
1764 BPLOG(INFO)!(((google_breakpad::LogStream::SEVERITY_INFO) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
clog, google_breakpad::LogStream::SEVERITY_INFO, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 1764))
<< "Unknown exception reason " << reason;
1765 break;
1766 }
1767 break;
1768 case MD_EXCEPTION_CODE_LIN_SIGKILL:
1769 reason = "SIGKILL";
1770 break;
1771 case MD_EXCEPTION_CODE_LIN_SIGUSR1:
1772 reason = "SIGUSR1";
1773 break;
1774 case MD_EXCEPTION_CODE_LIN_SIGSEGV:
1775 reason = "SIGSEGV / ";
1776 switch (exception_flags) {
1777 case MD_EXCEPTION_FLAG_LIN_SI_USER:
1778 reason.append("SI_USER");
1779 break;
1780 case MD_EXCEPTION_FLAG_LIN_SI_KERNEL:
1781 reason.append("SI_KERNEL");
1782 break;
1783 case MD_EXCEPTION_FLAG_LIN_SEGV_MAPERR:
1784 reason.append("SEGV_MAPERR");
1785 break;
1786 case MD_EXCEPTION_FLAG_LIN_SEGV_ACCERR:
1787 reason.append("SEGV_ACCERR");
1788 break;
1789 case MD_EXCEPTION_FLAG_LIN_SEGV_BNDERR:
1790 reason.append("SEGV_BNDERR");
1791 break;
1792 case MD_EXCEPTION_FLAG_LIN_SEGV_PKUERR:
1793 reason.append("SEGV_PKUERR");
1794 break;
1795 default:
1796 reason.append(flags_string);
1797 BPLOG(INFO)!(((google_breakpad::LogStream::SEVERITY_INFO) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
clog, google_breakpad::LogStream::SEVERITY_INFO, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 1797))
<< "Unknown exception reason " << reason;
1798 break;
1799 }
1800 break;
1801 case MD_EXCEPTION_CODE_LIN_SIGUSR2:
1802 reason = "SIGUSR2";
1803 break;
1804 case MD_EXCEPTION_CODE_LIN_SIGPIPE:
1805 reason = "SIGPIPE";
1806 break;
1807 case MD_EXCEPTION_CODE_LIN_SIGALRM:
1808 reason = "SIGALRM";
1809 break;
1810 case MD_EXCEPTION_CODE_LIN_SIGTERM:
1811 reason = "SIGTERM";
1812 break;
1813 case MD_EXCEPTION_CODE_LIN_SIGSTKFLT:
1814 reason = "SIGSTKFLT";
1815 break;
1816 case MD_EXCEPTION_CODE_LIN_SIGCHLD:
1817 reason = "SIGCHLD";
1818 break;
1819 case MD_EXCEPTION_CODE_LIN_SIGCONT:
1820 reason = "SIGCONT";
1821 break;
1822 case MD_EXCEPTION_CODE_LIN_SIGSTOP:
1823 reason = "SIGSTOP";
1824 break;
1825 case MD_EXCEPTION_CODE_LIN_SIGTSTP:
1826 reason = "SIGTSTP";
1827 break;
1828 case MD_EXCEPTION_CODE_LIN_SIGTTIN:
1829 reason = "SIGTTIN";
1830 break;
1831 case MD_EXCEPTION_CODE_LIN_SIGTTOU:
1832 reason = "SIGTTOU";
1833 break;
1834 case MD_EXCEPTION_CODE_LIN_SIGURG:
1835 reason = "SIGURG";
1836 break;
1837 case MD_EXCEPTION_CODE_LIN_SIGXCPU:
1838 reason = "SIGXCPU";
1839 break;
1840 case MD_EXCEPTION_CODE_LIN_SIGXFSZ:
1841 reason = "SIGXFSZ";
1842 break;
1843 case MD_EXCEPTION_CODE_LIN_SIGVTALRM:
1844 reason = "SIGVTALRM";
1845 break;
1846 case MD_EXCEPTION_CODE_LIN_SIGPROF:
1847 reason = "SIGPROF";
1848 break;
1849 case MD_EXCEPTION_CODE_LIN_SIGWINCH:
1850 reason = "SIGWINCH";
1851 break;
1852 case MD_EXCEPTION_CODE_LIN_SIGIO:
1853 reason = "SIGIO";
1854 break;
1855 case MD_EXCEPTION_CODE_LIN_SIGPWR:
1856 reason = "SIGPWR";
1857 break;
1858 case MD_EXCEPTION_CODE_LIN_SIGSYS:
1859 reason = "SIGSYS";
1860 break;
1861 case MD_EXCEPTION_CODE_LIN_DUMP_REQUESTED:
1862 reason = "DUMP_REQUESTED";
1863 break;
1864 default:
1865 BPLOG(INFO)!(((google_breakpad::LogStream::SEVERITY_INFO) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
clog, google_breakpad::LogStream::SEVERITY_INFO, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 1865))
<< "Unknown exception reason " << reason;
1866 break;
1867 }
1868 break;
1869 }
1870
1871 case MD_OS_SOLARIS: {
1872 switch (exception_code) {
1873 case MD_EXCEPTION_CODE_SOL_SIGHUP:
1874 reason = "SIGHUP";
1875 break;
1876 case MD_EXCEPTION_CODE_SOL_SIGINT:
1877 reason = "SIGINT";
1878 break;
1879 case MD_EXCEPTION_CODE_SOL_SIGQUIT:
1880 reason = "SIGQUIT";
1881 break;
1882 case MD_EXCEPTION_CODE_SOL_SIGILL:
1883 reason = "SIGILL";
1884 break;
1885 case MD_EXCEPTION_CODE_SOL_SIGTRAP:
1886 reason = "SIGTRAP";
1887 break;
1888 case MD_EXCEPTION_CODE_SOL_SIGIOT:
1889 reason = "SIGIOT | SIGABRT";
1890 break;
1891 case MD_EXCEPTION_CODE_SOL_SIGEMT:
1892 reason = "SIGEMT";
1893 break;
1894 case MD_EXCEPTION_CODE_SOL_SIGFPE:
1895 reason = "SIGFPE";
1896 break;
1897 case MD_EXCEPTION_CODE_SOL_SIGKILL:
1898 reason = "SIGKILL";
1899 break;
1900 case MD_EXCEPTION_CODE_SOL_SIGBUS:
1901 reason = "SIGBUS";
1902 break;
1903 case MD_EXCEPTION_CODE_SOL_SIGSEGV:
1904 reason = "SIGSEGV";
1905 break;
1906 case MD_EXCEPTION_CODE_SOL_SIGSYS:
1907 reason = "SIGSYS";
1908 break;
1909 case MD_EXCEPTION_CODE_SOL_SIGPIPE:
1910 reason = "SIGPIPE";
1911 break;
1912 case MD_EXCEPTION_CODE_SOL_SIGALRM:
1913 reason = "SIGALRM";
1914 break;
1915 case MD_EXCEPTION_CODE_SOL_SIGTERM:
1916 reason = "SIGTERM";
1917 break;
1918 case MD_EXCEPTION_CODE_SOL_SIGUSR1:
1919 reason = "SIGUSR1";
1920 break;
1921 case MD_EXCEPTION_CODE_SOL_SIGUSR2:
1922 reason = "SIGUSR2";
1923 break;
1924 case MD_EXCEPTION_CODE_SOL_SIGCLD:
1925 reason = "SIGCLD | SIGCHLD";
1926 break;
1927 case MD_EXCEPTION_CODE_SOL_SIGPWR:
1928 reason = "SIGPWR";
1929 break;
1930 case MD_EXCEPTION_CODE_SOL_SIGWINCH:
1931 reason = "SIGWINCH";
1932 break;
1933 case MD_EXCEPTION_CODE_SOL_SIGURG:
1934 reason = "SIGURG";
1935 break;
1936 case MD_EXCEPTION_CODE_SOL_SIGPOLL:
1937 reason = "SIGPOLL | SIGIO";
1938 break;
1939 case MD_EXCEPTION_CODE_SOL_SIGSTOP:
1940 reason = "SIGSTOP";
1941 break;
1942 case MD_EXCEPTION_CODE_SOL_SIGTSTP:
1943 reason = "SIGTSTP";
1944 break;
1945 case MD_EXCEPTION_CODE_SOL_SIGCONT:
1946 reason = "SIGCONT";
1947 break;
1948 case MD_EXCEPTION_CODE_SOL_SIGTTIN:
1949 reason = "SIGTTIN";
1950 break;
1951 case MD_EXCEPTION_CODE_SOL_SIGTTOU:
1952 reason = "SIGTTOU";
1953 break;
1954 case MD_EXCEPTION_CODE_SOL_SIGVTALRM:
1955 reason = "SIGVTALRM";
1956 break;
1957 case MD_EXCEPTION_CODE_SOL_SIGPROF:
1958 reason = "SIGPROF";
1959 break;
1960 case MD_EXCEPTION_CODE_SOL_SIGXCPU:
1961 reason = "SIGXCPU";
1962 break;
1963 case MD_EXCEPTION_CODE_SOL_SIGXFSZ:
1964 reason = "SIGXFSZ";
1965 break;
1966 case MD_EXCEPTION_CODE_SOL_SIGWAITING:
1967 reason = "SIGWAITING";
1968 break;
1969 case MD_EXCEPTION_CODE_SOL_SIGLWP:
1970 reason = "SIGLWP";
1971 break;
1972 case MD_EXCEPTION_CODE_SOL_SIGFREEZE:
1973 reason = "SIGFREEZE";
1974 break;
1975 case MD_EXCEPTION_CODE_SOL_SIGTHAW:
1976 reason = "SIGTHAW";
1977 break;
1978 case MD_EXCEPTION_CODE_SOL_SIGCANCEL:
1979 reason = "SIGCANCEL";
1980 break;
1981 case MD_EXCEPTION_CODE_SOL_SIGLOST:
1982 reason = "SIGLOST";
1983 break;
1984 case MD_EXCEPTION_CODE_SOL_SIGXRES:
1985 reason = "SIGXRES";
1986 break;
1987 case MD_EXCEPTION_CODE_SOL_SIGJVM1:
1988 reason = "SIGJVM1";
1989 break;
1990 case MD_EXCEPTION_CODE_SOL_SIGJVM2:
1991 reason = "SIGJVM2";
1992 break;
1993 default:
1994 BPLOG(INFO)!(((google_breakpad::LogStream::SEVERITY_INFO) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
clog, google_breakpad::LogStream::SEVERITY_INFO, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 1994))
<< "Unknown exception reason " << reason;
1995 break;
1996 }
1997 break;
1998 }
1999
2000 case MD_OS_PS3: {
2001 switch (exception_code) {
2002 case MD_EXCEPTION_CODE_PS3_UNKNOWN:
2003 reason = "UNKNOWN";
2004 break;
2005 case MD_EXCEPTION_CODE_PS3_TRAP_EXCEP:
2006 reason = "TRAP_EXCEP";
2007 break;
2008 case MD_EXCEPTION_CODE_PS3_PRIV_INSTR:
2009 reason = "PRIV_INSTR";
2010 break;
2011 case MD_EXCEPTION_CODE_PS3_ILLEGAL_INSTR:
2012 reason = "ILLEGAL_INSTR";
2013 break;
2014 case MD_EXCEPTION_CODE_PS3_INSTR_STORAGE:
2015 reason = "INSTR_STORAGE";
2016 break;
2017 case MD_EXCEPTION_CODE_PS3_INSTR_SEGMENT:
2018 reason = "INSTR_SEGMENT";
2019 break;
2020 case MD_EXCEPTION_CODE_PS3_DATA_STORAGE:
2021 reason = "DATA_STORAGE";
2022 break;
2023 case MD_EXCEPTION_CODE_PS3_DATA_SEGMENT:
2024 reason = "DATA_SEGMENT";
2025 break;
2026 case MD_EXCEPTION_CODE_PS3_FLOAT_POINT:
2027 reason = "FLOAT_POINT";
2028 break;
2029 case MD_EXCEPTION_CODE_PS3_DABR_MATCH:
2030 reason = "DABR_MATCH";
2031 break;
2032 case MD_EXCEPTION_CODE_PS3_ALIGN_EXCEP:
2033 reason = "ALIGN_EXCEP";
2034 break;
2035 case MD_EXCEPTION_CODE_PS3_MEMORY_ACCESS:
2036 reason = "MEMORY_ACCESS";
2037 break;
2038 case MD_EXCEPTION_CODE_PS3_COPRO_ALIGN:
2039 reason = "COPRO_ALIGN";
2040 break;
2041 case MD_EXCEPTION_CODE_PS3_COPRO_INVALID_COM:
2042 reason = "COPRO_INVALID_COM";
2043 break;
2044 case MD_EXCEPTION_CODE_PS3_COPRO_ERR:
2045 reason = "COPRO_ERR";
2046 break;
2047 case MD_EXCEPTION_CODE_PS3_COPRO_FIR:
2048 reason = "COPRO_FIR";
2049 break;
2050 case MD_EXCEPTION_CODE_PS3_COPRO_DATA_SEGMENT:
2051 reason = "COPRO_DATA_SEGMENT";
2052 break;
2053 case MD_EXCEPTION_CODE_PS3_COPRO_DATA_STORAGE:
2054 reason = "COPRO_DATA_STORAGE";
2055 break;
2056 case MD_EXCEPTION_CODE_PS3_COPRO_STOP_INSTR:
2057 reason = "COPRO_STOP_INSTR";
2058 break;
2059 case MD_EXCEPTION_CODE_PS3_COPRO_HALT_INSTR:
2060 reason = "COPRO_HALT_INSTR";
2061 break;
2062 case MD_EXCEPTION_CODE_PS3_COPRO_HALTINST_UNKNOWN:
2063 reason = "COPRO_HALTINSTR_UNKNOWN";
2064 break;
2065 case MD_EXCEPTION_CODE_PS3_COPRO_MEMORY_ACCESS:
2066 reason = "COPRO_MEMORY_ACCESS";
2067 break;
2068 case MD_EXCEPTION_CODE_PS3_GRAPHIC:
2069 reason = "GRAPHIC";
2070 break;
2071 default:
2072 BPLOG(INFO)!(((google_breakpad::LogStream::SEVERITY_INFO) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
clog, google_breakpad::LogStream::SEVERITY_INFO, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 2072))
<< "Unknown exception reason "<< reason;
2073 break;
2074 }
2075 break;
2076 }
2077
2078 default: {
2079 BPLOG(INFO)!(((google_breakpad::LogStream::SEVERITY_INFO) >= (google_breakpad
::LogStream::SEVERITY_CRITICAL))) ? (void) 0 : google_breakpad
::LogMessageVoidify() & (google_breakpad::LogStream(std::
clog, google_breakpad::LogStream::SEVERITY_INFO, "./../../../../../../toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc"
, 2079))
<< "Unknown exception reason " << reason;
2080 break;
2081 }
2082 }
2083
2084 if (address) {
2085 *address = GetAddressForArchitecture(
2086 static_cast<MDCPUArchitecture>(raw_system_info->processor_architecture),
2087 *address);
2088 }
2089
2090 return reason;
2091}
2092
2093// static
2094string MinidumpProcessor::GetAssertion(Minidump *dump) {
2095 MinidumpAssertion *assertion = dump->GetAssertion();
2096 if (!assertion)
2097 return "";
2098
2099 const MDRawAssertionInfo *raw_assertion = assertion->assertion();
2100 if (!raw_assertion)
2101 return "";
2102
2103 string assertion_string;
2104 switch (raw_assertion->type) {
2105 case MD_ASSERTION_INFO_TYPE_INVALID_PARAMETER:
2106 assertion_string = "Invalid parameter passed to library function";
2107 break;
2108 case MD_ASSERTION_INFO_TYPE_PURE_VIRTUAL_CALL:
2109 assertion_string = "Pure virtual function called";
2110 break;
2111 default: {
2112 char assertion_type[32];
2113 snprintf(assertion_type, sizeof(assertion_type),
2114 "0x%08x", raw_assertion->type);
2115 assertion_string = "Unknown assertion type ";
2116 assertion_string += assertion_type;
2117 break;
2118 }
2119 }
2120
2121 string expression = assertion->expression();
2122 if (!expression.empty()) {
2123 assertion_string.append(" " + expression);
2124 }
2125
2126 string function = assertion->function();
2127 if (!function.empty()) {
2128 assertion_string.append(" in function " + function);
2129 }
2130
2131 string file = assertion->file();
2132 if (!file.empty()) {
2133 assertion_string.append(", in file " + file);
2134 }
2135
2136 if (raw_assertion->line != 0) {
2137 char assertion_line[32];
2138 snprintf(assertion_line, sizeof(assertion_line), "%u", raw_assertion->line);
2139 assertion_string.append(" at line ");
2140 assertion_string.append(assertion_line);
2141 }
2142
2143 return assertion_string;
2144}
2145
2146} // namespace google_breakpad