Phantom exceptions

4 posts, 0 answers
  1. Matt
    Matt avatar
    5 posts
    Member since:
    May 2013

    Posted 30 Apr 2015 Link to this post

    I am the lead developer for a WPF application used internally by my company.  It includes an automated error reporting subsystem, and our users occasionally throw this exception:

    Stack
    trace: at
    System.Windows.Controls.ItemContainerGenerator.ContainerFromIndex(Int32 index)
    at
    Telerik.Windows.Controls.RadTreeView.UpdateTabStopOnSelectionFromUI(IEnumerable`1
    selectedItems) at Telerik.Windows.Controls.RadTreeView.OnCollapsed(Object
    sender, RadRoutedEventArgs e)

     

    Originally I used a RadTreeView in the application where the users were throwing this exception, but after weeks of trying to track it down unsuccessfully I replaced the control with a stock TreeView.  Now there is no RadTreeView *anywhere* the users cause this, but the number of these exceptions hasn't diminished at all.

     

    I am using 2015.1.401.45 release on .NET 4.5.1.

  2. Milena
    Admin
    Milena avatar
    204 posts

    Posted 01 May 2015 Link to this post

    Hello Matt,

    It's very hard for us to detect the root cause of this issue from the gives stack trace. Is it possible for you to elaborate a bit more on your scenario and isolate this in a runnable sample that we could debug locally? Also for us it important to know the steps to reproduce it - when this exception occurs. This will allow us to test it locally and investigate the reason behind this behavior.

    Thank you in advance for your cooperation.

    Regards,
    Milena
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Matt
    Matt avatar
    5 posts
    Member since:
    May 2013

    Posted 01 May 2015 in reply to Milena Link to this post

    Hello Milena,

    Part of the problem is that it is random and there is no consistent way to reproduce the error, so I cannot provide a sample project.  It seems to happen more often when removing the root node from a stock WPF TreeView.  Like I said, I replaced the RadTreeView control from the originating module.  Do any other Telerik WPF controls use the RadTreeView as a child?

    I found this: http://www.telerik.com/forums/nullreferenceexpection-in-containerfromindex

     Here is more detailed exception info:

    System.NullReferenceException:
    Object reference not set to an instance of an object. at
    System.Windows.Controls.ItemContainerGenerator.ContainerFromIndex(Int32 index)
    at
    Telerik.Windows.Controls.RadTreeView.UpdateTabStopOnSelectionFromUI(IEnumerable`1
    selectedItems) at Telerik.Windows.Controls.RadTreeView.OnCollapsed(Object
    sender, RadRoutedEventArgs e) 

     

    and here is the call stack:

    at
    PlanIt2.Common.ErrorHandler.NotifyTheDevs(Exception ex, String AdditionalInfo)
    at PlanIt2.App.App_DispatcherUnhandledException(Object sender,
    DispatcherUnhandledExceptionEventArgs e) at
    System.Windows.Threading.Dispatcher.CatchException(Exception e) at
    System.Windows.Threading.Dispatcher.CatchExceptionStatic(Object source,
    Exception e) at System.Windows.Threading.ExceptionWrapper.CatchException(Object
    source, Exception e, Delegate catchHandler) 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 PlanIt2.App.Main()

    Thanks!

  5. Milena
    Admin
    Milena avatar
    204 posts

    Posted 04 May 2015 Link to this post

    Hi Math,

    Thank you for the additional information but unfortunately it is not enough to investigate the issue.

    As it is written in the post you referred to, this method  UpdateTabStopOnSelectionFromUI has null checks and it might be an issue in the WPF framework (if it is reproducible with the MS TreeView too).

    So, could you provide us more information about: 
    - how you populate the TreeView;
    - where it is hosted;
    - any other details of your project you think are important and could be connected with this behavior
    Also, if you cannot provide us a project, could you send us a captured video with the exception? It would be helpful.

    I'm looking forward to your reply.

    Regards,
    Milena
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
Back to Top