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

segmentation fault when reusing instances of tessreract #174

Open
Martinez78 opened this issue Dec 23, 2019 · 0 comments
Open

segmentation fault when reusing instances of tessreract #174

Martinez78 opened this issue Dec 23, 2019 · 0 comments

Comments

@Martinez78
Copy link

Martinez78 commented Dec 23, 2019

I tried to use Tesseract via threads in parallel. I created three instances of Tesseract with the same settings, and create Callable objects referencing always one of those three for each file in a batch of PDFs and submitted the “callable” objects to a FixedThreadPool. This way these “callable” Objects do reuse always one of the same three Tesseract instances previously created when processing one file. In each callable object doOCR is called with the corresponding input file. Processing a lot of PDF documents with theses same Tesseract instances works well, but with some PDFs after a while the JVM crashes with a SIGSEV.

A fatal error has been detected by the Java Runtime Environment:

SIGSEGV (0xb) at pc=0x00007ff6e4302f3e, pid=20667, tid=0x00007ff72939a700

JRE version: Java(TM) SE Runtime Environment (8.0_102-b14) (build 1.8.0_102-b14)
Java VM: Java HotSpot(TM) 64-Bit Server VM (25.102-b14 mixed mode linux-amd64 compressed oops)
Problematic frame:
C [liblept.so.5+0xfef3e] pixDestroy+0xe

I also saw the message " Please call Init before attempting to set an image.corrupted size vs. prev_size while consolidating", in my opinion pointing to a memory alignment / structure mapping problem
hs_err_pid20667.log
.

The error does not occur when each callable uses its own freshly created instance of Tesseract for each and every input file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant