1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

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>
This commit is contained in:
Marc Dumais 2013-02-15 09:14:34 -05:00 committed by Marc Khouzam
parent 94a7ef56dd
commit 0045ca7172

View file

@ -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();