Bug 21306 - JDI client does not tolerate null thread from events
Summary: JDI client does not tolerate null thread from events
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 2.0   Edit
Hardware: Other All
: P3 normal (vote)
Target Milestone: 2.0.1   Edit
Assignee: Darin Swanson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-07-08 10:31 EDT by Jared Burns CLA
Modified: 2002-07-23 15:36 EDT (History)
0 users

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-07-08 10:31:46 EDT
We create a ClassPrepareRequest for java.lang.Error for our "Suspend on
compilation errors" feature. The ClassPrepareEvent comes to us with a
ThreadID of 0, which, according to JDWP spec, means null. We've previously
assumed that an event could never come from a "null" thread. 

However, closer inspection of the JDWP spec yielded the following on the 
topic of the threadID field in a ClassPrepareEvent:
"Preparing thread. In rare cases, this event may occur in a debugger system
thread within the target VM. Debugger threads take precautions to prevent
these events, but they cannot be avoided under some conditions, especially
for some subclasses of java.lang.Error. If the event was generated by a
debugger system thread, the value returned by this method is null, and if
the requested  suspend policy for the event was EVENT_THREAD all threads
will be suspended instead, and the composite event's suspend policy will
reflect this change."

EventSetImpl.resumeThreads() needs to handle a null thread. When the thread 
is null, it should resume the entire VM.
Comment 1 Jared Burns CLA 2002-07-08 10:47:14 EDT
Fixed. Please verify.
Comment 2 Darin Swanson CLA 2002-07-15 15:11:08 EDT
Does this not have to be handled in the case when there is more than one event?
Comment 3 Jared Burns CLA 2002-07-23 15:32:14 EDT
That was an oversight on my part.

I've updated EventSetImpl to resume the entire VM if any event in the set has 
a null thread.

Please verify (Darin W).
Comment 4 Darin Wright CLA 2002-07-23 15:36:44 EDT
Verified. Released change to 2.0.1 (and is in HEAD)