Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run Time Error 121

Status
Not open for further replies.

ianb16

Programmer
Nov 8, 2002
17
CA
Could someone help with the following error message:

Error 121: Fatal exception during script execution.
The instruction at "0x004f181b" referenced memory at "0x0214f6ef". The memory could not be written.

I am running procomm 4.8 on a Windows 2000 computer.
Through the procomm scheduler I run a group containing a number of entries to call. Each entry has a script assoctiated with it to run when connected.

This message appeared after the six of eight entries.

Any suggestions?

 
Does the message appear each time you run the set of scripts? Have you tried running just the script associated with the sixth and seventh entry by itself to see if you can isolate the problem? aspect@aspectscripting.com
 
I have run the scripts individually and as a group within procomm.

So far this message has only appeared when running the Group through procomm scheduler.
 
Did the error only occur once when running the group through the scheduler, or does it happen every time?

One thing you might want to consider is using the Windows scheduler instead of Procomm's. I have seen some people have problems with Procomm's scheduler that are resolved when running the Windows one instead.
aspect@aspectscripting.com
 
It happened on another workstation once. On this workstation it seems to be happening everytime.

I am testing it right now with the windows scheduler.

Will update with results later.
 
I received the same error with the windows scheduler.

I do not receive this for other Groups I dial into.

Any suggestions.

Further Info:
The one group with the error is a different type a script because of a different system.
 
Can you post the script (sixth and seventh one I suppose)? Can't really go any further without seeing what you are doing. Also, what version of Procomm are you running?
aspect@aspectscripting.com
 
Hi Knob,

Version 4.8

I have been trying other system settings etc to bypass this error, but it seems to be consistent within that dialing group. I will post the code for one entry in that group (they are all basically the same):

;ABC.WAS
;Script for Downloading data from ABC Company
;
string st_date, end_date, sts_date
string savename, repname, acctname
integer foundrep, numex, serv_reps, sales_reps, rep_no
integer dtype=1
string comp="ABC"

#include "datesa.inc"
#include "captset.inc"
#include "adpfunc.inc"
#include "gen_func.inc"

proc main
string reps[15], saves[15], acct[15]
string name, pass
integer tot_rep

call set_capt ; set capture defaults
call set_date with &st_date, &end_date, &sts_date

serv_reps = 3
sales_reps = 2

reps[1] = "REPORT 1"
reps[2] = "REPORT 2"
reps[3] = "REPORT 3"
reps[4] = "REPORT 4"
reps[5] = "REPORT 5"
reps[6] = ""
reps[7] = ""
reps[8] = ""
reps[9] = ""
reps[10] = ""
reps[11] = ""
reps[12] = ""
reps[13] = ""

saves[1] = "REPORT1.DMP"
saves[2] = "REPORT2.DMP"
saves[3] = "REPORT3.DMP"
saves[4] = "REPORT4.DMP"
saves[5] = "REPORT5.DMP"
saves[6] = ""
saves[7] = ""
saves[8] = ""
saves[9] = ""
saves[10] = ""
saves[11] = ""
saves[12] = ""
saves[13] = ""

acct[1] = "ABC-S"
acct[2] = "ABC-S"
acct[3] = "ABC-S"
acct[4] = "ABC-S"
acct[5] = "ABC-FI"
acct[6] = ""
acct[7] = ""
acct[8] = ""
acct[9] = ""
acct[10] = ""
acct[11] = ""
acct[12] = ""
acct[13] = ""

name = "abc123"
pass = "xyz987"

;login
call login with name, pass

; reports

rep_no=0
tot_rep=serv_reps+sales_reps
while rep_no < tot_rep
rep_no=rep_no+1
repname=reps[rep_no]
savename=saves[rep_no]
acctname=acct[rep_no]
call scanrep
endwhile

;exit

pause 2
transmit &quot;^[OR&quot; ;F3
waitfor &quot;Function&quot;
transmit &quot;^[OR&quot; ;F3
pause 2
disconnect

endproc

;
; Dates.inc
; This is where to set the dates for extraction
;
proc set_date

param string st_date, end_date, sts_date

string Fname=&quot;datesA.txt&quot;
string lineinfo

if fopen 0 Fname READ
fread 0 lineinfo 255
substr st_date lineinfo 0 7
substr end_date lineinfo 8 7
substr sts_date lineinfo 16 7
fclose 0
else
errormsg &quot;Can't open for input.&quot; Fname
endif

endproc

;
; captset.inc
; Capture settings for download
;
proc set_capt

set capture path &quot;c:\download&quot;
set capture overwrite ON
set capture recordmode FILTERED
set capture autostart off
capture off

endproc

; General Type Functions
;
; Enters is for sending a specified number of enter's
;
proc enters

param integer times

integer i

for i = 1 upto times
transmit &quot;^M&quot;
endfor
endproc

proc movedown

param integer times

integer i

for i = 1 upto times
transmit &quot;^[[B&quot;
endfor
endproc

proc moveup

param integer times

integer i

for i = 1 upto times
transmit &quot;^[[A&quot;
endfor
endproc

proc moveleft

param integer times

integer i

for i = 1 upto times
transmit &quot;^[[D&quot;
endfor
endproc

proc moveright

param integer times

integer i

for i = 1 upto times
transmit &quot;^[[C&quot;
endfor
endproc

proc errorrep

param string report

string errorlog=&quot;c:\download\errorlog.txt&quot;
string errdate, errtime

fopen 1 errorlog APPEND TEXT
if success
errdate=$DATE
errtime=$TIME
fputs 1 &quot;&quot;
fstrfmt 1 &quot;Error on report - %s - %s at %s %s&quot; comp, report, errdate, errtime
endif
fclose 1
disconnect
clear
halt
endproc

proc errorlog

string errorlog=&quot;c:\download\errorlog.txt&quot;
string errdate, errtime

fopen 1 errorlog APPEND TEXT
if success
errdate=$DATE
errtime=$TIME
fputs 1 &quot;&quot;
fstrfmt 1 &quot;Error logging in for %s at %s %s&quot; comp, errdate, errtime
endif
fclose 1
disconnect
clear
halt
endproc

; Functions to be used for XYZ Dealers
;
; scanrep is to look for the report to run
;
proc scanrep

string checkname

integer pass=0
pause 2
call moveup with 1
transmit acctname
call enters with 1
pause 1
transmit &quot;RPG&quot;
call enters with 1
pause 2
transmit &quot;^[OR&quot; ;F3

foundrep=0
numex=0

waitfor &quot;<EXIT>&quot;

if failure
call errorrep with repname
endif

pause 3

call movedown with 1
rget checkname 36
PAUSE 5
while 1

if foundrep
exitwhile
endif

if numex
call enters with 1
exitwhile
endif

call movedown with 2
call moveup with 1
rget checkname 36
PAUSE 1
if strfind checkname repname
call moveup with 1
call runrep
endif
if strfind checkname &quot;<EXIT>&quot;
call foundex
endif
endwhile
endproc


;
; runrep runs the report
;
proc runrep
string start_d

if rep_no<=serv_reps
start_d=st_date
else
start_d=sts_date
endif

call enters with 1
waitfor &quot;OPIES&quot;
if failure
call errorrep with repname
endif
pause 3

transmit &quot;R&quot;
call enters with 1
set capture file savename

waitfor &quot;Terminal&quot;

if failure
call errorrep with repname
endif

transmit &quot;1&quot;
call enters with 1
capture on


if rep_no!=3
waitfor &quot;GREATER&quot;
if failure
call errorrep with repname
endif
transmit start_d
call enters with 1
endif

if rep_no!=3
waitfor &quot;LESS THAN&quot;
if failure
call errorrep with repname
endif
transmit end_date
call enters with 1
endif

when TARGET 0 &quot;Key any key to continue: &quot; call runrep2
when QUIET 300 call stalled
while $CARRIER ; Loop while connected.
yield ; Release ASPECT process time
if foundrep
exitwhile
endif
endwhile
endproc

; waitfor &quot;Key any key to continue: &quot; 7200

; check for error report
; if failure
; call errorrep with repname
; endif

proc stalled
call errorrep with repname
when clear
endproc

proc runrep2
capture off
call enters with 1

waitfor &quot;OPIES&quot;
if failure
call errorrep with repname
endif

transmit &quot;E&quot;

call enters with 1
pause 1
call enters with 1
foundrep = 1
when clear
endproc

;
; foundex increments the numex when exit is found
;

proc foundex
numex=numex+1
endproc

proc login
param string name, pass

switch dtype ; Find value of numeric variable
case 0 ; and display corresponding
call enters with 1
waitfor &quot;login:&quot;
transmit name
call enters with 1
endcase
case 1
call enters with 1
waitfor &quot;ACCOUNT NAME:&quot;
transmit name
call enters with 1
endcase
endswitch

waitfor &quot;Password:&quot;
if failure
call errorlog
endif

transmit pass
call enters with 1

waitfor &quot;Press any key to continue.&quot; 15
if success
call enters with 1
endif


; check for error logging in

waitfor &quot;login:&quot; 10

if success
call errorlog
endif

endproc





 
I didn't really see anything that jumped out at me when looking over your script, although I didn't have the include files to look through (does the script access any declarations from those files?). One thing you might want to try is adding some debugging code to the procedures, such as usermsg &quot;entering procedure xyz&quot;, &quot;exiting procedure abc&quot;, etc. or writing the script status to a text file, although I would recommend against doing that since it could change the flow of the script. Hopefully adding the usermsg commands will help us track down the procedure that the crash is occurring in and we can troubleshoot it from there.
aspect@aspectscripting.com
 
The code I posted included the &quot;include&quot; files:
captset.inc, genfunc.inc, adpfunc.inc etc.

I will try your suggestion, but here is some additional info:

- Instead of error 121 I get the message PW5.EXE application error.
The instruction at 0x77fcbee8 referenced at 0x0000000d. The memory could not be read.

- I broke the group of 8 ADP entries into two groups of four. Last night I received the above error message in the last entry of the first group.

- On the symantec site there is a documentid: 1998120111265526, dealing with error 121.

------------------------------------------------------------
Error: &quot;ASPECT error 121: Fatal exception during script execution&quot; when running an ASPECT script

Situation:
When you launch an ASPECT script, you see the following error message: &quot;ASPECT error 121: Fatal exception during script execution.&quot; When you close the error message, you may see the following error message: &quot;Error 107, Invalid Data Type Encountered.&quot;
This error is not documented in the manual or in the online script reference.

Solution:
If ASPECT attempts to push a pointer onto the run-time stack and stack re-allocation occurs (if the stack moves from one memory location to another), and the pointer points to data on the current stack, then the pointer may become invalid with the new stack. This results in &quot;Error 121: Fatal exception during script execution.&quot; This is most likely to occur during several dozen recursions of a small procedure since the required stack size grows quickly.

The resolution is to create a big enough memory block for the ASPECT stack so that it never has to be re-allocated. Use the following procedure as the first procedure in the script to claim enough memory to stop reallocation of the ASPECT memory block. This will also prevent the error from occurring.

proc main ; put proc growstack in your script as the first procedure
growstack(50) ; it will grow ASPECT's run-time stack to 60K bytes

(the rest of your script)

.endproc

proc growstack
param integer kbytes
string locstrs[4] ; approximately 1K stack required
if kbytes
growstack(kbytes - 1) ; 60 recursions result in a 60 K ASPECT memory block.
endif
endproc
------------------------------------------------------------

I tried the code before but this was for a previous version of procomm. Would the memalloc function work? or am I heading down the wron road.

- Lastly could there be a corrupt .dir or .prm file?

Please let me know if this additional info helps. Otherwise I am still working through the mess.

Ian

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top