[Mono-list] Weird issue with Process.Start (works with MS .NET)

Gonzalo Paniagua Javier gonzalo.mono at gmail.com
Mon Nov 16 17:16:22 EST 2009

On Thu, 2009-11-12 at 10:08 +0100, Anteru wrote:
> Hi,
> got a very weird problem with Process.Start here, and I don't know where
> to start debugging (first issues actually I ever had with Mono.) Problem
> appears like this, I set up a ProcessStartInfo, register the
> OutputDataReceived handler, and then I start the process using Start(),
> but unfortunately, Start() never returns and the app just hangs. Code
> looks like this:
>             p.Start();
> 		// Never comes here ...
>             p.BeginOutputReadLine();
> I tried it in an isolated test case, but no luck. Using the .NET Runtime
> on Windows it works flawlessly, while it hangs _every time_ using Mono.
> (Source code:
> http://gitorious.org/network/network/blobs/master/NetWork/Task/RunBinaryTask.cs)
> Might be related to the network stuff going on, or maybe because it's in
>  a ThreadPool :/ I tried to reproduce it in a smaller test case by
> starting a thread and trying to read (works), I also tried to run in a
> thread pool (works also), so there must be something in the app which
> breaks it, but I have no idea where to start debugging.
> I checked access rights, these are fine, and running the executable
> manually also works fine.

There's nothing in your code that could cause that problem. There's one
thing wrong though. If you redirect the standard error, you should call
BeginErrorReadLine() too or the process will block when the pipe is


More information about the Mono-list mailing list