RFR: 8166189: Fix for Bug 8165524 breaks AIX build

Langer, Christoph christoph.langer at sap.com
Mon Sep 19 08:44:38 UTC 2016

Hi all,

thanks for your valuable input.

So, since libjli.so can't use libjvm.so and its dladdr() port, there's no way around the libjli.so specific version of it. However, in libjli.so it is only used for resolving pathnames of the program, so the code can be very lean. Hence I completely reduced it to delivering the pathname of a module. And this code is not thread safe, as Volker mentioned. I would think/hope that a launcher would do its resolving work all in one thread and this should not be an issue. Maybe someone of the jli experts can confirm this or object against it. For now I would not spend more efforts in making this multi thread capable.

As for the libawt version of dladdr(), this one should be removed and redirected to hotspot. I'll have a look at this when I find time.

Please find a new webrev where I have addressed all findings and concerns
- corrected spaces and indentation
- removed the printf output in favor of handling the return code
- only fill the info->dli_fname field
- move conditional include to src/java.base/unix/native/libjli/java_md.h


Best regards

> -----Original Message-----
> From: Volker Simonis [mailto:volker.simonis at gmail.com]
> Sent: Freitag, 16. September 2016 19:34
> To: Langer, Christoph <christoph.langer at sap.com>
> Cc: Kumar Srinivasan <kumar.x.srinivasan at oracle.com>; Mandy Chung
> <mandy.chung at oracle.com>; Chris Bensen <chris.bensen at oracle.com>;
> Thomas Stüfe <thomas.stuefe at gmail.com>; Lindenmaier, Goetz
> <goetz.lindenmaier at sap.com>; core-libs-dev <core-libs-
> dev at openjdk.java.net>; ppc-aix-port-dev at openjdk.java.net
> Subject: Re: RFR: 8166189: Fix for Bug 8165524 breaks AIX build
> Hi Christoph,
> I think your change is fine as a quick-fix to fix the build. But
> you're completely right that this should be reworked in the long term.
> I hate to see that we now have the third version of these routines in
> the OpenJDK. Unfortunately a clean solution is not trivial.
> libjli is not linked against libjvm because libjli is actually used to
> load libjvm. So we can not put the dladdr routines for AIX there. But
> I think we should at least consolidate the two versions which will be
> in the class library after your change. Initially I intentionally put
> porting_aix.{c,h} into jdk/aix/porting with the intent to make it
> available to ALL jdk native libraries.
> Unfortunately, with the source code reorganization due to the modular
> changes, the common, top-level aix repository had to go away and the
> code was moved to src/java.desktop/aix/native/libawt/porting_aix.c.
> With the reorganized, modularized source code layout and build system
> it is not possible to share code between modules. We somehow have to
> fix this although I currently don't know how. IF somebody has an idea,
> please let me know :)
> Regarding your change:
> - can you please move
> +#if defined(_AIX)
> +#include "java_md_aix.h"
> +#endif
> +
> from java_md_common.c to the end of
> java.base/unix/native/libjli/java_md.h. It will then be automatically
> included into java_md_common.c trough java.h which includes java_md.h
> Also, this version of dladdr is inherently not thread safe. I don't
> think that's a problem here, but it would be nice if you could quickly
> check if that's indeed true.
> Besides that, looks good.
> Thanks for fixing,
> Volker
> On Fri, Sep 16, 2016 at 11:58 AM, Langer, Christoph
> <christoph.langer at sap.com> wrote:
> > Hi,
> >
> > the fix for https://bugs.openjdk.java.net/browse/JDK-8165524 breaks the AIX
> build as function dladdr is not available on AIX.
> >
> > There already exist ports of that API in hotspot and awt. With the proposed
> change I duplicate the awt port to libjli. This is maybe only a quick fix -
> eventually we should think about consolidating and using the hotspot port in all
> places by exporting it from libjvm.so for AIX.
> >
> > Bug: https://bugs.openjdk.java.net/browse/JDK-8166189
> > Webrev: http://cr.openjdk.java.net/~clanger/webrevs/8166189.0/
> >
> > Thanks
> > Christoph
> >
> >
> >> -----Original Message-----
> >> From: core-libs-dev [mailto:core-libs-dev-bounces at openjdk.java.net] On
> Behalf
> >> Of Kumar Srinivasan
> >> Sent: Montag, 12. September 2016 22:57
> >> To: core-libs-dev <core-libs-dev at openjdk.java.net>; Mandy Chung
> >> <mandy.chung at oracle.com>; Chris Bensen <chris.bensen at oracle.com>
> >> Subject: RFR: 8165524: Better detect JRE that Linux JLI will be using
> >>
> >> Hello,
> >>
> >> I am sponsoring this changeset for Chris Bensen of the java packager
> >> team, please review  fix for the launcher to  better locate java.home.
> >>
> >> http://cr.openjdk.java.net/~ksrini/8165524/
> >>
> >> Thanks
> >> Kumar
> >

More information about the core-libs-dev mailing list