From owner-freebsd-current@FreeBSD.ORG Wed May 20 12:01:01 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF30F106566C; Wed, 20 May 2009 12:01:01 +0000 (UTC) (envelope-from serenity@exscape.org) Received: from ch-smtp01.sth.basefarm.net (ch-smtp01.sth.basefarm.net [80.76.149.212]) by mx1.freebsd.org (Postfix) with ESMTP id 868B18FC15; Wed, 20 May 2009 12:01:01 +0000 (UTC) (envelope-from serenity@exscape.org) Received: from c83-253-252-234.bredband.comhem.se ([83.253.252.234]:42207 helo=mx.exscape.org) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.69) (envelope-from ) id 1M6kTh-0000ae-3X; Wed, 20 May 2009 14:00:58 +0200 Received: from [192.168.1.5] (macbookpro [192.168.1.5]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mx.exscape.org (Postfix) with ESMTPSA id 016A76CD83; Wed, 20 May 2009 14:00:48 +0200 (CEST) Message-Id: From: Thomas Backman To: Wesley Shields In-Reply-To: <20090519204947.GA39529@atarininja.org> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Date: Wed, 20 May 2009 14:00:49 +0200 References: <949B5884-5303-4EFF-AC7D-293640FFA012@exscape.org> <20090518161148.GA56646@atarininja.org> <20090519204947.GA39529@atarininja.org> X-Mailer: Apple Mail (2.935.3) X-Originating-IP: 83.253.252.234 X-Scan-Result: No virus found in message 1M6kTh-0000ae-3X. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1M6kTh-0000ae-3X 9cb1ba1742a400c0df02dcc83950e01b Cc: freebsd-current@freebsd.org Subject: Re: DTrace panic while probing syscall::open (and possibly many others) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2009 12:01:02 -0000 On May 19, 2009, at 10:49 PM, Wesley Shields wrote: > I just noticed this but shouldn't you be using copyinstr() on the > first > probe. It should look something like this: > > syscall::open:entry > { > self->path = copyinstr(arg0); > } > > syscall::open:return > / self->path / > { > printf("%s\n", self->path); > } > > This still doesn't solve the problem of copyinstr() causing a crash > though. I don't remember why, but I do remember that it was said (in older versions) in the Solaris DTrace guide to always copy in variables after the function return, not quite sure why (Possibly because they could be undefined in :::entry?). Brendan Gregg, who wrote the DTrace Toolkit, does this, anyway (see the opensnoop.d script). Sun liked his work so much that they hired him. :-) Regards, Thomas