Robert Mustacchi
2011-Feb-23 19:33 UTC
[dtrace-discuss] Issue with DTrace libdir dependency resolution and patch
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 -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: libdir.patch URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20110223/a80ddd68/attachment.ksh>
Robert Mustacchi
2011-Feb-24 17:57 UTC
[dtrace-discuss] Issue with DTrace libdir dependency resolution and patch
All, There was a small typo in this mail. This line:> #pragma D depends_on procfs.dshould instead read: #pragma D depends_on library procfs.d Sorry for the confusion, Robert
Jonathan Haslam
2011-Feb-24 18:47 UTC
[dtrace-discuss] Issue with DTrace libdir dependency resolution and patch
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.> 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 > > > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20110224/aa265bc5/attachment.html>
Bryan Cantrill
2011-Feb-24 19:59 UTC
[dtrace-discuss] Issue with DTrace libdir dependency resolution and patch
On Thu, Feb 24, 2011 at 10:47 AM, Jonathan Haslam <jonathan.haslam at oracle.com> wrote:> 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