Open mkatliar opened 9 years ago
Well, this is an older issue. Maybe you can paste valgrind output...
Here's output of lldb
on OS X:
qpDUNES -- A DUal NEwton Strategy for convex quadratic programming.
Copyright (C) 2012-2014 by Janick Frasch and Hans Joachim Ferreau.
Developed within the Optimization in Engineering Center (OPTEC) at
KU Leuven, Belgium under supervision of Moritz Diehl. All rights
reserved.
qpDUNES is distributed under the terms of the GNU Lesser
General Public License 3 in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
Process 3111 stopped
* thread #1: tid = 0x313ad, 0x0000000100021a8b example3_affine_mpc`mpcDUNES_initLtv(mpcProblem=0x00007fff5fbff098, H_=0x00000001000605c0, g_=<unavailable>, C_=0x00000001000606c0, c_=0x0000000100060750, zLow_=0x0000000100060780, zUpp_=<unavailable>, D_=<unavailable>, dLow_=<unavailable>, dUpp_=<unavailable>, zRef_=0x00000001000608e0) + 2923 at setup_mpc.c:729, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
frame #0: 0x0000000100021a8b example3_affine_mpc`mpcDUNES_initLtv(mpcProblem=0x00007fff5fbff098, H_=0x00000001000605c0, g_=<unavailable>, C_=0x00000001000606c0, c_=0x0000000100060750, zLow_=0x0000000100060780, zUpp_=<unavailable>, D_=<unavailable>, dLow_=<unavailable>, dUpp_=<unavailable>, zRef_=0x00000001000608e0) + 2923 at setup_mpc.c:729
726 }
727 }
728 /* set constant QP part */
-> 729 *qpObjConst = 0.;
730 if (zRef_ != 0) {
731 for ( ii=0; ii<nVttl; ++ii ) *qpObjConst += tmp_HzRef[ii] * zRef_[ii];
732
Here is the valgrind output:
==26416== Memcheck, a memory error detector
==26416== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==26416== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==26416== Command: bin/example3_affine_mpc
==26416== Parent PID: 2095
==26416==
==26416== Invalid write of size 8
==26416== at 0x4178F4: mpcDUNES_initLtv (setup_mpc.c:701)
==26416== by 0x40DE7C: main (example3_affine_mpc.c:247)
==26416== Address 0x5a5e478 is 0 bytes after a block of size 88 alloc'd
==26416== at 0x4C2DC90: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==26416== by 0x413BA4: mpcDUNES_setup (setup_mpc.c:69)
==26416== by 0x40DE31: main (example3_affine_mpc.c:233)
==26416==
==26416== Invalid write of size 8
==26416== at 0x41791A: mpcDUNES_initLtv (setup_mpc.c:704)
==26416== by 0x40DE7C: main (example3_affine_mpc.c:247)
==26416== Address 0x5a5e478 is 0 bytes after a block of size 88 alloc'd
==26416== at 0x4C2DC90: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==26416== by 0x413BA4: mpcDUNES_setup (setup_mpc.c:69)
==26416== by 0x40DE31: main (example3_affine_mpc.c:233)
==26416==
==26416== Use of uninitialised value of size 8
==26416== at 0x417F2A: mpcDUNES_initLtv (setup_mpc.c:729)
==26416== by 0x40DE7C: main (example3_affine_mpc.c:247)
==26416==
==26416== Use of uninitialised value of size 8
==26416== at 0x417A43: mpcDUNES_initLtv (setup_mpc.c:731)
==26416== by 0x40DE7C: main (example3_affine_mpc.c:247)
==26416==
==26416== Conditional jump or move depends on uninitialised value(s)
==26416== at 0x43564D: qpOASES::QProblemB::backsolveR(double const*, qpOASES::BooleanType, qpOASES::BooleanType, double*) const (in /media/sf_E_DRIVE/software/qpDUNES-dev/build/linux/bin/example3_affine_mpc)
==26416== by 0x420AB3: qpOASES::QProblem::determineStepDirection(double const*, double const*, double const*, double const*, double const*, qpOASES::BooleanType, qpOASES::BooleanType, double*, double*, double*, double*) (in /media/sf_E_DRIVE/software/qpDUNES-dev/build/linux/bin/example3_affine_mpc)
==26416== by 0x42EA04: qpOASES::QProblem::solveQP(double const*, double const*, double const*, double const*, double const*, int&, double*, int) (in /media/sf_E_DRIVE/software/qpDUNES-dev/build/linux/bin/example3_affine_mpc)
==26416== by 0x42F689: qpOASES::QProblem::solveRegularisedQP(double const*, double const*, double const*, double const*, double const*, int&, double*, int) (in /media/sf_E_DRIVE/software/qpDUNES-dev/build/linux/bin/example3_affine_mpc)
==26416== by 0x430A70: qpOASES::QProblem::hotstart(double const*, double const*, double const*, double const*, double const*, int&, double*) (in /media/sf_E_DRIVE/software/qpDUNES-dev/build/linux/bin/example3_affine_mpc)
==26416== by 0x4328F4: qpOASES::QProblem::solveInitialQP(double const*, double const*, qpOASES::Bounds const*, qpOASES::Constraints const*, int&, double*) (in /media/sf_E_DRIVE/software/qpDUNES-dev/build/linux/bin/example3_affine_mpc)
==26416== by 0x418DD7: qpOASES_setup (in /media/sf_E_DRIVE/software/qpDUNES-dev/build/linux/bin/example3_affine_mpc)
==26416== by 0x40FBCD: qpDUNES_setupAllLocalQPs (setup_qp.c:1177)
==26416== by 0x417D3C: mpcDUNES_initLtv (setup_mpc.c:772)
==26416== by 0x40DE7C: main (example3_affine_mpc.c:247)
And there are TONS (1227, to be exact) of "Conditional jump or move depends on uninitialised value(s)" errors referring to qpOASES
as well as qpDUNES
code.
To reproduce: run example3_affine_mpc
Happens in setup_mpc.c, line 729:
Call stack:
qpObjConst
is initialized tompcProblem->qpObjConst
in line 660, butmpcProblem->qpObjConst
contains an unitialized value: