Hi Paul,<div><br></div><div>if you are on Linux, run your program with valgrind to find out where exactly this happens.</div><div><br></div><div>If the information you get isn&#39;t specific enough, recompile your code and that of ipopt in debug mode. For Ipopt, run configure with the </div>
<div><br></div><div>--enable-debug </div><div><br></div><div>option. Compile your own code with the -g flag.</div><div>Valgrind will tell you in which file and line things go wrong</div><div><br></div><div>Hans</div><div>
<br><div class="gmail_quote">On Thu, Mar 3, 2011 at 6:17 PM, Paul Smith <span dir="ltr">&lt;<a href="mailto:phhs80@gmail.com">phhs80@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Dear All,<br>
<br>
I am compiling an example in C++, which is correctly solved by Ipopt,<br>
but when the program exits (I guess while freeing the SmartPointer),<br>
it gives the error below.<br>
<br>
Any ideas?<br>
<br>
Thanks in advance,<br>
<br>
Paul<br>
<br>
-------------------------------------------------<br>
<br>
*** glibc detected *** /home/psmith/research/programs/myprogram/teste:<br>
free(): invalid next size (normal): 0x0000000001f35770 ***<br>
======= Backtrace: =========<br>
/lib64/libc.so.6[0x361ee76d63]<br>
/home/psmith/research/programs/myprogram/teste(_ZN5Ipopt11TNLPAdapterD1Ev+0x42)[0x46a1c2]<br>
/home/psmith/research/programs/myprogram/teste(_ZN5Ipopt11TNLPAdapterD0Ev+0x9)[0x46aac9]<br>
/home/psmith/research/programs/myprogram/teste(_ZN5Ipopt15GradientScalingD0Ev+0x166)[0x4affe6]<br>
/home/psmith/research/programs/myprogram/teste(_ZN5Ipopt8SmartPtrINS_16NLPScalingObjectEE15ReleasePointer_Ev+0x1f)[0x49a51f]<br>
/home/psmith/research/programs/myprogram/teste(_ZN5Ipopt12OrigIpoptNLPD1Ev+0x789)[0x4f69c9]<br>
/home/psmith/research/programs/myprogram/teste(_ZN5Ipopt12OrigIpoptNLPD0Ev+0x9)[0x4f6df9]<br>
/home/psmith/research/programs/myprogram/teste(_ZN5Ipopt14IpoptAlgorithmD1Ev+0x1e6)[0x522d56]<br>
/home/psmith/research/programs/myprogram/teste(_ZN5Ipopt14IpoptAlgorithmD0Ev+0x9)[0x522f09]<br>
/home/psmith/research/programs/myprogram/teste(_ZN5Ipopt16IpoptApplicationD1Ev+0x186)[0x45a0a6]<br>
/home/psmith/research/programs/myprogram/teste(_ZN5Ipopt16IpoptApplicationD0Ev+0x9)[0x45a1b9]<br>
/home/psmith/research/programs/myprogram/teste(_ZN5Ipopt8SmartPtrINS_16IpoptApplicationEE15ReleasePointer_Ev+0x6f)[0x4577d7]<br>
/home/psmith/research/programs/myprogram/teste[0x456da4]<br>
/home/psmith/research/programs/myprogram/teste[0x45603d]<br>
/lib64/libc.so.6(__libc_start_main+0xfd)[0x361ee1ee5d]<br>
/home/psmith/research/programs/myprogram/teste[0x4510e9]<br>
======= Memory map: ========<br>
00400000-007c1000 r-xp 00000000 fd:00 20447398<br>
  /home/psmith/research/programs/myprogram/teste<br>
009c1000-009c8000 rw-p 003c1000 fd:00 20447398<br>
  /home/psmith/research/programs/myprogram/teste<br>
009c8000-009cb000 rw-p 00000000 00:00 0<br>
01efd000-02d65000 rw-p 00000000 00:00 0                                  [heap]<br>
361ea00000-361ea1f000 r-xp 00000000 fd:00 131168<br>
  /lib64/<a href="http://ld-2.13.so" target="_blank">ld-2.13.so</a><br>
361ec1e000-361ec1f000 r--p 0001e000 fd:00 131168<br>
  /lib64/<a href="http://ld-2.13.so" target="_blank">ld-2.13.so</a><br>
361ec1f000-361ec20000 rw-p 0001f000 fd:00 131168<br>
  /lib64/<a href="http://ld-2.13.so" target="_blank">ld-2.13.so</a><br>
361ec20000-361ec21000 rw-p 00000000 00:00 0<br>
361ee00000-361ef91000 r-xp 00000000 fd:00 131211<br>
  /lib64/<a href="http://libc-2.13.so" target="_blank">libc-2.13.so</a><br>
361ef91000-361f191000 ---p 00191000 fd:00 131211<br>
  /lib64/<a href="http://libc-2.13.so" target="_blank">libc-2.13.so</a><br>
