poll function don't release all windows handle / possible memory leak

Thomas Stalder cygwinml@gmail.com
Wed Apr 20 13:22:00 GMT 2011


Hello,

Thanks for the fix.

I have made some tests with the CVS version and I don't have anymore
not closed Handle, but I still have a memory leaks.

I have made 2 testcases :

$ gcc server.c -o server
$ gcc server.c -Dnoleak -o servernoleak
$ gcc client.c -o client

I execute sever.exe and client.exe

after 1 minute I have 2992Ko memory used by server.exe (see
http://www.netsolux.ch/cyg/5.gif)
after about 10 minutes I have 5156Ko memory used by server.exe  (see
http://www.netsolux.ch/cyg/6.gif)

If I execute severnoleak.exe and client.exe I dont have memory leak.

The memory leak seem to be in the poll (select) function.

Regards,

Thomas

2011/4/18 Corinna Vinschen
> On Apr 18 11:35, Thomas Stalder wrote:
>> Hello,
>>
>> I have found that poll function don't release all windows handle (with
>> network socket) and generate memory leak.
>
> That's actually a pthread problem in conjunction with select (poll only
> calls select under the hood).  I applied a fix to CVS.  Thanks for the
> testcase!
>
>
> Corinna
>
> --
> Corinna Vinschen                  Please, send mails regarding Cygwin to
> Cygwin Project Co-Leader          cygwin AT cygwin DOT com
> Red Hat
>
> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: server.c
Type: text/x-csrc
Size: 5965 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20110420/0c5e70e2/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: client.c
Type: text/x-csrc
Size: 967 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20110420/0c5e70e2/attachment-0001.bin>
-------------- next part --------------
--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


More information about the Cygwin mailing list