Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Oct 2015 11:11:59 -0700
From:      Mark Johnston <markj@freebsd.org>
To:        Shrikanth Kamath <shrikanth07@gmail.com>
Cc:        "freebsd-dtrace@freebsd.org" <freebsd-dtrace@freebsd.org>
Subject:   Re: Running DTrace Userland probes at times terminates traced process
Message-ID:  <CAMw1wOzcUgfUnXhBLtugZxAkijARxU3-Q0sJ24FPdRKZ91cUCw@mail.gmail.com>
In-Reply-To: <CAEOAkMW4_Z5dcEgBU4QRxogmUswZvm0DPKeJn%2B65UJDV_NiyOg@mail.gmail.com>
References:  <CAEOAkMW4_Z5dcEgBU4QRxogmUswZvm0DPKeJn%2B65UJDV_NiyOg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Oct 15, 2015 at 10:53 PM, Shrikanth Kamath
<shrikanth07@gmail.com> wrote:
> It maybe a non issue but wanted to check with the forum,
>
> I am running the following dtrace one liner on the login process
>
> root@bsdvm#dtrace -ln 'pid$target::*:entry' -p <pid of login>
>
> root@bsdvm:~ # ps
>  PID TT  STAT    TIME COMMAND
> 1820 u0  Ss   0:00.02 login [pam] (login)
> ...
>
> root@bsdvm:~ # uname -a
> FreeBSD bsdvm 10.2-STABLE FreeBSD 10.2-STABLE #0 r286878: Tue Aug 18
> 22:14:16 UTC 2015
> root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC  i386
>
>
> But before it can finish listing all the probes I issue a CTRL-C and
> thereby stopping dtrace. This results in terminating the login
> process.
>
> When I ran ktrace on dtrace I see it does a PT_ATTACH but since I do
> not allow to run it to completion and terminate early it fails to do a
>  clean PT_DETACH thereby terminating the traced process.
>
> May not be an issue if we don't kill DTrace after it has done a PT_ATTACH...

This has been fixed in head: dtrace(1) now detaches from the child
process(es) before exiting when it receives a signal in -l mode.

For some reason I haven't merged the change to stable/10 yet - sorry
about that. I'll be sure to MFC the change in the next day or so.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAMw1wOzcUgfUnXhBLtugZxAkijARxU3-Q0sJ24FPdRKZ91cUCw>