bug 1101194 - follow-up to fix bustage in TestCertDB r=bustage on a CLOSED TREE
authorDavid Keeler <dkeeler@mozilla.com>
Thu, 08 Jan 2015 10:56:07 -0800
changeset 222807 86f3f3bee063e719039107fb7a04c0b98b384c92
parent 222806 fec317aa00bc9d1d71beb664237bd659a256a7f2
child 222808 b3f84cf78dc20519db0797f9bd613331647d61e6
child 222809 20a7f674d668fdd19e0337f6f5847befc3a66fbf
push id28073
push userkwierso@gmail.com
push dateFri, 09 Jan 2015 01:08:23 +0000
treeherdermozilla-central@b3f84cf78dc2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbustage
bugs1101194
milestone37.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 1101194 - follow-up to fix bustage in TestCertDB r=bustage on a CLOSED TREE Turns out there was a code path that resulted in attempting to acquire a lock on the DataStorage mutex when one had already been acquired, resulting in deadlock. This fixes it.
security/manager/boot/src/DataStorage.cpp
--- a/security/manager/boot/src/DataStorage.cpp
+++ b/security/manager/boot/src/DataStorage.cpp
@@ -106,22 +106,16 @@ private:
   static nsresult ParseLine(nsDependentCSubstring& aLine, nsCString& aKeyOut,
                             Entry& aEntryOut);
 
   nsRefPtr<DataStorage> mDataStorage;
 };
 
 DataStorage::Reader::~Reader()
 {
-  {
-    MutexAutoLock lock(mDataStorage->mMutex);
-    Telemetry::Accumulate(Telemetry::DATA_STORAGE_ENTRIES,
-                          mDataStorage->mPersistentDataTable.Count());
-  }
-
   // Notify that calls to Get can proceed.
   {
     MonitorAutoLock readyLock(mDataStorage->mReadyMonitor);
     mDataStorage->mReady = true;
     nsresult rv = mDataStorage->mReadyMonitor.NotifyAll();
     unused << NS_WARN_IF(NS_FAILED(rv));
   }
 
@@ -204,16 +198,19 @@ DataStorage::Reader::Run()
         // we got around to reading the file. Don't overwrite new entries.
         Entry newerEntry;
         bool present = mDataStorage->mPersistentDataTable.Get(key, &newerEntry);
         if (!present) {
           mDataStorage->mPersistentDataTable.Put(key, entry);
         }
       }
     } while (true);
+
+    Telemetry::Accumulate(Telemetry::DATA_STORAGE_ENTRIES,
+                          mDataStorage->mPersistentDataTable.Count());
   }
 
   return NS_OK;
 }
 
 // The key must be a non-empty string containing no instances of '\t' or '\n',
 // and must have a length no more than 256.
 // The value must not contain '\n' and must have a length no more than 1024.