[Mono-dev] Potential problem with managed wrappers for compillers

Vorobiev Maksim MVorobiev at croc.ru
Mon Sep 12 14:12:50 EDT 2005


Good day.

Some time ago there was the post with patch for CSharpCodeCompiller.cs. It solves the rare problem in situation then long-run compillation terminates and ExitCode reads before compiller process actually ends. The solution was to change next code:
try {
        mcs.Start();
	// If there are a few kB in stdout, we might lock
	mcs_output=mcs.StandardError.ReadToEnd();
	mcs.StandardOutput.ReadToEnd ();
	mcs.WaitForExit();
} finally {
        results.NativeCompilerReturnValue = mcs.ExitCode;
	mcs.Close();
}

to this one:

try {
        mcs.Start();
	// If there are a few kB in stdout, we might lock
	mcs_output=mcs.StandardError.ReadToEnd();
	mcs.StandardOutput.ReadToEnd ();
	mcs.WaitForExit();
        results.NativeCompilerReturnValue = mcs.ExitCode;
} finally {
	mcs.Close();
}

so, the exit code reads only then no exception occurs - that is correct. This change was included with 1.1.9 version.

But I have found, that the same issue presents in VBCodeCompiller.cs and CodeCompiller.cs. This ma cause potential problem. Perhas, it'll be good to be changed in the same way as for C# compiller.

Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050912/69dd3f5e/attachment.html 


More information about the Mono-devel-list mailing list