Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE in sun.awt.FontConfiguration.getVersion(...) #75

Closed
ChristianCiach opened this issue Oct 22, 2018 · 36 comments
Closed

NPE in sun.awt.FontConfiguration.getVersion(...) #75

ChristianCiach opened this issue Oct 22, 2018 · 36 comments
Labels
Milestone

Comments

@ChristianCiach
Copy link

We have some unit tests that create GUI components. Some of these fail with this stacktrace when using adoptopenjdk/openjdk11:latest:

        java.lang.NullPointerException
            at java.desktop/sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1262)
            at java.desktop/sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:225)
            at java.desktop/sun.awt.FontConfiguration.init(FontConfiguration.java:107)
            at java.desktop/sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:719)
            at java.desktop/sun.font.SunFontManager$2.run(SunFontManager.java:367)
            at java.base/java.security.AccessController.doPrivileged(Native Method)
            at java.desktop/sun.font.SunFontManager.<init>(SunFontManager.java:312)
            at java.desktop/sun.awt.FcFontManager.<init>(FcFontManager.java:35)
            at java.desktop/sun.awt.X11FontManager.<init>(X11FontManager.java:56)

This is not a new issue, as seen here: docker-library/openjdk#46

This workaround also applies here: docker-library/openjdk@0f82de1 . You just have to install the package libfontconfig1 to fix this issue.

@karianna karianna added the bug label Oct 22, 2018
@karianna
Copy link
Member

@dinogun Is this something that was stripped out or something we missed in the base JDK/JRE that we give you?

@dinogun
Copy link
Collaborator

dinogun commented Oct 25, 2018

@ChristianCiach Are you testing the Alpine images as well ? If yes, do these tests fail there as well ? Want to make sure that we add this in both if needed, though I am not sure if the GUI usecase makes sense in the Alpine case.
@karianna The missing package is part of the base OS and not part of the JDK.

@ChristianCiach
Copy link
Author

This is probably just me being incompatible with mondays, but I can't find any Alpine images on Docker Hub. Strange, I was sure they were there before.

@dinogun
Copy link
Collaborator

dinogun commented Oct 29, 2018

You should find them here, specifically the tag adoptopenjdk/openjdk11:x86_64-alpine-jdk-11.28. The latest alpine is always accessible as adoptopenjdk/openjdk11:alpine

@ChristianCiach
Copy link
Author

The exact same NPE happens with the openjdk11:alpine image. I tried to install apk --no-cache add fontconfig ttf-dejavu into the image as seen here or here, but that doesn't fix it for me.

@minhtran83
Copy link

@ChristianCiach It happens the same with me too. Both fontconfig or ttf-dejavu does not work for me.
I have to switch to use ubuntu image, and it is good to me

@gamma
Copy link

gamma commented Nov 28, 2018

