Bug 438650

Summary: Unhandled exception when we click on any node in Treeview Control
Product: [Mono] Mono: Class Libraries Reporter: Palanisamy Muniappan <Palanisamy_m>
Component: Windows.FormsAssignee: Mono Bugs <mono-bugs>
Status: RESOLVED FIXED QA Contact: Mono Bugs <mono-bugs>
Severity: Blocker    
Priority: P1 - Urgent CC: calberto.cortez, johnm, suneetha_g
Version: 2.0.x   
Target Milestone: ---   
Hardware: i386   
OS: All   
Whiteboard: OSX
Found By: Development Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: Please find the attached sample application for the defect.
Unit Test

Description Palanisamy Muniappan 2008-10-24 09:43:33 UTC
Description of Problem:
We are using Treeview control in our application. When we click/right click on any node in Treeview, it is throwing Unhandled Exception from System.Windows.Forms.TreeView.MouseUpHandler and application will crash.

This problem is occuring in MAC OS X 10.5.

It is working fine in all the linux flavours(for example : Ubuntu 8.04, fedora core 8 and RHEL 5).

Steps to reproduce the problem:
1. Open application that contain treeview, in-turn treeview has nodes.
2. Click on any node in Treeview, it is throwing Unhandled Exception.
3. If we click the nodes 10 times, application will crash atlease 6 times.

Actual Results:
Application should work fine when we click on any nodes in Treeview.

Expected Results:
Unhandled exception when we click on any node in Treeview Control

How often does this happen? 
It is happening frequently.One time it will crash on one node and next time it will crash on some other node but it will work on previous node.

Additional Information:

This problem is specific to MAC OS and mono 1.9.1 and 2.0

Please see the log file content below:-

System.NullReferenceException: Object reference not set to an instance of an object
  at System.Windows.Forms.TreeView.MouseUpHandler (System.Object sender, System.Windows.Forms.MouseEventArgs e) [0x00000] 
  at (wrapper delegate-invoke) System.MulticastDelegate:invoke_void__this___object_MouseEventArgs (object,System.Windows.Forms.MouseEventArgs)
  at System.Windows.Forms.Control.OnMouseUp (System.Windows.Forms.MouseEventArgs e) [0x00000] 
  at System.Windows.Forms.Control.WmRButtonUp (System.Windows.Forms.Message& m) [0x00000] 
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m) [0x00000] 
  at System.Windows.Forms.TreeView.WndProc (System.Windows.Forms.Message& m) [0x00000] 
  at System.Windows.Forms.Control+ControlWindowTarget.OnMessage (System.Windows.Forms.Message& m) [0x00000] 
  at System.Windows.Forms.Control+ControlNativeWindow.WndProc (System.Windows.Forms.Message& m) [0x00000] 
  at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg, IntPtr wParam, IntPtr lParam) [0x00000] 
  at System.Windows.Forms.XplatUICarbon.DispatchMessage (System.Windows.Forms.MSG& msg) [0x00000] 
  at System.Windows.Forms.XplatUI.DispatchMessage (System.Windows.Forms.MSG& msg) [0x00000] 
  at System.Windows.Forms.Application.RunLoop (Boolean Modal, System.Windows.Forms.ApplicationContext context) [0x00000] 
  at System.Windows.Forms.Application.Run (System.Windows.Forms.ApplicationContext context) [0x00000] 
  at System.Windows.Forms.Application.Run (System.Windows.Forms.Form mainForm) [0x00000] 
  at Likewise.LMC.LMCAppMain.Main (System.String[] args) [0x00000]
Comment 1 suneetha_g Gunisetti 2008-12-15 11:43:13 UTC
Hi,

I have implemented the sample .Net application that reproduces this defect.

Steps to reproduce the defect:

1. Run the application, Opens the Main form.
2. Click on Root node in the lift side panel.
3. Application will get crash and it throws an exception in the terminal windows.
4. Some times when we click on root node it adds dynamic nodes to it successfully.
5. But it will get crash on child node selection.

How often does this happen?
Most of the node click events

Actual Result: 
Now when we click on any of the nodes in the tree view the application is getting crashed.

Expected Result:
The tree view should perform all the operations as like in windows.
Comment 2 suneetha_g Gunisetti 2008-12-15 11:59:34 UTC
Created attachment 260056 [details]
Please find the attached sample application for the defect.
Comment 3 John Mortlock 2008-12-16 11:46:10 UTC
Created attachment 260280 [details]
Unit Test

Attached is a unit test which can reproduce the problem.

Essentially the problem occurs whenever the node list is cleared during the nodeclick event.
Comment 4 John Mortlock 2008-12-16 11:47:13 UTC
Should also mention this occurs in SVN head on Win32.
Comment 5 suneetha_g Gunisetti 2008-12-17 12:32:16 UTC
The same issue is happening in Fedora10 32-bit. As we observed that MONO is in-built with the version 2.0.1.
Comment 6 suneetha_g Gunisetti 2009-01-13 10:55:24 UTC
Hi,

As we learnt that there is defect in MONO 2.X version. Since we are getting the same error with MONO 2.X version in all the Linux distros.
Comment 7 Carlos Alberto Cortez 2009-01-20 03:02:09 UTC
Marking this bug's Platform as All, since this is actually reproducible not only on Mac.
Comment 8 Carlos Alberto Cortez 2009-01-20 07:13:32 UTC
This should be fixed in rev 123859. Re-open if needed.
 
Thanks!