[Mono-bugs] [Bug 74909][Wis] New - C# - C Interop callbacks crash - but works with dotgnu

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 11 May 2005 10:23:18 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by abbottkirk@yahoo.com.

http://bugzilla.ximian.com/show_bug.cgi?id=74909

--- shadow/74909	2005-05-11 10:23:18.000000000 -0400
+++ shadow/74909.tmp.25166	2005-05-11 10:23:18.000000000 -0400
@@ -0,0 +1,76 @@
+Bug#: 74909
+Product: Mono: Runtime
+Version: 1.1
+OS: 
+OS Details: Windows Cygwin
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: interop
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: abbottkirk@yahoo.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: C# - C Interop callbacks crash - but works with dotgnu
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+I have some C# - C interop callbacks using both PInvoke and unsafe
+pointers. I can crashes which don't happen under Visual.net or
+under Dotgnu. I have a small example and Makefile that i can submit.
+The callbacks are implemented in C# and 'registered' with some unmanaged
+C-code.
+
+Steps to reproduce the problem:
+1. Compile & run
+2. 
+3. 
+
+Actual Results:
+Starting...
+N = 5
+M = 2
+NNZ = 10
+NLB = 5
+N = 4
+Iterating in IpoptLink.c.iterate()
+
+Unhandled Exception: System.NullReferenceException: Object reference not set to
+an instance of an object.
+   at IpOptClient.Model.OnEvalG(Int32 n, Double* pX, Double* pG, Double*
+pDat, I
+nt32* pIdat)
+   at IpOptClient.IpoptDriver.OPTIMIZE(Int32& N, Int32& M, Int32& NNZ,
+Int32& NL
+B, Int32& NUB, Double* X, Int32* ILB, Double* BNDS_L, Int32* IUB, Double*
+BNDS_U
+, EvalFDelegate EV_F, EvalGDelegate EV_G, Double& fObj)
+   at IpOptClient.Model.doit()
+   at IpOptClient.IpoptDriver.Main(String[] args)
+
+
+Expected Results:
+Starting...
+N = 5
+M = 2
+NNZ = 10
+NLB = 5
+N = 4
+Iterating in IpoptLink.c.iterate()
+g[0] = 12
+g[1] = 1
+g[2] = 3.3
+g[3] = 11
+g[4] = 0
+
+
+How often does this happen? 
+Every run
+
+Additional Information:
+I have a small zip file that is configured to run either
+under MONO and DOTGNU that can be used to replicate the problem.