Adding a simple fontconfig.properties (see adoptium/temurin-build#693) in the $JAVA_HOME/lib directory fixes the NPE. But it still does not work and requires something else I couldn't find yet. Using -Dsun.java2d.debugfonts=warning I get the following warnings and errors:

Nov 28, 2018 11:18:02 AM sun.font.FcFontConfiguration warning
WARNING: Failed to get info from libfontconfig
...
Nov 28, 2018 11:18:02 AM sun.awt.X11FontManager specificFontIDForName
SEVERE: Font Configuration Font ID is malformed:
Nov 28, 2018 11:18:02 AM sun.awt.X11FontManager getFileNameFromPlatformName
WARNING: ** Registering all font paths because can't find file for 
Nov 28, 2018 11:18:02 AM sun.awt.X11FontManager getFileNameFromPlatformName
WARNING: ** Finished registering all font paths
Nov 28, 2018 11:18:02 AM sun.awt.X11FontManager switchFontIDForName
SEVERE: Font Configuration Font ID is malformed:

I asume that the simple fontconfig.propertiesdoes not suffice, but what has to go in it? Can it be generated?

@gamma
Copy link

gamma commented Nov 28, 2018

I asume that the simple fontconfig.propertiesdoes not suffice, but what has to go in it? Can it be generated?

I checked further. ldd /usr/lib/libfontconfig.so.1 gives the dependencies. I tried loading the lib from java by hand (System.loadLibrary("fontconfig")) - which threw an error that libc.musl-x86_64.so.1 was missing. But it is there in /lib

I linked it into /usr/lib.

Second: I had to set LD_LIBRARY_PATH=/usr/lib

Now it works.

@jcoetzee
Copy link
Contributor

Experiencing the same. Installing ttf-dejavu and fontconfig doesn't help.

@gamma
Copy link

gamma commented Dec 10, 2018

@jcoetzee have you checked my solution, setting the LD_LIBRARY_PATH as ENV and checking that libc.musl-x86_64.so.1 is available in /usr/lib

@jcoetzee
Copy link
Contributor

@gamma Just tried and it works even without creating the simple fontconfig.properties file (which is what I wanted to avoid). Thanks.

@jcoetzee
Copy link
Contributor

For those wondering, the workaround can be summarised as

RUN ln -s /lib/libc.musl-x86_64.so.1 /usr/lib/libc.musl-x86_64.so.1
ENV LD_LIBRARY_PATH /usr/lib

@jgkirschbaum
Copy link

Installing packages fontconfig and urw-fonts on CentOS 6 & 7 fixed the issue.

@ReillyTevera
Copy link
Contributor

ReillyTevera commented Mar 5, 2019

I wasn't able to get it working just with the workaround as described by @jcoetzee. I had to softlink a few additional libraries as well to make the JVM happy.

Full workaround (tested with adoptopenjdk/openjdk8-openj9:jdk8u202-b08_openj9-0.12.1-alpine and adoptopenjdk/openjdk11:jdk-11.0.2.9-alpine):

RUN apk add --no-cache fontconfig
RUN ln -s /usr/lib/libfontconfig.so.1 /usr/lib/libfontconfig.so && \
    ln -s /lib/libuuid.so.1 /usr/lib/libuuid.so.1 && \
    ln -s /lib/libc.musl-x86_64.so.1 /usr/lib/libc.musl-x86_64.so.1
ENV LD_LIBRARY_PATH /usr/lib

@cwrau
Copy link

cwrau commented Mar 6, 2019

@ReillyProcentive
I can say that this workaround works for me, with imageadoptopenjdk/openjdk11:jdk-11.0.2.9-alpine-slim
Thank you!

timorantalaiho added a commit to Opetushallitus/baseimage-fatjar that referenced this issue Mar 18, 2019
This should fix the error with e.g. Apache POI
that we use for handling excel sheets.

AdoptOpenJDK/openjdk-docker#75
timorantalaiho added a commit to Opetushallitus/baseimage-fatjar that referenced this issue Mar 18, 2019
This should fix the error with e.g. Apache POI
that we use for handling excel sheets.

AdoptOpenJDK/openjdk-docker#75
timorantalaiho added a commit to Opetushallitus/baseimage-fatjar that referenced this issue Mar 18, 2019
This should fix the error with e.g. Apache POI
that we use for handling excel sheets.

AdoptOpenJDK/openjdk-docker#75
timorantalaiho added a commit to Opetushallitus/baseimage-fatjar that referenced this issue Mar 18, 2019
This should fix the error with e.g. Apache POI
that we use for handling excel sheets.

AdoptOpenJDK/openjdk-docker#75
timorantalaiho added a commit to Opetushallitus/baseimage-fatjar that referenced this issue Mar 19, 2019
This should fix the error with e.g. Apache POI
that we use for handling excel sheets.

AdoptOpenJDK/openjdk-docker#75
@DukeyToo
Copy link

DukeyToo commented Mar 27, 2019

Above fixes for me too. fontconfig and libuuid symbolic links were not needed in adoptopenjdk/openjdk11:jdk-11.0.1.13-alpine but they are needed in adoptopenjdk/openjdk11:jdk-11.0.2.9-alpine. Also added libuuid apk package, which I did not have before.

@robinvanpraet
Copy link

This made it work for me:

RUN apt-get update && apt-get install -y --no-install-recommends fontconfig
RUN ln -s /usr/lib/libfontconfig.so.1 /usr/lib/libfontconfig.so && \
    ln -s /lib/libuuid.so.1 /usr/lib/libuuid.so.1 && \
    ln -s /lib/libc.musl-x86_64.so.1 /usr/lib/libc.musl-x86_64.so.1
ENV LD_LIBRARY_PATH /usr/lib

I'm using the adoptopenjdk/openjdk11:jdk-11.0.1.13-slim image

@ReillyTevera
Copy link
Contributor

For AdoptOpenJDK developers here is a reliable way to reproduce the issue (using the adoptopenjdk/openjdk8-openj9:jdk8u202-b08_openj9-0.12.1-alpine image):

apk add --no-cache fontconfig

public class Main {
  public static void main(String[] args) {
      System.loadLibrary("fontconfig");
    }
}

This fails with the error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: fontconfig (Not found in java.library.path)
	at java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:1434)
	at java.lang.ClassLoader.loadLibraryWithClassLoader(ClassLoader.java:1404)
	at java.lang.System.loadLibrary(System.java:540)
	at Main.main(Main.java:21)

