Invalid read with valgrind
The demos pile_of_sand_spheres
gives invalid read with valgrind. The problem is that the function get_lagrange_multiplier
in OptimBase.hpp get an xtensor of size contacts.size()
with the call to lagrange_multiplier_data()
but in the next line, it's cast to an array of size number_row_matrix(contacts)
which returns 4 * contacts.size()
for the problem DryWithFriction of this demo. For a problem DryWithoutFriction the right size is returned (contacts.size()).
I'm not sure where the bug is (size of lagrange multipliers with OptimMosek, or the function get_lagrange_multiplier). If contacts.size() is used instead of this->number_row_matrix(contacts) in the function get_lagrange_multiplier, the invalid read error disappear. But I don't know if it's compatible with the other problems.