aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes Thread Hangs at SocketInputStream.read0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Thread Hangs at SocketInputStream.read0 " Watch "Thread Hangs at SocketInputStream.read0 " New topic
Author

Thread Hangs at SocketInputStream.read0

Ivanovich Starover
Greenhorn

Joined: May 31, 2010
Posts: 1
Hello everybody
In my porgram I use JMXConnector to control remote java objects.
And sometimes I have thread hanging by calling to method connect() of my JMXConnector instance.
I have tracked this by JStack and got the the following thread stacktrace :


"Job_Executor4" daemon prio=6 tid=0x19cf3000 nid=0x5e0 in Object.wait() [0x1a10f000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x04bd00f8> (a com.sun.jmx.remote.opt.internal.ArrayNotificationBuffer)
at com.sun.jmx.remote.opt.internal.ArrayNotificationBuffer.fetchNotifications(ArrayNotificationBuffer.java:375)
- locked <0x04bd00f8> (a com.sun.jmx.remote.opt.internal.ArrayNotificationBuffer)
at com.sun.jmx.remote.opt.internal.ArrayNotificationBuffer$ShareBuffer.fetchNotifications(ArrayNotificationBuffer.java:154)
at com.sun.jmx.remote.opt.internal.ServerNotifForwarder.fetchNotifs(ServerNotifForwarder.java:169)
at javax.management.remote.generic.ServerIntermediary$RequestHandler.handleNotifReqMessage(ServerIntermediary.java:679)
at javax.management.remote.generic.ServerIntermediary$RequestHandler.execute(ServerIntermediary.java:626)
at com.sun.jmx.remote.generic.ServerSynchroMessageConnectionImpl$RemoteJob.run(ServerSynchroMessageConnectionImpl.java:249)
at com.sun.jmx.remote.opt.util.ThreadService$ThreadServiceJob.run(ThreadService.java:208)
at com.sun.jmx.remote.opt.util.JobExecutor.run(JobExecutor.java:59)

"Stream Cleaner Thread - xes-sample" daemon prio=6 tid=0x18ea3400 nid=0xa60 waiting on condition [0x1b51f000]
java.lang.Thread.State: TIMED_WAITING (sleeping)
at java.lang.Thread.sleep(Native Method)
at com.mycompany.etools.xeserver.starter.XESStarter$ProcessStreamCleaner.run(XESStarter.java:349)

"Job_Executor3" daemon prio=6 tid=0x18e17800 nid=0xa24 in Object.wait() [0x1b2df000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x0a22aab0> (a [I)
at com.sun.jmx.remote.opt.util.ThreadService$ThreadServiceJob.run(ThreadService.java:144)
- locked <0x0a22aab0> (a [I)
at com.sun.jmx.remote.opt.util.JobExecutor.run(JobExecutor.java:59)

"Job_Executor2" daemon prio=6 tid=0x1a28a800 nid=0x1380 runnable [0x1b24f000]
java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(Unknown Source)
at com.sun.net.ssl.internal.ssl.InputRecord.readFully(Unknown Source)
at com.sun.net.ssl.internal.ssl.InputRecord.read(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
- locked <0x0a22ec60> (a java.lang.Object)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)
- locked <0x0a22ecf0> (a com.sun.net.ssl.internal.ssl.AppInputStream)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
- locked <0x0a230d18> (a java.io.BufferedInputStream)
at java.io.ObjectInputStream$PeekInputStream.peek(Unknown Source)
at java.io.ObjectInputStream$BlockDataInputStream.peek(Unknown Source)
at java.io.ObjectInputStream$BlockDataInputStream.peekByte(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at com.sun.jmx.remote.socket.SocketConnection.readMessage(SocketConnection.java:211)
at com.sun.jmx.remote.generic.ServerSynchroMessageConnectionImpl$MessageReader.run(ServerSynchroMessageConnectionImpl.java:168)
at com.sun.jmx.remote.opt.util.ThreadService$ThreadServiceJob.run(ThreadService.java:208)
at com.sun.jmx.remote.opt.util.JobExecutor.run(JobExecutor.java:59)

"Job_Executor1" daemon prio=6 tid=0x1a28a400 nid=0xe40 waiting on condition [0x1b1bf000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0a0fa898> (a java.util.concurrent.Semaphore$NonfairSync)
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.Semaphore.acquire(Unknown Source)
at com.mycompany.eam.modules.xesmanager.mbean.RTSystemSrv.getStatus(RTSystemSrv.java:243)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(Unknown Source)
at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(Unknown Source)
at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(Unknown Source)
at com.sun.jmx.mbeanserver.PerInterface.getAttribute(Unknown Source)
at com.sun.jmx.mbeanserver.MBeanSupport.getAttribute(Unknown Source)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttribute(Unknown Source)
at com.sun.jmx.mbeanserver.JmxMBeanServer.getAttribute(Unknown Source)
at javax.management.remote.generic.ServerIntermediary.handleRequest(ServerIntermediary.java:222)
at javax.management.remote.generic.ServerIntermediary$PrivilegedRequestJob.run(ServerIntermediary.java:951)
at java.security.AccessController.doPrivileged(Native Method)
at javax.management.remote.generic.ServerIntermediary$RequestHandler.handleMBSReqMessage(ServerIntermediary.java:727)
at javax.management.remote.generic.ServerIntermediary$RequestHandler.execute(ServerIntermediary.java:629)
at com.sun.jmx.remote.generic.ServerSynchroMessageConnectionImpl$RemoteJob.run(ServerSynchroMessageConnectionImpl.java:249)
at com.sun.jmx.remote.opt.util.ThreadService$ThreadServiceJob.run(ThreadService.java:208)
at com.sun.jmx.remote.opt.util.JobExecutor.run(JobExecutor.java:59)

"Thread-7" daemon prio=6 tid=0x1a289c00 nid=0x40c in Object.wait() [0x003cf000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x0a230e58> (a [I)
at com.sun.jmx.remote.opt.internal.ServerCommunicatorAdmin$Adminor.run(ServerCommunicatorAdmin.java:145)
- locked <0x0a230e58> (a [I)
at java.lang.Thread.run(Unknown Source)

"Job_Executor0" daemon prio=6 tid=0x1a357800 nid=0x10e8 runnable [0x002ee000]
java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(Unknown Source)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read1(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
- locked <0x04bd2368> (a java.io.BufferedInputStream)
at java.io.ObjectInputStream$PeekInputStream.read(Unknown Source)
at java.io.ObjectInputStream$PeekInputStream.readFully(Unknown Source)
at java.io.ObjectInputStream$BlockDataInputStream.readShort(Unknown Source)
at java.io.ObjectInputStream.readStreamHeader(Unknown Source)
at java.io.ObjectInputStream.<init>(Unknown Source)
at com.sun.jmx.remote.socket.SocketConnection$ObjectInputStreamWithLoader.<init>(SocketConnection.java:354)
at com.sun.jmx.remote.socket.SocketConnection.readMessage(SocketConnection.java:204)
at com.sun.jmx.remote.opt.security.AdminClient.connectionOpen(AdminClient.java:57)
at com.sun.jmx.remote.generic.ClientSynchroMessageConnectionImpl.connect(ClientSynchroMessageConnectionImpl.java:71)
- locked <0x04bd2870> (a [I)
at javax.management.remote.generic.GenericConnector.connect(GenericConnector.java:177)
- locked <0x04bd2928> (a [I)
at javax.management.remote.jmxmp.JMXMPConnector.connect(JMXMPConnector.java:119)
at javax.management.remote.generic.GenericConnector.connect(GenericConnector.java:124)
at com.mycompany.eam.modules.xesmanager.mbean.ProfileSrv.connect(ProfileSrv.java:316)
- locked <0x0a0ecec0> (a com.mycompany.eam.modules.xesmanager.mbean.ProfileSrv)
at com.mycompany.eam.modules.xesmanager.mbean.ProfileSrv.startConnection(ProfileSrv.java:340)
- locked <0x0a0ecec0> (a com.mycompany.eam.modules.xesmanager.mbean.ProfileSrv)
at com.mycompany.eam.modules.xesmanager.mbean.ProfileSrv.start(ProfileSrv.java:372)
at com.mycompany.eam.modules.xesmanager.mbean.RTSystemSrv.execute(RTSystemSrv.java:118)
at com.mycompany.eam.modules.xesmanager.mbean.ProfileSrv.execute(ProfileSrv.java:151)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(Unknown Source)
at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(Unknown Source)
at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(Unknown Source)
at com.sun.jmx.mbeanserver.PerInterface.invoke(Unknown Source)
at com.sun.jmx.mbeanserver.MBeanSupport.invoke(Unknown Source)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(Unknown Source)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(Unknown Source)
at javax.management.remote.generic.ServerIntermediary.handleRequest(ServerIntermediary.java:280)
at javax.management.remote.generic.ServerIntermediary$PrivilegedRequestJob.run(ServerIntermediary.java:951)
at java.security.AccessController.doPrivileged(Native Method)
at javax.management.remote.generic.ServerIntermediary$RequestHandler.handleMBSReqMessage(ServerIntermediary.java:727)
at javax.management.remote.generic.ServerIntermediary$RequestHandler.execute(ServerIntermediary.java:629)
at com.sun.jmx.remote.generic.ServerSynchroMessageConnectionImpl$RemoteJob.run(ServerSynchroMessageConnectionImpl.java:249)
at com.sun.jmx.remote.opt.util.ThreadService$ThreadServiceJob.run(ThreadService.java:208)
at com.sun.jmx.remote.opt.util.JobExecutor.run(JobExecutor.java:59)

"Thread-6" daemon prio=6 tid=0x19cf3c00 nid=0xfb8 waiting on condition [0x1a15f000]
java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x09e28140> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(Unknown Source)
at java.util.concurrent.DelayQueue.take(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

"Thread-4" daemon prio=6 tid=0x19cf1400 nid=0x83c waiting on condition [0x197ff000]
java.lang.Thread.State: TIMED_WAITING (sleeping)
at java.lang.Thread.sleep(Native Method)
at com.mycompany.eam.modules.xesmanager.mbean.ProfileSrv$AutoReconnect.run(ProfileSrv.java:402)
at java.lang.Thread.run(Unknown Source)

"Thread-3" daemon prio=6 tid=0x19cf8000 nid=0xd60 waiting on condition [0x1976f000]
java.lang.Thread.State: TIMED_WAITING (sleeping)
at java.lang.Thread.sleep(Native Method)
at com.mycompany.eam.modules.xesmanager.mbean.ProfileSrv$AutoReconnect.run(ProfileSrv.java:402)
at java.lang.Thread.run(Unknown Source)

"Thread-1" prio=6 tid=0x19040000 nid=0xf5c runnable [0x1971f000]
java.lang.Thread.State: RUNNABLE
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(Unknown Source)
- locked <0x09dd5420> (a java.net.SocksSocketImpl)
at java.net.ServerSocket.implAccept(Unknown Source)
at java.net.ServerSocket.accept(Unknown Source)
at com.sun.jmx.remote.socket.SocketConnectionServer.accept(SocketConnectionServer.java:173)
at com.sun.jmx.remote.generic.SynchroMessageConnectionServerImpl.accept(SynchroMessageConnectionServerImpl.java:47)
at javax.management.remote.generic.GenericConnectorServer$Receiver.run(GenericConnectorServer.java:334)

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

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

"JDWP Event Helper Thread" daemon prio=6 tid=0x0262f000 nid=0x4f8 runnable [0x00000000]
java.lang.Thread.State: RUNNABLE

"JDWP Transport Listener: dt_socket" daemon prio=6 tid=0x02623c00 nid=0xc80 runnable [0x00000000]
java.lang.Thread.State: RUNNABLE

"Attach Listener" daemon prio=10 tid=0x0261c800 nid=0x968 waiting on condition [0x00000000]
java.lang.Thread.State: RUNNABLE

"Finalizer" daemon prio=8 tid=0x025db800 nid=0x1038 in Object.wait() [0x1895f000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x09c9f6d8> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(Unknown Source)
- locked <0x09c9f6d8> (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=0x025da000 nid=0xf80 in Object.wait() [0x188cf000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x09c9f6f8> (a java.lang.ref.Reference$Lock)
at java.lang.Object.wait(Object.java:485)
at java.lang.ref.Reference$ReferenceHandler.run(Unknown Source)
- locked <0x09c9f6f8> (a java.lang.ref.Reference$Lock)

"main" prio=6 tid=0x00e2b000 nid=0x11bc in Object.wait() [0x00d7f000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x09cae358> (a EDU.oswego.cs.dl.util.concurrent.Mutex)
at java.lang.Object.wait(Object.java:485)
at EDU.oswego.cs.dl.util.concurrent.Mutex.acquire(Unknown Source)
- locked <0x09cae358> (a EDU.oswego.cs.dl.util.concurrent.Mutex)
at com.mycompany.eam.server.EAMServer.waitForStop(EAMServer.java:521)
at com.mycompany.eam.server.EAMServer.main(EAMServer.java:632)

"VM Thread" prio=10 tid=0x025d7000 nid=0x100c runnable

"VM Periodic Task Thread" prio=10 tid=0x02644c00 nid=0x13dc waiting on condition

JNI global references: 3078

So no deadlocks detected.
I really don't know what's the problem... Please help.

Thanks in advance.
 
jQuery in Action, 2nd edition
 
subject: Thread Hangs at SocketInputStream.read0