Bug 169350 - [dtrace] Extraneous output when tracing writes with output redirect to a file
Summary: [dtrace] Extraneous output when tracing writes with output redirect to a file
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-23 16:30 UTC by W.L. Tai
Modified: 2017-12-31 22:23 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description W.L. Tai 2012-06-23 16:30:10 UTC
Extraneous output when tracing writes from entry to return with output redirection to a file.

Fix: 

Work around:

Either continue to use self->flag or use the predicate

/this->flag && execname != "dtrace"/
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.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2012-06-23 21:20:33 UTC
Responsible Changed
From-To: freebsd-bugs->gnn

gnn has requested the dtrace PRs.
Comment 2 George V. Neville-Neil freebsd_committer freebsd_triage 2014-04-21 18:14:59 UTC
Responsible Changed
From-To: gnn->markj

Hand over to the person doing most of the DTrace work.
Comment 3 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:58:41 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped