bell-sw/Liberica

SIGSEGV in 19.0.1+11 (alpine-musl)

henrik242 opened this issue · 3 comments

Using bellsoft/liberica-openjdk-alpine-musl:19@sha256:7ed452eb660c529f1fc6a835909010c9c9abe90ed2438a9d595a06ebaa49aa5f

Getting error:

> [linux/arm64  5/15] RUN cd /tmp &&     /opt/jdk-19/bin/javac SSLTest.java &&     /opt/jdk-19/bin/java -cp /tmp SSLTest accounts.google.com api.sendgrid.com kinesis.eu-west-1.amazonaws.com:                                                                                                              
#0 1.086 #                                                                                                                                                                                                                                                                                                   
#0 1.086 # A fatal error has been detected by the Java Runtime Environment:                                                                                                                                                                                                                                  
#0 1.087 #                                                                                                                                                                                                                                                                                                   
#0 1.087 #  SIGSEGV (0xb) at pc=0x0000005502231528, pid=8, tid=24                                                                                                                                                                                                                                            
#0 1.094 #
#0 1.096 # JRE version: OpenJDK Runtime Environment (19.0.1+11) (build 19.0.1+11)
#0 1.096 # Java VM: OpenJDK 64-Bit Server VM (19.0.1+11, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, linux-aarch64)
#0 1.096 # Problematic frame:
#0 1.096 # V  [libjvm.so+0x927528]  PhaseCFG::schedule_node_into_block(Node*, Block*)+0x48
#0 1.125 #
#0 1.127 # No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#0 1.128 #
#0 1.139 # An error report file with more information is saved as:
#0 1.139 # /tmp/hs_err_pid8.log
#0 1.388 
#0 1.389 [error occurred during error reporting (), id 0xb, SIGSEGV (0xb) at pc=0x0000005502401f28]
#0 1.389 
#0 1.391 #
#0 1.392 # If you would like to submit a bug report, please visit:
#0 1.392 #   https://bell-sw.com/support
#0 1.392 #
#0 1.400 [thread 12 also had an error]
#0 1.401 qemu: uncaught target signal 6 (Aborted) - core dumped
#0 1.414 Aborted
------
WARNING: No output specified for docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load
Dockerfile:30
--------------------
  29 |     COPY SSLTest.java /tmp/
  30 | >>> RUN cd /tmp && \
  31 | >>>     $JAVA_HOME/bin/javac SSLTest.java && \
  32 | >>>     $JAVA_HOME/bin/java -cp /tmp SSLTest accounts.google.com api.sendgrid.com kinesis.eu-west-1.amazonaws.com
  33 |     
--------------------
error: failed to solve: process "/bin/sh -c cd /tmp &&     $JAVA_HOME/bin/javac SSLTest.java &&     $JAVA_HOME/bin/java -cp /tmp SSLTest accounts.google.com api.sendgrid.com kinesis.eu-west-1.amazonaws.com" did not complete successfully: exit code: 134

SSLTest.java contents:

import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import java.io.*;

public class SSLTest {
    public static void main(String[] args) {
        if (args.length < 1) {
            System.out.println("Usage: SSLTest host [host...]");
            System.exit(1);
        }
        int failures = 0;
        SSLSocketFactory factory = (SSLSocketFactory) SSLSocketFactory.getDefault();
        for (int i = 0; i < args.length; i++) {
            try {
                SSLSocket socket = (SSLSocket) factory.createSocket(args[i], 443);

                socket.getOutputStream().write(1);

                InputStream in = socket.getInputStream();
                while (in.available() > 0) {
                    System.out.print(in.read());
                }
                System.out.println("Verified SSL connection to " + args[i]);
            } catch (Exception e) {
                System.err.println("Could not connect to " + args[i] + ": " + e.toString());
                failures++;
            }
        }
        System.exit(failures);
    }
}

Weird thing: This worked Dec 5th 2022 with the exact same liberica image.

I see some differences in the working build from Dec 5th and now.

Failing:

#8 [linux/amd64  1/15] FROM bellsoft/liberica-openjdk-alpine-musl:19@sha256:7ed452eb660c529f1fc6a835909010c9c9abe90ed2438a9d595a06ebaa49aa5f
#8 sha256:c87dca686b5dddc2363bd9cc87a09a8ea4ac2a09117771312ea3a528bd4e3057 76.71MB / 76.71MB 1.1s done
#8 sha256:213ec9aee27d8be045c6a92b7eac22c9a64b44558193775a1a7f626352392b49 2.81MB / 2.81MB 0.2s done

Working:

#8 [linux/arm64  1/15] FROM bellsoft/liberica-openjdk-alpine-musl:19@sha256:7ed452eb660c529f1fc6a835909010c9c9abe90ed2438a9d595a06ebaa49aa5f
#8 sha256:9b18e9b68314027565b90ff6189d65942c0f7986da80df008b8431276885218e 2.71MB / 2.71MB 0.0s done
#8 sha256:6ce5c5863ba1f43dd93f2e3e882d73c427440e11896b2247b2314dec5a24af93 76.38MB / 76.38MB 0.6s done

could you post hs_err log here?

Frustratingly I'm not able to reproduce this today, while yesterday it failed both on CI (linux host) and locally (macOS host).

The image signatures from above was a false positive, I was looking at the wrong places in the logs.

I'll reopen if it happens again.