You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a logged NPE due to viewerInput being null in the constructor of ViewerUpdateMonitor when updating tree elements during Viewer.setInput(null):
// Bug 380288: Catch and log a race condition where the viewer input is null.
if (viewerInput == null) {
DebugUIPlugin.log(newNullPointerException("Input to viewer update should not be null")); //$NON-NLS-1$
}
The problem originally occurred when watching a variable from the Variables view using right click->Watch, which switches from the Variables view to the Expressions view. However, I was able to reproduce the problem on master with several of the tests in org.eclipse.debug.tests.
I expected: neither logged exception nor hit at breakpoint
But got: logged exceptions and multiple hits at breakpoint
Here is some relevant log output
From <workspace>/.metadata/.log
!ENTRY org.eclipse.debug.ui 4 120 2024-08-13 14:55:12.260
!MESSAGE Error logged from Debug UI:
!STACK 0
java.lang.NullPointerException: Input to viewer update should not be null
at org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor.<init>(ViewerUpdateMonitor.java:90)
at org.eclipse.debug.internal.ui.viewers.model.ChildrenUpdate.<init>(ChildrenUpdate.java:45)
at org.eclipse.debug.internal.ui.viewers.model.TreeModelContentProvider.doUpdateElement(TreeModelContentProvider.java:1190)
at org.eclipse.debug.internal.ui.viewers.model.TreeModelContentProvider.updateElement(TreeModelContentProvider.java:1762)
at org.eclipse.jface.viewers.TreeViewer.virtualLazyUpdateWidget(TreeViewer.java:1001)
at org.eclipse.jface.viewers.TreeViewer.lambda$1(TreeViewer.java:260)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:91)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5855)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1617)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1643)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1626)
at org.eclipse.swt.widgets.Tree.checkData(Tree.java:372)
at org.eclipse.swt.widgets.Tree.cellDataProc(Tree.java:304)
at org.eclipse.swt.widgets.Display.cellDataProc(Display.java:995)
at org.eclipse.swt.internal.gtk.GTK.gtk_tree_view_column_cell_set_cell_data(Native Method)
at org.eclipse.swt.widgets.Tree.calculateWidth(Tree.java:443)
at org.eclipse.swt.widgets.Tree.calculateWidth(Tree.java:518)
at org.eclipse.swt.widgets.Tree.setScrollWidth(Tree.java:3917)
at org.eclipse.swt.widgets.Tree.cellDataProc(Tree.java:353)
at org.eclipse.swt.widgets.Display.cellDataProc(Display.java:995)
at org.eclipse.swt.internal.gtk.GTK.gtk_tree_view_column_cell_set_cell_data(Native Method)
at org.eclipse.swt.widgets.Tree.calculateWidth(Tree.java:443)
at org.eclipse.swt.widgets.Tree.calculateWidth(Tree.java:518)
at org.eclipse.swt.widgets.Tree.setScrollWidth(Tree.java:3917)
at org.eclipse.swt.widgets.Tree.cellDataProc(Tree.java:353)
at org.eclipse.swt.widgets.Display.cellDataProc(Display.java:995)
at org.eclipse.swt.internal.gtk.GTK.gtk_tree_store_clear(Native Method)
at org.eclipse.swt.widgets.Tree.removeAll(Tree.java:2989)
at org.eclipse.jface.viewers.TreeViewer.removeAll(TreeViewer.java:289)
at org.eclipse.jface.viewers.AbstractTreeViewer.lambda$1(AbstractTreeViewer.java:1631)
at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1392)
at org.eclipse.jface.viewers.TreeViewer.preservingSelection(TreeViewer.java:367)
at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1353)
at org.eclipse.jface.viewers.AbstractTreeViewer.inputChanged(AbstractTreeViewer.java:1627)
at org.eclipse.debug.internal.ui.viewers.model.InternalTreeModelViewer.inputChanged(InternalTreeModelViewer.java:486)
at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:282)
at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1636)
at org.eclipse.debug.tests.viewer.model.StateTests.testSaveAndRestoreLarge(StateTests.java:1085)
[...]
The text was updated successfully, but these errors were encountered:
The logging was added to find the caller that uses null [1].
So instead of removing the logging the caller that passes null should be fixed. @mx990 can you provide a PR?
There is a logged NPE in the constructor of ViewerUpdateMonitor when
viewerInput is null. This can happen sporadically when updating tree
elements during Viewer.setInput(null).
This commit adds a check to avoid creating children updates when the
viewer input is null.
Fixeseclipse-platform#1500
There is a logged NPE due to
viewerInput
beingnull
in the constructor ofViewerUpdateMonitor
when updating tree elements duringViewer.setInput(null)
:eclipse.platform/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerUpdateMonitor.java
Lines 86 to 91 in b469dee
The problem originally occurred when watching a variable from the Variables view using right click->Watch, which switches from the Variables view to the Expressions view. However, I was able to reproduce the problem on
master
with several of the tests inorg.eclipse.debug.tests
.Steps to reproduce
eclipse.platform/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerUpdateMonitor.java
Line 90 in b469dee
org.eclipse.debug.tests
:org.eclipse.debug.tests.viewer.model.JFaceViewerStateTests
testSaveAndRestoreLarge()
testSaveAndRestorePartialStateLarge()
org.eclipse.debug.tests.viewer.model.JFaceViewerPerformanceTests
testSaveAndRestore()
I expected: neither logged exception nor hit at breakpoint
But got: logged exceptions and multiple hits at breakpoint
Here is some relevant log output
From
<workspace>/.metadata/.log
The text was updated successfully, but these errors were encountered: