Date: Sat, 23 Jun 2012 15:21:12 GMT From: "W.L. Tai" <t10661789@yahoo.com> To: freebsd-gnats-submit@FreeBSD.org Subject: kern/169350: Extraneous output when tracing writes with output redirect to a file Message-ID: <201206231521.q5NFLCJx051989@red.freebsd.org> Resent-Message-ID: <201206231530.q5NFUA7i009993@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 169350
>Category: kern
>Synopsis: Extraneous output when tracing writes with output redirect to a file
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sat Jun 23 15:30:10 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator: W.L. Tai
>Release: 9.0 stable
>Organization:
>Environment:
FreeBSD aaa.local 9.0-STABLE FreeBSD 9.0-STABLE #0: Fri Jun 22 20:51:15 HKT 2012 root@aaa.local:/usr/obj/usr/src/sys/TAI amd64
>Description:
Extraneous output when tracing writes from entry to return with output redirection to a file.
>How-To-Repeat:
Consider the following script: test-bug.d
#!/usr/sbin/dtrace -s
#pragma D option quiet
vfs::vop_read:entry, vfs::vop_write:entry
/execname != "dtrace"/
{
self->flag = 1;
}
vfs::vop_read:return, vfs::vop_write:return
/self->flag/
{
this->flag = 1;
self->flag = 0;
}
vfs::vop_read:return, vfs::vop_write:return
/this->flag/
{
printf("%s\n", execname);
}
After running
dtrace -s test-bug.d -n 'tick-5s { exit(0); }' > /tmp/test
the file /tmp/test would contains lines with dtrace, which should not be there. Somehow dtrace has inherit the value of this->flag.
>Fix:
Work around:
Either continue to use self->flag or use the predicate
/this->flag && execname != "dtrace"/
>Release-Note:
>Audit-Trail:
>Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201206231521.q5NFLCJx051989>
