[ grinder-Bugs-2703325 ] Console startup deadlock due to Java bug 6744953

SourceForge.net <[email protected]> Mon, 27 Feb 2012 05:10:45 -0800
Newsgroups gmane.comp.java.grinder.devel
Message-ID <[email protected]>
Bugs item #2703325, was opened at 2009-03-22 07:37
Message generated for change (Comment added) made by philipa
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=118598&aid=2703325&group_id=18598

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Console
Group: None
>Status: Closed
>Resolution: Works For Me
Priority: 5
Private: No
Submitted By: Philip Aston (philipa)
Assigned to: Nobody/Anonymous (nobody)
Summary: Console startup deadlock due to Java bug 6744953

Initial Comment:
Suvendu Mohapatra reports the following deadlock when trying to start the console from a particular directory. Looks like http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6744953. 

2009-03-22 19:34:04
Full thread dump Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing):

"Basic L&F File Loading Thread" prio=6 tid=0x030c1400 nid=0xab0 waiting on condition [0x03bef000..0x03befd14]
   java.lang.Thread.State: WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x22958cd8> (a java.util.concurrent.FutureTask$Sync)
	at java.util.concurrent.locks.LockSupport.park(Unknown Source)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(Unknown Source)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(Unknown Source)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(Unknown Source)
	at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
	at java.util.concurrent.FutureTask.get(Unknown Source)
	at sun.awt.shell.Win32ShellFolderManager2$ComInvoker.invoke(Unknown Source)
	at javax.swing.plaf.basic.BasicDirectoryModel$LoadFilesThread.run0(Unknown Source)
	at javax.swing.plaf.basic.BasicDirectoryModel$LoadFilesThread.run(Unknown Source)

"Swing-Shell" daemon prio=6 tid=0x030bbc00 nid=0x824 waiting for monitor entry [0x03b5f000..0x03b5fc14]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at sun.awt.shell.Win32ShellFolder2.isFileSystem(Unknown Source)
	- waiting to lock <0x22947fc0> (a sun.awt.shell.Win32ShellFolder2)
	at sun.awt.shell.Win32ShellFolder2.equals(Unknown Source)
	at java.util.AbstractList.equals(Unknown Source)
	at java.util.Vector.equals(Unknown Source)
	- locked <0x22905048> (a java.util.Vector)
	at javax.swing.plaf.basic.BasicDirectoryModel$LoadFilesThread$1.call(Unknown Source)
	at javax.swing.plaf.basic.BasicDirectoryModel$LoadFilesThread$1.call(Unknown Source)
	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at sun.awt.shell.Win32ShellFolderManager2$ComInvoker$3.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

"AWT-EventQueue-0" prio=6 tid=0x0301a800 nid=0xb48 in Object.wait() [0x03a0f000..0x03a0fa14]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x22e713a8> (a java.awt.EventQueue)
	at java.lang.Object.wait(Object.java:485)
	at java.awt.EventQueue.getNextEvent(Unknown Source)
	- locked <0x22e713a8> (a java.awt.EventQueue)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)

"AWT-Windows" daemon prio=6 tid=0x02fd3c00 nid=0xc48 runnable [0x038ff000..0x038ffb14]
   java.lang.Thread.State: RUNNABLE
	at sun.awt.windows.WToolkit.eventLoop(Native Method)
	at sun.awt.windows.WToolkit.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

"AWT-Shutdown" prio=6 tid=0x02fd3000 nid=0xf98 in Object.wait() [0x038af000..0x038afb94]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x22e71538> (a java.lang.Object)
	at java.lang.Object.wait(Object.java:485)
	at sun.awt.AWTAutoShutdown.run(Unknown Source)
	- locked <0x22e71538> (a java.lang.Object)
	at java.lang.Thread.run(Unknown Source)

"Java2D Disposer" daemon prio=10 tid=0x02fd1400 nid=0xf00 in Object.wait() [0x0385f000..0x0385fc14]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x22e715c8> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(Unknown Source)
	- locked <0x22e715c8> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(Unknown Source)
	at sun.java2d.Disposer.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

"Executor thread 2" daemon prio=6 tid=0x02fc3c00 nid=0xd08 in Object.wait() [0x037bf000..0x037bfc94]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x22e71658> (a net.grinder.util.thread.Condition)
	at java.lang.Object.wait(Object.java:485)
	at net.grinder.util.thread.ThreadSafeQueue.dequeue(ThreadSafeQueue.java:78)
	- locked <0x22e71658> (a net.grinder.util.thread.Condition)
	at net.grinder.util.thread.Executor$ExecutorRunnable.interruptibleRun(Executor.java:120)
	at net.grinder.util.thread.InterruptibleRunnableAdapter.run(InterruptibleRunnableAdapter.java:59)
	at java.lang.Thread.run(Unknown Source)

