IE9 crashes with Stackhash error

1 post / 0 new
Anders
Anders's picture
IE9 crashes with Stackhash error

Some versions of IE9 fails completely on some large server callbacks (eg. Actiontab update parameters or dashboard export).
There is no clear reason why this happens. The error says Stackhash error and is basically IE that tries to access a section of the memory that it is not allowed to read...
This is not a error in the AnalyzePRO code itself. The browser crashes on a regular expression parsing for no apparent reason.

This issue is reported on IE9 and APRO 5.1.1 but can probably occur on other AnalyzePRO versions as well.

Since there is no real bug in the AnalyzePRO code it is quite hard to fix "the faulting code" but I found out that we can rewrite the code a bit for IE9 which is not the best way performance-wise but the crash-situation disappears apparently:

1) For this fix to work you need to set the application in debug mode: set "fw_debug" to "true" in the web.config file.

2) Open the file [APRO-virtual-dir]\Common\Scripts\jquery\jquery.serviceproxy.js in a text editor

3) Insert the following code at line 43 (below the large comment section and before "var json..." line):

        /*

            Hack to fix IE9 stackhash issue on datetime to MSAJAX date conversion

            This hack will only be executed on IE9 browsers

            2014-09-26: Anders Retterås

        */

        if($.browser.msie && $.browser.version < 10){

            // Disable WCF date conversion

            _I.isWcf = false;


            // Create callback function to convert DATETIME to MSDATE before serialization

            var ie9workaround = function(params){


                // Loop all parameters

                for (var key in params) {

                  if (params.hasOwnProperty(key)) {                    

                    if(typeof params[key] == "object"){


                        // This parameter is a object, loop all parameters on object

                        params[key] = ie9workaround(params[key]);

                    }else if(typeof params[key] == "string"){


                        // This is a string value, check if the string is DATETIME formatted

                        var a = reISO.exec(params[key]);

                        if (a) {                    

                            params[key] = '/Date(' + new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4], +a[5], +a[6])).getTime() + ')/';

                        }


                    }

                  }

                }


                // Entire object is checked, return

                return params;

            };


            // Check if object contains DATETIMEs and convert them

            params = ie9workaround(params);

        }
 
4) Save the file and test.
 
This fix will be included in the next version of AnalyzePRO (all versions after 5.1.1).
 
Regards,
Anders Retterås