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 (core dumped) while running tesseract #624

Closed
cricket1 opened this issue Dec 28, 2016 · 5 comments
Closed

Segmentation fault (core dumped) while running tesseract #624

cricket1 opened this issue Dec 28, 2016 · 5 comments
Labels

Comments

@cricket1
Copy link

  • I followed instructions to compile tesseract from https://github.com/tesseract-ocr/tesseract/wiki/Compiling#Compilation

  • I try running tesseract I get Segmentation fault (core dumped)

  • gdb logs
    (gdb) run
    Starting program: /usr/local/bin/tesseract
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
STRING::string (this=this@entry=0x7ffff7dc9a78 <debug_file+24>) at strngs.cpp:203
203 if (header->used_ == 0)
(gdb) bt
#0 STRING::string (this=this@entry=0x7ffff7dc9a78 <debug_file+24>) at strngs.cpp:203
#1 0x00007ffff7873e41 in string (this=0x7ffff7dc9a60 <debug_file>) at params.h:203
#2 tprintf_internal (format=format@entry=0x7ffff789ad32 "Found AVX\n") at tprintf.cpp:60
#3 0x00007ffff77f2661 in SIMDDetect::SIMDDetect (this=) at simddetect.cpp:63
#4 0x00007ffff7dea10a in call_init (l=, argc=argc@entry=1,
argv=argv@entry=0x7fffffffdb18, env=env@entry=0x7fffffffdb28) at dl-init.c:78
#5 0x00007ffff7dea1f3 in call_init (env=, argv=, argc=,
l=) at dl-init.c:36
#6 _dl_init (main_map=0x7ffff7ffe1c8, argc=1, argv=0x7fffffffdb18, env=0x7fffffffdb28) at dl-init.c:126
#7 0x00007ffff7ddb30a in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#8 0x0000000000000001 in ?? ()
#9 0x00007fffffffdecb in ?? ()
#10 0x0000000000000000 in ?? ()

  • Any clue why this is happening ?
@stweil
Copy link
Contributor

stweil commented Dec 28, 2016

How did you run Tesseract (which command line options, which image)?

@stweil
Copy link
Contributor

stweil commented Dec 28, 2016

I can reproduce the problem. It only happens when Tesseract is built with a shared library (libtesseract.so). The crash occurs because the constructor of the global variable debug_file was not called at the time when SIMDDetect::SIMDDetect is executed. For the moment, removing the tprintf statements in arch/simddetect.cpp helps.

@stweil
Copy link
Contributor

stweil commented Dec 28, 2016

Fixed with pull request #625.

@cricket1
Copy link
Author

No issues seen now

@Shreeshrii
Copy link
Collaborator

Messages only shown now when asking for version and not for each image. Thanks!

 tesseract -v
tesseract 4.00.00alpha-238-ge6ccfb2
 leptonica-1.74
  libjpeg 8d (libjpeg-turbo 1.3.0) : libpng 1.2.50 : libtiff 4.0.3 : zlib 1.2.8

 Found AVX
 Found SSE

tesseract san001.jpg san001.tst -l san
Tesseract Open Source OCR Engine v4.00.00alpha-238-ge6ccfb2 with Leptonica

@zdenop zdenop closed this as completed Dec 28, 2016
@amitdo amitdo added the bug label May 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants