Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 335320 - [tracepoint] NPE when terminating a launch and using the TraceControl view
Summary: [tracepoint] NPE when terminating a launch and using the TraceControl view
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf-gdb (show other bugs)
Version: 8.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 8.0   Edit
Assignee: Marc Khouzam CLA
QA Contact: Marc Khouzam CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-25 09:41 EST by Marc Khouzam CLA
Modified: 2011-05-17 22:23 EDT (History)
2 users (show)

See Also:


Attachments
Guard against NPE (820 bytes, patch)
2011-05-17 22:10 EDT, Marc Khouzam CLA
marc.khouzam: iplog-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Khouzam CLA 2011-01-25 09:41:48 EST
When using the TraceControl view and terminating a launch, the following NPE can occur.

java.lang.NullPointerException
	at org.eclipse.cdt.dsf.gdb.internal.ui.tracepoints.TraceControlView.updateContent(TraceControlView.java:269)
	at org.eclipse.cdt.dsf.gdb.internal.ui.tracepoints.TraceControlView.debugSessionChanged(TraceControlView.java:379)
	at org.eclipse.cdt.dsf.gdb.internal.ui.tracepoints.TraceControlView.setDebugContext(TraceControlView.java:357)
	at org.eclipse.cdt.dsf.gdb.internal.ui.tracepoints.TraceControlView.dispose(TraceControlView.java:211)
	at org.eclipse.ui.internal.WorkbenchPartReference.doDisposePart(WorkbenchPartReference.java:737)
	at org.eclipse.ui.internal.ViewReference.doDisposePart(ViewReference.java:104)
	at org.eclipse.ui.internal.WorkbenchPartReference.dispose(WorkbenchPartReference.java:684)
	at org.eclipse.ui.internal.WorkbenchPage.disposePart(WorkbenchPage.java:1721)
	at org.eclipse.ui.internal.WorkbenchPage.partRemoved(WorkbenchPage.java:1713)
	at org.eclipse.ui.internal.ViewFactory.releaseView(ViewFactory.java:257)
	at org.eclipse.ui.internal.Perspective.dispose(Perspective.java:292)
	at org.eclipse.ui.internal.WorkbenchPage.dispose(WorkbenchPage.java:1792)
	at org.eclipse.ui.internal.WorkbenchWindow.closeAllPages(WorkbenchWindow.java:858)
	at org.eclipse.ui.internal.WorkbenchWindow.hardClose(WorkbenchWindow.java:1693)
	at org.eclipse.ui.internal.WorkbenchWindow.busyClose(WorkbenchWindow.java:739)
	at org.eclipse.ui.internal.WorkbenchWindow.access$0(WorkbenchWindow.java:715)
	at org.eclipse.ui.internal.WorkbenchWindow$5.run(WorkbenchWindow.java:831)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.internal.WorkbenchWindow.close(WorkbenchWindow.java:829)
	at org.eclipse.jface.window.WindowManager.close(WindowManager.java:109)
	at org.eclipse.ui.internal.Workbench$18.run(Workbench.java:1106)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.Workbench.busyClose(Workbench.java:1103)
	at org.eclipse.ui.internal.Workbench.access$15(Workbench.java:1032)
	at org.eclipse.ui.internal.Workbench$25.run(Workbench.java:1276)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.internal.Workbench.close(Workbench.java:1274)
	at org.eclipse.ui.internal.Workbench.close(Workbench.java:1246)
	at org.eclipse.ui.internal.handlers.QuitHandler.execute(QuitHandler.java:41)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
	at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
	at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
	at org.eclipse.ui.internal.actions.CommandAction.runWithEvent(CommandAction.java:157)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3539)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3160)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Comment 1 Marc Khouzam CLA 2011-05-17 16:25:05 EDT
Another way to reproduce:
1- open the TraceControl view
2- start a local debug session with 7.2
3- close the TraceControl view

I saw the NPE at that time.
Comment 2 Marc Khouzam CLA 2011-05-17 22:10:20 EDT
Created attachment 195934 [details]
Guard against NPE

When closing the view, we must protect against the NPE.
Comment 3 Marc Khouzam CLA 2011-05-17 22:10:49 EDT
Committed to HEAD
Comment 4 CDT Genie CLA 2011-05-17 22:23:05 EDT
*** cdt cvs genie on behalf of mkhouzam ***
Bug 335320: NPE when terminating a launch and using the TraceControl view

[*] TraceControlView.java 1.6 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/tracepoints/TraceControlView.java?root=Tools_Project&r1=1.5&r2=1.6