[Os-project-managers] NaN in xs:double (OSrL)

Horand Gassmann Horand.Gassmann at Dal.Ca
Sat Feb 5 15:09:46 EST 2011


Kipp Martin <kmartin at chicagobooth.edu> wrote:

> Where does the segfault occur? Try running in debug mode.

Well diagnosed. I am impressed. Here is the debug session:

Breakpoint 1, IpoptProblem::get_nlp_info (this=0x32cad20, n=@0x7fff56866418,
     m=@0x7fff56866414, nnz_jac_g=@0x7fff56866410, nnz_h_lag=@0x7fff5686640c,
     index_style=@0x32f5aec)
     at ../../../../OS/src/OSSolverInterfaces/OSIpoptSolver.cpp:120
120				nnz_h_lag = sparseHessian->hessDimension;
(gdb) print sparseHessian
$2 = (SparseHessianMatrix *) 0x0
(gdb) step

Program received signal SIGSEGV, Segmentation fault.
0x000000000056a591 in IpoptProblem::get_nlp_info (this=0x32cad20,
     n=@0x7fff56866418, m=@0x7fff56866414, nnz_jac_g=@0x7fff56866410,
     nnz_h_lag=@0x7fff5686640c, index_style=@0x32f5aec)
     at ../../../../OS/src/OSSolverInterfaces/OSIpoptSolver.cpp:120
120				nnz_h_lag = sparseHessian->hessDimension;

sparseHessian is never constructed, perhaps because the nonlinear  
expression does not involve variables, and so the program bombs at  
line 120 of OSIpoptSolver.cpp. If you want to have a look at it after  
your class, here is the input I am using:

<?xml version="1.0" encoding="UTF-8"?>

<osil xmlns="os.optimizationservices.org"  
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="os.optimizationservices.org  
http://www.optimizationservices.org/schemas/2.0/OSiL.xsd">
	<instanceHeader>
		<name>NanTest</name>
		<description> A simple problem where the objective always evaluates  
to NaN </description>
		<fileCreator>
			Horand Gassmann, Jun Ma and Kipp Martin
		</fileCreator>
		<licence>
			This file is licensed under the Eclipse Public License.
			Please see the accompanying LICENSE file in root directory for terms.
		</licence>
	</instanceHeader>
	<instanceData>
		<variables numberOfVariables="2">
			<var name="x0" ub = "1000"  />
			<var name="x1" ub = "1000" />
		</variables>
		<objectives numberOfObjectives="1">
			<obj name = "Objective Function" maxOrMin="max" numberOfObjCoef="0">
			</obj>
		</objectives>
		<nonlinearExpressions numberOfNonlinearExpressions="1">
			<nl idx="-1">
				<divide>
					<number type="real" value="1.0 "/>
					<number type="real" value="0.0 "/>
				</divide>
			</nl   >
		</nonlinearExpressions>
	</instanceData>
</osil>


Cheers

gus



More information about the Os-project-managers mailing list