[Mono-bugs] [Bug 43664][Wis] New - Mono crash accessing Default Property in VB.net EXE

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Mon, 26 May 2003 08:25:56 -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 joergr@voelcker.com.

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

--- shadow/43664	Mon May 26 08:25:56 2003
+++ shadow/43664.tmp.31053	Mon May 26 08:25:56 2003
@@ -0,0 +1,103 @@
+Bug#: 43664
+Product: Mono/Runtime
+Version: unspecified
+OS: Debian Woody
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: JoergR@voelcker.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Mono crash accessing Default Property in VB.net EXE
+
+Description of Problem:
+I'm trying to run a compiled VB.net EXE on Mono 0.24.
+At the second call to a Default Property (Indexer in C#) the 
+Mono crashes with a System.NullReferenceException.
+
+Running the same executable using Mint all is going fine.
+
+
+Steps to reproduce the problem:
+1. Compile the following code using VBC from MS.NET
+
+' ------- 8< --- Cut here --- >8 --------------
+Imports System
+
+Public Class TestClass
+    Private m_strings() As String
+
+    Public Sub New()
+        m_strings = New String() {"", ""}
+    End Sub
+
+    Default Public Property Item(ByVal index As Integer) As String
+        Get
+            Console.WriteLine("Inside Get")
+            Item = m_strings(index)
+        End Get
+        Set(ByVal Value As String)
+            Console.WriteLine("Inside Set")
+            m_strings(index) = Value
+        End Set
+    End Property
+End Class
+
+
+Module Module1
+
+    Sub Main()
+        Dim i As Integer
+        Dim test As TestClass
+
+        test = New TestClass
+
+        For i = 0 To 1
+            Console.WriteLine("Setting {0}", i)
+            test.Item(i) = String.Format("Test {0}", i)
+            Console.WriteLine("{0} set.", i)
+        Next
+
+    End Sub
+
+End Module
+
+' ------- 8< --- Cut here --- >8 --------------
+
+2. Run the executable using mono
+
+Actual Results:
+Setting 0
+Inside Set
+0 set.
+
+Unhandled Exception: System.NullReferenceException: A null value was found
+where an object instance was required
+in (unmanaged) /usr/lib/libmono.so.0 [0x4010057b]
+in (unmanaged) /usr/lib/libmono.so.0(mono_g_hash_table_lookup+0x67)
+[0x400ff613]
+in (unmanaged) /usr/lib/libmono.so.0(mono_class_vtable+0xa5) [0x400a5a05]
+in (unmanaged) /usr/lib/libmono.so.0(mono_object_new+0x28) [0x400a77ec]
+in <0x0004d> 00 .Module1:Main ()
+
+
+Expected Results:
+Setting 0
+Inside Set
+0 set.
+Setting 1
+Inside Set
+1 set.
+
+
+How often does this happen? 
+Every time.
+
+Additional Information:
+Mono 0.24