Hi,
    I am working on a hardware raid driver named cpqary3.
After some io operations, I run command "reboot -d "  to force to create 
a coredump file.
After the machine is up, ::findleaks found some mem leaks related to 
cpqary3 driver in the coredump.

> ::findleaks

CACHE LEAKED BUFCTL CALLER
ffffff01cb02b458 1 ffffff01d807ca90 cpqary3_init_ctlr+0x16c
ffffff01d7e3d458 1 ffffff0207f5e290 cralloc_flags+0x21
ffffff01cb030018 1 ffffff01d813e808 impl_acc_hdl_alloc+0x34
ffffff01cb030018 1 ffffff01da608b50 impl_acc_hdl_alloc+0x34
ffffff01cb02b018 1 ffffff01d7ff58d8 impl_acc_hdl_alloc+0x4a
ffffff01cb02e018 1 ffffff01d51673e0 impl_acc_hdl_alloc+0x64
ffffff01d7079458 1 ffffff01d813e070 rootnex_coredma_allochdl+0x5c
ffffff01d7079458 1 ffffff01da919388 rootnex_coredma_allochdl+0x5c
ffffff01d7079458 1 ffffff01fa5c6c08 rootnex_coredma_allochdl+0x84
ffffff01cb02e898 1 ffffff01e9a78df8 scsi_hba_probe+0x5c
ffffff01cb02f458 1 ffffff01da91adb0 uhci_polled_create_tw+0x2a

>  ffffff01d807ca90::bufctl -v

ADDR BUFADDR TIMESTAMP THREAD
CACHE LASTLOG CONTENTS
ffffff01d807ca90 ffffff01d710ad18 2504fa90af fffffffffbc2efe0
ffffff01cb02b458 ffffff01cd0c1080 ffffff01d14ce820
kmem_cache_alloc_debug+0x283
kmem_cache_alloc+0xa9
kmem_zalloc+0x6a
cpqary3_init_ctlr+0x16c
cpqary3_init_ctlr_resource+0x22
cpqary3_attach+0x149
devi_attach+0x80
attach_node+0x95
i_ndi_config_node+0xa5
i_ddi_attachchild+0x40
devi_attach_node+0xac
devi_config_one+0x2f3
ndi_devi_config_one+0xb4
resolve_pathname+0x164
ddi_pathname_to_dev_t+0x1f
>

 From the above results, We know for the first leak the buffer address 
is 0xffffff01d710ad18

>  *cpqary3_state::walk softstate|::print -at cpqary3_t drvr_replyq
ffffff01d51948a0 cpqary3_drvr_replyq_t *drvr_replyq = 0xffffff01d7f11e70
>  0xffffff01d7f11e70::print -at cpqary3_drvr_replyq_t phyctgp
ffffff01d7f11e9a struct cpqary3_phyctg *phyctgp = 0xffffff01d710ad18

Following the global variable "cpqary3_state", I found there is a pointer 
"phyctgp"
is pointer to the leaked buf address since the 
cpqary3_state->phyctgp->phyctgp==0xffffff01d710ad18

Since buffer(0xffffff01d710ad18) is point by pointer 
cpqary3_state->phyctgp->phyctgp

Why ::findleaks think this buffer is a mem leak?

Is it a bug in ::findleaks ?

Any responses are welcome!

Thanks,
Colin




-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.opensolaris.org/pipermail/mdb-discuss/attachments/20090909/1b51d9f8/attachment.html>

Reply via email to