I am hosting a Modded Minecraft server on a Ubuntu 22.04.3 LTS system and I have been facing repeated crashes due to a SIGSEGV error from the Java Runtime Environment (JRE). These crashes occur approximately every 30 minutes, and the issue persists across both modded and vanilla servers I have hosted in the past.
What could be causing the SIGSEGV (Segmentation Fault) in the Java VM while running a Minecraft server? How can I prevent this from happening? Are there any JVM flags or diagnostics tools I can use to further investigate?
System Information
- OS: Ubuntu 22.04.3 LTS
- CPU: Intel Core i3-10100
- RAM: 32 GB
- JRE: Java SE Runtime Environment 17.0.8+9 (build 17.0.8+9-LTS-211)
Service Management
I am using systemd to manage running the server.
[Service]
User=minecraft
Nice=1
SuccessExitStatus=0 1
ProtectHome=true
ProtectSystem=full
PrivateDevices=true
NoNewPrivileges=true
Restart=always
RestartSec=5s
WorkingDirectory=/opt/minecraft/server/prominence
ExecStart=/opt/minecraft/server/prominence/start.sh
Service File
Error Logs
# A fatal error has been detected by the Java Runtime Environment:
# SIGSEGV (0xb) at pc=0x00007f7e6cc1c643, pid=575062, tid=575205
# JRE version: Java(TM) SE Runtime Environment (17.0.8+9) (build 17.0.8+9-LTS-211)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0.8+9-LTS-211, mixed mode, sharing)
# Problematic frame:
# j java.util.HashSet.iterator()Ljava/util/Iterator;+7 [email protected]
Every time the crash happens, the problematic frame is different. Here are some example crash logs (normal Minecraft server logs don’t regularly have errors leading up to the fatal error; it is sudden).
Error sample 1
Error sample 2
Bonus Vanilla Error (since it is similar):
Vanilla error
Things I did to try and resolve:
- Reinstalled Java and Minecraft server files.
- Changed Java versions
- Adjusted the memory allocation for the servers.
- Tried running both modded (Fabric) and vanilla Minecraft servers—same issue persists.
- Tried different java options for changing garbage collection, etc (common Minecraft ones), eg (UseParallelGC)
Not sure if this is a coincidence, but it seems like doing something like reinstalling java improved stability for a time (about a day), but after that the normal frequency of the crashing resumed.
4