gali8 / Tesseract-OCR-iOS

Tesseract OCR iOS is a Framework for iOS7+, compiled also for armv7s and arm64.
http://www.nexor.it
MIT License
4.22k stars 949 forks source link

Frequent SIGABRT in -[G8Tesseract characterChoices] #163

Open nealsid opened 9 years ago

nealsid commented 9 years ago

Maybe 1/10 recognitions lead to a SIGABRT in the following line in G8Tesseract.mm:598:

tesseract::ChoiceIterator choiceIterator(*resultIterator);

I'm only playing around with single character recognition. resultIterator isn't NULL. Feel free to send me requests for debugging information, or extra tracing statements you'd like added and reproduced, etc.

The training data was both a mix of the default English data and custom english data from another specific font I was using.

nealsid commented 9 years ago

More info: Running on an iPhone 6, ios 8.2, instaleld via CocoaPods from HEAD (not a released version), but it's version 4.0.0

kevincon commented 9 years ago

Sorry for the delay in getting back to you, it seems a lot of us were mysteriously unsubscribed from notifications for the repo. :(

Can you save one of the images that causes the crash? If you can, can you reproduce the crash by reloading that image and trying to recognize on it again? If so, can you try installing and running Tesseract on your desktop computer with the same versions of Tesseract (3.03-rc1) and Leptonica (1.71) and your language and configuration files and see if you experience the crash with the same image there as well? If you have trouble installing those versions on your desktop computer, you can post or email me the image and language/config files and I can try it for you.

If the crash happens with the desktop version of Tesseract as well, then this may be related to another issue that was reported here a while back with a user using a custom language file (#152). That user solved his problem by rebuilding the Tesseract binaries for this library using the upstream trunk version (the development branch of Tesseract 3.04).

If the crash doesn't happen with the desktop version, then the crash-causing image will be really useful in trying to debug this issue. :)

nealsid commented 9 years ago

Hey Kevin, thanks for the info (and my turn to apologize for the delay, I've been pretty heads down on another project and haven't even gone to github recently). I will try what you say and write back, but it may be a week or so.

ws233 commented 9 years ago

Any news here?

aleclaws commented 8 years ago

I was experiencing this crash and have "fixed" it by checking if the G8RecognizedBlock is nil.

G8Tesseract.mm: 595

G8RecognizedBlock *block = [self blockFromIterator:resultIterator iteratorLevel:G8PageIteratorLevelSymbol];
if(block != nil) {
// ...
ws233 commented 8 years ago

@aleclaws, why don't you make a pull request to the master with this fix?