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

[Bug]: OpenJDK 21 Crashes with SIGILL on ARM64 (Mac M-Series) - Suggest Switching to OpenJDK 17 #3000

Open
1 task done
wangdadatao opened this issue Feb 20, 2025 · 0 comments

Comments

@wangdadatao
Copy link

Installation Method

Docker

The Problem

When running the stirlingtools/stirling-pdf:latest image on an ARM64 platform (specifically a Mac M-series chip), the Java application fails to start due to a SIGILL (illegal instruction) error in OpenJDK 21.0.6+7-alpine-r0. This prevents Stirling-PDF from functioning correctly. However, switching to OpenJDK 17 resolves the issue.


my computer: mac mini m4
docker version: 27.5.1, build 9f9e405

Version of Stirling-PDF

Image: stirlingtools/stirling-pdf:latest (Version 0.42.0, built 2025-02-18)

Last Working Version of Stirling-PDF

Image: stirlingtools/stirling-pdf:latest (Version 0.42.0, built 2025-02-18)

Page Where the Problem Occurred

https://hub.docker.com/layers/stirlingtools/stirling-pdf/latest/images/sha256-eb8684f6b9e9af7e0323fc4d6bc193f8a0f12a2b52544292a2aebab60992c4f0

Docker Configuration

version: '3.3'
services:
  stirling-pdf:
    image: stirlingtools/stirling-pdf:latest
    platform: linux/arm64
    ports:
      - '31080:8080'
    volumes:
      - ./StirlingPDF/trainingData:/usr/share/tessdata
      - ./StirlingPDF/extraConfigs:/configs
      - ./StirlingPDF/customFiles:/customFiles/
      - ./StirlingPDF/logs:/logs/
      - ./StirlingPDF/pipeline:/pipeline/
    environment:
      - DOCKER_ENABLE_SECURITY=false
      - LANGS=zh_CN

Relevant Log Output

2025-02-20 20:37:21 Copying original files without overwriting existing files
2025-02-20 20:37:21 Running Stirling PDF with DOCKER_ENABLE_SECURITY=false and VERSION_TAG=0.42.0
2025-02-20 20:37:21 Installing font package: font-isas-misc
2025-02-20 20:37:21 fetch https://dl-cdn.alpinelinux.org/alpine/v3.21/main/aarch64/APKINDEX.tar.gz
2025-02-20 20:37:23 fetch https://dl-cdn.alpinelinux.org/alpine/v3.21/community/aarch64/APKINDEX.tar.gz
2025-02-20 20:37:27 fetch https://dl-cdn.alpinelinux.org/alpine/edge/main/aarch64/APKINDEX.tar.gz
2025-02-20 20:37:29 fetch https://dl-cdn.alpinelinux.org/alpine/edge/community/aarch64/APKINDEX.tar.gz
2025-02-20 20:37:34 fetch https://dl-cdn.alpinelinux.org/alpine/edge/testing/aarch64/APKINDEX.tar.gz
2025-02-20 20:37:36 OK: 1574 MiB in 393 packages
2025-02-20 20:37:36 Setting permissions and ownership for necessary directories...
2025-02-20 20:37:36 Picked up JAVA_TOOL_OPTIONS: -XX:+UnlockExperimentalVMOptions     -XX:MaxRAMPercentage=75     -XX:InitiatingHeapOccupancyPercent=20     -XX:+G1PeriodicGCInvokesConcurrent     -XX:G1PeriodicGCInterval=10000     -XX:+UseStringDeduplication     -XX:G1PeriodicGCSystemLoadThreshold=70
2025-02-20 20:37:36 #
2025-02-20 20:37:36 # A fatal error has been detected by the Java Runtime Environment:
2025-02-20 20:37:36 #
2025-02-20 20:37:36 #  SIGILL (0x4) at pc=0x0000ffff70d3fc5c, pid=20, tid=21
2025-02-20 20:37:36 #
2025-02-20 20:37:36 # JRE version:  (21.0.6+7) (build )
2025-02-20 20:37:36 # Java VM: OpenJDK 64-Bit Server VM (21.0.6+7-alpine-r0, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-aarch64)
2025-02-20 20:37:36 # Problematic frame:
2025-02-20 20:37:36 # j  java.lang.System.registerNatives()V+0 [email protected]
2025-02-20 20:37:36 #
2025-02-20 20:37:36 # No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
2025-02-20 20:37:36 #
2025-02-20 20:37:36 # An error report file with more information is saved as:
2025-02-20 20:37:36 # /tmp/hs_err_pid20.log
2025-02-20 20:37:36 [0.009s][warning][os] Loading hsdis library failed
2025-02-20 20:37:36 #
2025-02-20 20:37:36 # The crash happened outside the Java Virtual Machine in native code.
2025-02-20 20:37:36 # See problematic frame for where to report the bug.
2025-02-20 20:37:36 #
2025-02-20 20:37:36 INFO:unoserver:Starting unoserver 3.1.
2025-02-20 20:37:36 INFO:unoserver:Command: /usr/bin/soffice --headless --invisible --nocrashreport --nodefault --nologo --nofirststartwizard --norestore -env:UserInstallation=file:///tmp/tmp5o63q3vu --accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext
2025-02-20 20:37:46 INFO:unoserver:Starting UnoConverter.
2025-02-20 20:37:46 INFO:unoserver:Starting UnoComparer.
2025-02-20 20:37:48 INFO:unoserver:Server PID: 29

Additional Information

Additional Testing

  • Removing JAVA_TOOL_OPTIONS: The crash persists even after unsetting JAVA_TOOL_OPTIONS, indicating the issue is not related to JVM parameters.
unset JAVA_TOOL_OPTIONS
/usr/lib/jvm/java-21-openjdk/bin/java -version
# SIGILL (0x4) at pc=0x0000ffffab33fc5c
  • Switching to OpenJDK 17: Installing OpenJDK 17.0.14+7-alpine-r0 in the same container resolves the issue:
apk add openjdk17
/usr/lib/jvm/java-17-openjdk/bin/java -version
openjdk version "17.0.14" 2025-01-21
OpenJDK Runtime Environment (build 17.0.14+7-alpine-r0)
OpenJDK 64-Bit Server VM (build 17.0.14+7-alpine-r0, mixed mode, sharing)

Root Cause

The issue appears to be a bug or compatibility problem in the OpenJDK 21.0.6+7-alpine-r0 build for ARM64, likely due to the use of unsupported CPU instructions (e.g., ARMv8.2+ features) that are not available in the Docker virtualized environment on Mac M-series chips. OpenJDK 17 does not exhibit this behavior and runs successfully.

Browsers Affected

No response

No Duplicate of the Issue

  • I have verified that there are no existing issues raised related to my problem.
@wangdadatao wangdadatao changed the title [Bug]: [Bug]: OpenJDK 21 Crashes with SIGILL on ARM64 (Mac M-Series) - Suggest Switching to OpenJDK 17 Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant