This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi! We are experiencing problems with the latest nightlies of WPF Elements 6.0. We have confirmed that these crashes were not present in the previous nightlies. For us, they make no sense. We get different errors, but they are pretty easy to reproduce in our codebase. However, with older nightlies, our code works as it should. See attached screenshot for more info. This is not something that appears every time we do something, but it happens a lot. It would probably require quite a bit of time to do a small test project that reproduces this, so we are hoping that you can see something in the stack traces that we can't. What has changed? Can you think of anything that may be a problem? Also, we are thinking about upgrading to WPF Elements 7. Are the nightly changes from version 6 included in version 7 nightlies too? I know that you fixed a lot of our problems in the version 6 branch. Best regards, Stack trace of one of the crashes: Exception: at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Delegate.DynamicInvokeImpl(Object[] args) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.DispatcherOperation.InvokeImpl() at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Windows.Threading.DispatcherOperation.Invoke() at System.Windows.Threading.Dispatcher.ProcessQueue() at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) at MS.Win32.HwndSubclass.SubclassWndProc(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 TheViewer.App.Main() in c:!TFS\Monitoring\TheViewer\Master\TheViewer\TheViewer\obj\x86\Debug\App.g.cs:line 0 at System.AppDomain.nExecuteAssembly(RuntimeAssembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStartContext(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() Inner Exception: And another: at System.Windows.Media.VisualCollection.Insert(Int32 index, Visual visual)
at System.Windows.Controls.Panel.AddChildren(GeneratorPosition pos, Int32 itemCount)
at System.Windows.Controls.Panel.OnItemsChangedInternal(Object sender, ItemsChangedEventArgs args)
at System.Windows.Controls.Panel.OnItemsChanged(Object sender, ItemsChangedEventArgs args)
at System.Windows.Controls.ItemContainerGenerator.OnItemAdded(Object item, Int32 index)
at System.Windows.Controls.ItemContainerGenerator.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
at System.Windows.WeakEventManager.ListenerList and another: at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Delegate.DynamicInvokeImpl(Object[] args) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.DispatcherOperation.InvokeImpl() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Windows.Threading.DispatcherOperation.Invoke() at System.Windows.Threading.Dispatcher.ProcessQueue() at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) at MS.Win32.HwndSubclass.SubclassWndProc(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.Application.RunInternal(Window window) at System.Windows.Application.Run() at TheViewer.App.Main() in c:!TFS\Monitoring\TheViewer\Master\TheViewer\TheViewer\obj\x86\Release\App.g.cs:line 0 |
|
|
Hello Roland Thanks for pointing this out. I've looked at all the points in our code that are related to these stack traces, but I can't think of anything that has changed recently that is related to this. Unfortunately a repro project is going to be the best way to look into this further. Also, please send the types and messages of these exceptions. The nightly builds of version 7.0 are frequently kept up to date with 6.0, so you'll have no problems upgrading. -Jason Fauchelle |
|
|
Hi Jason Unfortunately we haven't got the time to create a repro project. We believe that the crash is related to changing between axis modes (selectable/horizontal/vertical) and the ChartAlternativeYAxes. Is it possible to get source code for the 0824 nightly so that we can see what happens? That would be a lot faster for us. (btw, we've upgraded to 7.0 now, without any problem. Great!) -Roland Wallin |
|
|
Hello Jason I used the source that came with the latest version 6 nightly. The crash that occurs always seems to happen in the AddTickMark method in the ChartAxis class. More specifically on the line that says "cache.Add(tickMark);". Sometimes cache is the minor tick mark collection and sometimes it is the major tick mark collection. If we then study the message in the exception that occurs: "Message = "Specified argument was out of the range of valid values.\r\nParameter name: index" and the source of that message is PresentationCore, it leads me to believe that it might some binding or synchronization problem between the tick mark collections and the visual elements that will be rendered on the screen. Could this be the case? Edit: PS. Best regards |
|
|
Thanks for all the information about this. I managed to reproduce this issue but couldn't find any recent changes that affect this. There have only been a couple of very simple changes to the Chart control recently. Rolling these back don't solve the issue. I've looked into this extensively, but couldn't find a good fix for this. To solve this for now, I've put a try catch block around the single line of code in the Chart causing the problem. This doesn't seem to have any adverse effects, all tick marks are still rendered correctly and there is negligible impact on performance. This will be available in the next nightly build for both 6.0 and 7.0. -Jason Fauchelle |
|
|
Hello Jason While the chart doesn't crash now the number of tick marks and labels diminishes over time. So even though the application itself doesn't crash the procedure for generating tick marks and labels crash and doesn't generate the objects as it should. See the overlay alternative Y-axes on the attached screen shot. Best regards |
|
|
Hello Nicklas Thanks for the screen shot, I've been able to reproduce this. I've been looking into finding a proper solution for this for quite a while but so far things don't look promising. I've looked to see how others have solved this bug, but none of their scenarios seem to be applicable to this issue. I will continue looking into this. -Jason Fauchelle |
|
|
Hello Jason I just wanted to share with you an observation. When we use our algorithm to manually set the MajorTickMarkSpacing we can't seem to get the chart to crash. Could this help you in any way? Best regards |
|
|
Hello Nicklas Thanks for the observation, I'll keep this in mind. Sorry I didn't get around to looking into it this week. This is on my high priority list for next week. I do have an idea of how to solve this. -Jason Fauchelle |
|
|
Hi Nicklas, In the next nightly build, the issue with the missing tick marks and labels should be resolved. -Jason Fauchelle |
|