[Ipopt-tickets] [Ipopt] #185: Metadata handling might segfault in TNLPAdapter::FinalizeSolution
Ipopt
coin-trac at coin-or.org
Thu Aug 30 14:29:24 EDT 2012
#185: Metadata handling might segfault in TNLPAdapter::FinalizeSolution
---------------------+------------------------
Reporter: hpirnay | Owner: ipopt-team
Type: defect | Status: new
Priority: low | Component: Ipopt
Version: 3.10 | Severity: normal
Keywords: MetaData |
---------------------+------------------------
This is a bug found by Weifeng Chen:
In IpTNLPAdapter.cpp, it is implicitly assumed that all MetaData vectors
have the same length as the DenseVector they are attached to. However, in
the setter functions in IpDenseVector.hpp, this is never checked.
This might lead to segfaults in IpTNLPAdapter.cpp lines
1890,1917,1918,1964,1965, if MetaData are passed in that don't have the
correct length.
Possible fixes:
1. In IpDenseVector.hpp, DenseVector::Set...MetaData, check for the length
of the vector that is passed in, and don't accept it, if it doesn't have
the correct length
2. In IpTNLPAdapter, check the length of the arrays that are retrieved via
DenseVector::Get...MetaData before assuming their length to be the same.
Personally, I would prefer 2., since it allows a more flexible use of the
MetaData feature.
--
Ticket URL: <https://projects.coin-or.org/ticket/185>
Ipopt <http://projects.coin-or.org/Ipopt>
Interior-point optimizer for nonlinear programs.
More information about the Ipopt-tickets
mailing list