Community
Participate
Working Groups
Created attachment 187037 [details] Fix After the fix to bug 334650, I see the following exception at the end of all the tests. The exception is issued once for every test that was run. It turns out that the JUnit tests never actually need any adapters as created by GdbAdapterFactory during their execution. However, at the very end, when all launches are removed, there is a call to an adapter from PerspectiveManager#launchRemoved. This call happens right before GdbAdapterFactory#launchesRemoved is called, so we actually try to create all the adapters although the launch is being removed. And we get a RejectedExecutionException because the executor is no longer valid. This patch addresses the issue. !ENTRY org.eclipse.debug.core 4 120 2011-01-18 13:48:43.550 !MESSAGE An exception occurred during launch change notification. !STACK 0 java.util.concurrent.RejectedExecutionException at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.reject(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor.schedule(Unknown Source) at org.eclipse.cdt.dsf.concurrent.DefaultDsfExecutor.schedule(DefaultDsfExecutor.java:434) at java.util.concurrent.ScheduledThreadPoolExecutor.execute(Unknown Source) at org.eclipse.cdt.dsf.concurrent.DefaultDsfExecutor.execute(DefaultDsfExecutor.java:458) at org.eclipse.cdt.dsf.debug.ui.sourcelookup.DsfSourceDisplayAdapter.<init>(DsfSourceDisplayAdapter.java:615) at org.eclipse.cdt.dsf.gdb.internal.ui.GdbAdapterFactory$SessionAdapterSet.<init>(GdbAdapterFactory.java:145) at org.eclipse.cdt.dsf.gdb.internal.ui.GdbAdapterFactory.getAdapter(GdbAdapterFactory.java:365) at org.eclipse.core.internal.runtime.AdapterManager.getAdapter(AdapterManager.java:326) at org.eclipse.core.internal.runtime.AdapterManager.loadAdapter(AdapterManager.java:356) at org.eclipse.cdt.dsf.gdb.launching.GdbLaunch.getAdapter(GdbLaunch.java:309) at org.eclipse.debug.internal.ui.launchConfigurations.PerspectiveManager.launchRemoved(PerspectiveManager.java:237) at org.eclipse.debug.internal.core.LaunchManager$LaunchNotifier.run(LaunchManager.java:443) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.debug.internal.core.LaunchManager$LaunchNotifier.notify(LaunchManager.java:428) at org.eclipse.debug.internal.core.LaunchManager.fireUpdate(LaunchManager.java:990) at org.eclipse.debug.internal.core.LaunchManager.removeLaunch(LaunchManager.java:2200) at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager.removeTerminatedLaunches(LaunchConfigurationManager.java:329) at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager.launchAdded(LaunchConfigurationManager.java:315) at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager.startup(LaunchConfigurationManager.java:200) at org.eclipse.debug.internal.ui.DebugUIPlugin.start(DebugUIPlugin.java:524) at [...]
Committed to HEAD. Pawel, can you review this two line change?
*** cdt cvs genie on behalf of mkhouzam *** Bug 334687: Adapters could be created once a DsfSession is invalid [*] GdbAdapterFactory.java 1.18 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/GdbAdapterFactory.java?root=Tools_Project&r1=1.17&r2=1.18
Interesting use case. The fix makes sense though.