RFR: 8226238: Improve error output and fix elf issues in os::dll_load

Baesken, Matthias matthias.baesken at sap.com
Tue Jun 18 07:45:49 UTC 2019


Hello,
please  review  this change to linux    os::dll_load .
os::dll_load  includes some coding to report  error details  in cases  where  the lib loading fails .
For this ,  we ELF  header of the shared-object we failed to load   is evaluated .

However the code   currently has some issues .
- it misses to convert endianness of elf_head.e_machine (ELF data entry) in case the platform we run on, and the lib we try to load  have different endianness
- the error message could show the real elf architecture name in mismatch cases (but does not)


Adjusted error message looks like this :
example from renaissance db-shootout benchmark   that  runs  on linuxs390x and attempts to load an x86_64 JNI lib "by mistake"
message without the change :
 .... ELF file data encoding not big-endian (Possible cause: endianness mismatch)]


with change :
 .... ELF file data encoding not big-endian (Possible cause: can't load AMD 64 .so on a IBM System/390 platform)


bug/webrev :

https://bugs.openjdk.java.net/browse/JDK-8226238
http://cr.openjdk.java.net/~mbaesken/webrevs/8226238.2/


Thanks, Matthias


More information about the hotspot-dev mailing list