Bug 1469603 - Use a recursive lock in crash reporter callbacks that might be called synchronously; r=erahm

This commit is contained in:
Gabriele Svelto
2018-06-21 09:56:26 +02:00
parent c6bb02e0c0
commit ff8ae4522e
2 changed files with 12 additions and 9 deletions

View File

@@ -581,7 +581,7 @@ PluginModuleChromeParent::InitCrashReporter()
}
{
mozilla::MutexAutoLock lock(mCrashReporterMutex);
mozilla::RecursiveMutexAutoLock lock(mCrashReporterMutex);
mCrashReporter = MakeUnique<ipc::CrashReporterHost>(
GeckoProcessType_Plugin,
shmem,
@@ -721,7 +721,7 @@ void
PluginModuleChromeParent::WriteExtraDataForMinidump()
{
// mCrashReporterMutex is already held by the caller
mCrashReporterMutex.AssertCurrentThreadOwns();
mCrashReporterMutex.AssertCurrentThreadIn();
typedef nsDependentCString cstring;
@@ -1087,7 +1087,7 @@ PluginModuleChromeParent::TakeFullMinidump(base::ProcessId aContentPid,
std::function<void(nsString)>&& aCallback,
bool aAsync)
{
mozilla::MutexAutoLock lock(mCrashReporterMutex);
mozilla::RecursiveMutexAutoLock lock(mCrashReporterMutex);
if (!mCrashReporter || !mTakeFullMinidumpCallback.IsEmpty()) {
aCallback(EmptyString());
@@ -1174,7 +1174,7 @@ PluginModuleChromeParent::TakeBrowserAndPluginMinidumps(bool aReportsReady,
const nsAString& aBrowserDumpId,
bool aAsync)
{
mCrashReporterMutex.AssertCurrentThreadOwns();
mCrashReporterMutex.AssertCurrentThreadIn();
// Generate crash report including plugin and browser process minidumps.
// The plugin process is the parent report with additional dumps including
@@ -1209,7 +1209,7 @@ PluginModuleChromeParent::OnTakeFullMinidumpComplete(bool aReportsReady,
base::ProcessId aContentPid,
const nsAString& aBrowserDumpId)
{
mCrashReporterMutex.AssertCurrentThreadOwns();
mCrashReporterMutex.AssertCurrentThreadIn();
if (aReportsReady) {
nsString dumpId = mCrashReporter->MinidumpID();
@@ -1294,7 +1294,7 @@ void
PluginModuleChromeParent::TerminateChildProcessOnDumpComplete(MessageLoop* aMsgLoop,
const nsCString& aMonitorDescription)
{
mCrashReporterMutex.AssertCurrentThreadOwns();
mCrashReporterMutex.AssertCurrentThreadIn();
if (!mCrashReporter) {
// If mCrashReporter is null then the hang has ended, the plugin module
@@ -1511,7 +1511,7 @@ RemoveMinidump(nsIFile* minidump)
void
PluginModuleChromeParent::ProcessFirstMinidump()
{
mozilla::MutexAutoLock lock(mCrashReporterMutex);
mozilla::RecursiveMutexAutoLock lock(mCrashReporterMutex);
if (!mCrashReporter)
return;