powered by Jive Software

Can anyone help me decipher this?

Ever since I upgraded to Java 1.5, JBother has been locking up occasionally. Here is a thread dump… I’'m not sure where the culprit is.

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

“Thread-20” prio=1 tid=0xb0e05eb0 nid=0x5412 runnable

at org.jdesktop.jdic.tray.internal.impl.GnomeSystemTrayService.eventLoop(Native Method)

at org.jdesktop.jdic.tray.internal.impl.GnomeSystemTrayService$1.run(GnomeSystemTr ayService.java:82)

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

“Smack Listener Processor” daemon prio=1 tid=0x080722a0 nid=0x50e4 waiting for monitor entry

at javax.swing.TimerQueue.containsTimer(TimerQueue.java:169)

  • waiting to lock <0x890f72c8> (a javax.swing.TimerQueue)

at javax.swing.Timer.isRunning(Timer.java:497)

at com.valhalla.jbother.ConversationArea.append(ConversationArea.java:207)

at com.valhalla.jbother.groupchat.ChatRoomPanel.serverNoticeMessage(ChatRoomPanel. java:1074)

at com.valhalla.jbother.groupchat.StatusListener.voiceRevoked(StatusListener.java: 116)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at org.jivesoftware.smackx.muc.MultiUserChat.fireParticipantStatusListeners(MultiU serChat.java:1996)

at org.jivesoftware.smackx.muc.MultiUserChat.checkRoleModifications(MultiUserChat. java:2187)

at org.jivesoftware.smackx.muc.MultiUserChat.access$700(MultiUserChat.java:45)

at org.jivesoftware.smackx.muc.MultiUserChat$6.processPacket(MultiUserChat.java:20 71)

at org.jivesoftware.smack.PacketReader$ListenerWrapper.notifyListener(PacketReader .java:579)

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

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

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

“Smack Packet Reader” daemon prio=1 tid=0x0852c230 nid=0x50e3 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 <0x89353a00> (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 <0x89353a88> (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 <0x89357ad8> (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 <0x89357ad8> (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:297)

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

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

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

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

at org.jivesoftware.smack.PacketWriter.processListeners(PacketWriter.java:239)

  • locked <0x89357b80> (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=0x08530800 nid=0x50e1 in Object.wait()

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

at org.jivesoftware.smack.PacketWriter.nextPacket(PacketWriter.java:174) - locked <0x89357c20> (a java.util.LinkedList)

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

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=0x0852d1c0 nid=0x50e0 waiting on condition

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

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

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

“DestroyJavaVM” prio=1 tid=0x0805b258 nid=0x50c3 waiting on condition

“TimerQueue” daemon prio=1 tid=0x083c7378 nid=0x50cf waiting for monitor entry

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

  • waiting to lock <0x89094970> (a com.valhalla.jbother.EventProcessor)
    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 <0x892d0250> (a javax.swing.Timer)
    at javax.swing.TimerQueue.postExpiredTimers(TimerQueue.java:195)
  • locked <0x890f72c8> (a javax.swing.TimerQueue)
    at javax.swing.TimerQueue.run(TimerQueue.java:231)
  • locked <0x890f72c8> (a javax.swing.TimerQueue)

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

“AWT-EventQueue-0” prio=1 tid=0x083b3530 nid=0x50ce 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 <0x89094970> (a com.valhalla.jbother.EventProcessor)

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=0x083b2fb8 nid=0x50cd in Object.wait()

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

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

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

“AWT-XAWT” daemon prio=1 tid=0x083ae300 nid=0x50cc 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=0x083a3690 nid=0x50cb in Object.wait()

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

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

  • locked <0x890ac088> (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=0x080a0720 nid=0x50c9 runnable

“CompilerThread0” daemon prio=1 tid=0x0809f1d0 nid=0x50c8 waiting on condition

“Signal Dispatcher” daemon prio=1 tid=0x0809e280 nid=0x50c7 runnable

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

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

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

  • locked <0x88fbb7f8> (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=0x08098950 nid=0x50c5 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 <0x88fbb878> (a java.lang.ref.Reference$Lock)

“VM Thread” prio=1 tid=0x08095e80 nid=0x50c4 runnable

“VM Periodic Task Thread” prio=1 tid=0x080bb4a8 nid=0x50ca waiting on condition

/code

Hey Adam,

This is not a Smack issue but since I love analyzing thread dumps I’'m going to jump into this one.

So this is the problem:

Thread: 0x080722a0 is waiting to obtain a lock on 0x890f72c8

Thread: 0x083c7378 locked 0x890f72c8 and is waiting to obtain a lock on 0x89094970

Thread: 0x083b3530 locked 0x89094970 and is waiting for an awt event

In summary, the third thread is what is causing the overall system lock. You will need to modify the logic in your application regarding locks (ie. synchronization).

BTW, as you may know Smack now has support for JEP-13 Flexible Offline Message Retrieval so you may want to include that new functionality into JBother. JM 2.2 has official support so you can test it with our server.

Regards,

– Gato

Well, I possibly tracked it down… but it’‘s tough. It doesn’'t happen at all on my amd64 machine, and happens very randomly on my home machine (I can leave JBother running for 3 days before it happens).

Anyway, thanks for the info.

Here’'s another dump that looks a bit different:

“Smack Listener Processor” daemon prio=1 tid=0x0855dbd0 nid=0x4ac waiting on con dition

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

at org.jivesoftware.smack.PacketReader.processListeners(PacketReader.jav a:243)

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

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

“Smack Packet Reader” daemon prio=1 tid=0x0855d250 nid=0x4ac runnable

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

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

at com.sun.net.ssl.internal.ssl.InputRecord.a(DashoA12275)

at com.sun.net.ssl.internal.ssl.InputRecord.read(DashoA12275)

at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)

  • locked <0xac201f40> (a java.lang.Object)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
    at com.sun.net.ssl.internal.ssl.AppInputStream.read(DashoA12275)
  • locked <0xac201f50> (a com.sun.net.ssl.internal.ssl.AppInputStream)
    at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:408)
    at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:450)
    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:182)
  • locked <0xac213c80> (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 <0xac213c80> (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:29 5)

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

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

“Smack Writer Listener Processor” daemon prio=1 tid=0x0855cf28 nid=0x4ac in Obje ct.wait()

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

at org.jivesoftware.smack.PacketWriter.processListeners(PacketWriter.jav a:239)

  • locked <0xac213ff8> (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=0x085612f8 nid=0x4ac in Object.wait()

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

at org.jivesoftware.smack.PacketWriter.nextPacket(PacketWriter.java:174)

  • locked <0xac214080> (a java.util.LinkedList)

at org.jivesoftware.smack.PacketWriter.writePackets(PacketWriter.java:20 0)

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

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

“Thread-23” daemon prio=1 tid=0x0855c4f8 nid=0x4ac waiting on condition

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

at org.jivesoftware.smack.PacketWriter$KeepAliveTask.run(PacketWriter.ja va:334)

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

“DestroyJavaVM” prio=1 tid=0x0831e180 nid=0x4ac waiting on condition

“TimerQueue” daemon prio=1 tid=0xaa700aa0 nid=0x4ac waiting for monitor entry

at sun.awt.AppContext.get(AppContext.java:542)

  • waiting to lock <0xabe643f8> (a java.util.HashMap)
    at sun.awt.SunToolkit.getSystemEventQueueImplPP(SunToolkit.java:543)
    at sun.awt.SunToolkit.getSystemEventQueueImpl(SunToolkit.java:537)
    at java.awt.Toolkit.getEventQueue(Toolkit.java:1519)
    at java.awt.EventQueue.invokeLater(EventQueue.java:792)
    at javax.swing.SwingUtilities.invokeLater(SwingUtilities.java:1170)
    at javax.swing.Timer.post(Timer.java:538)
  • locked <0xac1d8c40> (a javax.swing.Timer)
    at javax.swing.TimerQueue.postExpiredTimers(TimerQueue.java:193)
  • locked <0xabe6bef0> (a javax.swing.TimerQueue)
    at javax.swing.TimerQueue.run(TimerQueue.java:229)
  • locked <0xabe6bef0> (a javax.swing.TimerQueue)

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

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

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

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

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

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

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

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

“AWT-EventQueue-0” prio=1 tid=0x0830ab50 nid=0x4ac waiting for monitor entry

at javax.swing.TimerQueue.containsTimer(TimerQueue.java:167)

  • waiting to lock <0xabe6bef0> (a javax.swing.TimerQueue)

at javax.swing.Timer.isRunning(Timer.java:497)

at com.valhalla.jbother.ConversationArea.append(ConversationArea.java:20 7)

at com.valhalla.jbother.ChatPanel$14.run(ChatPanel.java:664)

at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)

at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)

at com.valhalla.jbother.EventProcessor.dispatchEvent(JBother.java:115)

at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh read.java:201)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre ad.java:151)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

“AWT-Motif” daemon prio=1 tid=0x082fd008 nid=0x4ac runnable

at sun.awt.motif.MToolkit.run(Native Method)

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

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

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

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

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

“Signal Dispatcher” daemon prio=1 tid=0x080a6858 nid=0x4ac waiting on condition

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

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

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

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

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

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

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

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

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

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

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

“VM Thread” prio=1 tid=0x08090260 nid=0x4ac runnable

“VM Periodic Task Thread” prio=1 tid=0x080a9088 nid=0x4ac waiting on condition

“Suspend Checker Thread” prio=1 tid=0x080a5e58 nid=0x4ac runnable

/code

Hey Adam,

I would say that you have probably hit a Java bug. This is the situation:

Thread=0x0830ab50 is waiting to obtain a lock on 0xabe6bef0

Thread=0xaa700aa0 has locked 0xabe6bef0 and is waiting to lock 0xabe643f8 but nobody locks that object[/b]

After a quick google search I found this link: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4852507. You may want to join to those guys and maybe provide a way to reproduce the problem.

Good luck,

– Gato

Being self taught and all, I’‘m not sure how to go about fixing this. What’'s the best way to debug a problem like this? Is there software available to aid?

Adam

Hey Adam,

I always had to fix these problem by myself. Anyway, you may want to try posting this issue at the java forums. I read that many other people reported having the same problem and there is also a java bug reported but not fixed.

Regards,

– Gato

The second thread dump is caused by a different problem than the first.

The second is a problem with libpthread and is solved here:

https://192.168.10.21/exchweb/bin/redir.asp?URL=http://forum.java.sun.com/thread .jspa?threadID=547960%26messageID=2672714

Even with that solved I’'m still getting the first crash.