[Ipopt] Segfault using Ipopt with CUTEst: Use of uninitialised value of size 8

James Diffenderfer jdiffen1 at gmail.com
Tue May 19 10:28:55 EDT 2020


Hello,

I encountered an issue when trying to use ipopt with CUTEst to solve some
test problems. Details of the issue are provided below. I asked about this
issue on the CUTEst github page and Nick Gould mentioned that I should
check with the ipopt mailing list to see if anyone has encountered a
similar issue. It it worth noting that Nick was able to successfully solve
the problem without encountering a segmentation fault. Any help would be
greatly appreciated. Thanks.



Issue Overview: I followed the directions in $CUTEST/src/ipopt/README.ipopt
for getting Ipopt running with CUTEst but Ipopt with CUTEst results in a
segmentation fault. Running with Valgrind indicates 'use of uninitialised
value of size 8'.

I recently installed Ipopt version 3.13.3 and have been unable to solve
problems with Ipopt using CUTEst. In particular, I am experiencing a
segmentation fault from an invalid memory reference. I did a quick edit of
runcutest to run with Valgrind and have included the output below. The
following three outputs are included below:

(1) Indication that Ipopt was able to pass the tests upon installation
(2) Console output on attempt to solve BIGGSC4 with Ipopt
(3) Console output on attempt to solve BIGGSC4 with Ipopt with Valgrind in
runcutest


-------------------------------------------------------------------------------
(1) Message indicating Ipopt 3.13.3 has been successfully installed on
machine:
-------------------------------------------------------------------------------

Running unitTests...

Testing AMPL Solver Executable...
    no AMPL solver executable found, skipping test...
Testing C++ Example...
    Test passed!
Testing C Example...
    Test passed!
Testing Fortran Example...
    Test passed!
Skip testing Java Example (Java interface not build)
Testing sIpopt Example parametric_cpp...
    Test passed!
Testing sIpopt Example redhess_cpp...
    Test passed!
make[1]: Leaving directory '/home/james/Programs/Ipopt/Ipopt/master/test'

##################################################
### Installing Ipopt master
##################################################


Install completed. If executing any of the installed
binaries results in an error that shared libraries cannot
be found, you may need to
  - add 'export LD_LIBRARY_PATH=/home/james/Programs/Ipopt/lib' to your
~/.bashrc (Linux)
  - add 'export DYLD_LIBRARY_PATH=/home/james/Programs/Ipopt/lib' to
~/.bashrc (OS X)




-------------------------------------------------------------------------------
(2) Message received when attempting to solve BIGGSC4 with Ipopt:
-------------------------------------------------------------------------------

:~$ runcutest -p ipopt -D BIGGSC4
sifdecoder -A pc.lnx.gfo -st   BIGGSC4

 Problem name: BIGGSC4

 Double precision version will be formed

 The objective function uses 1 nonlinear group

 There are 7 linear inequality constraints

 There are 4 variables bounded from below and above


 File successfully decoded
 CUTEST: tools (double precision version) compiled successfully
 CUTEst: ipopt (double precision version) compiled successfully

Program received signal SIGSEGV: Segmentation fault - invalid memory
reference.

Backtrace for this error:
#0  0x7fed07f1b2ed in ???
#1  0x7fed07f1a503 in ???
#2  0x7fed07b4df1f in ???
#3  0x7fed0a5f71e8 in ???
#4  0x55eac0e9dd22 in ???
#5  0x55eac0e9e5f2 in ???
#6  0x7fed07b30b96 in ???
#7  0x55eac0e9d269 in ???
#8  0xffffffffffffffff in ???
/home/james/Programs/CUTEST-Program/cutest/bin/runcutest: line 238: 32615
Segmentation fault      (core dumped) ${EXEC}/run_${PACKAGE}




-------------------------------------------------------------------------------
(3) Message received when solving BIGGSC4 with Ipopt (Valgrind in
runcutest):
-------------------------------------------------------------------------------

:~$ runcutest -p ipopt -D BIGGSC4
sifdecoder -A pc.lnx.gfo -st   BIGGSC4

 Problem name: BIGGSC4

 Double precision version will be formed

 The objective function uses 1 nonlinear group

 There are 7 linear inequality constraints

 There are 4 variables bounded from below and above


 File successfully decoded
 CUTEST: tools (double precision version) compiled successfully
 CUTEst: ipopt (double precision version) compiled successfully
==32182== Memcheck, a memory error detector
==32182== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==32182== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==32182== Command: /home/james/run_ipopt
==32182==
==32182== Use of uninitialised value of size 8
==32182==    at 0x126341E8: ipsolve_ (in
/home/james/Programs/Ipopt/lib/libipopt.so.3.13.3)
==32182==    by 0x109D22: MAIN__ (in /home/james/run_ipopt)
==32182==    by 0x10A5F2: main (in /home/james/run_ipopt)
==32182==  Uninitialised value was created by a stack allocation
==32182==    at 0x10947F: MAIN__ (in /home/james/run_ipopt)
==32182==

******************************************************************************
This program contains Ipopt, a library for large-scale nonlinear
optimization.
 Ipopt is released as open source code under the Eclipse Public License
(EPL).
         For more information visit http://projects.coin-or.org/Ipopt
******************************************************************************

This is Ipopt version 3.13.3, running with linear solver mumps.
NOTE: Other linear solvers might be more efficient (see Ipopt
documentation).

Number of nonzeros in equality constraint Jacobian...:        0
Number of nonzeros in inequality constraint Jacobian.:       16
Number of nonzeros in Lagrangian Hessian.............:        6

==32182== Syscall param sched_setaffinity(mask) points to unaddressable
byte(s)
==32182==    at 0x15197839: syscall (syscall.S:38)
==32182==    by 0x122FB0A8: __kmp_affinity_determine_capable
(z_Linux_util.cpp:186)
==32182==    by 0x122A5571: __kmp_env_initialize(char const*)
(kmp_settings.cpp:5783)
==32182==    by 0x1228C717: __kmp_do_serial_initialize
(kmp_runtime.cpp:7003)
==32182==    by 0x1228C717: __kmp_do_middle_initialize
(kmp_runtime.cpp:7146)
==32182==    by 0x1228C717: __kmp_middle_initialize (kmp_runtime.cpp:7255)
==32182==    by 0x1226CD2D: omp_get_num_procs@@VERSION (kmp_ftn_entry.h:612)
==32182==    by 0xBB5E8BD: mkl_serv_get_num_stripes (in
/home/james/intel/compilers_and_libraries_2019.5.281/linux/mkl/lib/intel64_lin/libmkl_intel_thread.so)
==32182==    by 0xBC244F1: mkl_blas_dgemm (in
/home/james/intel/compilers_and_libraries_2019.5.281/linux/mkl/lib/intel64_lin/libmkl_intel_thread.so)
==32182==    by 0xAF4DBA6: DGEMM (in
/home/james/intel/compilers_and_libraries_2019.5.281/linux/mkl/lib/intel64_lin/libmkl_intel_lp64.so)
==32182==    by 0x15B8BD66: dmumps_237_ (in
/home/james/Programs/Ipopt/lib/libcoinmumps.so.2.1.0)
==32182==    by 0x15B8EBC5: dmumps_140_ (in
/home/james/Programs/Ipopt/lib/libcoinmumps.so.2.1.0)
==32182==    by 0x15B79AC5: dmumps_251_ (in
/home/james/Programs/Ipopt/lib/libcoinmumps.so.2.1.0)
==32182==    by 0x15B3DB47: dmumps_244_ (in
/home/james/Programs/Ipopt/lib/libcoinmumps.so.2.1.0)
==32182==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32182==
Total number of variables............................:        4
                     variables with only lower bounds:        0
                variables with lower and upper bounds:        4
                     variables with only upper bounds:        0
Total number of equality constraints.................:        0
Total number of inequality constraints...............:        7
        inequality constraints with only lower bounds:        1
   inequality constraints with lower and upper bounds:        6
        inequality constraints with only upper bounds:        0

iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du
alpha_pr  ls
   0 -1.9999960e-04 4.96e+00 3.67e-01  -1.0 0.00e+00    -  0.00e+00
0.00e+00   0
   1 -1.4654948e-03 4.89e+00 1.20e+00  -1.0 1.42e+00    -  7.45e-03
1.58e-02h  1
   2 -3.1187792e+00 0.00e+00 7.82e+01  -1.0 1.66e+00    -  2.97e-02
1.00e+00f  1
   3 -3.2911450e+00 0.00e+00 2.11e+00  -1.0 2.31e-01    -  6.48e-01
1.00e+00f  1
   4 -7.4033627e+00 0.00e+00 8.95e-01  -1.0 2.23e+00    -  2.02e-01
1.00e+00f  1
   5 -9.3688176e+00 0.00e+00 7.61e-01  -1.0 7.61e-01   0.0 1.00e+00
1.00e+00f  1
   6 -1.2634455e+01 0.00e+00 9.40e-01  -1.7 5.23e+00  -0.5 3.90e-01
2.36e-01f  1
   7 -1.5042427e+01 0.00e+00 8.31e-01  -1.7 1.20e+01  -1.0 2.78e-01
5.61e-02f  1
   8 -1.5089210e+01 0.00e+00 1.33e+00  -1.7 5.67e-02    -  4.60e-01
1.00e+00f  1
   9 -1.7926460e+01 0.00e+00 5.64e-01  -1.7 1.91e+00  -0.5 6.65e-01
1.00e+00f  1
iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du
alpha_pr  ls
  10 -1.9765668e+01 0.00e+00 6.81e-01  -1.7 8.43e-01  -0.1 7.90e-01
1.00e+00f  1
  11 -2.1870779e+01 0.00e+00 1.22e+00  -1.7 4.93e+00  -0.6 9.76e-01
1.65e-01f  1
  12 -2.4457195e+01 0.00e+00 1.69e+00  -1.7 1.02e+01  -1.1 2.55e-01
8.82e-02f  1
  13 -2.4431280e+01 0.00e+00 2.03e+00  -1.7 1.82e+00  -0.6 8.59e-01
3.39e-02f  4
  14 -2.4440263e+01 0.00e+00 1.15e+00  -1.7 7.14e-02    -  9.94e-01
5.00e-01f  2
  15 -2.4432566e+01 0.00e+00 2.00e-07  -1.7 3.13e-02    -  1.00e+00
1.00e+00f  1
  16 -2.4496204e+01 0.00e+00 5.06e-03  -3.8 4.80e-02    -  9.25e-01
9.72e-01f  1
  17 -2.4498824e+01 0.00e+00 1.50e-09  -3.8 3.56e-02    -  1.00e+00
1.00e+00f  1
  18 -2.4499812e+01 0.00e+00 5.53e-04  -5.7 1.90e-02    -  9.71e-01
1.00e+00f  1
  19 -2.4499947e+01 0.00e+00 1.84e-11  -5.7 9.42e-03    -  1.00e+00
1.00e+00f  1
iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du
alpha_pr  ls
  20 -2.4499982e+01 0.00e+00 1.84e-11  -5.7 4.79e-03    -  1.00e+00
1.00e+00f  1
  21 -2.4499991e+01 0.00e+00 1.84e-11  -5.7 2.31e-03    -  1.00e+00
1.00e+00f  1
  22 -2.4499999e+01 0.00e+00 1.77e-06  -8.6 1.34e-03    -  9.99e-01
1.00e+00f  1
  23 -2.4500000e+01 0.00e+00 2.51e-14  -8.6 6.68e-04    -  1.00e+00
1.00e+00f  1
  24 -2.4500000e+01 0.00e+00 2.51e-14  -8.6 3.33e-04    -  1.00e+00
1.00e+00f  1
  25 -2.4500000e+01 0.00e+00 2.51e-14  -8.6 1.65e-04    -  1.00e+00
1.00e+00h  1
  26 -2.4500000e+01 0.00e+00 2.51e-14  -8.6 7.89e-05    -  1.00e+00
1.00e+00h  1

Number of Iterations....: 26

                                   (scaled)                 (unscaled)
Objective...............:  -2.4500000338117488e+01   -2.4500000338117488e+01
Dual infeasibility......:   2.5059035596809423e-14    2.5059035596809423e-14
Constraint violation....:   0.0000000000000000e+00    0.0000000000000000e+00
Complementarity.........:   8.7300075264282586e-09    8.7300075264282586e-09
Overall NLP error.......:   8.7300075264282586e-09    8.7300075264282586e-09


Number of objective function evaluations             = 32
Number of objective gradient evaluations             = 27
Number of equality constraint evaluations            = 0
Number of inequality constraint evaluations          = 32
Number of equality constraint Jacobian evaluations   = 0
Number of inequality constraint Jacobian evaluations = 27
Number of Lagrangian Hessian evaluations             = 26
Total CPU secs in IPOPT (w/o function evaluations)   =      2.623
Total CPU secs in NLP function evaluations           =      0.023

EXIT: Optimal Solution Found.
==32182== Use of uninitialised value of size 8
==32182==    at 0x126341BC: ipfree_ (in
/home/james/Programs/Ipopt/lib/libipopt.so.3.13.3)
==32182==    by 0x109D35: MAIN__ (in /home/james/run_ipopt)
==32182==    by 0x10A5F2: main (in /home/james/run_ipopt)
==32182==  Uninitialised value was created by a stack allocation
==32182==    at 0x10947F: MAIN__ (in /home/james/run_ipopt)
==32182==
==32182== Conditional jump or move depends on uninitialised value(s)
==32182==    at 0x4C30CF1: free (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==32182==    by 0x126341CC: ipfree_ (in
/home/james/Programs/Ipopt/lib/libipopt.so.3.13.3)
==32182==    by 0x109D35: MAIN__ (in /home/james/run_ipopt)
==32182==    by 0x10A5F2: main (in /home/james/run_ipopt)
==32182==  Uninitialised value was created by a stack allocation
==32182==    at 0x10947F: MAIN__ (in /home/james/run_ipopt)
==32182==

************************ CUTEst statistics ************************


 Package used            :  IPOPT
 Problem                 :  BIGGSC4
 # variables             =               4
 # constraints           =               7
 # objective functions   =        0.6000000E+02
 # objective gradients   =        0.2800000E+02
 # objective Hessians    =        0.2700000E+02
 # Hessian-vector prdct  =        0.0000000E+00
 # constraints functions =        0.6100000E+02
 # constraints gradients =        0.2900000E+02
 # constraints Hessians  =        0.2700000E+02
 Exit code               =               0
 Final f                 =  -0.2450000E+02
 Set up time             =            0.08 seconds
 Solve time              =            3.56 seconds


******************************************************************

==32182==
==32182== HEAP SUMMARY:
==32182==     in use at exit: 2,639 bytes in 21 blocks
==32182==   total heap usage: 35,865 allocs, 35,844 frees, 302,556,517
bytes allocated
==32182==
==32182== 28 bytes in 1 blocks are definitely lost in loss record 2 of 21
==32182==    at 0x4C2FB0F: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==32182==    by 0x1098E7: MAIN__ (in /home/james/run_ipopt)
==32182==    by 0x10A5F2: main (in /home/james/run_ipopt)
==32182==
==32182== 70 bytes in 1 blocks are definitely lost in loss record 14 of 21
==32182==    at 0x4C2FB0F: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==32182==    by 0x1099C3: MAIN__ (in /home/james/run_ipopt)
==32182==    by 0x10A5F2: main (in /home/james/run_ipopt)
==32182==
==32182== LEAK SUMMARY:
==32182==    definitely lost: 98 bytes in 2 blocks
==32182==    indirectly lost: 0 bytes in 0 blocks
==32182==      possibly lost: 0 bytes in 0 blocks
==32182==    still reachable: 2,541 bytes in 19 blocks
==32182==         suppressed: 0 bytes in 0 blocks
==32182== Reachable blocks (those to which a pointer was found) are not
shown.
==32182== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==32182==
==32182== For counts of detected and suppressed errors, rerun with: -v
==32182== ERROR SUMMARY: 6 errors from 6 contexts (suppressed: 0 from 0)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/ipopt/attachments/20200519/17072898/attachment-0001.html>


More information about the Ipopt mailing list