[Mono-list] Weird issue with Process.Start (works with MS .NET)
Anteru
newsgroups at catchall.shelter13.net
Tue Nov 17 03:42:19 EST 2009
Gonzalo Paniagua Javier schrieb:
> 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
> filled.
Ok, I'll give it a try. FWIW, the app in question does not write to
stderr at all (and I actually won't come to start BeginErrorReadLine as
I'm stuck in the Start() call and I never get out of it ... but I'll
double check that the app actually starts and tries to write something)
Cheers,
Anteru
More information about the Mono-list
mailing list