Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
Created attachment 7905 [details]
repro case for socket leak when running on centos 6
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"
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.