Bug 52694 - Deadlock in GUI related to non AWT Threads updating GUI
Deadlock in GUI related to non AWT Threads updating GUI
Status: RESOLVED FIXED
Product: JMeter
Classification: Unclassified
Component: Main
2.4
All All
: P2 normal (vote)
: ---
Assigned To: JMeter issues mailing list
:
: 51898 (view as bug list)
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2012-02-17 10:45 UTC by Philippe Mouawad
Modified: 2012-02-17 15:16 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Mouawad 2012-02-17 10:45:19 UTC
Found one Java-level deadlock:
=============================
"SC2 1-1":
  waiting to lock monitor 100cffda0 (object 7f017f4b0, a java.awt.Component$AWTTreeLock),
  which is held by "AWT-EventQueue-0"
"AWT-EventQueue-0":
  waiting to lock monitor 100db8608 (object 7f1319c00, a org.apache.jmeter.visualizers.ViewResultsFullVisualizer),
  which is held by "SC2 1-1"

Java stack information for the threads listed above:
===================================================
"SC2 1-1":
	at java.awt.Container.addImpl(Container.java:1032)
	- waiting to lock <7f017f4b0> (a java.awt.Component$AWTTreeLock)
	at javax.swing.CellRendererPane.addImpl(CellRendererPane.java:89)
	at java.awt.Container.add(Container.java:365)
	at javax.swing.plaf.basic.BasicTreeUI$NodeDimensionsHandler.getNodeDimensions(BasicTreeUI.java:2718)
	at javax.swing.tree.AbstractLayoutCache.getNodeDimensions(AbstractLayoutCache.java:475)
	at javax.swing.tree.VariableHeightLayoutCache$TreeStateNode.updatePreferredSize(VariableHeightLayoutCache.java:1342)
	at javax.swing.tree.VariableHeightLayoutCache.createNodeAt(VariableHeightLayoutCache.java:764)
	at javax.swing.tree.VariableHeightLayoutCache.treeNodesInserted(VariableHeightLayoutCache.java:473)
	at javax.swing.plaf.basic.BasicTreeUI$Handler.treeNodesInserted(BasicTreeUI.java:3785)
	at javax.swing.tree.DefaultTreeModel.fireTreeNodesInserted(DefaultTreeModel.java:499)
	at javax.swing.tree.DefaultTreeModel.nodesWereInserted(DefaultTreeModel.java:296)
	at javax.swing.tree.DefaultTreeModel.insertNodeInto(DefaultTreeModel.java:223)
	at org.apache.jmeter.visualizers.ViewResultsFullVisualizer.updateGui(ViewResultsFullVisualizer.java:135)
	- locked <7f1319c00> (a org.apache.jmeter.visualizers.ViewResultsFullVisualizer)
	at org.apache.jmeter.visualizers.ViewResultsFullVisualizer.add(ViewResultsFullVisualizer.java:126)
	at org.apache.jmeter.reporters.ResultCollector.sendToVisualizer(ResultCollector.java:519)
	at org.apache.jmeter.reporters.ResultCollector.sampleOccurred(ResultCollector.java:495)
	at org.apache.jmeter.threads.ListenerNotifier.notifyListeners(ListenerNotifier.java:84)
	at org.apache.jmeter.threads.JMeterThread.notifyListeners(JMeterThread.java:777)
	at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:445)
	at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:271)
	at java.lang.Thread.run(Thread.java:680)
"AWT-EventQueue-0":
	at java.awt.Component.addComponentListener(Component.java)
	- waiting to lock <7f1319c00> (a org.apache.jmeter.visualizers.ViewResultsFullVisualizer)
	at javax.swing.AncestorNotifier.addListeners(AncestorNotifier.java:128)
	at javax.swing.AncestorNotifier.propertyChange(AncestorNotifier.java:203)
	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
	at java.awt.Component.firePropertyChange(Component.java:8239)
	at javax.swing.JComponent.addNotify(JComponent.java:4686)
	at java.awt.Container.addNotify(Container.java:2622)
	- locked <7f017f4b0> (a java.awt.Component$AWTTreeLock)
	at javax.swing.JComponent.addNotify(JComponent.java:4685)
	at java.awt.Container.addNotify(Container.java:2622)
	- locked <7f017f4b0> (a java.awt.Component$AWTTreeLock)
	at javax.swing.JComponent.addNotify(JComponent.java:4685)
	at java.awt.Container.addNotify(Container.java:2622)
	- locked <7f017f4b0> (a java.awt.Component$AWTTreeLock)
	at javax.swing.JComponent.addNotify(JComponent.java:4685)
	at java.awt.Container.addImpl(Container.java:1068)
	- locked <7f017f4b0> (a java.awt.Component$AWTTreeLock)
	at javax.swing.JTabbedPane.insertTab(JTabbedPane.java:703)
	at javax.swing.JTabbedPane.addTab(JTabbedPane.java:777)
	at org.apache.jmeter.visualizers.SamplerResultTab.setupTabPaneForSampleResult(SamplerResultTab.java:342)
	at org.apache.jmeter.visualizers.SamplerResultTab.setupTabPane(SamplerResultTab.java:217)
	at org.apache.jmeter.visualizers.ViewResultsFullVisualizer.valueChanged(ViewResultsFullVisualizer.java:235)
	at javax.swing.JTree.fireValueChanged(JTree.java:2820)
	at javax.swing.JTree$TreeSelectionRedirector.valueChanged(JTree.java:3191)
	at javax.swing.tree.DefaultTreeSelectionModel.fireValueChanged(DefaultTreeSelectionModel.java:629)
	at javax.swing.tree.DefaultTreeSelectionModel.notifyPathChange(DefaultTreeSelectionModel.java:1078)
	at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPaths(DefaultTreeSelectionModel.java:287)
	at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPath(DefaultTreeSelectionModel.java:170)
	at javax.swing.JTree.setSelectionPath(JTree.java:1598)
	at javax.swing.plaf.basic.BasicTreeUI.selectPathForEvent(BasicTreeUI.java:2311)
	at javax.swing.plaf.basic.BasicTreeUI$Handler.handleSelection(BasicTreeUI.java:3520)
	at javax.swing.plaf.basic.BasicTreeUI$Handler.mousePressed(BasicTreeUI.java:3459)
	at java.awt.Component.processMouseEvent(Component.java:6370)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
	at java.awt.Component.processEvent(Component.java:6138)
	at java.awt.Container.processEvent(Container.java:2085)
	at java.awt.Component.dispatchEventImpl(Component.java:4735)
	at java.awt.Container.dispatchEventImpl(Container.java:2143)
	at java.awt.Component.dispatchEvent(Component.java:4565)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4621)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4279)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4212)
	at java.awt.Container.dispatchEventImpl(Container.java:2129)
	at java.awt.Window.dispatchEventImpl(Window.java:2478)
	at java.awt.Component.dispatchEvent(Component.java:4565)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:679)
	at java.awt.EventQueue.access$000(EventQueue.java:85)
	at java.awt.EventQueue$1.run(EventQueue.java:638)
	at java.awt.EventQueue$1.run(EventQueue.java:636)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
	at java.awt.EventQueue$2.run(EventQueue.java:652)
	at java.awt.EventQueue$2.run(EventQueue.java:650)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:649)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Found 1 deadlock.
Comment 1 Philippe Mouawad 2012-02-17 10:45:48 UTC
Issue present in versions from 2.4 (at least) up to 2.6
Comment 2 Philippe Mouawad 2012-02-17 10:51:34 UTC
To reproduce:
- Put a breakpoint in 
ViewResultsFullVisualizer#add(final SampleResult sample)
- Start a Test 
- Let one thread stopped at debug point enter updateGui
- Navigate to Tree Results

=> You get the lock.
Comment 3 Philippe Mouawad 2012-02-17 15:01:53 UTC
*** Bug 51898 has been marked as a duplicate of this bug. ***
Comment 4 Philippe Mouawad 2012-02-17 15:16:16 UTC
Date: Fri Feb 17 15:15:33 2012
New Revision: 1245602

URL: http://svn.apache.org/viewvc?rev=1245602&view=rev
Log:
Bug 52694 - Deadlock in GUI related to non AWT Threads updating GUI

Modified:
   jmeter/trunk/src/components/org/apache/jmeter/visualizers/AssertionVisualizer.java
   jmeter/trunk/src/components/org/apache/jmeter/visualizers/ComparisonVisualizer.java
   jmeter/trunk/src/components/org/apache/jmeter/visualizers/DistributionGraphVisualizer.java
   jmeter/trunk/src/components/org/apache/jmeter/visualizers/GraphVisualizer.java
   jmeter/trunk/src/components/org/apache/jmeter/visualizers/MailerVisualizer.java
   jmeter/trunk/src/components/org/apache/jmeter/visualizers/SplineVisualizer.java
   jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatGraphVisualizer.java
   jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatVisualizer.java
   jmeter/trunk/src/components/org/apache/jmeter/visualizers/SummaryReport.java
   jmeter/trunk/src/components/org/apache/jmeter/visualizers/TableVisualizer.java
   jmeter/trunk/src/components/org/apache/jmeter/visualizers/ViewResultsFullVisualizer.java
   jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java
   jmeter/trunk/src/core/org/apache/jmeter/visualizers/SamplingStatCalculator.java
   jmeter/trunk/xdocs/changes.xml