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

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

Closed
jorisv opened this issue Feb 23, 2015 · 2 comments
Labels

Comments

@jorisv
Copy link

jorisv commented Feb 23, 2015

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"
@bchretien bchretien added the bug label Feb 23, 2015
@bchretien
Copy link
Member

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
Copy link
Member

42d6ceb should fix the issue with the function-pool test.

@jorisv jorisv closed this as completed Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants