Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

OpenJDK vs. OracleJDK

GregoryO
2014-04-23
2014-06-05
  • GregoryO
    GregoryO
    2014-04-23

    Hi,

    Let me first describe my environment
    Fedora Linux x64
    (Installed both Oracle and OpenJDK, switchable when I need)
    Compiled Tesseract 3.02 from sources to x64.

    1) On OpenJDK when I unpack and run "ant test", everything goes fine, looks like tests are valid because they produce some OCR'ed output.

    2) on OracleJDK I'm doing same, but it fails with some SIGSEGV after compiling, and when running tests.

    Error: Illegal min or max specification!
    signal_termination_handler:Error:Signal_termination_handler called:Code 5002
    JRE version: 7.0_21-b11
    Java VM: Java HotSpot(TM) 64-Bit Server VM (23.21-b01 mixed mode linux-amd64 compressed oops)
    Problematic frame:
    C [libtesseract.so+0x244f90] ERRCODE::error(char const, TessErrorLogCode, char const, ...) const+0x180

    Oracle JDK version:
    java version "1.7.0_21"
    Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
    Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)

    Open JDK version:
    java version "1.7.0_25"
    OpenJDK Runtime Environment (fedora-2.3.12.1.fc17-x86_64)
    OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)

    Lib tesseract version:
    file /opt/tesseract/lib/libtesseract.so.3.0.2
    /opt/tesseract/lib/libtesseract.so.3.0.2: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, BuildID[sha1]=0x809337d0cdd7506ba9773ca691ae4fe260d996e5, not stripped

    What can be wrong with JDK ?

     
    Last edit: GregoryO 2014-04-23
  • Quan Nguyen
    Quan Nguyen
    2014-04-24

    I developed Tess4J with Ubuntu 14.04 32-bit and Oracle JDK 1.7.0_55 32-bit and built latest Tesseract 3.03 source from svn, and it worked fine.

    Hope others who have system configuration similar to yours will share their experience.

     
  • Mateusz Z
    Mateusz Z
    2014-06-05

    It is bug in tesseract - https://code.google.com/p/tesseract-ocr/issues/detail?id=910

    I had to add setlocale (LC_ALL, "C"); in TessBaseAPIInit2 method in api/capi.cpp

    TESS_API int TESS_CALL TessBaseAPIInit2(TessBaseAPI handle, const char datapath, const char* language, TessOcrEngineMode oem)
    {
    setlocale (LC_ALL, "C");
    return handle->Init(datapath, language, oem);
    }

    and recompile tess