Closed rhardih closed 5 years ago
Also, I'm not really sure what I'm supposed to do as a reasonable fix in my case.
Is "C" vs. "C.UTF-8" actually grounds for failing here?
IMO this is duplicate for https://github.com/tesseract-ocr/tesseract/issues/1670
I think you're right. I've subscribed to the other issue.
I'm in the process of migrating from using version 3.05.01 to version 4.0.0 in an Android app and I'm seeing a SEGFAULT already when trying to create a new base api.
I'm building using the r18b Android NDK and this is my build settings:
Full setup can be seen in this dockerfile: tesseract-4.0.0.Dockerfile.
The build runs fine, and the resultant .so file seems ok as well:
I have a small Qt unit test, which doesn't do anything else than just trying to create a new instance of the base api. Source can be seen here: tst_tesseract_4_0_0.cpp.
It's pretty simple and just links in tesseract and leptonica, and bundles libtiff.
It is based off of the same test for v3.05.01 which runs just fine: tst_tesseract_3_05_01.cpp.
The segfault appears o be caused by the locale assertion introduced in https://github.com/tesseract-ocr/tesseract/commit/3292484f67af8bdda23aa5e510918d0115785291, because the value of
locale
in my case isC.UTF-8
.The way this fails, produces no errors or warnings about the value of locale and I just stumbled upon this by, because I happened to have source maps set up in debugging.
Environment
Current Behavior:
SIGSEGV
when callingnew tesseract::TessBaseAPI()
.Expected Behavior:
No segfaults.
Suggested Fix:
Provide some sort of warning about the locale maybe.
CC @stweil