Interestingly this fails in both the AdoptOpenJDK and Alpine docker images (openjdk:8u201-jre-alpine3.9). It appears that when the fontconfig library is installed it gets created at /usr/lib/libfontconfig.so.1 and OpenJDK is unable to detect libraries that do not end in .so (thus the first symbolic link creation). An upstream issue should probably be created for this issue but I'm unsure as to where it should go (the OpenJDK project itself?).

After you link the first library (ln -s /usr/lib/libfontconfig.so.1 /usr/lib/libfontconfig.so) you run into the second issue which is that the default list of Java libraries (java.library.path) is seemingly ignored. This issue is only present in AdoptOpenJDK.

If you run java -XshowSettings:properties you see that the following is the default list of library paths:

    java.library.path = /opt/java/openjdk/jre/lib/amd64/compressedrefs
        /opt/java/openjdk/jre/lib/amd64
        /usr/lib64
        /usr/lib

Interestingly AdoptOpenJDK seemingly ignores these and is thus unable to load fontconfig even after the first issue is worked around. Additionally setting these through a flag doesn't seem to work (-Djava.library.path=/usr/lib:/lib) but setting them through an environmental variable (export LD_LIBRARY_PATH=/usr/lib:/lib) seems to work.

A third issue seems to be present in JDK11 builds but not JDK 8 builds. This issue is that Java seems to fatally exit if /lib is included in the list of library paths. This error is the reason behind only using /usr/lib in the workaround and then softlinking the libraries that fontconfig needs into /usr/lib.

Error message:

/linked # export LD_LIBRARY_PATH=/usr/lib:/lib
/linked # java Main
Picked up JAVA_TOOL_OPTIONS: -XX:+UseContainerSupport
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f703dbad518, pid=82, tid=83
#
# JRE version:  (11.0.2+9) (build )
# Java VM: OpenJDK 64-Bit Server VM (11.0.2+9, mixed mode, aot, sharing, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# C  [libc.so.6+0x52518]
#
# Core dump will be written. Default location: core.82 (may not exist)
#
# An error report file with more information is saved as:
# /linked/hs_err_pid82.log
#
# If you would like to submit a bug report, please visit:
#   https://github.com/AdoptOpenJDK/openjdk-build/issues
#
Aborted (core dumped)
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f703dbad518, pid=82, tid=83
#
# JRE version:  (11.0.2+9) (build )
# Java VM: OpenJDK 64-Bit Server VM (11.0.2+9, mixed mode, aot, sharing, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# C  [libc.so.6+0x52518]
#
# Core dump will be written. Default location: core.82 (may not exist)
#
# If you would like to submit a bug report, please visit:
#   https://github.com/AdoptOpenJDK/openjdk-build/issues
#

---------------  S U M M A R Y ------------

Command Line: -XX:+UseContainerSupport Main

Host: Intel(R) Xeon(R) CPU E3-1240 v5 @ 3.50GHz, 
[error occurred during error reporting (printing summary machine and OS info), id 0xb, SIGSEGV (0xb) at pc=0x00007f703dbad518]

Time: Wed Apr 10 19:27:03 2019 UTC elapsed time: 0 seconds (0d 0h 0m 0s)

---------------  T H R E A D  ---------------

Current thread (0x00007f7038010800):  JavaThread "Unknown thread" [_thread_in_vm, id=83, stack(0x00007f703e5c0000,0x00007f703e6c1000)]

Stack: [0x00007f703e5c0000,0x00007f703e6c1000],  sp=0x00007f703e6bd1c0,  free space=1012k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libc.so.6+0x52518]


siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000000048

Registers:
RAX=0x00000000fbad8001, RBX=0x00007f703e6bd8c0, RCX=0x0000000000000000, RDX=0x0000000000000000
RSP=0x00007f703e6bd1c0, RBP=0x00007f703e6bd890, RSI=0x00007f7038010800, RDI=0x00007f703e6bd8c0
R8 =0x0000000000000000, R9 =0x00007f7038000000, R10=0xfffffffffffff000, R11=0x0000000000000000
R12=0x00007f703e6beaa0, R13=0x00007f703e6bd8c0, R14=0x00007f703e6bda90, R15=0x00007f703d61757e
RIP=0x00007f703dbad518, EFLAGS=0x0000000000010206, CSGSFS=0x002b000000000033, ERR=0x0000000000000004
  TRAPNO=0x000000000000000e

Top of Stack: (sp=0x00007f703e6bd1c0)
0x00007f703e6bd1c0:   000000000005000a ffffffffffffffff
0x00007f703e6bd1d0:   0000000000050036 0000000000000000
0x00007f703e6bd1e0:   00007f703e6bd8e0 0000000000000000
0x00007f703e6bd1f0:   0000000000000013 00007f703e6bd910 

Instructions: (pc=0x00007f703dbad518)
0x00007f703dbad4f8:   41 8b 45 00 a8 04 0f 85 6c 25 00 00 48 85 f6 0f
0x00007f703dbad508:   84 8d 39 00 00 48 8b b5 00 fa ff ff 48 8b 56 08
0x00007f703dbad518:   48 8b 7a 48 48 8b 72 40 ba 00 00 00 00 80 3f 00
0x00007f703dbad528:   48 89 b5 58 f9 ff ff 8b 35 ab b1 36 00 48 0f 45 


---------------  P R O C E S S  ---------------

Threads class SMR info:
_java_thread_list=0x0000000001846810, length=0, elements={
}

Java Threads: ( => current thread )

Other Threads:

[error occurred during error reporting (printing all threads), id 0xb, SIGSEGV (0xb) at pc=0x00007f703d4efe93]

VM state:not at safepoint (not fully initialized)

VM Mutex/Monitor currently owned by a thread: None


[error occurred during error reporting (printing compressed oops mode), id 0xb, SIGSEGV (0xb) at pc=0x00007f703d5129b3]

Deoptimization events (0 events):
No events

Classes redefined (0 events):
No events

Internal exceptions (0 events):
No events

Events (0 events):
No events


Dynamic libraries:
00400000-00401000 r-xp 00000000 fd:02 12749247                           /opt/java/openjdk/bin/java
00600000-00601000 r--p 00000000 fd:02 12749247                           /opt/java/openjdk/bin/java
00601000-00602000 rw-p 00001000 fd:02 12749247                           /opt/java/openjdk/bin/java
01843000-01864000 rw-p 00000000 00:00 0                                  [heap]
7f702ef11000-7f7037589000 r--s 00000000 fd:02 13000521                   /opt/java/openjdk/lib/modules
7f7037589000-7f70375a4000 r-xp 00000000 fd:02 13000502                   /opt/java/openjdk/lib/libjimage.so
7f70375a4000-7f70377a4000 ---p 0001b000 fd:02 13000502                   /opt/java/openjdk/lib/libjimage.so
7f70377a4000-7f70377a6000 r--p 0001b000 fd:02 13000502                   /opt/java/openjdk/lib/libjimage.so
7f70377a6000-7f70377a7000 rw-p 0001d000 fd:02 13000502                   /opt/java/openjdk/lib/libjimage.so
7f70377a7000-7f70377ae000 r-xp 00000000 fd:02 13000520                   /opt/java/openjdk/lib/libzip.so
7f70377ae000-7f70379ad000 ---p 00007000 fd:02 13000520                   /opt/java/openjdk/lib/libzip.so
7f70379ad000-7f70379ae000 r--p 00006000 fd:02 13000520                   /opt/java/openjdk/lib/libzip.so
7f70379ae000-7f70379af000 rw-p 00007000 fd:02 13000520                   /opt/java/openjdk/lib/libzip.so
7f70379af000-7f70379ba000 r-xp 00000000 fd:02 12749185                   /usr/glibc-compat/lib/libnss_files-2.29.so
7f70379ba000-7f7037bb9000 ---p 0000b000 fd:02 12749185                   /usr/glibc-compat/lib/libnss_files-2.29.so
7f7037bb9000-7f7037bba000 r--p 0000a000 fd:02 12749185                   /usr/glibc-compat/lib/libnss_files-2.29.so
7f7037bba000-7f7037bbb000 rw-p 0000b000 fd:02 12749185                   /usr/glibc-compat/lib/libnss_files-2.29.so
7f7037bbb000-7f7037bc1000 rw-p 00000000 00:00 0 
7f7037bc1000-7f7037bea000 r-xp 00000000 fd:02 13000498                   /opt/java/openjdk/lib/libjava.so
7f7037bea000-7f7037dea000 ---p 00029000 fd:02 13000498                   /opt/java/openjdk/lib/libjava.so
7f7037dea000-7f7037deb000 r--p 00029000 fd:02 13000498                   /opt/java/openjdk/lib/libjava.so
7f7037deb000-7f7037ded000 rw-p 0002a000 fd:02 13000498                   /opt/java/openjdk/lib/libjava.so
7f7037ded000-7f7037dfe000 r-xp 00000000 fd:02 13000519                   /opt/java/openjdk/lib/libverify.so
7f7037dfe000-7f7037ffd000 ---p 00011000 fd:02 13000519                   /opt/java/openjdk/lib/libverify.so
7f7037ffd000-7f7037fff000 r--p 00010000 fd:02 13000519                   /opt/java/openjdk/lib/libverify.so
7f7037fff000-7f7038000000 rw-p 00012000 fd:02 13000519                   /opt/java/openjdk/lib/libverify.so
7f7038000000-7f7038047000 rw-p 00000000 00:00 0 
7f7038047000-7f703c000000 ---p 00000000 00:00 0 
7f703c1f7000-7f703c1fe000 r-xp 00000000 fd:02 12749198                   /usr/glibc-compat/lib/librt-2.29.so
7f703c1fe000-7f703c3fd000 ---p 00007000 fd:02 12749198                   /usr/glibc-compat/lib/librt-2.29.so
7f703c3fd000-7f703c3fe000 r--p 00006000 fd:02 12749198                   /usr/glibc-compat/lib/librt-2.29.so
7f703c3fe000-7f703c3ff000 rw-p 00007000 fd:02 12749198                   /usr/glibc-compat/lib/librt-2.29.so
7f703c3ff000-7f703c53f000 r-xp 00000000 fd:02 12749167                   /usr/glibc-compat/lib/libm-2.29.so
7f703c53f000-7f703c73e000 ---p 00140000 fd:02 12749167                   /usr/glibc-compat/lib/libm-2.29.so
7f703c73e000-7f703c73f000 r--p 0013f000 fd:02 12749167                   /usr/glibc-compat/lib/libm-2.29.so
7f703c73f000-7f703c740000 rw-p 00140000 fd:02 12749167                   /usr/glibc-compat/lib/libm-2.29.so
7f703c740000-7f703d812000 r-xp 00000000 fd:02 13000532                   /opt/java/openjdk/lib/server/libjvm.so
7f703d812000-7f703da11000 ---p 010d2000 fd:02 13000532                   /opt/java/openjdk/lib/server/libjvm.so
7f703da11000-7f703dacf000 r--p 010d1000 fd:02 13000532                   /opt/java/openjdk/lib/server/libjvm.so
7f703dacf000-7f703db08000 rw-p 0118f000 fd:02 13000532                   /opt/java/openjdk/lib/server/libjvm.so
7f703db08000-7f703db5b000 rw-p 00000000 00:00 0 
7f703db5b000-7f703dd0f000 r-xp 00000000 fd:02 12749156                   /usr/glibc-compat/lib/libc-2.29.so
7f703dd0f000-7f703df0f000 ---p 001b4000 fd:02 12749156                   /usr/glibc-compat/lib/libc-2.29.so
7f703df0f000-7f703df13000 r--p 001b4000 fd:02 12749156                   /usr/glibc-compat/lib/libc-2.29.so
7f703df13000-7f703df15000 rw-p 001b8000 fd:02 12749156                   /usr/glibc-compat/lib/libc-2.29.so
7f703df15000-7f703df19000 rw-p 00000000 00:00 0 
7f703df19000-7f703df1c000 r-xp 00000000 fd:02 12749162                   /usr/glibc-compat/lib/libdl-2.29.so
7f703df1c000-7f703e11b000 ---p 00003000 fd:02 12749162                   /usr/glibc-compat/lib/libdl-2.29.so
7f703e11b000-7f703e11c000 r--p 00002000 fd:02 12749162                   /usr/glibc-compat/lib/libdl-2.29.so
7f703e11c000-7f703e11d000 rw-p 00003000 fd:02 12749162                   /usr/glibc-compat/lib/libdl-2.29.so
7f703e11d000-7f703e12d000 r-xp 00000000 fd:02 13000482                   /opt/java/openjdk/lib/jli/libjli.so
7f703e12d000-7f703e32c000 ---p 00010000 fd:02 13000482                   /opt/java/openjdk/lib/jli/libjli.so
7f703e32c000-7f703e32d000 r--p 0000f000 fd:02 13000482                   /opt/java/openjdk/lib/jli/libjli.so
7f703e32d000-7f703e32e000 rw-p 00010000 fd:02 13000482                   /opt/java/openjdk/lib/jli/libjli.so
7f703e32e000-7f703e348000 r-xp 00000000 fd:02 12749192                   /usr/glibc-compat/lib/libpthread-2.29.so
7f703e348000-7f703e547000 ---p 0001a000 fd:02 12749192                   /usr/glibc-compat/lib/libpthread-2.29.so
7f703e547000-7f703e548000 r--p 00019000 fd:02 12749192                   /usr/glibc-compat/lib/libpthread-2.29.so
7f703e548000-7f703e549000 rw-p 0001a000 fd:02 12749192                   /usr/glibc-compat/lib/libpthread-2.29.so
7f703e549000-7f703e54d000 rw-p 00000000 00:00 0 
7f703e54d000-7f703e574000 r-xp 00000000 fd:02 12749147                   /usr/glibc-compat/lib/ld-2.29.so
7f703e5b6000-7f703e5be000 rw-s 00000000 fd:02 1248391                    /tmp/hsperfdata_root/82
7f703e5be000-7f703e5bf000 ---p 00000000 00:00 0 
7f703e5bf000-7f703e5c0000 r--p 00000000 00:00 0 
7f703e5c0000-7f703e5c4000 ---p 00000000 00:00 0 
7f703e5c4000-7f703e6c3000 rw-p 00000000 00:00 0 
7f703e6c3000-7f703e6da000 r--p 00000000 fd:02 1193431                    /lib/ld-musl-x86_64.so.1
7f703e6da000-7f703e71f000 r-xp 00017000 fd:02 1193431                    /lib/ld-musl-x86_64.so.1
7f703e71f000-7f703e751000 r--p 0005c000 fd:02 1193431                    /lib/ld-musl-x86_64.so.1
7f703e751000-7f703e752000 r--p 0008d000 fd:02 1193431                    /lib/ld-musl-x86_64.so.1
7f703e752000-7f703e753000 rw-p 0008e000 fd:02 1193431                    /lib/ld-musl-x86_64.so.1
7f703e753000-7f703e756000 rw-p 00000000 00:00 0 
7f703e757000-7f703e75a000 r--p 00000000 fd:02 1193436                    /lib/libz.so.1.2.11
7f703e75a000-7f703e768000 r-xp 00003000 fd:02 1193436                    /lib/libz.so.1.2.11
7f703e768000-7f703e76f000 r--p 00011000 fd:02 1193436                    /lib/libz.so.1.2.11
7f703e76f000-7f703e770000 r--p 00017000 fd:02 1193436                    /lib/libz.so.1.2.11
7f703e770000-7f703e771000 rw-p 00018000 fd:02 1193436                    /lib/libz.so.1.2.11
7f703e771000-7f703e773000 rw-p 00000000 00:00 0 
7f703e773000-7f703e774000 r--p 00026000 fd:02 12749147                   /usr/glibc-compat/lib/ld-2.29.so
7f703e774000-7f703e775000 rw-p 00027000 fd:02 12749147                   /usr/glibc-compat/lib/ld-2.29.so
7f703e775000-7f703e776000 rw-p 00000000 00:00 0 
7ffde5f95000-7ffde5fb6000 rw-p 00000000 00:00 0                          [stack]
7ffde5fbc000-7ffde5fbf000 r--p 00000000 00:00 0                          [vvar]
7ffde5fbf000-7ffde5fc0000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]


