RFR: 8226468: loadquery failed error message displayed

Thomas Stüfe thomas.stuefe at gmail.com
Tue Jun 25 16:41:49 UTC 2019


Since the patch was trivial I pushed it under the trivial rule.

Cheers, Thomas

On Tue, Jun 25, 2019 at 3:21 PM Baesken, Matthias <matthias.baesken at sap.com>
wrote:

> Looks good to me as well .
>
>
>
> Best regards, Matthias
>
>
>
>
>
> *From:* Thomas Stüfe <thomas.stuefe at gmail.com>
> *Sent:* Dienstag, 25. Juni 2019 15:17
> *To:* Steve Groeger <GROEGES at uk.ibm.com>
> *Cc:* Baesken, Matthias <matthias.baesken at sap.com>; ppc-aix-port-dev <
> ppc-aix-port-dev at openjdk.java.net>
> *Subject:* Re: RFR: 8226468: loadquery failed error message displayed
>
>
>
> Hi Steve,
>
>
>
> looks good. Its fine, we do not need a realloc loop. Keep it simple stupid
> :)
>
>
>
> I can sponsor this for you.
>
>
>
> ..Thomas
>
>
>
> On Tue, Jun 25, 2019 at 2:57 PM Steve Groeger <GROEGES at uk.ibm.com> wrote:
>
> Matthias / Thomas,
>
> Thanks for all your comments. I have created an issue [1] and also a
> webrev [2] to resolve this issue.
>
> I have just doubled the size of the buffer (to 0x8000) in both places you
> mentioned.
> If we want to use the same method as used in loadlib_aix.cpp then I can
> look at doing that.
>
> If I can get someone to sponsor this change and to also review the webrev
> I would be very grateful.
>
> Once this has been approved and committed then I would probabamly look at
> getting this back-ported to jdk13 and jdk11.
>
> [1] https://bugs.openjdk.java.net/browse/JDK-8226468
> [2] http://cr.openjdk.java.net/~sgroeger/8226468-1/webrev.00/
>
> Thanks
> Steve Groeger
> IBM Runtime Technologies
> Hursley, Winchester
> Tel: (44) 1962 816911  Mobex: 279990  Mobile: 07718 517 129
> Fax (44) 1962 816800
> Lotus Notes: Steve Groeger/UK/IBM
> Internet: groeges at uk.ibm.com
>
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales with number
> 741598.
> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
>
> "Baesken, Matthias" <matthias.baesken at sap.com> wrote on 25/06/2019
> 11:19:26:
>
> > From: "Baesken, Matthias" <matthias.baesken at sap.com>
> > To: "Thomas Stüfe" <thomas.stuefe at gmail.com>, Steve Groeger
> > <GROEGES at uk.ibm.com>
> > Cc: ppc-aix-port-dev <ppc-aix-port-dev at openjdk.java.net>
> > Date: 25/06/2019 11:19
> > Subject: RE: loadquery failed error message displayed
> >
> > Hi Steve, please create an issue + patch .
> >
> > Btw.  I wonder also about   the other  loadquery  usages :
> >
> >
> > java_md_aix.c
> >
> > static unsigned char dladdr_buffer[0x4000];
> >
> > 33 return loadquery(L_GETINFO, dladdr_buffer, sizeof(dladdr_buffer));
> >
> >
> > loadlib_aix.cpp
> >
> > 192 // Call loadquery(L_GETINFO..) to get a list of all loaded Dlls
> > from AIX. loadquery
> > 198 if (loadquery(L_GETINFO, buffer, buflen) == -1) {
> >
> >
> >
> > Maybe you  could also adjust the  buffer size in  java_md_aix.c  as well
>  ?
> > (  The usage  in  loadlib_aix.cpp  uses a buffer reallocation  until
> > the size is large enough.  )
> >
> > Increasing by factor of 2  is fine with me .  But maybe some people
> > prefer what we do in  loadlib_aix.cpp (reallocation at runtime ).
> >
> >
> >
> >
> > Best regards, Matthias
> >
> >
> > From: ppc-aix-port-dev <ppc-aix-port-dev-bounces at openjdk.java.net>
> > On Behalf Of Thomas Stüfe
> > Sent: Mittwoch, 19. Juni 2019 19:21
> > To: Steve Groeger <GROEGES at uk.ibm.com>
> > Cc: ppc-aix-port-dev <ppc-aix-port-dev at openjdk.java.net>
> > Subject: Re: loadquery failed error message displayed
> >
> > Hi Steve,
> >
> > I wrote this a very long time ago and we never ran into this
> > problem, curious that it took so long... but of course, please
> > create an issue and do a patch, thanks!
> >
> > I would probably just increase the buffer by factor 2 or 4.
> >
> > Cheers, Thomas
> >
> > On Wed, Jun 19, 2019, 14:19 Steve Groeger <GROEGES at uk.ibm.com> wrote:
> > Hi all,
> >
> > We have a scenario where in a Java program after loading some shared
> > libraries (using System.loadLibrary) and then calling
> > javax.imageio.ImageIO.read(new File(..)) the java program displays
> > the following error message:
> >
> > loadquery failed (12 Not enough space)
> >
> > This happens when running on AIX with Java 11 using this sample code:
> >
> > import java.io.File;
> > import java.util.Map;
> > import javax.imageio.ImageIO;
> > public class Reproduce {
> >    public static void main(String[] args) {
> >        try {
> >            System.loadLibrary("mylib");
> >
> >            String filePath = "...";
> >            BufferedImage img = ImageIO.read(new File(filePath));
> >
> >        }
> >        catch (Throwable e) {
> >            System.out.println("Exception : " + e);
> >            e.printStackTrace();
> >        }
> >    }
> > }
> >
> > It seems that this is displayed from src/java.desktop/aix/native/
> > libawt/porting_aix.c
> >
> > static unsigned char dladdr_buffer[0x4000];
> >
> > static void fill_dll_info(void) {
> >  int rc = loadquery(L_GETINFO,dladdr_buffer, sizeof(dladdr_buffer));
> >  if (rc == -1) {
> >    fprintf(stderr, "loadquery failed (%d %s)", errno, strerror(errno));
> >    fflush(stderr);
> >  }
> > }
> >
> > and is due to the dladdr_info buffer being too small to contain all
> > the data returned from the loadquery function.
> >
> > The same buffer size is also used in src/java.base/aix/native/
> > libjli/java_md_aix.c
> >
> > Could / Should the size of these buffers be increased to handle the
> > large data and prevent the error message from being displayed.
> > If so, I am happy to raise an issue and to generate a webrev for this.
> > What would people suggest as a suitable size for the buffer, ie
> > double the size (x8000) or something else?
> >
> > Thanks
> > Steve Groeger
> > IBM Runtime Technologies
> > Hursley, Winchester
> > Tel: (44) 1962 816911  Mobex: 279990  Mobile: 07718 517 129
> > Fax (44) 1962 816800
> > Lotus Notes: Steve Groeger/UK/IBM
> > Internet: groeges at uk.ibm.com
> >
> > Unless stated otherwise above:
> > IBM United Kingdom Limited - Registered in England and Wales with
> > number 741598.
> > Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
> 3AU
> > Unless stated otherwise above:
> > IBM United Kingdom Limited - Registered in England and Wales with
> > number 741598.
> > Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
> 3AU
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales with number
> 741598.
> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/ppc-aix-port-dev/attachments/20190625/2ec105ab/attachment.html>


More information about the ppc-aix-port-dev mailing list