[Ipopt] [Coin-discuss] Trouble with C interface: glibc memory corruption error

Andreas Waechter andreasw at watson.ibm.com
Wed May 28 11:14:18 EDT 2008


Hi John,

My guess would be that there is wrong use of Ipopt's SmartPtr's.  Please 
read the section on SmartPtr in the Ipopt documentation carefully,

http://www.coin-or.org/Ipopt/documentation/node57.html

The main point is that if you create any of the Ipopt objects (which 
inherit from ReferencedObject), you must use a SmartPtr to store the 
object in when you get it from "new".

Andreas


On Wed, 28 May 2008, Stefan Vigerske wrote:

> Hi,
>
> I copy my answer to the Ipopt mailing list. Maybe this belongs more to
> there.
>
> Can you create a debugging build (--enable-debug) and run valgrind to
> see where the first time something goes wrong in the program?
> Or, if not valgrind, then gdb.
>
> Or do you have some code that can be used to reproduce your problem?
>
> Stefan
>
> John Pye write:
>> Hi all
>>
>> I'm working on a interface to IPOPT from the C language, but I'm running
>> into a problem that I'm having trouble debugging.
>>
>> What happens is that I'm getting a 'glibc detected' 'memory corruption
>> (fast)' error :-)
>>
>>> *** glibc detected *** /home/john/ascend/test.py: malloc(): memory
>>> corruption (fast): 0x082b21c0 ***
>>> Terminated
>>
>> I added some commenting output to CreateIpoptProblem, and I found that
>> the error occurs somewhere inside the Ipopt::IpoptApplication
>> constructor called from within that function (IpStdCInterface.cpp line
>> ~100).
>>
>> I wonder if anyone might be able to suggest what possibly things I might
>> have done wrong in my call to CreateIpoptProblem that could lead to this
>> sort of extreme error? I'm rather puzzled.
>>
>> Also, I tried to turn on the IPOPT debug output, but didn't seem to
>> succeed. What is the correct way of getting deboug output from IPOPT?
>>
>> Would appreciate any suggestions.
>>
>> Cheers
>> JP
>>
>>
>> _______________________________________________
>> Coin-discuss mailing list
>> Coin-discuss at list.coin-or.org
>> http://list.coin-or.org/mailman/listinfo/coin-discuss
>>
>
>
> -- 
> Stefan Vigerske
> Humboldt University Berlin, Numerical Mathematics
> http://www.math.hu-berlin.de/~stefan
> _______________________________________________
> Ipopt mailing list
> Ipopt at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/ipopt
>


More information about the Ipopt mailing list