jscript match regular expression bug w/ IE 6 SP2

G

Guest

Ever since I upgraded to Windows XP SP2, I started noticing that the
RequiredFieldValidator on a textbox on one of my ASP.Net pages was taking a
REALLY LONG TIME to validate in my IE client! The CPU on my machine was at
100% utilization and after about 30 seconds, I got control back of IE. I
debugged the issue, and this is what I found out! When I paste a fairly large
amount of text into a textbox, (around 350K), the ValidatorTrim(s) inside of
the WebUIValidation.js aspnet_client scripts is called...

function ValidatorTrim(s) {
var m = s.match(/^\s*(\S+(\s+\S+)*)\s*$/);
return (m == null) ? "" : m[1];
}

Using IE 6.0.2900.2180.xpsp_sp2_rtm.040803-2158, the hang was occuring on
the s.match regular expression which is supposed to trim the contents of the
textbox! On my colleague's machine, using Windows XP SP1 (not SP2), this same
function calculates VERY quickly! On machines in our office using Windows XP
SP2, this function takes a VERY long time!!! This is awful! Has the
implementation of Internet Explorer jscript regular expressions changed? Has
Microsoft introduced a bug into jscript/javascript? Any ideas anyone? Help!
 
R

Robert Aldwinckle

aedell said:
Ever since I upgraded to Windows XP SP2, I started noticing that the
RequiredFieldValidator on a textbox on one of my ASP.Net pages was taking a
REALLY LONG TIME to validate in my IE client! The CPU on my machine was at
100% utilization and after about 30 seconds, I got control back of IE. I
debugged the issue, and this is what I found out! When I paste a fairly large
amount of text into a textbox, (around 350K), the ValidatorTrim(s) inside of
the WebUIValidation.js aspnet_client scripts is called...

function ValidatorTrim(s) {
var m = s.match(/^\s*(\S+(\s+\S+)*)\s*$/);
return (m == null) ? "" : m[1];
}

Are you using that inner pattern for anything? If not why have it?
What does it generate in terms of a result array?

Using IE 6.0.2900.2180.xpsp_sp2_rtm.040803-2158, the hang was occuring on
the s.match regular expression which is supposed to trim the contents of the
textbox! On my colleague's machine, using Windows XP SP1 (not SP2), this same
function calculates VERY quickly! On machines in our office using Windows XP
SP2, this function takes a VERY long time!!! This is awful! Has the
implementation of Internet Explorer jscript regular expressions changed? Has
Microsoft introduced a bug into jscript/javascript? Any ideas anyone? Help!

My guess is that something which used to be optimized had to be
redesigned with a less efficient algorithm to avoid leaving a security
exposure. Such is the cost of hacking for the average user...

BTW as you may have realized by now this is not the best newsgroup
for discussing coding issues. ;)


Good luck

Robert Aldwinckle
---
 
G

Guest

Hi Robert,
Are you using that inner pattern for anything? If not why have it?
What does it generate in terms of a result array?

The code is not mine - it's Microsoft's! That jscript function is called
for most validator control's in ASP.Net... Either I modify their code, or
stop using validator controls (which isn't practical).
My guess is that something which used to be optimized had to be
redesigned with a less efficient algorithm to avoid leaving a security
exposure. Such is the cost of hacking for the average user...

I agree. Just this is the first I've seen it reported.
BTW as you may have realized by now this is not the best newsgroup
for discussing coding issues. ;)

I wish I knew an address at Microsoft to report actual bugs and defects
found... We're a Microsoft "partner" yet I don't know of any direct channel
to report this to!

Adam :)

Robert Aldwinckle said:
aedell said:
Ever since I upgraded to Windows XP SP2, I started noticing that the
RequiredFieldValidator on a textbox on one of my ASP.Net pages was taking a
REALLY LONG TIME to validate in my IE client! The CPU on my machine was at
100% utilization and after about 30 seconds, I got control back of IE. I
debugged the issue, and this is what I found out! When I paste a fairly large
amount of text into a textbox, (around 350K), the ValidatorTrim(s) inside of
the WebUIValidation.js aspnet_client scripts is called...

function ValidatorTrim(s) {
var m = s.match(/^\s*(\S+(\s+\S+)*)\s*$/);
return (m == null) ? "" : m[1];
}

Are you using that inner pattern for anything? If not why have it?
What does it generate in terms of a result array?

Using IE 6.0.2900.2180.xpsp_sp2_rtm.040803-2158, the hang was occuring on
the s.match regular expression which is supposed to trim the contents of the
textbox! On my colleague's machine, using Windows XP SP1 (not SP2), this same
function calculates VERY quickly! On machines in our office using Windows XP
SP2, this function takes a VERY long time!!! This is awful! Has the
implementation of Internet Explorer jscript regular expressions changed? Has
Microsoft introduced a bug into jscript/javascript? Any ideas anyone? Help!

My guess is that something which used to be optimized had to be
redesigned with a less efficient algorithm to avoid leaving a security
exposure. Such is the cost of hacking for the average user...

BTW as you may have realized by now this is not the best newsgroup
for discussing coding issues. ;)


Good luck

Robert Aldwinckle
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top