adoptium / adoptium-support

For end-user problems reported with our binary distributions
Apache License 2.0
46 stars 15 forks source link

A fatal error has been detected by the Java Runtime Environment tess4j 5.4.0 #641

Closed Bala4496 closed 1 year ago

Bala4496 commented 1 year ago

Please provide a brief summary of the bug

Hi, I got some issue with Tesseract. when I try to run it manually (tesseract image.png out) it works perfectly. But when I use it in my app JVM get fatal error and crashes

My conf:

  1. RecognitionService.class

    public class RecognitionService {
    
    private static ITesseract tesseract;
    
    static {
        try {
            tesseract = new Tesseract();
        } catch (Exception e) {
            log.warn("Failure during Tesseract initialization", e);
        }
    }
    
    public String parseImage(File file) throws TesseractException {
        return tesseract.doOCR(file).replaceAll("\n", " ").trim();
    }
    }
  2. Dockerfile
    FROM adoptopenjdk/openjdk11:x86_64-alpine-jdk-11.0.14.1_1-slim
    RUN apk add tesseract-ocr
    ENV TESSDATA_PREFIX=/app/tessdata/
  3. pom.xml
    <dependency>
        <groupId>net.sourceforge.tess4j</groupId>
        <artifactId>tess4j</artifactId>
        <version>5.4.0</version>
    </dependency>
  4. Logfile hs_err_pid1.log

Please provide steps to reproduce where possible

I tried next options:

  1. export LC_ALL=C
  2. tesseract.setOcrEngineMode(1);

Expected Results

I expect than my problem will be solved

Actual Results

A fatal error has been detected by the Java Runtime Environment while tesseract processing with next errors:

  1. {} -> ELIST_ITERATOR::add_after_then_move(ELIST_LINK*)+0x44
  2. export LC_ALL=C -> tesseract::HistogramRect(Pix, int, int, int, int, int, int)+0xb3
  3. tesseract.setOcrEngineMode(1) -> BLOBNBOX::ComputeEdgeOffsets(Pix, Pix, BLOBNBOX_LIST*)+0xdd
  4. export LC_ALL=C + setOcrEngineMode(1) -> ELIST_ITERATOR::add_after_then_move(ELIST_LINK*)+0x44

What Java Version are you using?

OpenJDK Runtime Environment Temurin-11.0.14.1+1

What is your operating system and platform?

openjdk11:x86_64-alpine-jdk-11.0.14.1_1-slim

karianna commented 1 year ago

@Bala4496 Please do try again with the latest temurin alpine image with 11.0.17 but this is almost certainly a bug the the tess4j folks need to fix as they are calling out to native code and need to test that native code path on Alpine.

github-actions[bot] commented 1 year ago

We are marking this issue as stale because it has not been updated for a while. This is just a way to keep the support issues queue manageable. It will be closed soon unless the stale label is removed by a committer, or a new comment is made.