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

A jvm crash occurs is used in docker #2116

Closed
liuzihua699 opened this issue Nov 1, 2023 · 4 comments
Closed

A jvm crash occurs is used in docker #2116

liuzihua699 opened this issue Nov 1, 2023 · 4 comments

Comments

@liuzihua699
Copy link

liuzihua699 commented Nov 1, 2023

source:

@PostMapping("/test")
public BaseResult<String> testOpenCV() {
    String path = "/tmp/imgs/";
    Mat img = imread(path + "1.jpg", IMREAD_COLOR);
    cvtColor(img, img, COLOR_BGR2GRAY);
    imwrite(path + "1-test.jpg",img );
    return BaseResult.success("success");
}

maven:

<dependency>
    <groupId>org.bytedeco</groupId>
    <artifactId>javacv</artifactId>
    <version>1.5.9</version>
</dependency>
<dependency>
    <groupId>org.bytedeco</groupId>
    <artifactId>javacv-platform</artifactId>
    <version>1.5.9</version>
</dependency>

Dockerfile:

FROM xxx/jdk8-alpine:alpha

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN mkdir -p /usr/local/app/media-agent/sqlite
RUN mkdir -p /usr/local/app/snapshot
WORKDIR /usr/local/app
#VOLUME /usr/local/app/media-agent

#中文字体库
COPY font/simsun.ttc /usr/share/fonts/dejavu
COPY media-agent-start/target/media-agent.jar /usr/local/app/media-agent/
COPY sqlite/edge.sqlite3 /usr/local/app/media-agent/sqlite/
COPY imgs/ /tmp/imgs

RUN chmod -R 777 /usr/local/app/media-agent

ENTRYPOINT java -jar /usr/local/app/media-agent/agent.jar \
    --zlmedia.baseUrl=${ZLMEDIA_URL} \
    --spring.datasource.url=jdbc:sqlite:/usr/local/app/agent/sqlite/edge.sqlite3 \
    --spring.profiles.active=${SPRING_PROFILES_ACTIVE}

jvm errors:

# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x0000000000002026, pid=1, tid=0x00007f177a3eeb38
#
# JRE version: OpenJDK Runtime Environment (8.0_345-b01) (build 1.8.0_345-b01)
# Java VM: OpenJDK 64-Bit Server VM (25.345-b01 mixed mode linux-amd64 compressed oops)
# Derivative: IcedTea 3.24.0
# Distribution: Custom build (Tue Nov  8 21:00:08 UTC 2022)
# Problematic frame:
# C  0x0000000000002026
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please include
# instructions on how to reproduce the bug and visit:
#   https://icedtea.classpath.org/bugzilla
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.

else content:
hs_err_pid1.log

@saudet
Copy link
Member

saudet commented Nov 2, 2023

Ah, I see, you're trying to use Alpine. That won't work

@saudet
Copy link
Member

saudet commented Nov 2, 2023

Duplicate of bytedeco/javacpp-presets#1379

@saudet saudet marked this as a duplicate of #1379 Nov 2, 2023
@saudet saudet closed this as completed Nov 2, 2023
@saudet saudet marked this as a duplicate of bytedeco/javacpp-presets#1379 Nov 2, 2023
@liuzihua699
Copy link
Author

Ah, I see, you're trying to use Alpine. That won't work

Thank you for your reply! But can you provide a usable Dockerfile as a reference?

@saudet
Copy link
Member

saudet commented Nov 8, 2023

Anything that uses Ubuntu 20.04 should be fine

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

2 participants