roboptim-core icon indicating copy to clipboard operation
roboptim-core copied to clipboard

derivable-function and function-pool unit test fail with g++ (4.7.2) and Boost (1.49)

Open jorisv opened this issue 10 years ago • 2 comments

derivable-function and function-pool unit test fail with g++ (4.7.2) and Boost (1.49) when compiling in Release (-O3 -DNDEBUG). The bug don't appear when compiling in Debug, and appear only for function-pool in -O1 and -O2. If I use a previous g++ version (4.6.3) the bug don't appear. Probably a compiler issue…

derivable-function output:

Running 4 test cases...
log4cxx: Could not open file [/home/joris/dev/these/mc_pg/roboptim-core/tests/log4cxx.xml].
null function (differentiable function)
Differentiable function
1
1
1
1
null function

1
1
[1](0)
[1](0)
[1](0)
[1](0)
[1](0)
[1](0)
1
1
(1, 1)
(1, 1)
1
1
1
1

log4cxx: Could not open file [/home/joris/dev/these/mc_pg/roboptim-core/tests/log4cxx.xml].
null function (differentiable function)
Differentiable function
1
1
1
1
null function

1
1
[1](0)
[1](0)








1
1
(1, 1)
(1, 1)
1
1
1
1

log4cxx: Could not open file [/home/joris/dev/these/mc_pg/roboptim-core/tests/log4cxx.xml].
unknown location(0): fatal error in "jacobian_check<N8roboptim16EigenMatrixDenseE>": signal: SIGSEGV, si_code: 0 (memory access violation at address: 0x00000080)
/home/joris/dev/these/mc_pg/roboptim-core/tests/derivable-function.cc(244): last checkpoint

*** 1 failure detected in test suite "Master Test Suite"

function-pool output:

Running 2 test cases...
log4cxx: Could not open file [/home/joris/dev/these/mc_pg/roboptim-core/tests/log4cxx.xml].
x = [3](0.785398,-0.785398,1.5708)
Joint position pool (differentiable function):
  Position of joint 0 (differentiable function)
  Position of joint 1 (differentiable function)
  Position of joint 2 (differentiable function)
Engine: calling compute
[6](0.707107,0.707107,1.70711,0.707107,1.70711,1.70711)
Engine: calling jacobian
[6,3]((-0.707107,0,0), (0.707107,0,0), (-0.707107,6.12303e-17,0), (1.70711,1,0), (-1.70711,-1,-1), (1.70711,1,1.22461e-16))
Position of joint 0 (differentiable function)
[2](0.707107,0.707107)
[2,3]((-0.707107,0,0), (0.707107,0,0))
Position of joint 1 (differentiable function)
[2](1.70711,0.707107)
[2,3]((-0.707107,6.12303e-17,0), (1.70711,1,0))
Position of joint 2 (differentiable function)
[2](1.70711,1.70711)
[2,3]((-1.70711,-1,-1), (1.70711,1,1.22461e-16))
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
[6,3]((-0.707107,0,0), (0.707107,0,0), (-0.707107,0,0), (1.70711,1,0), (-1.70711,-1,-1), (1.70711,1,0))

/home/joris/dev/these/mc_pg/roboptim-core/tests/function-pool.cc(310): error in "function_pool<N8roboptim16EigenMatrixDenseE>": check output->match_pattern () failed. Mismatch at position 386
...03e-1...
...23e-1...
log4cxx: Could not open file [/home/joris/dev/these/mc_pg/roboptim-core/tests/log4cxx.xml].
x = [3](0.785398,-0.785398,1.5708)
Joint position pool (differentiable function):
  Position of joint 0 (differentiable function)
  Position of joint 1 (differentiable function)
  Position of joint 2 (differentiable function)
Engine: calling compute
[6](0.707107,0.707107,1.70711,0.707107,1.70711,1.70711)
Engine: calling jacobian
[6,3]((-0.707107,0,0), (0.707107,0,0), (-0.707107,6.12303e-17,0), (1.70711,1,0), (-1.70711,-1,-1), (1.70711,1,1.22461e-16))
Position of joint 0 (differentiable function)
[2](0.707107,0.707107)
[2,3]((-0.707107,0,0), (0.707107,0,0))
Position of joint 1 (differentiable function)
[2](1.70711,0.707107)
[2,3]((-0.707107,6.12303e-17,0), (1.70711,1,0))
Position of joint 2 (differentiable function)
[2](1.70711,1.70711)
[2,3]((-1.70711,-1,-1), (1.70711,1,1.22461e-16))
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
Engine: calling compute
[6,3]((-0.707107,0,0), (0.707107,0,0), (-0.707107,0,0), (1.70711,1,0), (-1.70711,-1,-1), (1.70711,1,0))

/home/joris/dev/these/mc_pg/roboptim-core/tests/function-pool.cc(310): error in "function_pool<N8roboptim17EigenMatrixSparseE>": check output->match_pattern () failed. Mismatch at position 386
...03e-1...
...23e-1...

*** 2 failures detected in test suite "Master Test Suite"

jorisv avatar Feb 23 '15 10:02 jorisv

Thanks for reporting this.

For derivable-function, if this is indeed a compiler issue, there isn't much we can do, except find an alternative implementation in the function we use in the hope that it would not lead to the same compiler error.

For function-pool, this could probably be avoided with a better check for small scalars (as was done in roboptim/roboptim-trajectory#21), since different compilers can produce different results. We can probably make something generic, which would benefit to other tests that also compare matrices extensively. In the meantime, I guess we could filter small scalars and set them to zero (not ideal but good enough for the pool).

bchretien avatar Feb 23 '15 12:02 bchretien

https://github.com/roboptim/roboptim-core/commit/42d6ceb3b1a76ce271854e336fae027b9ccddf50 should fix the issue with the function-pool test.

bchretien avatar Mar 07 '15 09:03 bchretien