Community
Participate
Working Groups
Created attachment 93256 [details] includes sample and error screen We are using OLE support inside Eclipse view. Here we are getting runtime error when trying to close Parent by calling opener.close(); twice or calling opener.focus() after the parent is closed. steps to reproduce: 1.Modify url string (in com.hsbc.xpd.test\src\com\hsbc\xpd\test\views\TestView1.CreatePartControl()) as per the location of page1.html (in OfflineWebContent\WebContent\test\page1.html). 2. run the sample 3. open the perspective in com.hsbc.xpd,test 4. click on open page with JS button in page1.html 5. in child view : click on Close parent twice. 6. in second click in gives runtime error. same is reproducible if you open the page1.html in integrated Browser. error details are attached in the sample
Note, this might not be SWT. It could be the OLE support in the Workbench.
I commented out the WindowClose listener to prevent the parent window from closing and pressed the Close Parent button twice and got the same crash. I'm not sure what opener.close() does?
opener.close()will close the parent if parent exist. All we are doing in addWindowClosingListner is disposing view. So thats should not be a concern when addWindowClosingListner is commented. In case of comment, the IE which is embedded inside the olecontrolsite of the parent view will be closed but parent view will continue to exists. opener.close() call works well in IE7 even on second hit. I believe there is still some java code referencing to parent in COM which is causing a native exception on second hit to close parent IE(parent IE window is already disposed in first hit).
New finding: opener.close() seems to work well even on second click if the page(OfflineWebContent\WebContent\test\page1.html) is opened in Integrated Web Browser in eclipse Version: 3.3.0 Build id: I20070625-1500. However a crash will be observed when viewing the page in Integrated Web Browser in eclipse 3.2 .
If opener.close() works in 3.3 and not 3.2 then you should upgrade to 3.3. I don't think the javascript is correct. You are calling opener.close() when the opener has been closed and disposed. An error is reported in IE and may be this same error is causing the crash through the OLE layer. Sending any messages to a null object, a closed or disposed window will result in unpredictable (bad) results. You should modify your script to include a "opener.closed" check: function closewindow() { if (opener && !opener.closed) opener.close(); } This fixed the problem for me. There's no plan to fix this problem.
Hi Duong, yes we figured the same workarond few days back. Thanks for your time
Hi Duong, Our customer does not have control over the script and may not always be in a position to correct it. So, the workaround is not acceptable to them. We need a fix in eclipse layer to provide to the customer. Just for clarification we are using the following SWT build in our product and we see the failure there swt.version=3.3.1.v3346jPATCH swt.frag.linux.version=3.3.1.v3346i swt.frag.win32.version=3.3.1.207744
Can you tell me which version of IE you have on your machine? I just tried running your example with IE7 and the crash does not happen.
Hi Duoung, My version of IE is 7. As reported previously, the crash is observed only when the HTML inside the view. The page (Page1.html) Works well in IE and integrated browser of eclipse 3.3
Our focus here is to fix it for the crash in eclipse view. Observation in other browsers were just to find a possible workaround which apprently will not work for customer this time.
What I meant was that I ran your example in the Eclipse view with IE7 installed and the crash went away. This could mean that the problem can be caused below SWT by someone trying to access the disposed object.
Yes, As per my understanding thats correct. I believe, there is still soem java code referencing to already disposed parent object. This need to be taken care of and in case of native exception, that should be handled effectively. Correct me if i am wrong.
Reopening the bug
I'm not sure why this bug is reopened. Here are a few reason why I don't think this is an SWT problem: 1) The suggested code: function closewindow() { if (opener && !opener.closed) opener.close(); } is not a work around. If you read any javascript documentation, they all say that you should check that the opener is not null and it is open before you close it. It's standard practice and not a work around. So to me, it's USER ERROR. 2) The problem appears to be fixed in IE7. In IE6, if the opener is null and you try to close it, you'll get an error dialog (try setting the opener to null after you close it and when you try to close again, you'll get an error dialog). However, if the opener is not null but it is closed, it crashes in IE6. IE7 handles both cases and show the user an error dialog when the opener is null or when it is closed. 3) There doesn't appear to be any evidence that the crash is occuring inside SWT code. If you look at the VM crash stack trace, the crash is occurring in mshtml.dll right after the jscript.dll is executed. The SWT code is not even close to where the crash occurred. Stack: [0x00030000,0x00070000), sp=0x0006b650, free space=237k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [mshtml.dll+0xed0cc] C [shdocvw.dll+0x53d9f] C [shdocvw.dll+0x545c3] C [shdocvw.dll+0x565b2] C [mshtml.dll+0x17650c] C [mshtml.dll+0x17681d] C [mshtml.dll+0x176858] C [mshtml.dll+0x1701ab] C [mshtml.dll+0x14ec53] C [mshtml.dll+0xc0bc9] C [mshtml.dll+0x98a63] C [mshtml.dll+0x988ff] C [mshtml.dll+0x988c6] C [mshtml.dll+0x97d1e] C [jscript.dll+0x4acc] ........ about 30 calls earlier ................ C [swt-win32-3439.dll+0x37db] j org.eclipse.swt.internal.win32.OS.DispatchMessageW(Lorg/eclipse/swt/internal/win32/MSG;)I+0 J org.eclipse.swt.widgets.Display.readAndDispatch()Z If you have any other evidence that it's SWT that's causing the crash, I will be glad to look at it.
Suneeta, was it reopened because the work around didn't work for you?
Duong, Thanks for ponting out the scenario in IE6.I didnt try it in IE6 before. As suggetsed by you the crash happens in mshtml.DLL. Steve, as described in notes mail (send to you)Its a customer issue that came to us.
Your bug has been moved to triage, visit http://www.eclipse.org/swt/triage.php for more info.
This is a one-off bulk update. (The last one in the triage migration). Moving bugs from swt-triaged@eclipse to platform-swt-inbox@eclipse.org and adding "triaged" keyword as per new triage process: https://wiki.eclipse.org/SWT/Devel/Triage See Bug 518478 for details. Tag for notification/mail filters: @TriageBulkUpdate
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. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. 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. -- The automated Eclipse Genie.