VM Arguments:
jvm_args: -XX:+UseContainerSupport 
java_command: Main
java_class_path (initial): .
Launcher Type: SUN_STANDARD

[Global flags]
     uint G1ConcRefinementThreads                  = 8                                         {product} {ergonomic}
    uintx GCDrainStackTargetSize                   = 64                                        {product} {ergonomic}
   size_t InitialHeapSize                          = 328760448                                 {product} {ergonomic}
   size_t MaxHeapSize                              = 5260167168                                {product} {ergonomic}
    uintx ReservedCodeCacheSize                    = 251658240                              {pd product} {ergonomic}
     bool SegmentedCodeCache                       = true                                      {product} {ergonomic}
     bool UseCompressedClassPointers               = true                                 {lp64_product} {ergonomic}
     bool UseCompressedOops                        = true                                 {lp64_product} {ergonomic}
     bool UseContainerSupport                      = true                                      {product} {environment}
     bool UseG1GC                                  = true                                      {product} {ergonomic}

Logging:
Log output configuration:
 #0: stdout all=warning uptime,level,tags
 #1: stderr all=off uptime,level,tags

Environment Variables:
JAVA_HOME=/opt/java/openjdk
JAVA_TOOL_OPTIONS=-XX:+UseContainerSupport
PATH=/opt/java/openjdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
LD_LIBRARY_PATH=/usr/lib:/lib

