JDK-6588870 : D3D PIT: AWT testcases crashes the jvm
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 6u4
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2007-08-03
  • Updated: 2010-10-14
  • Resolved: 2007-08-21
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.
JDK 6
6u10 b02Fixed
Related Reports
Relates :  
Relates :  
Description
Three awt testcases crashes the jvm when executed with 6u4 b01 pit for d3d on Windows XP Home SP2 system. All the crash logs look similar.

Attached is a testcase which reproduces the crash. It happens inconsistently, 3 out of 5 times. Also attached is the output of platforminfo utility and the crash log.

To run the testcase, set JAVA_HOME and run the script 'run.sh'

Comments
SUGGESTED FIX http://sa.sfbay.sun.com/projects/java2d_data/6u4/6588870.1
14-08-2007

EVALUATION The bug is caused by the way we de-initialize the new Direct3D pipeline. In particular, during the toolkit's dispose phase we release the D3DPipelineManager. (see awt_Toolkit.cpp Dispose()). Unfortunately later another thread may come in and attempt to get the current manager by using GetInstance(). This call will create an uninitialized instance of the pipeline manager, which is unusable (to make it usable InitD3D() must be called first). So the crash happens when later a GetD3DContext() is called and we dereference a null pointer to the adapters array. The solution is to change the way the pipeline is initialized. Now we'll have the following methods in the D3DPipelineManager class (this follows the pattern of other d3d pipeline classes): constructor and destructor are private CreateInstance() - Creates and initializes a new instance of the pipeline manager if it can. It is only called from D3DGraphicsDevice.InitD3D(), returns created and initialized singleton instance, or NULL DeleteInstance() - deletes the singleton of the manager - called when the toolkit is disposed of GetInstance() - returns the singleton of the manager (doesn't create it) - used by the rest of the code So now once the single instance is deleted, the only way to get a new one is through one single path - and it would be a usable instance if that happend. As it is now, however, during the exit the current manager will be disposed of, and any further inquires will return NULL. The rest of the code is already prepared to get a NULL pipeline manager, and will fail safely. Another rather nasty bug was that the singleton was not being initialized to NULL.
13-08-2007

EVALUATION I was able to reproduce the crash using 6u4-b01 nightly build on WinXP SP2 desktop. According to the HotSpot log file it happens in awt.dll+0xa664f and the corresponding line in awt.map is following: 0001:000a5630 ?GetD3DContext@D3DPipelineManager@@QAEJIPAPAVD3DContext@@@Z 100a6630 f D3DPipelineManager.obj I haven't found any file named '*D3DPipelineManager*' in 6u3/7.0 J2SE workspace (is it a generated file? is it specific to 6u4?), but it looks like related to Direct3D pipeline. Dispatching to Java2D team.
06-08-2007