I found tesseract4.0 crashed when I use Intel i7-8700 CPU with Ubuntu 18.04.

227 views
Skip to first unread message

황인성

unread,
Jul 6, 2018, 4:53:44 AM7/6/18
to tesseract-dev

Hello,

I found tesseract4.0 crashed when I use Intel i7-8700 CPU with Ubuntu 18.04.

With Ubuntu 16.04, I have also same problems.

I used pyocr for wrapping lib for tesseract. ( PyOCR | python Tutori)

When I call below function several times, it is OK.

txt = tool.image_to_string(
  Image.open('test.png'),
  lang=lang,
  builder=pyocr.builders.TextBuilder()
)

But, when I call it over one hundred times, crash happens and PC is reboot.

By the way,

when I use i5-8400 CPU, sometimes error message is shown, but no crash happens.

And, one more thing,

Tesseract uses AVX and SSE, and when I disable them and re-test it, everything is fine. Never crash happens. No error message is shown.

But, you know, running speed is not good.

I think i7-8700 CPU has something different from those of i5-8400 with AVX and SSE function.

Is there anybody who has a similar experience to me?

Is there any solution I can use tesseract with i7-8700K CPU turning on AVX and SSE.


Zdenko Podobny

unread,
Jul 6, 2018, 4:57:41 AM7/6/18
to tesser...@googlegroups.com
Please use tesseract executable (not wrapper) for reporting issue.

Zdenko


pi 6. 7. 2018 o 10:53 황인성 <drpr...@gmail.com> napísal(a):
--
You received this message because you are subscribed to the Google Groups "tesseract-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-de...@googlegroups.com.
To post to this group, send email to tesser...@googlegroups.com.
Visit this group at https://groups.google.com/group/tesseract-dev.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-dev/bb105f9b-fd35-4cbe-ad27-970fa27bb301%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rami Kanhouche

unread,
Jul 7, 2018, 11:40:24 AM7/7/18
to tesseract-dev
If your PC reboots then it means that you found a bug in Ubuntu or your PC hardware. This is in no way a tesseract issue. Try running your code on different computer and/or OS version.

황인성

unread,
Jul 10, 2018, 2:03:05 AM7/10/18
to tesser...@googlegroups.com
I've already done test on different computer and different CPU before I sent that report.
And also I did test on different Ubuntu 16.04 LTS.
It shows same problem with i7-8700K and i7-8700 CPU.



2018-07-08 0:40 GMT+09:00 'Rami Kanhouche' via tesseract-dev <tesser...@googlegroups.com>:
If your PC reboots then it means that you found a bug in Ubuntu or your PC hardware. This is in no way a tesseract issue. Try running your code on different computer and/or OS version.
--
You received this message because you are subscribed to the Google Groups "tesseract-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-dev+unsubscribe@googlegroups.com.

To post to this group, send email to tesser...@googlegroups.com.
Visit this group at https://groups.google.com/group/tesseract-dev.

황인성

unread,
Jul 10, 2018, 2:03:15 AM7/10/18
to tesser...@googlegroups.com
I has a mistake in what I wrote.

os.system("tesseract image.jpg stdout -l kor+eng")

Thanks.



2018-07-10 12:23 GMT+09:00 황인성 <drpr...@gmail.com>:
If you want, I can give you test code and test images for showing this problem.
It occurs again 100%

2018-07-10 12:16 GMT+09:00 황인성 <drpr...@gmail.com>:
And also,
When I use it without pyocr like below. It happens same problem.
...
os.system("tesseract image.jpg stdout -l=kor+eng")
...

Edi Linux

unread,
Nov 21, 2018, 7:41:52 AM11/21/18
to tesseract-dev
Hello,
Were you able to solve the problem?
This problem is appearing when I use tesseract 4.0.0 with the I5 8400 CPU.
Thanks.

Em terça-feira, 10 de julho de 2018 03:03:15 UTC-3, 황인성 escreveu:
I has a mistake in what I wrote.

os.system("tesseract image.jpg stdout -l kor+eng")

Thanks.


