loadquery failed error message displayed
Thomas Stüfe
thomas.stuefe at gmail.com
Wed Jun 19 17:20:37 UTC 2019
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];
> <http://hg.openjdk.java.net/jdk/jdk/file/tip/src/java.desktop/aix/native/libawt/porting_aix.c#l33>
>
> <http://hg.openjdk.java.net/jdk/jdk/file/tip/src/java.desktop/aix/native/libawt/porting_aix.c#l34>
> static void fill_dll_info(void) {
> <http://hg.openjdk.java.net/jdk/jdk/file/tip/src/java.desktop/aix/native/libawt/porting_aix.c#l35>
> int rc = loadquery(L_GETINFO,dladdr_buffer, sizeof(dladdr_buffer));
> <http://hg.openjdk.java.net/jdk/jdk/file/tip/src/java.desktop/aix/native/libawt/porting_aix.c#l36>
> if (rc == -1) {
> <http://hg.openjdk.java.net/jdk/jdk/file/tip/src/java.desktop/aix/native/libawt/porting_aix.c#l37>
> fprintf(stderr, "loadquery failed (%d %s)", errno, strerror(errno));
> <http://hg.openjdk.java.net/jdk/jdk/file/tip/src/java.desktop/aix/native/libawt/porting_aix.c#l38>
> fflush(stderr);
> <http://hg.openjdk.java.net/jdk/jdk/file/tip/src/java.desktop/aix/native/libawt/porting_aix.c#l39>
> }
> <http://hg.openjdk.java.net/jdk/jdk/file/tip/src/java.desktop/aix/native/libawt/porting_aix.c#l40>
> }
> <http://hg.openjdk.java.net/jdk/jdk/file/tip/src/java.desktop/aix/native/libawt/porting_aix.c#l41>
>
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/ppc-aix-port-dev/attachments/20190619/0e0d4221/attachment.html>
More information about the ppc-aix-port-dev
mailing list