powered by Jive Software

Another thread dump

Sorry for all this thread dump stuff, but the app locked up again, and this time the thread dump doesn’'t even mention the JBother source.

Full thread dump Java HotSpot™ Client VM (1.5.0_04-b05 mixed mode, sharing):

“Smack Listener Processor” daemon prio=1 tid=0x0849b658 nid=0x499b sleeping[0xb10c7000…0xb10c74c0]

at java.lang.Thread.sleep(Native Method)

at org.jivesoftware.smack.PacketReader.processListeners(PacketReader.java:253)

at org.jivesoftware.smack.PacketReader.access$100(PacketReader.java:42)

at org.jivesoftware.smack.PacketReader$2.run(PacketReader.java:71)

“Smack Packet Reader” daemon prio=1 tid=0x0849a790 nid=0x499a runnable

at java.net.SocketInputStream.socketRead0(Native Method)

at java.net.SocketInputStream.read(SocketInputStream.java:129)

at com.sun.net.ssl.internal.ssl.InputRecord.readFully(InputRecord.java:284)

at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:319)

at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:720)

  • locked <0x89183110> (a java.lang.Object)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:67 7)
    at com.sun.net.ssl.internal.ssl.AppInputStream.read(AppInputStream.java:75)
  • locked <0x89183198> (a com.sun.net.ssl.internal.ssl.AppInputStream)
    at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:411)
    at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:453)
    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:183)
  • locked <0x891831d8> (a java.io.InputStreamReader)
    at java.io.InputStreamReader.read(InputStreamReader.java:167)
    at java.io.BufferedReader.fill(BufferedReader.java:136)
    at java.io.BufferedReader.read1(BufferedReader.java:187)
    at java.io.BufferedReader.read(BufferedReader.java:261)
  • locked <0x891831d8> (a java.io.InputStreamReader)

at org.xmlpull.mxp1.MXParser.fillBuf(MXParser.java:2971)

at org.xmlpull.mxp1.MXParser.more(MXParser.java:3025)

at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1144)

at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093)

at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:337)

at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:42)

at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:62)

“Smack Writer Listener Processor” daemon prio=1 tid=0x08499940 nid=0x4999 in Object.wait()

at java.lang.Object.wait(Native Method)

  • waiting on <0x8910cf20> (a java.util.LinkedList)
    at org.jivesoftware.smack.PacketWriter.processListeners(PacketWriter.java:236)
  • locked <0x8910cf20> (a java.util.LinkedList)

at org.jivesoftware.smack.PacketWriter.access$100(PacketWriter.java:34)

at org.jivesoftware.smack.PacketWriter$2.run(PacketWriter.java:67)

“Smack Packet Writer” daemon prio=1 tid=0x08499558 nid=0x4998 in Object.wait()

at java.lang.Object.wait(Native Method)

  • waiting on <0x8910cfc0> (a java.util.LinkedList)
    at org.jivesoftware.smack.PacketWriter.nextPacket(PacketWriter.java:178) - locked <0x8910cfc0> (a java.util.LinkedList)

at org.jivesoftware.smack.PacketWriter.writePackets(PacketWriter.java:197)

at org.jivesoftware.smack.PacketWriter.access$000(PacketWriter.java:34)

at org.jivesoftware.smack.PacketWriter$1.run(PacketWriter.java:59)

“Thread-8” daemon prio=1 tid=0x08493a38 nid=0x4997 waiting on condition

at java.lang.Thread.sleep(Native Method)

at org.jivesoftware.smack.PacketWriter$KeepAliveTask.run(PacketWriter.java:349)

at java.lang.Thread.run(Thread.java:595)

“DestroyJavaVM” prio=1 tid=0x0805b580 nid=0x497a waiting on condition

“TimerQueue” daemon prio=1 tid=0x081de0d8 nid=0x4986 waiting for monitor entry

at java.awt.EventQueue.postEventPrivate(EventQueue.java:189)

  • waiting to lock <0x89014f10> (a java.awt.EventQueue)
    at java.awt.EventQueue.postEvent(EventQueue.java:175)
    at java.awt.EventQueue.invokeLater(EventQueue.java:809)
    at javax.swing.SwingUtilities.invokeLater(SwingUtilities.java:1198)
    at javax.swing.Timer.post(Timer.java:538)
  • locked <0x890e1748> (a javax.swing.Timer)
    at javax.swing.TimerQueue.postExpiredTimers(TimerQueue.java:195)
  • locked <0x89049860> (a javax.swing.TimerQueue)
    at javax.swing.TimerQueue.run(TimerQueue.java:231)
  • locked <0x89049860> (a javax.swing.TimerQueue)

at java.lang.Thread.run(Thread.java:595)

“AWT-EventQueue-1” prio=1 tid=0x081a4550 nid=0x4985 in Object.wait()

at java.lang.Object.wait(Native Method)

at java.lang.Object.wait(Object.java:474)

at java.awt.EventQueue.getNextEvent(EventQueue.java:345)

  • locked <0x89014f10> (a java.awt.EventQueue)

at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java: 189)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:16 3)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149) at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

“AWT-Shutdown” prio=1 tid=0x081a3f10 nid=0x4984 in Object.wait()

at java.lang.Object.wait(Native Method)

  • waiting on <0x89018850> (a java.lang.Object)
    at java.lang.Object.wait(Object.java:474)
    at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:259)
  • locked <0x89018850> (a java.lang.Object)

at java.lang.Thread.run(Thread.java:595)

“AWT-XAWT” daemon prio=1 tid=0x08199788 nid=0x4983 runnable

at sun.awt.X11.XToolkit.waitForEvents(Native Method)

at sun.awt.X11.XToolkit.run(XToolkit.java:463)

at sun.awt.X11.XToolkit.run(XToolkit.java:438)

at java.lang.Thread.run(Thread.java:595)

“Java2D Disposer” daemon prio=1 tid=0x0818dec8 nid=0x4982 in Object.wait()

at java.lang.Object.wait(Native Method)

at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)

  • locked <0x89018988> (a java.lang.ref.ReferenceQueue$Lock)

at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)

at sun.java2d.Disposer.run(Disposer.java:107)

at java.lang.Thread.run(Thread.java:595)

“Low Memory Detector” daemon prio=1 tid=0x080a27a0 nid=0x4980 runnable

“CompilerThread0” daemon prio=1 tid=0x080a1250 nid=0x497f waiting on condition

“Signal Dispatcher” daemon prio=1 tid=0x080a02d8 nid=0x497e runnable

“Finalizer” daemon prio=1 tid=0x08099698 nid=0x497d in Object.wait()

at java.lang.Object.wait(Native Method)

at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)

  • locked <0x88fec8c8> (a java.lang.ref.ReferenceQueue$Lock)

at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)

at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)

“Reference Handler” daemon prio=1 tid=0x080989a8 nid=0x497c in Object.wait()

at java.lang.Object.wait(Native Method)

at java.lang.Object.wait(Object.java:474)

at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)

  • locked <0x88fec948> (a java.lang.ref.Reference$Lock)

“VM Thread” prio=1 tid=0x08095ed8 nid=0x497b runnable

“VM Periodic Task Thread” prio=1 tid=0x080bd528 nid=0x4981 waiting on condition

/code

I’'ve had another smack user contact me via email saying that they have the same problem with their app wondering if I had a solution. Does this still look like the Java bug that was mentioned before?

Adam

Hey Adam,

I don’'t see any Smack code that is involved in this problem. The suspicious thing is that the “TimerQueue” thread is waiting to obtain a lock on an object that is locked by “AWT-EventQueue-1” and “AWT-EventQueue-1” is also waiting in a wait[/i] so the locked object will remain locked until “AWT-EventQueue-1” receives a notify.

In other words, the “TimerQueue” thread is blocked by “AWT-EventQueue-1” and “AWT-EventQueue-1” is freezed until an Event is received. Is this the problem?

Regards,

– Gato

I’'ve seen this.

The BufferedReader is synchronized and you can’'t close it while a read is in progress.

The fix:

In XMPPConnection.close():

// Close down the readers and writers.

if (reader != null) {

// The reader is synchronized!

// If we try to close() while a read is in progress, we deadlock.

// We’'ll be OK if we comment this out.

//try { reader.close(); } catch (Throwable ignore) { }

reader = null;

}

Hey John,

I don’'t see any close operation in the thread dump. Am I missing something?

Can you provide a thread dump of the problem you had with XMPPConnection.close()?

Thanks,

– Gato

Gato,

Looks like it might be a problem with JEditorPane. I’'ve completely switched to JTextPane because JEditorPane is painfully slow, and the lockups have ceased!

Thanks for your help,

Adam

Glad to hear that things are working fine now.

Regards,

– Gato