Closed Bug 431284 Opened 18 years ago Closed 15 years ago

Javascript string match feature causes firefox to segfault.

Categories

(Firefox :: General, defect)

3.0 Branch
x86
Linux
defect
Not set
critical

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: briggs679, Unassigned)

Details

(Whiteboard: [CLOSEME 2010-09-15])

User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9b5) Gecko/2008041515 Firefox/3.0b5 Build Identifier: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9b5) Gecko/2008041515 Firefox/3.0b5 The following javascript commands will cause firefox to segfault. var linkList = content.document.links; for (var x=0; x < linkList.length; x++){ if (linkList[x].href.match("computer_number=") && linkList[x].target.match("_new")){ var tmpObject = new coreItem(linkList[x].innerHTML); ticketDevices.push(tmpObject); }; }; I fixed the problem with: var linkList = content.document.links; for (var x=0; x < linkList.length; x++){ if (linkList[x].href.indexOf("computer_number=") > -1 && linkList[x].target.indexOf("_new") > -1){ var tmpObject = new coreItem(linkList[x].innerHTML); ticketDevices.push(tmpObject); }; }; So the actual problem is: if (linkList[x].href.match("computer_number=") && linkList[x].target.match("_new")){ In particular the "match" command. If i replace it with "indexOf". Then firefox does not segfult and the expected result happens. The loop is 7465 in length. There is only one link on the page that meets the criteria. Reproducible: Always Steps to Reproduce: 1.run the above loop with > 7500 elements and use the match command to filter out the elements. Actual Results: Firefox will segfult. It will not report anything to the console if you run it from a command prompt. Expected Results: It should have returned an array with one object in it. This is being run from within a add on.
who built your firefox? if it wasn't us, find your vendor and ask them for symbols so you can get a stack trace. if it was us, be sure breakpad is active and working and use about:crashes to get a breakpad incident id.
Reporter, are you still seeing this issue with Firefox 3.6.x or later in safe mode? If not, please close. These links can help you in your testing. http://support.mozilla.com/kb/Safe+Mode http://support.mozilla.com/kb/Managing+profiles
Whiteboard: [CLOSEME 2010-09-15]
Version: unspecified → 3.0 Branch
No reply, INCOMPLETE. Please retest with Firefox 3.6.10 or later and a new profile (http://support.mozilla.com/kb/Managing+profiles). If you continue to see this issue with the newest firefox and a new profile, then please comment on this bug.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.