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] macOS 15.2 ARM64 Docker 环境下 JRE-23 SIGILL 崩溃问题 #831

Open
7 of 18 tasks
dddXzz opened this issue Dec 20, 2024 · 9 comments
Open
7 of 18 tasks

[BUG] macOS 15.2 ARM64 Docker 环境下 JRE-23 SIGILL 崩溃问题 #831

dddXzz opened this issue Dec 20, 2024 · 9 comments
Labels
backend This is a backend bug bug 程序错误,有什么东西无法正常工作 priority: medium 中优先级 unconfirmed 该问题未经确认

Comments

@dddXzz
Copy link

dddXzz commented Dec 20, 2024

版本号 - Version

v7.2.2

操作系统平台和系统架构 - OS and CPU Arch

macOS:15.2 arm64

部署方式 - Deploy methods

  • Windows .exe 安装程序 (Windows .exe Installer)
  • Windows .zip 绿色部署包 (Windows .zip Portable)
  • Docker
  • JAR 包直接启动 (Start via .JAR directly)
  • 群晖 DSM 套件 (Synology .spk package)
  • Debian 软件包 (Debian .deb package)
  • RedHat/Fedora 软件包 (RedHat/Fedora .rpm package)

添加的下载器 - Added Downloaders

  • qBittorrent
  • BiglyBT/Azureus/Vuze
  • Deluge
  • Transmission
  • BitComet

问题描述 - Issue Description

macOS15.2系统下在通过docker compose部署PeerBanHelper时遇到严重的 JVM 崩溃问题。错误日志显示这是一个 JRE 层面的严重错误(SIGILL),导致 Java 虚拟机崩溃。

原因分析

这是OpenJDK 23 在 ARM64 架构上的一个已知 bug。该问题已在 OpenJDK 官方 bug 跟踪系统中被确认(JDK-8345296)。

临时解决方案:
将基础镜像从原来的jre版本更新为 openjdk:24-slim,成功解决了当前的 JVM 崩溃问题。
Dockerfile:
FROM docker.io/openjdk:24-slim
LABEL maintainer="https://github.com/PBH-BTN/PeerBanHelper"
COPY target/libraries /app/libraries
COPY target/PeerBanHelper.jar /app/PeerBanHelper.jar
USER 0
EXPOSE 9898
ENV TZ=UTC
ENV JAVA_OPTS="-Dpbh.release=docker -Djava.awt.headless=true -Xmx512M -Xss512k -XX:+UseG1GC -XX:+UseStringDeduplication -XX:+ShrinkHeapInSteps"
WORKDIR /app
VOLUME /tmp
ENTRYPOINT JAVAHOME/bin/javaJAVAH​OME/bin/java{JAVA_OPTS} -jar PeerBanHelper.jar

复现步骤 - Reproduce steps

  1. 在M4芯片,macOS15.2的mac上通过docker compose部署v7.2.2版本报错,JVM崩溃。

截图/日志文件 - Screenshot / Logs

2024-12-20 02:51:15 #
2024-12-20 02:51:15 # A fatal error has been detected by the Java Runtime Environment:
2024-12-20 02:51:15 #
2024-12-20 02:51:15 # SIGILL (0x4) at pc=0x0000ffff8a7401a8, pid=7, tid=8
2024-12-20 02:51:15 #
2024-12-20 02:51:15 # JRE version: (23.0.1+11) (build )
2024-12-20 02:51:15 # Java VM: OpenJDK 64-Bit Server VM (23.0.1+11, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-aarch64)
2024-12-20 02:51:15 # Problematic frame:
2024-12-20 02:51:15 # j java.lang.System.registerNatives()V+0 [email protected]
2024-12-20 02:51:15 #
2024-12-20 02:51:15 # No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
2024-12-20 02:51:15 #
2024-12-20 02:51:15 # An error report file with more information is saved as:
2024-12-20 02:51:15 # /app/hs_err_pid7.log
2024-12-20 02:51:15 [0.039s][warning][os] Loading hsdis library failed
2024-12-20 02:51:15 #
2024-12-20 02:51:15 # The crash happened outside the Java Virtual Machine in native code.
2024-12-20 02:51:15 # See problematic frame for where to report the bug.
2024-12-20 02:51:15 #
2024-12-20 02:51:15 #

额外信息 - Addition Information

相关讨论

OpenJDK Bug Report: JDK-8345296
Fix PR: openjdk/jdk21u-dev#1222
Issue: macOS 15.2 M4: Unable to launch Elasticsearch Docker container

检查清单 - Check list

  • PeerBanHelper 已更新到最新版本,非最新版本不接受任何错误反馈,任何非最新版本的 Issue 将被 立 刻 关 闭,不会有人给您提供任何支持 (I'm running the latest version of PBH that can be found in Github Relases, non-latest release won't receive any support)
  • 所添加的下载器已满足 README 中的前置要求(如版本号和插件)(The downloaders that I've added already satisfied the requirements (E.g install plugins/adapters))
  • 我已检查过 PBH 文档(特别是常见问题),且即使使用了搜索也没有找到与此有关的内容 (This not a question/or the question that not listed in README's FAQ or PBH WIKI)
  • 我没有检查这个检查清单,只是闭眼选中了所有的复选框,请关闭这个 Issue (I have not read these checkboxes and therefore I just ticked them all, Please close this issue)
  • 这不是一个安全漏洞,它可以被安全的公开报告。若需要报告安全漏洞,请在此报告 (This not a security related issue, can be safe report in public. If you want report a security exploit, please report it here)
  • 我同意遵守 PBH-BTN 包容性条约,不发布 “嘲讽、骂战、引战、开盒(有时也称为人肉搜索)、人身攻击、仇恨、暴力、侮辱性言辞、违法违规、黑灰产、危害国家安全、实施或帮助他人实施电信犯罪” 等内容。并已知晓如果仍旧发布了这些内容,我的账号将立刻从包括但不限于 PBH-BTN 组织、社交软件中封禁。所有主题、内容都将被立刻删除或折叠,撤销、删除和收回您所做出的一切贡献,并封禁 BTN 网络的中账号权限、排除您所提交的所有数据。在您违反相关规则时,PBH-BTN 将会将您的注册、登录、和最近访问的 IP 地址、电子邮件地址、以及其它可能追踪您或将您去匿名化的信息从定期删除转为永不删除,并在任何国家或地区的政府、公安机关或有关部门需要时无通知的提供这些数据。 (I agree to abide by the PBH-BTN Inclusivity Pact by not posting content such as “taunting, name-calling, war-mongering, open-boxing (sometimes referred to as mansplaining), personal attacks, hatred, violence, insulting language, illegal activities, black and grey business, endangering national security, and committing or assisting others in committing telecommunication crimes”. I am aware that if I continue to post such content, my account will be immediately banned from organizations including but not limited to PBH-BTN, social software. All topics and content will be immediately deleted or collapsed, all contributions will be revoked, deleted and retracted, and you will be banned from the BTN network and all data you have submitted will be excluded. In the event of a violation of these rules, PBH-BTN will delete your registration, login, and most recent IP address, email address, and any other information that may be used to track you or de-anonymize you from regular to permanent deletion, and will make this data available to the government, public security, or other relevant authorities without notice if they request it, no matter what country or region.)
@jonm58
Copy link

jonm58 commented Dec 20, 2024

但jdk 24没正式发布吧?

@dddXzz
Copy link
Author

dddXzz commented Dec 20, 2024

但jdk 24没正式发布吧?

是没有正式发布,所以只是临时解决方案。毕竟更新了系统才发现的该bug,只能先这样用着先,等待后续jdk更新吧。

@jonm58
Copy link

jonm58 commented Dec 20, 2024

但jdk 24没正式发布吧?

是没有正式发布,所以只是临时解决方案。毕竟更新了系统才发现的该bug,只能先这样用着先,等待后续jdk更新吧。

可以直接替换文件吗?
https://github.com/adoptium/temurin24-binaries/releases/tag/jdk-24%2B28-ea-beta

@dddXzz
Copy link
Author

dddXzz commented Dec 20, 2024

但jdk 24没正式发布吧?

是没有正式发布,所以只是临时解决方案。毕竟更新了系统才发现的该bug,只能先这样用着先,等待后续jdk更新吧。

可以直接替换文件吗? https://github.com/adoptium/temurin24-binaries/releases/tag/jdk-24%2B28-ea-beta

具体是怎样替换呢?

@jonm58
Copy link

jonm58 commented Dec 20, 2024

但jdk 24没正式发布吧?

是没有正式发布,所以只是临时解决方案。毕竟更新了系统才发现的该bug,只能先这样用着先,等待后续jdk更新吧。

可以直接替换文件吗? https://github.com/adoptium/temurin24-binaries/releases/tag/jdk-24%2B28-ea-beta

具体是怎样替换呢?

把jdk23运行时删除了,然后把压缩包里的文件放在原来jdk23运行时的位置上
https://github.com/adoptium/temurin24-binaries/releases/download/jdk-24%2B28-ea-beta/OpenJDK24U-jre_aarch64_linux_hotspot_24_28-ea.tar.gz

Linux应该可以这样做

@dddXzz
Copy link
Author

dddXzz commented Dec 20, 2024

但jdk 24没正式发布吧?

是没有正式发布,所以只是临时解决方案。毕竟更新了系统才发现的该bug,只能先这样用着先,等待后续jdk更新吧。

可以直接替换文件吗? https://github.com/adoptium/temurin24-binaries/releases/tag/jdk-24%2B28-ea-beta

具体是怎样替换呢?

把jdk23运行时删除了,然后把压缩包里的文件放在原来jdk23运行时的位置上 https://github.com/adoptium/temurin24-binaries/releases/download/jdk-24%2B28-ea-beta/OpenJDK24U-jre_aarch64_linux_hotspot_24_28-ea.tar.gz

Linux应该可以这样做

哦,我是用docker部署,现在的方案是依赖了openjdk:24-slim的docker镜像,替换了原来的eclipse-temurin:23-jre-noble镜像。如果要用该环境的话(https://github.com/adoptium/temurin24-binaries/releases/tag/jdk-24%2B28-ea-beta),
可能得自己构建该jre的docker镜像(目前没有)。peerbanhelper项目如果不通过docker部署,手动部署的话倒是可以使用jdk23(也不用替换为jdk24)。但这个bug只会在docker部署下存在,看bug的描述是M4芯片的macOS15.2在虚拟机下会崩溃,目前项目docker镜像的jdk环境(jdk23)才会有该bug,我就直接依赖openjdk构建好的jdk-24镜像重新构建一个该项目的docker镜像了,目前是能部署起容器正常运行的。

@dddXzz
Copy link
Author

dddXzz commented Dec 20, 2024

试了下构建jre的镜像用于项目jvm依赖,相比于直接依赖jdk,依赖jre的镜像能小挺多。

@Ghost-chu Ghost-chu added bug 程序错误,有什么东西无法正常工作 priority: medium 中优先级 unconfirmed 该问题未经确认 backend This is a backend bug labels Dec 21, 2024
@exlife1
Copy link

exlife1 commented Jan 9, 2025

同bug

@Ghost-chu
Copy link
Collaborator

试一下 ghostchu/peerbanhelper-snapshot:sha-395a894 有没有改善,我们没有苹果设备,无法测试。

这个镜像更换了 base image,至于有没有用我也不确定

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend This is a backend bug bug 程序错误,有什么东西无法正常工作 priority: medium 中优先级 unconfirmed 该问题未经确认
Projects
None yet
Development

No branches or pull requests

4 participants