achains / Twist-n-Sync-CPP-Module

High perfomance module for Twist-n-Sync application
MIT License
4 stars 1 forks source link

Undefined behaviour on Android platform #5

Closed achains closed 3 years ago

achains commented 3 years ago

Algorithm gives different results and sometimes even crashes on Android.

Strongly recommended to check everything with valgrind and other sanitizers like ASan, UBSan etc

achains commented 3 years ago

There was a problem in TSUtil::eigenCrossCor method. Fixed in https://github.com/achains/Twist-n-Sync-CPP-Module/commit/5166aff3154721241c253844ef64c71e5493b7ff I was expecting Eigen::VectorXd::conservativeResize to initialize dedicated memory with zeros, but it didn't. Manually initialized it and valgrind erros disappeared.