uliss / quneiform

optical character recognition software
GNU General Public License v3.0
10 stars 2 forks source link

Compilation error (branch release_0.5) #8

Closed LazyKent closed 11 years ago

LazyKent commented 11 years ago

I have compilation error using branch release_0.5.

/usr/src/packages/BUILD/quneiform/cli/options.cpp: In function 'void cf::printVersion(std::ostream&)':
/usr/src/packages/BUILD/quneiform/cli/options.cpp:106:28: error: 'CF_CXX_FLAGS' was not declared in this scope
make[2]: *** [cli/CMakeFiles/cuneiform-options.dir/options.cpp.o] Error 1
uliss commented 11 years ago

Please, try it again. I've installed OpenSuse 12.2 in VirtualBox, made some fixes and now it compiles, passes all test, recognizes and not crashes.

LazyKent commented 11 years ago

It seems, compilation is OK. Now there is an error in install.

 CMake Error at src/cmake_install.cmake:72 (FILE):
   file INSTALL cannot find
   "/home/abuild/rpmbuild/BUILD/quneiform/build/src/include/config-user.h".
 Call Stack (most recent call first):
   cmake_install.cmake:47 (INCLUDE)

 make: *** [install] Error 1

I built packages in OBS. You can see logs and others. https://build.opensuse.org/package/show?package=quneiform&project=home%3ALazy_Kent%3Atesting

LazyKent commented 11 years ago

Install works now. But I got buffer overflow errors in post-build check (openSUSE feature).

[ 1200s] ... testing for serious compiler warnings
[ 1200s]     (using /usr/lib/build/checks-data/check_gcc_output)
[ 1200s]     (using /home/kent/rpmbuild/BUILD-osc/openSUSE_Factory-x86_64/.build.log)
[ 1200s] 
[ 1200s] I: Program causes undefined operation
[ 1200s]    (likely same variable used twiceand post/pre incremented in the same expression).
[ 1200s]    e.g. x = x++; Split it in two operations.
[ 1200s] W: quneiform sequence-point /home/abuild/rpmbuild/BUILD/quneiform/src/exc/matrix.cpp:199
[ 1200s] W: quneiform sequence-point /home/abuild/rpmbuild/BUILD/quneiform/src/lns/memops.h:133
[ 1200s] W: quneiform sequence-point /home/abuild/rpmbuild/BUILD/quneiform/src/rcutp/rcutp_func.cpp:2417, 2450
[ 1200s] W: quneiform sequence-point /home/abuild/rpmbuild/BUILD/quneiform/src/rimage/crinvertor.cpp:87
[ 1200s] W: quneiform sequence-point /home/abuild/rpmbuild/BUILD/quneiform/src/rstr/accents.cpp:2088
[ 1200s] W: quneiform sequence-point /home/abuild/rpmbuild/BUILD/quneiform/src/rstr/alcutfun.cpp:2002, 2022
[ 1200s] W: quneiform sequence-point /home/abuild/rpmbuild/BUILD/quneiform/src/rstr/diffrv.cpp:2921
[ 1200s] W: quneiform sequence-point /home/abuild/rpmbuild/BUILD/quneiform/src/rstr/pass3.cpp:1911
[ 1200s] W: quneiform sequence-point /home/abuild/rpmbuild/BUILD/quneiform/src/rstr/sweeper.cpp:211
[ 1200s] 
[ 1200s] I: Statement is overflowing a buffer
[ 1200s] E: quneiform bufferoverflow /usr/include/bits/string3.h:84
[ 1200s] 
[ 1200s] I: Statement might be overflowing a buffer in strncat. Common mistake:
[ 1200s]    BAD: strncat(buffer,charptr,sizeof(buffer)) is wrong, it takes the left over size as 3rd argument
[ 1200s]    GOOD: strncat(buffer,charptr,sizeof(buffer)-strlen(buffer)-1)
[ 1200s] E: quneiform bufferoverflowstrncat /usr/include/bits/string3.h:150
[ 1200s] 
[ 1200s] I: Statement might potentially overflow a destination buffer, where a size larger
[ 1200s]     than the actual buffer was specified
[ 1200s] E: quneiform destbufferoverflow /usr/include/bits/stdio2.h:293

From compilation log:

[  503s] In file included from /usr/include/string.h:638:0,
[  503s]                  from /home/abuild/rpmbuild/BUILD/quneiform/src/rstr/match_wd.cpp:57:
[  503s] In function 'void* memset(void*, int, size_t)',
[  503s]     inlined from 'Bool _ZL15make_str_rasterP4cellS0_P12tagStrRaster.constprop.1(cell*, cell*)' at /home/abuild/rpmbuild/BUILD/quneiform/src/rstr/match_wd.cpp:409:71:
[  503s] /usr/include/bits/string3.h:84:88: warning: call to void* __builtin___memset_chk(void*, int, long unsigned int, long unsigned int) will always overflow destination buffer [enabled by default]
...
[  505s] In file included from /usr/include/string.h:638:0,
[  505s]                  from /home/abuild/rpmbuild/BUILD/quneiform/src/rstr/match_wd.cpp:57:
[  505s] In function 'void* memset(void*, int, size_t)',
[  505s]     inlined from 'Bool _ZL15make_str_rasterP4cellS0_P12tagStrRaster.constprop.1(cell*, cell*)' at /home/abuild/rpmbuild/BUILD/quneiform/src/rstr/match_wd.cpp:409:71:
[  505s] /usr/include/bits/string3.h:84:88: warning: call to void* __builtin___memset_chk(void*, int, long unsigned int, long unsigned int) will always overflow destination buffer [enabled by default]
...
[  116s] In file included from /usr/include/string.h:638:0,
[  116s]                  from /usr/include/c++/4.7/cstring:44,
[  116s]                  from /home/abuild/rpmbuild/BUILD/quneiform/src/rsadd/rsadd.cpp:62:
[  116s] In function 'char* strncat(char*, const char*, size_t)',
[  116s]     inlined from 'Bool32 rsadd_eng_group_CSTR(CSTR_rast, CSTR_rast)' at /home/abuild/rpmbuild/BUILD/quneiform/src/rsadd/rsadd.cpp:1002:55:
[  116s] /usr/include/bits/string3.h:150:94: warning: call to char* __builtin___strncat_chk(char*, const char*, long unsigned int, long unsigned int) might overflow destination buffer [enabled by default]
...
[  657s] In file included from /usr/include/stdio.h:937:0,
[  657s]                  from /home/abuild/rpmbuild/BUILD/quneiform/src/include/cfcompat.h:33,
[  657s]                  from /home/abuild/rpmbuild/BUILD/quneiform/src/rfrmt/crtfchar.h:26,
[  657s]                  from /home/abuild/rpmbuild/BUILD/quneiform/src/rfrmt/crtfstring.cpp:20:
[  657s] In function 'size_t fread(void*, size_t, size_t, FILE*)',
[  657s]     inlined from 'static cf::CRtfString* cf::CRtfString::read(FILE*)' at /home/abuild/rpmbuild/BUILD/quneiform/src/rfrmt/crtfstring.cpp:311:41:
[  657s] /usr/include/bits/stdio2.h:293:89: warning: call to '__fread_chk_warn' declared with attribute warning: fread called with bigger size * nmemb than length of destination buffer [enabled by default]
uliss commented 11 years ago

Some build warnings were fixed. But I have to noticed that legacy code was written in such way that there's still numerous number of warnings about suspicious behavior. It matter of long time to fix them.

LazyKent commented 11 years ago

Thanks, Serge! You are the Man! All compilation errors are gone. https://build.opensuse.org/package/show?package=quneiform&project=home%3ALazy_Kent%3Atesting

I have not tested the program yet. As you can see in OBS, I have disabled to run 'make test'. Unfortunately, local build with 'make test' failed.

