docker - Java 运行时环境检测到致命错误
问题描述
我创建了以下 docker 映像,其中包含执行 opencv 和 tesseract 操作的 spring boot 应用程序:
FROM openjdk:17-alpine
RUN apk update && \
apk upgrade && \
apk add --no-cache tesseract-ocr opencv gcompat
COPY myapp-1.0.0.jar myapp-1.0.0.jar
ENTRYPOINT ["java","-jar","/myapp-1.0.0.jar"]
当我尝试在 linux 机器(2 个不同的 vms 或 google.cloud)上运行它时,它会启动,其他端点工作但是当我调用启动 opencv 操作的端点时,我收到以下错误:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00000000001e1766, pid=1, tid=124
#
# JRE version: OpenJDK Runtime Environment (17.0+14) (build 17-ea+14)
# Java VM: OpenJDK 64-Bit Server VM (17-ea+14, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# C 0x00000000001e1766
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/libexec/abrt-hook-ccpp %s %c %p %u %g %t e %P %I %h" (or dumping to //core.1)
#
# An error report file with more information is saved as:
# //hs_err_pid1.log
[thread 125 also had an error][thread 127 also had an error][thread 128 also had an error]
谁能帮我分析一下?我理解它是一个原生的 C 问题。可能是opencv或依赖项?但为什么?我认为它从以下 opencv 函数开始:
Mat map = Imgcodecs.imdecode(new MatOfByte(byteArray), Imgcodecs.IMREAD_UNCHANGED);
完整的错误日志在这里
解决方案
推荐阅读
- stm32 - adxl345 采样频率太低 stm23f4
- regex - 正则表达式的匹配字符串
- sql - Oracle SQL 正则表达式 (regexp_substr)
- html - Selenium No Element Found Exception 即使在从源代码复制元素后
- android - 选项卡未显示在颤振中
- vulkan - 命令缓冲区内存要求高吗?
- node.js - 为什么无限循环会阻止 Promise 解决?
- python - 文本小部件未使用删除功能清除
- java - HtmlUnit - 非法选择器错误
- java - 从 JsonSchema 生成 Java POJO 模型(最好使用 JAXB)