United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6374419 Misleading error message if 32bit dll used together with 64 bit VM
JDK-6374419 : Misleading error message if 32bit dll used together with 64 bit VM

Details
Type:
Bug
Submit Date:
2006-01-19
Status:
Closed
Updated Date:
2012-10-08
Project Name:
JDK
Resolved Date:
2006-04-19
Component:
hotspot
OS:
windows_vista
Sub-Component:
runtime
CPU:
x86
Priority:
P4
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:

Related Reports
Backport:
Backport:
Backport:
Relates:
Relates:
Relates:
Relates:

Sub Tasks

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.
                                     
2006-02-10



Hardware and Software, Engineered to Work Together