Decipher Tools Blog

News about all things iOS, especially backup, recovery, and forensics. Upcoming features for Decipher TextMessage, Decipher Backup Repair, Decipher VoiceMail, and Decipher Backup Browser.


SWT StackOverflowError on Windows

Kelly Wilkerson

Categories: development | View Comments

Recently I was chasing down a crash report from a customer on Windows 7. The underlying exception trace is summarized as follows:

java.lang.StackOverflowError
    at org.eclipse.swt.internal.ole.win32.COM.VtblCall(Native Method)
    at org.eclipse.swt.internal.ole.win32.IDispatch.Invoke(Unknown Source)
    at org.eclipse.swt.ole.win32.OleAutomation.invoke(Unknown Source)
    at org.eclipse.swt.ole.win32.OleAutomation.invoke(Unknown Source)
    at org.eclipse.swt.browser.IE.navigate(Unknown Source)
    at org.eclipse.swt.browser.IE.setUrl(Unknown Source)
    at org.eclipse.swt.browser.IE$7.handleEvent(Unknown Source)
    at org.eclipse.swt.ole.win32.OleEventTable.sendEvent(Unknown Source)
    at org.eclipse.swt.ole.win32.OleEventSink.notifyListener(Unknown Source)
    at org.eclipse.swt.ole.win32.OleEventSink.Invoke(Unknown Source)
    at org.eclipse.swt.ole.win32.OleEventSink.access$100(Unknown Source)
    at org.eclipse.swt.ole.win32.OleEventSink$1.method6(Unknown Source)
    at org.eclipse.swt.internal.ole.win32.COMObject.callback6(Unknown Source)
    at org.eclipse.swt.internal.ole.win32.COM.VtblCall(Native Method)
    at org.eclipse.swt.internal.ole.win32.IDispatch.Invoke(Unknown Source)
    at org.eclipse.swt.ole.win32.OleAutomation.invoke(Unknown Source)
    at org.eclipse.swt.ole.win32.OleAutomation.invoke(Unknown Source)
    at org.eclipse.swt.browser.IE.navigate(Unknown Source)
    at org.eclipse.swt.browser.IE.setUrl(Unknown Source)
    at org.eclipse.swt.browser.IE$7.handleEvent(Unknown Source)
    at org.eclipse.swt.ole.win32.OleEventTable.sendEvent(Unknown Source)
    at org.eclipse.swt.ole.win32.OleEventSink.notifyListener(Unknown Source)
    at org.eclipse.swt.ole.win32.OleEventSink.Invoke(Unknown Source)
    at org.eclipse.swt.ole.win32.OleEventSink.access$100(Unknown Source)
    at org.eclipse.swt.ole.win32.OleEventSink$1.method6(Unknown Source)
    at org.eclipse.swt.internal.ole.win32.COMObject.callback6(Unknown Source)
    at org.eclipse.swt.internal.ole.win32.COM.VtblCall(Native Method)
    at org.eclipse.swt.internal.ole.win32.IDispatch.Invoke(Unknown Source)
    at org.eclipse.swt.ole.win32.OleAutomation.invoke(Unknown Source)
    at org.eclipse.swt.ole.win32.OleAutomation.invoke(Unknown Source)
    at org.eclipse.swt.browser.IE.navigate(Unknown Source)
    at org.eclipse.swt.browser.IE.setUrl(Unknown Source)
    at org.eclipse.swt.browser.IE$7.handleEvent(Unknown Source)
    at org.eclipse.swt.ole.win32.OleEventTable.sendEvent(Unknown Source)
    at org.eclipse.swt.ole.win32.OleEventSink.notifyListener(Unknown Source)
    at org.eclipse.swt.ole.win32.OleEventSink.Invoke(Unknown Source)
    at org.eclipse.swt.ole.win32.OleEventSink.access$100(Unknown Source)
    at org.eclipse.swt.ole.win32.OleEventSink$1.method6(Unknown Source)
    at org.eclipse.swt.internal.ole.win32.COMObject.callback6(Unknown Source)
    at org.eclipse.swt.internal.ole.win32.COM.VtblCall(Native Method)
    at org.eclipse.swt.internal.ole.win32.IDispatch.Invoke(Unknown Source)
    at org.eclipse.swt.ole.win32.OleAutomation.invoke(Unknown Source)
    at org.eclipse.swt.ole.win32.OleAutomation.invoke(Unknown Source)
    at org.eclipse.swt.browser.IE.navigate(Unknown Source)
    at org.eclipse.swt.browser.IE.setUrl(Unknown Source)
    (I think you get the idea from here...)

This is also documented on the Eclipse SWT bug tracker as issue 473934.

On this Windows PC, trying to set a URL for a newly-made SWT Browser widget (using Internet Explorer for the browser) caused an infinite recursion, which eventually led to a StackOverflowError:

  1. On the first call to setUrl() on the new browser widget, the IE Browser widget internals first tries setting the url to about:blank to clear up some other issues for new Browser widgets.

  2. That actually ends up failing, since the underlying problem on this Windows computer is that the registry entry specifying the "about" protocol handler is broken.

  3. The IE Browser code checks to see if the current url is set to figure out if it's a new browser widget, and it's not (because the about:blank set failed), so the Browser widget still assumes it needs to do that initial call to set the url to about:blank.

  4. And we're back to number 1 above. Rinse, repeat, stack overflow.

The underlying problem is a configuration issue on this computer. The underlying issue is that the protocol handler registry key for about is incorrect or non-existent, so that initial about:blank url set fails, starting the vicious cycle.

As I post in the SWT bug tracker ticket, the missing registry key at the time I wrote this, which is appropriate for IE 11 is:

[HKEY_CLASSES_ROOT\PROTOCOLS\Handler\about]
"CLSID"="{3050F406-98B5-11CF-BB82-00AA00BDCE0B}"

You should definitely compare on your clean (working) test computer to make sure that key matches what you have, in case it's changed since I wrote this. You can add that key manually to the broken machine if IE 11 is installed and it should fix the issue. Or, you can uninstall IE 11 and reinstall it, which should rewrite the correct registry keys. Uninstalling IE 11 and reinstalling it is a bit of a pain though.