[Mono-bugs] [Bug 621475] New: TextBox and RichTextBox crash on click when text value will be set to null

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Jul 11 14:12:46 EDT 2010


http://bugzilla.novell.com/show_bug.cgi?id=621475

http://bugzilla.novell.com/show_bug.cgi?id=621475#c0


           Summary: TextBox and RichTextBox crash on click when text value
                    will be set to null
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.6.x
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: Critical
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: jcook at myself.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.6)
Gecko/20100625 Firefox/3.6.6 (.NET CLR 3.5.30729)

if the text value is set to null on click event for that textbox the app will
crash, setting the value to null using other methods works (like pressing a
button)

test case:

this.barcodebox.Location = new System.Drawing.Point(230, 76);
this.barcodebox.Name = "barcodebox";
this.barcodebox.Size = new System.Drawing.Size(134, 20);
this.barcodebox.Click += new System.EventHandler(this.barcodebox_Click);
..
..
..
private void barcodebox_Click(object sender, EventArgs e)
        {

           barcodebox.Text = "";
           //or using
           //barcodebox.Text = null;

        }


this is the output:

System.IndexOutOfRangeException: Array index is out of range.
  at System.Windows.Forms.Document.Invalidate (System.Windows.Forms.Line start,
Int32 start_pos, System.Windows.Forms.Line end, Int32 end_pos) [0x00000] in
<filename unknown>:0 
  at System.Windows.Forms.Document.InvalidateSelectionArea () [0x00000] in
<filename unknown>:0 
  at System.Windows.Forms.TextBox.TextBox_LostFocus (System.Object sender,
System.EventArgs e) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control.OnLostFocus (System.EventArgs e) [0x00000] in
<filename unknown>:0 
  at System.Windows.Forms.Control.WmKillFocus (System.Windows.Forms.Message& m)
[0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m)
[0x00000] in <filename unknown>:0 
  at System.Windows.Forms.TextBoxBase.WndProc (System.Windows.Forms.Message& m)
[0x00000] in <filename unknown>:0 
  at System.Windows.Forms.TextBox.WndProc (System.Windows.Forms.Message& m)
[0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control+ControlWindowTarget.OnMessage
(System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control+ControlNativeWindow.WndProc
(System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg, IntPtr
wParam, IntPtr lParam) [0x00000] in <filename unknown>:0 
System.ObjectDisposedException: The object was used after being disposed.
  at System.Windows.Forms.Control.CreateHandle () [0x00000] in <filename
unknown>:0 
  at System.Windows.Forms.TextBoxBase.CreateHandle () [0x00000] in <filename
unknown>:0 
  at System.Windows.Forms.Control.get_Handle () [0x00000] in <filename
unknown>:0 
  at (wrapper remoting-invoke-with-check)
System.Windows.Forms.Control:get_Handle ()
  at System.Windows.Forms.Control.WmLButtonDown (System.Windows.Forms.Message&
m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m)
[0x00000] in <filename unknown>:0 
  at System.Windows.Forms.TextBoxBase.WndProc (System.Windows.Forms.Message& m)
[0x00000] in <filename unknown>:0 
  at System.Windows.Forms.TextBox.WndProc (System.Windows.Forms.Message& m)
[0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control+ControlWindowTarget.OnMessage
(System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control+ControlNativeWindow.WndProc
(System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg, IntPtr
wParam, IntPtr lParam) [0x00000] in <filename unknown>:0 


Reproducible: Always

Steps to Reproduce:
1. enter some text
2. click on anything else 
3. click back
4. crash
Actual Results:  
application crash

Expected Results:  
clear the textbox

tried  different mono versions and linux distributions

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list