ProbeVue error messages
As described earlier, running the probevue command requires privilege. If an ordinary user tries running the probevue command, the RBAC framework detects this and fails the execution of the command immediately.
$ probevue kernel.e
ksh: probevue: 0403-006 Execute permission denied.
The Authorizations and privileges section of the Running ProbeVue describes how to enable non-root users with the authorizations and privileges to issue the probevue command.
The ProbeVue compiler, which is built-in to the probevue command, prints detailed error messages during the compilation phase when it detects any syntax errors, semantic errors or type incompatibility errors. Consider the following script:
/* Syntax error example:
* syntaxbug.e
*/
@@BEGIN
{
int i, j, k;
i = 4;
j = 22;
k = i _ z;
printf("k = %d\n", k);
exit();
}
The preceding script has a syntax error on line 11 at column 15, the assignment statement. Instead of a minus symbol (-) or an underscore symbol (_) was typed by mistake. On running the script, the ProbeVue compiler catches this error and generates an error message:
# probevue syntaxbug.e
syntaxbug.e: token between line 11: column 15 and line11: column 15: , expected
instead of this token
The ProbeVue compiler also invokes internal system calls to check if the probe specifications in the Vue script are valid. A common error is to pass an invalid process ID or the process ID of an exited process in the probe point tuple. Another common error is to forget to pass a process ID as an argument on the command line when the script expects one. Consider the following script:
/* simpleprobe.e
*/
@@syscall:$1:read:entry
{
printf("In read system call: thread ID = %d\n", __tid);
exit();
}
The preceding script requires a process ID as an argument to replace the '$1' variable in the probe point tuple at line 3. The kernel will return an error if you tries to probe a process that has exited or does not exist. It also fails if the process ID indicates a kernel process or the init process. Further, you cannot probe a process that does not belong to you unless you have the required privileges to probe another user's processes. You can use the prgrep command with the -p flag to print the process name given a process ID.
# probevue simpleprobe.e 233
probevue: The process does not exist.
ERR-19: Line:3 Column:3 Invalid probe string
# prgrep -p 232
#
# probevue simpleprobe.e 1
ERR-19: Line:3 Column:3 Invalid probe string
# prgrep -p 1
init
# probevue simpleprobe.e
ERR-19: Line:3 Column:3 Invalid probe stringThe probevue command can also detect if an unprivileged user tries to access kernel variables. Consider the kernel.e script from the sample programs section. The following example session shows what happens if you try running this as an unprivileged user:
$ probevue kernel.e
ERR-56: Line:93 Column:39 No authority to access kernel variable
ERR-56: Line:99 Column:23 No authority to access kernel variable
ERR-56: Line:100 Column:24 No authority to access kernel variable
ERR-56: Line:101 Column:25 No authority to access kernel variable
ERR-56: Line:102 Column:24 No authority to access kernel variable
ERR-102: Line:140 Column:13 Operation not allowed
ERR-46: Line:140 Column:9 Invalid Assignment, Type mismatch
After the Vue script has been compiled successfully, the probevue command invokes a system call to start a new ProbeVue session passing the intermediate code generated by the compiler. The system call will fail if the ProbeVue framework fails to initialize a new ProbeVue session. There can be several reasons for this. For example, starting the new session can cause memory resources for the user to exceed the administrator-specified limits. The session can need more memory resources than allowed for a single session. There can be unauthorized functions used in the interval probe manager. One of the processes being probed can have exited after the compilation phase checks were made. When the session cannot be started, the kernel fails the system call returning a unique 64-bit error.
The ProbeVue framework can abort a successfully started and active ProbeVue session if a severe or unrecoverable error is encountered while issuing the probe actions. Possible errors include exceeding session or user memory limits (memory requirements for thread-local variables and list variables can grow as the session progresses), exceeding temporary string or stack area limits, accessing out-of-array indexes, attempting to divide by zero, and so on. In all cases, the kernel will return a unique 64-bit error number while terminating the session.
When the session is failed whether at start or after it has been successfully started, the probevue command prints a generic error message including the unique 64-bit error number in hexadecimal format and exits. The following chart provides the meaning of some common 64-bit errors that could be returned by the kernel:
| Kernel error | Meaning | Occurs at |
|---|---|---|
| 0xEEEE00008C285034 | Out of memory while allocating primary trace buffers. | Session start |
| 0xEEEE00008C285035 | Out of memory while allocating secondary trace buffers. | Session start |
| 0xEEEE00008C52002B | Out of memory while allocating storage for probe specification strings. | Session start |
| 0xEEEE000096284122 | Out of memory while allocating storage for thread-local storage. | Session start |
| 0xEEEE000081284049 | Use of user-space access functions in the interval probe manager. | Session start |
| 0xEEEE0000D3520022 | Number of sessions limit for regular users. | Session start |
| 0xEEEE000096284131 | Illegal address passed to the get_userstring function. | Executing probe action |
| 0xEEEE00008C520145 | Maximum thread limit hit for thread local variables. | Executing probe action |