[Mono-dev] Socket.Accept() causes [1]+ Stopped

DJL djleehaha at googlemail.com
Tue Sep 27 09:28:50 EDT 2011

Hi everyone, first post on here.

I'm getting a bizzarre behaviour and I'm hoping you guys can help.
Sorry if this is the wrong place to post this.

Short version:
Calling Socket.Accept() is causing my application to freeze. A commandline
"fg" resumes it.

Long version:
Ok so I have a multi-threaded, Multi DLL  application.
Several of these DLLs are calling Socket.Accept() without issue.
However the newest of these is causing the application to stop every time.
The commandline shows "[1]+  Stopped" and no other output.
typing "fg" causes the application to continue as if nothing happened.

Here is an excerpt from my code:

Log(9, "pcsBash.Start()");
Log(9, "<");
stStdIn = pcsBash.StandardInput.BaseStream;
stStdErr = pcsBash.StandardOutput.BaseStream;
Log(9, "Accept()");
sktStdOut = sktStdOutListen.Accept();
Log(9, "<");
stStdOut = new System.Net.Sockets.NetworkStream(sktStdOut, true);
Log(9, "<");/

Looking in the log when it stops (before typing fg) the last entry is
(And yes the log is being flushed after each line).

It is always in this same place, which leads me to suspect it is NOT one of
the other threads causing this.

Anyone have any ideas what could possibly cause this?

Incidentally - the same code running on Windows in Microsoft's .Net does not
do anything out of the ordinary - although I imagine if it did the symptoms
might be quite different?

Once again, thanks for any help you can give on this baffling issue

System info:

/#mono --version
Mono JIT compiler version 2.8.2 (tarball Wed Feb 23 09:31:21 UTC 2011)
Copyright (C) 2002-2010 Novell, Inc and Contributors. www.mono-project.com
        TLS:           __thread
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  amd64
        Disabled:      none
        Misc:          debugger softdebug
        LLVM:          supported, not enabled.
        GC:            Included Boehm (with typed GC and Parallel Mark)
#uname -a
Linux svn #1 SMP PREEMPT 2011-07-21 02:17:24 +0200
x86_64 x86_64 x86_64 GNU/Linux

View this message in context: http://mono.1490590.n4.nabble.com/Socket-Accept-causes-1-Stopped-tp3847351p3847351.html
Sent from the Mono - Dev mailing list archive at Nabble.com.

More information about the Mono-devel-list mailing list