1

Hi everyone who use Eigen, I encountered a strange question here.

I implemented a Unscented Kalman Filter with Eigen.

It works very well on my PC, but the same piece of code will generate segmentation fault on my embedded system, Odroid XU (Armv7 Architecture).

After hours of debugging, I found the problem was with this part:

qrSolver.compute(OS.transpose());    
m_q=qrSolver.householderQ();
m_r = qrSolver.matrixQR().triangularView<Upper>();

S_pre = m_r.block(0,0,n,n).transpose();

if (w_c0 < 0)
    internal::llt_inplace<float,Upper>::rankUpdate(S_pre,
                sqrt(-w_c0)*(sigmaPoints.col(0) - state_pre),
    -1);
else
    internal::llt_inplace<float,Upper>::rankUpdate(S_pre,
                sqrt(w_c0)*(sigmaPoints.col(0) - state_pre),
    1);

where I first compute the QR decomposition of matrix OS (dimension n-by-3n), and then perform rank update of its R component (dimension n-by-n). internal::llt_inplace::rankUpdate is a function in Eigen library which is not documented. It just perform rank-1 update to its first argument. This function can be found in ~/path_to_Eigen/Cholesky/LLT.h

The most strange thing of this piece of code is, with -DCMAKE_BUILD_TYPE=Debug it works perfectly, while if I compile with -DCMAKE_BUILD_TYPE=Release, this code fails.

I would like to ask can anyone understand this or does anyone have similar issue before. Please help, thanks a lot.

g3rv4
  • 19,750
  • 4
  • 36
  • 58
PaulYang
  • 330
  • 3
  • 9
  • It could be possible that running debug results in extra checks which make it run correctly.. – cageman Apr 07 '14 at 13:12
  • What if you disable NEON vectorization? (-DEIGEN_DONT_VECTORIZE) Can you run valgrind on your system? (you might also try your code with valgrind on your P, even if it's working there might be hidden errors). – ggael Apr 08 '14 at 08:41

0 Answers0