Date: Fri, 26 Sep 2014 06:58:44 -0700 From: madhava gaikwad <alex_madhava@yahoo.com> To: Mark Johnston <markj@FreeBSD.org> Cc: "freebsd-dtrace@freebsd.org" <freebsd-dtrace@freebsd.org> Subject: Re: [freebsd 9.2] dtrace causes hung process when called for strlen Message-ID: <1411739924.65670.YahooMailNeo@web122006.mail.ne1.yahoo.com> In-Reply-To: <20140926070831.GA56476@charmander.Belkin> References: <1411705375.19660.YahooMailNeo@web122002.mail.ne1.yahoo.com> <20140926070831.GA56476@charmander.Belkin>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <markj@FreeBSD.org> 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 <stdio.h>=0A> #include <string.h>=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: <owner-freebsd-dtrace@FreeBSD.ORG> 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 <gnn@neville-neil.com>) id 1XXWsp-0003Px-6W; Fri, 26 Sep 2014 10:52:31 -0400 From: "George Neville-Neil" <gnn@neville-neil.com> To: "Mark Johnston" <markj@FreeBSD.org> 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 <avg@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." <freebsd-dtrace.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-dtrace>, <mailto:freebsd-dtrace-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/freebsd-dtrace/> List-Post: <mailto:freebsd-dtrace@freebsd.org> List-Help: <mailto:freebsd-dtrace-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-dtrace>, <mailto:freebsd-dtrace-request@freebsd.org?subject=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 @@ __<bsd.own.mk>__: > > .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_=--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1411739924.65670.YahooMailNeo>