Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server exits / crashes JVM on start. #3208

Closed
dgarvis opened this issue Dec 25, 2024 · 4 comments
Closed

Server exits / crashes JVM on start. #3208

dgarvis opened this issue Dec 25, 2024 · 4 comments

Comments

@dgarvis
Copy link

dgarvis commented Dec 25, 2024

Describe the problem

As always, thank you for your fantastic work on this project.

When I start the container, the container exits, and I get the logs attached.

Container definition

services:
  mc:
    image: itzg/minecraft-server:stable
    tty: true
    stdin_open: true
    ports:
      - "25565:25565"
    environment:
      EULA: "TRUE"
      TYPE: paper

      MEMORY: 2G
      OPS: "...omitted..."
    volumes:
      - ./data:/data

Container logs

using type = paper

mc-1  | [init] Running as uid=1000 gid=1000 with /data as 'drwxr-xr-x 7 1000 1000 224 Dec 25 17:44 /data'
mc-1  | [init] Resolving type given PAPER
mc-1  | #
mc-1  | # A fatal error has been detected by the Java Runtime Environment:
mc-1  | #
mc-1  | #  SIGILL (0x4) at pc=0x0000ffff86267c5c, pid=41, tid=52
mc-1  | #
mc-1  | # JRE version:  (21.0.5+11) (build )
mc-1  | # Java VM: OpenJDK 64-Bit Server VM (21.0.5+11-LTS, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-aarch64)
mc-1  | # Problematic frame:
mc-1  | # j  java.lang.System.registerNatives()V+0 [email protected]
mc-1  | #
mc-1  | # No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
mc-1  | #
mc-1  | # An error report file with more information is saved as:
mc-1  | # /data/hs_err_pid41.log
mc-1  | [0.288s][warning][os] Loading hsdis library failed
mc-1  | #
mc-1  | # The crash happened outside the Java Virtual Machine in native code.
mc-1  | # See problematic frame for where to report the bug.
mc-1  | #
mc-1  | /start-deployPaper: line 43:    41 Aborted                 mc-image-helper install-paper "${args[@]}"
mc-1  | [init] [ERROR] Failed to download paper 

using no type

mc-1  | [init] Changing ownership of /data to 1000 ...
mc-1  | [init] Running as uid=1000 gid=1000 with /data as 'drwxr-xr-x 2 1000 1000 64 Dec 25 18:00 /data'
mc-1  | [init] Resolving type given VANILLA

an hs_err_pid##.log file exists in both cases that looks like

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGILL (0x4) at pc=0x0000ffff6a267c5c, pid=44, tid=55
#
# JRE version:  (21.0.5+11) (build )
# Java VM: OpenJDK 64-Bit Server VM (21.0.5+11-LTS, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-aarch64)
# Problematic frame:
# j  java.lang.System.registerNatives()V+0 [email protected]
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

---------------  S U M M A R Y ------------

Command Line: me.itzg.helpers.McImageHelper resolve-minecraft-version LATEST

Host: AArch64, 16 cores, 23G, Ubuntu 24.04.1 LTS
Time: Wed Dec 25 18:00:21 2024 UTC elapsed time: 0.021104 seconds (0d 0h 0m 0s)

---------------  T H R E A D  ---------------

Current thread (0x0000ffff7802b950):  JavaThread "Unknown thread" [_thread_in_native, id=55, stack(0x0000ffff7ec02000,0x0000ffff7ee00000) (2040K)]

Stack: [0x0000ffff7ec02000,0x0000ffff7ee00000],  sp=0x0000ffff7edfdff0,  free space=2031k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
j  java.lang.System.registerNatives()V+0 [email protected]
j  java.lang.System.<clinit>()V+0 [email protected]
v  ~StubRoutines::call_stub 0x0000ffff6a25f144
V  [libjvm.so+0x836998]  JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*)+0x218
V  [libjvm.so+0x811de8]  InstanceKlass::call_class_initializer(JavaThread*)+0x284
V  [libjvm.so+0x812930]  InstanceKlass::initialize_impl(JavaThread*)+0x370
V  [libjvm.so+0xdcca38]  Threads::initialize_java_lang_classes(JavaThread*, JavaThread*)+0xe8
V  [libjvm.so+0xdceaf4]  Threads::create_vm(JavaVMInitArgs*, bool*)+0x3f4
V  [libjvm.so+0x8c9b14]  JNI_CreateJavaVM+0x80
C  [libjli.so+0x8bac]  JavaMain+0x7c
C  [libjli.so+0xc20c]  ThreadJavaMain+0xc
C  [libc.so.6+0x8597c]
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  java.lang.System.registerNatives()V+0 [email protected]
j  java.lang.System.<clinit>()V+0 [email protected]
v  ~StubRoutines::call_stub 0x0000ffff6a25f144

siginfo: si_signo: 4 (SIGILL), si_code: 1 (ILL_ILLOPC), si_addr: 0x0000ffff6a267c5c

omitted... as the comment is to long
@itzg
Copy link
Owner

itzg commented Dec 25, 2024

I'm sorry, there's not really anything I can do about fatal JVM crashes, in this case SIGILL (as in illegal instruction). It will be something about your system such as kernel or physical memory issues. Perhaps Google around for some of the symptoms there.

@dgarvis
Copy link
Author

dgarvis commented Dec 25, 2024

Ah, that makes sense. Thank you very much for the guidance.

Will update this thread if I find a solution.

This thread looks to be very similar and has a similar setup: docker/for-mac#7505
Better thread: corretto/corretto-21#85

Java17 seems to work but does not work with the current version of Minecraft.
There is a java argument that seems to work also, but cI an't figure out how to pass that to the mc-helper app, so it still crashes.

@dgarvis dgarvis closed this as completed Dec 25, 2024
@lprimak
Copy link

lprimak commented Dec 26, 2024

use JAVA_TOOL_OPTIONS='-XX:UseSVE=0'
or docker run -e JAVA_TOOL_OPTIONS=-XX:UseSVE=0 ...

That works for most containers that do not override JAVA_TOOL_OPTIONS explicitly

@itzg
Copy link
Owner

itzg commented Dec 26, 2024

Can also use https://docker-minecraft-server.readthedocs.io/en/latest/configuration/jvm-options/#extra-jvm-options in the case of this image, but yea, that env var will also work.

Edit

Yes JAVA_TOOL_OPTIONS must be used since it is the image helper tool that is first running into the SIGILL.

@dgarvis dgarvis changed the title Server exists / crashes JVM on start. Server exits / crashes JVM on start. Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants