Bug 400231 - [visualizer] NPE in MulticoreVisualizerEventListener.handleEvent(IExitedDMEvent
Summary: [visualizer] NPE in MulticoreVisualizerEventListener.handleEvent(IExitedDMEvent
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf-gdb (show other bugs)
Version: 8.1.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 8.2   Edit
Assignee: Marc Khouzam CLA
QA Contact: Marc Khouzam CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-07 11:11 EST by Marc Dumais CLA
Modified: 2013-03-01 11:31 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Dumais CLA 2013-02-07 11:11:47 EST
I have had the following exception when terminating a debug session with the multicore visualizer open.   I was not able to reproduce it, so it might be caused to a rare race condition.


java.lang.NullPointerException
	at org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.ui.view.MulticoreVisualizerEventListener.handleEvent(MulticoreVisualizerEventListener.java:190)
	at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.cdt.dsf.service.DsfSession.doDispatchEvent(DsfSession.java:519)
	at org.eclipse.cdt.dsf.service.DsfSession.access$2(DsfSession.java:463)
	at org.eclipse.cdt.dsf.service.DsfSession$3.run(DsfSession.java:390)
	at org.eclipse.cdt.dsf.concurrent.DefaultDsfExecutor$TracingWrapperRunnable.run(DefaultDsfExecutor.java:374)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:662)
Comment 1 Marc Dumais CLA 2013-02-11 15:17:56 EST
Proposed patch pushed to gerrit:

https://git.eclipse.org/r/#/c/10290/

In this case, preventing against the NPE seems to be a safe approach: the likely scenario is that the debugging session is being killed and a thread has terminated, triggering the IExitedDMEvent event.   

The NPE happens when we process the event and then attempt to refresh the canvas which has already being disposed.
Comment 2 Marc Dumais CLA 2013-02-11 15:18:06 EST
w/r to the following patch, I declare the following:

1) that I am authorized to submit this code change
2) that the code is 100% my own work
Comment 3 Marc Khouzam CLA 2013-02-12 13:19:34 EST
Thanks Marc, that looks like a good fix.

Please update the copyright header and I will commit it.
Comment 4 Marc Khouzam CLA 2013-02-12 13:27:58 EST
Committed to master.

Thanks!