"Executor thread 1" daemon prio=6 tid=0x02fc2c00 nid=0xbfc in Object.wait() [0x0376f000..0x0376fd14]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x22e71658> (a net.grinder.util.thread.Condition)
	at java.lang.Object.wait(Object.java:485)
	at net.grinder.util.thread.ThreadSafeQueue.dequeue(ThreadSafeQueue.java:78)
	- locked <0x22e71658> (a net.grinder.util.thread.Condition)
	at net.grinder.util.thread.Executor$ExecutorRunnable.interruptibleRun(Executor.java:120)
	at net.grinder.util.thread.InterruptibleRunnableAdapter.run(InterruptibleRunnableAdapter.java:59)
	at java.lang.Thread.run(Unknown Source)

"Executor thread 0" daemon prio=6 tid=0x02fc1800 nid=0x4a4 in Object.wait() [0x0371f000..0x0371fd94]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x22e71658> (a net.grinder.util.thread.Condition)
	at java.lang.Object.wait(Object.java:485)
	at net.grinder.util.thread.ThreadSafeQueue.dequeue(ThreadSafeQueue.java:78)
	- locked <0x22e71658> (a net.grinder.util.thread.Condition)
	at net.grinder.util.thread.Executor$ExecutorRunnable.interruptibleRun(Executor.java:120)
	at net.grinder.util.thread.InterruptibleRunnableAdapter.run(InterruptibleRunnableAdapter.java:59)
	at java.lang.Thread.run(Unknown Source)

"ServerReceiver (6372, [AGENT connection type, CONSOLE_CLIENT connection type, WORKER connection type]) thread 4" daemon prio=6 tid=0x02fc0400 nid=0xd7c waiting on condition [0x036cf000..0x036cfa14]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
	at java.lang.Thread.sleep(Native Method)
	at net.grinder.communication.ServerReceiver$ServerReceiverRunnable.interruptibleRun(ServerReceiver.java:242)
	at net.grinder.util.thread.InterruptibleRunnableAdapter.run(InterruptibleRunnableAdapter.java:59)
	at java.lang.Thread.run(Unknown Source)

"ServerReceiver (6372, [AGENT connection type, CONSOLE_CLIENT connection type, WORKER connection type]) thread 3" daemon prio=6 tid=0x02fbf400 nid=0x8c4 waiting on condition [0x0367f000..0x0367fa94]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
	at java.lang.Thread.sleep(Native Method)
	at net.grinder.communication.ServerReceiver$ServerReceiverRunnable.interruptibleRun(ServerReceiver.java:242)
	at net.grinder.util.thread.InterruptibleRunnableAdapter.run(InterruptibleRunnableAdapter.java:59)
	at java.lang.Thread.run(Unknown Source)

"ServerReceiver (6372, [AGENT connection type, CONSOLE_CLIENT connection type, WORKER connection type]) thread 2" daemon prio=6 tid=0x02fbec00 nid=0xa40 waiting on condition [0x0362f000..0x0362fb14]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
	at java.lang.Thread.sleep(Native Method)
	at net.grinder.communication.ServerReceiver$ServerReceiverRunnable.interruptibleRun(ServerReceiver.java:242)
	at net.grinder.util.thread.InterruptibleRunnableAdapter.run(InterruptibleRunnableAdapter.java:59)
	at java.lang.Thread.run(Unknown Source)

"ServerReceiver (6372, [AGENT connection type, CONSOLE_CLIENT connection type, WORKER connection type]) thread 1" daemon prio=6 tid=0x02fa0000 nid=0xa20 waiting on condition [0x035df000..0x035dfb94]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
	at java.lang.Thread.sleep(Native Method)
	at net.grinder.communication.ServerReceiver$ServerReceiverRunnable.interruptibleRun(ServerReceiver.java:242)
	at net.grinder.util.thread.InterruptibleRunnableAdapter.run(InterruptibleRunnableAdapter.java:59)
	at java.lang.Thread.run(Unknown Source)

"ServerReceiver (6372, [AGENT connection type, CONSOLE_CLIENT connection type, WORKER connection type]) thread 0" daemon prio=6 tid=0x02f9a800 nid=0xc70 waiting on condition [0x0358f000..0x0358fc14]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
	at java.lang.Thread.sleep(Native Method)
	at net.grinder.communication.ServerReceiver$ServerReceiverRunnable.interruptibleRun(ServerReceiver.java:242)
	at net.grinder.util.thread.InterruptibleRunnableAdapter.run(InterruptibleRunnableAdapter.java:59)
	at java.lang.Thread.run(Unknown Source)

"Acceptor problem listener" daemon prio=6 tid=0x02f97400 nid=0x29c in Object.wait() [0x0353f000..0x0353fc94]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x22e71af0> (a net.grinder.util.thread.Condition)
	at java.lang.Object.wait(Object.java:485)
	at net.grinder.util.thread.ThreadSafeQueue.dequeue(ThreadSafeQueue.java:78)
	- locked <0x22e71af0> (a net.grinder.util.thread.Condition)
	at net.grinder.communication.Acceptor.getPendingException(Acceptor.java:183)
	at net.grinder.console.communication.ConsoleCommunicationImplementation$2.run(ConsoleCommunicationImplementation.java:176)

"Acceptor thread 0" daemon prio=6 tid=0x02fa1400 nid=0xce0 runnable [0x034ef000..0x034efd14]
   java.lang.Thread.State: RUNNABLE
	at java.net.PlainSocketImpl.socketAccept(Native Method)
	at java.net.PlainSocketImpl.accept(Unknown Source)
	- locked <0x22e71be0> (a java.net.SocksSocketImpl)
	at java.net.ServerSocket.implAccept(Unknown Source)
	at java.net.ServerSocket.accept(Unknown Source)
	at net.grinder.communication.Acceptor$AcceptorRunnable.interruptibleRun(Acceptor.java:386)
	at net.grinder.util.thread.InterruptibleRunnableAdapter.run(InterruptibleRunnableAdapter.java:59)
	at java.lang.Thread.run(Unknown Source)

"Timer-0" daemon prio=6 tid=0x02a96400 nid=0xfbc in Object.wait() [0x033ff000..0x033ffd94]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x22e1e750> (a java.util.TaskQueue)
	at java.util.TimerThread.mainLoop(Unknown Source)
	- locked <0x22e1e750> (a java.util.TaskQueue)
	at java.util.TimerThread.run(Unknown Source)

"Low Memory Detector" daemon prio=6 tid=0x02a5dc00 nid=0x918 runnable [0x00000000..0x00000000]
   java.lang.Thread.State: RUNNABLE

"CompilerThread0" daemon prio=10 tid=0x02a58400 nid=0xf20 waiting on condition [0x00000000..0x02d0f740]
   java.lang.Thread.State: RUNNABLE

"Attach Listener" daemon prio=10 tid=0x02a57000 nid=0x848 runnable [0x00000000..0x00000000]
   java.lang.Thread.State: RUNNABLE

"Signal Dispatcher" daemon prio=10 tid=0x02a56400 nid=0xcd0 waiting on condition [0x00000000..0x00000000]
   java.lang.Thread.State: RUNNABLE

"Finalizer" daemon prio=8 tid=0x02a51c00 nid=0x8c0 in Object.wait() [0x02c1f000..0x02c1fc94]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x22e0ef20> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(Unknown Source)
	- locked <0x22e0ef20> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(Unknown Source)
	at java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source)

"Reference Handler" daemon prio=10 tid=0x02a4d800 nid=0xa14 in Object.wait() [0x02bcf000..0x02bcfd14]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x22e0efa8> (a java.lang.ref.Reference$Lock)
	at java.lang.Object.wait(Object.java:485)
	at java.lang.ref.Reference$ReferenceHandler.run(Unknown Source)
	- locked <0x22e0efa8> (a java.lang.ref.Reference$Lock)

