Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (767)
Games in Android Showcase (230)
games submitted by our members
Games in WIP (854)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Swing app deadlocking  (Read 2775 times)
0 Members and 1 Guest are viewing this topic.
Offline GKW

Senior Devvie




Revenge is mine!


« Posted 2004-03-03 01:24:34 »

If I let my app run for a while the thing always locks up.  It doesn't happen in a predictable manor.  I am just looping through the same code with no external input.


This is the thread dump for 1.4:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
114  
115  
116  
117  
118  
119  
120  
Full thread dump JFluid Client VM (based on Java HotSpot(TM) VM) (JF 1.3 mixed m
ode):

"DestroyJavaVM" prio=5 tid=0x008f0d10 nid=0x2d8 waiting on condition [0..6fb08]
Thread state: _thread_blocked
Thread: 0x008f0d10  [0x2d8] State: _at_safepoint  pc: 0x00000000

"Thread-1" prio=5 tid=0x183d2260 nid=0x300 runnable [3d8f000..3d8fdb4]
Thread state: _thread_blocked
Thread: 0x183d2260  [0x300] State: _call_back  pc: 0x00000000
        at javax.swing.RepaintManager.addDirtyRegion(RepaintManager.java:234)
        - waiting to lock <0x1051c7f8> (a javax.swing.RepaintManager)
        at javax.swing.JComponent.repaint(JComponent.java:4341)
        at java.awt.Component.repaint(Component.java:2408)
        at net.java.games.jogl.GLJPanel.display(GLJPanel.java:102)
        at net.java.games.jogl.Animator$1.run(Animator.java:104)
        at java.lang.Thread.run(Thread.java:534)

"Java2D Disposer" daemon prio=10 tid=0x183cbc40 nid=0x484 in Object.wait() [1a7af000..1a7afdb4]
Thread state: _thread_blocked
Thread: 0x183cbc40  [0x484] State: _at_safepoint  pc: 0x00000000
        at java.lang.Object.wait(Native Method)
        - waiting on <0x105307b0> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)
        - locked <0x105307b0> (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=7 tid=0x183c9670 nid=0x48c runnable [1a76f000..1a76fdb4]

Thread state: _thread_blocked
Thread: 0x183c9670  [0x48c] State: _at_safepoint  pc: 0x00000000
        at sun.java2d.loops.Blit.Blit(Native Method)
        at sun.java2d.pipe.DrawImage.blitSurfaceData(DrawImage.java:640)
        at sun.java2d.pipe.DrawImage.renderSurfaceData(DrawImage.java:346)
        at sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:66)
        at sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:752)
        at sun.java2d.pipe.ValidatePipe.copyImage(ValidatePipe.java:154)
        at sun.java2d.SunGraphics2D.copyImage(SunGraphics2D.java:2692)
        at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:2721)
        at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:2678)
        at net.java.games.jogl.GLJPanel.paintComponent(GLJPanel.java:109)
        - locked <0x10521138> (a java.lang.Object)
        at javax.swing.JComponent.paint(JComponent.java:808)
        at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4795)

        at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4748)
        at javax.swing.JComponent._paintImmediately(JComponent.java:4692)
        at javax.swing.JComponent.paintImmediately(JComponent.java:4495)
        at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:410)

        at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(System
EventQueueUtilities.java:117)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
        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-Shutdown" prio=7 tid=0x009df620 nid=0x434 in Object.wait() [1a72f000..1a72fdb4]
Thread state: _thread_blocked
Thread: 0x009df620  [0x434] State: _at_safepoint  pc: 0x00000000
        at java.lang.Object.wait(Native Method)
        - waiting on <0x1050d000> (a java.lang.Object)
        at java.lang.Object.wait(Object.java:429)
        at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:259)
        - locked <0x1050d000> (a java.lang.Object)
        at java.lang.Thread.run(Thread.java:534)

"AWT-Windows" daemon prio=7 tid=0x183bb9c8 nid=0x2cc runnable [1a62f000..1a62fdb4]
Thread state: _thread_in_native
Thread: 0x183bb9c8  [0x2cc] State: _at_safepoint  pc: 0x00000000
        at sun.awt.windows.WToolkit.eventLoop(Native Method)
        at sun.awt.windows.WToolkit.run(WToolkit.java:262)
        at java.lang.Thread.run(Thread.java:534)

