Bug 149358 - [Browser] Browser control can cause workbench crash, machine lock-up
Summary: [Browser] Browser control can cause workbench crash, machine lock-up
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Grant Gayed CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-01 01:32 EDT by David Slubicki CLA
Modified: 2019-09-06 16:07 EDT (History)
2 users (show)

See Also:


Attachments
Plugin for use in recreating this bug (11.75 KB, application/java-archive)
2006-07-01 01:34 EDT, David Slubicki CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Slubicki CLA 2006-07-01 01:32:00 EDT
The following setup consistently causes system lock-up (javaw.exe process taking 99% cpu with memory usage quickly increasing until workbench crash):

- you must be connected to the internet
- in Windows, set the "Machine Debug Manager" service to disabled
- in Internet Explorer make sure the "Disable Script Debugging" option is NOT checked (this is an option on the "Advanced" tab of the "Internet Options" dialog)
- copy the attached plug-in (details below) to your plugins directory and launch eclipse using a new workspace (it is a good idea to have Task Manager visible at this point)
- in the Resource Perspective you should now see a view labeled, "Browser Test" (if not, you can launch it from the "Show View" dialog)
- click the button labeled "Click Me" in the "Browser Test" view
- a dialog will open displaying a license agreement.  click one of the two buttons ("I Agree" or "I Disagree").

You should now notice the stated problem.  You will need to kill eclipse using Task Manager.

Pausing the main thread reveals the following information:

Thread [main] (Suspended)	
	owns: RunnableLock  (id=79)	
	COM.CoFreeUnusedLibraries() line: not available [native method]	
	WebSite(OleClientSite).releaseObjectInterfaces() line: 1065	
	WebSite(OleControlSite).releaseObjectInterfaces() line: 636	
	WebSite(OleClientSite).onDispose(Event) line: 826	
	OleClientSite.access$1(OleClientSite, Event) line: 821	
	OleClientSite$1.handleEvent(Event) line: 125	
	EventTable.sendEvent(Event) line: 66	
	WebSite(Widget).sendEvent(Event) line: 928	
	WebSite(Widget).sendEvent(int, Event, boolean) line: 952	
	WebSite(Widget).sendEvent(int) line: 933	
	WebSite(Widget).release(boolean) line: 743	
	OleFrame(Composite).releaseChildren(boolean) line: 636	
	OleFrame(Widget).release(boolean) line: 746	
	Browser(Composite).releaseChildren(boolean) line: 636	
	Browser(Widget).release(boolean) line: 746	
	Composite.releaseChildren(boolean) line: 636	
	Composite(Widget).release(boolean) line: 746	
	Composite.releaseChildren(boolean) line: 636	
	Composite(Widget).release(boolean) line: 746	
	Shell(Composite).releaseChildren(boolean) line: 636	
	Shell(Canvas).releaseChildren(boolean) line: 117	
	Shell(Decorations).releaseChildren(boolean) line: 722	
	Shell.releaseChildren(boolean) line: 1062	
	Shell(Widget).release(boolean) line: 746	
	Shell(Widget).dispose() line: 415	
	Shell(Decorations).dispose() line: 397	
	Shell.dispose() line: 627	
	LicenseAcceptanceDialog(Window).close() line: 330	
	LicenseAcceptanceDialog(Dialog).close() line: 1014	
	LicenseAcceptanceDialog.close() line: 296	
	LicenseAcceptanceDialog(Dialog).okPressed() line: 973



about the attached plug-in:

I created, and will attach, a test plugin which should make troubleshooting a little easier.  The plugin includes a class which I copied (with slight modification) from the Web Tools project (org.eclipse.wst.internet.cache.internal.LicenseAcceptanceDialog).  This dialog makes use of SWT's browser control.  Also included in this plugin is a very simple view (Browser Test) which is contributed to the Resource Perspective.  This view contains one button which, when clicked, launches the aforementioned dialog.

Please let me know if you need any additional information.

Thanks,
David
Comment 1 David Slubicki CLA 2006-07-01 01:34:10 EDT
Created attachment 45635 [details]
Plugin for use in recreating this bug
Comment 2 Tod Creasey CLA 2007-10-31 13:34:55 EDT
What is the status of this?
Comment 3 Grant Gayed CLA 2007-11-02 12:06:10 EDT
This will be revisited next week.
Comment 4 Grant Gayed CLA 2007-11-07 16:42:42 EST
> set the "Machine Debug Manager" service to disabled

where do I do this?
Comment 5 David Slubicki CLA 2007-11-07 19:39:45 EST
Start -> Settings -> Control Panel -> Administrative Tools -> Services.  "Machine Debug Manager" should be one of the services in the list.  Right-click this entry -> Properties -> Startup type:  set to "Disabled" (and stop the service).
Comment 6 Grant Gayed CLA 2007-11-09 14:51:25 EST
Sorry, I haven't been able to reproduce this because I haven't found a machine here yet that shows the Machine Debug Manager service.  I've found one that has mdm.exe (presumably was installed with Visual Studio), but the service does not appear.  I've tried running the original plug-in in eclipse 3.2.2 with and without mdm.exe running but it doesn't show a problem.  Did you have to do anything to make it appear in your services?

Also, as a useful data point, can you see if replacing the Browser creation code in LicenseAcceptableDialog.createContents(...) with the code below makes the problem go away?  The code below just embeds the control directly with no additional effort, and will give an indication of whether the Browser is doing something wrong or the explorer control could have a problem.

OleControlSite controlSite;
OleFrame frame;
try {
    frame = new OleFrame(licenseTextComposite, SWT.BORDER);
    controlSite = new OleControlSite(frame, SWT.NONE, "Shell.Explorer");
    controlSite.doVerb(OLE.OLEIVERB_INPLACEACTIVATE);
    OleAutomation webBrowser = new OleAutomation(controlSite);
    int[] ids = webBrowser.getIDsOfNames(new String[]{"Navigate", "URL"}); 
    Variant[] rgvarg = new Variant[] {new Variant(licenseURL)};
    int[] rgdispidNamedArgs = new int[]{ids[1]};
    webBrowser.invoke(ids[0], rgvarg, rgdispidNamedArgs);
} catch (SWTError e) {
    System.out.println("Unable to open activeX control");
    return null;
}
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
frame.setLayoutData(gd);
monitor.done();
stackLayout.topControl = frame;
licenseTextComposite.layout();
composite.getDisplay().asyncExec(new Runnable() {
    public void run() {
        agreeButton.setEnabled(true);
    }
});
Comment 7 Eclipse Webmaster CLA 2019-09-06 16:07:50 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.