JDK-4264410 : MultiDitherTest fails with assertion
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.3.0
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_7,windows_nt
  • CPU: x86,sparc
  • Submitted: 1999-08-20
  • Updated: 2001-07-02
  • Resolved: 1999-08-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other Other Other
1.2.2_008 008Fixed 1.2.2_009Fixed 1.3.0Fixed
Related Reports
Duplicate :  
Relates :  
Description
The regression test in test/java/awt/Canvas/MultiDitherTest fails on Win32 with an assertion failure in AwtSharedDC::GetDC ( GetObjectType(m_hDC) == OBJ_DC fails).

You can reproduce this by running the test under java_g with the kestrel fcs "C" builds.

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: 1.2.2_009 generic FIXED IN: 1.2.2_009 kestrel INTEGRATED IN: 1.2.2_008 1.2.2_009 kestrel VERIFIED IN: 1.2.2_008 1.2.2_009
14-06-2004

EVALUATION The problem has appeared since my fix 4045781 for clip region corruption. Using the debugger, I see that the HDC in question (returned from AwtSharedDC::GetDC) is non-null. The window the DC is from is still visible and valid. Yet GetObjectType and all subsequent calls that use the DC fail, claiming it is an invalid parameter (according to the GetLastError string). There seems to be a problem with calling ::GetDCEx on a thread other than the main message pump thread. When the assert fires, I looked at the state of the other threads in the process. Usually the assert fires when another thread is in the process of manipulating/creating a window. The Win32 docs say that GDI calls are not thread safe so it seems very likely that creation/destruction of a window could be touching some shared GDI resource (say the DC cache) that needs to be protected by synchronization. (Prior to 4045781 we were using CS_OWNDC on all windows which problem means that the common DC pool wasn't touched at all). Synchronizing the GetDCEx/ReleaseDC calls by executing them on the main toolkit message pump thread via SendMessage resolves the problem. This means that we never attempt to get or release a DC while Windows is doing something internally with the same set of windows/DC's. robi.khan@eng 1999-08-20 No regression test provided since MultiDitherTest (see desc) reproduces the problem. robi.khan@eng 1999-08-20 I have reopened this bug because it can still be reproduced using another mechanism. Start any applet. Select "Save" from the Applet menu. While the FileDialog is visible, <ctrl>-c Java from the console. The FileDialog will disappear, but the applet will remain running (this is a separate bug I am working on independently). Now, click the "X" (close) button on the Applet's Frame. The assertion failure will appear. david.mendenhall@eng 1999-08-24 The assertion appears to be some sort of shutdown related problem and not really related to this bug per-se (though it may well be in awt_Graphics.cpp). A separate bug will be opened up for the new issue. robi.khan@eng 1999-08-24
24-08-1999