help-gnutls
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Memory leaks are observed for libgnutls in multi-thread mode


From: tangtong
Subject: RE: Memory leaks are observed for libgnutls in multi-thread mode
Date: Mon, 19 Oct 2009 03:37:18 +0000

Hi,Nikos and Simon

I find out another condition for memory leaks beside -53 error is tls sessions's handshake process are interweaven together. If the hanshake of  tls sessions are finished before another session is launched,no memory leaks happen;
But if the handshake of tls sessions are interlaced and at the same time -53 error is observed, the memory leaks will happen. BTW, In my program, all tls session share the same credentials.

Regards
Tony


From: address@hidden
To: address@hidden
Date: Mon, 19 Oct 2009 03:11:07 +0000
CC: address@hidden; address@hidden
Subject: RE: Memory leaks are observed for libgnutls in multi-thread mode

Hi,Nikos

The attach is the log for 8tps/20tps, both have memory-leaks.

Regards
Tony


> Date: Sun, 18 Oct 2009 10:32:45 +0300
> From: address@hidden
> To: address@hidden
> CC: address@hidden; address@hidden
> Subject: Re: Memory leaks are observed for libgnutls in multi-thread mode
>
> tangtong wrote:
> > Hi,Nikos and Simon
> >
> > To verify the issue, I have configured my server to run as signle thread mode. Under high TPS, the memory leak still happen in gnutls_handshake, which means the root-cause is not caused by multi-thread.
> >
> > By more logs and analysis, I have the following findings:
> > Under high TPS, my server can't serve every session timely, which leads to the closure of the sockets by the clients for timeout reason. The write operation on the server side of the corresponding socket leads to broken pipe error. gnutls_handshake() reports GNUTLS_E_PUSH_ERROR, -53. As a result, the hand-shake stage of tls session is not finished successfully.
> >
> > After repeated testing, It is evident when aborted tls session caused by error -53 are observed, the memory leak happen.
> >
> > I have double check my codes, for these aborted session, I have called the gnutls_bye()/gnutls_deinit() function.
> >
> > My assumption now is for those session which has unfinished hand-shake stage, the resourses are not released properly in gnutls_handshake() for some reason.
>
> Could you for this (memory leak) scenario to send us debugging output of
> gnutls? To do that just add a logging function such as:
>
> static void
> tls_log_func (int level, const char *str)
> {
> fprintf (stderr, "|<%d>| %s", level, str);
> }
>
> and call those after initialization of gnutls.
> gnutls_global_set_log_function (tls_log_func);
> gnutls_global_set_log_level (2);
>
>
> regards,
> Nikos


更多热辣资讯尽在新版MSN首页! 立刻访问!

使用新一代 Windows Live Messenger 轻松交流和共享! 立刻下载!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]