Bug 22613 - Socket leak from old FIXED status novel bug still present
Summary: Socket leak from old FIXED status novel bug still present
Alias: None
Product: Class Libraries
Classification: Mono
Component: mscorlib ()
Version: 3.6.0
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2014-09-03 16:00 UTC by paul firth
Modified: 2014-10-03 08:35 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

repro case for socket leak when running on centos 6 (677 bytes, text/plain)
2014-09-03 16:00 UTC, paul firth

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description paul firth 2014-09-03 16:00:36 UTC
Created attachment 7905 [details]
repro case for socket leak when running on centos 6

This bug:


Is still present in mono 3.6.0 running on centos 6 on linux. I cannot reproduce it in windows mono 3.3.0, so either this has reappeared between these versions, or is something specific to the linux version.

I've attached the same repro case from the original bug.

On windows mono 3.3.0, when running I get:


On centos 6, mono 3.3.6 when running I get:

"Instantiate 1021 sockets
System.Net.Sockets.SocketException: Too many open files
  at System.Net.Sockets.Socket..ctor (AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType) [0x00058] in /usr/local/src/mono-3.6.0/mcs/class/System/System.Net.Sockets/Socket_2_1.cs:953
  at Test.MainClass.Main (System.String[] args) [0x00000] in <filename unknown>:0"

This is also happening in my live apps; eventually it will just stop accepting connections and lsof will return reams and reams of this:

"mono    24690 root  305u  sock      0,6      0t0 98115947 can't identify protocol
mono    24690 root  306u  sock      0,6      0t0 98099198 can't identify protocol
mono    24690 root  307u  sock      0,6      0t0 98099428 can't identify protocol
mono    24690 root  308u  sock      0,6      0t0 98100147 can't identify protocol
mono    24690 root  309u  sock      0,6      0t0 98101952 can't identify protocol"

Cheers, Paul.
Comment 1 Rodrigo Kumpera 2014-10-03 08:35:33 UTC
This is not a bug. It's a limitation of the underlying system. Increase the rlimit of your system if you need that to work.