Hi Adam,
  I changed the D script to as follows. 
 
-----------------------------------------

#!/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:libmtmalloc.so.1:malloc_internal:return
/self->size/
{
 printf("\nmalloc Ptr=0x%p Size=%d", arg1, self->size);
 ustack();
 self->size = 0;
 self->trace = 0;
}

pid$1:libmtmalloc.so.1:oversize:return
/self->size/
{
  printf("\nmalloc Ptr=0x%p Size=%d", arg1, self->size);
  ustack();
  self->size = 0;
  self->trace = 0;
}

-----------------------------------------


But during running it, the error still occured,

-----------------------

# dtrace -qs ./mem2.d 13206
dtrace: error on enabled probe ID 3 (ID 49838: 
pid13206:libmtmalloc.so.1:malloc_internal:return): invalid address 
(0x1fdf72000) in action #3
dtrace: error on enabled probe ID 3 (ID 49838: 
pid13206:libmtmalloc.so.1:malloc_internal:return): invalid address 
(0x1fdf72000) in action #3
dtrace: error on enabled probe ID 3 (ID 49838: 
pid13206:libmtmalloc.so.1:malloc_internal:return): invalid address 
(0x1fdf72000) in action #3
dtrace: error on enabled probe ID 3 (ID 49838: 
pid13206:libmtmalloc.so.1:malloc_internal:return): invalid address 
(0x1fdf72000) in action #3
dtrace: error on enabled probe ID 3 (ID 49838: 
pid13206:libmtmalloc.so.1:malloc_internal:return): invalid address 
(0x1fd572000) in action #3
dtrace: error on enabled probe ID 3 (ID 49838: 
pid13206:libmtmalloc.so.1:malloc_internal:return): invalid address 
(0x1fd572000) in action #3

---------------------

The address "0x1fdf72000" apparently is wrong, does "malloc_internal:return" 
sometimes return a wrong address ? What is the "action #3" ? 

Thanks.
 

BRs 
LiJian


--
This message posted from opensolaris.org
_______________________________________________
dtrace-discuss mailing list
[email protected]

Reply via email to