Signal Handlers:
SIGSEGV: [libjvm.so+0xe1b7f0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGBUS: [libjvm.so+0xe1b7f0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGFPE: [libjvm.so+0xe1b7f0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGPIPE: [libjvm.so+0xbef880], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGXFSZ: [libjvm.so+0xbef880], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGILL: [libjvm.so+0xe1b7f0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGUSR2: [libjvm.so+0xbef720], sa_mask[0]=00000000000000000000000000000000, sa_flags=SA_RESTART|SA_SIGINFO
SIGHUP: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGINT: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGTERM: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGQUIT: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none


---------------  S Y S T E M  ---------------

OS:NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.9.0
PRETTY_NAME="Alpine Linux v3.9"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/"
uname:Linux 5.0.5-113.current #1 SMP PREEMPT Sat Mar 30 15:03:15 UTC 2019 x86_64
libc:glibc 2.29 NPTL 2.29 
rlimit: STACK 8192k, CORE infinity, NPROC infinity, NOFILE 1048576, AS infinity, DATA infinity, FSIZE infinity
load average:
[error occurred during error reporting (printing OS information), id 0xb, SIGSEGV (0xb) at pc=0x00007f703dba6129]

CPU:total 8 (initial active 8) 
CPU Model and flags from /proc/cpuinfo:
model name	: Intel(R) Xeon(R) CPU E3-1240 v5 @ 3.50GHz
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp flush_l1d

Memory: 4k page
[error occurred during error reporting (printing memory info), id 0xb, SIGSEGV (0xb) at pc=0x00007f703dbad518]

vm_info: OpenJDK 64-Bit Server VM (11.0.2+9) for linux-amd64 JRE (11.0.2+9), built on Jan 28 2019 15:50:01 by "jenkins" with gcc 7.3.1 20180303 (Red Hat 7.3.1-5)

END.

@karianna karianna added this to the April 2019 milestone Apr 11, 2019
rahcola pushed a commit to Opetushallitus/baseimage-fatjar that referenced this issue Apr 18, 2019
This should fix the error with e.g. Apache POI
that we use for handling excel sheets.

AdoptOpenJDK/openjdk-docker#75
@karianna karianna modified the milestones: April 2019, May 2019 May 1, 2019
@karianna karianna modified the milestones: October 2020, November 2020 Nov 5, 2020
@oliviermeurice
Copy link

With adoptopenjdk/openjdk8:alpine-jre I had to do this to have X11 (java app GUI) redirected to the host:
RUN apk add xorg-server
&& apk add libxrender
&& apk add libxtst
&& apk add libxi
&& apk add ttf-dejavu
&& rm -rf /var/cache/apk/*

Adding fontconfig did not solve the NPE. Instead I had to add a font package (here I added ttf-dejavu).

@karianna
Copy link
Member

Closing this issue in favor of a more specific one for Alpine since this appears to be resolved for all other platforms. If you have a specific docker image of ours that does not work, please raise a separate issue.

@ygordaudt
Copy link

ygordaudt commented May 16, 2021

Não consegui fazer funcionar apenas com a solução alternativa descrita por @jcoetzee . Tive que fazer um softlink de algumas bibliotecas adicionais também para deixar o JVM feliz.

Solução alternativa completa (testado com adoptopenjdk/openjdk8-openj9:jdk8u202-b08_openj9-0.12.1-alpinee adoptopenjdk/openjdk11:jdk-11.0.2.9-alpine):

RUN apk add --no-cache fontconfig
RUN ln -s /usr/lib/libfontconfig.so.1 /usr/lib/libfontconfig.so && \
    ln -s /lib/libuuid.so.1 /usr/lib/libuuid.so.1 && \
    ln -s /lib/libc.musl-x86_64.so.1 /usr/lib/libc.musl-x86_64.so.1
ENV LD_LIBRARY_PATH /usr/lib

It worked perfectly for me. You rock!

Tested on adoptopenjdk/openjdk11:alpine-jre

@mattpsvreis
Copy link

Sorry to re-open this issue, but it was never mentioned the following image: amazoncorretto:11-alpine-jdk.

The same stack trace as the OP happens when using the autoSizeColumn() function from the Sheet class that was generated by the createSheet() function from the HSSFWorkbook class from the package org.apache.poi.hssf.usermodel.HSSFWorkbook while running in a Docker container that uses amazoncorretto:11-alpine-jdk as the image for Java, using the Spring Boot Framework.

After digging I stumbled upon many 'fixes', including this GitHub Issue, but all suggested fixes didn't work. The same stack trace continues to happen.

Further help would be appreciated!

@ReillyBrogan
Copy link

Sorry to re-open this issue, but it was never mentioned the following image: amazoncorretto:11-alpine-jdk.

Amazon Corretto is a completely different build of the JDK than the AdoptOpenJDK builds (now known as Adoptium), and is supported by a completely different vendor (Amazon).

I don't know what support resources Corretto has, but you should utilize them instead.

@mattpsvreis
Copy link

Sorry to re-open this issue, but it was never mentioned the following image: amazoncorretto:11-alpine-jdk.

Amazon Corretto is a completely different build of the JDK than the AdoptOpenJDK builds (now known as Adoptium), and is supported by a completely different vendor (Amazon).

I don't know what support resources Corretto has, but you should utilize them instead.

Figured as much, but posted it here just in case someone passes by this popular GitHub issue can see that I mentioned it in a different thread, and also stated that I had the same issue but with a different JDK!

Also, if anyone here happens to have a light, it'd be appreciated. But I'm not expecting much truthfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests