473,473 Members | 2,160 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Invisible Deadlock


Hi all,

I have a strange behaviour where the AppContext.get() is waiting for
lock of a HashMap that is not locked by any other task. This freezes my
GUI because the AWT-EventQueue wants to stop a javax.swing.Timer that is
locked by the TimerQueue Thread that is waiting for the HashMap.

I have no idea how to catch problem. Am I am doing something wrong with
the timer? Any hint how I can get more information about the reason? Any
workaround?

Our application uses many trees and tables in some Frames that are
updated via javax.swing.Timer because the burst load is to heave for an
event driven update. The App must run all the time because it monitors
network devices. A frozen GUI is the worst thing that could hapen to our
App because normally there are no user actions and the user will not be
aware of this. The App is running on serveral linux machines (debian,
redhead, suse with different versions) with serveral JDK 1.4.xxx. Every
where the same.

Can someone help me with this matter?
Thanks.
Peter

Full thread dump Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode):

"JDWP Command Reader" daemon prio=1 tid=0x0838c3d8 nid=0x4e33 runnable
[0..0]

"Thread-2" prio=1 tid=0x08277ce0 nid=0x4e33 runnable [5a148000..5a1488bc]
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream. java:129)
at java.net.SocketInputStream.read(SocketInputStream. java:182)
at
java.io.ObjectInputStream$PeekInputStream.peek(Obj ectInputStream.java:2133)
at
java.io.ObjectInputStream$BlockDataInputStream.pee k(ObjectInputStream.java:2423)
at
java.io.ObjectInputStream$BlockDataInputStream.pee kByte(ObjectInputStream.java:2433)
at
java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1245)
at java.io.ObjectInputStream.readObject(ObjectInputSt ream.java:324)
at
com.atecom.lib.network.impl.BlockingSocketThread.r un(BlockingSocketThread.java:51)

"MemoryLabel" prio=1 tid=0x0828b8f0 nid=0x4e33 waiting on condition
[599de000..599de8bc]
at java.lang.Thread.sleep(Native Method)
at com.atecom.lib.util.Misc.sleep(Misc.java:773)
at
com.atecom.maya.client.gui.common.JButtonMemory$1. run(JButtonMemory.java:69)

"TimerQueue" daemon prio=1 tid=0x0835a228 nid=0x4e33 waiting for monitor
entry [5a037000..5a0378bc]
at sun.awt.AppContext.get(AppContext.java:542)
- waiting to lock <0x45b687b0> (a java.util.HashMap)
at
sun.awt.SunToolkit.getSystemEventQueueImplPP(SunTo olkit.java:543)
at sun.awt.SunToolkit.getSystemEventQueueImpl(SunTool kit.java:537)
at java.awt.Toolkit.getEventQueue(Toolkit.java:1519)
at java.awt.EventQueue.invokeLater(EventQueue.java:79 2)
at javax.swing.SwingUtilities.invokeLater(SwingUtilit ies.java:1170)
at javax.swing.Timer.post(Timer.java:538)
- locked <0x45eaade0> (a javax.swing.Timer)
at javax.swing.TimerQueue.postExpiredTimers(TimerQueu e.java:193)
- locked <0x45be7528> (a javax.swing.TimerQueue)
at javax.swing.TimerQueue.run(TimerQueue.java:229)
- locked <0x45be7528> (a javax.swing.TimerQueue)
at java.lang.Thread.run(Thread.java:534)

"Java2D Disposer" daemon prio=1 tid=0x08285b58 nid=0x4e33 in
Object.wait() [59eff000..59eff8bc]
at java.lang.Object.wait(Native Method)
- waiting on <0x45ba3b58> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue .java:111)
- locked <0x45ba3b58> (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=0x0819d2d8 nid=0x4e33 waiting for monitor
entry [59e7f000..59e7f8bc]
at javax.swing.TimerQueue.removeTimer(TimerQueue.java :135)
- waiting to lock <0x45be7528> (a javax.swing.TimerQueue)
at javax.swing.Timer.stop(Timer.java:509)
at
javax.swing.ToolTipManager.initiateToolTip(ToolTip Manager.java:468)
at javax.swing.ToolTipManager.mouseEntered(ToolTipMan ager.java:458)
at java.awt.Component.processMouseEvent(Component.jav a:5109)
at java.awt.Component.processEvent(Component.java:489 7)
at java.awt.Container.processEvent(Container.java:156 9)
at java.awt.Component.dispatchEventImpl(Component.jav a:3615)
at java.awt.Container.dispatchEventImpl(Container.jav a:1627)
at java.awt.Component.dispatchEvent(Component.java:34 77)
at
java.awt.LightweightDispatcher.retargetMouseEvent( Container.java:3483)
at
java.awt.LightweightDispatcher.trackMouseEnterExit (Container.java:3323)
at
java.awt.LightweightDispatcher.processMouseEvent(C ontainer.java:3180)
at
java.awt.LightweightDispatcher.dispatchEvent(Conta iner.java:3128)
at java.awt.Container.dispatchEventImpl(Container.jav a:1613)
at java.awt.Window.dispatchEventImpl(Window.java:1606 )
at java.awt.Component.dispatchEvent(Component.java:34 77)
at java.awt.EventQueue.dispatchEvent(EventQueue.java: 456)
at
java.awt.EventDispatchThread.pumpOneEventForHierar chy(EventDispatchThread.java:201)
at
java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThread.java:151)
at
java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:145)
at
java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThre ad.java:100)

"Maya Memory Watchdog" prio=1 tid=0x0818d250 nid=0x4e33 waiting on
condition [59dff000..59dff8bc]
at java.lang.Thread.sleep(Native Method)
at com.atecom.lib.util.Misc.sleep(Misc.java:773)
at
com.atecom.maya.client.ClientApplication$3.run(Cli entApplication.java:338)

"MayaWorkerThread" prio=1 tid=0x0818cf48 nid=0x4e33 in Object.wait()
[59d7f000..59d7f8bc]
at java.lang.Object.wait(Native Method)
at com.atecom.lib.util.WorkerThread.run(WorkerThread. java:72)
- locked <0x45b70928> (a com.atecom.maya.client.MayaWorkerThread)

"Thread-1" prio=1 tid=0x0816afa0 nid=0x4e33 runnable [59cff000..59cff8bc]
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream. java:129)
at java.net.SocketInputStream.read(SocketInputStream. java:182)
at java.io.DataInputStream.readInt(DataInputStream.ja va:443)
at
com.atecom.maya.protocol.AlarmConverter.readAlarm( AlarmConverter.java:98)
at
com.atecom.maya.client.alarmserver.ConnectionAlarm Server.run(ConnectionAlarmServer.java:193)
at java.lang.Thread.run(Thread.java:534)

"AWT-Motif" daemon prio=1 tid=0x081892d0 nid=0x4e33 runnable
[59c7f000..59c7f8bc]
at sun.awt.motif.MToolkit.run(Native Method)
at java.lang.Thread.run(Thread.java:534)

"AWT-Shutdown" prio=1 tid=0x08188f30 nid=0x4e33 in Object.wait()
[59aff000..59aff8bc]
at java.lang.Object.wait(Native Method)
- waiting on <0x45b3ee78> (a java.lang.Object)
at java.lang.Object.wait(Object.java:429)
at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:2 59)
- locked <0x45b3ee78> (a java.lang.Object)
at java.lang.Thread.run(Thread.java:534)

"Ping Thread" prio=1 tid=0x08140480 nid=0x4e33 waiting on condition
[59a5e000..59a5e8bc]
at java.lang.Thread.sleep(Native Method)
at com.atecom.lib.util.Misc.sleep(Misc.java:773)
at
com.atecom.maya.client.adminserver.PingThread.run( PingThread.java:70)

"DestroyJavaVM" prio=1 tid=0x080529e8 nid=0x4e33 waiting on condition
[0..bfffbe84]

"LogLevelThread" prio=1 tid=0x0813dc48 nid=0x4e33 in Object.wait()
[593ca000..593ca8bc]
at java.lang.Object.wait(Native Method)
- waiting on <0x45b3a0a8> (a
de.qfs.lib.log.LogLevels$LogLevelThread)
at java.lang.Object.wait(Object.java:429)
at de.qfs.lib.log.LogLevels$LogLevelThread.run(LogLev els.java:869)
- locked <0x45b3a0a8> (a de.qfs.lib.log.LogLevels$LogLevelThread)

"Signal Dispatcher" daemon prio=1 tid=0x080909e8 nid=0x4e33 waiting on
condition [0..0]

"JDWP Event Helper Thread" daemon prio=1 tid=0x0808f228 nid=0x4e33
runnable [0..0]

"JDWP Transport Listener: dt_socket" daemon prio=1 tid=0x0808e6f0
nid=0x4e33 runnable [0..58b70610]

