bytedeco / javacpp-presets

The missing Java distribution of native C++ libraries
Other
2.68k stars 745 forks source link

OpenCV, FFmpeg, Tesseract, etc not working on Alpine, CentOS, etc images #1379

Open Ratoone opened 1 year ago

Ratoone commented 1 year ago

I'm trying to run tesseract using java 17 on an alpine image. However, initializing the tessApi fails with the following error:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x000000000004c106, pid=1, tid=35
#
# JRE version: OpenJDK Runtime Environment Zulu17.30+15-CA (17.0.1+12) (build 17.0.1+12-LTS)
# Java VM: OpenJDK 64-Bit Server VM Zulu17.30+15-CA (17.0.1+12-LTS, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# C  0x000000000004c106
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /tmp/hs_err_pid1.log

Using a debian based image works, however that is not an option for my use case. I've tried installing glibc using the instructions from https://gist.github.com/larzza/0f070a1b61c1d6a699653c9a792294be, but no change

POM file:

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

<dependency>
    <groupId>org.bytedeco</groupId>
    <artifactId>leptonica-platform</artifactId>
    <version>1.83.0-1.5.9</version>
</dependency>
saudet commented 1 year ago

You'll need to build from source: https://github.com/bytedeco/javacpp-presets#build-instructions

phial3 commented 9 months ago

You'll need to build from source: https://github.com/bytedeco/javacpp-presets#build-instructions

I've verified that 1.5.10 maybe exists some problems, and 1.5.9 no problem.

https://github.com/bytedeco/javacv/issues/2181#issuecomment-1916182055

saudet commented 9 months ago

Since CentOS is pretty much dead, I've switched the builds to Ubuntu because it's the most popular distribution today, so if it doesn't work, please use Ubuntu.

steeveen commented 8 months ago

I have tested on red hat and meet no jniopencv_highgui . Is there a candicate solution can run on other linux?

saudet commented 8 months ago

The latest release version 1.5.10 should work with RHEL 9, but I haven't tested it personally.

steeveen commented 7 months ago

I have no rehl9 but tested the code on rehl7.5, meeting the problem

steeveen commented 7 months ago

To synchronize the latest progress, I found that the cause of the above problem is that there is no CXXABI_1_3_8 in my OS. I tried to install gcc4.9 but there was no download source in my environment. Is there any other way? In addition, can the new 1.5.11 avoid this problem? look forward to any bro.