Click to See Complete Forum and Search --> : Close window function producing an invalid page fault (stack dump errors)


Marco Smith
05-07-2003, 02:13 PM
Close window function producing an invalid page fault (stack dump errors) in iexplorer v5.0

The web program launches numerous windows from a menu page.
The menu page stores the data inputted via the various child windows in hidden input controls
Some of the data input windows require data from the menu page controls
All the documents access a number of large javascript js files, plus the javascript within themselves.
In effect there is a great deal of data processing.

The program works correctly.

To prevent script errors in the child windows where the parent menu page has been closed first (by the normal window close x), an onFocus command checks to see if the parent window is closed, and if so the child window is closed.
This works without errors - close the parent and each child window closes the moment it gains focus.

However, ideally a "close all" button is required on the main menu page to close each child window, and itself.
Yet such a function causes the internal errors eg.

IEXPLORE caused an invalid page fault in
module RPCRT4.DLL at 015f:70142d00.
Registers:
EAX=02b6dbf8 CS=015f EIP=70142d00 EFLGS=00010202
EBX=029a9014 SS=0167 ESP=02efee08 EBP=00000000
ECX=00484480 DS=0167 ESI=00484480 FS=1347
EDX=0044e8b4 ES=0167 EDI=004c30b0 GS=0000
Bytes at CS:EIP:
8b 30 ff 56 08 5e c2 04 00 53 56 57 33 db 55 8b
Stack dump:
02b6dbf8 02b4f134 65344f73 00484478 02b4f090 65f07280 02b4f134 8164c350 02b4f090 02b4f094 00000000 029a9014 65f06c96 65f06a60 0000004b fffc234f

During development a timeout command was introduced to aid location of the problem.
Initially in fact, with a 2 second delay, the errors disappeared.
However, later when testing with all windows having been opened, the errors re-appeared.

Here is the close all function:

function close_all(){
if(frs_chk>0){if(frs.closed){}else{window.setTimeout("close_frs()",3000)}}
if(x01_win_chk>0){if(x01_win.closed){}else{window.setTimeout("close_x01()",6000)}}
if(x02_win_chk>0){if(x02_win.closed){}else{window.setTimeout("close_x02()",9000)}}
if(x03_win_chk>0){if(x03_win.closed){}else{window.setTimeout("close_x03()",12000)}}
if(x04_win_chk>0){if(x04_win.closed){}else{window.setTimeout("close_x04()",15000)}}
if(x05_win_chk>0){if(x05_win.closed){}else{window.setTimeout("close_x05()",18000)}}
if(x06_win_chk>0){if(x06_win.closed){}else{window.setTimeout("close_x06()",21000)}}
if(x07_win_chk>0){if(x07_win.closed){}else{window.setTimeout("close_x07()",24000)}}
if(bb_win_chk>0){if(bb_win.closed){}else{window.setTimeout("close_bb()",27000)}}
if(rb_win_chk>0){if(rb_win.closed){}else{window.setTimeout("close_rb()",30000)}}
if(pp_win_chk>0){if(pp_win.closed){}else{window.setTimeout("close_pp()",33000)}}
window.setTimeout("close_menu()",36000);
}

function close_frs(){frs.close()}
function close_x01(){x01_win.close()}
function close_x02(){x02_win.close()}
function close_x03(){x03_win.close()}
function close_x04(){x04_win.close()}
function close_x05(){x05_win.close()}
function close_x06(){x06_win.close()}
function close_x07(){x07_win.close()}
function close_bb(){bb_win.close()}
function close_rb(){rb_win.close()}
function close_pp(){pp_win.close()}
function close_menu(){window.close()}

Note: each win_chk var is set to 1 when opened.

Does anybody out there know why these errors are occurring or at least know of a work around solution to the problem?

JackTheTripper
05-07-2003, 02:40 PM
You said putting a delay in corrected the problem, why not try a shorter delay like .25 sec or 1/2 sec.


I had a script that was continuously running a function and got an error. When I put a delay of even .25 seconds it worked fine and didn't mess up my script.

Marco Smith
05-08-2003, 04:35 AM
Yes, the delay is still there.
I actually increased the delays in stages on the hunch that the errors were due to the flushing of the data from memory.
The function in the 1st post has 3 sec delays for each close.

The problem (I believe) is probably best addressed at a fundamental level, as to 'why closing the windows via a function' produces errors, when closing individually there are none.

I don't know enought about the processes involved in closing the windows, and what is happening to all the associated data.

If I can't get this data (and from it a solution) then perhaps another close function might do the trick.

I though of imitating the manual close (a function to close the parent and then pass focus to each window in turn, but if I remember, as soon as the parent window closes, the function will stop running.

any ideas?

marco