clause-local variable with copyin()
Hiroki Sato
hrs at FreeBSD.org
Mon Dec 19 17:35:47 UTC 2016
Matthew Ahrens <mahrens at delphix.com> wrote
in <CAJjvXiHScMOhCb7kVoSgPHgccXkmNo_c1ysFBXnyrqj4ehJeUw at mail.gmail.com>:
ma> On Fri, Dec 16, 2016 at 10:10 PM, Hiroki Sato <hrs at freebsd.org> wrote:
ma> > The symptom varied depending on the address of this->st, so I am
ma> > guessing that this->st was incorrectly freed at the end of the first
ma> > probe. If I use copyinstr(arg0) instead of copyin(), this problem
ma> > does not occur.
ma> >
ma>
ma> Perhaps this is a bug (or at least, unexpected behavior) with copyin(). I
ma> assume that it works fine with simple data types (e.g. numbers).
Yes, it happens only when using copyin().
ma> I tried to test out your script on illumos but I got as far as this before
ma> running out of time:
ma>
ma> dtrace -h -s sample_probes.d
ma> gcc -c sample.c
ma> dtrace -G -s sample_probes.d sample.o
ma> gcc -o sample sample.o
ma> dtrace -s sample_debug.d -c ./sample
ma> dtrace: failed to compile script sample_debug.d: line 1: 'dump-str' is an
ma> invalid probe name
I confirmed that illumos-2816291 reproduced the same behavior. The
sample_probes.o file should be linked to create a "sample" binary
like this:
% gcc -o sample sample.o sample_probes.o
-- Hiroki
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-dtrace/attachments/20161219/1056d01b/attachment.sig>
More information about the freebsd-dtrace
mailing list