[Ipopt] java ipopt dispose

Stefan Vigerske stefan at math.hu-berlin.de
Thu Apr 25 12:01:35 EDT 2013


Hi,

probably a wrong use of smart pointers in the jipopt.
The source in Java_org_coinor_Ipopt_OptimizeTNLP looks to me as if the 
object behind the ipopt member in the Ipopt class will already be 
deleted at the end of Java_org_coinor_Ipopt_OptimizeTNLP.

Does it work if you comment out the line
   delete problem;
in jipopt.cpp:Java_org_coinor_Ipopt_FreeIpoptProblem ?

Stefan

On 04/25/2013 05:33 PM, Joris Kinable wrote:
> Dear,
>
> I managed to get Ipopt working on my linux system using the Java interface.
> I implemented a very small test problem, which seems to be solved
> correctly. The java doc mentions the following:
>
> /*** Disposes of the natively allocated memory.
> * Programmers should, for efficiency, call the dispose method when finished
> * using a Ipopt object.
>
> However, whenever I invoke the dispose() method, I get the following crash:
>
> *** glibc detected *** /usr/lib/jvm/java-6-openjdk/bin/java: double free or
> corruption (out): 0x00007fc4080e57e0 ***
> ======= Backtrace: =========
> /lib/x86_64-linux-gnu/libc.so.6(+0x7ae56)[0x7fc413ccae56]
> /lib/x86_64-linux-gnu/libc.so.6(cfree+0x6c)[0x7fc413ccf13c]
> [0x7fc40e653d68]
>
> Can I fix this somehow?
>
> br,
>
> Joris
>
>
>
> _______________________________________________
> Ipopt mailing list
> Ipopt at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/ipopt
>



More information about the Ipopt mailing list