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

Update from Leptonica 1.74.1 to 1.74.2 #979

Merged
merged 2 commits into from
Jun 5, 2017

Conversation

stweil
Copy link
Member

@stweil stweil commented Jun 5, 2017

The newer version contains fixes for the pixUnsharpMaskingGray*
functions which are relevant for Tesseract (used in ImageData::PreScale
which calls pixScale).

Signed-off-by: Stefan Weil [email protected]

The newer version contains fixes for the pixUnsharpMaskingGray*
functions which are relevant for Tesseract (used in ImageData::PreScale
which calls pixScale).

Signed-off-by: Stefan Weil <[email protected]>
@stweil
Copy link
Member Author

stweil commented Jun 5, 2017

See Dan's comment for issue #644.

@stweil
Copy link
Member Author

stweil commented Jun 5, 2017

Should we refuse builds with Leptonica < 1.74.2? Then additional changes for CMakeLists.txt and configure.ac would be needed. The newer version not only fixes problems with undefined memory for lstmtraining, but also for tesseract --oem 1:

With Leptonica 1.74.1:

$ valgrind bin/ndebug/x86_64-linux-gnu/api/tesseract --oem 1 ~/Bilder/ocr/hello_world.png /tmp/hello
==21183== Memcheck, a memory error detector
==21183== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==21183== Using Valgrind-3.12.0.SVN and LibVEX; rerun with -h for copyright info
==21183== Command: bin/ndebug/x86_64-linux-gnu/api/tesseract --oem 1 /home/stweil/Bilder/ocr/hello_world.png /tmp/hello
==21183== 
==21183== Conditional jump or move depends on uninitialised value(s)
==21183==    at 0x4ECF07A: nextOnPixelInRasterLow (in /usr/lib/x86_64-linux-gnu/liblept.so.5.0.1)
==21183==    by 0x4ECF29F: nextOnPixelInRaster (in /usr/lib/x86_64-linux-gnu/liblept.so.5.0.1)
==21183==    by 0x4ED03A9: pixConnCompBB (in /usr/lib/x86_64-linux-gnu/liblept.so.5.0.1)
==21183==    by 0x4E8B8DC: ??? (in /usr/lib/x86_64-linux-gnu/liblept.so.5.0.1)
==21183==    by 0x4E8C021: ??? (in /usr/lib/x86_64-linux-gnu/liblept.so.5.0.1)
==21183==    by 0x4E8CABA: bmfCreate (in /usr/lib/x86_64-linux-gnu/liblept.so.5.0.1)
==21183==    by 0x1710B8: DebugPixa (debugpixa.h:15)
==21183==    by 0x1710B8: tesseract::Tesseract::Tesseract() (tesseractclass.cpp:623)
==21183==    by 0x11F99B: tesseract::TessBaseAPI::Init(char const*, int, char const*, tesseract::OcrEngineMode, char**, int, GenericVector<STRING> const*, GenericVector<STRING> const*, bool, bool (*)(STRING const&, GenericVector<char>*)) (baseapi.cpp:320)
==21183==    by 0x11FE25: tesseract::TessBaseAPI::Init(char const*, char const*, tesseract::OcrEngineMode, char**, int, GenericVector<STRING> const*, GenericVector<STRING> const*, bool) (baseapi.cpp:284)
==21183==    by 0x116273: main (tesseractmain.cpp:440)
==21183== 
==21183== Conditional jump or move depends on uninitialised value(s)
==21183==    at 0x4ECF12E: nextOnPixelInRasterLow (in /usr/lib/x86_64-linux-gnu/liblept.so.5.0.1)
==21183==    by 0x4ECF29F: nextOnPixelInRaster (in /usr/lib/x86_64-linux-gnu/liblept.so.5.0.1)
==21183==    by 0x4ED03A9: pixConnCompBB (in /usr/lib/x86_64-linux-gnu/liblept.so.5.0.1)
==21183==    by 0x4E8B8DC: ??? (in /usr/lib/x86_64-linux-gnu/liblept.so.5.0.1)
==21183==    by 0x4E8C021: ??? (in /usr/lib/x86_64-linux-gnu/liblept.so.5.0.1)
==21183==    by 0x4E8CABA: bmfCreate (in /usr/lib/x86_64-linux-gnu/liblept.so.5.0.1)
==21183==    by 0x1710B8: DebugPixa (debugpixa.h:15)
==21183==    by 0x1710B8: tesseract::Tesseract::Tesseract() (tesseractclass.cpp:623)
==21183==    by 0x11F99B: tesseract::TessBaseAPI::Init(char const*, int, char const*, tesseract::OcrEngineMode, char**, int, GenericVector<STRING> const*, GenericVector<STRING> const*, bool, bool (*)(STRING const&, GenericVector<char>*)) (baseapi.cpp:320)
==21183==    by 0x11FE25: tesseract::TessBaseAPI::Init(char const*, char const*, tesseract::OcrEngineMode, char**, int, GenericVector<STRING> const*, GenericVector<STRING> const*, bool) (baseapi.cpp:284)
==21183==    by 0x116273: main (tesseractmain.cpp:440)
==21183== 
Tesseract Open Source OCR Engine v4.00.00alpha with Leptonica
==21183== 
==21183== HEAP SUMMARY:
==21183==     in use at exit: 3,360 bytes in 7 blocks
==21183==   total heap usage: 653,804 allocs, 653,797 frees, 143,432,299 bytes allocated
==21183== 
==21183== LEAK SUMMARY:
==21183==    definitely lost: 0 bytes in 0 blocks
==21183==    indirectly lost: 0 bytes in 0 blocks
==21183==      possibly lost: 912 bytes in 3 blocks
==21183==    still reachable: 2,448 bytes in 4 blocks
==21183==         suppressed: 0 bytes in 0 blocks
==21183== Rerun with --leak-check=full to see details of leaked memory
==21183== 
==21183== For counts of detected and suppressed errors, rerun with: -v
==21183== Use --track-origins=yes to see where uninitialised values come from
==21183== ERROR SUMMARY: 169 errors from 2 contexts (suppressed: 0 from 0)

With Leptonica 1.74.2:

$ valgrind bin/ndebug/x86_64-linux-gnu/api/tesseract --oem 1 ~/Bilder/ocr/hello_world.png /tmp/hello2
==22040== Memcheck, a memory error detector
==22040== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==22040== Using Valgrind-3.12.0.SVN and LibVEX; rerun with -h for copyright info
==22040== Command: bin/ndebug/x86_64-linux-gnu/api/tesseract --oem 1 /home/stweil/Bilder/ocr/hello_world.png /tmp/hello2
==22040== 
Tesseract Open Source OCR Engine v4.00.00alpha with Leptonica
==22040== 
==22040== HEAP SUMMARY:
==22040==     in use at exit: 3,360 bytes in 7 blocks
==22040==   total heap usage: 653,807 allocs, 653,800 frees, 143,423,100 bytes allocated
==22040== 
==22040== LEAK SUMMARY:
==22040==    definitely lost: 0 bytes in 0 blocks
==22040==    indirectly lost: 0 bytes in 0 blocks
==22040==      possibly lost: 912 bytes in 3 blocks
==22040==    still reachable: 2,448 bytes in 4 blocks
==22040==         suppressed: 0 bytes in 0 blocks
==22040== Rerun with --leak-check=full to see details of leaked memory
==22040== 
==22040== For counts of detected and suppressed errors, rerun with: -v
==22040== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

@stweil
Copy link
Member Author

stweil commented Jun 5, 2017

Tesseract cmake builds are broken with Leptonica 1.74.2 because Leptonica now requires an installation: the Leptonica_INCLUDE_DIRS refer to /usr/local/include. Therefore Travis CI fails. @egorpugin, how should we fix that?

@egorpugin
Copy link
Contributor

Someone broke my leptonica cmake scripts? :)

@egorpugin egorpugin merged commit 22bcf4d into tesseract-ocr:master Jun 5, 2017
@egorpugin
Copy link
Contributor

egorpugin commented Jun 5, 2017

Should we refuse builds with Leptonica < 1.74.2?

We can do anything, because it's dev branch.
+1 from me

@stweil stweil deleted the update branch June 5, 2017 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants