Bug 18306 - Use safe runnables for listeners and "untrusted" code
Summary: Use safe runnables for listeners and "untrusted" code
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 2.0   Edit
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: 2.1 M5   Edit
Assignee: Darin Swanson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 18896 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-05-30 09:39 EDT by Jared Burns CLA
Modified: 2003-01-25 15:42 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 Jared Burns CLA 2002-05-30 09:39:57 EDT
See Bug 18305. An NPE in the runtime workbench launch configuration prevents 
me from opening the launch configuration dialog.

Whereever possible, the platform launch config support should defend against 
errors in the delegates. An error in one delegate (in this case, PDE) 
shouldn't cripple the platform.
Comment 1 Darin Wright CLA 2002-06-03 16:03:35 EDT
*** Bug 18896 has been marked as a duplicate of this bug. ***
Comment 2 Darin Wright CLA 2002-06-03 17:03:01 EDT
Need to determine if we should guard against other extension points as well.
Comment 3 Darin Wright CLA 2002-06-07 11:41:29 EDT
Propose to use safe runnables when traversing/delegating to "event handlers". 
The pattern in the core and UI seems to be that when delegating to a list of 
handlers, protection should be used such that if one handler "bombs", the rest 
of the handlers get to handle the event.
Comment 4 Darin Wright CLA 2002-06-09 10:34:04 EDT
Ideally, we should guard against the following:

(1) For all extension points that we define, we must guard against failure when 
instantiating an extension. Log the error, and throw out the extension. This 
should not effect other instantiations (extensions) of the same extension point.

(2) Any place we have listener lists, handling callbacks, guard against 
failure, such that if one listener fails, subsequent listeners still receive 
callbacks. This includes:

* IDebugEventFilter
* IDebugEventSetListener
* IExpressionListener
* ILaunchListener
* IJavaBreakpointListener
* IJavaHotCodeReplaceListener
* IVMInstallChangedListener

NOTE: This does not address the problem this bug was logged for. Unclear if we 
should change function at this point.
Comment 5 Darin Wright CLA 2002-06-10 18:43:58 EDT
Our current standpoint on this is to defer. No changes planned for 2.0.
Comment 6 Darin Wright CLA 2002-09-13 11:06:08 EDT
Consider for 2.1
Comment 7 Darin Wright CLA 2003-01-23 12:14:51 EST
Added "bullet proofing" for:
* Debug event filters
* Debug event listeners
* Breakpoint listeners
* Expression listeners
* Launch listeners
* Launch configuration listeners
* Stream monitor listeners
* Java breakpoint listeners

I believe these are the most important. Any others should be opened as new bug 
reports.

Fixed.
Comment 8 Darin Wright CLA 2003-01-23 12:15:13 EST
Please verify, Darin (S).
Comment 9 Darin Swanson CLA 2003-01-23 12:18:40 EST
Marking as fixed.
Comment 10 Darin Swanson CLA 2003-01-25 14:27:41 EST
Shouldn't the JDIDebugPlugin ISafeRunnable's handleException(Throwable) 
methods, log the exception?
Comment 11 Darin Wright CLA 2003-01-25 14:48:36 EST
It's optional - the platform already logs the errors.
Comment 12 Darin Swanson CLA 2003-01-25 15:42:20 EST
Verified code.