Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 328883 - AbstractCachingVMProvider throws ClassCastException
Summary: AbstractCachingVMProvider throws ClassCastException
Status: VERIFIED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf (show other bugs)
Version: 8.0   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 7.0   Edit
Assignee: Pawel Piech CLA
QA Contact: Pawel Piech CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-27 16:02 EDT by Dobrin Alexiev CLA
Modified: 2011-05-13 11:00 EDT (History)
2 users (show)

See Also:
pawel.1.piech: review? (Randy.Rohrbach)
marc.khouzam: review+


Attachments
Fix. (5.77 KB, patch)
2010-10-28 15:47 EDT, Pawel Piech CLA
cdtdoug: iplog-
Details | Diff
Corrected fix. (7.87 KB, patch)
2010-11-30 17:44 EST, Pawel Piech CLA
cdtdoug: iplog-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dobrin Alexiev CLA 2010-10-27 16:02:01 EDT
Build Identifier: 

I setup my Eclipse workspace against the latest CDT/DFS and I've got the following exception when I start a GDB session using a debug session to Cygwin.

Caused by: java.lang.ClassCastException: org.eclipse.core.runtime.Status
	at org.eclipse.cdt.dsf.ui.viewmodel.update.AbstractCachingVMProvider$7.handleCompleted(AbstractCachingVMProvider.java:1213)
	at org.eclipse.cdt.dsf.concurrent.RequestMonitor$2.run(RequestMonitor.java:291)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
	... 23 more

I noticed that at that moment the exception getStatus() returned 
Status CANCEL: unknown code=1  null

This is the line of the cast: 
PropertiesUpdateStatus missUpdateStatus = (PropertiesUpdateStatus)getStatus();

Reproducible: Always
Comment 1 Pawel Piech CLA 2010-10-28 15:47:01 EDT
Created attachment 181987 [details]
Fix.

Sorry about that.  I should know better than make such an assumption.
Comment 2 Pawel Piech CLA 2010-10-28 15:48:58 EDT
I committed the fix.  Dobrin please verify.
Comment 4 Dobrin Alexiev CLA 2010-10-29 11:19:04 EDT
Thanks Pawel. The exception is gone.
Comment 5 Pawel Piech CLA 2010-11-30 17:44:30 EST
Created attachment 184196 [details]
Corrected fix.

(In reply to bug 321932 comment #11)
> I'm getting an assertion pretty often with this fix.  I'm not sure if it is
> something that DSF-GDB was always doing wrong or if the assert made an wrong
> assumption.
> 
> Any opinion?
> 
> ...
 
The new exception is a side effect of my fix for this bug.  After reviewing the changes a little while I found additional problems my my recent changes.  This patch fixes that and adds a guard against the class cast exception.
Comment 6 Pawel Piech CLA 2010-11-30 17:47:56 EST
I applied the corrected fix.  Randy can you please review my changes.
Comment 7 Pawel Piech CLA 2010-11-30 17:48:36 EST
Marc, can you verify whether the assertion error goes away for you.  Thanks!
Comment 9 Marc Khouzam CLA 2010-12-01 09:03:23 EST
(In reply to comment #7)
> Marc, can you verify whether the assertion error goes away for you.  Thanks!

Seems to be gone.  Thanks for the quick fix!