ICEfaces
  1. ICEfaces
  2. ICE-7161

Get Javascript Stack Overflow error when unloading a page in IE8

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: EE-1.8.2.GA_P03
    • Fix Version/s: None
    • Component/s: Bridge
    • Labels:
      None
    • Environment:
      Linux
      Java 6

      Description

      Our application has a link which logs the user out of the application. In IE8 (not in Firefox or IE9 for that matter), after the application has been used after a time, clicking on the logout link displays a Javascript error: Stack overflow at line 4

      It doesn't happen all the time, but we've got one path through our application which does this everytime using IE8.

        Activity

        Hide
        Ed Hillmann added a comment - - edited

        I've debugged this, and (from what I can tell) this is caused by an error in the protoype javascript library. This is what I did.

        I changed ICEfaces, so I used the uncompressed version of the Javascript Bridge. When I did that, the error message changed to "Stack overflow at line 1306".

        Using IE8's Developer Tools, I saw that the line 1306 in question was in ice-extras.js. I was able to debug the javascript, and saw that the particular call was in the _destroyCache method which is attached to the window's onunloadevent when using IE.

        The function in error is the stopObserving method. It is looping through all the events for the element, and assuming that the responder has non-null handler references. The bug is caused by IE8 setting the handler reference in a responder for the "load" event to null. The infinite loop is caused because the stopObserving doesn't check for null handlers before calling back into itself.

        I have a patch to the apporpriate file, which I will submit in a second. Technically, this is more a prototype bug which ICEfaces has inherited (if I updated my app to use 1.8.2 EE P02, I didn't get this error). But I'll submit the fix back to you, and let you hash it out with prototype.

        Show
        Ed Hillmann added a comment - - edited I've debugged this, and (from what I can tell) this is caused by an error in the protoype javascript library. This is what I did. I changed ICEfaces, so I used the uncompressed version of the Javascript Bridge. When I did that, the error message changed to "Stack overflow at line 1306". Using IE8's Developer Tools, I saw that the line 1306 in question was in ice-extras.js. I was able to debug the javascript, and saw that the particular call was in the _destroyCache method which is attached to the window's onunloadevent when using IE. The function in error is the stopObserving method. It is looping through all the events for the element, and assuming that the responder has non-null handler references. The bug is caused by IE8 setting the handler reference in a responder for the "load" event to null. The infinite loop is caused because the stopObserving doesn't check for null handlers before calling back into itself. I have a patch to the apporpriate file, which I will submit in a second. Technically, this is more a prototype bug which ICEfaces has inherited (if I updated my app to use 1.8.2 EE P02, I didn't get this error). But I'll submit the fix back to you, and let you hash it out with prototype.
        Hide
        Ed Hillmann added a comment -

        Checking for null handler for each responder. Alow calling back into stopObserving if responder.handler is not null.

        Added a similar check for eventName, just to be thorough.

        Show
        Ed Hillmann added a comment - Checking for null handler for each responder. Alow calling back into stopObserving if responder.handler is not null. Added a similar check for eventName, just to be thorough.

          People

          • Assignee:
            Unassigned
            Reporter:
            Ed Hillmann
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: