RFR: 8226238: Improve error output and fix elf issues in os::dll_load
Langer, Christoph
christoph.langer at sap.com
Thu Jun 27 14:59:06 UTC 2019
Hi Matthias,
your change looks good overall.
I only have a few style nits:
src/hotspot/os/linux/os_linux.cpp, line 1751 (new):
Can you convert
unsigned char current_endianness = ELFDATA2MSB; // BE
#if defined(VM_LITTLE_ENDIAN)
current_endianness = ELFDATA2LSB; // LE
#endif
to
#if defined(VM_LITTLE_ENDIAN)
unsigned char current_endianness = ELFDATA2LSB; // LE
#else
unsigned char current_endianness = ELFDATA2MSB; // BE
#endif
And the same in line 1611 of src/hotspot/os/solaris/os_solaris.cpp.
src/hotspot/os/linux/os_linux.cpp, line 1802: you could fix the indentation of ELFDATA2LSB for EM_ARM
same for line 1580 of src/hotspot/os/solaris/os_solaris.cpp.
Best regards
Christoph
> -----Original Message-----
> From: hotspot-dev <hotspot-dev-bounces at openjdk.java.net> On Behalf Of
> Baesken, Matthias
> Sent: Dienstag, 25. Juni 2019 09:43
> To: 'hotspot-dev at openjdk.java.net' <hotspot-dev at openjdk.java.net>
> Subject: RE: RFR: 8226238: Improve error output and fix elf issues in
> os::dll_load
>
> Ping ...
>
> Best regards, Matthias
>
>
> From: Baesken, Matthias
> Sent: Dienstag, 18. Juni 2019 13:24
> To: 'hotspot-dev at openjdk.java.net' <hotspot-dev at openjdk.java.net>
> Subject: RE: RFR: 8226238: Improve error output and fix elf issues in
> os::dll_load
>
> Hello, I noticed the solaris os::dll_load coding has similar issues.
> New webrev ( handling linux + solaris ) :
>
> http://cr.openjdk.java.net/~mbaesken/webrevs/8226238.3/
>
> Best regards, Matthias
>
>
>
> 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/
More information about the hotspot-dev
mailing list