Summary: | kooka crashes when trying OCR via gocr | ||
---|---|---|---|
Product: | [Applications] kooka | Reporter: | Johannes Obermayr <johannesobermayr> |
Component: | general | Assignee: | Jonathan Marten <jjm> |
Status: | RESOLVED FIXED | ||
Severity: | crash | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/kooka/d7238d569de8d64205ad991d142b9135322fd5c6 | Version Fixed In: | |
Sentry Crash Report: | |||
Attachments: | Patch to fix |
Description
Johannes Obermayr
2012-06-23 20:44:16 UTC
Created attachment 72096 [details] Patch to fix Thanks for the report. Have spotted a very suspicious use of QStringList (via QRegExp) in the GOCR progress detection; this was unlikely to have been triggered before because GOCR doesn't actually seem to output any progress information, contrary to its man page. However, if the OCR result text happens to match the pattern "<startofline><whitespace><number><whitespace><number>" on any line, the crash may happen - either an assert or a crash, depending on whether Qt is compiled in debug or release mode. Can you compile Kooka from source? If so, can you try it with the patch attached on the same OCR input and let me know if this fixes the problem. See http://techbase.kde.org/Projects/Kooka for build instructions (get the latest Git version, then apply the patch on top of it). The patch works. Thanks. Git commit d7238d569de8d64205ad991d142b9135322fd5c6 by Jonathan Marten. Committed on 25/06/2012 at 09:37. Pushed by marten into branch 'master'. Fix crash with GOCR: suspicous use of QRegExp::capturedTexts() with a pattern that doesn't have any capture sections defined! Rewrite the GOCR stdout/stderr handling for better separation of results, progress and error/debug. GOCR result text is sent to a temporary file (formerly stdout) and read when the OCR process is finished. GOCR standard error is sent to another file (formerly printed via kDebug(), but nothing else was done with it). GOCR progress is still sent to stdout - the only thing that should now be sent to stdout - and used to display progress. Only really useful for very long OCR tasks, since GOCR only prints progress messages at 10 second intervals. Correct the capture and handling of the GOCR progress output, and the scanning of the progress line. Pointless, because nothing currently uses the progress signal! Fixed initial value setting problem with KScanSlider which showed itself in the GOCR setup dialogue page. M +105 -59 kooka/ocrgocrengine.cpp M +3 -2 kooka/ocrgocrengine.h M +1 -1 libkscan/kscancontrols.cpp http://commits.kde.org/kooka/d7238d569de8d64205ad991d142b9135322fd5c6 |