OpenSolaris

Printable Version Enter a New Search
Bug ID 6581257
Synopsis dtrace_lookup_by_type() can fail spuriously
State 10-Fix Delivered (Fix available in build)
Category:Subcategory library:libdtrace
Keywords
Responsible Engineer Adam Leventhal
Reported Against
Duplicate Of
Introduced In solaris_10
Commit to Fix snv_72
Fixed In snv_72
Release Fixed solaris_nevada(snv_72)
Related Bugs
Submit Date 16-July-2007
Last Update Date 31-August-2007
Description
[ahl 7.16.2007]

dtrace_lookup_by_type() essentially has two operation modes: either it looks for symbol in a specific CTF container or it iterates over some subset of the CTF containers that libdtrace knows about. If there's a problem with the CTF container itself, we want to handle the case differently in those two cases. In the former, we want to report the error immediately; in the latter we press on and look for the type in other containers (reporting overall failure if no match is found later).

Here's the code that implements that bit of logic:

        if (object != DTRACE_OBJ_EVERY &&
...
                n = 1;

        } else {
...
                n = dtp->dt_nmods;
        }
...
        for (; n > 0; n--, dmp = dt_list_next(dmp)) {
...
                /*
                 * If we can't load the CTF container, continue on to the next
                 * module.  If our search was scoped to only one module (n = 1)
                 * then return immediately, leaving dt_errno set to the error
                 * from dt_module_getctf() on the module given by the caller.
                 */
                if (dt_module_getctf(dtp, dmp) == NULL) {
                        if (n == 1)
                                return (-1);
                        continue;
                }

The problem is that if dt_module_getctf() fails during the last iteration of the for loop when n happens to equal 1, we treat it like the singleton case.

We need to maintain additional state to determine if we're in the singleton case or not.
Work Around
N/A
Comments
N/A