From owner-freebsd-hackers@FreeBSD.ORG Sat Dec 4 20:33:04 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E1391065693 for ; Sat, 4 Dec 2010 20:33:04 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 9D5D48FC12 for ; Sat, 4 Dec 2010 20:33:03 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id WAA13285; Sat, 04 Dec 2010 22:33:00 +0200 (EET) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1POymx-0005g9-Vw; Sat, 04 Dec 2010 22:33:00 +0200 Message-ID: <4CFAA579.1010701@freebsd.org> Date: Sat, 04 Dec 2010 22:32:57 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: Brandon Gooch References: In-Reply-To: X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: DTrace: Sending ^C while running script produces no output X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Dec 2010 20:33:04 -0000 on 03/12/2010 07:20 Brandon Gooch said the following: > I've been tinkering with DTrace a bit, and I've notice something > peculiar on each system I've tried it on. > > Sending ^C from the keyboard in the terminal (console, XTerm, Konsole) > produces no output [1]. Can you ktrace the dtrace process? I wonder, could it be that SIGINT from ^C is somehow delivered twice?.. > For example, while trying out a one-liner (from > http://www.brendangregg.com/DTrace/dtrace_oneliners.txt): > > brandon@d820:~$ sudo dtrace -n 'syscall:::entry { @num[execname] = count(); }' > dtrace: description 'syscall:::entry ' matched 514 probes > ^C BTW, sudo might play a role here... Just a thought. > brandon@d820:~$ (12-02 23:11) > > > If I instead, from another terminal, use pkill to quit or terminate > the process, I get output: > > brandon@d820:~$ sudo dtrace -n 'syscall:::entry { @num[execname] = count(); }'; > dtrace: description 'syscall:::entry ' matched 514 probes > > > akonadi_control 4 > akonadiserver 5 > syslogd 6 > sendmail 8 > akonadi_ical_resour 12 > akonadi_maildir_res 12 > akonadi_nepomuk_con 12 > akonadi_vcard_resou 12 > kuiserver 12 > akonadi_maildispatc 14 > korgac 14 > virtuoso-t 15 > dbus-daemon 17 > mysqld 18 > hald 24 > knotify4 27 > akonadi_contacts_re 36 > nepomukservicestub 70 > pkill 70 > powerd 72 > dtrace 101 > zsh 111 > sudo 495 > kwin 2812 > firefox-bin 3175 > kdeinit4 11044 > Xorg 39588 > brandon@d820:~$ (12-02 23:14) > > > I also want to add that I've tried this with a variety of shells on > both 8.2-PRERELEASE and HEAD systems, i386 and amd64, built with GCC > and nearly GENERIC kernels in order to try to eliminate the cause. > > I feel as though this has something to do with file descriptors being > closed too soon when handling the signal or something of that nature. > It's also been suggested that this could be a bug in libdtrace, but I > haven't the knowledge (or skill) to try and pinpoint the cause myself. > > Is there anyone here that may be able to provide feedback or debugging > suggestions? > > Thanks! > > -Brandon > > [1] This isn't always the case, only like 99.99% of the time. > Sometimes I do get output, but usually it's just snippets, and > sometimes random characters! -- Andriy Gapon