Alan Adams
2020-07-30 10:32:23 UTC
[Posted and mailed]
I have a weird problem. A routine which is called successfully hundreds of
times, always from the same place in the code, fails when one of the
passed parameters is not defined. However a call to *reporrtstack from
within the failing routine shows that the variable is being passed in.
My initial reaction was to increase the wimp slot, because this occurs
when a variable in increased, so I have a pretty strong suspicion that
memory is being corrupted somewhere. I don't know where to look though.
What can undefine a variable in this way?
The called function:
DEF PROCFD_SET(n%,p%)
IF DEBUG%AND1 THEN
*report SL: fd_set: n% p% (n% DIV 32) (n% MOD 32)
*REPORTSTACK
ENDIF
p%!((n% DIV 32)*4) = p%!((n% DIV 32)*4) OR (1<<(n% MOD 32))
ENDPROC
The reporter result
SL: fd_set: n%=14 p% (n% DIV 32)=0 (n% MOD 32)=14
BASIC Stack
315 REPEAT
326 PROCreturn13(&00074AC0)
813 PROCnull(&00074AC0)
582 PROCcheckincoming
737 FOR Integer=0 [TO 28 STEP 1]
794 PROCdespatch(0)
1081 WHILE dataend%(client%*2)<>datastart%(client%*2)
1137 PROCsavegates_exec(0)
3122 PROCsendmessage("",0)
3886 PROCsendbuffer(1)
661 PROCFD_SET(14,&00092390) [in "Libraries.Slalom_Comms_Lib"]
11:23:43.17 ** BASICError ** ERR=4 Mistake ERL=435 [in
"Libraries.SocketLib"]
Memory: Prog=153,797 Vars=973,436 Free=146,820 Stack=56 Undefined=0
Slot=1248K
I have a weird problem. A routine which is called successfully hundreds of
times, always from the same place in the code, fails when one of the
passed parameters is not defined. However a call to *reporrtstack from
within the failing routine shows that the variable is being passed in.
My initial reaction was to increase the wimp slot, because this occurs
when a variable in increased, so I have a pretty strong suspicion that
memory is being corrupted somewhere. I don't know where to look though.
What can undefine a variable in this way?
The called function:
DEF PROCFD_SET(n%,p%)
IF DEBUG%AND1 THEN
*report SL: fd_set: n% p% (n% DIV 32) (n% MOD 32)
*REPORTSTACK
ENDIF
p%!((n% DIV 32)*4) = p%!((n% DIV 32)*4) OR (1<<(n% MOD 32))
ENDPROC
The reporter result
SL: fd_set: n%=14 p% (n% DIV 32)=0 (n% MOD 32)=14
BASIC Stack
315 REPEAT
326 PROCreturn13(&00074AC0)
813 PROCnull(&00074AC0)
582 PROCcheckincoming
737 FOR Integer=0 [TO 28 STEP 1]
794 PROCdespatch(0)
1081 WHILE dataend%(client%*2)<>datastart%(client%*2)
1137 PROCsavegates_exec(0)
3122 PROCsendmessage("",0)
3886 PROCsendbuffer(1)
661 PROCFD_SET(14,&00092390) [in "Libraries.Slalom_Comms_Lib"]
11:23:43.17 ** BASICError ** ERR=4 Mistake ERL=435 [in
"Libraries.SocketLib"]
Memory: Prog=153,797 Vars=973,436 Free=146,820 Stack=56 Undefined=0
Slot=1248K
--
Alan Adams, from Northamptonshire
***@adamshome.org.uk
http://www.nckc.org.uk/
Alan Adams, from Northamptonshire
***@adamshome.org.uk
http://www.nckc.org.uk/