JDK-4838939 : java.exe - DLL Initialization Failed
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 1.4.1
  • Priority: P5
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: windows_nt
  • CPU: x86
  • Submitted: 2003-03-27
  • Updated: 2004-08-03
  • Resolved: 2004-08-03
Related Reports
Duplicate :  
Relates :  
Description

Name: rmT116609			Date: 03/27/2003


FULL PRODUCT VERSION :
java version "1.4.1_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_02-b06)
Java HotSpot(TM) Client VM (build 1.4.1_02-b06, mixed mode)

FULL OS VERSION :
Windows NT Version 4.0

A DESCRIPTION OF THE PROBLEM :
I created a new project and created a class TestFrame.java. In the project properties set the JDK to java 1.4.1_02-b06. When compiled and run it always gives an error
	java.exe - DLL Initialization Failed
	Initialization of the dynamic link library C:\WINNT\System32\ddraw.dll failed. The process is terminating abnormally


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1)Create a new project
2)Create a new frame called TestFrame.java
3)In the constructor write the line setVisible(true);
4)Compile and run.
5)It throws an error
java.exe - DLL Initialization Failed
	Initialization of the dynamic link library C:\WINNT\System32\ddraw.dll failed. The process is terminating abnormally


EXPECTED VERSUS ACTUAL BEHAVIOR :
For the frame to launch
It throws an error:
java.exe - DLL Initialization Failed
	Initialization of the dynamic link library C:\WINNT\System32\ddraw.dll failed. The process is terminating abnormally


ERROR MESSAGES/STACK TRACES THAT OCCUR :
java.exe - DLL Initialization Failed
	Initialization of the dynamic link library C:\WINNT\System32\ddraw.dll failed. The process is terminating abnormally


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
//TestFrame.java

import java.awt.*;
import javax.swing.JFrame;

public class TestFrame extends JFrame {

  public TestFrame() {
    setVisible(true);
  }
  public static void main(String[] args) {
    TestFrame testFrame = new TestFrame();
  }
}


---------- END SOURCE ----------

Please also see:

http://forum.java.sun.com/thread.jsp?forum=32&thread=232065
(Review ID: 183001) 
======================================================================

Comments
EVALUATION This appears to be a rare situation linked somehow to the OS setup on particular machines. I have seen this mentioned on msdn and on the web, but have been unable to reproduce the problem on my NT4 system. The user's system has Service Pack 5 of NT4 and an nVidia tnt2 video card (both of which are very acceptable for a Java platform). The information that I have gleaned from the web and similar problems on other platforms includes: - There may be a problem with ddraw.dll or some other system library that it depends upon. Reinstall or repair the OS to see if that fixes the problem. - There could also be some problem with the graphics driver. Get the latest driver for that video card from the manufacturer (www.nvidia.com) and install it to see whether that helps. - Apparently ddraw likes to load itself into a particular location in memory. Perhaps there is some other application occupying that slot, making the ddraw loading impossible. The only fix for this would be to figure out that other application and somehow prevent it from loading itself where it does. Note that this possible problem/fix I am taking completely from information I saw posted on websites and have no idea whether it is realistic or not. Without the ability to reproduce the problem, I cannot test possible fixes. - We have had problems in the past with NT services being run that loaded ddraw. In these other bugs, this caused a hang when we attempted to load ddraw (not a crash, as is the case here). However, it is worth checking whether there is something running as an NT service that is causing the problem. Other than that, I'm coming up dry. The only thing that we can (and should) do is to detect when ddraw loading fails (by catching an exception, presumably) and disable ddraw. We already do something similar if the loading process fails, but apparently it is not robust enough to handle this error. This should be an easy fix (although we have no good way to verify it since we do not have a system that reproduces the problem). in the meantime, a workaround is posted in the Work Around section. ###@###.### 2003-03-28 Given the age of the bug and platform (NT4), the number of fixes in this area in 1.5 (including a fix that caused a deadlock upon loading problems with ddraw.dll), and our inability to reproduce the base problem, I am closing the bug as Not Reproducible. For those folks having problems with running Java as an NT service, I'd refer you to bug 4455041, which details that bug, workaround, and fix. ###@###.### 2004-08-03
03-08-2004

WORK AROUND Run with the noddraw flag to disable our use of ddraw completely. This will cause us to avoid even attempting to load ddraw.dll, thus we will avoid the crash. The submitter has verified that the workaround works correctly in their environment. java -Dsun.java2d.noddraw=true <class> ###@###.### 2003-03-28
28-03-2003