cureos/csipopt — Issue #2: Running example with Mono yields NullReferenceException
Author: cureos
Created: 2011-12-19 12:44:31+00:00
State: open
Labels: Bug

It is not sufficient to use the "classic" csipopt API with Mono any more. In the first call to a function delegate, the following exception is thrown:

```Unhandled Exception: System.NullReferenceException: Object reference not set to
an instance of an object
at string.memcpy4 (byte*,byte*,int) <0x00018>
at string.memcpy (byte*,byte*,int) <0x000b7>
at (wrapper native-to-managed) Cureos.Numerics.IpoptProblem/JacobianEvaluator.Ev
aluate (int,intptr,Cureos.Numerics.IpoptBoolType,int,int,intptr,intptr,intptr,in
tptr) <0x00087>
at (wrapper managed-to-native) Cureos.Numerics.IpoptAdapter.IpoptSolve (intptr,d
ouble[],double[],double&,double[],double[],double[],intptr) <0x00003>
at Cureos.Numerics.IpoptProblem.SolveProblem (double[],double&,double[],double[]
,double[],double[]) <0x0004f>
at hs071_cs.Program.Main (string[]) <0x002af>```

This happens regardless of which executable is being run with the Mono runtime, mcs or Visual C# compiled.
On the other hand, when running an mcs compiled executable using the regular .NET runtime, the optimization problem is successfully solved.