"main" prio=6 tid=0x00295c00 nid=0x7f4 waiting on condition [0x0090f000..0x0090fe54]
   java.lang.Thread.State: WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x229564c0> (a java.util.concurrent.FutureTask$Sync)
	at java.util.concurrent.locks.LockSupport.park(Unknown Source)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(Unknown Source)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(Unknown Source)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(Unknown Source)
	at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
	at java.util.concurrent.FutureTask.get(Unknown Source)
	at sun.awt.shell.Win32ShellFolderManager2$ComInvoker.invoke(Unknown Source)
	at sun.awt.shell.Win32ShellFolder2.hasAttribute(Unknown Source)
	at sun.awt.shell.Win32ShellFolder2.isLink(Unknown Source)
	- locked <0x22947fc0> (a sun.awt.shell.Win32ShellFolder2)
	at javax.swing.filechooser.FileSystemView.isFileSystem(Unknown Source)
	at javax.swing.filechooser.FileSystemView.getSystemDisplayName(Unknown Source)
	at javax.swing.plaf.basic.BasicFileChooserUI$BasicFileView.getName(Unknown Source)
	at javax.swing.JFileChooser.getName(Unknown Source)
	at sun.swing.FilePane$FileRenderer.getListCellRendererComponent(Unknown Source)
	at javax.swing.plaf.basic.BasicListUI.updateLayoutState(Unknown Source)
	at javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState(Unknown Source)
	at javax.swing.plaf.basic.BasicListUI.getCellBounds(Unknown Source)
	at javax.swing.JList.getCellBounds(Unknown Source)
	at javax.swing.JList.ensureIndexIsVisible(Unknown Source)
	at sun.swing.FilePane.ensureIndexIsVisible(Unknown Source)
	at sun.swing.FilePane.ensureFileIsVisible(Unknown Source)
	at javax.swing.plaf.metal.MetalFileChooserUI.ensureFileIsVisible(Unknown Source)
	at javax.swing.JFileChooser.ensureFileIsVisible(Unknown Source)
	at javax.swing.JFileChooser.setSelectedFile(Unknown Source)
	at net.grinder.console.swingui.ConsoleUI$ChooseDirectoryAction.<init>(ConsoleUI.java:1426)
	at net.grinder.console.swingui.ConsoleUI.<init>(ConsoleUI.java:243)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
	at java.lang.reflect.Constructor.newInstance(Unknown Source)
	at org.picocontainer.defaults.InstantiatingComponentAdapter.newInstance(InstantiatingComponentAdapter.java:193)
	at org.picocontainer.defaults.ConstructorInjectionComponentAdapter$1.run(ConstructorInjectionComponentAdapter.java:220)
	at org.picocontainer.defaults.ThreadLocalCyclicDependencyGuard.observe(ThreadLocalCyclicDependencyGuard.java:53)
	at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.getComponentInstance(ConstructorInjectionComponentAdapter.java:248)
	at org.picocontainer.defaults.DecoratingComponentAdapter.getComponentInstance(DecoratingComponentAdapter.java:60)
	at org.picocontainer.defaults.CachingComponentAdapter.getComponentInstance(CachingComponentAdapter.java:58)
	at org.picocontainer.defaults.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:393)
	at org.picocontainer.defaults.DefaultPicoContainer.getComponentInstanceOfType(DefaultPicoContainer.java:382)
	at net.grinder.console.ConsoleFoundation.createUI(ConsoleFoundation.java:173)
	at net.grinder.Console.<init>(Console.java:70)
	at net.grinder.Console.main(Console.java:92)

"VM Thread" prio=10 tid=0x02a4c400 nid=0x164 runnable 

"VM Periodic Task Thread" prio=10 tid=0x02a6f800 nid=0x91c waiting on condition 

JNI global references: 1074

Heap
 def new generation   total 960K, used 567K [0x228e0000, 0x229e0000, 0x22dc0000)
  eden space 896K,  56% used [0x228e0000, 0x2295dd30, 0x229c0000)
  from space 64K, 100% used [0x229d0000, 0x229e0000, 0x229e0000)
  to   space 64K,   0% used [0x229c0000, 0x229c0000, 0x229d0000)
 tenured generation   total 4096K, used 984K [0x22dc0000, 0x231c0000, 0x268e0000)
   the space 4096K,  24% used [0x22dc0000, 0x22eb6370, 0x22eb6400, 0x231c0000)
 compacting perm gen  total 12288K, used 1690K [0x268e0000, 0x274e0000, 0x2a8e0000)
   the space 12288K,  13% used [0x268e0000, 0x26a86828, 0x26a86a00, 0x274e0000)
    ro space 8192K,  62% used [0x2a8e0000, 0x2ade2a28, 0x2ade2c00, 0x2b0e0000)
    rw space 12288K,  52% used [0x2b0e0000, 0x2b7286b8, 0x2b728800, 0x2bce0000)



----------------------------------------------------------------------

>Comment By: Philip Aston (philipa)
Date: 2012-02-27 05:10

Message:
Closing this since the underlying JDK bug has been fixed.

I'm not worried about the initialisation being done in a non-Swing thread.
I've never seen an issue with it, and AFAICS, we'll not receive events
until we make the frame visible, which is the last step of the
initialisation.

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2009-05-13 21:57

Message:
The console initializing code should indeed be running in the EDT, which is
currently not the case?. Manipulating Swing / AWT components outside of the
EDT may cause concurrency issues because most Swing components are not
thread-safe. The bug report, on the other hand, explicitly mentions running
the sample code in the EDT, so I'm not convinced it would help in this
case.

----------------------------------------------------------------------

Comment By: Philip Aston (philipa)
Date: 2009-03-22 07:38

Message:
May be possible to workaround this by dispatching console initialisation in
the Swing thread?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=118598&aid=2703325&group_id=18598

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2