From owner-freebsd-hackers@FreeBSD.ORG Thu Jul 28 04:36:12 2011 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 11AE5106564A for ; Thu, 28 Jul 2011 04:36:12 +0000 (UTC) (envelope-from ambrosehua@gmail.com) Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id BEB7E8FC0A for ; Thu, 28 Jul 2011 04:36:11 +0000 (UTC) Received: by qyk38 with SMTP id 38so1608837qyk.13 for ; Wed, 27 Jul 2011 21:36:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=tXTHX+CpaZDJwGDdGgPBsNRo6zDFX22flMRImNiby04=; b=oksEZ0YA4yAufAKHQBL4kNd4CfjqEmBwRft6DvWR2sD/9OwDDE6B+6qfqaM61eaABu IqdDUCH22BtL3+v3ZyJSJ+Kt0037jf2T4d2vmfZHRhWniVmvU1UwUkiV8vX7eeO1Tvm9 VIdFDl4pPRIbYGjW2A9gBO3YJ4B0Y71hNclKg= MIME-Version: 1.0 Received: by 10.229.215.68 with SMTP id hd4mr447954qcb.177.1311826212970; Wed, 27 Jul 2011 21:10:12 -0700 (PDT) Received: by 10.229.43.101 with HTTP; Wed, 27 Jul 2011 21:10:12 -0700 (PDT) In-Reply-To: <20110723135655.4479d190@fabiankeil.de> References: <20110722202811.17302hol2s3ar084@newwebmail.rawbw.com> <20110723135655.4479d190@fabiankeil.de> Date: Thu, 28 Jul 2011 12:10:12 +0800 Message-ID: From: ambrosehuang ambrose To: Fabian Keil Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Yuri , freebsd-hackers@freebsd.org Subject: Re: DTrace script asserts and kills the other process 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: Thu, 28 Jul 2011 04:36:12 -0000 > Yuri wrote: > > > I am trying to run this dtrace script: > > > > #!/usr/sbin/dtrace -s > > pid123:libc::entry > > { > > self->timestmp[probefunc] = timestmp; > > } > > pid123:libc::return > > /self->timestmp[probefunc] != 0/ > > { > > @function_duration[probefunc] = sum(timestmp - > > self->timestmp[probefunc]); timestmp[probefunc] = 0; > > } > > > > which I got from here: > > http://www.princeton.edu/~unix/Solaris/troubleshoot/dtrace.html > > replacing 123 with the pid of some running process. > > > > Result: dtrace utility asserts: > > Assertion failed: (dpr != NULL), file > > > /usr/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c, > > line 751. > > Abort trap: 6 > > > > Also the target process is killed too: > > Killed: 9 > > > > 8.2-STABLE amd64 > > This is a known issue. You may be able to work around it by > letting dtrace start the traced process. > > There's already a PR about it: > http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/158431 > but the limitation isn't mentioned in the wiki: > http://wiki.freebsd.org/DTrace/userland > > It's not clear to me if this has worked in the past or if it > works for other architectures (the reporter and I are both using > amd64, too). > > Fabian > I came across the same problem in 8.2-stable , it seemed the problem had been there since 8.2-release with userland dtrace integrated. I followed the PR185431 and found when dtrace started, it indeed attached to the traced process( dpr != NULL), but the traced process died soon, and according to the PR, this is "error in error" since the dtrace came accross error in dfatal .................................................................................................................................................... #3 0x0000000808d8af2d in dt_proc_lookup (dtp=0x80b841000, P=0x80d7ffb40, remove=0) at /usr/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c:751 #4 0x0000000808d8af92 in dt_proc_destroy (dtp=0x80b841000, P=0x80d7ffb40) at /usr/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c:763 #5 0x0000000808d8bc6e in dt_proc_hash_destroy (dtp=0x80b841000) at /usr/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c:1162 #6 0x0000000808daa4b5 in dtrace_close (dtp=0x80b841000) at /usr/src/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c:1554 #7 0x0000000000402775 in dfatal (fmt=0x408572 "no probes %s\n") at /usr/src/cddl/usr.sbin/dtrace/../../../cddl/contrib/opensolaris/cmd/dtrace/dtrace.c:236 #8 0x0000000000406b2c in main (argc=3, argv=0x7ffffffed9c0) at /usr/src/cddl/usr.sbin/dtrace/../../../cddl/contrib/opensolaris/cmd/dtrace/dtrace.c:1825 .....................................................................................................................................................