From owner-freebsd-dtrace@FreeBSD.ORG Thu Sep 25 22:46:46 2014 Return-Path: Delivered-To: freebsd-dtrace@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2CA3DCD2; Thu, 25 Sep 2014 22:46:46 +0000 (UTC) Received: from mail-qc0-x232.google.com (mail-qc0-x232.google.com [IPv6:2607:f8b0:400d:c01::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BD7FBC6F; Thu, 25 Sep 2014 22:46:45 +0000 (UTC) Received: by mail-qc0-f178.google.com with SMTP id x13so5990440qcv.9 for ; Thu, 25 Sep 2014 15:46:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=a76s+FYI6vw0sM8t7jrFD1TR/coYIoN7TvXrCYwZ2Qg=; b=srr9pQyj1j+B1JDvbc338cfmTJV1zMAsW7jkQ5dTKXMODxmo05FE1sJEDazx3YUWzi FSADcfmWf2aLII6fTLLn1SN04n452S1xl6qX+yVFWnnVTbVXzeC3z7rl69ehL/2iyzKm z0CKAgGrYNmAYcfFGtKAbMoB6QuYgG7J+fK+dNRe+sUwzVhxmxwT6HV77YvU+XwBrnSi Nx4Wv/NqwCuTav1QdLhoYQNrh+4xPI0YxseIDvb2NzFG3prh/io7gcsArfyn+jmV2TuD +tcGrvMup3TeGWOUWynTRcC/RjJi/0xWo1Uw/ZYUVIf0DGtuToIe4YGLNSgT79cXylZT 6kXg== X-Received: by 10.140.102.215 with SMTP id w81mr25589102qge.67.1411685204868; Thu, 25 Sep 2014 15:46:44 -0700 (PDT) Received: from ip-172-31-25-62.ec2.internal (ec2-54-85-57-1.compute-1.amazonaws.com. [54.85.57.1]) by mx.google.com with ESMTPSA id h30sm3192266qge.38.2014.09.25.15.46.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Sep 2014 15:46:44 -0700 (PDT) Sender: Mark Johnston Date: Thu, 25 Sep 2014 22:51:42 +0000 From: Mark Johnston To: Andriy Gapon Subject: Re: WITH_CTF vs -g Message-ID: <20140925225142.GC2501@ip-172-31-25-62.ec2.internal> References: <54108909.7050908@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54108909.7050908@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: freebsd-toolchain@FreeBSD.org, freebsd-dtrace@FreeBSD.org X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "A discussion list for developers working on DTrace in FreeBSD." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 22:46:46 -0000 On Wed, Sep 10, 2014 at 08:23:21PM +0300, Andriy Gapon wrote: > > In my opinion WITH_CTF should imply -g in CFLAGS otherwise, as far as I can see, > there is nothing to generate CTF data from. Forcing an end-user to remember to > additionally pass -g is not nice. > > Also, I think that we can always have -g in CTFFLAGS, because the stripping step > takes care of the original DWARF data in any case. But I am not 100% sure about > this. > > What do you think? > Thanks! Hi Andriy, Are you planning to go through with this? I was just about to post this exact question, but then I remembered that you already have. :) FWIW, the diff I have in mind is below. It also removes some checks that I think are unnecessary from bsd.{lib,prog}.mk. It is not fully tested, but seems to work for me. I'm also not sure about unconditionally passing -g to ctfconvert and ctfmerge. Thanks, -Mark diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index f0acf16..c6b689d 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -36,7 +36,7 @@ NO_WERROR= .if defined(DEBUG_FLAGS) CFLAGS+= ${DEBUG_FLAGS} -.if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != "" +.if ${MK_CTF} != "no" CTFFLAGS+= -g .endif .else diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index 486914b..32556a1 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -128,6 +128,7 @@ ____: .if ${MK_CTF} != "no" CTFCONVERT_CMD= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +DEBUG_FLAGS?= -g .elif defined(.PARSEDIR) || (defined(MAKE_VERSION) && ${MAKE_VERSION} >= 5201111300) CTFCONVERT_CMD= .else diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index 340950a..e4f7104 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -20,7 +20,7 @@ NO_WERROR= CFLAGS+=${DEBUG_FLAGS} CXXFLAGS+=${DEBUG_FLAGS} -.if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != "" +.if ${MK_CTF} != "no" CTFFLAGS+= -g .endif .endif From owner-freebsd-dtrace@FreeBSD.ORG Fri Sep 26 04:26:03 2014 Return-Path: Delivered-To: freebsd-dtrace@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6F09C72C for ; Fri, 26 Sep 2014 04:26:03 +0000 (UTC) Received: from nm45.bullet.mail.ne1.yahoo.com (nm45.bullet.mail.ne1.yahoo.com [98.138.120.52]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A1105FB for ; Fri, 26 Sep 2014 04:26:02 +0000 (UTC) Received: from [127.0.0.1] by nm45.bullet.mail.ne1.yahoo.com with NNFMP; 26 Sep 2014 04:25:56 -0000 Received: from [98.138.100.114] by nm45.bullet.mail.ne1.yahoo.com with NNFMP; 26 Sep 2014 04:22:55 -0000 Received: from [98.138.226.166] by tm105.bullet.mail.ne1.yahoo.com with NNFMP; 26 Sep 2014 04:22:55 -0000 Received: from [127.0.0.1] by omp1067.mail.ne1.yahoo.com with NNFMP; 26 Sep 2014 04:22:55 -0000 X-Yahoo-Newman-Property: ymail-4 X-Yahoo-Newman-Id: 841833.72936.bm@omp1067.mail.ne1.yahoo.com Received: (qmail 64546 invoked by uid 60001); 26 Sep 2014 04:22:55 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1411705375; bh=TYssddrGHEZPAeOgxVWNYOV4JfAQpMwIukZpAeWbqMo=; h=Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=Na3ZPpUtubXB12I9roObi5VowFyMU5UTwNRL9NUD1575KLJb8ZxGRrtmigKBGGqtjwqTMV8wzRsNyzOWs6Ka2LztaM8SeH8ij6ga1eL1K+KsDFf7BJQwF5YCGEuaCrdSpFjHA+4ThbRKH4hFbcRaRKsmL+kBRzx6rU6r19OS5VE= X-YMail-OSG: QP5i0uMVM1kCf_C94K0aXcBM3_gyAtDLoDDXL.TviMUP_Gw 8JINIn15VPAwTF3hRgm5rRGPmEXqDidapDqetRWK3jtq0rmk_0.y0b9f426F ZJBDDIAi_xJ_qYsfxY1AbpTY11AlxzFKytiULUtSs_iBQ_yxO1u98niwF5RW xl2qFWcDuEncYAXqnFoxDP22ow4H3nJdi5wTTEvCHJsmmPBIhSo6L1efg_mk _s3iLJCrSA2kVtkXtXaqpEYeKYJDyTjmUpvxaCZBl9yYemTpcu6Ac9ZFaf1p vCRsCWJMqlafUA0NCB5vkCdpCIjVTgAz.LyWz9rENIGDXjzfODKKR1HUa6ek DmrzjK1Ig0VPd3ORi0bBOQUv5mDQLgtbWgqBVn4iCzexmwSu7NqylxX2fdmo uHGg9gAgfE9elprmBBiCQmETFgskKJh6dVDjLNYvxAxrjoGRTpKdyi9wIGJL f87xPMnUzsM_57K6mbzuOYirBqbczrViSNvE1fPMYgpMIEQnk3ABx1NWOCs3 .E.IiLs9gP_eI3FEsbR0NefEamtHMHwtww18L99WgaVM_qRmksMW3tc1DTxl yXv7apShNcoQeb.aS2ZVigjHb5eo0c1z6ZlgdFKDRWUgec9pS7nmBLL5gTMC kTykUN1CFErGDc0ahCGRt8aFkKNm0vzIQhP9qH3HdkZX.G.V1jJZtAQtnX5P 1z.IChXagDQkG8wHmVTIoItoUYas- Received: from [72.163.216.217] by web122002.mail.ne1.yahoo.com via HTTP; Thu, 25 Sep 2014 21:22:55 PDT X-Rocket-MIMEInfo: 002.001, SGVsbG8gRXhwZXJ0cywKIApJIGFtIGEgZnJlZWJzZCBuZXdiaWUgYW5kIGhhdmluZyBhIHN0cmFuZ2UgaXNzdWUgb24gZnJlZWJzZCA5LjIgKEl0IGlzIEFNRDY0Cm1hY2hpbmUpLkkgYW0gbm90IGFibGUgdG8gZHRyYWNlIGZldyBsaWJjIGZ1bmN0aW9ucy4gRm9yIGV4YW1wbGUgSSBhbSBhYmxlIHRvCmR0cmFjZSBzdHJkdXAsIGJ1dCBjYWxsaW5nIGR0cmFjZSBmb3Igc3RybGVuIGNhdXNlcyBodW5nIHByb2Nlc3MuIEl0IGlzIDEwMCAlIHBlcmNlbnQgcmVwcm8tYWJsZS4gSXMgaXQKZXhwZWN0ZWQ_CiAKUHIBMAEBAQE- X-Mailer: YahooMailWebService/0.8.203.696 Message-ID: <1411705375.19660.YahooMailNeo@web122002.mail.ne1.yahoo.com> Date: Thu, 25 Sep 2014 21:22:55 -0700 From: madhava gaikwad Reply-To: madhava gaikwad Subject: [freebsd 9.2] dtrace causes hung process when called for strlen To: "freebsd-dtrace@freebsd.org" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "A discussion list for developers working on DTrace in FreeBSD." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 04:26:03 -0000 Hello Experts,=0A =0AI am a freebsd newbie and having a strange issue on fr= eebsd 9.2 (It is AMD64=0Amachine).I am not able to dtrace few libc function= s. For example I am able to=0Adtrace strdup, but calling dtrace for strlen = causes hung process. It is 100 % percent repro-able. Is it=0Aexpected?=0A = =0AProblem: high cpu, and hung process under dtrace when=0Acalling for strl= en. Somehow my sample program don=E2=80=99t crash, but the real=0Aapplicati= on crashes when I send ctrl+C to application running under dtrace.=0A =0A = PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU COMMAND= =0A25264 root 2 85 0 61268K 15244K RUN 0:26 43.99% dtr= ace=0A25265 root 1 47 0 10136K 1368K STOP 0:18 31.98% = sample=0A =0ASample program =0A$ cat sample.c=0A#include =0A#inclu= de =0A =0Aint main (void) {=0Aint i =3D 0;=0Afor (; i < 3; i++) {= =0A printf("calling strlen: %d\n", strlen("foobar"));=0A prin= tf("calling strdup: %s\n", strdup("foobar"));=0A }=0A return 0;=0A}= =0A =0AThe sample Makefile=0A$cat Makefile=0ACFLAGS=3D-I.=0ACFLAGS+=3D-fno-= omit-frame-pointer -g=0A =0Asamplemake: sample.c=0A gcc -o=0Asa= mple sample.c -I.=0A$=0A =0AThe sample D files=0A$ cat strdup.d=0Apid$targe= t::strdup:return=0A{=0A trace (arg1);=0A}=0A$ cat strlen.d=0Apid$target::= strlen:entry=0A{=0A trace (arg0);=0A}=0A =0A =0A$ date; dtrace -s strdup.= d -c=0A/tmp/sample; date=0AFri Sep 26 03:53:57 GMT 2014=0Adtrace: script 's= trdup.d' matched 1 probe=0Acalling strlen: 6=0Acalling strdup: foobar=0Acal= ling strlen: 6=0Acalling strdup: foobar=0Acalling strlen: 6=0Acalling strdu= p: foobar=0Adtrace: pid 26100 has exited=0ACPU ID FU= NCTION:NAME=0A 0 32060 strdup:return 34372624480= =0A 0 32060 strdup:return 34372624488=0A 0 320= 60 strdup:return 34372624496=0A =0AFri Sep 26 03:5= 3:57 GMT 2014=0A$ date ; dtrace -s strlen.d -c /tmp/sample=0A; date=0AFri S= ep 26 03:54:04 GMT 2014=0Adtrace: script 'strlen.d' matched 1 probe=0Acalli= ng strlen: 6=0ACPU ID FUNCTION:NAME=0A 0 32060 = strlen:entry 4196103=0A^C=0A =0AFri Sep 26 03:56= :42 GMT 2014=0A =0AAny help will be really appreciated. I am having dtrace = related=0Apatches from firefox email chain < https://lists.freebsd.org/pipe= rmail/freebsd-dtrace/2013-October/000107.html>. =0A =0AThis is an enterpris= e application and we cannot move to 10.0=0Arelease of freebsd at least for = now=0AThank you.=0AMadhava=0A From owner-freebsd-dtrace@FreeBSD.ORG Fri Sep 26 07:08:38 2014 Return-Path: Delivered-To: freebsd-dtrace@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2DCCF659 for ; Fri, 26 Sep 2014 07:08:38 +0000 (UTC) Received: from mail-pd0-x229.google.com (mail-pd0-x229.google.com [IPv6:2607:f8b0:400e:c02::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F3E03823 for ; Fri, 26 Sep 2014 07:08:37 +0000 (UTC) Received: by mail-pd0-f169.google.com with SMTP id p10so430181pdj.0 for ; Fri, 26 Sep 2014 00:08:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=JWVqRJmSTitQyD/P/W3qhxY0b+or+ltdKMwkqgUkNp0=; b=Jy6UeezNGCv9D8DhGTeXP/NTmm3r0lkfJztERB/EZyG5/6Pu0ldIFMGtRN+4jWsoSx FPqZ3csWqKreX1rzQ8x9eWZRYfrAgonxZtM9vnB74xK3XiQSv/XrvavowuhIu/w/Wxur wQL73ERw5TzeVVziDXSr8eTr9jR5StNCOUOVHbEGDMB7yxiQr0V2V4Q5cyLv3VLYIfvz w7IvL+WAl3+51yIM/Ij5EFVO/pBQ/brdAiip5bF85KFQ9z1fI77bNUcgxDN3/sr2P3cy noYjDDJJP+UXdyBF5Fk0/sNTIhsYwjb7aKgD4hHNUcNOO4OsNH9YFEteXtdCRKHoyMx3 3JEg== X-Received: by 10.69.29.43 with SMTP id jt11mr15297338pbd.92.1411715317344; Fri, 26 Sep 2014 00:08:37 -0700 (PDT) Received: from charmander.Belkin (c-66-235-3-150.sea.wa.customer.broadstripe.net. [66.235.3.150]) by mx.google.com with ESMTPSA id ah7sm3993546pbd.52.2014.09.26.00.08.36 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Sep 2014 00:08:36 -0700 (PDT) Sender: Mark Johnston Date: Fri, 26 Sep 2014 00:08:31 -0700 From: Mark Johnston To: madhava gaikwad Subject: Re: [freebsd 9.2] dtrace causes hung process when called for strlen Message-ID: <20140926070831.GA56476@charmander.Belkin> References: <1411705375.19660.YahooMailNeo@web122002.mail.ne1.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1411705375.19660.YahooMailNeo@web122002.mail.ne1.yahoo.com> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "freebsd-dtrace@freebsd.org" X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "A discussion list for developers working on DTrace in FreeBSD." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 07:08:38 -0000 On Thu, Sep 25, 2014 at 09:22:55PM -0700, madhava gaikwad via freebsd-dtrace wrote: > Hello Experts, > > I am a freebsd newbie and having a strange issue on freebsd 9.2 (It is AMD64 > machine).I am not able to dtrace few libc functions. For example I am able to > dtrace strdup, but calling dtrace for strlen causes hung process. It is 100 % percent repro-able. Is it > expected? Hi, I'm not sure what the exact problem is in your case, but 9.2 is missing a large number of fixes that have gone into userland DTrace support. Without them, I don't expect it to work reliably. I suggest trying 9.3 or the soon-to-be-released 10.1 instead. If you continue to run into problems after upgrading, please let us know. Thanks, -Mark > > Problem: high cpu, and hung process under dtrace when > calling for strlen. Somehow my sample program don’t crash, but the real > application crashes when I send ctrl+C to application running under dtrace. > > PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU COMMAND > 25264 root 2 85 0 61268K 15244K RUN 0:26 43.99% dtrace > 25265 root 1 47 0 10136K 1368K STOP 0:18 31.98% sample > > Sample program > $ cat sample.c > #include > #include > > int main (void) { > int i = 0; > for (; i < 3; i++) { > printf("calling strlen: %d\n", strlen("foobar")); > printf("calling strdup: %s\n", strdup("foobar")); > } > return 0; > } > > The sample Makefile > $cat Makefile > CFLAGS=-I. > CFLAGS+=-fno-omit-frame-pointer -g > > samplemake: sample.c > gcc -o > sample sample.c -I. > $ > > The sample D files > $ cat strdup.d > pid$target::strdup:return > { > trace (arg1); > } > $ cat strlen.d > pid$target::strlen:entry > { > trace (arg0); > } > > > $ date; dtrace -s strdup.d -c > /tmp/sample; date > Fri Sep 26 03:53:57 GMT 2014 > dtrace: script 'strdup.d' matched 1 probe > calling strlen: 6 > calling strdup: foobar > calling strlen: 6 > calling strdup: foobar > calling strlen: 6 > calling strdup: foobar > dtrace: pid 26100 has exited > CPU ID FUNCTION:NAME > 0 32060 strdup:return 34372624480 > 0 32060 strdup:return 34372624488 > 0 32060 strdup:return 34372624496 > > Fri Sep 26 03:53:57 GMT 2014 > $ date ; dtrace -s strlen.d -c /tmp/sample > ; date > Fri Sep 26 03:54:04 GMT 2014 > dtrace: script 'strlen.d' matched 1 probe > calling strlen: 6 > CPU ID FUNCTION:NAME > 0 32060 strlen:entry 4196103 > ^C > > Fri Sep 26 03:56:42 GMT 2014 > > Any help will be really appreciated. I am having dtrace related > patches from firefox email chain < https://lists.freebsd.org/pipermail/freebsd-dtrace/2013-October/000107.html>. > > This is an enterprise application and we cannot move to 10.0 > release of freebsd at least for now > Thank you. > Madhava > _______________________________________________ > freebsd-dtrace@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-dtrace > To unsubscribe, send any mail to "freebsd-dtrace-unsubscribe@freebsd.org" From owner-freebsd-dtrace@FreeBSD.ORG Fri Sep 26 14:01:31 2014 Return-Path: Delivered-To: freebsd-dtrace@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 61CFD2D5 for ; Fri, 26 Sep 2014 14:01:31 +0000 (UTC) Received: from nm45.bullet.mail.ne1.yahoo.com (nm45.bullet.mail.ne1.yahoo.com [98.138.120.52]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B72FF1F for ; Fri, 26 Sep 2014 14:01:30 +0000 (UTC) Received: from [127.0.0.1] by nm45.bullet.mail.ne1.yahoo.com with NNFMP; 26 Sep 2014 14:01:30 -0000 Received: from [98.138.101.128] by nm45.bullet.mail.ne1.yahoo.com with NNFMP; 26 Sep 2014 13:58:44 -0000 Received: from [98.138.89.199] by tm16.bullet.mail.ne1.yahoo.com with NNFMP; 26 Sep 2014 13:58:44 -0000 Received: from [127.0.0.1] by omp1057.mail.ne1.yahoo.com with NNFMP; 26 Sep 2014 13:58:44 -0000 X-Yahoo-Newman-Property: ymail-4 X-Yahoo-Newman-Id: 547596.3573.bm@omp1057.mail.ne1.yahoo.com Received: (qmail 66911 invoked by uid 60001); 26 Sep 2014 13:58:44 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1411739924; bh=qOl7Zh1ZWfwN8CuR/B2uAR7GnlPGq8doFkr8+hmKImA=; h=References:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=X16Adva5qs4F/fihIU3TqilqD9ZiM9QLTaxKwXQIbwoinTMp2A2QQm79YWnCMFPdOFBHOF4Lfhi4ej+a3HovTFke6BgjDOpRu+P6rPDA2yWBYSWyCyBl+W2m224m3F6F6sBrZMKwnKgnA4dhvJKoNaqhT3U74SdFNhMjXMoVJp8= X-YMail-OSG: u2fFXHkVM1mQG34jvPG3G_.FN3m6DV1n4cA8JsOcXEDuQRf fPpItVOCtPGOssDar2W13aBykP9AqyGwx3TV6KvB8I__g618wMosnW810PQl 5JHcN7ht0r33Gn_GueoGuL4tNpLDDQp5n7GNavNw7IvRAv5heR8vx1Uuj68P DlIRIhoyS2WeoY3TwtcRkFBfG3.MlqaHvi.abVZ27.WnGla.22LPbXMZCG8S 4sy7ufchEyjnI1ztAeZZHYV_pu12pjgVSNQSOtu0MI9wbKrl9ed4K9cjUpZF .NfcuGNOYVFA6kMSopgHFMHS7dEKXhPPIeW_LA7qFXB_7M5_uSwmtuP5l3mN VB._1JfNQ2z4SpN.ZyO5NX3gndZrGbWT4cXMyq06gY_dZHq80S4rOKoCZYVq SAsRZ7nRf6Ew0Qgl8oD2o4UZcUCAbrt9i8B9vKaSGHsYP_McLokkN6_Rl8dn 7WieYYhA_o39nzheAGAVtJbdL7KrhtPfleqD7ia8xZata2_11DizU3bcPrVA an2eAQJWxWJ3y4qXtdAd86OR3xqkENmDL41OBpOM0XFXdOR.DxCkKYYhS3XA ODbaXiwi6IEmYCaTM214zG6emPftz8g-- Received: from [182.74.147.174] by web122006.mail.ne1.yahoo.com via HTTP; Fri, 26 Sep 2014 06:58:44 PDT X-Rocket-MIMEInfo: 002.001, VGhhbmtzIGZvciB0aGUgcmVwbHkgTWFyay4gU28gaW4gTnV0c2hlbGwsIDkuMiBpcyBub3QgdGhlIHZlcnNpb24gY29tcGxldGVseSBzdXBwb3J0aW5nIGR0cmFjZSBmdW5jdGlvbmFsaXR5LiBJIGFtIG5vdCBzdXJlIGlmIEkgY2FuIGdldCBuZXh0IGZyZWVic2QgdmVyc2lvbiBmb3IgbXkgcHJvZHVjdCB0aGF0IHF1aWNrLiBJIHdpbGwgdHJ5IHRvIGFkZCBtb3JlIGRlYnVncyBpbnRvIHRob3NlIGZ1bmN0aW9ucyBhbmQgd2lsbCBzZWUgaWYgSSBjYW4gZ2V0IGFueXRoaW5nIGluIHNob3J0IHRpbWUuICAKCkEBMAEBAQE- X-Mailer: YahooMailWebService/0.8.203.696 References: <1411705375.19660.YahooMailNeo@web122002.mail.ne1.yahoo.com> <20140926070831.GA56476@charmander.Belkin> Message-ID: <1411739924.65670.YahooMailNeo@web122006.mail.ne1.yahoo.com> Date: Fri, 26 Sep 2014 06:58:44 -0700 From: madhava gaikwad Reply-To: madhava gaikwad Subject: Re: [freebsd 9.2] dtrace causes hung process when called for strlen To: Mark Johnston In-Reply-To: <20140926070831.GA56476@charmander.Belkin> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "freebsd-dtrace@freebsd.org" X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "A discussion list for developers working on DTrace in FreeBSD." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 14:01:31 -0000 Thanks for the reply Mark. So in Nutshell, 9.2 is not the version completel= y supporting dtrace functionality. I am not sure if I can get next freebsd = version for my product that quick. I will try to add more debugs into those= functions and will see if I can get anything in short time. =0A=0AAgain t= hanks for your help and pointers.=0A=0ACheers,=0AMadhava=0A=0A=0AOn Friday,= September 26, 2014 12:38 PM, Mark Johnston wrote:=0A = =0A=0A=0AOn Thu, Sep 25, 2014 at 09:22:55PM -0700, madhava gaikwad via free= bsd-dtrace wrote:=0A> Hello Experts,=0A> =0A> I am a freebsd newbie and ha= ving a strange issue on freebsd 9.2 (It is AMD64=0A> machine).I am not able= to dtrace few libc functions. For example I am able to=0A> dtrace strdup, = but calling dtrace for strlen causes hung process. It is 100 % percent repr= o-able. Is it=0A> expected?=0A=0AHi,=0A=0AI'm not sure what the exact probl= em is in your case, but 9.2 is missing=0Aa large number of fixes that have = gone into userland DTrace support. Without=0Athem, I don't expect it to wor= k reliably. I suggest trying 9.3 or the=0Asoon-to-be-released 10.1 instead.= If you continue to run into problems=0Aafter upgrading, please let us know= .=0A=0AThanks,=0A-Mark=0A=0A=0A> =0A> Problem: high cpu, and hung process = under dtrace when=0A> calling for strlen. Somehow my sample program don=E2= =80=99t crash, but the real=0A> application crashes when I send ctrl+C to a= pplication running under dtrace.=0A> =0A> PID USERNAME THR PRI NIC= E SIZE RES STATE TIME WCPU COMMAND=0A> 25264 root 2 = 85 0 61268K 15244K RUN 0:26 43.99% dtrace=0A> 25265 root = 1 47 0 10136K 1368K STOP 0:18 31.98% sample=0A> =0A> Sample pro= gram =0A> $ cat sample.c=0A> #include =0A> #include =0A>= =0A> int main (void) {=0A> int i =3D 0;=0A> for (; i < 3; i++) {=0A> = printf("calling strlen: %d\n", strlen("foobar"));=0A> printf("c= alling strdup: %s\n", strdup("foobar"));=0A> }=0A> return 0;=0A> }= =0A> =0A> The sample Makefile=0A> $cat Makefile=0A> CFLAGS=3D-I.=0A> CFLAG= S+=3D-fno-omit-frame-pointer -g=0A> =0A> samplemake: sample.c=0A> = gcc -o=0A> sample sample.c -I.=0A> $=0A> =0A> The sample D files=0A> = $ cat strdup.d=0A> pid$target::strdup:return=0A> {=0A> trace (arg1);=0A>= }=0A> $ cat strlen.d=0A> pid$target::strlen:entry=0A> {=0A> trace (arg0= );=0A> }=0A> =0A> =0A> $ date; dtrace -s strdup.d -c=0A> /tmp/sample; dat= e=0A> Fri Sep 26 03:53:57 GMT 2014=0A> dtrace: script 'strdup.d' matched 1 = probe=0A> calling strlen: 6=0A> calling strdup: foobar=0A> calling strlen: = 6=0A> calling strdup: foobar=0A> calling strlen: 6=0A> calling strdup: foob= ar=0A> dtrace: pid 26100 has exited=0A> CPU ID FUNCT= ION:NAME=0A> 0 32060 strdup:return 34372624480= =0A> 0 32060 strdup:return 34372624488=0A> 0 = 32060 strdup:return 34372624496=0A> =0A> Fri Sep= 26 03:53:57 GMT 2014=0A> $ date ; dtrace -s strlen.d -c /tmp/sample=0A> ; = date=0A> Fri Sep 26 03:54:04 GMT 2014=0A> dtrace: script 'strlen.d' matched= 1 probe=0A> calling strlen: 6=0A> CPU ID FUNCTION:N= AME=0A> 0 32060 strlen:entry 4196103=0A> ^= C=0A> =0A> Fri Sep 26 03:56:42 GMT 2014=0A> =0A> Any help will be really = appreciated. I am having dtrace related=0A> patches from firefox email chai= n < https://lists.freebsd.org/pipermail/freebsd-dtrace/2013-October/000107.= html>. =0A> =0A> This is an enterprise application and we cannot move to 1= 0.0=0A> release of freebsd at least for now=0A> Thank you.=0A> Madhava=0A> = _______________________________________________=0A> freebsd-dtrace@freebsd.= org mailing list=0A> https://lists.freebsd.org/mailman/listinfo/freebsd-dtr= ace=0A> To unsubscribe, send any mail to "freebsd-dtrace-unsubscribe@freebs= d.org=0A" From owner-freebsd-dtrace@FreeBSD.ORG Fri Sep 26 14:52:33 2014 Return-Path: Delivered-To: freebsd-dtrace@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 88B6ACF5; Fri, 26 Sep 2014 14:52:33 +0000 (UTC) Received: from vps.hungerhost.com (vps.hungerhost.com [216.38.53.176]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 57C607AA; Fri, 26 Sep 2014 14:52:32 +0000 (UTC) Received: from [92.247.20.226] (port=1327 helo=[172.16.19.1]) by vps.hungerhost.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.82) (envelope-from ) id 1XXWsp-0003Px-6W; Fri, 26 Sep 2014 10:52:31 -0400 From: "George Neville-Neil" To: "Mark Johnston" Subject: Re: WITH_CTF vs -g Date: Fri, 26 Sep 2014 17:52:24 +0300 Message-ID: <47C2BB52-E2DB-45B2-B6E1-3D05DAEFE32F@neville-neil.com> In-Reply-To: <20140925225142.GC2501@ip-172-31-25-62.ec2.internal> References: <54108909.7050908@FreeBSD.org> <20140925225142.GC2501@ip-172-31-25-62.ec2.internal> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=_MailMate_5AB27897-19E1-4FA4-AD53-58C31E8A8A55_="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Mailer: MailMate (1.8r4469) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps.hungerhost.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - neville-neil.com X-Get-Message-Sender-Via: vps.hungerhost.com: authenticated_id: gnn@neville-neil.com Cc: freebsd-toolchain@FreeBSD.org, freebsd-dtrace@FreeBSD.org, Andriy Gapon X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "A discussion list for developers working on DTrace in FreeBSD." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 14:52:33 -0000 This is an OpenPGP/MIME signed message (RFC 3156 and 4880). --=_MailMate_5AB27897-19E1-4FA4-AD53-58C31E8A8A55_= Content-Type: text/plain On 26 Sep 2014, at 1:51, Mark Johnston wrote: > On Wed, Sep 10, 2014 at 08:23:21PM +0300, Andriy Gapon wrote: >> >> In my opinion WITH_CTF should imply -g in CFLAGS otherwise, as far as I can see, >> there is nothing to generate CTF data from. Forcing an end-user to remember to >> additionally pass -g is not nice. >> >> Also, I think that we can always have -g in CTFFLAGS, because the stripping step >> takes care of the original DWARF data in any case. But I am not 100% sure about >> this. >> >> What do you think? >> Thanks! > > Hi Andriy, > > Are you planning to go through with this? I was just about to post this > exact question, but then I remembered that you already have. :) > > FWIW, the diff I have in mind is below. It also removes some checks that > I think are unnecessary from bsd.{lib,prog}.mk. It is not fully tested, > but seems to work for me. I'm also not sure about unconditionally > passing -g to ctfconvert and ctfmerge. > Mark, Can you put this up in Phabricator? reviews.freebsd.org Best, George > Thanks, > -Mark > > diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk > index f0acf16..c6b689d 100644 > --- a/share/mk/bsd.lib.mk > +++ b/share/mk/bsd.lib.mk > @@ -36,7 +36,7 @@ NO_WERROR= > .if defined(DEBUG_FLAGS) > CFLAGS+= ${DEBUG_FLAGS} > > -.if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != "" > +.if ${MK_CTF} != "no" > CTFFLAGS+= -g > .endif > .else > diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk > index 486914b..32556a1 100644 > --- a/share/mk/bsd.own.mk > +++ b/share/mk/bsd.own.mk > @@ -128,6 +128,7 @@ ____: > > .if ${MK_CTF} != "no" > CTFCONVERT_CMD= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} > +DEBUG_FLAGS?= -g > .elif defined(.PARSEDIR) || (defined(MAKE_VERSION) && ${MAKE_VERSION} >= 5201111300) > CTFCONVERT_CMD= > .else > diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk > index 340950a..e4f7104 100644 > --- a/share/mk/bsd.prog.mk > +++ b/share/mk/bsd.prog.mk > @@ -20,7 +20,7 @@ NO_WERROR= > CFLAGS+=${DEBUG_FLAGS} > CXXFLAGS+=${DEBUG_FLAGS} > > -.if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != "" > +.if ${MK_CTF} != "no" > CTFFLAGS+= -g > .endif > .endif > _______________________________________________ > freebsd-dtrace@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-dtrace > To unsubscribe, send any mail to "freebsd-dtrace-unsubscribe@freebsd.org" --=_MailMate_5AB27897-19E1-4FA4-AD53-58C31E8A8A55_= Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iEUEARECAAYFAlQlfagACgkQYdh2wUQKM9J8jACeKY01jUvP0JfdM2puK0ma8gyC YC0AmL8Jvyeb2cPVUMWJE8zUKuHvuPE= =08RQ -----END PGP SIGNATURE----- --=_MailMate_5AB27897-19E1-4FA4-AD53-58C31E8A8A55_=-- From owner-freebsd-dtrace@FreeBSD.ORG Fri Sep 26 15:59:40 2014 Return-Path: Delivered-To: freebsd-dtrace@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4AA67C4D; Fri, 26 Sep 2014 15:59:40 +0000 (UTC) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 1F36DE50; Fri, 26 Sep 2014 15:59:38 +0000 (UTC) Received: from porto.starpoint.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 SAA10883; Fri, 26 Sep 2014 18:59:36 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1XXXvk-000NvE-F1; Fri, 26 Sep 2014 18:59:36 +0300 Message-ID: <54258D30.8040107@FreeBSD.org> Date: Fri, 26 Sep 2014 18:58:40 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: Mark Johnston Subject: Re: WITH_CTF vs -g References: <54108909.7050908@FreeBSD.org> <20140925225142.GC2501@ip-172-31-25-62.ec2.internal> In-Reply-To: <20140925225142.GC2501@ip-172-31-25-62.ec2.internal> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: freebsd-toolchain@FreeBSD.org, freebsd-dtrace@FreeBSD.org X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "A discussion list for developers working on DTrace in FreeBSD." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 15:59:40 -0000 On 26/09/2014 01:51, Mark Johnston wrote: > On Wed, Sep 10, 2014 at 08:23:21PM +0300, Andriy Gapon wrote: >> >> In my opinion WITH_CTF should imply -g in CFLAGS otherwise, as far as I can see, >> there is nothing to generate CTF data from. Forcing an end-user to remember to >> additionally pass -g is not nice. >> >> Also, I think that we can always have -g in CTFFLAGS, because the stripping step >> takes care of the original DWARF data in any case. But I am not 100% sure about >> this. >> >> What do you think? >> Thanks! > > Hi Andriy, > > Are you planning to go through with this? I was just about to post this > exact question, but then I remembered that you already have. :) > > FWIW, the diff I have in mind is below. It also removes some checks that > I think are unnecessary from bsd.{lib,prog}.mk. It is not fully tested, > but seems to work for me. I'm also not sure about unconditionally > passing -g to ctfconvert and ctfmerge. Mark, your change looks like what I was thinking of. I will it a whirl here. Thank you! > diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk > index f0acf16..c6b689d 100644 > --- a/share/mk/bsd.lib.mk > +++ b/share/mk/bsd.lib.mk > @@ -36,7 +36,7 @@ NO_WERROR= > .if defined(DEBUG_FLAGS) > CFLAGS+= ${DEBUG_FLAGS} > > -.if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != "" > +.if ${MK_CTF} != "no" > CTFFLAGS+= -g > .endif > .else > diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk > index 486914b..32556a1 100644 > --- a/share/mk/bsd.own.mk > +++ b/share/mk/bsd.own.mk > @@ -128,6 +128,7 @@ ____: > > .if ${MK_CTF} != "no" > CTFCONVERT_CMD= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} > +DEBUG_FLAGS?= -g > .elif defined(.PARSEDIR) || (defined(MAKE_VERSION) && ${MAKE_VERSION} >= 5201111300) > CTFCONVERT_CMD= > .else > diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk > index 340950a..e4f7104 100644 > --- a/share/mk/bsd.prog.mk > +++ b/share/mk/bsd.prog.mk > @@ -20,7 +20,7 @@ NO_WERROR= > CFLAGS+=${DEBUG_FLAGS} > CXXFLAGS+=${DEBUG_FLAGS} > > -.if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != "" > +.if ${MK_CTF} != "no" > CTFFLAGS+= -g > .endif > .endif > -- Andriy Gapon