Bug 366532 - SharedLibraryManager exception during tear-down
Summary: SharedLibraryManager exception during tear-down
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug (show other bugs)
Version: 8.1.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: cdt-debug-inbox@eclipse.org CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-13 08:52 EST by Andrey Loskutov CLA
Modified: 2020-09-04 15:22 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 Andrey Loskutov CLA 2011-12-13 08:52:35 EST
Build Identifier: 3.7.1 / CDT 8.0.1

We've got this each time our process we debugging right now with CDT is stopped via IDebugTarget.terminate() (there will be an MIStoppedEvent):

org.eclipse.cdt.debug.mi.core.cdi.MI2CDIException: Inferior terminated[]
	at org.eclipse.cdt.debug.mi.core.cdi.SharedLibraryManager.getMIShareds(SharedLibraryManager.java:123)
	at org.eclipse.cdt.debug.mi.core.cdi.SharedLibraryManager.updateState(SharedLibraryManager.java:188)
	at org.eclipse.cdt.debug.mi.core.cdi.SharedLibraryManager.update(SharedLibraryManager.java:136)
	at org.eclipse.cdt.debug.mi.core.cdi.EventManager.processSuspendedEvent(EventManager.java:326)
	at org.eclipse.cdt.debug.mi.core.cdi.EventManager.update(EventManager.java:100)
	at java.util.Observable.notifyObservers(Observable.java:142)
	at org.eclipse.cdt.debug.mi.core.MISession.notifyObservers(MISession.java:791)
	at org.eclipse.cdt.debug.mi.core.EventThread.run(EventThread.java:46)

Reproducible: Always

Steps to Reproduce:
Start a process in CDT debugger, stop it from the code via IDebugTarget.terminate(). You will get an error in the log.

I can fix the issue by adding the if() block below just after the beginning of getMIShareds() method:

MIShared[] getMIShareds(MISession miSession) throws CDIException {
    MIShared[] miLibs = new MIShared[0];
		
    if (miSession.isTerminated() || (miSession.getMIInferior() == null  || miSession.getMIInferior().isTerminated())) {
        return miLibs;
    }