From owner-freebsd-questions@FreeBSD.ORG Tue Jan 18 06:41:53 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 034801065672 for ; Tue, 18 Jan 2011 06:41:53 +0000 (UTC) (envelope-from javier@liendo.net) Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com [209.85.216.175]) by mx1.freebsd.org (Postfix) with ESMTP id B5AE78FC1B for ; Tue, 18 Jan 2011 06:41:52 +0000 (UTC) Received: by qyk8 with SMTP id 8so2269104qyk.13 for ; Mon, 17 Jan 2011 22:41:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=liendo.net; s=google; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=080sxtjvyUKIzpmaNphMDtbY/XQ4Ici11VYBiiVuGX8=; b=Hlj+avOz+zI2gFwie5ar0WBAjXlljxW8h8nlz0tJuxZTLZb5Z/hNqEI/0+JFdFBGhe +zwmBkYjOUmaUH7iGrIDJtHCHs4W1XLLMa+FRClu4ZIeNAFqHK7xzv+YUwU5uRj2ksCe PdcJ3/Z7UOdeX+9FcPnQfNE8SdX1YgOyADolg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=liendo.net; s=google; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=MZnKXSn0nsZ/kMvmOSNQ5uH7npWurAnpjbGVCrosXFMWktts4Py/MEnnRYAqL0/qvz KhxgVLjX3fnGIDQ8AdIjnOeiDeAxf+ac+SGt26KBfHKIIirYOTOWpKsw2WPFHxpbULM4 pActH5gH+mzW7FQp9ZWlaDapC9XGMyJ6EhHA0= MIME-Version: 1.0 Received: by 10.229.212.3 with SMTP id gq3mr4280951qcb.169.1295331388435; Mon, 17 Jan 2011 22:16:28 -0800 (PST) Received: by 10.220.190.204 with HTTP; Mon, 17 Jan 2011 22:16:28 -0800 (PST) Date: Tue, 18 Jan 2011 00:16:28 -0600 Message-ID: From: Javier Liendo To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: dtrace/userland causing segmentation fault X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 06:41:53 -0000 hello freebsd gurus... i'm currently using FreeBSD 9.0-CURRENT-201101... dtrace is enable and working [root@ ~]# dtrace -l | tail -5 41473 profile tick-1= 000 41474 profile tick-5= 000 41475 profile tick-1= sec 41476 database5533 db main query-done 41477 database5533 db main query-start i=B4m trying to use dtrace with a very basic userland program and i=B4m 100% of the time getting segmentation faults... ------ probes definition file ------ [root@ ~]# cat simple_probes.d provider simple { probe loop(int); }; ------ simple program ------ [root@ ~]# cat simple.c #include #include "simple_probes.h" int main() { int i; i=3D0; while(1) { printf("%d\n",i); i++; SIMPLE_LOOP(i); } return(0); } ------ the steps i use to get the program compiled are ------ [root@ ~]# dtrace -C -h -s simple_probes.d [root@ ~]# gcc -c simple.c [root@ ~]# dtrace -G -s simple_probes.d simple.o [root@ ~]# gcc -lelf -o simple simple_probes.o simple.o ------ but when i run the program i always get segmentation fault >:( -----= - [root@ ~]# ./simple 0 Segmentation fault: 11 (core dumped) i=B4ve been banging my head against a wall trying to troubleshoot this issue with obviously no success... have any of the freebsd gurus found a similar behavior in the past regarding userland dtrace? any pointers/links/words of encouragement will be greatly appreciated... regards, javier