зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1286802
- Part 3: Add empty set_include_context_heap() implementation to ExceptionHandler and CrashGenerationServer. r=ted
MozReview-Commit-ID: 5GBzvyvNPDa
This commit is contained in:
Родитель
8b323a48e2
Коммит
d52aeedecb
|
@ -5734,5 +5734,13 @@ pref("layers.advanced.filter-layers", 2);
|
|||
// Enable lowercased response header name
|
||||
pref("dom.xhr.lowercase_header.enabled", false);
|
||||
|
||||
// When a crash happens, whether to include heap regions of the crash context
|
||||
// in the minidump. Enabled by default on nightly and aurora.
|
||||
#ifdef RELEASE_OR_BETA
|
||||
pref("toolkit.crashreporter.include_context_heap", false);
|
||||
#else
|
||||
pref("toolkit.crashreporter.include_context_heap", true);
|
||||
#endif
|
||||
|
||||
// Open noopener links in a new process
|
||||
pref("dom.noopener.newprocess.enabled", true);
|
||||
|
|
|
@ -126,7 +126,8 @@ CrashGenerationServer::CrashGenerationServer(
|
|||
server_state_(IPC_SERVER_STATE_UNINITIALIZED),
|
||||
shutting_down_(false),
|
||||
overlapped_(),
|
||||
client_info_(NULL) {
|
||||
client_info_(NULL),
|
||||
include_context_heap_(false) {
|
||||
InitializeCriticalSection(&sync_);
|
||||
}
|
||||
|
||||
|
@ -896,6 +897,11 @@ void CrashGenerationServer::HandleDumpRequest(const ClientInfo& client_info) {
|
|||
SetEvent(client_info.dump_generated_handle());
|
||||
}
|
||||
|
||||
void CrashGenerationServer::set_include_context_heap(bool enabled) {
|
||||
|
||||
include_context_heap_ = enabled;
|
||||
}
|
||||
|
||||
bool CrashGenerationServer::GenerateDump(const ClientInfo& client,
|
||||
std::wstring* dump_path) {
|
||||
assert(client.pid() != 0);
|
||||
|
|
|
@ -106,6 +106,11 @@ class CrashGenerationServer {
|
|||
pre_fetch_custom_info_ = do_pre_fetch;
|
||||
}
|
||||
|
||||
// Calling set_include_context_heap(true) causes heap regions to be included
|
||||
// in the minidump when a crash happens. The heap regions are from the
|
||||
// register values of the client crashing context.
|
||||
void set_include_context_heap(bool enabled);
|
||||
|
||||
private:
|
||||
// Various states the client can be in during the handshake with
|
||||
// the server.
|
||||
|
@ -289,6 +294,9 @@ class CrashGenerationServer {
|
|||
// Client Info for the client that's connecting to the server.
|
||||
ClientInfo* client_info_;
|
||||
|
||||
// Whether to include heap regions of the crashing context.
|
||||
bool include_context_heap_;
|
||||
|
||||
// Disable copy ctor and operator=.
|
||||
CrashGenerationServer(const CrashGenerationServer& crash_server);
|
||||
CrashGenerationServer& operator=(const CrashGenerationServer& crash_server);
|
||||
|
|
|
@ -279,6 +279,8 @@ void ExceptionHandler::Initialize(
|
|||
|
||||
LeaveCriticalSection(&handler_stack_critical_section_);
|
||||
}
|
||||
|
||||
include_context_heap_ = false;
|
||||
}
|
||||
|
||||
ExceptionHandler::~ExceptionHandler() {
|
||||
|
@ -1026,4 +1028,8 @@ void ExceptionHandler::UnregisterAppMemory(void* ptr) {
|
|||
}
|
||||
}
|
||||
|
||||
void ExceptionHandler::set_include_context_heap(bool enabled) {
|
||||
include_context_heap_ = enabled;
|
||||
}
|
||||
|
||||
} // namespace google_breakpad
|
||||
|
|
|
@ -267,6 +267,11 @@ class ExceptionHandler {
|
|||
void RegisterAppMemory(void* ptr, size_t length);
|
||||
void UnregisterAppMemory(void* ptr);
|
||||
|
||||
// Calling set_include_context_heap(true) causes heap regions to be included
|
||||
// in the minidump when a crash happens. The heap regions are from the
|
||||
// register values of the crashing context.
|
||||
void set_include_context_heap(bool enabled);
|
||||
|
||||
private:
|
||||
friend class AutoExceptionHandler;
|
||||
|
||||
|
@ -490,6 +495,8 @@ class ExceptionHandler {
|
|||
// The number of instances of this class.
|
||||
static volatile LONG instance_count_;
|
||||
|
||||
bool include_context_heap_;
|
||||
|
||||
// disallow copy ctor and operator=
|
||||
explicit ExceptionHandler(const ExceptionHandler &);
|
||||
void operator=(const ExceptionHandler &);
|
||||
|
|
|
@ -257,6 +257,9 @@ static uint32_t eventloopNestingLevel = 0;
|
|||
static Mutex* dumpSafetyLock;
|
||||
static bool isSafeToDump = false;
|
||||
|
||||
// Whether to include heap regions of the crash context.
|
||||
static bool sIncludeContextHeap = false;
|
||||
|
||||
// OOP crash reporting
|
||||
static CrashGenerationServer* crashServer; // chrome process has this
|
||||
|
||||
|
@ -1760,6 +1763,9 @@ nsresult SetExceptionHandler(nsIFile* aXREDirectory,
|
|||
#ifdef XP_WIN
|
||||
gExceptionHandler->set_handle_debug_exceptions(true);
|
||||
|
||||
// Initially set sIncludeContextHeap to true for debugging startup crashes
|
||||
// even if the controlling pref value is false.
|
||||
SetIncludeContextHeap(true);
|
||||
#ifdef _WIN64
|
||||
// Tell JS about the new filter before we disable SetUnhandledExceptionFilter
|
||||
SetJitExceptionHandler();
|
||||
|
@ -2433,6 +2439,17 @@ nsresult UnregisterAppMemory(void* ptr)
|
|||
#endif
|
||||
}
|
||||
|
||||
void SetIncludeContextHeap(bool aValue)
|
||||
{
|
||||
sIncludeContextHeap = aValue;
|
||||
|
||||
#ifdef XP_WIN
|
||||
if (gExceptionHandler) {
|
||||
gExceptionHandler->set_include_context_heap(sIncludeContextHeap);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool GetServerURL(nsACString& aServerURL)
|
||||
{
|
||||
if (!gExceptionHandler)
|
||||
|
@ -3483,6 +3500,10 @@ OOPInit()
|
|||
true, // automatically generate dumps
|
||||
&dumpPath);
|
||||
|
||||
if (sIncludeContextHeap) {
|
||||
crashServer->set_include_context_heap(sIncludeContextHeap);
|
||||
}
|
||||
|
||||
#elif defined(XP_LINUX)
|
||||
if (!CrashGenerationServer::CreateReportChannel(&serverSocketFd,
|
||||
&clientSocketFd))
|
||||
|
|
|
@ -93,6 +93,9 @@ bool GetLastRunCrashID(nsAString& id);
|
|||
nsresult RegisterAppMemory(void* ptr, size_t length);
|
||||
nsresult UnregisterAppMemory(void* ptr);
|
||||
|
||||
// Include heap regions of the crash context.
|
||||
void SetIncludeContextHeap(bool aValue);
|
||||
|
||||
// Functions for working with minidumps and .extras
|
||||
typedef nsDataHashtable<nsCStringHashKey, nsCString> AnnotationTable;
|
||||
|
||||
|
|
|
@ -4294,6 +4294,10 @@ XREMain::XRE_mainRun()
|
|||
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("FramePoisonSize"),
|
||||
nsPrintfCString("%" PRIu32, uint32_t(gMozillaPoisonSize)));
|
||||
|
||||
bool includeContextHeap =
|
||||
Preferences::GetBool("toolkit.crashreporter.include_context_heap", false);
|
||||
CrashReporter::SetIncludeContextHeap(includeContextHeap);
|
||||
|
||||
#ifdef XP_WIN
|
||||
PR_CreateThread(PR_USER_THREAD, AnnotateSystemManufacturer_ThreadStart, 0,
|
||||
PR_PRIORITY_LOW, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, 0);
|
||||
|
|
Загрузка…
Ссылка в новой задаче