Title: [209154] trunk
- Revision
- 209154
- Author
- [email protected]
- Date
- 2016-11-30 14:21:16 -0800 (Wed, 30 Nov 2016)
Log Message
REGRESSION: inspector/sampling-profiler/* LayoutTests are flaky timeouts
https://bugs.webkit.org/show_bug.cgi?id=164388
<rdar://problem/29101555>
Patch by Joseph Pecoraro <[email protected]> on 2016-11-30
Reviewed by Saam Barati.
Source/_javascript_Core:
There was a possibility of a deadlock between the main thread and the GC thread
with the SamplingProfiler lock when Inspector is processing samples to send to
the frontend. The Inspector (main thread) was holding the SamplingProfiler lock
while processing samples, which runs _javascript_ that could trigger a GC, and
GC then tries to acquire the SamplingProfiler lock to process unprocessed samples.
A simple solution here is to tighten the bounds of when Inspector holds the
SamplingProfiler lock. It only needs the lock when extracting samples from
the SamplingProfiler. It doesn't need to hold the lock for processing those
samples, which is what can run script and cause a GC.
* inspector/agents/InspectorScriptProfilerAgent.cpp:
(Inspector::InspectorScriptProfilerAgent::trackingComplete):
Tighten bounds of this lock to only where it is needed.
LayoutTests:
* platform/mac/TestExpectations:
Unskip now that tests are no longer flakey.
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (209153 => 209154)
--- trunk/LayoutTests/ChangeLog 2016-11-30 22:10:49 UTC (rev 209153)
+++ trunk/LayoutTests/ChangeLog 2016-11-30 22:21:16 UTC (rev 209154)
@@ -1,3 +1,14 @@
+2016-11-30 Joseph Pecoraro <[email protected]>
+
+ REGRESSION: inspector/sampling-profiler/* LayoutTests are flaky timeouts
+ https://bugs.webkit.org/show_bug.cgi?id=164388
+ <rdar://problem/29101555>
+
+ Reviewed by Saam Barati.
+
+ * platform/mac/TestExpectations:
+ Unskip now that tests are no longer flakey.
+
2016-11-30 Ryan Haddad <[email protected]>
Skipping crashing test js/dom/modules/module-will-fire-beforeload.html.
Modified: trunk/LayoutTests/platform/mac/TestExpectations (209153 => 209154)
--- trunk/LayoutTests/platform/mac/TestExpectations 2016-11-30 22:10:49 UTC (rev 209153)
+++ trunk/LayoutTests/platform/mac/TestExpectations 2016-11-30 22:21:16 UTC (rev 209154)
@@ -1462,6 +1462,4 @@
webkit.org/b/164277 fast/preloader/image-srcset.html [ Pass Failure ]
-webkit.org/b/164388 inspector/sampling-profiler [ Pass Timeout ]
-
webkit.org/b/161650 http/tests/cache/disk-cache/disk-cache-remove-several-pending-writes.html [ Pass Failure ]
Modified: trunk/Source/_javascript_Core/ChangeLog (209153 => 209154)
--- trunk/Source/_javascript_Core/ChangeLog 2016-11-30 22:10:49 UTC (rev 209153)
+++ trunk/Source/_javascript_Core/ChangeLog 2016-11-30 22:21:16 UTC (rev 209154)
@@ -1,3 +1,26 @@
+2016-11-30 Joseph Pecoraro <[email protected]>
+
+ REGRESSION: inspector/sampling-profiler/* LayoutTests are flaky timeouts
+ https://bugs.webkit.org/show_bug.cgi?id=164388
+ <rdar://problem/29101555>
+
+ Reviewed by Saam Barati.
+
+ There was a possibility of a deadlock between the main thread and the GC thread
+ with the SamplingProfiler lock when Inspector is processing samples to send to
+ the frontend. The Inspector (main thread) was holding the SamplingProfiler lock
+ while processing samples, which runs _javascript_ that could trigger a GC, and
+ GC then tries to acquire the SamplingProfiler lock to process unprocessed samples.
+
+ A simple solution here is to tighten the bounds of when Inspector holds the
+ SamplingProfiler lock. It only needs the lock when extracting samples from
+ the SamplingProfiler. It doesn't need to hold the lock for processing those
+ samples, which is what can run script and cause a GC.
+
+ * inspector/agents/InspectorScriptProfilerAgent.cpp:
+ (Inspector::InspectorScriptProfilerAgent::trackingComplete):
+ Tighten bounds of this lock to only where it is needed.
+
2016-11-30 Mark Lam <[email protected]>
Proxy is not allowed in the global prototype chain.
Modified: trunk/Source/_javascript_Core/inspector/agents/InspectorScriptProfilerAgent.cpp (209153 => 209154)
--- trunk/Source/_javascript_Core/inspector/agents/InspectorScriptProfilerAgent.cpp 2016-11-30 22:10:49 UTC (rev 209153)
+++ trunk/Source/_javascript_Core/inspector/agents/InspectorScriptProfilerAgent.cpp 2016-11-30 22:21:16 UTC (rev 209154)
@@ -206,13 +206,14 @@
JSLockHolder lock(m_environment.scriptDebugServer().vm());
SamplingProfiler* samplingProfiler = m_environment.scriptDebugServer().vm().samplingProfiler();
RELEASE_ASSERT(samplingProfiler);
+
LockHolder locker(samplingProfiler->getLock());
samplingProfiler->pause(locker);
Vector<SamplingProfiler::StackTrace> stackTraces = samplingProfiler->releaseStackTraces(locker);
+ locker.unlockEarly();
+
Ref<Protocol::ScriptProfiler::Samples> samples = buildSamples(m_environment.scriptDebugServer().vm(), WTFMove(stackTraces));
- locker.unlockEarly();
-
m_enabledSamplingProfiler = false;
m_frontendDispatcher->trackingComplete(WTFMove(samples));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes