[Mono-bugs] [Bug 76140][Nor] New - NullReferenceException from runtime when calling native inb from worker thread.

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sun Sep 18 01:40:30 EDT 2005


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 andrewarnott at byu.edu.

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

--- shadow/76140	2005-09-18 01:40:29.000000000 -0400
+++ shadow/76140.tmp.15720	2005-09-18 01:40:29.000000000 -0400
@@ -0,0 +1,73 @@
+Bug#: 76140
+Product: Mono: Runtime
+Version: 1.1
+OS: GNU/Linux [Other]
+OS Details: 2.6.12-gentoo-r6
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: interop
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: AndrewArnott at byu.edu               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: NullReferenceException from runtime when calling native inb from worker thread.
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+I wrote a shared library in C (.so) to expose ioperm, inb and outb for
+P/Invoke'ing from my C# program.  Everything was working great until I
+tried to call inb from a worker thread.  Then the runtime threw a
+NullReferenceException while executing the inb C function.  By adding trace
+strings through my code, I determined that the runtime actually calls into
+C's inb, but then coughs before it returns.
+
+Steps to reproduce the problem:
+0. I am running Mono 1.1.8.3. (I'm installing 1.1.9 now to test, and will
+add to this bug when I'm done).
+1. Extract the attached bug repro.
+2. Change into the inb_bug directory.
+3. "make test"
+
+Actual Results:
+
+gcc -shared -g -Wall -fPIC   -o libIOWrapper.so IOWrapper.c
+mcs Program.cs
+sudo mono Program.exe
+Calling Ioperm...
+Calling Inb a few times in the main thread...
+Successful.  Now starting worker thread...
+Thread started.  Press enter to end.
+
+Unhandled Exception: System.NullReferenceException: Object reference not
+set to an instance of an object
+in <0x00000> <unknown method>
+in (wrapper managed-to-native) Program:Inb (int)
+in <0x00009> Program:WorkerThread ()
+in (wrapper delegate-invoke) System.MulticastDelegate:invoke_void ()
+
+Expected Results:
+
+
+gcc -shared -g -Wall -fPIC   -o libIOWrapper.so IOWrapper.c
+mcs Program.cs
+sudo mono Program.exe
+Calling Ioperm...
+Calling Inb a few times in the main thread...
+Successful.  Now starting worker thread...
+Thread started.  Press enter to end.
+
+How often does this happen? 
+
+Every time.
+
+Additional Information:
+
+I'm happy to work with you on this bug's details or repro if you need.  I
+know nothing about how Mono's runtime engine works on the inside though, so
+I won't be any good at fixing this bug myself.  But it's a show-stopper for
+what I'm trying to do.


More information about the mono-bugs mailing list