[Bonmin] Segfault in simple example

Paul Lange paul.lange at fcc.chalmers.se
Thu Jan 19 06:09:49 EST 2017


Hej Stefan,

thanks for the hints. I changed to the SmartPtr and switched toc index 
style.

However, the problem persists.


/Paul


/clangsantitize> ./bonmin_test                                         1
ASAN:SIGSEGV
=================================================================
==29385==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000008 
(pc 0x7f9f22c3a49c sp 0x7ffc12fb7ff0 bp 0x7ffc12fb8030 T0)
     #0 0x7f9f22c3a49b in Bonmin::TMINLP2TNLP::get_nlp_info(int&, int&, 
int&, int&, Ipopt::TNLP::IndexStyleEnum&) 
/usr/src/debug/Bonmin-1.8.4/src/Interfaces/BonTMINLP2TNLP.cpp:339
     #1 0x7f9f23a5af1e in 
Ipopt::OrigIpoptNLP::Initialize(Ipopt::Journalist const&, 
Ipopt::OptionsList const&, std::string const&) 
(/home/software/IpOpt/lib/libipopt.so.1+0x118f1e)
     #2 0x7f9f23a186eb in 
Ipopt::IpoptAlgorithm::InitializeImpl(Ipopt::OptionsList const&, 
std::string const&) (/home/software/IpOpt/lib/libipopt.so.1+0xd66eb)
     #3 0x7f9f239a5535 in Ipopt::IpoptApplication::call_optimize() 
(/home/software/IpOpt/lib/libipopt.so.1+0x63535)
     #4 0x7f9f239aeb9e in 
Ipopt::IpoptApplication::OptimizeNLP(Ipopt::SmartPtr<Ipopt::NLP> const&, 
Ipopt::SmartPtr<Ipopt::AlgorithmBuilder>&) 
(/home/software/IpOpt/lib/libipopt.so.1+0x6cb9e)
     #5 0x7f9f239ae9dc in 
Ipopt::IpoptApplication::OptimizeNLP(Ipopt::SmartPtr<Ipopt::NLP> const&) 
(/home/software/IpOpt/lib/libipopt.so.1+0x6c9dc)
     #6 0x7f9f22c52fb6 in 
Bonmin::IpoptSolver::OptimizeTNLP(Ipopt::SmartPtr<Ipopt::TNLP> const&) 
/usr/src/debug/Bonmin-1.8.4/src/Interfaces/Ipopt/BonIpoptSolver.cpp:144
     #7 0x7f9f22c2c3ea in 
Bonmin::OsiTMINLPInterface::solveAndCheckErrors(bool, bool, char const*) 
/usr/src/debug/Bonmin-1.8.4/src/Interfaces/BonOsiTMINLPInterface.cpp:2616
     #8 0x7f9f22c2eb69 in Bonmin::OsiTMINLPInterface::initialSolve(char 
const*) 
/usr/src/debug/Bonmin-1.8.4/src/Interfaces/BonOsiTMINLPInterface.cpp:2797
     #9 0x7f9f226255cd (/lib64/libCbc.so.3+0xa45cd)
     #10 0x7f9f22bd1e7e in 
Bonmin::Bab::branchAndBound(Bonmin::BabSetupBase&) 
/usr/src/debug/Bonmin-1.8.4/src/CbcBonmin/BonCbc.cpp:452
     #11 0x47d254 in main 
/home/lange/workspace/Playground/ipopt_test/MyBonmin.cpp:39
     #12 0x7f9f1ef98b14 in __libc_start_main (/lib64/libc.so.6+0x21b14)
     #13 0x47ce4c in _start 
(/scratch/lange/Playground/ipopt_test/clangsantitize/bonmin_test+0x47ce4c)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV 
/usr/src/debug/Bonmin-1.8.4/src/Interfaces/BonTMINLP2TNLP.cpp:339 
Bonmin::TMINLP2TNLP::get_nlp_info(int&, int&, int&, int&, 
Ipopt::TNLP::IndexStyleEnum&)
==29385==ABORTING


On 01/19/2017 11:28 AM, Stefan Vigerske wrote:
> Hi,
>
> better try
>
>     SmartPtr<TMINLP> tminlp = new MyTMINLP;
>
>     BonminSetup bonmin_setup;
>     bonmin_setup.initialize(tminlp);
>
>
> Once a smart pointer, always a smart pointer...
>
> And fortran index style, really?
>
> Stefan
>
> On 01/19/2017 11:07 AM, Paul Lange wrote:
>> Hello,
>>
>> I'm trying to use Bonmin but unfortunately have problems with getting a
>> simple example to work.
>>
>> See the code here [1], it's basically a cleaned up version of the
>> provided example.
>> When I run it, I get a segfault like shown below. I tried compiling with
>> different versions of gcc. Below is the output from a version compiled
>> with clangs address sanitizer.
>>
>> Any help, ideas or tips are greatly appreciated.
>>
>> Thanks and best regards,
>> Paul
>>
>> [1]
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__gist.github.com_anonymous_7c5d9cfb3b69ae51f7c9ccd4b68d6b85&d=CwICAg&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=BRcuJnQr5NAzU29t80hk2rsLc4vrlRySBDabuq0O1ZI&m=gL_o37CjCA0XbXRdDgJtB31eCdPJejAtC6mP3D9D7g0&s=Oh_XAAInX_wO4UDCzGrAEcCL8U-UQIRksCfPvD_yPkg&e= 
>>
>>
>>
>>
>>
>>
>>
>>
>> /clangsantitize> ./bonmin_test
>> ASAN:SIGSEGV
>> =================================================================
>> ==22261==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000008
>> (pc 0x7f1d1334849c sp 0x7ffcc74f9990 bp 0x7ffcc74f99d0 T0)
>>     #0 0x7f1d1334849b in Bonmin::TMINLP2TNLP::get_nlp_info(int&, int&,
>> int&, int&, Ipopt::TNLP::IndexStyleEnum&)
>> /usr/src/debug/Bonmin-1.8.4/src/Interfaces/BonTMINLP2TNLP.cpp:339
>>     #1 0x7f1d14168f1e in
>> Ipopt::OrigIpoptNLP::Initialize(Ipopt::Journalist const&,
>> Ipopt::OptionsList const&, std::string const&)
>> (/home/software/IpOpt/lib/libipopt.so.1+0x118f1e)
>>     #2 0x7f1d141266eb in
>> Ipopt::IpoptAlgorithm::InitializeImpl(Ipopt::OptionsList const&,
>> std::string const&) (/home/software/IpOpt/lib/libipopt.so.1+0xd66eb)
>>     #3 0x7f1d140b3535 in Ipopt::IpoptApplication::call_optimize()
>> (/home/software/IpOpt/lib/libipopt.so.1+0x63535)
>>     #4 0x7f1d140bcb9e in
>> Ipopt::IpoptApplication::OptimizeNLP(Ipopt::SmartPtr<Ipopt::NLP> const&,
>> Ipopt::SmartPtr<Ipopt::AlgorithmBuilder>&)
>> (/home/software/IpOpt/lib/libipopt.so.1+0x6cb9e)
>>     #5 0x7f1d140bc9dc in
>> Ipopt::IpoptApplication::OptimizeNLP(Ipopt::SmartPtr<Ipopt::NLP> const&)
>> (/home/software/IpOpt/lib/libipopt.so.1+0x6c9dc)
>>     #6 0x7f1d13360fb6 in
>> Bonmin::IpoptSolver::OptimizeTNLP(Ipopt::SmartPtr<Ipopt::TNLP> const&)
>> /usr/src/debug/Bonmin-1.8.4/src/Interfaces/Ipopt/BonIpoptSolver.cpp:144
>>     #7 0x7f1d1333a3ea in
>> Bonmin::OsiTMINLPInterface::solveAndCheckErrors(bool, bool, char const*)
>> /usr/src/debug/Bonmin-1.8.4/src/Interfaces/BonOsiTMINLPInterface.cpp:2616 
>>
>>     #8 0x7f1d1333cb69 in Bonmin::OsiTMINLPInterface::initialSolve(char
>> const*)
>> /usr/src/debug/Bonmin-1.8.4/src/Interfaces/BonOsiTMINLPInterface.cpp:2797 
>>
>>     #9 0x7f1d12d335cd (/lib64/libCbc.so.3+0xa45cd)
>>     #10 0x7f1d132dfe7e in
>> Bonmin::Bab::branchAndBound(Bonmin::BabSetupBase&)
>> /usr/src/debug/Bonmin-1.8.4/src/CbcBonmin/BonCbc.cpp:452
>>     #11 0x47d1c0 in main
>> /home/lange/workspace/Playground/ipopt_test/MyBonmin.cpp:39
>>     #12 0x7f1d0f6a6b14 in __libc_start_main (/lib64/libc.so.6+0x21b14)
>>     #13 0x47ce4c in _start
>> (/scratch/lange/Playground/ipopt_test/clangsantitize/bonmin_test+0x47ce4c) 
>>
>>
>> AddressSanitizer can not provide additional info.
>> SUMMARY: AddressSanitizer: SEGV
>> /usr/src/debug/Bonmin-1.8.4/src/Interfaces/BonTMINLP2TNLP.cpp:339
>> Bonmin::TMINLP2TNLP::get_nlp_info(int&, int&, int&, int&,
>> Ipopt::TNLP::IndexStyleEnum&)
>> ==22261==ABORTING
>>
>> _______________________________________________
>> Bonmin mailing list
>> Bonmin at list.coin-or.org
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__list.coin-2Dor.org_mailman_listinfo_bonmin&d=CwICAg&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=BRcuJnQr5NAzU29t80hk2rsLc4vrlRySBDabuq0O1ZI&m=gL_o37CjCA0XbXRdDgJtB31eCdPJejAtC6mP3D9D7g0&s=WA8s7cW9QIZuQ30i4wDllVyaSqjS7xW1Eq3uB0uWAZc&e= 
>>
>>
>
>



More information about the Bonmin mailing list