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.