Bug 217174 - dtrace does not cleanup probes
Summary: dtrace does not cleanup probes
Status: Closed Not A Bug
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 10.3-STABLE
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-17 14:14 UTC by Daniel G
Modified: 2017-02-21 02:24 UTC (History)
2 users (show)

See Also:


Attachments
DTrace script causing problem (2.83 KB, text/x-dsrc)
2017-02-17 14:14 UTC, Daniel G
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel G 2017-02-17 14:14:31 UTC
Created attachment 180077 [details]
DTrace script causing problem

Running and stopping a DTrace script, may leave a "ftcleanup" process behind in "DL" state, ps afux output:

root     820   0.0  0.0      0    16  -  DL    1:43PM  0:00.01 [ftcleanup]

Perl scripts (for some reason) notice this and show the following warning afterwards:

WARNING: number of probes fixed does not match the number of defined probes (16 != 18, respectively)
WARNING: some probes might not fire or your program might crash


This is reproducible on 10.3-STABLE and 10.3-RELEASE, and may take two or three attempts if it doesn't occur on the first attempt.


How to reproduce:

1. Execute attached dtracte script.
2. Stop executed dtrace script.
3. Check ps afux for kernel ftcleanup process
4. Repeat above until bug is triggered (2-3 times total should be enough)


Any perl script subsequently will print the following warning on stderr, like this script for example:

```
#!/usr/local/bin/perl
print "Test";
```

WARNING: number of probes fixed does not match the number of defined probes (16 != 18, respectively)
WARNING: some probes might not fire or your program might crash


I can also reproduce this with other dtrace scripts, like this one:
https://gist.github.com/genisd/72db1d98b64d9d7127570fff7d4b89f6


I don't know how big the implications are. One of our automation scripts dies due to the stderr output (it checks on that).
Comment 1 Mark Johnston freebsd_committer freebsd_triage 2017-02-21 02:17:53 UTC
The ftcleanup process is created when DTrace modules are loaded. It has nothing to do with the error message from perl, which should be addressed by ports
r430710.