flexible-collision-library / fcl

Flexible Collision Library
https://flexible-collision-library.github.io/
Other
1.36k stars 415 forks source link

Test failures in doSimplex, gjk on Gentoo #485

Open expeditioneer opened 3 years ago

expeditioneer commented 3 years ago

I'm getting a couple of test failures when trying to build from source on v0.6.1. I'm on Gentoo ccd 2.1 (build with double precision and shared-libs and octomap 1.9.5.

The short version:

The following tests FAILED:
     34 - test_gjk_libccd-inl_gjk_doSimplex2 (Failed)

Long version:

34/38 Testing: test_gjk_libccd-inl_gjk_doSimplex2
34/38 Test: test_gjk_libccd-inl_gjk_doSimplex2
Command: "/var/tmp/portage/sci-libs/fcl-0.6.1/work/fcl-0.6.1_build/test/narrowphase/detail/convexity_based_algorithm/test_gjk_libccd-inl_gjk_doSimplex2"
Directory: /var/tmp/portage/sci-libs/fcl-0.6.1/work/fcl-0.6.1_build/test/narrowphase/detail/convexity_based_algorithm
"test_gjk_libccd-inl_gjk_doSimplex2" start time: Jul 22 14:55 CEST
Output:
----------------------------------------------------------
[==========] Running 5 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 5 tests from DoSimplex2Test
[ RUN      ] DoSimplex2Test.OriginInSimplex
[       OK ] DoSimplex2Test.OriginInSimplex (0 ms)
[ RUN      ] DoSimplex2Test.NeedMoreComputing
[       OK ] DoSimplex2Test.NeedMoreComputing (0 ms)
[ RUN      ] DoSimplex2Test.Region1Boundary1
/var/tmp/portage/sci-libs/fcl-0.6.1/work/fcl-0.6.1/test/narrowphase/detail/convexity_based_algorithm/test_gjk_libccd-inl_gjk_doSimplex2.cpp:289: Failure
Death test: doSimplex2(&line_, &dir_)
    Result: died but not with expected error.
  Expected: .*Assertion.*p_OA.dot\(p_OB\) <= p_OB.squaredNorm\(\) \* eps.*
Actual msg:
[  DEATH   ] 
[  FAILED  ] DoSimplex2Test.Region1Boundary1 (368 ms)
[ RUN      ] DoSimplex2Test.Region1Boundary2
/var/tmp/portage/sci-libs/fcl-0.6.1/work/fcl-0.6.1/test/narrowphase/detail/convexity_based_algorithm/test_gjk_libccd-inl_gjk_doSimplex2.cpp:303: Failure
Death test: doSimplex2(&line_, &dir_)
    Result: died but not with expected error.
  Expected: .*Assertion.*p_OA.dot\(p_OB\) <= p_OB.squaredNorm\(\) \* eps.*
Actual msg:
[  DEATH   ] 
[  FAILED  ] DoSimplex2Test.Region1Boundary2 (299 ms)
[ RUN      ] DoSimplex2Test.Region1Boundary3
/var/tmp/portage/sci-libs/fcl-0.6.1/work/fcl-0.6.1/test/narrowphase/detail/convexity_based_algorithm/test_gjk_libccd-inl_gjk_doSimplex2.cpp:317: Failure
Death test: doSimplex2(&line_, &dir_)
    Result: died but not with expected error.
  Expected: .*Assertion.*p_OA.dot\(p_OB\) <= p_OB.squaredNorm\(\) \* eps.*
Actual msg:
[  DEATH   ] 
[  FAILED  ] DoSimplex2Test.Region1Boundary3 (304 ms)
[----------] 5 tests from DoSimplex2Test (971 ms total)

[----------] Global test environment tear-down
[==========] 5 tests from 1 test case ran. (971 ms total)
[  PASSED  ] 2 tests.
[  FAILED  ] 3 tests, listed below:
[  FAILED  ] DoSimplex2Test.Region1Boundary1
[  FAILED  ] DoSimplex2Test.Region1Boundary2
[  FAILED  ] DoSimplex2Test.Region1Boundary3

 3 FAILED TESTS
<end of output>
Test time =   0.98 sec
----------------------------------------------------------
Test Failed.
"test_gjk_libccd-inl_gjk_doSimplex2" end time: Jul 22 14:55 CEST
"test_gjk_libccd-inl_gjk_doSimplex2" time elapsed: 00:00:00
----------------------------------------------------------
SeanCurtis-TRI commented 3 years ago

It seems that whatever build infrastructure you're using, the assert() functionality is different. The assert is obviously being evaluated and the assertion is failing (as expected). But instead of the line of code being presented as part of the "message" made available to gtest, it's getting nothing.

Can you provide specific compiler information?

I've not worked with gentoo at all, so I don't have any easy access to confirm this. You should confirm what happens when assert() fails and, at the end of the day, put local guards around these tests based on detecting that you're doing this under gentoo (based on whatever detectable properties are correlated with this alternate behavior).

Depending on what we find, you may have to keep a local change floating on top of your FCL fork. If the fix for you is to make FCL master aware of unsupported build tools or OS's, then it probably won't make it back to master.

SeanCurtis-TRI commented 3 years ago

Is it the case that you're using clang? And if so, which version.

A quick foray into bumping he CI from trusty to xenial cause this exact value to happen in a very limited scope: only debug build with clang-7 compiler on Ubuntu Xenial.

expeditioneer commented 3 years ago

Sorry for my late reply. I'm using GCC 9.3.0 with Flags '-march=native -O2 -pipe'.