2018-07-10 12:23 GMT+09:00 황인성 <drpr...@gmail.com>:
If you want, I can give you test code and test images for showing this problem.
It occurs again 100%
2018-07-10 12:16 GMT+09:00 황인성 <drpr...@gmail.com>:
And also,
When I use it without pyocr like below. It happens same problem.
...
os.system("tesseract image.jpg stdout -l=kor+eng")
...

2018-07-10 11:47 GMT+09:00 황인성 <drpr...@gmail.com>:
I've already done test on different computer and different CPU before I sent that report.
And also I did test on different Ubuntu 16.04 LTS.
It shows same problem with i7-8700K and i7-8700 CPU.


2018-07-08 0:40 GMT+09:00 'Rami Kanhouche' via tesseract-dev <tesser...@googlegroups.com>:
If your PC reboots then it means that you found a bug in Ubuntu or your PC hardware. This is in no way a tesseract issue. Try running your code on different computer and/or OS version.

--
You received this message because you are subscribed to the Google Groups "tesseract-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-de...@googlegroups.com.

To post to this group, send email to tesser...@googlegroups.com.
Visit this group at https://groups.google.com/group/tesseract-dev.

drpr...@gmail.com

unread,
Nov 23, 2018, 6:42:27 AM11/23/18
to tesser...@googlegroups.com

Yes, I did, but I could do only preventing crash by disabling AVX and SSE in C source code.

I had to cost performance.

The way that I disabled AVX and SSE as following.

-------------------------------

you are using a relatively new computer (with AVX and SSE support) on an old operating system (Windows XP). A quick search gives lots of hints that AVX does not work with XP. Tesseract will detect AVX support of the CPU and use it, because it does not test whether you are using an old operating system. So I expect that is the reason of the crash which you observe.

You can test that hypothesis by building a new Tesseract with AVX disabled: simply remove all lines which set avx_available_ in file arch/simddetect.cpp. The resulting Tesseract should work on any Windows version. If is does not, disable SSE support as well.

diff -rupN src/arch/simddetect.cpp src-modified/arch/simddetect.cpp

--- src/arch/simddetect.cpp              2017-04-03 20:07:40.000000000 +0300

+++ src-modified/arch/simddetect.cpp          2017-04-12 14:57:21.391494700 +0300

@@ -50,7 +50,21 @@ SIMDDetect::SIMDDetect() {

   unsigned int eax, ebx, ecx, edx;

   if (__get_cpuid(1, &eax, &ebx, &ecx, &edx) != 0) {

     sse_available_ = (ecx & 0x00080000) != 0;

+#  if defined(_WIN32)

+    OSVERSIONINFO osvi;

+

+    ZeroMemory( &osvi, sizeof( OSVERSIONINFO ) );

+    osvi.dwOSVersionInfoSize = sizeof( OSVERSIONINFO );

+

+    GetVersionEx( &osvi );

+   

+    if( osvi.dwMajorVersion > 5 )

+      avx_available_ = (ecx & 0x10000000) != 0;

+    else

+      avx_available_ = false;

+#  else

     avx_available_ = (ecx & 0x10000000) != 0;

+#  endif

   }

# elif defined(_WIN32)

   int cpuInfo[4];

@@ -58,7 +72,18 @@ SIMDDetect::SIMDDetect() {

   if (cpuInfo[0] >= 1) {

     __cpuid(cpuInfo, 1);

     sse_available_ = (cpuInfo[2] & 0x00080000) != 0;

-    avx_available_ = (cpuInfo[2] & 0x10000000) != 0;

+   

+    OSVERSIONINFO osvi;

+

+    ZeroMemory( &osvi, sizeof( OSVERSIONINFO ) );

+    osvi.dwOSVersionInfoSize = sizeof( OSVERSIONINFO );

+

+    GetVersionEx( &osvi );

+   

+    if( osvi.dwMajorVersion > 5 )

+      avx_available_ = (cpuInfo[2] & 0x10000000) != 0;

+    else

+      avx_available_ = false;

   }

# else

#  error "I don't know how to test for SIMD with this compiler"

 

-------------------------------

You can find some more information with below link.

https://github.com/tesseract-ocr/tesseract/issues/810

 

Best,

 

Billy

Reply all
Reply to author
Forward
0 new messages