<AWT Dev> <Swing Dev> RFR(S): 8156020: 8145547 breaks AIX and and uses RTLD_NOLOAD incorrectly

Philip Race philip.race at oracle.com
Fri May 6 04:32:02 UTC 2016

Hi Volker,

1) adding awt-dev. Semyon did the review on swing but really it should 
(and mainly!) have been awt.

2) Yes, this ought to be pushed to 9-client, specifically not 9-dev.
Assuming it goes to 9-dev we may need to deal with conflicts.
Also if it causes any kind of problem with 9-dev I would not want to pile
fix on fix, so it would probably just get anti-deltaed. Just a warning.

3) It strictly needs a JPRT run before pushing so someone will need to 
do that.

4) This change definitely needs two reviewers.

And we were discussing RTLD_NOLOAD is not Posix as that came up why it 
was not
a solution in a cross-platform solution for determining whether libs were
already loaded but it was reported to not be able to detect some cases.
So I thought we had determined it was not a general solution.
Leaving aside why it is in there after that (something I will need to 
the lack of the other flag may explain why it was apparently "not working".

So one interesting thing is it appears to me that I thought we pushed
the .v6 webrev - the one I thought we (or I) approved since it was the 

but this looks like the v5 webrev was pushed :

All of this "detection" code was the main issue at that juncture.
So I would like some time to disentangle that before anything is changed.


On 5/4/16, 11:32 AM, Volker Simonis wrote:
> 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 awt-dev mailing list