Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 482726

Summary: app-office/libreoffice-4.1.0.4 - diff.cxx:267:Assertion Test name: SdFiltersTest::testDocumentLayout -/ /- double equality assertion failed
Product: Gentoo Linux Reporter: Andrew Savchenko <bircoph>
Component: Current packagesAssignee: Gentoo Office Team <office>
Status: RESOLVED FIXED    
Severity: normal CC: bircoph
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log.xz
environment
emerge --info
libreoffice-4.1.0.4.ebuild.patch

Description Andrew Savchenko gentoo-dev 2013-08-27 21:07:40 UTC
Hello,

libreoffice-4.1.0.4 fails to compile due to failed unit test despite USE="-test":

diff.cxx:267:Assertion
Test name: SdFiltersTest::testDocumentLayout
double equality assertion failed
- Expected: nan
- Actual  : nan
- Delta   : 1e-08
- Reference: /var/tmp/portage/app-office/libreoffice-4.1.0.4/work/libreoffice-4
.1.0.4/sd/qa/unit/data/xml/shapes-test_page0.xml
- Node: type
Comment 1 Andrew Savchenko gentoo-dev 2013-08-27 21:09:27 UTC
Created attachment 357202 [details]
build.log.xz
Comment 2 Andrew Savchenko gentoo-dev 2013-08-27 21:09:40 UTC
Created attachment 357204 [details]
environment
Comment 3 Andrew Savchenko gentoo-dev 2013-08-27 21:10:10 UTC
Created attachment 357208 [details]
emerge --info
Comment 4 Andrew Savchenko gentoo-dev 2013-08-28 05:37:37 UTC
That's no fun at all. After offending test disable it fails on another one:

[build CUT] sc_ucalc
Value: 8
43formel: =A1+B1

3
expected height 6001 actual 6001
expected width 2001 actual 2001
expected left 6000 actual 6000
expected right 3000 actual 3000
expected new height 8002 actual 8001
expected new width 3002 3001
expected startrow 3 actual 3
expected startcol 6 actual 6
expected endrow 8 actual 8
expected endcol 7 actual 7
ucalc.cxx:1094:Assertion
Test name: (anonymous namespace)::Test::testCellFunctions
equality assertion failed
- Expected: -7
- Actual  : 0
- =IFERROR(A6;-7)

Failures !!!
Run: 64   Failure total: 1   Failures: 1   Errors: 0

Error: a unit test failed, please do one of:

export DEBUGCPPUNIT=TRUE            # for exception catching
export GDBCPPUNITTRACE="gdb --args" # for interactive debugging
export VALGRIND=memcheck            # for memory checking

and retry using: make CppunitTest_sc_ucalc

There should be a way to disable all this tests altogether. While failing tests are not desired themselves, it is quite expected that for so sophisticated, large and thus buggy project like libreoffice some things will occasionally fail here and there.
Comment 5 Andrew Savchenko gentoo-dev 2013-08-29 02:15:30 UTC
This bug contains multiple issues:

1) Libreoffice forces unit tests even with USE="-test".
2) Some unit tests fail.

Default libreoffice's build target (in dmake system) is build and all tests, but it may be changed by changing Makefile target to build-nocheck.

See attached patch for the fix. Works fine for me, disables all test and speeds up overall build time.
Comment 6 Andrew Savchenko gentoo-dev 2013-08-29 02:22:59 UTC
Created attachment 357284 [details, diff]
libreoffice-4.1.0.4.ebuild.patch

Disable all tests when test use flag is not set.
Comment 7 Tomáš Chvátal (RETIRED) gentoo-dev 2013-08-29 14:38:11 UTC
Yea not running tests is a good idea, but still those tests are valid, something is seriously broken in your system, so you can get for example wrong resutls on calc with this lo, is that something you really desire?
Comment 8 Andrew Savchenko gentoo-dev 2013-08-29 14:52:59 UTC
(In reply to Tomáš Chvátal from comment #7)
> Yea not running tests is a good idea, but still those tests are valid,
> something is seriously broken in your system, so you can get for example
> wrong resutls on calc with this lo, is that something you really desire?

I doubt that all test are correct. Result such as (see my first post):
- Expected: nan
- Actual  : nan
- Delta   : 1e-08
can't be correct. NaN is NaN. I have an idea where this exact bug comes from, but this is a test bug, not a code bug: take one NaN float and another double and compare their in-memory representations, here you go.

And I do not really care what calc results will be, because I do not use office for scientific computations.

Yes, failing test are bad and in the ideal world all of them should be taken care of, but in the real life I do not always have time to handle compilation issues during world updates. 

Most complex packages fail tests here and there and this doesn't always mean a problem in the code itself. Take a look on glibc, on most systems some of tests will fail, we don't even have a test use flag for this package, but it have tests.
Comment 9 Tomáš Chvátal (RETIRED) gentoo-dev 2013-08-30 08:36:23 UTC
Fixed in 4.1.1.2, But still please take time to report this to upstream tracker at bugs.freedesktop.org.