meh / ruby-tesseract-ocr

A Ruby wrapper library to the tesseract-ocr API.
629 stars 74 forks source link

Segfault during require 'tesseract' (issue with ffi?) #43

Open mikaylathompson opened 10 years ago

mikaylathompson commented 10 years ago

I'm getting a segfault whenever I try to require tesseract. All I have in the file is require 'tesseract' and it crashes.

The stack trace is here.

It looks like the tesseract.rb file just requires tesseract-ocr (line 25), and that require is what gets ffi involved.

If it's helpful: tesseract-ocr gem info

$ gem list tesseract -d

tesseract-ocr (0.1.6)
    Author: meh.
    Homepage: http://github.com/meh/ruby-tesseract-ocr
    License: BSD
    Installed at: /Users/Mikayla/.rvm/gems/ruby-2.1.2

    A wrapper library to the tesseract-ocr API.

ffi gem info

$ gem list ffi
ffi (1.9.6)
    Author: Wayne Meissner
    Homepage: http://wiki.github.com/ffi/ffi
    License: BSD
    Installed at: /Users/Mikayla/.rvm/gems/ruby-2.1.2

    Ruby FFI

ffi-extra (0.1.0)
    Author: meh.
    Homepage: http://github.com/meh/ruby-ffi-extra
    Installed at: /Users/Mikayla/.rvm/gems/ruby-2.1.2

    Some extra methods for FFI

ffi-inline (0.0.4.3)
    Author: meh.
    Homepage: http://github.com/meh/ruby-ffi-inline
    Installed at: /Users/Mikayla/.rvm/gems/ruby-2.1.2

    Inline C/C++ in Ruby easily and cleanly.

Has anyone seen anything similar? I can take this to ffi, of course, but it seems unlikely that I'm the only one to have encountered this coming from tesseract.

I saw Issue 39, but that seems like a pretty different error message, and was also not resolved.

meh commented 10 years ago

39 is surely a missing headers/libraries issue (for whatever reason I never got notifications about it, hence no responses).

This looks like a bug in FFI itself, if it were a segfault on tesseract side you would get it while using it instead of on require.

kithokit commented 9 years ago

Any new finding for this?