Bamboo Server Crashes due to Segmentation Fault on BigInteger methods
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Problem
Bamboo Server may occasionally crash, with the following in the catalina.out:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f3df99c75df, pid=<pid>,
tid=0x00007f3d53d6d700
#
# JRE version: Java(TM) SE Runtime Environment (8.0_92-b14) (build
1.8.0_92-b14)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.92-b14 mixed mode
linux-amd64 compressed oops)
# Problematic frame:
# J 77505 C2 java.math.BigInteger.montReduce([I[III)[I (99 bytes) @
0x00007f3df99c75df [0x00007f3df99c71e0+0x3ff]
#
# 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:
# /home/bamboo/hs_err_pid<pid>.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
Cause
This has been confirmed to be a bug in OpenJDK: JDK-8160163 (but may apply to other JDKs), relating to these methods:
- BigInteger.montReduce
- BigInteger.squareToLen
Workaround
Add the following parameters to the JVM_SUPPORT_RECOMMENDED_ARGS= parameter in BAMBOO_INSTALL/bin/setenv.sh:
"-XX:CompileCommand=exclude,java/math/BigInteger.montReduce -XX:CompileCommand=exclude,java/math/BigInteger.squareToLen"
This should look like:
#
# Occasionally Atlassian Support may recommend that you set some specific JVM arguments. You can use this variable below to do that.
#
JVM_SUPPORT_RECOMMENDED_ARGS="-XX:CompileCommand=exclude,java/math/BigInteger.montReduce -XX:CompileCommand=exclude,java/math/BigInteger.squareToLen"
It is also suggested in the JDK bug that this may be related to versions of the linux Kernel. OpenJDK suggests using kernel versions greater than 3.8.13-60.