Group: Forum Members
Last Active: 14 Years Ago
Posts: 6,
Visits: 1
|
My application crashed today and the call stack suggests it was due to a mouse-move event being improperly handled by a Nevron chart that was not yet populated with data. Call stack below - any thoughts?
2010-12-01 11:22:49,220 FATAL ####.App - Unhandled Exception System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) at System.ThrowHelper.ThrowArgumentOutOfRangeException() at System.Collections.Generic.List`1.get_Item(Int32 index) at Nevron.Chart.NScaleRuler.lIlIIllIll(Double value) at Nevron.Chart.NScaleRuler.ScaleToLogical(Double coordinate) at Nevron.Chart.NViewToScale1DTransformation.Transform(NPointF pointView, Double& value) at Nevron.Chart.NAxisCursor.SetValueFromViewPoint(NChartRenderingContext context, NPointF point) at Nevron.Chart.NAxisCursor.OnMouseMove(NMouseEventArgs e) at Nevron.Chart.WinForm.NDataCursorTool.OnMouseMove(Object sender, MouseEventArgs e) at Nevron.Chart.WinForm.NController.OnMouseMove(Object sender, MouseEventArgs e) at Nevron.Chart.WinForm.NChartControl.OnMouseMove(MouseEventArgs e) at System.Windows.Forms.Control.WmMouseMove(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.Run() at System.Windows.Application.RunDispatcher(Object ignore) at System.Windows.Application.RunInternal(Window window) at System.Windows.Application.Run(Window window) at System.Windows.Application.Run() at CreditAlpha.App.Main() in C:\Dev\NewCreditAlpha\Credit Alpha\obj\x86\Debug\App.g.cs:line 0 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()
|
Group: Forum Members
Last Active: Last Week
Posts: 3,054,
Visits: 4,009
|
Hi Neil, Can you post the code that replicates the problem?
Best Regards, Nevron Support Team
|
Group: Forum Members
Last Active: 14 Years Ago
Posts: 6,
Visits: 1
|
This is part of a large application. I can try to reduce it to a reproducible example if you wish
However looking at your code, there seems to be a clear bug in NScaleRuler:
NScaleRuler.ScaleToLogical calls into an internal function called NScaleRuler.lIlIIllIll which reads
if (this.m_ScaleBegin > value) return this.l1I1llI1l[0];
int count = this.l1I1llI1l.Count; if (count != 0) { ... }
return null;
I believe line 2 is causing the problem. Consider replacing this with
int count = this.l1I1llI1l.Count; if (count == 0) return null;
if (this.m_ScaleBegin > value) return this.l1I1llI1l[0];
...
return null;
|
Group: Forum Members
Last Active: Last Week
Posts: 3,054,
Visits: 4,009
|
Hi Neil, You're correct that the code that handles the trasnform does not check the internal segment bounds correctly. We just fixed that, however the issue can only occur if there are no segments in the axis ruler segment collection. This is very strange as it is not meant to operate that way - since the code that generates segments depends on many things (linear / log settings, scale breaks, inflate) it will be very helpful if you can post code that isolates this problem. Also is there anything specific about the chart that can help us narrow the search (like scalebreaks, zero data points etc).
Best Regards, Nevron Support Team
|
Group: Forum Members
Last Active: 14 Years Ago
Posts: 6,
Visits: 1
|
Hi,
I'm not using scalebreaks. There were probably no points on the graph at this point - the data is populated from a different thread
How can I get a patched copy of the libraries?
Thanks, Neil
|
Group: Forum Members
Last Active: Last Week
Posts: 3,054,
Visits: 4,009
|
Hi Neil, You simply have to download the installation again and reinstall. BTW multithreading can be causing this - the control may be painting when you modify the data - to prevent from concurrent access from the paint thread and the data feed thread you need to lock the chart document first - for example: nChartControl1.Document.Lock(); // changes go herenChartControl1.Document.Unlock();
Creates a block in which it is safe to modify the chart document state. Most likely threading is the problem here so we recommend to check if implementing the above approach in your code fixes the problem.
Best Regards, Nevron Support Team
|
Group: Forum Members
Last Active: 13 Years Ago
Posts: 4,
Visits: 1
|
Hi, I am getting the same problem. The charts are updated in threads and also, there are different threads which update the GUI controls simultaneously . After going through the replies, I have included the Lock () and Unlock () on the chart control. Further, I also use thread locking mechanism (i.e. Monitor.TryEnter and Monitor.Exit). However the problem still exist. In one of the post, it is stated that the problem is fixed. Currently, I am using Nevron .NET Vision 2010.1 for VS2008. Is the problem fixed for this version? Warm Regards, Sachin
|
Group: Forum Members
Last Active: Last Week
Posts: 3,054,
Visits: 4,009
|
Hi Sachin, The problem above has been fixed long time ago in one of the SPs for 2010. We just double checked the code in the new version (2011 Vol1) and it is Ok there as well so you should not experience it with it. Let us know if you meet any problems.
Best Regards, Nevron Support Team
|