Discussion:
Issue with DTrace libdir dependency resolution and patch
(too old to reply)
Robert Mustacchi
2011-02-23 19:33:41 UTC
Permalink
Raw Message
Hi all,

I have found an issue with how DTrace handles the #pragma D depends_on
option when using dtrace -Lpath to add additional directories. I have
confirmed that this is a problem on illumos and OS X 10.6.6. Presumably
it also affects FreeBSD.

When looking for a dependency it does not search the entire path to try
and resolve it, but rather only the local directory. So if you have a
file with the following:

#pragma D depends_on procfs.d

that was in another directory, say, /home/rm/local/lib/dtrace, DTrace
will only look for procfs.d in /home/rm/local/lib/dtrace/procfs.d and
never anywhere else on the library path, which includes /usr/lib/dtrace
where the file resides.

Attached is a patch that applies cleanly to Illumos. This patch searches
the entire libdir path for the file using the first one that it finds.
This patch also adds a DTest that catches this issue.

This patch was developed at Joyent with review from Bryan Cantrill. It
is copyright by Joyent and licensed under the CDDL. It should apply
cleanly to the Mac OS X and FreeBSD codebases. If people from the
respective communities would like me to file bugs or there is some other
process to facilitate this fix getting out there, please let me know.

Thanks,
Robert
Robert Mustacchi
2011-02-24 17:57:25 UTC
Permalink
Raw Message
All,
Post by Robert Mustacchi
#pragma D depends_on procfs.d
should instead read:

#pragma D depends_on library procfs.d

Sorry for the confusion,
Robert
Jonathan Haslam
2011-02-24 18:47:31 UTC
Permalink
Raw Message
Hi Robert,

This is my bad - sorry about the problem and thanks for fixing it. I no
longer work in this area but I'll log the bug against Solaris (I'm not
sure how to log them externally).

Thanks again.

Jon.
Post by Robert Mustacchi
I have found an issue with how DTrace handles the #pragma D depends_on
option when using dtrace -Lpath to add additional directories. I have
confirmed that this is a problem on illumos and OS X 10.6.6.
Presumably it also affects FreeBSD.
When looking for a dependency it does not search the entire path to
try and resolve it, but rather only the local directory. So if you
#pragma D depends_on procfs.d
that was in another directory, say, /home/rm/local/lib/dtrace, DTrace
will only look for procfs.d in /home/rm/local/lib/dtrace/procfs.d and
never anywhere else on the library path, which includes
/usr/lib/dtrace where the file resides.
Attached is a patch that applies cleanly to Illumos. This patch
searches the entire libdir path for the file using the first one that
it finds. This patch also adds a DTest that catches this issue.
This patch was developed at Joyent with review from Bryan Cantrill. It
is copyright by Joyent and licensed under the CDDL. It should apply
cleanly to the Mac OS X and FreeBSD codebases. If people from the
respective communities would like me to file bugs or there is some
other process to facilitate this fix getting out there, please let me
know.
Thanks,
Robert
_______________________________________________
dtrace-discuss mailing list
Bryan Cantrill
2011-02-24 19:59:01 UTC
Permalink
Raw Message
On Thu, Feb 24, 2011 at 10:47 AM, Jonathan Haslam
Post by Jonathan Haslam
Hi Robert,
This is my bad - sorry about the problem and thanks for fixing it. I no
longer work in this area but I'll log the bug against Solaris (I'm not sure
how to log them externally).
If this is to be fixed within Oracle, please do so with awareness of
the license and copyright on this work.

Thanks,
Bryan

Loading...