Status: Unconfirmed
Owner: [email protected]
Labels: Type-Bug Pri-2 OS-All Area-Misc

New issue 6918 by [email protected]: array.sort() produces Aw Snap error when  
array length>5000
http://code.google.com/p/chromium/issues/detail?id=6918

Chrome Version  1.0.154.43     : <REPLACE this with your version. Ex:
0.3.154.3>
URLs (if applicable) :
Other browsers tested:
   Add OK or FAIL after other browsers where you have tested this issue:
      Safari 3: OK
     Firefox 3:
          IE 7: OK
    Opera 9.51: OK

What steps will reproduce the problem?
1. Create simple (6-line) Javascript program that prompts for number, fills
array with that many elements, and sorts it. (program included below)
2. Run it, and enter 5000.  Program works.
3. Run it, and enter 5001 or any higher number.

What is the expected result?

Program should run to completion and should produce "Done" message.
What happens instead?

"Aw Snap" error consistently appears when any number exceeding 5000 is
entered.
.
Please provide any additional information below. Attach a screenshot if
possible.
==================================

<script language=javascript>
// simplest-case error.  If I remove any of the items (array population,
// prompting for number instead of hard-coding it), the program doesn't
// crash.
function testsort(n) {
     n=1*n;
     var numbers=new Array(n);

     for (var i=0;i<n;i++) numbers[i]=i;
     numbers.sort();  // this crashes when n>5000.
}

</script>

<form>
<input type=text name=N><input type=button onclick='testsort(N.value);'>
</form>




--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/group/chromium-bugs
-~----------~----~----~----~------~----~------~--~---

Reply via email to