AdoptOpenJDK / openjdk-docker

Scripts for creating Docker images of OpenJDK binaries.
https://hub.docker.com/_/adoptopenjdk/
Apache License 2.0
426 stars 237 forks source link

adoptopenjdk/openjdk11:alpine-jre fontconfig Segfault #520

Closed mjp91 closed 3 years ago

mjp91 commented 3 years ago

Seems to have been introduced in a recent update to base Alpine image (3.13).

Are there any older tags available so we can revert back to 3.12 or do I need to build my own image?

FROM adoptopenjdk/openjdk11:alpine-jre

# omitted for brevity

RUN apk add --no-cache fontconfig ttf-dejavu

# omitted for brevity
 #
 # A fatal error has been detected by the Java Runtime Environment:
 #
 #  SIGSEGV (0xb) at pc=0x00007f44de379980, pid=1, tid=109
 #
 # JRE version: OpenJDK Runtime Environment AdoptOpenJDK (11.0.10+9) (build 11.0.10+9)
 # Java VM: OpenJDK 64-Bit Server VM AdoptOpenJDK (11.0.10+9, mixed mode, tiered, compressed oops, g1 gc, linux-amd64)
 # Problematic frame:
 # C  [libc.so.6+0x81980]  _IO_link_in+0x1f0
 #
 # Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %d %P %E" (or dumping to /application/core.1)
 #
 # If you would like to submit a bug report, please visit:
 #   https://github.com/AdoptOpenJDK/openjdk-support/issues
 # The crash happened outside the Java Virtual Machine in native code.
 # See problematic frame for where to report the bug.
 #

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

 Command Line: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8000 -javaagent:BOOT-INF/lib/aspectjweaver-1.9.6.jar -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/usr/p4/dumps org.           springframework.boot.loader.JarLauncher

 Host:
 [error occurred during error reporting (printing summary machine and OS info), id 0xb, SIGSEGV (0xb) at pc=0x00007f44de379980]

 Time: Fri Feb 26 13:14:05 2021 Europe elapsed time: 248.683114 seconds (0d 0h 4m 8s)

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

 Current thread (0x00007f44340de000):  JavaThread "workExecutor-1" [_thread_in_native, id=109, stack(0x00007f443cea8000,0x00007f443cfa9000)]

 Stack: [0x00007f443cea8000,0x00007f443cfa9000],  sp=0x00007f443cfa1ea0,  free space=999k
 Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
 C  [libc.so.6+0x81980]  _IO_link_in+0x1f0

 Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
 j  sun.font.FontConfigManager.getFontConfig(Ljava/lang/String;Lsun/font/FontConfigManager$FontConfigInfo;[Lsun/font/FontConfigManager$FcCompFont;Z)V+0 java.desktop@11.0.10
 j  sun.font.FontConfigManager.initFontConfigFonts(Z)V+178 java.desktop@11.0.10
 j  sun.font.FontConfigManager.loadFontConfig()[Lsun/font/FontConfigManager$FcCompFont;+2 java.desktop@11.0.10
 j  sun.font.FcFontConfiguration.init()Z+39 java.desktop@11.0.10
 j  sun.font.FcFontConfiguration.<init>(Lsun/font/SunFontManager;)V+16 java.desktop@11.0.10
 j  sun.awt.X11FontManager.createFontConfiguration()Lsun/awt/FontConfiguration;+40 java.desktop@11.0.10
 j  sun.font.SunFontManager$2.run()Ljava/lang/Object;+175 java.desktop@11.0.10
 v  ~StubRoutines::call_stub
 J 2146  java.security.AccessController.doPrivileged(Ljava/security/PrivilegedAction;)Ljava/lang/Object; java.base@11.0.10 (0 bytes) @ 0x00007f44caee788f [0x00007f44caee7840+0x000000000000004f]
 j  sun.font.SunFontManager.<init>()V+223 java.desktop@11.0.10
 j  sun.awt.FcFontManager.<init>()V+1 java.desktop@11.0.10
 j  sun.awt.X11FontManager.<init>()V+1 java.desktop@11.0.10
v  ~StubRoutines::call_stub
 J 2770  jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Ljava/lang/reflect/Constructor;[Ljava/lang/Object;)Ljava/lang/Object; java.base@11.0.10 (0 bytes) @ 0x00007f44caf552a3                   [0x00007f44caf55240+0x0000000000000063]
 J 23295 c2 jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance([Ljava/lang/Object;)Ljava/lang/Object; java.base@11.0.10 (89 bytes) @ 0x00007f44cc06db84 [0x00007f44cc06db20+0x0000000000000064]
 J 14152 c2 java.lang.reflect.Constructor.newInstance([Ljava/lang/Object;)Ljava/lang/Object; java.base@11.0.10 (76 bytes) @ 0x00007f44cb7df690 [0x00007f44cb7df560+0x0000000000000130]
 j  sun.font.FontManagerFactory$1.run()Ljava/lang/Object;+32 java.desktop@11.0.10
 v  ~StubRoutines::call_stub
 J 2146  java.security.AccessController.doPrivileged(Ljava/security/PrivilegedAction;)Ljava/lang/Object; java.base@11.0.10 (0 bytes) @ 0x00007f44caee788f [0x00007f44caee7840+0x000000000000004f]
 j  sun.font.FontManagerFactory.getInstance()Lsun/font/FontManager;+17 java.desktop@11.0.10
 j  sun.java2d.SunGraphicsEnvironment.getFontManagerForSGE()Lsun/font/FontManagerForSGE;+0 java.desktop@11.0.10
 j  sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames(Ljava/util/Locale;)[Ljava/lang/String;+0 java.desktop@11.0.10
 j  sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames()[Ljava/lang/String;+4 java.desktop@11.0.10
 j  sun.java2d.HeadlessGraphicsEnvironment.getAvailableFontFamilyNames()[Ljava/lang/String;+4 java.desktop@11.0.10
 j  net.sf.jasperreports.engine.util.JRGraphEnvInitializer.initializeGraphEnv()V+22
 j  net.sf.jasperreports.engine.fill.BaseReportFiller.<init>(Lnet/sf/jasperreports/engine/JasperReportsContext;Lnet/sf/jasperreports/engine/fill/JasperReportSource;Lnet/sf/jasperreports/engine/fill/            FillerParent;)V+9
 j  net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(Lnet/sf/jasperreports/engine/JasperReportsContext;Lnet/sf/jasperreports/engine/fill/JasperReportSource;Lnet/sf/jasperreports/engine/fill/                BandReportFillerParent;)V+4
 j  net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(Lnet/sf/jasperreports/engine/JasperReportsContext;Lnet/sf/jasperreports/engine/fill/JasperReportSource;Lnet/sf/jasperreports/engine/fill/            BandReportFillerParent;)V+4
 j  net.sf.jasperreports.engine.fill.JRFiller.createBandReportFiller(Lnet/sf/jasperreports/engine/JasperReportsContext;Lnet/sf/jasperreports/engine/fill/JasperReportSource;)Lnet/sf/jasperreports/engine/fill/   JRBaseFiller;+65
 j  net.sf.jasperreports.engine.fill.JRFiller.createReportFiller(Lnet/sf/jasperreports/engine/JasperReportsContext;Lnet/sf/jasperreports/engine/fill/JasperReportSource;)Lnet/sf/jasperreports/engine/fill/       ReportFiller;+58
 j  net.sf.jasperreports.engine.fill.JRFiller.fill(Lnet/sf/jasperreports/engine/JasperReportsContext;Lnet/sf/jasperreports/engine/fill/JasperReportSource;Ljava/util/Map;Lnet/sf/jasperreports/engine/            JRDataSource;)Lnet/sf/jasperreports/engine/JasperPrint;+2
 j  net.sf.jasperreports.engine.fill.JRFiller.fill(Lnet/sf/jasperreports/engine/JasperReportsContext;Lnet/sf/jasperreports/engine/JasperReport;Ljava/util/Map;Lnet/sf/jasperreports/engine/JRDataSource;)Lnet/sf/ jasperreports/engine/JasperPrint;+7
 j  net.sf.jasperreports.engine.JasperFillManager.fill(Lnet/sf/jasperreports/engine/JasperReport;Ljava/util/Map;Lnet/sf/jasperreports/engine/JRDataSource;)Lnet/sf/jasperreports/engine/JasperPrint;+7
 j  net.sf.jasperreports.engine.JasperFillManager.fillReport(Lnet/sf/jasperreports/engine/JasperReport;Ljava/util/Map;Lnet/sf/jasperreports/engine/JRDataSource;)Lnet/sf/jasperreports/engine/JasperPrint;+6
mjp91 commented 3 years ago

Could be related to #517, will try installing freetype

Edit: no luck, same error

btpeterson commented 3 years ago

@mjp91 I was running into similar issues when my alpine-slim base image updated from using Alpine 3.12 to 3.13 yesterday. I reverted to an older tag that uses Alpine 3.12 and the segfaults aren't happening anymore. This one from the previous release before the most recent release should still work without segfaults https://hub.docker.com/layers/adoptopenjdk/openjdk11/x86_64-alpine-jre-11.0.9.1_1/images/sha256-961d26d00378688d5dd6bd4e00859f8fc9faaf33e2bf3cd528db8306e778287f?context=explore

ggrossetie commented 3 years ago

I can confirm that adoptopenjdk/openjdk11:jre-11.0.10_9-alpine is now using Alpine 3.13.2:

$ docker run -it adoptopenjdk/openjdk11:jre-11.0.10_9-alpine 
/ # cat /etc/*release*
3.13.2
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.13.2
PRETTY_NAME="Alpine Linux v3.13"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/

I noticed it because I get the exact same Segfault as @mjp91:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fdb5260e980, pid=1, tid=32
#
# JRE version: OpenJDK Runtime Environment AdoptOpenJDK (11.0.10+9) (build 11.0.10+9)
# Java VM: OpenJDK 64-Bit Server VM AdoptOpenJDK (11.0.10+9, mixed mode, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# C  [libc.so.6+0x81980]  _IO_link_in+0x1f0
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %d %P %E" (or dumping to //core.1)
#
# An error report file with more information is saved as:
# //hs_err_pid1.log
#
# If you would like to submit a bug report, please visit:
#   AdoptOpenJDK/openjdk-support/issues
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
aahlenst commented 3 years ago

AdoptOpenJDK 11 is built against glibc. Alpine runs on musl libc and all libraries shipped with it do so, too. So if you blindly install any library that AdoptOpenJDK might need via apk, you're doing it wrong.

$ LD_DEBUG=libs java FontTest
       215: find library=libz.so.1 [0]; searching
       215:  search path=/opt/java/openjdk/bin/../lib/jli/tls/x86_64/x86_64:/opt/java/openjdk/bin/../lib/jli/tls/x86_64:/opt/java/openjdk/bin/../lib/jli/tls/x86_64:/opt/java/openjdk/bin/../lib/jli/tls:/opt/java/openjdk/bin/../lib/jli/x86_64/x86_64:/opt/java/openjdk/bin/../lib/jli/x86_64:/opt/java/openjdk/bin/../lib/jli/x86_64:/opt/java/openjdk/bin/../lib/jli:/opt/java/openjdk/bin/../lib/tls/x86_64/x86_64:/opt/java/openjdk/bin/../lib/tls/x86_64:/opt/java/openjdk/bin/../lib/tls/x86_64:/opt/java/openjdk/bin/../lib/tls:/opt/java/openjdk/bin/../lib/x86_64/x86_64:/opt/java/openjdk/bin/../lib/x86_64:/opt/java/openjdk/bin/../lib/x86_64:/opt/java/openjdk/bin/../lib        (RPATH from file java)
       215:   trying file=/opt/java/openjdk/bin/../lib/jli/tls/x86_64/x86_64/libz.so.1
       215:   trying file=/opt/java/openjdk/bin/../lib/jli/tls/x86_64/libz.so.1
       215:   trying file=/opt/java/openjdk/bin/../lib/jli/tls/x86_64/libz.so.1
       215:   trying file=/opt/java/openjdk/bin/../lib/jli/tls/libz.so.1
       215:   trying file=/opt/java/openjdk/bin/../lib/jli/x86_64/x86_64/libz.so.1
       215:   trying file=/opt/java/openjdk/bin/../lib/jli/x86_64/libz.so.1
       215:   trying file=/opt/java/openjdk/bin/../lib/jli/x86_64/libz.so.1
       215:   trying file=/opt/java/openjdk/bin/../lib/jli/libz.so.1
       215:   trying file=/opt/java/openjdk/bin/../lib/tls/x86_64/x86_64/libz.so.1
       215:   trying file=/opt/java/openjdk/bin/../lib/tls/x86_64/libz.so.1
       215:   trying file=/opt/java/openjdk/bin/../lib/tls/x86_64/libz.so.1
       215:   trying file=/opt/java/openjdk/bin/../lib/tls/libz.so.1
       215:   trying file=/opt/java/openjdk/bin/../lib/x86_64/x86_64/libz.so.1
       215:   trying file=/opt/java/openjdk/bin/../lib/x86_64/libz.so.1
       215:   trying file=/opt/java/openjdk/bin/../lib/x86_64/libz.so.1
       215:   trying file=/opt/java/openjdk/bin/../lib/libz.so.1
       215:  search cache=/usr/glibc-compat/etc/ld.so.cache
       215:   trying file=/usr/glibc-compat/lib/libz.so.1
       215: 
       215: find library=libpthread.so.0 [0]; searching
       215:  search path=/opt/java/openjdk/bin/../lib/jli:/opt/java/openjdk/bin/../lib      (RPATH from file java)
       215:   trying file=/opt/java/openjdk/bin/../lib/jli/libpthread.so.0
       215:   trying file=/opt/java/openjdk/bin/../lib/libpthread.so.0
       215:  search cache=/usr/glibc-compat/etc/ld.so.cache
       215:   trying file=/usr/glibc-compat/lib/libpthread.so.0
       215: 
       215: find library=libjli.so [0]; searching
       215:  search path=/opt/java/openjdk/bin/../lib/jli:/opt/java/openjdk/bin/../lib      (RPATH from file java)
       215:   trying file=/opt/java/openjdk/bin/../lib/jli/libjli.so
       215: 
       215: find library=libdl.so.2 [0]; searching
       215:  search path=/opt/java/openjdk/bin/../lib/jli:/opt/java/openjdk/bin/../lib      (RPATH from file java)
       215:   trying file=/opt/java/openjdk/bin/../lib/jli/libdl.so.2
       215:   trying file=/opt/java/openjdk/bin/../lib/libdl.so.2
       215:  search cache=/usr/glibc-compat/etc/ld.so.cache
       215:   trying file=/usr/glibc-compat/lib/libdl.so.2
       215: 
       215: find library=libc.so.6 [0]; searching
       215:  search path=/opt/java/openjdk/bin/../lib/jli:/opt/java/openjdk/bin/../lib      (RPATH from file java)
       215:   trying file=/opt/java/openjdk/bin/../lib/jli/libc.so.6
       215:   trying file=/opt/java/openjdk/bin/../lib/libc.so.6
       215:  search cache=/usr/glibc-compat/etc/ld.so.cache
       215:   trying file=/usr/glibc-compat/lib/libc.so.6
       215: 
       215: 
       215: calling init: /usr/glibc-compat/lib/libpthread.so.0
       215: 
       215: 
       215: calling init: /usr/glibc-compat/lib/libc.so.6
       215: 
       215: 
       215: calling init: /usr/glibc-compat/lib/libdl.so.2
       215: 
       215: 
       215: calling init: /usr/glibc-compat/lib/libz.so.1
       215: 
       215: 
       215: calling init: /opt/java/openjdk/bin/../lib/jli/libjli.so
       215: 
       215: 
       215: initialize program: java
       215: 
       215: 
       215: transferring control: java
       215: 
       215: find library=libm.so.6 [0]; searching
       215:  search path=/opt/java/openjdk/bin/../lib/jli:/opt/java/openjdk/bin/../lib      (RPATH from file java)
       215:   trying file=/opt/java/openjdk/bin/../lib/jli/libm.so.6
       215:   trying file=/opt/java/openjdk/bin/../lib/libm.so.6
       215:  search cache=/usr/glibc-compat/etc/ld.so.cache
       215:   trying file=/usr/glibc-compat/lib/libm.so.6
       215: 
       215: 
       215: calling init: /usr/glibc-compat/lib/libm.so.6
       215: 
       215: 
       215: calling init: /opt/java/openjdk/lib/server/libjvm.so
       215: 
       215: find library=librt.so.1 [0]; searching
       215:  search path=/opt/java/openjdk/bin/../lib/jli:/opt/java/openjdk/bin/../lib      (RPATH from file java)
       215:   trying file=/opt/java/openjdk/bin/../lib/jli/librt.so.1
       215:   trying file=/opt/java/openjdk/bin/../lib/librt.so.1
       215:  search cache=/usr/glibc-compat/etc/ld.so.cache
       215:   trying file=/usr/glibc-compat/lib/librt.so.1
       215: 
       215: 
       215: calling init: /usr/glibc-compat/lib/librt.so.1
       215: 
       215: 
       215: calling init: /opt/java/openjdk/lib/libverify.so
       215: 
       215: 
       215: calling init: /opt/java/openjdk/lib/libjava.so
       215: 
       215: 
       215: calling init: /opt/java/openjdk/lib/libjimage.so
       215: 
       215: /opt/java/openjdk/lib/server/libjvm.so: error: symbol lookup error: undefined symbol: JVM_begin_signal_setting (fatal)
       215: find library=libnss_files.so.2 [0]; searching
       215:  search path=/opt/java/openjdk/bin/../lib/jli:/opt/java/openjdk/bin/../lib      (RPATH from file java)
       215:   trying file=/opt/java/openjdk/bin/../lib/jli/libnss_files.so.2
       215:   trying file=/opt/java/openjdk/bin/../lib/libnss_files.so.2
       215:  search cache=/usr/glibc-compat/etc/ld.so.cache
       215:   trying file=/usr/glibc-compat/lib/libnss_files.so.2
       215: 
       215: 
       215: calling init: /usr/glibc-compat/lib/libnss_files.so.2
       215: 
       215: 
       215: calling init: /opt/java/openjdk/lib/libzip.so
       215: 
       215: /opt/java/openjdk/lib/libjava.so: error: symbol lookup error: undefined symbol: Java_java_security_AccessController_doPrivileged (fatal)
       215: /opt/java/openjdk/lib/libjava.so: error: symbol lookup error: undefined symbol: Java_jdk_internal_reflect_Reflection_getCallerClass (fatal)
       215: /opt/java/openjdk/lib/libjava.so: error: symbol lookup error: undefined symbol: Java_java_security_AccessController_doPrivileged (fatal)
       215: /opt/java/openjdk/lib/libjava.so: error: symbol lookup error: undefined symbol: Java_java_security_AccessController_doPrivileged (fatal)
       215: java: error: symbol lookup error: undefined symbol: JNI_OnLoad_nio (fatal)
       215: find library=libnet.so [0]; searching
       215:  search path=/opt/java/openjdk/lib/tls/x86_64/x86_64:/opt/java/openjdk/lib/tls/x86_64:/opt/java/openjdk/lib/tls/x86_64:/opt/java/openjdk/lib/tls:/opt/java/openjdk/lib/x86_64/x86_64:/opt/java/openjdk/lib/x86_64:/opt/java/openjdk/lib/x86_64:/opt/java/openjdk/lib        (RPATH from file /opt/java/openjdk/lib/libnio.so)
       215:   trying file=/opt/java/openjdk/lib/tls/x86_64/x86_64/libnet.so
       215:   trying file=/opt/java/openjdk/lib/tls/x86_64/libnet.so
       215:   trying file=/opt/java/openjdk/lib/tls/x86_64/libnet.so
       215:   trying file=/opt/java/openjdk/lib/tls/libnet.so
       215:   trying file=/opt/java/openjdk/lib/x86_64/x86_64/libnet.so
       215:   trying file=/opt/java/openjdk/lib/x86_64/libnet.so
       215:   trying file=/opt/java/openjdk/lib/x86_64/libnet.so
       215:   trying file=/opt/java/openjdk/lib/libnet.so
       215: 
       215: 
       215: calling init: /opt/java/openjdk/lib/libnet.so
       215: 
       215: 
       215: calling init: /opt/java/openjdk/lib/libnio.so
       215: 
       215: /opt/java/openjdk/lib/libjava.so: error: symbol lookup error: undefined symbol: Java_sun_nio_fs_UnixNativeDispatcher_init (fatal)
       215: /opt/java/openjdk/lib/libnio.so: error: symbol lookup error: undefined symbol: fstatat64 (fatal)
       215: /opt/java/openjdk/lib/libjava.so: error: symbol lookup error: undefined symbol: Java_sun_nio_fs_UnixNativeDispatcher_getcwd (fatal)
       215: java: error: symbol lookup error: undefined symbol: JNI_OnLoad_jimage (fatal)
       215: /opt/java/openjdk/lib/libjimage.so: error: symbol lookup error: undefined symbol: JNI_OnLoad (fatal)
       215: /opt/java/openjdk/lib/libjava.so: error: symbol lookup error: undefined symbol: Java_jdk_internal_jimage_NativeImageBuffer_getNativeMap (fatal)
       215: /opt/java/openjdk/lib/libnio.so: error: symbol lookup error: undefined symbol: Java_jdk_internal_jimage_NativeImageBuffer_getNativeMap (fatal)
       215: java: error: symbol lookup error: undefined symbol: JNI_OnLoad_awt (fatal)
       215: 
       215: calling init: /opt/java/openjdk/lib/libawt.so
       215: 
       215: java: error: symbol lookup error: undefined symbol: JNI_OnLoad_awt_headless (fatal)
       215: 
       215: calling init: /opt/java/openjdk/lib/libawt_headless.so
       215: 
       215: /opt/java/openjdk/lib/libjava.so: error: symbol lookup error: undefined symbol: Java_java_security_AccessController_doPrivileged (fatal)
       215: /opt/java/openjdk/lib/libawt.so: error: symbol lookup error: undefined symbol: Java_java_security_AccessController_doPrivileged (fatal)
       215: /opt/java/openjdk/lib/libnio.so: error: symbol lookup error: undefined symbol: Java_java_security_AccessController_doPrivileged (fatal)
       215: /opt/java/openjdk/lib/libjimage.so: error: symbol lookup error: undefined symbol: Java_java_security_AccessController_doPrivileged (fatal)
       215: /opt/java/openjdk/lib/libawt_headless.so: error: symbol lookup error: undefined symbol: Java_java_security_AccessController_doPrivileged (fatal)
       215: java: error: symbol lookup error: undefined symbol: JNI_OnLoad_awt (fatal)
       215: /opt/java/openjdk/lib/libjava.so: error: symbol lookup error: undefined symbol: Java_java_awt_Toolkit_initIDs (fatal)
       215: /opt/java/openjdk/lib/libjava.so: error: symbol lookup error: undefined symbol: Java_java_awt_Font_initIDs (fatal)
       215: /opt/java/openjdk/lib/libawt.so: error: symbol lookup error: undefined symbol: Java_java_awt_Font_initIDs (fatal)
       215: /opt/java/openjdk/lib/libnio.so: error: symbol lookup error: undefined symbol: Java_java_awt_Font_initIDs (fatal)
       215: /opt/java/openjdk/lib/libjimage.so: error: symbol lookup error: undefined symbol: Java_java_awt_Font_initIDs (fatal)
       215: java: error: symbol lookup error: undefined symbol: JNI_OnLoad_awt (fatal)
       215: java: error: symbol lookup error: undefined symbol: JNI_OnLoad_fontmanager (fatal)
       215: find library=libharfbuzz.so [0]; searching
       215:  search path=/opt/java/openjdk/lib      (RPATH from file /opt/java/openjdk/lib/libnio.so)
       215:   trying file=/opt/java/openjdk/lib/libharfbuzz.so
       215: 
       215: find library=libfreetype.so.6 [0]; searching
       215:  search path=/opt/java/openjdk/lib      (RPATH from file /opt/java/openjdk/lib/libnio.so)
       215:   trying file=/opt/java/openjdk/lib/libfreetype.so.6
       215:  search path=/opt/java/openjdk/bin/../lib/jli:/opt/java/openjdk/bin/../lib      (RPATH from file java)
       215:   trying file=/opt/java/openjdk/bin/../lib/jli/libfreetype.so.6
       215:   trying file=/opt/java/openjdk/bin/../lib/libfreetype.so.6
       215:  search cache=/usr/glibc-compat/etc/ld.so.cache
       215:   trying file=/usr/lib/libfreetype.so.6
       215: 
       215: find library=libbz2.so.1 [0]; searching
       215:  search path=/opt/java/openjdk/lib      (RPATH from file /opt/java/openjdk/lib/libnio.so)
       215:   trying file=/opt/java/openjdk/lib/libbz2.so.1
       215:  search path=/opt/java/openjdk/bin/../lib/jli:/opt/java/openjdk/bin/../lib      (RPATH from file java)
       215:   trying file=/opt/java/openjdk/bin/../lib/jli/libbz2.so.1
       215:   trying file=/opt/java/openjdk/bin/../lib/libbz2.so.1
       215:  search cache=/usr/glibc-compat/etc/ld.so.cache
       215:   trying file=/usr/lib/libbz2.so.1
       215: 
       215: find library=libpng16.so.16 [0]; searching
       215:  search path=/opt/java/openjdk/lib      (RPATH from file /opt/java/openjdk/lib/libnio.so)
       215:   trying file=/opt/java/openjdk/lib/libpng16.so.16
       215:  search path=/opt/java/openjdk/bin/../lib/jli:/opt/java/openjdk/bin/../lib      (RPATH from file java)
       215:   trying file=/opt/java/openjdk/bin/../lib/jli/libpng16.so.16
       215:   trying file=/opt/java/openjdk/bin/../lib/libpng16.so.16
       215:  search cache=/usr/glibc-compat/etc/ld.so.cache
       215:   trying file=/usr/lib/libpng16.so.16
       215: 
       215: find library=libbrotlidec.so.1 [0]; searching
       215:  search path=/opt/java/openjdk/lib      (RPATH from file /opt/java/openjdk/lib/libnio.so)
       215:   trying file=/opt/java/openjdk/lib/libbrotlidec.so.1
       215:  search path=/opt/java/openjdk/bin/../lib/jli:/opt/java/openjdk/bin/../lib      (RPATH from file java)
       215:   trying file=/opt/java/openjdk/bin/../lib/jli/libbrotlidec.so.1
       215:   trying file=/opt/java/openjdk/bin/../lib/libbrotlidec.so.1
       215:  search cache=/usr/glibc-compat/etc/ld.so.cache
       215:   trying file=/usr/lib/libbrotlidec.so.1
       215: 
       215: find library=libc.musl-x86_64.so.1 [0]; searching
       215:  search path=/opt/java/openjdk/lib      (RPATH from file /opt/java/openjdk/lib/libnio.so)
       215:   trying file=/opt/java/openjdk/lib/libc.musl-x86_64.so.1
       215:  search path=/opt/java/openjdk/bin/../lib/jli:/opt/java/openjdk/bin/../lib      (RPATH from file java)
       215:   trying file=/opt/java/openjdk/bin/../lib/jli/libc.musl-x86_64.so.1
       215:   trying file=/opt/java/openjdk/bin/../lib/libc.musl-x86_64.so.1
       215:  search cache=/usr/glibc-compat/etc/ld.so.cache
       215:   trying file=/lib/libc.musl-x86_64.so.1
       215: 
       215: find library=libbrotlicommon.so.1 [0]; searching
       215:  search path=/opt/java/openjdk/lib      (RPATH from file /opt/java/openjdk/lib/libnio.so)
       215:   trying file=/opt/java/openjdk/lib/libbrotlicommon.so.1
       215:  search path=/opt/java/openjdk/bin/../lib/jli:/opt/java/openjdk/bin/../lib      (RPATH from file java)
       215:   trying file=/opt/java/openjdk/bin/../lib/jli/libbrotlicommon.so.1
       215:   trying file=/opt/java/openjdk/bin/../lib/libbrotlicommon.so.1
       215:  search cache=/usr/glibc-compat/etc/ld.so.cache
       215:   trying file=/usr/lib/libbrotlicommon.so.1
       215: 
       215: 
       215: calling init: /lib/libc.musl-x86_64.so.1
       215: 
       215: 
       215: calling init: /usr/lib/libbrotlicommon.so.1
       215: 
       215: 
       215: calling init: /usr/lib/libbrotlidec.so.1
       215: 
       215: 
       215: calling init: /usr/lib/libpng16.so.16
       215: 
       215: 
       215: calling init: /usr/lib/libbz2.so.1
       215: 
       215: 
       215: calling init: /usr/lib/libfreetype.so.6
       215: 
       215: 
       215: calling init: /opt/java/openjdk/lib/libharfbuzz.so
       215: 
       215: 
       215: calling init: /opt/java/openjdk/lib/libfontmanager.so
       215: 
       215: /opt/java/openjdk/lib/libjava.so: error: symbol lookup error: undefined symbol: Java_sun_font_SunFontManager_initIDs (fatal)
       215: /opt/java/openjdk/lib/libawt.so: error: symbol lookup error: undefined symbol: Java_sun_font_SunFontManager_initIDs (fatal)
       215: /opt/java/openjdk/lib/libnio.so: error: symbol lookup error: undefined symbol: Java_sun_font_SunFontManager_initIDs (fatal)
       215: /opt/java/openjdk/lib/libjimage.so: error: symbol lookup error: undefined symbol: Java_sun_font_SunFontManager_initIDs (fatal)
       215: /opt/java/openjdk/lib/libawt_headless.so: error: symbol lookup error: undefined symbol: Java_sun_font_SunFontManager_initIDs (fatal)
       215: java: error: symbol lookup error: undefined symbol: JNI_OnLoad_awt (fatal)
       215: /opt/java/openjdk/lib/libjava.so: error: symbol lookup error: undefined symbol: Java_sun_java2d_Disposer_initIDs (fatal)
       215: /opt/java/openjdk/lib/libjava.so: error: symbol lookup error: undefined symbol: Java_sun_font_StrikeCache_getGlyphCacheDescription (fatal)
       215: /opt/java/openjdk/lib/libawt.so: error: symbol lookup error: undefined symbol: Java_sun_font_StrikeCache_getGlyphCacheDescription (fatal)
       215: /opt/java/openjdk/lib/libnio.so: error: symbol lookup error: undefined symbol: Java_sun_font_StrikeCache_getGlyphCacheDescription (fatal)
       215: /opt/java/openjdk/lib/libjimage.so: error: symbol lookup error: undefined symbol: Java_sun_font_StrikeCache_getGlyphCacheDescription (fatal)
       215: /opt/java/openjdk/lib/libawt_headless.so: error: symbol lookup error: undefined symbol: Java_sun_font_StrikeCache_getGlyphCacheDescription (fatal)
       215: java: error: symbol lookup error: undefined symbol: JNI_OnLoad_net (fatal)
       215: /opt/java/openjdk/lib/libjava.so: error: symbol lookup error: undefined symbol: Java_java_net_InetAddress_init (fatal)
       215: /opt/java/openjdk/lib/libawt.so: error: symbol lookup error: undefined symbol: Java_java_net_InetAddress_init (fatal)
       215: /opt/java/openjdk/lib/libjava.so: error: symbol lookup error: undefined symbol: Java_java_net_InetAddressImplFactory_isIPv6Supported (fatal)
       215: /opt/java/openjdk/lib/libawt.so: error: symbol lookup error: undefined symbol: Java_java_net_InetAddressImplFactory_isIPv6Supported (fatal)
       215: /opt/java/openjdk/lib/libjava.so: error: symbol lookup error: undefined symbol: Java_java_net_Inet4AddressImpl_getLocalHostName (fatal)
       215: /opt/java/openjdk/lib/libawt.so: error: symbol lookup error: undefined symbol: Java_java_net_Inet4AddressImpl_getLocalHostName (fatal)
       215: /opt/java/openjdk/lib/libjava.so: error: symbol lookup error: undefined symbol: Java_java_net_Inet4AddressImpl_lookupAllHostAddr (fatal)
       215: /opt/java/openjdk/lib/libawt.so: error: symbol lookup error: undefined symbol: Java_java_net_Inet4AddressImpl_lookupAllHostAddr (fatal)
       215: /opt/java/openjdk/lib/libjava.so: error: symbol lookup error: undefined symbol: Java_java_net_Inet4Address_init (fatal)
       215: /opt/java/openjdk/lib/libawt.so: error: symbol lookup error: undefined symbol: Java_java_net_Inet4Address_init (fatal)
       215: /opt/java/openjdk/lib/libjava.so: error: symbol lookup error: undefined symbol: Java_java_net_Inet6Address_init (fatal)
       215: /opt/java/openjdk/lib/libawt.so: error: symbol lookup error: undefined symbol: Java_java_net_Inet6Address_init (fatal)
       215: /opt/java/openjdk/lib/libjava.so: error: symbol lookup error: undefined symbol: Java_sun_font_FontConfigManager_getFontConfig (fatal)
       215: /opt/java/openjdk/lib/libawt.so: error: symbol lookup error: undefined symbol: Java_sun_font_FontConfigManager_getFontConfig (fatal)
       215: /opt/java/openjdk/lib/libnet.so: error: symbol lookup error: undefined symbol: Java_sun_font_FontConfigManager_getFontConfig (fatal)
       215: /opt/java/openjdk/lib/libnio.so: error: symbol lookup error: undefined symbol: Java_sun_font_FontConfigManager_getFontConfig (fatal)
       215: /opt/java/openjdk/lib/libjimage.so: error: symbol lookup error: undefined symbol: Java_sun_font_FontConfigManager_getFontConfig (fatal)
       215: find library=libfontconfig.so.1 [0]; searching
       215:  search path=/opt/java/openjdk/lib      (RPATH from file /opt/java/openjdk/lib/libnio.so)
       215:   trying file=/opt/java/openjdk/lib/libfontconfig.so.1
       215:  search path=/opt/java/openjdk/bin/../lib/jli:/opt/java/openjdk/bin/../lib      (RPATH from file java)
       215:   trying file=/opt/java/openjdk/bin/../lib/jli/libfontconfig.so.1
       215:   trying file=/opt/java/openjdk/bin/../lib/libfontconfig.so.1
       215:  search cache=/usr/glibc-compat/etc/ld.so.cache
       215:   trying file=/usr/lib/libfontconfig.so.1
       215: 
       215: find library=libexpat.so.1 [0]; searching
       215:  search path=/opt/java/openjdk/bin/../lib/jli:/opt/java/openjdk/bin/../lib      (RPATH from file java)
       215:   trying file=/opt/java/openjdk/bin/../lib/jli/libexpat.so.1
       215:   trying file=/opt/java/openjdk/bin/../lib/libexpat.so.1
       215:  search cache=/usr/glibc-compat/etc/ld.so.cache
       215:   trying file=/usr/lib/libexpat.so.1
       215: 
       215: find library=libuuid.so.1 [0]; searching
       215:  search path=/opt/java/openjdk/bin/../lib/jli:/opt/java/openjdk/bin/../lib      (RPATH from file java)
       215:   trying file=/opt/java/openjdk/bin/../lib/jli/libuuid.so.1
       215:   trying file=/opt/java/openjdk/bin/../lib/libuuid.so.1
       215:  search cache=/usr/glibc-compat/etc/ld.so.cache
       215:   trying file=/lib/libuuid.so.1
       215: 
       215: 
       215: calling init: /lib/libuuid.so.1
       215: 
       215: 
       215: calling init: /usr/lib/libexpat.so.1
       215: 
       215: 
       215: calling init: /usr/lib/libfontconfig.so.1
       215: 
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fe2e3b9b980, pid=215, tid=216
#
# JRE version: OpenJDK Runtime Environment AdoptOpenJDK (11.0.10+9) (build 11.0.10+9)
# Java VM: OpenJDK 64-Bit Server VM AdoptOpenJDK (11.0.10+9, mixed mode, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# C  [libc.so.6+0x81980]  _IO_link_in+0x1f0
#
# Core dump will be written. Default location: Core dumps may be processed with "/lib/systemd/systemd-coredump %P %u %g %s %t 9223372036854775808 %h" (or dumping to //core.215)
#
# An error report file with more information is saved as:
# //hs_err_pid215.log
#
# If you would like to submit a bug report, please visit:
#   https://github.com/AdoptOpenJDK/openjdk-support/issues
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Aborted (core dumped)

As you can see, when running FontTest, musl libc is being loaded (calling init: /lib/libc.musl-x86_64.so.1). As a result, you have two variants of libc in the process and you get crashes.

Obviously, we have to fix the container images with Alpine and glibc.

In the meantime, get the following packages:

Verify their signatures, unpack them, and copy all libraries with cp usr/lib/* /usr/glibc-compat/lib.

And a newer glibc is needed, too: https://github.com/sgerrand/alpine-pkg-glibc/releases/tag/2.33-r0. After apk add ttf-dejavu, even FontTest runs successfully. :sweat_smile:

Thankfully, AdoptOpenJDK 16 with musl support is around the corner and then those shenanigans aren't needed anymore.

aahlenst commented 3 years ago

@dinogun @bharathappali Looking through the errors reported in other linked issues, the problem seems not to be limited to font support. https://github.com/Cubxity/docker-minecraft-server/issues/1#issue-818151833 has problems with network code. Might be worthwhile to undo the Alpine upgrade until one of you can figure out what the real problem is.

clrxbl commented 3 years ago

I'm having this issue when a Java application is reading YAML files since this update, consistent segfaults. Version downgrade would be appreciated. I've switched to Amazon Corretto's docker image for now which has resolved my issue.

bharathappali commented 3 years ago

@mjp91 Can I know if there is a specific test or program you tried to recreate the issue ?

mjp91 commented 3 years ago

@bharathappali The FontTest @aahlenst did appears to produce the same error but I can roll up something specific if needed?

Originated in a commercial app that uses JasperSoft reporting.

aahlenst commented 3 years ago

@bharathappali https://blog.adoptopenjdk.net/2021/01/prerequisites-for-font-support-in-adoptopenjdk/ contains FontTest and is our generic program to checking for font issues. I'm more worried about what @clrxbl mentioned (reading YAML files and other things).

dantheperson commented 3 years ago

Getting the same crash here since rebuiding our alpine base image. An app that reads data over the network (grpc) and writes it to a spreadsheet.

#
# A fatal error has been detected by the Java Runtime Environment:

#
# SIGSEGV (0xb) at pc=0x00007fae616ed980, pid=1, tid=68
#
# JRE version: OpenJDK Runtime Environment AdoptOpenJDK (15.0.2+7) (build 15.0.2+7)
# Java VM: OpenJDK 64-Bit Server VM AdoptOpenJDK (15.0.2+7, mixed mode, tiered, compressed oops, serial gc, linux-amd64)
# Problematic frame:
# C [libc.so.6+0x81980] _IO_link_in+0x1f0 
bharathappali commented 3 years ago

I'm getting a core dump while building OpenJ9 image (OpenJ9 image has SCC generation phase which runs tomcat to generate SCC for base classes)

java '-Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer' -Xscmx50m -version
Assertion failed at ../../../../../openj9/runtime/compiler/x/env/J9CPU.cpp:155: self()->supports_feature_test(feature)
VMState: 0x0005ffff
    Old API and new API did not match: processor feature 107

compiling java/lang/Double.longBitsToDouble(J)D at level: cold
#0: /opt/java/openjdk/lib/compressedrefs/libj9jit29.so(+0x891c85) [0x7fd79fa71c85]
#1: /opt/java/openjdk/lib/compressedrefs/libj9jit29.so(+0x89c620) [0x7fd79fa7c620]
#2: /opt/java/openjdk/lib/compressedrefs/libj9jit29.so(+0x5716ce) [0x7fd79f7516ce]
#3: /opt/java/openjdk/lib/compressedrefs/libj9jit29.so(+0x572e7d) [0x7fd79f752e7d]
#4: /opt/java/openjdk/lib/compressedrefs/libj9jit29.so(+0x4d67bb) [0x7fd79f6b67bb]
#5: /opt/java/openjdk/lib/compressedrefs/libj9jit29.so(+0x92c15b) [0x7fd79fb0c15b]
#6: /opt/java/openjdk/lib/compressedrefs/libj9jit29.so(+0x9382ee) [0x7fd79fb182ee]
#7: /opt/java/openjdk/lib/compressedrefs/libj9jit29.so(+0x4a4576) [0x7fd79f684576]
#8: /opt/java/openjdk/lib/compressedrefs/libj9jit29.so(+0x4f7b80) [0x7fd79f6d7b80]
#9: /opt/java/openjdk/lib/compressedrefs/libj9jit29.so(+0x5327cf) [0x7fd79f7127cf]
#10: /opt/java/openjdk/lib/compressedrefs/libj9jit29.so(+0x157b73) [0x7fd79f337b73]
#11: /opt/java/openjdk/lib/compressedrefs/libj9jit29.so(+0x183239) [0x7fd79f363239]
#12: /opt/java/openjdk/lib/compressedrefs/libj9prt29.so(+0x2a743) [0x7fd7a5702743]
#13: /opt/java/openjdk/lib/compressedrefs/libj9jit29.so(+0x184f45) [0x7fd79f364f45]
#14: /opt/java/openjdk/lib/compressedrefs/libj9jit29.so(+0x1854f8) [0x7fd79f3654f8]
#15: /opt/java/openjdk/lib/compressedrefs/libj9jit29.so(+0x180b73) [0x7fd79f360b73]
#16: /opt/java/openjdk/lib/compressedrefs/libj9jit29.so(+0x181042) [0x7fd79f361042]
#17: /opt/java/openjdk/lib/compressedrefs/libj9jit29.so(+0x1810ea) [0x7fd79f3610ea]
#18: /opt/java/openjdk/lib/compressedrefs/libj9prt29.so(+0x2a743) [0x7fd7a5702743]
#19: /opt/java/openjdk/lib/compressedrefs/libj9jit29.so(+0x181544) [0x7fd79f361544]
#20: /opt/java/openjdk/lib/compressedrefs/libj9thr29.so(+0xe4f6) [0x7fd7a54cb4f6]
#21: /usr/glibc-compat/lib/libpthread.so.0(+0x8f00) [0x7fd7a7286f00]
#22: function clone+0x3f [0x7fd7a6fa145f]

JVMDUMP039I Processing dump event "abort", detail "" at 2021/03/05 03:21:05 - please wait.
JVMDUMP032I JVM requested System dump using '//core.20210305.032105.24.0001.dmp' in response to an event
JVMPORT030W /proc/sys/kernel/core_pattern setting "|/usr/share/apport/apport %p %s %c %d %P %E" specifies that the core dump is to be piped to an external program.  Attempting to rename either core or core.37.

JVMDUMP012E Error in System dump: The core file created by child process with pid = 37 was not found. Expected to find core file with name "//core"
JVMDUMP032I JVM requested Java dump using '//javacore.20210305.032105.24.0002.txt' in response to an event
JVMDUMP010I Java dump written to //javacore.20210305.032105.24.0002.txt
JVMDUMP032I JVM requested Snap dump using '//Snap.20210305.032105.24.0003.trc' in response to an event
JVMDUMP010I Snap dump written to //Snap.20210305.032105.24.0003.trc
JVMDUMP032I JVM requested JIT dump using '//jitdump.20210305.032105.24.0004.dmp' in response to an event
JVMDUMP010I JIT dump written to //jitdump.20210305.032105.24.0004.dmp
JVMDUMP013I Processed dump event "abort", detail "".

The issue got resolved after following the workaround provided by @aahlenst

Updating GLIBC patch to 2.33 solved the issue.

curl is often failing for me in alpine 3.13

sombochea commented 3 years ago

I'm getting the same errors too for use fontconfig in adoptopenjdk jre alpine!

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f484bd76980, pid=1, tid=42
#
# JRE version: OpenJDK Runtime Environment AdoptOpenJDK (11.0.10+5) (build 11.0.10+5-202012062348)
# Java VM: OpenJDK 64-Bit Server VM AdoptOpenJDK (11.0.10+5-202012062348, mixed mode, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# C  [libc.so.6+0x81980]  _IO_link_in+0x1f0
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %d %P %E" (or dumping to /opt/cubetiq/core.1)
#
# An error report file with more information is saved as:
# /opt/cubetiq/hs_err_pid1.log
#
# If you would like to submit a bug report, please visit:
#   https://github.com/AdoptOpenJDK/openjdk-support/issues
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
karianna commented 3 years ago

New images are over at github.com/adoptium/containers