[Mono-bugs] [Bug 77171][Cri] New - Setting TextBox.Text crashes with NullPointerException

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Jan 6 13:46:06 EST 2006


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 bernd.w at alice.it.

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

--- shadow/77171	2006-01-06 13:46:06.000000000 -0500
+++ shadow/77171.tmp.12847	2006-01-06 13:46:06.000000000 -0500
@@ -0,0 +1,93 @@
+Bug#: 77171
+Product: Mono: Class Libraries
+Version: 1.1
+OS: GNU/Linux [Other]
+OS Details: Fedora 4 and Windows 2000
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Critical
+Component: Windows.Forms
+AssignedTo: peter at novonyx.com                            
+ReportedBy: bernd.w at alice.it               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Setting TextBox.Text crashes with NullPointerException
+
+Description of Problem:
+
+Setting of Property Windows.Forms.TextBox.Text to some non-null string 
+crashes the program with Nullpointerexception in 
+System.Windows.Forms.Line:RecalculateLine with mono 1.1.12.1, both in 
+Fedora Linux 4 and in Windows 2000.
+
+
+Steps to reproduce the problem:
+
+create simple Form with this in constructor:
+
+this.textBox1 = new System.Windows.Forms.TextBox();
+this.textBox1.Text = "abc";
+
+By commenting out the line this.textBox1.Text it works fine.
+Setting Location, Name, Tabindex etc. works fine, setting Text after that 
+crashes again.
+By changing it to "this.textBox1.Text = null;" it works fine.
+
+
+Actual Results:
+[root at linuxserver2 ~]# mono AllowInternetSharp.exe
+Mono System.Windows.Forms Assembly [Revision: 54007; built: 2005/12/6 
+14:35:24]
+Keyboard: German keyboard layout without dead keys
+Gtk colorscheme read
+
+Unhandled Exception: System.NullReferenceException: Object reference not 
+set to an instance of an object
+in <0x0047d> System.Windows.Forms.Line:RecalculateLine 
+(System.Drawing.Graphics g, System.Windows.Forms.Document doc)
+in <0x000a8> System.Windows.Forms.Document:RecalculateDocument 
+(System.Drawing.Graphics g, Int32 start, Int32 end, Boolean optimize)
+in <0x00017> System.Windows.Forms.Document:RecalculateDocument 
+(System.Drawing.Graphics g)
+in <0x00026> System.Windows.Forms.Document:owner_HandleCreated 
+(System.Object sender, System.EventArgs e)
+in (wrapper delegate-invoke) 
+System.MulticastDelegate:invoke_void_object_EventArgs 
+(object,System.EventArgs)
+in <0x00023> System.Windows.Forms.Control:OnHandleCreated 
+(System.EventArgs e)
+in <0x0000d> System.Windows.Forms.TextBoxBase:OnHandleCreated 
+(System.EventArgs e)
+in <0x0000d> System.Windows.Forms.TextBox:OnHandleCreated 
+(System.EventArgs e)
+in <0x000f9> System.Windows.Forms.Control:CreateHandle ()
+in <0x0000a> System.Windows.Forms.TextBoxBase:CreateHandle ()
+in <0x00024> System.Windows.Forms.Control:get_Handle ()
+in (wrapper remoting-invoke-with-check) 
+System.Windows.Forms.Control:get_Handle ()
+in <0x0005b> System.Windows.Forms.Document:PositionCaret 
+(System.Windows.Forms.Line line, Int32 pos)
+in <0x00309> System.Windows.Forms.TextBoxBase:set_Text (System.String 
+value)
+in <0x0000d> System.Windows.Forms.TextBox:set_Text (System.String value)
+in <0x00050> AllowInternetSharp.Form1:InitializeComponent ()
+in <0x00020> AllowInternetSharp.Form1:.ctor ()
+in (wrapper remoting-invoke-with-check) AllowInternetSharp.Form1:.ctor ()
+in <0x00018> AllowInternetSharp.Form1:Main ()
+
+
+Expected Results:
+No exception, Form showing
+
+How often does this happen?
+every time
+
+
+Additional Information:
+tested in Fedora 4 and in Windows 2000
+works fine in .NET 1.1
+In Windows 2000 actually the programm freezes. Tracing shows a 
+NullPointerException.


More information about the mono-bugs mailing list