Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Sep 2014 21:22:55 -0700
From:      madhava gaikwad <alex_madhava@yahoo.com>
To:        "freebsd-dtrace@freebsd.org" <freebsd-dtrace@freebsd.org>
Subject:   [freebsd 9.2] dtrace causes hung process when called for strlen
Message-ID:  <1411705375.19660.YahooMailNeo@web122002.mail.ne1.yahoo.com>

next in thread | raw e-mail | index | archive | help
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 <stdio.h>=0A#inclu=
de <string.h>=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: <owner-freebsd-dtrace@FreeBSD.ORG>
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 <freebsd-dtrace@freebsd.org>; 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 <freebsd-dtrace@freebsd.org>; Fri, 26 Sep 2014 07:08:37 +0000 (UTC)
Received: by mail-pd0-f169.google.com with SMTP id p10so430181pdj.0
 for <freebsd-dtrace@freebsd.org>; 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 <multiple recipients>
 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 26 Sep 2014 00:08:36 -0700 (PDT)
Sender: Mark Johnston <markjdb@gmail.com>
Date: Fri, 26 Sep 2014 00:08:31 -0700
From: Mark Johnston <markj@FreeBSD.org>
To: madhava gaikwad <alex_madhava@yahoo.com>
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" <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."
 <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 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 <stdio.h>
> #include <string.h>
>  
> 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"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1411705375.19660.YahooMailNeo>