hello folks,
On large system running hundreds of users on the same application, very often I am faced with uniBASIC runtime errors in generic subroutines for which I do not have the source codes.
Most of the time the problem is due to badly initialized variable by the calling program.
The difficulty lies in identifying the calling program, knowing that errlog refers to the subroutine without showing the callstack.
Does anyone have any idea how to capture the callstack and determine which program to fix?
Here some samples from errlog :
Bad data “14/0/21” for conversion “D2-”. Unconverted data used for selection.
Program “SB.EVAL.EXP”: Line 276, Variable “$R95” previously undefined. Empty string used
Program “SB.GEN.DRIV.I”: Line 548, Nonnumeric data when numeric required. Zero used.
Program “SB.EVAL.EXP”: Line 121, Nonnumeric data when numeric required. Zero used
Manu,
There is no native way to do this in Basic simply. As you are using SB then starting at SB 6.3 there is a new SB Common Variable called 'USER.DEBUG' which may well provide you with a route of what you want to do.
USER.DEBUG is the name of the user-defined debug program. When activated, this program is called before and after every call to a process or program within SB.
The Parameters passed are:
▪ The name of the calling process
▪ The type of call (process or program)
▪ A Before/After flag
For more information on the USER.DEBUG variable please refer to the SB documentation. For reference The call stack is available in SYSTEM(9001) in UniVerse and SYSTEM(49) in UniData.
Thanks,
Jonathan
hello folks,
On large system running hundreds of users on the same application, very often I am faced with uniBASIC runtime errors in generic subroutines for which I do not have the source codes.
Most of the time the problem is due to badly initialized variable by the calling program.
The difficulty lies in identifying the calling program, knowing that errlog refers to the subroutine without showing the callstack.
Does anyone have any idea how to capture the callstack and determine which program to fix?
Here some samples from errlog :
Bad data “14/0/21” for conversion “D2-”. Unconverted data used for selection.
Program “SB.EVAL.EXP”: Line 276, Variable “$R95” previously undefined. Empty string used
Program “SB.GEN.DRIV.I”: Line 548, Nonnumeric data when numeric required. Zero used.
Program “SB.EVAL.EXP”: Line 121, Nonnumeric data when numeric required. Zero used
We were getting these and the system is not much help at telling where they come from, what actually caused them etc.so I knocked together a quick and dirty routine to do numeric checks on a file's attribute. The user name was a general guide to what file could be suspect and the program has highlighted where people have been uploading incorrect data so we could stop it. It can also be caused by programmers using the wrong information in what should be a numeric field. Including comments ithe program is only 44 lines long and is run at TCL, it could be a lot better but it does the job and helped us stop some silly mistakes that meant the errlog was getting filled with the sort of noise you are getting.
hello folks,
On large system running hundreds of users on the same application, very often I am faced with uniBASIC runtime errors in generic subroutines for which I do not have the source codes.
Most of the time the problem is due to badly initialized variable by the calling program.
The difficulty lies in identifying the calling program, knowing that errlog refers to the subroutine without showing the callstack.
Does anyone have any idea how to capture the callstack and determine which program to fix?
Here some samples from errlog :
Bad data “14/0/21” for conversion “D2-”. Unconverted data used for selection.
Program “SB.EVAL.EXP”: Line 276, Variable “$R95” previously undefined. Empty string used
Program “SB.GEN.DRIV.I”: Line 548, Nonnumeric data when numeric required. Zero used.
Program “SB.EVAL.EXP”: Line 121, Nonnumeric data when numeric required. Zero used
SYSTEM(9001) returns the call stack.
RAID "T" command shows it.
PORT.STATUS LAYER.STACK can show it on another system.
All of those require you to catch it or pause the offending program at point of failure.
I have my own error logging subroutine that I can call from inside any program. It captures:
- SYSTEM(9001),
- @variables, pid
- stuff from our ap's common, &
- has inargs to capture anything specific to the particular call.
Then it writes to a type-19 file that I can query later.
It has proven useful.
In the past I've suggested an enhancement to include the callstack in uv/errlog but it's never gotten any traction. I think I'll do the same in this forum & see if other like the idea.
hello folks,
On large system running hundreds of users on the same application, very often I am faced with uniBASIC runtime errors in generic subroutines for which I do not have the source codes.
Most of the time the problem is due to badly initialized variable by the calling program.
The difficulty lies in identifying the calling program, knowing that errlog refers to the subroutine without showing the callstack.
Does anyone have any idea how to capture the callstack and determine which program to fix?
Here some samples from errlog :
Bad data “14/0/21” for conversion “D2-”. Unconverted data used for selection.
Program “SB.EVAL.EXP”: Line 276, Variable “$R95” previously undefined. Empty string used
Program “SB.GEN.DRIV.I”: Line 548, Nonnumeric data when numeric required. Zero used.
Program “SB.EVAL.EXP”: Line 121, Nonnumeric data when numeric required. Zero used
Hi Chuck, Hi Jonathan,
Thanks for your help.
Yes, I known USER.DEBUG or SYSTEM(9001) etc ... but I have no idea where / when the error occurs. thousend of programs and millions of calls of theses subr .
I'v tried to add some 'user defined' userexit to 'oconv' the error message prepared for log entry errlog but with no success.
Yes chuck, the call stack into errlog is a solution or a global subr declaration to 'prepare a message into errrlog' ...
It's really sad the U2 basic do not have call-trace catching capabilities.
I suppose U2 dev engeneer never have to maintain old progs with no sources...
Let's hope occurs.
hello folks,
On large system running hundreds of users on the same application, very often I am faced with uniBASIC runtime errors in generic subroutines for which I do not have the source codes.
Most of the time the problem is due to badly initialized variable by the calling program.
The difficulty lies in identifying the calling program, knowing that errlog refers to the subroutine without showing the callstack.
Does anyone have any idea how to capture the callstack and determine which program to fix?
Here some samples from errlog :
Bad data “14/0/21” for conversion “D2-”. Unconverted data used for selection.
Program “SB.EVAL.EXP”: Line 276, Variable “$R95” previously undefined. Empty string used
Program “SB.GEN.DRIV.I”: Line 548, Nonnumeric data when numeric required. Zero used.
Program “SB.EVAL.EXP”: Line 121, Nonnumeric data when numeric required. Zero used
Manu,
I added as a new thread, "
Universe Enhancement Request for uv/errlog - Return Stack".
I'm hoping you & others will lend support there. Maybe click on "I have this question too".