Big Red X crash

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
JHirsch
Newbie
Newbie
Posts: 16
Joined: Tue Jul 20, 2004 4:00 am
Location: USA

Big Red X crash

Post by JHirsch » Fri Mar 04, 2005 7:57 pm

I am using the latest TeeChart.DLL (ver 1.1.1864.22788) and after several execution cycles of drawing a trend graph (adding points on the end of lines in realtime) the graph control crashes with a system exception. The crash appears as a Big Red X in the chart area with a red square outline and white background color. The jist of the exception is as follows:
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.Collections.ArrayListEnumeratorSimple.MoveNext()
at Steema.TeeChart.Chart.BroadcastToolEvent(EventArgs e)
at Steema.TeeChart.Chart.InternalDraw(Graphics g)
at Steema.TeeChart.TChart.Draw(Graphics g)
at Steema.TeeChart.TChart.OnPaint(PaintEventArgs pe)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
I am using the Cursor tool to put vertical lines with a text tag that follows the line. The text must be repostitioned with the line as the x-axis is changed so this is accomplished in the After Draw event. I am keeping the list of "Markers" or Cursor Tools in an ArrayList and adjusting the position via this code:

Code: Select all

private ArrayList markerLines;
private ArrayList markerLinesTS;

...

markerLines = new ArrayList();
markerLinesTS = ArrayList.Synchronized(markerLines);

...
// Inside the AfterDraw event handler
lock(markerLinesTS)
 {
     foreach(MarkerClass mc in markerLinesTS)
     {
         x = mc.CTool.GetHorizAxis.CalcXPosValue(mc.CTool.XValue);
         y = (mc.CTool.GetVertAxis.CalcYPosValue(mc.CTool.GetVertAxis.MaxYValue) - (mc.CTool.GetVertAxis.CalcYPosValue(mc.CTool.GetVertAxis.MinYValue)) >> 2) + mc.CTool.GetVertAxis.CalcYPosValue(mc.CTool.GetVertAxis.MinYValue);
         graphControl.Graphics3D.RotateLabel(x, y, 0, mc.MarkerText, 90);
     }
     Monitor.Pulse(markerLinesTS);
}

This method was a result of using this forum to figure out the best way to implement these "markers".

The synchronized locks on the arraylist do not help this problem any as I have tried it with and without the locks to no avail.

I have tried the code with the current DLL listed above and the version before it with the same results.

I have also tried to generate a simple application where I could demonstrate the problem using the same graph related code from my application and cannot duplicate this problem in the simple case.

Help!

Jim

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Thu Mar 10, 2005 10:19 am

Hi Jim,

it's hard to tell which is the problem without being able to reproduce the problem here. If you're able to create an example with which we can reproduce the problem send it us (post it into the news://www.steema.net/steema.public.attachments newsgroup) so we can debug it and try to find where is the problem.

JHirsch
Newbie
Newbie
Posts: 16
Joined: Tue Jul 20, 2004 4:00 am
Location: USA

Post by JHirsch » Tue Mar 15, 2005 3:00 pm

Hi Pep,

I finally have seen the crash in my demo program. It had to run overnight to produce it. I have zipped the project up and will post it in the newsgroup for your attention.

It is a Visual Studio .NET 2003 project and you may have to redirect to the proper teechart.dll.


Jim

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon Mar 21, 2005 4:40 pm

Hi Jim,

I'm able to run the demo project, but it's working just fine. Maybe I must do something to reproduce it (I've just click over the Go button and wait some minutes). ? If so, could you please tell me the steps I must follow ?

JHirsch
Newbie
Newbie
Posts: 16
Joined: Tue Jul 20, 2004 4:00 am
Location: USA

Post by JHirsch » Mon Mar 28, 2005 3:19 pm

Hi Pep,


The last time I saw the failure was when the program ran overnight (more than 12 hours). Also running that night was a virus scan program which loaded down the CPU. My thinking is that the crash may happen when the CPU is loaded and has been running for a while.

Jim

Post Reply