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.
I have a unit test in git://github.com/mono/monotorrent.git which demonstrates an issue with monos socket handling on MacOS. If you run the 'MonoTorrent.Client.MetadataModeTests.RequestMetadata' test, Mono will hang forever when Socket.Close is called. The sockets are created using the code here:
I have also modified this to set Socket.Linger to 'true' with a timeout of '0' which means that the socket should close immediately and not try to send any pending data, however this has no affect.
I have also tried calling Socket.ShutDown in addition to Socket.Close, but this does not help.
The stacktrace in GDB looks like:
#0 0x9971d2ea in close$UNIX2003 ()
#1 0x001e89b8 in socket_close (handle=0xd, data=0xb0f20b84) at sockets.c:97
#2 0x001d854b in _wapi_handle_unref_full (handle=0xd, ignore_private_busy_handles=0) at handles.c:1194
#3 0x001e8958 in closesocket (fd=13) at sockets.c:187
This looks very similar to my own personal nightmare, bug #6349 :-(
At least, it's good to know that more people are having this problem.
Closing ancient bugs, please reopen if you're still having this problem.