Bug 1519038 - Fixing Assertion failure: IsIdle(oldState) r=baku
authorTarek Ziadé <tarek@mozilla.com>
Tue, 15 Jan 2019 13:20:17 +0000
changeset 511019 5090d461e169e160de477c06b3606c9e130f9f00
parent 511018 4234a4516c4526b942e635e825a259206287ac7f
child 511030 abb8a4bb66a742bc1e31c3e2a2956bedf52be665
child 511031 d9a81de35ac3bee7f1e69d59d90a6ad7ee82c5c9
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1519038
milestone66.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 1519038 - Fixing Assertion failure: IsIdle(oldState) r=baku Differential Revision: https://phabricator.services.mozilla.com/D16529
toolkit/components/perfmonitoring/PerformanceUtils.cpp
--- a/toolkit/components/perfmonitoring/PerformanceUtils.cpp
+++ b/toolkit/components/perfmonitoring/PerformanceUtils.cpp
@@ -38,24 +38,29 @@ nsTArray<RefPtr<PerformanceInfoPromise>>
     promises.AppendElement(debugger->ReportPerformanceInfo());
   }
 
   // collecting ReportPerformanceInfo from all DocGroup instances
   LinkedList<TabGroup>* tabGroups = TabGroup::GetTabGroupList();
 
   // if GetTabGroupList() returns null, we don't have any tab group
   if (tabGroups) {
+    // Per Bug 1519038, we want to collect DocGroup objects
+    // and use them outside the iterator, to avoid a read-write conflict.
+    nsTArray<RefPtr<DocGroup>> docGroups;
     for (TabGroup* tabGroup = tabGroups->getFirst(); tabGroup;
          tabGroup =
              static_cast<LinkedListElement<TabGroup>*>(tabGroup)->getNext()) {
       for (auto iter = tabGroup->Iter(); !iter.Done(); iter.Next()) {
-        DocGroup* docGroup = iter.Get()->mDocGroup;
-        promises.AppendElement(docGroup->ReportPerformanceInfo());
+        docGroups.AppendElement(iter.Get()->mDocGroup);
       }
     }
+    for (DocGroup* docGroup : docGroups) {
+      promises.AppendElement(docGroup->ReportPerformanceInfo());
+    }
   }
   return promises;
 }
 
 nsresult GetTabSizes(nsGlobalWindowOuter* aWindow, nsTabSizes* aSizes) {
   // Measure the window.
   SizeOfState state(moz_malloc_size_of);
   nsWindowSizes windowSizes(state);