361f191000-361f195000 r--p 00191000 fd:00 131211<br>
  /lib64/<a href="http://libc-2.13.so" target="_blank">libc-2.13.so</a><br>
361f195000-361f196000 rw-p 00195000 fd:00 131211<br>
  /lib64/<a href="http://libc-2.13.so" target="_blank">libc-2.13.so</a><br>
361f196000-361f19c000 rw-p 00000000 00:00 0<br>
361f200000-361f284000 r-xp 00000000 fd:00 131433<br>
  /lib64/<a href="http://libm-2.13.so" target="_blank">libm-2.13.so</a><br>
361f284000-361f483000 ---p 00084000 fd:00 131433<br>
  /lib64/<a href="http://libm-2.13.so" target="_blank">libm-2.13.so</a><br>
361f483000-361f484000 r--p 00083000 fd:00 131433<br>
  /lib64/<a href="http://libm-2.13.so" target="_blank">libm-2.13.so</a><br>
361f484000-361f485000 rw-p 00084000 fd:00 131433<br>
  /lib64/<a href="http://libm-2.13.so" target="_blank">libm-2.13.so</a><br>
361f600000-361f602000 r-xp 00000000 fd:00 132219<br>
  /lib64/<a href="http://libdl-2.13.so" target="_blank">libdl-2.13.so</a><br>
361f602000-361f802000 ---p 00002000 fd:00 132219<br>
  /lib64/<a href="http://libdl-2.13.so" target="_blank">libdl-2.13.so</a><br>
361f802000-361f803000 r--p 00002000 fd:00 132219<br>
  /lib64/<a href="http://libdl-2.13.so" target="_blank">libdl-2.13.so</a><br>
361f803000-361f804000 rw-p 00003000 fd:00 132219<br>
  /lib64/<a href="http://libdl-2.13.so" target="_blank">libdl-2.13.so</a><br>
361fa00000-361fa17000 r-xp 00000000 fd:00 132114<br>
  /lib64/<a href="http://libpthread-2.13.so" target="_blank">libpthread-2.13.so</a><br>
361fa17000-361fc16000 ---p 00017000 fd:00 132114<br>
  /lib64/<a href="http://libpthread-2.13.so" target="_blank">libpthread-2.13.so</a><br>
361fc16000-361fc17000 r--p 00016000 fd:00 132114<br>
  /lib64/<a href="http://libpthread-2.13.so" target="_blank">libpthread-2.13.so</a><br>
361fc17000-361fc18000 rw-p 00017000 fd:00 132114<br>
  /lib64/<a href="http://libpthread-2.13.so" target="_blank">libpthread-2.13.so</a><br>
361fc18000-361fc1c000 rw-p 00000000 00:00 0<br>
361fe00000-361fe15000 r-xp 00000000 fd:00 131871<br>
  /lib64/libgcc_s-4.5.1-20100924.so.1<br>
361fe15000-3620014000 ---p 00015000 fd:00 131871<br>
  /lib64/libgcc_s-4.5.1-20100924.so.1<br>
3620014000-3620015000 rw-p 00014000 fd:00 131871<br>
  /lib64/libgcc_s-4.5.1-20100924.so.1<br>
3620600000-3620607000 r-xp 00000000 fd:00 133544<br>
  /lib64/<a href="http://librt-2.13.so" target="_blank">librt-2.13.so</a><br>
3620607000-3620806000 ---p 00007000 fd:00 133544<br>
  /lib64/<a href="http://librt-2.13.so" target="_blank">librt-2.13.so</a><br>
3620806000-3620807000 r--p 00006000 fd:00 133544<br>
  /lib64/<a href="http://librt-2.13.so" target="_blank">librt-2.13.so</a><br>
3620807000-3620808000 rw-p 00007000 fd:00 133544<br>
  /lib64/<a href="http://librt-2.13.so" target="_blank">librt-2.13.so</a><br>
3623a00000-3623ae8000 r-xp 00000000 fd:00 273173<br>
  /usr/lib64/libstdc++.so.6.0.14<br>
3623ae8000-3623ce8000 ---p 000e8000 fd:00 273173<br>
  /usr/lib64/libstdc++.so.6.0.14<br>
3623ce8000-3623cf0000 r--p 000e8000 fd:00 273173<br>
  /usr/lib64/libstdc++.so.6.0.14<br>
3623cf0000-3623cf2000 rw-p 000f0000 fd:00 273173<br>
  /usr/lib64/libstdc++.so.6.0.14<br>
3623cf2000-3623d07000 rw-p 00000000 00:00 0<br>
3630e00000-3630ee2000 r-xp 00000000 fd:00 281053<br>
  /usr/lib64/libgfortran.so.3.0.0<br>
3630ee2000-36310e2000 ---p 000e2000 fd:00 281053<br>
  /usr/lib64/libgfortran.so.3.0.0<br>
36310e2000-36310e4000 rw-p 000e2000 fd:00 281053<br>
  /usr/lib64/libgfortran.so.3.0.0<br>
36310e4000-36310e5000 rw-p 00000000 00:00 0<br>
3633e00000-3633e0d000 r-xp 00000000 fd:00 275116<br>
  /usr/lib64/libgomp.so.1.0.0<br>
3633e0d000-363400c000 ---p 0000d000 fd:00 275116<br>
  /usr/lib64/libgomp.so.1.0.0<br>
363400c000-363400d000 rw-p 0000c000 fd:00 275116<br>
  /usr/lib64/libgomp.so.1.0.0<br>
7fe43faff000-7fe43fb07000 rw-p 00000000 00:00 0<br>
7fe43fb07000-7fe43fc8d000 r-xp 00000000 fd:00 25428000<br>
  /home/psmith/ipopt/lib/coin/ThirdParty/libcoinmumps.so.1.3.3<br>
7fe43fc8d000-7fe43fe8c000 ---p 00186000 fd:00 25428000<br>
  /home/psmith/ipopt/lib/coin/ThirdParty/libcoinmumps.so.1.3.3<br>
7fe43fe8c000-7fe43fe8f000 rw-p 00185000 fd:00 25428000<br>
  /home/psmith/ipopt/lib/coin/ThirdParty/libcoinmumps.so.1.3.3<br>
7fe43fe8f000-7fe43fe92000 rw-p 00000000 00:00 0<br>
7fe43fe92000-7fe43feda000 r-xp 00000000 fd:00 25427996<br>
  /home/psmith/ipopt/lib/coin/ThirdParty/libcoinmetis.so.1.1.3<br>
7fe43feda000-7fe4400da000 ---p 00048000 fd:00 25427996<br>
  /home/psmith/ipopt/lib/coin/ThirdParty/libcoinmetis.so.1.1.3<br>
7fe4400da000-7fe4400db000 rw-p 00048000 fd:00 25427996<br>
  /home/psmith/ipopt/lib/coin/ThirdParty/libcoinmetis.so.1.1.3<br>
7fe4400db000-7fe440112000 r-xp 00000000 fd:00 25427994<br>
  /home/psmith/ipopt/lib/coin/ThirdParty/libcoinlapack.so.1.2.3<br>
7fe440112000-7fe440312000 ---p 00037000 fd:00 25427994<br>
  /home/psmith/ipopt/lib/coin/ThirdParty/libcoinlapack.so.1.2.3<br>
7fe440312000-7fe440313000 rw-p 00037000 fd:00 25427994<br>
  /home/psmith/ipopt/lib/coin/ThirdParty/libcoinlapack.so.1.2.3<br>
7fe440313000-7fe440324000 rw-p 00000000 00:00 0<br>
7fe440324000-7fe440325000 r-xp 00000000 fd:00 25427998<br>
  /home/psmith/ipopt/lib/coin/ThirdParty/libcoinhsl.so.1.2.3<br>
7fe440325000-7fe440524000 ---p 00001000 fd:00 25427998<br>
  /home/psmith/ipopt/lib/coin/ThirdParty/libcoinhsl.so.1.2.3<br>
7fe440524000-7fe440525000 rw-p 00000000 fd:00 25427998<br>
  /home/psmith/ipopt/lib/coin/ThirdParty/libcoinhsl.so.1.2.3<br>
7fe440525000-7fe44053a000 r-xp 00000000 fd:00 25428010<br>
  /home/psmith/ipopt/lib/coin/ThirdParty/libcoinblas.so.1.1.3<br>
7fe44053a000-7fe44073a000 ---p 00015000 fd:00 25428010<br>
  /home/psmith/ipopt/lib/coin/ThirdParty/libcoinblas.so.1.1.3<br>
7fe44073a000-7fe44073b000 rw-p 00015000 fd:00 25428010<br>
  /home/psmith/ipopt/lib/coin/ThirdParty/libcoinblas.so.1.1.3<br>
7fe44073b000-7fe440986000 r-xp 00000000 fd:00 25428002<br>
  /home/psmith/ipopt/lib/coin/libipopt.so.1.7.2<br>
7fe440986000-7fe440b86000 ---p 0024b000 fd:00 25428002<br>
  /home/psmith/ipopt/lib/coin/libipopt.so.1.7.2<br>
7fe440b86000-7fe440b90000 rw-p 0024b000 fd:00 25428002<br>
  /home/psmith/ipopt/lib/coin/libipopt.so.1.7.2<br>
7fe440b90000-7fe440b91000 rw-p 00000000 00:00 0<br>
7fe440bb7000-7fe440bb9000 rw-p 00000000 00:00 0<br>
7fffb917d000-7fffb919e000 rw-p 00000000 00:00 0                          [stack]<br>
7fffb91ff000-7fffb9200000 r-xp 00000000 00:00 0                          [vdso]<br>
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0<br>
  [vsyscall]<br>
The program has unexpectedly finished.<br>
<br>
_______________________________________________<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>
</blockquote></div><br></div>