Page 1 of 1

Stack overflow at line: 0

Posted: Fri Sep 12, 2003 3:47 am
by []InTeR[]
Hi,

I have a weard js problem. For some reason i have a stack overflow.

It's a survey page, it's in dutch. I don't think it's about the questions.
But the same page, with other questions works fine, even more questions.

If i change a little thing like delete or add one random question the page works fine again.

Here is a example page that i build for this problem. The original page is renerated by php.

The error is generated when all js scripts is done.
Page is fully loaded.

It's a neasty one....

Using:
Windows XP (dutch)
Explorer 6.0.2800.1106 SP1

Posted: Sat Sep 13, 2003 2:30 pm
by Vincent Puglia
Hi,

There are numerous reasons for a stack overflow. In your case I would suspect some form of recursion. But, I really can't tell because of the language differences.

What do you mean by
change a little thing like delete or add one random question
Any rate, why aren't you putting these three lines in a function and then passing parameters? Doing so, will cut the number of lines and make debugging easier.

Code: Select all

window.antwoordenї86]ї229] = 'Ja';
window.antwoordenї86]ї230] = 'Nee';
window.antwoordenї86]ї231] = 'Redelijk';
something like:

Code: Select all

fillAntwoorden(86, 229)


function fillAntwoorden(cell1, cell2Start)
{
window.antwoorden[cell1][cell2Start++] = 'Ja';
window.antwoorden[cell1][cell2Start++] = 'Nee';
window.antwoorden[cell1][cell2Start] = 'Redelijk';
}
[\code]

Vinny

Posted: Sat Sep 13, 2003 2:40 pm
by Vincent Puglia
Hi,

Something else you can try:

create dummy stub functions in your *.js files -- one at a time.

function somefunctioninthefile(parmsifnecessary)
{
alert(the parms)
}
and comment out the real function.

It may help isolate the offending code.

Vinny

Posted: Mon Sep 15, 2003 7:39 am
by []InTeR[]
Whe have some pretty deep debugging.
And the script is genareted by PHP so the large array is not a problem of code 'neath'.

The problem repeated itself on a other page, that had a infinityloop.
And that page 'creashes', and won't compute any JScript.

This page, (see top) is still working. And all the javascript is still working.

Posted: Tue Sep 16, 2003 5:24 pm
by Vincent Puglia
Hi,

Sorry, but I just returned from a trip and I'm still somewhat groggy and low on patience -- so, don't take the following personally.
Whe have some pretty deep debugging.
What does this mean? That you can't see the purpose of writing stubs and alerting parms?
And the script is genareted by PHP so the large array is not a problem of code 'neath'
Again, what does this mean? That because PHP wrote the code, it cannot have written so much that the browser has run of space and begun storing data and code willynilly? I, for one, do not know the limits of browsers, but I have run across people whose apps crashed because of bloat.
The problem repeated itself on a other page, that had a infinityloop.
And that page 'creashes', and won't compute any JScript.

And the point is? you are talking about a for (i) or do while (1) loop? That can usually crash any program if left to run without checks.
This page, (see top) is still working. And all the javascript is still working.
If it's working, then what is the problem?

Vinny