"CompilerThread0" daemon prio=5 tid=0x0023d100 nid=0x23c waiting on condition [0..1822f9e4]
Thread state: _thread_blocked
Thread: 0x0023d100  [0x23c] State: _at_safepoint  pc: 0x00000000

"Signal Dispatcher" daemon prio=10 tid=0x00940e40 nid=0x128 waiting on condition
 [0..0]
Thread state: _thread_blocked
Thread: 0x00940e40  [0x128] State: _at_safepoint  pc: 0x00000000

"Finalizer" daemon prio=9 tid=0x0093d890 nid=0x3d8 in Object.wait() [1816f000..1816fdb4]
Thread state: _thread_blocked
Thread: 0x0093d890  [0x3d8] State: _at_safepoint  pc: 0x00000000
        at java.lang.Object.wait(Native Method)
        - waiting on <0x1050d0e0> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)
        - locked <0x1050d0e0> (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=10 tid=0x0093c3b0 nid=0x340 in Object.wait() [1812f000..1812fdb4]
Thread state: _thread_blocked
Thread: 0x0093c3b0  [0x340] State: _at_safepoint  pc: 0x00000000
        at java.lang.Object.wait(Native Method)
        - waiting on <0x1050d148> (a java.lang.ref.Reference$Lock)
        at java.lang.Object.wait(Object.java:429)
        at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:115)
        - locked <0x1050d148> (a java.lang.ref.Reference$Lock)

"VM Thread" prio=5 tid=0x00991248 nid=0x2e0 runnable

"VM Periodic Task Thread" prio=10 tid=0x0023edb8 nid=0x4a0 waiting on condition


"Suspend Checker Thread" prio=10 tid=0x009404b0 nid=0x2d0 runnable

Compiler thread printing unimplemented.
JFluid: current dir is D:\java\jdk-windows\bin
Offline GKW

Senior Devvie




Revenge is mine!


« Reply #1 - Posted 2004-03-03 01:25:17 »

Same app with jre 1.5.0

Thread dump for jre1.5.0
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
Full thread dump Java HotSpot(TM) Client VM (1.5.0-beta-b32c mixed mode):

"DestroyJavaVM" prio=5 tid=0x00236068 nid=0x2e0 waiting on condition [0x00000000..0x0006fae8]

"Thread-2" prio=5 tid=0x0351f730 nid=0x300 waiting for monitor entry [0x05b1f000..0x05b1fb64]
        at sun.awt.AppContext.get(Unknown Source)
        - waiting to lock <0x6e27f110> (a java.util.HashMap)
        at javax.swing.SwingUtilities.appContextGet(Unknown Source)
        at javax.swing.RepaintManager.currentManager(Unknown Source)
        at javax.swing.RepaintManager.currentManager(Unknown Source)
        at javax.swing.JComponent.repaint(Unknown Source)
        at java.awt.Component.repaint(Unknown Source)
        at net.java.games.jogl.GLJPanel.display(GLJPanel.java:102)
        at net.java.games.jogl.Animator$1.run(Animator.java:104)
        at java.lang.Thread.run(Unknown Source)

"AWT-EventQueue-0" prio=7 tid=0x00a4fea0 nid=0x434 waiting for monitor entry [0x0398f000..0x0398fbe4]
        at sun.awt.AppContext.get(Unknown Source)
        - waiting to lock <0x6e27f110> (a java.util.HashMap)
        at javax.swing.SwingUtilities.appContextGet(Unknown Source)
        at javax.swing.RepaintManager.currentManager(Unknown Source)
        at javax.swing.RepaintManager.currentManager(Unknown Source)
        at javax.swing.JComponent._paintImmediately(Unknown Source)
        at javax.swing.JComponent.paintImmediately(Unknown Source)
        at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
        at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknow
n Source)
        at java.awt.event.InvocationEvent.dispatch(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(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-Shutdown" prio=7 tid=0x00a4be88 nid=0x23c in Object.wait() [0x0388f000..0x0388fc64]
        at java.lang.Object.wait(Native Method)
        - waiting on <0x6e271e40> (a java.lang.Object)
        at java.lang.Object.wait(Unknown Source)
        at sun.awt.AWTAutoShutdown.run(Unknown Source)
        - locked <0x6e271e40> (a java.lang.Object)
        at java.lang.Thread.run(Unknown Source)

"AWT-Windows" daemon prio=7 tid=0x00a4c100 nid=0x4a0 runnable [0x034bf000..0x034bfce4]
        at sun.awt.windows.WToolkit.eventLoop(Native Method)
        at sun.awt.windows.WToolkit.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

"Java2D Disposer" daemon prio=10 tid=0x00a4a420 nid=0x340 in Object.wait() [0x032bf000..0x032bf9e4]
        at java.lang.Object.wait(Native Method)
        - waiting on <0x6e29b658> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(Unknown Source)
        - locked <0x6e29b658> (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)

"Low Memory Detector" daemon prio=5 tid=0x009c9f50 nid=0x2d8 runnable [0x00000000..0x00000000]

"CompilerThread0" daemon prio=10 tid=0x009c8b98 nid=0x128 waiting on condition [0x00000000..0x00f8f854]

"Signal Dispatcher" daemon prio=10 tid=0x0023fe48 nid=0x4f8 waiting on condition
 [0x00000000..0x00000000]

"Finalizer" daemon prio=9 tid=0x009a1c68 nid=0x3d8 in Object.wait() [0x00d8f000..0x00d8fc64]
        at java.lang.Object.wait(Native Method)
        - waiting on <0x6e271fe8> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(Unknown Source)
        - locked <0x6e271fe8> (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=0x009c6a18 nid=0x480 in Object.wait() [0x00c8f000..0x00c8fce4]
        at java.lang.Object.wait(Native Method)
        - waiting on <0x6e272068> (a java.lang.ref.Reference$Lock)
        at java.lang.Object.wait(Unknown Source)
        at java.lang.ref.Reference$ReferenceHandler.run(Unknown Source)
        - locked <0x6e272068> (a java.lang.ref.Reference$Lock)

"VM Thread" prio=10 tid=0x009a0828 nid=0x2d0 runnable

"VM Periodic Task Thread" prio=10 tid=0x009cb168 nid=0x1a0 waiting on condition
Offline trembovetski

Senior Devvie




If only I knew what I'm talking about!


« Reply #2 - Posted 2004-03-03 03:52:55 »

I believe this is a known bug, fixed in beta2 (not yet available). Try to search on bug database for addDirtyRegion+deadlock, or something like that.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Ifadolai

Junior Devvie




Java forever!!


« Reply #3 - Posted 2004-03-19 13:18:39 »

Your code (GLJPanel) is bugged.

   at java.awt.Component.repaint(Component.java:2408)
  at net.java.games.jogl.GLJPanel.display(GLJPanel.java:102)

Is not allowed. You must call SwingInvokeLater or similar to make that call. It must be made from the AWT event thread. I'll bet that will make it work.

Nikolai V. Christensen, Computer Engineer,
Simulation and Training department
IFAD, Forskerparken 10A, DK-5230 Odense M
Denmark, EU
Phone: +45 63 15 71 31  Fax: +45 65 93 29 99
Offline GKW

Senior Devvie




Revenge is mine!


« Reply #4 - Posted 2004-03-19 16:41:31 »

No it actually is bug  4837639 and I really need beta 2.
Offline trembovetski

Senior Devvie




If only I knew what I'm talking about!


« Reply #5 - Posted 2004-03-20 04:17:09 »

repaint() is among those few methods which can be called on any thread as it eventually posts a repaint event on EDT anyway.

Pages: [1]
  ignore  |  Print  
 
 

 
EgonOlsen (1303 views)
2018-06-10 19:43:48

EgonOlsen (1161 views)
2018-06-10 19:43:44

EgonOlsen (900 views)
2018-06-10 19:43:20

DesertCoockie (1301 views)
2018-05-13 18:23:11

nelsongames (1106 views)
2018-04-24 18:15:36

nelsongames (1337 views)
2018-04-24 18:14:32

ivj94 (2079 views)
2018-03-24 14:47:39

ivj94 (1231 views)
2018-03-24 14:46:31

ivj94 (2213 views)
2018-03-24 14:43:53

Solater (798 views)
2018-03-17 05:04:08
Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!