Re: Re: 答复: [Samba] The memory maybe leak in samba 4.3.11

Zhangxiaoxu zhang.xiaoxu at h3c.com
Fri May 12 01:35:46 UTC 2017


Thanks a lot.

> Do you have processes in D state or processes using 100% CPU continuously?
Yes, if open the folder which is writing by itself and another client in windows explorer, the process will always in D state, and the CPU is higher.
I notice that, the client will send `change notify request`, then the smbd will receive a lot of message with code 0x310.
If the client receive the 'change notify response', it will send 'query directory request' to server.

> It might be that some message receiver does not pick up its messages at all.
Any idea about the case?

How do you think the solution:
keep the message queue length to 100 or more, and drop the other messages in 'queue_msg' function.


-----邮件原件-----
发件人: Volker Lendecke [mailto:Volker.Lendecke at SerNet.DE]
发送时间: 2017年5月11日 22:04
收件人: zhangxiaoxu 13123 (RD)
抄送: 'L.P.H. van Belle'; 'samba-technical at lists.samba.org'
主题: Re: 答复: [Samba] The memory maybe leak in samba 4.3.11

On Tue, May 09, 2017 at 02:59:51AM +0000, Zhangxiaoxu via samba-technical wrote:
> Use the valgrind, we found the stack of the malloc as below, so, maybe it is not memory leak.
>     ==2796353== 36,334,440 bytes in 100,929 blocks are still reachable in loss record 774 of 774
>     ==2796353==    at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
>     ==2796353==    by 0x953B88F: ??? (in /usr/lib/x86_64-linux-gnu/samba/libmessages-dgm.so.0)
>     ==2796353==    by 0x953BCA0: ??? (in /usr/lib/x86_64-linux-gnu/samba/libmessages-dgm.so.0)
>     ==2796353==    by 0x953C342: unix_msg_send (in /usr/lib/x86_64-linux-gnu/samba/libmessages-dgm.so.0)
>     ==2796353==    by 0x953E3B6: messaging_dgm_send (in /usr/lib/x86_64-linux-gnu/samba/libmessages-dgm.so.0)
>     ==2796353==    by 0x71732FF: messaging_send_iov_from (in /usr/lib/x86_64-linux-gnu/libsmbconf.so.0)
>     ==2796353==    by 0x716E1BA: ??? (in /usr/lib/x86_64-linux-gnu/libsmbconf.so.0)
>     ==2796353==    by 0x716E869: ??? (in /usr/lib/x86_64-linux-gnu/libsmbconf.so.0)
>     ==2796353==    by 0x716EA91: ??? (in /usr/lib/x86_64-linux-gnu/libsmbconf.so.0)
>     ==2796353==    by 0x7171207: ctdbd_migrate (in /usr/lib/x86_64-linux-gnu/libsmbconf.so.0)
>     ==2796353==    by 0x716BD6E: ??? (in /usr/lib/x86_64-linux-gnu/libsmbconf.so.0)
>         ==2796353==    by 0xAE6692F: ??? (in /usr/lib/x86_64-linux-gnu/samba/libdbwrap.so.0)
>
> Ifound the sendmsg is always failed because erron=EINTR, but smbd also need to malloc for the new msgs, so the res of the smbd grows up quickly.
>
> I add some code in unix_dgram_send_job, just send 10 times if sendmsg faild with EINTR, the res will not grows up anymore.
> Another, keep the max queue length to 100 also work well.
>
> I don’t know whether it is suitable for the process, also, I want to know why sendmsg return EINTR.
> Could you give us some suggestion about the case.

Do you have processes in D state or processes using 100% CPU continuously?

It might be that some message receiver does not pick up its messages at all.

Volker
-------------------------------------------------------------------------------------------------------------------------------------
本邮件及其附件含有杭州华三通信技术有限公司的保密信息,仅限于发送给上面地址中列出
的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、
或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本
邮件!
This e-mail and its attachments contain confidential information from H3C, which is
intended only for the person or entity whose address is listed above. Any use of the
information contained herein in any way (including, but not limited to, total or partial
disclosure, reproduction, or dissemination) by persons other than the intended
recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender
by phone or email immediately and delete it!


More information about the samba-technical mailing list