[Mono-list] Hang on Environment.Exit if there is any socket_io

Gregory Junker gjunker at dayark.com
Fri Feb 3 20:49:24 UTC 2012

Is it a hang (with 100% HW thread usage) in pthread_kill()? 


I get this on app exit only (so far) with a particular version of glibc
(which provides pthreads), specifically the version that comes with
RHEL6/CentOS6. My call stack however is through the GC, not through sockets,
but it would be interesting to know if the execution environments are
similar. I get this with 2.10.2 and 2.10.5, and plan to look deeper into the
causes here shortly.




From: mono-list-bounces at lists.ximian.com
[mailto:mono-list-bounces at lists.ximian.com] On Behalf Of David Evans
Sent: Friday, February 03, 2012 12:40 PM
To: mono-list at lists.ximian.com
Subject: [Mono-list] Hang on Environment.Exit if there is any socket_io


Hi All,


We're seeing a rare problem but frequent enough to be an issue for us, where
during an Environment.Exit() call to quit our application we hang and
generally there is one thread locked waiting for socket IO and we're hung
waiting for all threads to stop. In one case it was our logger thread trying
to write out logs so as a workaround we made sure to flush and close that
file before we exit. But sometimes it is from some remoting services that
the app provides that has open TCP connections, so next we'll start shutting
those down explicitly before we Exit(). So there is some kind of deadlock
that can occur it looks like when we Exit() with any pending IO.


Our app runs on linux. This occurs with both 2.6.4 and 2.10.6 (and we'll
start testing with 2.10.8 soon)


Anyone seen this before and have an easier workaround? Bug already filed
that you know of? I searched bugzilla on xamarin and didn't see anything, if
no one responds as a known issue I'll file a bug. 

Thanks much,


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-list/attachments/20120203/75f1604c/attachment.html>

More information about the Mono-list mailing list