From owner-freebsd-hackers@FreeBSD.ORG Fri Dec 3 05:20:46 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 864E2106567A for ; Fri, 3 Dec 2010 05:20:46 +0000 (UTC) (envelope-from jamesbrandongooch@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 1D9878FC0A for ; Fri, 3 Dec 2010 05:20:45 +0000 (UTC) Received: by wwf26 with SMTP id 26so4791626wwf.31 for ; Thu, 02 Dec 2010 21:20:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=h8ma1o47eSKREw/QPEpJ5X45nduHMv+85CoAsamqjkc=; b=OaxUE4ySKcTopBxz48gHN+C87gODMqERODOk4JC8/VI0oILt8o+YowKm21eNo6FCYG HTUkBSXCjDtaAgcdSSmPi3y17a5Rtn4SmGqWzgV8T2F7OdxiaRJatip69Eec0v+bjF3L XKHxKsZyFmaT6es2fyXITPDBojuGPFTC9YIoI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=ashqzHnx3zrAZcWWLQhC//itqwgMrFfq9yi8vAYTwzzNOF/EYvMVIudwQfhaxaHcn8 kcizTpUAJubdMBzf/3QeAr4byUp2xyAMNsD9Aui+wCnxp9UzDjR/BK8VWcYkXfzTP+ey aOP70TC6tOSE/TDvrctBlx6U4ln6LYbsNRBSU= MIME-Version: 1.0 Received: by 10.216.4.82 with SMTP id 60mr80340wei.89.1291353644932; Thu, 02 Dec 2010 21:20:44 -0800 (PST) Received: by 10.216.12.80 with HTTP; Thu, 2 Dec 2010 21:20:44 -0800 (PST) Date: Thu, 2 Dec 2010 23:20:44 -0600 Message-ID: From: Brandon Gooch To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: 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: Fri, 03 Dec 2010 05:20:46 -0000 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]. 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 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!