Bug 7804 - Internal VMDisconnected trying to delete event requests after VM is gone
Summary: Internal VMDisconnected trying to delete event requests after VM is gone
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 2.0   Edit
Hardware: PC other
: P1 normal (vote)
Target Milestone: 2.0 M3   Edit
Assignee: Darin Swanson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 6659 7975 466897 467643 467644 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-01-16 14:41 EST by Darin Swanson CLA
Modified: 2015-06-01 06:31 EDT (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 Darin Swanson CLA 2002-01-16 14:41:54 EST
Occurs during shutdown

Log: Wed Jan 16 13:35:55 CST 2002
4 org.eclipse.jdt.debug 120 Internal error logged from JDI Debug: 
com.sun.jdi.VMDisconnectedException: Got IOException from Virtual Machine
	at org.eclipse.jdi.internal.request.EventRequestImpl.disable
(EventRequestImpl.java:173)
	at 
org.eclipse.jdi.internal.request.EventRequestManagerImpl.deleteEventRequest
(EventRequestManagerImpl.java:266)
	at org.eclipse.jdt.internal.debug.core.JavaBreakpoint.removeFromTarget
(JavaBreakpoint.java:473)
	at 
org.eclipse.jdt.internal.debug.core.JDIDebugTarget.removeAllBreakpoints
(JDIDebugTarget.java:1191)
	at org.eclipse.jdt.internal.debug.core.JDIDebugTarget.cleanup
(JDIDebugTarget.java:1163)
	at org.eclipse.jdt.internal.debug.core.JDIDebugTarget.shutdown
(JDIDebugTarget.java:1356)
	at org.eclipse.jdt.internal.debug.core.JDIDebugPlugin.shutdown
(JDIDebugPlugin.java:107)
	at org.eclipse.core.internal.plugins.PluginRegistry$2.run
(PluginRegistry.java:265)
	at org.eclipse.core.internal.runtime.InternalPlatform.run
(InternalPlatform.java:821)
	at org.eclipse.core.internal.plugins.PluginRegistry$1.visit
(PluginRegistry.java:274)
	at org.eclipse.core.internal.plugins.PluginRegistry.accept
(PluginRegistry.java:45)
	at org.eclipse.core.internal.plugins.PluginRegistry.shutdownPlugins
(PluginRegistry.java:277)
	at org.eclipse.core.internal.plugins.PluginRegistry.shutdown
(PluginRegistry.java:252)
	at org.eclipse.core.internal.runtime.InternalPlatform.loaderShutdown
(InternalPlatform.java:532)
	at java.lang.reflect.Method.invoke(Native Method)
	at org.eclipse.core.internal.boot.InternalBootLoader.shutdown
(InternalBootLoader.java:954)
	at org.eclipse.core.internal.boot.InternalBootLoader.run
(InternalBootLoader.java:883)
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:321)
	at SlimLauncher.main(SlimLauncher.java:14)
Comment 1 Jared Burns CLA 2002-01-29 09:00:03 EST
The sequence of events here is as follows:

- JDIDebugTarget#shutdown
- JDIDebugTarget#terminate (sends request to VM)
- JDIDebugTarget#removeBreakpoint
- VM terminates (packet does not reach us yet)
- JavaBreakpoint checks if the VM is terminated (we don't know that it is yet)
and then tries to remove the event request
- We get a VMDisconnectedException and handle it quietly (writing to the log)
- VMDeathEvent arrives
- JDIDebugTarget's state is updated to terminated
Possible fixes include:
- JDIDebugTarget#isTerminated() can return true if isTerminating() is true (this
would negatively affect current logic inside the debug target)
- The isTerminating() method can be promoted to API. Client could then check
this flag as well as isTerminated() and isDisconnected()
- A new "isAvailable()" method could be added to the API. This method would
answer true if the debug target is available to handle requests. This would
allow clients to check only one method. Our implementation could then return
isTerminated() || isTerminating() || isDisconnected() || etc.

I prefer the last option as I think it is what debug target clients want most of
the time. A quick browse of our code base shows that we call (isTerminated() ||
isDisconnected()) all over the place. It would be nice to centralize this logic
to answer the real question, isAvailable().
Comment 2 Darin Wright CLA 2002-01-29 09:26:30 EST
The "client" (i.e. breakpoint) is internal to the implementation - no API is 
required.
Comment 3 Jared Burns CLA 2002-01-29 14:18:04 EST
Implemented isAvailable() method on JDIDebugTarget and updated internal packages
of org.eclipse.jdt.debug to call this method.
Comment 4 Jared Burns CLA 2002-01-29 14:18:16 EST
Please verify.
Comment 5 Darin Swanson CLA 2002-01-31 12:50:24 EST
Verified.
Added targetRequestFailed call in JDIStackFrame#isObsolete()
Comment 6 Jared Burns CLA 2002-02-26 14:25:07 EST
*** Bug 7975 has been marked as a duplicate of this bug. ***
Comment 7 Jared Burns CLA 2002-02-26 14:29:03 EST
*** Bug 6659 has been marked as a duplicate of this bug. ***
Comment 8 Sarika Sinha CLA 2015-05-20 04:00:16 EDT
*** Bug 467643 has been marked as a duplicate of this bug. ***
Comment 9 Sarika Sinha CLA 2015-05-20 04:00:36 EDT
*** Bug 467644 has been marked as a duplicate of this bug. ***
Comment 10 Sarika Sinha CLA 2015-06-01 06:31:33 EDT
*** Bug 466897 has been marked as a duplicate of this bug. ***