Spring Boot version: 2.5.5 Java Version: 1.8 (No issue when using Java 11)
Issue with the maven spring-boot plugin for goal spring-boot:build-image Docker run failed when creating container with spring-boot:build-image in java 8
Steps to reproduce:
- Visit https://start.spring.io/
- Select Java 8 on the list of options
- Click generate to download the project.
- Open the application and run it locally (perhaps in your favorite IDE). It should be good.
- Build docker image >
mvn spring-boot:build-image
- Run docker image: >
docker run -p 8080:8080 demo:0.0.1-SNAPSHOT
Expected: I would expect the application to come up and be accessible.
Actual: I get the following error
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007fca96e932f7, pid=1, tid=0x00007fca97ffb700
#
# JRE version: (8.0_302-b08) (build )
# Java VM: OpenJDK 64-Bit Server VM (25.302-b08 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V [libjvm.so+0xb2a2f7] VirtualMemoryTracker::add_reserved_region(unsigned char*, unsigned long, NativeCallStack const&, MemoryType, bool)+0x77
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /workspace/hs_err_pid1.log
#
# If you would like to submit a bug report, please visit:
# https://bell-sw.com/support
#
Issue started happening that I noticed 4 days ago. I was able to build my containers before.
(I first posed it in stackoverflow: https://stackoverflow.com/questions/69347796/docker-run-failed-when-creating-container-with-spring-bootbuild-image-in-java-8, but after some more testing I would think this report belongs here)
Comment From: wilkinsona
This is a JRE bug. I would guess that you've started seeing it recently due to the Java buildpack upgrading the JRE to 8.0_302-b08. Please report the problem to BellSoft, as suggested in the error message:
# If you would like to submit a bug report, please visit:
# https://bell-sw.com/support
Comment From: fiallega
OK, thank you for the quick response.
Comment From: wilkinsona
https://github.com/paketo-buildpacks/bellsoft-liberica/issues/131 has the details of a workaround.