You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to extend the SIpopt example parametric_dsdp_cpp adding a third parameter eta3 in the problem, but I am experiencing a crash due to access to unallocated memory (code with the modifications I am doing is here: parametric_dsdp_cpp.zip )
Trying to debug the problem, it seems to come from the fact that in line 210 of SensAlgorithm.cpp, inside the method ComputeSensitivityMatrix that is called when the option compute_dsdp is enabled, a vector space of hard-coded size 2 is created:
SmartPtr < DenseVectorSpace > delta_u_space;
delta_u_space = new DenseVectorSpace(2);
If the number of parameters in the problem is >= 3, it causes a crash because later the code tries to access the elements in position >= 2.
On the other hand, inside the method SensAlgorithm::Run() similar computation are performed, but this time in line 176 the method GetMeasurement is used:
According to d59d1b0, the question onto the "why" should go to @rlougee.
But I like that at the very end of your report you also provide the patch on how to fix this.
If I replace the 2 by np_, I don't get a complain on valgrind anymore.
Hi everyone!
I am trying to extend the SIpopt example parametric_dsdp_cpp adding a third parameter eta3 in the problem, but I am experiencing a crash due to access to unallocated memory (code with the modifications I am doing is here: parametric_dsdp_cpp.zip )
Trying to debug the problem, it seems to come from the fact that in line 210 of
SensAlgorithm.cpp
, inside the methodComputeSensitivityMatrix
that is called when the optioncompute_dsdp
is enabled, a vector space of hard-coded size 2 is created:If the number of parameters in the problem is >= 3, it causes a crash because later the code tries to access the elements in position >= 2.
On the other hand, inside the method
SensAlgorithm::Run()
similar computation are performed, but this time in line 176 the methodGetMeasurement
is used:and inside that method a vector space of size
n_idx_
is created, size that corresponds to the number of parameters in the problem:Is there a reason why inside
ComputeSensitivityMatrix
the size ofdelta_u_space
is 2 instead of the private membernp_
?Thanks,
Andrea
The text was updated successfully, but these errors were encountered: