Thank you for the suggestions. I actually managed to solve the problem without using Valgrind.<br>In the debugger I noticed that I was writing beyond the array boundaries in x_l, x_u and g_l,g_u. Apparently this only became a problem after exiting the get_bounds_info() function, when control was passed back to IPOPT.<br>
<br>However, now the problem is solved and all the vectors have the correct sizes and number of elements. And the optimization runs succesfully.<br><br>Best regards,<br>Alexandru Tatulea<br><div class="gmail_extra"><br><br>
<div class="gmail_quote">On Sat, Dec 15, 2012 at 3:00 PM, Hans Pirnay <span dir="ltr"><<a href="mailto:hans.pirnay@rwth-aachen.de" target="_blank">hans.pirnay@rwth-aachen.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Alex,<br>
<br>
try compiling your code in debug mode (gcc -g) and run it through<br>
valgrind. valgrind will tell you where the 'free' comes from.<br>
<span class="HOEnZb"><font color="#888888"><br>
Hans<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Sat, Dec 15, 2012 at 12:49 PM, Alex Tătulea <<a href="mailto:tatulea.alex@gmail.com">tatulea.alex@gmail.com</a>> wrote:<br>
> Hello,<br>
><br>
> I am new to IPOPT and I have to code this NLP in C++ under Linux. I have<br>
> implemented all the functions and individually tested them, they seem to<br>
> return the correct results.<br>
><br>
> But when I try running the optimizeNLP() function, I get an error in the<br>
> console with the message 'Double free or corruption (!prev)'. After tracking<br>
> the error with GDB, it seems that the optimizer calls the get_nlp_info()<br>
> routine with no error, and then performs the get_bounds_info() until return.<br>
> At this point, seems that the free() function is called (I don't know where<br>
> from) and then the memory error occurs and the program is aborted.<br>
><br>
> If anyone has encountered something like this, please give me a hint on how<br>
> to approach this problem. Is there some particular mechanism inside IPOPT<br>
> for freeing memory and handling vectors I should be aware of? Inside this<br>
> function I am not doing much, just assigning the values to x_l, x_u and<br>
> g_l,g_u...<br>
><br>
> Thanks in advance, I hope someone could help me here with an idea!<br>
><br>
> Alex<br>
><br>
</div></div><div class="HOEnZb"><div class="h5">> _______________________________________________<br>
> Ipopt mailing list<br>
> <a href="mailto:Ipopt@list.coin-or.org">Ipopt@list.coin-or.org</a><br>
> <a href="http://list.coin-or.org/mailman/listinfo/ipopt" target="_blank">http://list.coin-or.org/mailman/listinfo/ipopt</a><br>
><br>
</div></div></blockquote></div><br></div>