<Swing Dev> RFR(S): 8156020: 8145547 breaks AIX and and uses RTLD_NOLOAD incorrectly
Volker Simonis
volker.simonis at gmail.com
Wed May 4 18:32:32 UTC 2016
Hi,
can somebody please review this small change which fixes the AIX build
after change 8145547, but also fixes an incorrect usage pattern of
RTLD_NOLOAD in 8145547:
http://cr.openjdk.java.net/~simonis/webrevs/2016/8156020/
https://bugs.openjdk.java.net/browse/JDK-8156020
Here are the details from the bug report:
Change 8145547 uses the RTLD_NOLOAD flag when calling dlopen to probe
the availability of the GTK libraries.
But unfortunately RTLD_NOLOAD is not Posix and for example not
available on AIX and BSD.
I also found out, that the implementation of 8145547 contains a bug.
It uses RTLD_NOLOAD in an incorrect way. The man page for dlopen
clearly states that one of the two flags RTLD_LAZY or RTLD_NOW has to
be included in the flags. But the current implementation uses
RTLD_NOLOAD as single flag. Therefor the call to dlopen() currently
always returns NULL, no difference if the corresponding library has
been loaded already or not.
The bug report also contains a small C program which can be used to
reproduce the problem.
The fix is to only use RTLD_NOLOAD if it is defined. The change
removes the 'flags' argument from the various check() functions and
replaces it with a boolean 'load' argument. It indicates if the check
functions should just look for a previously loaded version of the GTK
libraries (i.e. if 'load' == false) or if it should additionally try
to load the libraries if that hasn't been done before (i.e. if 'load'
== true).
I hope I haven't changed the previous program semantics with my
change. At least I couldn't see any difference :)
I've built and smoke tested on Linux/Solaris and AIX with various
combinations for jdk.gtk.version,
-Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel and
FileDialog implementations.
I'd like to push this directly to jdk9-dev to fix the AIX build as
fast as possible. Would that be OK?
Thank you and best regards,
Volker
More information about the swing-dev
mailing list