The error invalid address seems to me coming when the
pid$1::oversize:entry fires. It only has one argument but
you seem to be looking for arg1 - the second argument.

Also not sure how the script runs as you would need the
-w option for enabling destructive probes to be able to
run the system("date") action.

In fact a better way to print the date is by using the
walltimestamp. Using printf("Date: %Y\n", walltimestamp);

HTHs

Angelo

LiJIan wrote:
> Thank you very much for your help, Adam.
> Now I write another script to check memory leak issue as follows, it works 
> well, but during runing I see some error output on screen such as "dtrace: 
> error on enabled probe ID 3 (ID 49838: 
> pid6918:libmtmalloc.so.1:malloc_internal:return): invalid address 
> (0x1fdc78000) in action #3".   
> Do you know why the error occur?  Does the error affect the output of the D 
> script, or I still can take use of output of the D script for memory leak 
> analysis ?  
> Thanks again.
> 
> -------------------
> #!/usr/sbin/dtrace -s
> 
> pid$1:libmtmalloc.so.1:malloc:entry
> {
>  self->trace = 1;
>  self->size = arg0;
> }
> 
> pid$1:libmtmalloc.so.1:free:entry
> /arg0 != 0/
> {
>  printf("\nfree Ptr=0x%p ", arg0);
> }
> 
> pid$1::malloc_internal:return,
> pid$1::oversize:entry
> /self->size/
> {
>  printf("\nmalloc Ptr=0x%p Size=%d", arg1, self->size);
>  ustack();
>  system("date");
>  self->size = 0;
>  self->trace = 0;
> }
> ---------------------
> 
> 
> BRs
> LiJian
> 
> 
> --
> This message posted from opensolaris.org
> _______________________________________________
> dtrace-discuss mailing list
> [email protected]

_______________________________________________
dtrace-discuss mailing list
[email protected]

Reply via email to