Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MA97 Segfault with HSL 2013 and Ipopt 3.11.1 #206

Closed
svigerske opened this issue Jan 29, 2019 · 8 comments
Closed

MA97 Segfault with HSL 2013 and Ipopt 3.11.1 #206

svigerske opened this issue Jan 29, 2019 · 8 comments
Labels

Comments

@svigerske
Copy link
Member

svigerske commented Jan 29, 2019

Issue created by migration from Trac.

Original creator: smith

Original creation time: 2013-06-25 18:29:32

Assignee: ipopt-team

Version: 3.11

CC: jhogg41

After upgrading to HSL 2013 and Ipopt 3.11.1, I've started to experience segfaults with MA97 on various problems (the other HSL solvers seem fine). The problem occurs when I use MA97 to solve multiple problem instances in serial.

A backtrace (full output below) shows that the segfault occurs when the Ma97SolverInterface destructor is invoked. The segfault occurs with both the GNU toolchain (4.6.4) and Intel's toolchain (13.0.1) on Linux and OS X, and occurs whether or not I build Ipopt/HSL with OpenMP support. Running in valgrind I obtain a "Conditional jump or move depends on uninitialised value(s)" error for MA97 but not with the other HSL solvers (again, full output included below).

I am building Ipopt with HSL, Metis, and Mumps, and configuring Ipopt with: ../configure CXX=g++-4.6 CC=gcc-4.6 F77=gfortran-4.6 --enable-debug -with-ipopt-checklevel=1

valgrind output:

==3701== Use of uninitialised value of size 8
==3701==    at 0x8F7178: __hsl_ma97_double_MOD_free_akeep_double (hsl_ma97d.f90:6667)
==3701==    by 0x7C19A4: ma97_free_akeep_d (hsl_ma97d_ciface.f90:612)
==3701==    by 0x7C7E5A: ma97_finalise_d (hsl_ma97d_ciface.f90:654)
==3701==    by 0x536259: Ipopt::Ma97SolverInterface::~Ma97SolverInterface() (IpMa97SolverInterface.cpp:52)
==3701==    by 0x5362B9: Ipopt::Ma97SolverInterface::~Ma97SolverInterface() (IpMa97SolverInterface.cpp:53)
==3701==    by 0x441CBE: Ipopt::SmartPtr<Ipopt::SparseSymLinearSolverInterface>::ReleasePointer_() (IpSmartPtr.hpp:554)
==3701==    by 0x43EF6D: Ipopt::SmartPtr<Ipopt::SparseSymLinearSolverInterface>::~SmartPtr() (IpSmartPtr.hpp:434)
==3701==    by 0x52B146: Ipopt::TSymLinearSolver::~TSymLinearSolver() (IpTSymLinearSolver.cpp:40)
==3701==    by 0x52B1CF: Ipopt::TSymLinearSolver::~TSymLinearSolver() (IpTSymLinearSolver.cpp:47)
==3701==    by 0x45BB54: Ipopt::SmartPtr<Ipopt::SymLinearSolver>::ReleasePointer_() (IpSmartPtr.hpp:554)
==3701==    by 0x45A987: Ipopt::SmartPtr<Ipopt::SymLinearSolver>::~SmartPtr() (IpSmartPtr.hpp:434)
==3701==    by 0x51BAB9: Ipopt::StdAugSystemSolver::~StdAugSystemSolver() (IpStdAugSystemSolver.cpp:58)
==3701==  Uninitialised value was created by a heap allocation
==3701==    at 0x4C2B1C7: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==3701==    by 0x455EFE: Ipopt::AlgorithmBuilder::BuildBasicAlgorithm(Ipopt::Journalist const&, Ipopt::OptionsList const&, std::string const&) (IpAlgBuilder.cpp:444)
==3701==    by 0x41C6E1: Ipopt::IpoptApplication::OptimizeNLP(Ipopt::SmartPtr<Ipopt::NLP> const&, Ipopt::SmartPtr<Ipopt::AlgorithmBuilder>&) (IpIpoptApplication.cpp:746)
==3701==    by 0x41C43A: Ipopt::IpoptApplication::OptimizeNLP(Ipopt::SmartPtr<Ipopt::NLP> const&) (IpIpoptApplication.cpp:712)
==3701==    by 0x41BFDD: Ipopt::IpoptApplication::OptimizeTNLP(Ipopt::SmartPtr<Ipopt::TNLP> const&) (IpIpoptApplication.cpp:691)
==3701==    by 0x405B80: solveBCQP(Eigen::SparseMatrix<double, 0, int> const&, Eigen::Matrix<double, -1, 1, 0, -1, 1> const&, Eigen::Matrix<double, -1, 1, 0, -1, 1> const&, Eigen::Matrix<double, -1, 1, 0, -1, 1> const&) (in /home/smith/BCQPSolver/bcqp)
==3701==    by 0x405F98: main (in /home/smith/BCQPSolver/bcqp)

gdb backtrace:

Program received signal SIGSEGV, Segmentation fault.
__GI___libc_free (mem=0x1) at malloc.c:2970
2970	malloc.c: No such file or directory.
(gdb) bt
#0  __GI___libc_free (mem=0x1) at malloc.c:2970
#1  0x00000000008f71f7 in hsl_ma97_double::free_akeep_double (akeep=...) at ../../../ThirdParty/HSL/coinhsl/hsl_ma97/hsl_ma97d.f90:6668
#2  0x00000000007c19a5 in ma97_free_akeep_d (cakeep=0xcb8130) at ../../../ThirdParty/HSL/coinhsl/hsl_ma97/C/hsl_ma97d_ciface.f90:612
#3  0x00000000007c7e5b in ma97_finalise_d (cakeep=0xcb8130, cfkeep=0x0)
    at ../../../ThirdParty/HSL/coinhsl/hsl_ma97/C/hsl_ma97d_ciface.f90:654
#4  0x000000000053625a in Ipopt::Ma97SolverInterface::~Ma97SolverInterface (this=0xcb7a50, __in_chrg=<optimized out>)
    at ../../../../../Ipopt/src/Algorithm/LinearSolvers/IpMa97SolverInterface.cpp:52
#5  0x00000000005362ba in Ipopt::Ma97SolverInterface::~Ma97SolverInterface (this=0xcb7a50, __in_chrg=<optimized out>)
    at ../../../../../Ipopt/src/Algorithm/LinearSolvers/IpMa97SolverInterface.cpp:53
#6  0x0000000000441cbf in Ipopt::SmartPtr<Ipopt::SparseSymLinearSolverInterface>::ReleasePointer_ (this=0xcb7c28)
    at ../../../../Ipopt/src/Interfaces/../Common/IpSmartPtr.hpp:554
#7  0x000000000043ef6e in Ipopt::SmartPtr<Ipopt::SparseSymLinearSolverInterface>::~SmartPtr (this=0xcb7c28, __in_chrg=<optimized out>)
    at ../../../../Ipopt/src/Interfaces/../Common/IpSmartPtr.hpp:434
#8  0x000000000052b147 in Ipopt::TSymLinearSolver::~TSymLinearSolver (this=0xcb7bd0, __in_chrg=<optimized out>)
    at ../../../../../Ipopt/src/Algorithm/LinearSolvers/IpTSymLinearSolver.cpp:40
#9  0x000000000052b1d0 in Ipopt::TSymLinearSolver::~TSymLinearSolver (this=0xcb7bd0, __in_chrg=<optimized out>)
    at ../../../../../Ipopt/src/Algorithm/LinearSolvers/IpTSymLinearSolver.cpp:47
#10 0x000000000045bb55 in Ipopt::SmartPtr<Ipopt::SymLinearSolver>::ReleasePointer_ (this=0xcb73e8)
    at ../../../../Ipopt/src/Algorithm/../Common/IpSmartPtr.hpp:554
#11 0x000000000045a988 in Ipopt::SmartPtr<Ipopt::SymLinearSolver>::~SmartPtr (this=0xcb73e8, __in_chrg=<optimized out>)
    at ../../../../Ipopt/src/Algorithm/../Common/IpSmartPtr.hpp:434
#12 0x000000000051baba in Ipopt::StdAugSystemSolver::~StdAugSystemSolver (this=0xcb73b0, __in_chrg=<optimized out>)
    at ../../../../Ipopt/src/Algorithm/IpStdAugSystemSolver.cpp:58
#13 0x000000000051bbf4 in Ipopt::StdAugSystemSolver::~StdAugSystemSolver (this=0xcb73b0, __in_chrg=<optimized out>)
    at ../../../../Ipopt/src/Algorithm/IpStdAugSystemSolver.cpp:61
#14 0x0000000000424d81 in Ipopt::SmartPtr<Ipopt::AugSystemSolver>::ReleasePointer_ (this=0xcb7ca8)
    at ../../../../Ipopt/src/Interfaces/../Common/IpSmartPtr.hpp:554
#15 0x00000000004235b8 in Ipopt::SmartPtr<Ipopt::AugSystemSolver>::~SmartPtr (this=0xcb7ca8, __in_chrg=<optimized out>)
    at ../../../../Ipopt/src/Interfaces/../Common/IpSmartPtr.hpp:434
#16 0x00000000004eafe6 in Ipopt::PDFullSpaceSolver::~PDFullSpaceSolver (this=0xcb7c70, __in_chrg=<optimized out>)
    at ../../../../Ipopt/src/Algorithm/IpPDFullSpaceSolver.cpp:40
#17 0x00000000004eb070 in Ipopt::PDFullSpaceSolver::~PDFullSpaceSolver (this=0xcb7c70, __in_chrg=<optimized out>)
    at ../../../../Ipopt/src/Algorithm/IpPDFullSpaceSolver.cpp:43
#18 0x000000000044fdb1 in Ipopt::SmartPtr<Ipopt::PDSystemSolver>::ReleasePointer_ (this=0xcb6a88)
    at ../../../../../Ipopt/src/contrib/CGPenalty/../../Common/IpSmartPtr.hpp:554
#19 0x000000000044ed5e in Ipopt::SmartPtr<Ipopt::PDSystemSolver>::~SmartPtr (this=0xcb6a88, __in_chrg=<optimized out>)
    at ../../../../../Ipopt/src/contrib/CGPenalty/../../Common/IpSmartPtr.hpp:434
#20 0x00000000004f627c in Ipopt::PDSearchDirCalculator::~PDSearchDirCalculator (this=0xcb6a50, __in_chrg=<optimized out>)
    at ../../../../Ipopt/src/Algorithm/IpPDSearchDirCalc.cpp:28
#21 0x00000000004f62dc in Ipopt::PDSearchDirCalculator::~PDSearchDirCalculator (this=0xcb6a50, __in_chrg=<optimized out>)
    at ../../../../Ipopt/src/Algorithm/IpPDSearchDirCalc.cpp:32
#22 0x000000000045b439 in Ipopt::SmartPtr<Ipopt::SearchDirectionCalculator>::ReleasePointer_ (this=0xcb6ad8)
    at ../../../../Ipopt/src/Algorithm/../Common/IpSmartPtr.hpp:554
#23 0x000000000045a3a4 in Ipopt::SmartPtr<Ipopt::SearchDirectionCalculator>::~SmartPtr (this=0xcb6ad8, __in_chrg=<optimized out>)
    at ../../../../Ipopt/src/Algorithm/../Common/IpSmartPtr.hpp:434
#24 0x00000000004853fe in Ipopt::IpoptAlgorithm::~IpoptAlgorithm (this=0xcb6aa0, __in_chrg=<optimized out>)
    at ../../../../Ipopt/src/Algorithm/IpIpoptAlg.cpp:54
#25 0x000000000048550c in Ipopt::IpoptAlgorithm::~IpoptAlgorithm (this=0xcb6aa0, __in_chrg=<optimized out>)
    at ../../../../Ipopt/src/Algorithm/IpIpoptAlg.cpp:58
#26 0x0000000000424e65 in Ipopt::SmartPtr<Ipopt::IpoptAlgorithm>::ReleasePointer_ (this=0xc83880)
---Type <return> to continue, or q <return> to quit---
    at ../../../../Ipopt/src/Interfaces/../Common/IpSmartPtr.hpp:554
#27 0x000000000042367c in Ipopt::SmartPtr<Ipopt::IpoptAlgorithm>::~SmartPtr (this=0xc83880, __in_chrg=<optimized out>)
    at ../../../../Ipopt/src/Interfaces/../Common/IpSmartPtr.hpp:434
#28 0x0000000000419c16 in Ipopt::IpoptApplication::~IpoptApplication (this=0xc83850, __in_chrg=<optimized out>)
    at ../../../../Ipopt/src/Interfaces/IpIpoptApplication.cpp:561
#29 0x0000000000419d64 in Ipopt::IpoptApplication::~IpoptApplication (this=0xc83850, __in_chrg=<optimized out>)
    at ../../../../Ipopt/src/Interfaces/IpIpoptApplication.cpp:565
#30 0x0000000000406647 in Ipopt::SmartPtr<Ipopt::IpoptApplication>::ReleasePointer_ (this=0x7fffffffe8f0)
    at ../../../../Ipopt/src/Interfaces/../Common/IpSmartPtr.hpp:554
#31 0x00000000004062de in Ipopt::SmartPtr<Ipopt::IpoptApplication>::~SmartPtr (this=0x7fffffffe8f0, __in_chrg=<optimized out>)
    at ../../../../Ipopt/src/Interfaces/../Common/IpSmartPtr.hpp:434
#32 0x0000000000405b9e in solveBCQP(Eigen::SparseMatrix<double, 0, int> const&, Eigen::Matrix<double, -1, 1, 0, -1, 1> const&, Eigen::Matrix<double, -1, 1, 0, -1, 1> const&, Eigen::Matrix<double, -1, 1, 0, -1, 1> const&) ()
#33 0x0000000000405f99 in main ()

(changed by @svigerske at 2013-06-26 08:15:28)

@svigerske
Copy link
Member Author

Binary attachment BCQPSolver.tar.bz2 by smith created at 2013-06-25 18:30:00 lost by Trac to GitHub conversion.

Code to generate segfault

@svigerske
Copy link
Member Author

Comment by smith created at 2013-06-25 18:31:40

To run the program:

  • Set the environment variable IPOPT_DIR to point to the Ipopt installation location.
  • Extract the source: tar xvjf BCQPSolver.tar.bz2
  • Execute make
  • Run the executable with the following argument: ./bcqp qp.bin

@svigerske
Copy link
Member Author

Attachment interface_patch.txt by smith created at 2013-06-26 02:14:23

Patch to IpMa97SolverInterface.hpp to resolve segfault

@svigerske
Copy link
Member Author

Comment by smith created at 2013-06-26 02:15:19

Per Jonathan Hogg's suggestion, the attached patch resolves the segfault in my tests.

@svigerske
Copy link
Member Author

Comment by @svigerske created at 2013-06-26 08:15:28

Changing assignee from ipopt-team to @svigerske.

@svigerske
Copy link
Member Author

Comment by @svigerske created at 2013-06-26 08:15:28

Changing status from new to assigned.

@svigerske
Copy link
Member Author

Comment by @svigerske created at 2013-06-26 08:26:15

Thanks, I've committed this patch with 6aede83. Will be in the next release.

@svigerske
Copy link
Member Author

Comment by @svigerske created at 2013-06-26 08:26:15

Resolution: fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant