From owner-freebsd-dtrace@freebsd.org Fri Oct 16 05:53:02 2015 Return-Path: Delivered-To: freebsd-dtrace@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38313A166D9 for ; Fri, 16 Oct 2015 05:53:02 +0000 (UTC) (envelope-from shrikanth07@gmail.com) Received: from mail-yk0-x234.google.com (mail-yk0-x234.google.com [IPv6:2607:f8b0:4002:c07::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F28121837 for ; Fri, 16 Oct 2015 05:53:01 +0000 (UTC) (envelope-from shrikanth07@gmail.com) Received: by yknn9 with SMTP id n9so25073517ykn.0 for ; Thu, 15 Oct 2015 22:53:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=9+jjMUWZ0MrtDJtgbJn3T/RDwOZkiOzdCwAi6vegFUA=; b=Lkfh1dfA26IEYunXEAD2hGXfTcf7jgI9+wGNARAmq5QbPNo6nnG4xbQz3fOPAjRyWH ToTnVl+BxEteEj6N31Ds8eW73xJJ7P67ykVfzxirG0ajeDqPRyiTE6eWcdeMALYPqoEq LsQ76Ihl3E3ds5uzIPH/8JmHwoH1Xk2cj58IDQ+8IVRlcNsJVhcfzztG1tc4A2/3fqA3 C9i7a1JftVCX76PL0PWxI9OCVBoQihOQFdZSLDEi56XQ/Po2HpEpckds9/bhepOycQ5d vIL622MmFyyv2sWroh77rK0VYMzVlqIpjqzD1FFMykE77/Ks+uJ92Omrt0HrIGIJGJdh EePg== MIME-Version: 1.0 X-Received: by 10.129.35.6 with SMTP id j6mr9219506ywj.8.1444974780953; Thu, 15 Oct 2015 22:53:00 -0700 (PDT) Received: by 10.129.88.70 with HTTP; Thu, 15 Oct 2015 22:53:00 -0700 (PDT) Date: Thu, 15 Oct 2015 22:53:00 -0700 Message-ID: Subject: Running DTrace Userland probes at times terminates traced process From: Shrikanth Kamath To: freebsd-dtrace@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "A discussion list for developers working on DTrace in FreeBSD." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2015 05:53:02 -0000 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 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... -- Shrikanth R K From owner-freebsd-dtrace@freebsd.org Fri Oct 16 18:12:01 2015 Return-Path: Delivered-To: freebsd-dtrace@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80089A175E0 for ; Fri, 16 Oct 2015 18:12:01 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-wi0-x231.google.com (mail-wi0-x231.google.com [IPv6:2a00:1450:400c:c05::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 24FF892A for ; Fri, 16 Oct 2015 18:12:01 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by wicll6 with SMTP id ll6so22840727wic.1 for ; Fri, 16 Oct 2015 11:11:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=i13GEUL5ru7owUuVqX+suDvXLZUf61XwsPW+7cIeBkM=; b=et+ZSg3CqyQVzpC88xxjHmc9iseXHwsRfYt6q1CyOyNQnGYDIFntWWBukuJEiVGOms hV0H4yTBLRC4gyPs9KXVfYEhsUVCXTOMkEMLuTMwj3iZBCe3LZ+T7CjDYY1FNTTr8T34 EhzO5oJGB0ViAUwwvacm7j7wUSaH3zGL78EyO7Frmyndnth/nvdkCDN2XOVGPvZI46Cg +if01Eg3SsySuedtMwUSA1RF6RCzl7uc0lvwDULklSn6nfweODA0Gs/b/iOEmhDkXYrM gTL+WW9WwfC0ST9OChMO8B4uf+MM5M1AfdpDOQKMhbUoHMYQqO5lLYiwPEJMM6b/QG92 qTHg== MIME-Version: 1.0 X-Received: by 10.180.188.169 with SMTP id gb9mr6595742wic.72.1445019119298; Fri, 16 Oct 2015 11:11:59 -0700 (PDT) Sender: markjdb@gmail.com Received: by 10.194.151.137 with HTTP; Fri, 16 Oct 2015 11:11:59 -0700 (PDT) In-Reply-To: References: Date: Fri, 16 Oct 2015 11:11:59 -0700 X-Google-Sender-Auth: dkrpfEXkVt9_SMHi48-5QnBPt4w Message-ID: Subject: Re: Running DTrace Userland probes at times terminates traced process From: Mark Johnston To: Shrikanth Kamath Cc: "freebsd-dtrace@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "A discussion list for developers working on DTrace in FreeBSD." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2015 18:12:01 -0000 On Thu, Oct 15, 2015 at 10:53 PM, Shrikanth Kamath 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 > > 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. From owner-freebsd-dtrace@freebsd.org Sat Oct 17 20:39:47 2015 Return-Path: Delivered-To: freebsd-dtrace@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E684A17F46 for ; Sat, 17 Oct 2015 20:39:47 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qg0-x22a.google.com (mail-qg0-x22a.google.com [IPv6:2607:f8b0:400d:c04::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 402A3D52 for ; Sat, 17 Oct 2015 20:39:47 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by qgeo38 with SMTP id o38so83932120qge.0 for ; Sat, 17 Oct 2015 13:39:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=T2XuOql14XkycD1Jg0S2yZLSUGv2GOpPfT4i8Nyw41w=; b=NH3QSdU0ZZxm5XlFj2+CZFTvzK6GQehiWVKpfBPPEF7lPpNbR3dgql43GNJvFXMS8w XVAHXB44JR89VKLCzfQ+EJgPMzYleEzzX0bZp7mhRQIV+getLXofWDDyEvEuQeioY7FT o+bq61V5Agqlh80BvzTP7OuqtfOqGb7OFMnhTgd6ZPunOwOLA9g+VgdxWHAe8WbD7n+i 6iZlEXEWRxOmjxkGErOOWASEDw5p1A5wTWWYS6EMx8JeKBhLMIVZRaqdPBomJLq5oTWn sVUcXgoAVCAwlYoLs+sqxd+bAdzVBaXdw4F9ux2MhPc5Ixt3nix0vNrsan9yPB6zYudy CkZA== X-Received: by 10.141.28.21 with SMTP id f21mr28766985qhe.13.1445114386146; Sat, 17 Oct 2015 13:39:46 -0700 (PDT) Received: from charmander.corp.emc.com ([50.245.130.59]) by smtp.gmail.com with ESMTPSA id k193sm10712567qhc.34.2015.10.17.13.39.44 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 17 Oct 2015 13:39:45 -0700 (PDT) Sender: Mark Johnston Date: Sat, 17 Oct 2015 13:39:38 -0700 From: Mark Johnston To: Shrikanth Kamath Cc: freebsd-dtrace@freebsd.org Subject: Re: Running DTrace Userland probes at times terminates traced process Message-ID: <20151017203938.GA46117@charmander.corp.emc.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "A discussion list for developers working on DTrace in FreeBSD." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2015 20:39:47 -0000 On Thu, Oct 15, 2015 at 10:53:00PM -0700, Shrikanth Kamath 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 > > 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... A fix for this has been MFCed to stable/10 in r289468.