JDK-4321940 : Race condition in javax.swing.UIDefaults.get.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.3.0
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_7
  • CPU: generic
  • Submitted: 2000-03-15
  • Updated: 2000-04-13
  • Resolved: 2000-04-13
Related Reports
Duplicate :  
Description
The test in 4321013/runlist.dat.1801.1900 (see bug 4321013) intermittently
fails to exit at the end of the test.  This was observed with the SAIL 06 build.
See comments for a pointer to the 06 build and how to run the test.


The output of the test stalls after

[ Exit:javasoft.sqe.tests.api.javax.swing.text.StyledEditorKit.UnderlineAction.SubCtorsTests ]
TableView2001: Passed. OKAY
[ Exit:javasoft.sqe.tests.api.javax.swing.text.TableView.CtorTests ]
 === protected void forwardUpdate(ElementChange ec, DocumentEvent e, Shape a, ViewFactory f) === 
TableView2002: Passed. OKAY
  0
  1
  2
  3
TableView2003: Passed. OKAY
[ Exit:javasoft.sqe.tests.api.javax.swing.text.TableView.miscTests ]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	last message seen



The VM is still running - it is periodically executing a GC.


jon.masamitsu@Eng 2000-04-05

Please see the evaluation for a description of the problem and a suggested
solution.

Comments
EVALUATION jon.masamitsu@Eng 2000-04-05 From: "Lars Bak" Subject: Re: bug 4321940 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Hi Jon, finally I found the problem with the hang when running swing programs. The bug is NOT in the virtual machine but in the swing java code. The bug is a wait/notify race condition in javax.swing.UIDefaults.get. If more than one thread is waiting for a lazy value, only one of them is notified. The real problem is notify should be replaced with a notifyAll in line 155 of UIDefaults.java: Old code: this.notify(); new code: this.notifyAll(); I made the change and could not reproduce the hang. Please reassign bug 4321940 to the swing team. This is in my mind a show stopper since it can stall any multi threaded swing programs. Take care, Lars
11-06-2004

PUBLIC COMMENTS This is a bug in Swing code.
10-06-2004