United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 2146341 fix for 6374419 suppresses real error message from the linker
2146341 : fix for 6374419 suppresses real error message from the linker

Details
Type:
Backport
Submit Date:
2007-01-29
Status:
Closed
Updated Date:
2012-10-13
Project Name:
JDK
Resolved Date:
2007-03-15
Component:
hotspot
OS:
Sub-Component:
runtime
CPU:
Priority:
P3
Resolution:
Fixed
Affected Versions:
Fixed Versions:
hs10

Related Reports
Backport:

Sub Tasks

Description
                                    

Comments
EVALUATION

Introduced in 5.0 u10 b01 and 6.0 b80

There are several problems in the code

1) libraries with EM_SPARC and EM_SPARC32PLUS in e_machine field of .so header are compatible. In fact Sun Studio on v9 machine generates by default EM_SPARC32PLUS library and gcc generates EM_SPARC libraries for 32-bit targets. This was causing the redicules output message:  Can't load Sparc 32-bit .so on a Sparc 32-bit platform. 
Same token: there is a potential problem with EM_386 and EM_486.

2) There may me many reasons why dlopen failed. The old code only checks if file exists, may be opened and if e_machine field matches current architecture and then assumes that architecture is not right. This overlooks any other reasons why library could not be opened. The code should compare if the architecture is right fo this library and if it is - report what dlerror() reported.

3) Code should evaluate little endian/big endian field of .so head. Otherwise examining elf_head may not be done correctly (byte order).

4) In version 6.0 and 7.0

bool failed_to_read_elf_head= (sizeof(elf_head)==
(os::read(file_descriptor, &elf_head,sizeof(elf_head)))) ;

should be 

bool failed_to_read_elf_head=(sizeof(elf_head)!= 
(::read(file_descriptor, &elf_head,sizeof(elf_head)))) ; 

Webrevs with the fix:
http://jruntime.east/~ik199011/my_webrevs/6515362_5.0_webrev/
http://jruntime.east/~ik199011/my_webrevs/6515362_6.0_webrev/
http://jruntime.east/~ik199011/my_webrevs/6515362_7.0_webrev/
                                     
2007-02-22



Hardware and Software, Engineered to Work Together