[Osi] Two issues in OsiCpxSolverInterface

Ted Ralphs tkralphs at lehigh.edu
Tue Feb 16 22:06:36 EST 2016


Hi Christian,

Looks like Stefan fixed at least one of these issues in trunk and stable.
Can you take a look?

Cheers,

Ted

On Fri, Feb 12, 2016 at 10:39 AM, Christian Troost <
christian.troost at uni-hohenheim.de> wrote:

> Dear OsiCpx-Team,
>
> I am currently testing the OsiCpxSolverInterface for our application.
>
> I stumbled over two issues that are probably bugs in the code:
>
> 1) In OsiCpxSolverInterface::getRowActivity() the rowact_ array is never
> populated and remains unititialized if
>         if( probtypemip_ )
>         AND  #if CPX_VERSION >= 1100
>         AND  if( solntype != CPX_NO_SOLN )
>
> 2) In OsiCpxSolverInterface::reset():
>
> OsiCpxSolverInterface calls parent OsiSolverInterface::setInitialData(),
>
> which does the following to the message handler:
>
>   if (defaultHandler_) {
>     delete handler_;
>     handler_ = NULL;
>   }
>   defaultHandler_=true;
>
> Now, what if a user passes in a message handler?
> According to the headers it is the users' responsibility to deallocate
> the message handler. So, assume the following sequence:
>
> A user allocates a message handler in his application
> The user passes in this message handler (this will set defaultHandler_=
> false) to OsiCpxSolverInterface.
> After some time, the user calls ->reset and deallocates the message
> handler in his application
>
> Since defaultHandler_ was false, handler_ has not been set to NULL in
> reset, but rather still points to the now deallocated memory.
>
> If the user now reuses the SolverInterface for the next problem, without
> passing in a messageHandler object the program may segfault on the first
> use of the message handler
>
> May not happen to often, but I had a problem and this seemed to be the
> reason ...
>
>
> Best,
> Christian
> _______________________________________________
> Osi mailing list
> Osi at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/osi
>



-- 
Dr. Ted Ralphs
Professor, Lehigh University
(610) 628-1280
ted 'at' lehigh 'dot' edu
coral.ie.lehigh.edu/~ted
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/osi/attachments/20160216/8d8cf9ac/attachment.html>


More information about the Osi mailing list