op_vuerr
A utility that prints out function stack traceback and other program error information. The error information is extracted from an error log maintained by programs supplied by OPNET or based on OPNET object code libraries.
Description
Most OPNET-supplied programs handle error conditions and program crashes using a unified error package. This package indicates the error to the user by updating a message area (if the program has a Graphical User Interface) or by printing messages on the standard output device. In all cases, errors are also logged in an ASCII file named err_log within the administration directory (<HOME>/op_admin).
Each entry in err_log has the following components:
- error classification, which indicates the severity of the error. The possible classifications are listed below:
- Warning – situation that may lead to problems, and that should be checked by user
- Recoverable Error – problem that does not prohibit the program from proceeding, but that may result in the cancellation of the current operation.
- Program Abort – problem that prohibits the program from reliably proceeding, and that causes the program to immediately abort
- Program Fault – problem that causes the Linux kernel to immediately abort the program in an uncontrolled manner
- date and time when the error occurred
- program in which the error occurred
- package of functions in which the error occurred
- function in which the error occurred
- description of the error, including variable values and related information which can serve to identify the error’s cause
- contents of the program-maintained function stack that can be used by technical support to help identify the location and cause of the error
The error log continues to grow as program errors occur and cause traceback information to added to the file. The reason the error log is cumulative is to provide:
- a reliable description of a recent sequence of errors that users or technical support can use to investigate the cause of the errors
- a comprehensive summary of problematic user/program interactions that technical support can analyze at regular intervals to improve the user interface
Typically, the error log grows to many thousands of lines after a month of heavy usage, so the log’s size should be checked regularly if disk space is at a premium. The error log file can be removed by the user at any time to reduce disk space usage; it is recreated as needed when the next error is logged.
The op_vuerr program provides a direct way to view the most recently logged error(s). It opens up the error log, searches out the last error (or last N errors, if specified), and prints out the traceback information on the standard output device. op_vuerr can be executed from any directory, adding to its convenience.
Preferences
This program supports the following preference sets:
- “Standard Preferences”
- “Diagnostics” preferences (except diag_enable and rec_err_suppress)
This program also supports the following additional preferences.
num_err
Specifies the number of errors to be extracted from the error log and printed to the standard output device. The most recent N errors are printed by op_vuerr (i.e., the last n entries in the error log), where N is the value of this preference.
| Type | Units | Default Value |
|---|---|---|
| integer | errors | 1 |
Example Usage
% op_vuerr
<<< Program Abort >>>
* Time: Fri May 17 17:31:48 1996
* Program: op_runsim (Version 3.0.A)
* Package: Simulation Kernel
* Function: sim_err_print (severity_level, str0, str1)
* Error: Error encountered rebuilding repository -- unable to proceed
T (0), EV (-1), MOD (NONE), PROC (sim_load_repos_load)
* Function call stack: (builds down)
------------------------------------------------------------
Call Block
Count Line# Function
------------------------------------------------------------
0) 1 267 main (argc, argv, envp)
1) 1 204 sim_init (argc, argv, envp)
2) 1 148 sim_load_models (net_name)
3) 1 571 sim_load_repos_load (net_name)
4) 2 171 sim_err_print (severity_level, str0, str1)
5) 3 224 Vos_Error_Print (level, package, error0, error1, error2)
------------------------------------------------------------
%
Each line in the function call stack contains a call count and a block line number in addition to the function name and arguments. The call count specifies the total number of times that the function has been called since the start of program execution. The block line number specifies the last source-code line number that was known to have executed within that function at the time of the error. The block line number is not a fine-grained measure and does not necessarily list the exact line number executed within the function at the time of the error.
The following example makes this more clear. It includes a sample code fragment with line numbers and four hypothetical error locations:
1 int function()
2 {
3 int x, y, z;
4 int *ptr;
5
6 z = 0; A
7 for (x = 0; x < 10; x++)
8 {
9 for (y = 0; y < 10; y++) B
10 {
11 z += y;
12 z += x; C
13 }
14 }
15 return z; D
16 }
The following table lists the line numbers that will be returned by op_vuerr for each location in the preceding example:
Table 23: Line Numbers Returned by op_vuerr for Each Error Location
| Location | Reported line number |
|---|---|
| A | 2 |
| B | 8 |
| C | 10 |
| D | 14 |