spring-bootraspberry-piraspbianadoptopenjdk

Java Springboot build fails in raspberry pi


Summary

I'm trying to build springboot application on my raspberry pi and I get SIGBUS (0x7) error

Error:

# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGBUS (0x7) at pc=0xb3de3a84, pid=7, tid=32
#
# JRE version: OpenJDK Runtime Environment AdoptOpenJDK (14.0.2+12) (build 14.0.2+12)
# Java VM: OpenJDK Server VM AdoptOpenJDK (14.0.2+12, mixed mode, sharing, g1 gc, linux-arm)
# Problematic frame:
# v  ~StubRoutines::atomic_load_long
#
# Core dump will be written. Default location: /server/core
#
# An error report file with more information is saved as:
# /server/hs_err_pid7.log

Steps to reproduce

I have a docker file with following snippet.

COPY .mvn .mvn

COPY pom.xml .

RUN ./mvnw dependency:go-offline

COPY src src

RUN ./mvnw package -DskipTests  # <------- Fails here

Builds fine on my other primary machine with ubuntu on it. But fails on Raspberry Pi 4 with raspbian.

Expected results

Expected a successful build similar to my other machine

Actual results

Fails with following error trace.

[thread 52 also had an error]
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGBUS (0x7) at pc=0xb3de3a84, pid=7, tid=32
#
# JRE version: OpenJDK Runtime Environment AdoptOpenJDK (14.0.2+12) (build 14.0.2+12)
# Java VM: OpenJDK Server VM AdoptOpenJDK (14.0.2+12, mixed mode, sharing, g1 gc, linux-arm)
# Problematic frame:
# v  ~StubRoutines::atomic_load_long
#
# Core dump will be written. Default location: /server/core
#
# An error report file with more information is saved as:
# /server/hs_err_pid7.log
#
# If you would like to submit a bug report, please visit:
#   https://github.com/AdoptOpenJDK/openjdk-support/issues
#
Aborted (core dumped)
The command '/bin/sh -c ./mvnw package -DskipTests' returned a non-zero code: 134
ERROR: Service 'server' failed to build

Triaging info

Java version: 14.0.2+12

What is your operating system and platform? Raspbian [full] latest. Raspberry Pi 4

How did you install Java? Dockerfile snippet shared above.

Did it work before? No

Did you test with other Java versions? yes with v11


Solution

  • Answering my own question, I tried a openjdk instead of adoptopenjdk and it worked. If it doesnt work for you, then try different versions of openjdk as well.