简体   繁体   English

仅当本地主机上的站点,仅当启用了javascript且仅在IE8模式下时,IE8才会在重新加载时崩溃

[英]IE8 crashing on reload only when site on localhost, only when javascript is enabled, only in IE8 mode

Here are the versions: 这些是版本:

  • IE 8.0.6001.18702 IE 8.0.6001.18702
  • Visual Studio Web Developer 2010 10.0.40219.1.SP1Rel Visual Studio Web开发人员2010 10.0.40219.1.SP1Rel
  • .Net 4.0.30319 SP1Rel .Net 4.0.30319 SP1Rel
  • jQuery 1.6.2 jQuery 1.6.2

When I run the site on localhost through Visual Studio, with IE set to IE8 mode and javascript enabled, the browser will crash when the page is reloaded. 当我通过Visual Studio在localhost上运行站点时,将IE设置为IE8模式并启用了javascript,重新加载页面时浏览器将崩溃。 It doesn't crash when URL is changed or tab/window closed. 更改URL或关闭选项卡/窗口时,它不会崩溃。 The messages I get are: 我收到的消息是:

VS JIT message: VS JIT消息:

An unhandled win32 exception occurred in iexplore.exe [ some PID ]. iexplore.exe [ 某些PID ]中发生未处理的win32异常。

Error when debugging with VS: 使用VS调试时出错:

Unhandled exception at 0x3fa078d8 in iexplore.exe: 0xC0000005: Access violation reading location 0x00000008. iexplore.exe中0x3fa078d8处未处理的异常:0xC0000005:访问冲突读取位置0x00000008。

Call stack location: mshtml.dll!3fa078d8() 调用堆栈位置:mshtml.dll!3fa078d8()

3FA078D8 mov eax,dword ptr [ebx+8] 3FA078D8 mov eax,dword ptr [ebx + 8]

When I cancel out of debugging the page usually loads just fine in the tab. 当我取消调试时,页面通常会在选项卡中正常加载。 Every now and then I'll get the "We were unable to return you to the page you were viewing." 有时我会得到“我们无法使您返回到您正在查看的页面”。 message. 信息。

To make it even more fun, this only happens on the home page of the site, and isn't reproduceable on the DEV server. 为了使它更加有趣,此操作仅在网站的主页上发生,而无法在DEV服务器上复制。 Switching to IE7 mode makes the crashes never occur. 切换到IE7模式将使崩溃永远不会发生。 Or commenting out some of the javascript files loaded at the bottom of the page. 或注释掉页面底部加载的一些javascript文件。

I've tried running IE8 with Addons disabled, and the crashes still happen. 我尝试在禁用插件的情况下运行IE8,并且崩溃仍然发生。 I tried running with Fiddler enabled and it still crashes. 我尝试在启用Fiddler的情况下运行,但仍然崩溃。

I think the crashes may have been related to the use of window.setTimeout() and window.setInterval() since they seem to be the only common functionality used across the different JS files that cause the project to stop crashing when commented out. 我认为崩溃可能与window.setTimeout()window.setInterval()的使用有关,因为它们似乎是跨不同JS文件使用的唯一通用功能,这些功能导致注释掉后项目停止崩溃。 In our global.js I've added this code to use instead: 在我们的global.js中,我添加了以下代码以代替使用:

(function (w) {

    w.windowBind = function (eventName, handler) {
        if (w.attachEvent) {
            w.attachEvent("on" + eventName, handler);
        } else if (w.addEventListener) {
            w.addEventListener(eventName, handler, false);
        } 
    };

    var timeoutsToExpire = [],
        expireTimeouts = function () {
            for (var i = 0, l = timeoutsToExpire.length; i < l; i++) {
                w.clearTimeout(timeoutsToExpire[i]);
            }
            timeoutsToExpire = [];
        },
        intervalsToExpire = [],
        expireIntervals = function () {
            for (var i = 0, l = intervalsToExpire.length; i < l; i++) {
                w.clearInterval(intervalsToExpire[i]);
            }
            intervalsToExpire = [];
        };

    w.setExpiringTimeout = function (func, time) {
        var id = w.setTimeout(func, time);
        timeoutsToExpire.push(id);
        return id;
    };

    w.setExpiringInterval = function (func, time) {
        var id = w.setInterval(func, time);
        intervalsToExpire.push(id);
        return id;
    };

    w.windowBind("unload", function () {
        // expire timers
        expireTimeouts();
        expireIntervals();
    });
    w.windowBind("beforeunload", function () {
        // expire timers
        expireTimeouts();
        expireIntervals();
    });

})(window);

Then I updated the previous window.setTimeout() and window.setInterval() references to use these helpers instead. 然后,我更新了以前的window.setTimeout()window.setInterval()引用,改为使用这些帮助器。 This seems to fix it for now. 这似乎已经解决了。

Update: maybe I posted too soon, it just crashed for me again. 更新:也许我发布得太早了,它又一次崩溃了。 They seem to be very intermittent now though. 他们现在似乎很断断续续。

Update 2: ok, it seems to happen reliably when I shift + refresh now, ugh. 更新2:好的,当我现在转移 + 刷新时,似乎确实发生了,嗯。

Update 3: tried out latest jQuery RC, and the crashes went away, the release notes mention 2 IE8 crashing bugs: http://blog.jquery.com/2011/08/29/jquery-1-6-3-rc1-released/ 更新3:试用了最新的jQuery RC,然后崩溃消失了,发行说明提到了2个IE8崩溃错误: http : //blog.jquery.com/2011/08/29/jquery-1-6-3-rc1-发布/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM