[freebsd 9.2] dtrace causes hung process when called for strlen

madhava gaikwad alex_madhava at yahoo.com
Fri Sep 26 14:01:31 UTC 2014


Thanks for the reply Mark. So in Nutshell, 9.2 is not the version completely 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.  

Again thanks for your help and pointers.

Cheers,
Madhava


On Friday, September 26, 2014 12:38 PM, Mark Johnston <markj at FreeBSD.org> wrote:
 


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 at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-dtrace
> To unsubscribe, send any mail to "freebsd-dtrace-unsubscribe at freebsd.org
"


More information about the freebsd-dtrace mailing list