-
Notifications
You must be signed in to change notification settings - Fork 373
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
tess4j is not work on tesseract 4.0.0-beta.3-199-gba757 #106
Comments
The current release was tested against tesseract-4.0.0-beta.1 on Ubuntu 18.04. Let me see if I can find time this weekend to compile, install tesseract-4.0.0-beta.3, and test tess4j against it. |
@nguyenq I solve the problem with 'export LC_ALL=C'. I fit out this by #105 conversation. I don't know why tess4j-4.1.0-snapshot with tesseract-4.0.0-beta.3 needs this set up, but tess4j-4.0.2-snapshot with tesseract-4.0.0-beta.1 didn't. If you know anything about this, please tell me. Thank you for your help. |
After successful build and install of tesseract 4.0.0-beta.3, I encountered a hard JVM crash when attempting to execute tess4j's unit tests.
Executing The exception stems from a recent commit in tesseract-4.0.0-beta.3 in an attempt to resolve the locale issue. That fix seems to have caused other issues. Duplicate of #105. |
|
Hi All, Tesseract Tess4j Exception A fatal error has been detected by the Java Runtime Environment: SIGSEGV (0xb) at pc=0x00007fe043d13e0d, pid=3926, tid=0x00007fe044a00700 JRE version: OpenJDK Runtime Environment (8.0_181-b13) (build 1.8.0_181-8u181-b13-1ubuntu0.16.04.1-b13) Failed to write core dump. 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: If you would like to submit a bug report, please visit: Even after executing export LC_ALL=C facing the same issue and terminal is not opening after restarting system. What is the correct solution? |
The library has been developed and tested on Ubuntu 18.10 and Oracle Java 11. Due to Tesseract's locale requirements, |
@nguyenq I think there should be some solution for older version of Ubuntu as well because after exporting LC_ALL=C , terminal stopped working and also Intellij Idea. |
For my opinion it can not be, that you have to run a Java application (or a J2EE container or wherever you run you Java application) with LC_ALL=C ! This problem has been introduced with the following commit 5 month ago:
The documentation of std::setlocale says:
So if I understand it right, tesseract either tries to set the C locale and or only checks, if it is set, and throws an Exception if not. The commit comment says
So the core problem is either, that a dynamic library loaded by JNA is not able to change the locale (if the above code can be interpreted to attempt to set the locale for tesseract) OR, if above code only ensures THAT the locale is set, the right way would be to somehow set the "C" locale for all tesseract JNA calls. I tried to search for something like this, but it didn't help. Is there anybody who understands excatly what the cpp code is trying? Does it try to SET the locale or does it only try to QUERY the C locale and see, if it set ? Cheers, |
I tried several things in my Java code, but what worked to get my Test green, was using the following snippet:
But I am not sure, if setting the locale to "C" using JNA does have some side-effects ... At least it does not affect the Java default locale. |
The example codes for running Tess4j has been given in "http://tess4j.sourceforge.net/codesample.html," however it was performed in Mac OS in intellij, error message came up with "!strcmp(locale, "C"):Error:Assert failed:in file baseapi.cpp, line 209" with the below messages: A fatal error has been detected by the Java Runtime Environment:SIGILL (0x4) at pc=0x000000012183ca4f, pid=44026, tid=0x0000000000001903JRE version: Java(TM) SE Runtime Environment (8.0_144-b01) (build 1.8.0_144-b01)Java VM: Java HotSpot(TM) 64-Bit Server VM (25.144-b01 mixed mode bsd-amd64 compressed oops)Problematic frame:C [libtesseract.dylib+0x156a4f] ERRCODE::error(char const*, TessErrorLogCode, char const*, ...) const+0x183By my reading of the above posts, it appears to be an issue with exporting LC_ALL=C, but not sure, in the example codes given, what exact codes should be added/amend, to make that example to run? |
@Jeff201812 Open a command line, execute export LC_ALL=C before launching IntelliJ from the same command prompt. Or try |
Thank you so much for the reply, though I did try export LC_ALL=C at the command line, which has been changed to C, but still not working. Will try the other option.
… On 17 Dec 2018, at 11:47 pm, Quan Nguyen ***@***.***> wrote:
@Jeff201812 Open a command line, execute export LC_ALL=C before launching IntelliJ from the same command prompt.
Or try CLibrary.INSTANCE.setlocale given above in your Java code.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
So what's the resolution here? Can we add the export LC_ALL step to the docs since everyone is just going to hit this error and the error message is super cryptic? Isn't there any way tess4j can set the variable before executing calls? |
I work with tess4j with
<dependency>
<groupId>net.sourceforge.tess4j</groupId>
<artifactId>tess4j</artifactId>
<version>4.0.2</version>
</dependency>
But it doesn't work with tesseract-4.0.0-beta.3-199-gba757.
When I start my service, and init the tess4j, my service crush.
My service work on centos 7.4 , and tesseract version information is
tesseract 4.0.0-beta.3-199-gba757
leptonica-1.76.0
libjpeg 6b (libjpeg-turbo 1.2.90) : libpng 1.5.13 : libtiff 4.0.3 : zlib 1.2.7 : libwebp 0.3.0
Found AVX2
Found AVX
Found SSE
print out the error log:
A fatal error has been detected by the Java Runtime Environment:
SIGSEGV (0xb) at pc=0x00007f11f9d4104a, pid=41510, tid=0x00007f1202fef700
JRE version: Java(TM) SE Runtime Environment (8.0_152-b16) (build 1.8.0_152-b16)
Java VM: Java HotSpot(TM) 64-Bit Server VM (25.152-b16 mixed mode linux-amd64 compressed oops)
Problematic frame:
C [libtesseract.so.4+0x27704a] ERRCODE::error(char const*, TessErrorLogCode, char const*, ...) const+0x16a
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 visit:
http://bugreport.java.com/bugreport/crash.jsp
The crash happened outside the Java Virtual Machine in native code.
See problematic frame for where to report the bug.`
I had clone the newest code and build by myself. But it still work. I notice that the newest code support beta3.
the error info:
A fatal error has been detected by the Java Runtime Environment:
SIGSEGV (0xb) at pc=0x00007ff5b0f3304a, pid=95930, tid=0x00007ff5b9ee0700
JRE version: Java(TM) SE Runtime Environment (8.0_152-b16) (build 1.8.0_152-b16)
Java VM: Java HotSpot(TM) 64-Bit Server VM (25.152-b16 mixed mode linux-amd64 compressed oops)
Problematic frame:
C [libtesseract.so.4+0x27704a] ERRCODE::error(char const*, TessErrorLogCode, char const*, ...) const+0x16a
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 visit:
http://bugreport.java.com/bugreport/crash.jsp
The crash happened outside the Java Virtual Machine in native code.
See problematic frame for where to report the bug.
--------------- T H R E A D ---------------
Current thread (0x00007ff60db13000): JavaThread "http-nio-80-exec-1" daemon [_thread_in_native, id=96070, stack(0x00007ff5b9de0000,0x00007ff5b9ee1000)]
siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000000000
The text was updated successfully, but these errors were encountered: