JDK-6374419 : Misleading error message if 32bit dll used together with 64 bit VM
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_vista
  • CPU: x86
  • Submitted: 2006-01-19
  • Updated: 2012-10-08
  • Resolved: 2006-04-19
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 JDK 6
1.4.2_19-revFixed 1.4.2_20Fixed 6 b80Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
Platform[s]    : FAIL - Windows Vista on AMD64

VM from windows-amd64 binaries throws the UnsatisfiedLinkError with the following error message if one tries to load 32 bit dll via loadLibrary:

java.lang.UnsatisfiedLinkError: PATH_TO_DLL: %1 is not a valid Win32 application

Please note that according to error message jckjni.dll "is not a valid Win32 application". But given dll was correct 32 bit dll. This error message is incorrect and may mislead users.

How to reproduce:

1. Unpack attached archive.zip
2. Correct TESTSUITE (/net/jre.sfbay/p/v10/jck/6.0/beta/b15a/binaries/JCK-runtime-60 in SWAN) and PRODUCT in runme.sh
3. Run runme.sh

Sample output (obtained on Windows Vista on amd64):

Z:/Links/stt/jck_workspace/mustang/b67/jck/WinVista/32
Library loading:
loadLibrary("invokeinterface00201m1") throws: java.lang.UnsatisfiedLinkError: no invokeinterface00201m1 in java.library.path
loadLibrary("jckjni") throws: java.lang.UnsatisfiedLinkError: Z:\Links\stt\jck_workspace\mustang\b67\jck\WinVista\32\jckjni.dll: %1 is not a valid Win32 application

Z:/Links/stt/jck_workspace/mustang/b67/jck/WinVista/64

Comments
EVALUATION Indeed Windows reports misleading error message: %1 is not a valid Win32 application. even in cases like loading 64bit dll from a 32bit application or visa versa. Solaris reports following message in such case: ld.so.1: load_dll_sol.out: fatal: 64/libjvm_db.so: wrong ELF class: ELFCLASS64 Linux reports even more misleading message! : ./linux64.libjvm.so: cannot open shared object file: No such file or directory See test applicatins in attachment So we need to substitute message with a more meaningful like: "Can't load 64-bit DLL on a 32-bit machine" But in light of CR 6348631: "remove HPI interface from Hotspot" we decided to move DLL/so loader to os class. Code for diagnostics requires file open, seek and read operations that I will also implement in os class.
10-02-2006