[  256s] Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.4VpPSg
[  256s] + umask 022
[  256s] + cd /usr/src/packages/BUILD
[  256s] + cd quneiform
[  256s] + cd build
[  256s] + make test
[  256s] Running tests...
[  257s] Test project /usr/src/packages/BUILD/quneiform/build
[  257s]       Start  1: GUI:test_cedpageexporter
[  261s]  1/27 Test  #1: GUI:test_cedpageexporter .............***Exception: Other  1.69 sec
[  261s]       Start  2: GUI:test_exportsettings
[  261s]  2/27 Test  #2: GUI:test_exportsettings ..............***Failed    0.04 sec
[  261s]       Start  3: GUI:test_formatsettings
[  261s]  3/27 Test  #3: GUI:test_formatsettings ..............***Failed    0.03 sec
[  261s]       Start  4: GUI:test_histogramwidget
[  261s]  4/27 Test  #4: GUI:test_histogramwidget .............***Failed    0.03 sec
[  261s]       Start  5: GUI:test_imagecache
[  261s]  5/27 Test  #5: GUI:test_imagecache ..................***Failed    0.02 sec
[  261s]       Start  6: GUI:test_imageview
[  262s]  6/27 Test  #6: GUI:test_imageview ...................***Exception: Other  1.07 sec
[  262s]       Start  7: GUI:test_language
[  262s]  7/27 Test  #7: GUI:test_language ....................   Passed    0.02 sec
[  262s]       Start  8: GUI:test_languageselect
[  262s]  8/27 Test  #8: GUI:test_languageselect ..............***Failed    0.04 sec
[  262s]       Start  9: GUI:test_page
[  262s]  9/27 Test  #9: GUI:test_page ........................***Exception: Other  0.24 sec
[  262s]       Start 10: GUI:test_packet
[  262s] 10/27 Test #10: GUI:test_packet ......................***Exception: Other  0.03 sec
[  262s]       Start 11: GUI:test_pageindicator
[  262s] 11/27 Test #11: GUI:test_pageindicator ...............***Failed    0.02 sec
[  262s]       Start 12: GUI:test_pagerecognitionqueue
[  262s] 12/27 Test #12: GUI:test_pagerecognitionqueue ........***Exception: Other  0.07 sec
[  262s]       Start 13: GUI:test_pagerecognizer
[  262s] 13/27 Test #13: GUI:test_pagerecognizer ..............***Exception: Other  0.07 sec
[  262s]       Start 14: GUI:test_recentmenu
[  262s] 14/27 Test #14: GUI:test_recentmenu ..................***Failed    0.03 sec
[  262s]       Start 15: GUI:test_recognitionsettingsdialog
[  263s] 15/27 Test #15: GUI:test_recognitionsettingsdialog ...***Exception: Other  0.05 sec
[  263s]       Start 16: GUI:test_recognitionprogressdialog
[  263s] 16/27 Test #16: GUI:test_recognitionprogressdialog ...***Exception: Other  0.08 sec
[  263s]       Start 17: GUI:test_selection
[  263s] 17/27 Test #17: GUI:test_selection ...................***Exception: Other  0.03 sec
[  263s]       Start 18: GUI:test_spellcheckerfactory
[  263s] 18/27 Test #18: GUI:test_spellcheckerfactory .........***Failed    0.08 sec
[  263s]       Start 19: GUI:test_texteditor
[  263s] 19/27 Test #19: GUI:test_texteditor ..................***Exception: Other  0.03 sec
[  263s]       Start 20: GUI:test_qtextdocumentexporter
[  263s] 20/27 Test #20: GUI:test_qtextdocumentexporter .......***Exception: Other  0.03 sec
[  263s]       Start 21: GUI:test_dibplugin
[  263s] 21/27 Test #21: GUI:test_dibplugin ...................***Failed    0.05 sec
[  263s]       Start 22: GUI:test_scanner
[  263s] 22/27 Test #22: GUI:test_scanner .....................***Failed    0.12 sec
[  263s]       Start 23: GUI:test_cedserializer
[  263s] 23/27 Test #23: GUI:test_cedserializer ...............***Exception: Other  0.03 sec
[  263s]       Start 24: GUI:test_aspellchecker
[  263s] 24/27 Test #24: GUI:test_aspellchecker ...............***Failed    0.02 sec
[  263s]       Start 25: GUI:test_multitiffplugin
[  263s] 25/27 Test #25: GUI:test_multitiffplugin .............***Failed    0.02 sec
[  263s]       Start 26: GUI:test_imageutils
[  263s] 26/27 Test #26: GUI:test_imageutils ..................***Failed    0.03 sec
[  263s]       Start 27: GUI:test_pdfplugin
[  263s] 27/27 Test #27: GUI:test_pdfplugin ...................***Failed    0.02 sec
[  263s]
[  263s] 4% tests passed, 26 tests failed out of 27
[  263s]
[  263s] Total Test time (real) =   6.45 sec
[  263s]
[  263s] The following tests FAILED:
[  263s]          1 - GUI:test_cedpageexporter (OTHER_FAULT)
[  263s]          2 - GUI:test_exportsettings (Failed)
[  263s]          3 - GUI:test_formatsettings (Failed)
[  263s]          4 - GUI:test_histogramwidget (Failed)
[  263s]          5 - GUI:test_imagecache (Failed)
[  263s]          6 - GUI:test_imageview (OTHER_FAULT)
[  263s]          8 - GUI:test_languageselect (Failed)
[  263s]          9 - GUI:test_page (OTHER_FAULT)
[  263s]         10 - GUI:test_packet (OTHER_FAULT)
[  263s]         11 - GUI:test_pageindicator (Failed)
[  263s]         12 - GUI:test_pagerecognitionqueue (OTHER_FAULT)
[  263s]         13 - GUI:test_pagerecognizer (OTHER_FAULT)
[  263s]         14 - GUI:test_recentmenu (Failed)
[  263s]         15 - GUI:test_recognitionsettingsdialog (OTHER_FAULT)
[  263s]         16 - GUI:test_recognitionprogressdialog (OTHER_FAULT)
[  263s]         17 - GUI:test_selection (OTHER_FAULT)
[  263s]         18 - GUI:test_spellcheckerfactory (Failed)
[  263s]         19 - GUI:test_texteditor (OTHER_FAULT)
[  263s]         20 - GUI:test_qtextdocumentexporter (OTHER_FAULT)
[  263s]         21 - GUI:test_dibplugin (Failed)
[  263s]         22 - GUI:test_scanner (Failed)
[  263s]         23 - GUI:test_cedserializer (OTHER_FAULT)
[  263s]         24 - GUI:test_aspellchecker (Failed)
[  263s]         25 - GUI:test_multitiffplugin (Failed)
[  263s]         26 - GUI:test_imageutils (Failed)
[  263s]         27 - GUI:test_pdfplugin (Failed)
[  263s] Errors while running CTest
[  263s] make: *** [test] Error 8
[  263s] error: Bad exit status from /var/tmp/rpm-tmp.4VpPSg (%check)

I hope, something is wrong in my side. Maybe, missing runtime dependencies? How to debug the issue?

Just in case, if you want to contact me directly for testing: lazy_kent на jabber.ru. Возможно, по-русски было бы проще разобраться.

LazyKent commented 11 years ago

Compilation works well. Tests failed because of missing X. Closed.