summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Dumais2013-02-15 09:14:34 (EST)
committer Marc Khouzam2013-06-28 11:35:50 (EDT)
commit010f97a80d2da8a31851bfdfddc2f153c1daf973 (patch)
tree080783512be78f51beee6fc0306a3336cb22e6f2
parent06f0d1af10fcadd00afb196197568d3a576b4df1 (diff)
downloadorg.eclipse.cdt-010f97a80d2da8a31851bfdfddc2f153c1daf973.zip
org.eclipse.cdt-010f97a80d2da8a31851bfdfddc2f153c1daf973.tar.gz
org.eclipse.cdt-010f97a80d2da8a31851bfdfddc2f153c1daf973.tar.bz2
Bug 396269 - [visualizer] NPE in MulticoreVisualizerCanvas.paintCanvas()
Change-Id: Id14d62c18db200c4f71ec3e9afaa6d9a39d5a8f4 Reviewed-on: https://git.eclipse.org/r/9156 Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com> IP-Clean: Marc Khouzam <marc.khouzam@ericsson.com> Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerEventListener.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerEventListener.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerEventListener.java
index d0e71eb..d4af4ca 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerEventListener.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerEventListener.java
@@ -10,6 +10,7 @@
* Marc Dumais (Ericsson) - Bug 400231
* Marc Dumais (Ericsson) - Bug 399419
* Marc Dumais (Ericsson) - Bug 405390
+ * Marc Dumais (Ericsson) - Bug 396269
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.ui.view;
@@ -188,6 +189,14 @@ public class MulticoreVisualizerEventListener {
assert cores.length == 1; // A thread belongs to a single core
int coreId = Integer.parseInt(cores[0]);
VisualizerCore vCore = fVisualizer.getModel().getCore(coreId);
+ // There is a race condition that sometimes happens here. We can reach
+ // here because we were notified that a thread is started, but the model
+ // is not yet completely constructed. If the model doesn't yet contain the
+ // core the thread runs-on, the getCore() call above will return null. This
+ // will later cause a problem when we try to draw this thread, if we allow
+ // this to pass. See Bug 396269/
+ if (vCore == null)
+ return;
int pid = Integer.parseInt(processContext.getProcId());
int tid = execDmc.getThreadId();