Opened 12 years ago

Closed 12 years ago

#11 closed defect (fixed)

Bub and fix in the Ipopt's ma57 solver interface

Reported by: rodrigo Owned by: pbonami
Priority: blocker Component: Bonmin
Version: stable/0.1 Keywords:
Cc:

Description

Hi Andreas and Pierre,

I've detected a small bug in the Ma57 linear solver interface in Ipopt that only shows up when using it iteratively through bonmin. Lines 328-341 of the IpMa57SolverInterface.cpp files read as:

if (!warm_start_same_structure_) {
      dim_=0;
      nonzeros_=0;
      delete [] a_;
      delete [] wd_fact_;
      delete [] wd_ifact_;
      delete [] wd_iwork_;
      delete [] wd_keep_;
    }
    else {
      ASSERT_EXCEPTION(dim_>0 && nonzeros_>0, INVALID_WARMSTART,
                       "Ma57TSolverInterface called with warm_start_same_structure, "
                       "but the problem is solved for the first time.");
    }

I think that when bonmin calls ipopt again for a new NLP iteration, and if it is using a warm start, then the pointers to a_ and wd_* should not be deleted. I had been getting segmentation faults, but after commenting out all of the delete [] lines, the problems have gone away. What do you think guys?

Thanks, hth.

Rodrigo

Change History (2)

comment:1 Changed 12 years ago by andreasw

Hi Rodrigo,

You are right, there was something wrong. But the fix is the following:

    if (!warm_start_same_structure_) {
      dim_=0;
      nonzeros_=0;
      delete [] a_;
      a_ = NULL;
      delete [] wd_fact_;
      wd_fact_ = NULL;
      delete [] wd_ifact_;
      wd_ifact_ = NULL;
      delete [] wd_iwork_;
      wd_iwork_ = NULL;
      delete [] wd_keep_;
      wd_keep_ = NULL;
    }
    else {
      ASSERT_EXCEPTION(dim_>0 && nonzeros_>0, INVALID_WARMSTART,
                       "Ma57TSolverInterface called with warm_start_same_structure, "
                       "but the problem is solved for the first time.");
    }

This is already corrected in the current trhnk version of Ipopt. So, once I finally get around to making a new release, it will be also fixed in the official release of Ipopt.

Thanks for letting us know,

Andreas

comment:2 Changed 12 years ago by pbonami

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.