"Finalizer" daemon prio=1 tid=0x08089f20 nid=0x4e33 in Object.wait()
[58a08000..58a088bc]
at java.lang.Object.wait(Native Method)
- waiting on <0x45b1afd8> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue .java:111)
- locked <0x45b1afd8> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue .java:127)
at java.lang.ref.Finalizer$FinalizerThread.run(Finali zer.java:159)

"Reference Handler" daemon prio=1 tid=0x08088408 nid=0x4e33 in
Object.wait() [58988000..589888bc]
at java.lang.Object.wait(Native Method)
- waiting on <0x45b1aff8> (a java.lang.ref.Reference$Lock)
at java.lang.Object.wait(Object.java:429)
at java.lang.ref.Reference$ReferenceHandler.run(Refer ence.java:115)
- locked <0x45b1aff8> (a java.lang.ref.Reference$Lock)

"VM Thread" prio=1 tid=0x08087108 nid=0x4e33 runnable

"VM Periodic Task Thread" prio=1 tid=0x08093528 nid=0x4e33 waiting on
condition
"Suspend Checker Thread" prio=1 tid=0x0808ff30 nid=0x4e33 runnable
Jul 17 '05 #1
2 5112
P.Xman wrote:

Hi all,

I have a strange behaviour where the AppContext.get() is waiting for
lock of a HashMap that is not locked by any other task. This freezes my
GUI because the AWT-EventQueue wants to stop a javax.swing.Timer that is
locked by the TimerQueue Thread that is waiting for the HashMap.

I have no idea how to catch problem. Am I am doing something wrong with
the timer? Any hint how I can get more information about the reason? Any
workaround?


The stacktrace doesn't really indicate a deadlock situation. Could also be
a condition wherein you are using far too many timers and thus starving the
EDT ??? (The javadoc comment of the postExpiredTimers method of the TimerQueue
class seems to indicate that this could happen if there are a lots of timers)

Also check your threads that are in sleep() state to see if they are holding any
locks.

BK
Jul 17 '05 #2
Thanks for your answer.
The stacktrace doesn't really indicate a deadlock situation.
=> thats why I called it 'invisible'
Could also be a condition wherein you are using far too many timers
and thus starving the
EDT ??? (The javadoc comment of the postExpiredTimers method of the
TimerQueue
class seems to indicate that this could happen if there are a lots of
timers)
=> my app creates directly about 10 timer in a range between 1 and 3
seconds - I think that's not the problem.
Also check your threads that are in sleep() state to see if they are
holding any
locks.


=> I checked this with eclipse - no locks to see. Can I get more Info
than eclipse or the dump offers?

In the freeze situation my App uses less than 1% CPU time - no
indication for a loop situation.

I have removed most of the Timer.stop() to see if it works now better.
I am not in the office the next 14 days - vacation :-) - I'll report
about the result when I am back.

Peter
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Robert Brown | last post by:
I have a deadlock that's happening on one oracle instance but cannot be reproduced on any other. It is always caused by the same SQL statement colliding with itself and only happens under very high...
1
by: dawatson833 | last post by:
I want to set an alert for a specific table whenever an event has caused a deadlock to occur on the table. I understand how to set up an alert. But I don't know which error number to use for...
7
by: Andrew Mayo | last post by:
Here's a really weird one for any SQL Server gurus out there... We have observed (SQL Server 2000) scenarios where a stored procedure which (a) begins a transaction (b) inserts some rows into...
3
by: Nigel Robbins | last post by:
Hi There, I'm getting a deadlock when I have two clients running the following statement. DELETE FROM intermediate.file_os_details WHERE file_uid = ? AND obj_uid There is a compound index on...
1
by: Rohit Raghuwanshi | last post by:
Hello all, we are running a delphi application with DB2 V8.01 which is causing deadlocks when rows are being inserted into a table. Attaching the Event Monitor Log (DEADLOCKS WITH DETAILS) here....
15
by: Zeng | last post by:
Hi, The bigger my C# web-application gets, the more places I need to put in the tedious retrying block of code to make sure operations that can run into database deadlocks are re-run (retried)...
1
by: Grant McLean | last post by:
Hi First a simple question ... I have a table "access_log" that has foreign keys "app_id" and "app_user_id" that reference the "application_type" and "app_user" tables. When I insert into...
2
by: Sumanth | last post by:
Hi , I am trying to acquire a lock on a table A in exclusive mode, and this statement gives an error indicating a deadlock or timeout has been detected. The lock timeout value is set to 0 which...
0
by: cwho.work | last post by:
Hi! We are using apache ibatis with our MySQL 5.0 database (using innodb tables), in our web application running on Tomcat 5. Recently we started getting a number of errors relating to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.