[Ipopt] Null pointer crash

Plett, Kelly KPlett at kbcat.com
Tue Feb 2 12:01:41 EST 2010


Hi Andreas,

I've been meaning to get back to the list that it was completely my
fault.  Hans' original reply triggered my memory enough to look at some
code I'd added to BacktrackingLineSearch::DoBacktrackingLineSearch.  In
order to cope with an infinite loop in one particular problem, I added
the highlighted code:

      while (alpha_primal>alpha_min ||
             n_steps == 0 ) {
        // always allow the "full" step if it is
        // acceptable (even if alpha_primal<=alpha_min)
        Jnlst().Printf(J_DETAILED, J_LINE_SEARCH,
                       "Starting checks for alpha (primal) = %8.2e\n",
                       alpha_primal);

>       if (alpha_primal-alpha_min < 1.0e-10) {
>         alpha_primal = alpha_min;
>         Jnlst().Printf(J_DETAILED, J_LINE_SEARCH, "Setting alpha to
ALPHA_MIN after %d steps\n", n_steps);
>         break;
>       }

Not sure how appalling it is, but it got that particular case solving
again (I can't remember the details, but alpha_primal had slowly worked
its way to be 1e-200 above alpha_min or something like that).  Anyway,
after I added "&& n_steps > 0" to that hack, the crash disappeared.

Thanks again,
Kelly 

> -----Original Message-----
> From: Andreas Waechter [mailto:andreasw at watson.ibm.com] 
> Sent: February 2, 2010 9:28 AM
> To: Plett, Kelly
> Cc: ipopt at list.coin-or.org
> Subject: Re: [Ipopt] Null pointer crash
> 
> Hi Kelly,
> 
> Have you been able to fix this in the meantime?  I have not 
> seen this problem before, and since it is at the heart of the 
> code, it would surprise me if you found a bug there.
> 
> However, if you can still reproduce this error, I suggest you 
> first check your code with a memory checker to make sure 
> there is no issues with writing into invalid memory or using 
> unintialized values.  If you can't find anything with this, 
> please let us know what options you are using. 
> Also, have a look at the output file for a print_level at 
> least 7 and see if you see something strange before the error 
> occurs (e.g., did your code return false when evaluating any 
> of the problem functions or derivatives)...
> 
> Regards,
> 
> Andreas
> 
> On Mon, 18 Jan 2010, Plett, Kelly wrote:
> 
> > Hi all,
> >
> > We have been using Ipopt with good success to optimize various 
> > black-box process models, so thanks to all who have 
> contributed to the project.
> > However...
> >
> > Recently I have been running into an increasing number of crashes in
> > IpoptCalculatedQuantities::curr_d_minus_s() on a null s 
> pointer.  When 
> > I bump up COIN_IPOPT_CHECKLEVEL to 3, I observe SmartPtr assertions 
> > starting in IpoptCalculatedQuantities::trial_slack_x_L() because
> > ip_data_->trial()->x() is null.  This occurs in AcceptTrialPoint on 
> > the max_correction = correct_bound_multiplier(...) line with the 
> > following call stack:
> > 	ipopt.dll!_wassert(const wchar_t * expr=0x0f594ea4, 
> const wchar_t * 
> > filename=0x0f594e40, unsigned int lineno=433)  Line 384 C
> > 	ipopt.dll!Ipopt::SmartPtr<Ipopt::Vector const >::operator*()
> > Line 433 + 0x1c bytes	C++
> > 	ipopt.dll!Ipopt::IpoptCalculatedQuantities::trial_slack_x_L()
> > Line 357 + 0x8 bytes	C++
> > 	ipopt.dll!Ipopt::IpoptCalculatedQuantities::trial_compl_x_L()
> > Line 1823 + 0xc bytes	C++
> >> 	ipopt.dll!Ipopt::IpoptAlgorithm::AcceptTrialPoint()  Line 658 +
> > 0x1d bytes	C++
> > 	ipopt.dll!Ipopt::IpoptAlgorithm::Optimize(bool isResto=false)
> > Line 367	C++
> >
> > Being new to the internals of Ipopt, under what conditions will the 
> > trial x vector be null?  Is there anything specific I 
> should look for 
> > in the diagnostics that might help me identify the root cause?  Any 
> > guidance would be greatly appreciated!
> >
> > The case in which I am currently observing this behaviour 
> is tiny (one 
> > variable, one inequality), but I have seen it in larger 
> ones as well.  
> > I can reproduce in both Ipopt 3.6.0 and 3.8.1.
> >
> > Thanks in advance,
> > Kelly
> > This e-mail is confidential and intended only for the 
> individual(s) to 
> > whom it is addressed. If you or your organisation is not an 
> intended 
> > recipient of this e-mail, please notify the sender by 
> replying and do 
> > not read or disseminate its information. Please delete all 
> copies from 
> > your system. KBC is liable neither for the proper or complete 
> > transmission of the information contained in this communication nor 
> > for any delay in its receipt. Opinions, conclusions and other 
> > information in this message and attachments that do not 
> relate to the 
> > official business of KBC are neither given nor endorsed by it. Even 
> > though the Webroot Virus Centre has checked this message 
> for all known 
> > viruses, you should carry out your own virus checks before 
> opening any 
> > attachments. Thank you for your co-operation. www.kbcat.com
> 




More information about the Ipopt mailing list