Community
Participate
Working Groups
The NPE below happens when closing the Multicore Visualizer view, but apparently only when nothing at that time is selected in the debug view. It seems that the canvas object is null in those cases, and the value is not checked before making an operation on it. java.lang.NullPointerException at org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.ui.view.MulticoreVisualizer.workbenchToVisualizerSelection(MulticoreVisualizer.java:822) at org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.ui.view.MulticoreVisualizer.updateCanvasSelectionInternal(MulticoreVisualizer.java:976) at org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.ui.view.MulticoreVisualizer.updateCanvasSelectionInternal(MulticoreVisualizer.java:969) at org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.ui.view.MulticoreVisualizer$4.run(MulticoreVisualizer.java:961) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
To reproduce, start a debug session with the multicore visualizer open. From the visualizer, control-click any selected object to de-select them. With all objects de-selected, close the visualizer window. It seems that what's happening is a race condition between the visualizer's canvas being disposed and a workbench selection update in the visualizer, trying to access the canvas.
Proposed patch: basically just a null check to avoid the NPE. In context, it doesn't make sense anyway to synchronize the canvas selection when disposing the view, so skipping this when the canvas is null seems to make sense. https://git.eclipse.org/r/13950 w/r to the patch submitted in this bug, I declare the following: 1) that I am authorized to submit this code change 2) that the code is 100% my own work Marc Dumais
Fix submitted through Gerrit.
Committed to cdt_8_2: http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?h=cdt_8_2&id=06f0d1af10fcadd00afb196197568d3a576b4df1
*** cdt git genie on behalf of Marc Dumais *** Bug 409006 - [visualizer] NPE when closing visualizer with nothing selected in debug view Change-Id: If1c7fdbdd08822175e83eebc9fcd51b6bd859aae Reviewed-on: <a href="https://git.eclipse.org/r/13950">https://git.eclipse.org/r/13950</a> Reviewed-by: William Swanson <traveler@xxxxxxxxxx> IP-Clean: William Swanson <traveler@xxxxxxxxxx> Tested-by: William Swanson <traveler@xxxxxxxxxx> [*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=06f0d1af10fcadd00afb196197568d3a576b4df1
Verified in 8.2.1 RC1 (EPP 20130821-2252).