Run the following in mono/mcs/class/System:
> while [ $? -eq 0 ]; do make check TESTNAME=System.Diagnostics.ProcessTest.DisposeWithDisposedStreams; done
After a few iterations, it'll fail with:
> Test Case Failures:
> 1) MonoTests.System.Diagnostics.ProcessTest.DisposeWithDisposedStreams : System.IO.IOException : Write fault on path /home/alexander/dev/mono/mcs/class/System/[Unknown]
> at System.IO.FileStream.WriteInternal (System.Byte src, Int32 offset, Int32 count) [0x00097] in /home/alexander/dev/mono/mcs/class/corlib/System.IO/FileStream.cs:652
> at System.IO.FileStream.Write (System.Byte array, Int32 offset, Int32 count) [0x000a5] in /home/alexander/dev/mono/mcs/class/corlib/System.IO/FileStream.cs:628
> at System.IO.StreamWriter.Flush (Boolean flushStream, Boolean flushEncoder) [0x00055] in /home/alexander/dev/mono/external/referencesource/mscorlib/system/io/streamwriter.cs:323
> at System.IO.StreamWriter.set_AutoFlush (Boolean value) [0x00013] in /home/alexander/dev/mono/external/referencesource/mscorlib/system/io/streamwriter.cs:347
> at System.Diagnostics.Process.Start_noshell (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) [0x00406] in /home/alexander/dev/mono/mcs/class/System/System.Diagnostics/Process.cs:1139
> at System.Diagnostics.Process.Start_common (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) [0x0008b] in /home/alexander/dev/mono/mcs/class/System/System.Diagnostics/Process.cs:1190
> at System.Diagnostics.Process.Start (System.Diagnostics.ProcessStartInfo startInfo) [0x0001e] in /home/alexander/dev/mono/mcs/class/System/System.Diagnostics/Process.cs:1210
> at MonoTests.System.Diagnostics.ProcessTest.DisposeWithDisposedStreams () [0x0001c] in /home/alexander/dev/mono/mcs/class/System/Test/System.Diagnostics/ProcessTest.cs:937
> at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object,System.Exception&)
> at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object parameters, System.Globalization.CultureInfo culture) [0x00038] in /home/alexander/dev/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:295
I don't think it's a problem with the test itself, as it basically just does Process.Start at that point, so I think it's a bug somewhere in FileStream. Maybe related to the recent move to SafeFileHandle?
Note: I can't seem to reproduce this outside of the testsuite (i.e. by copying the code into a console app).
CCing Marek as he added the test, maybe he has some insights?
Fixed in master
Notice (2018-05-21): bugzilla.xamarin.com will be
switching to read-only mode on Thursday, 2018-05-25 22:00 UTC.
Please join us on
Visual Studio Developer Community and
GitHub to continue tracking
issues. Bugzilla will remain available for reference in read-only mode.
We will continue to work on open Bugzilla bugs and copy them to the new
locations as needed for follow-up. The See Also field
on each Bugzilla bug will be updated with a link to its new location
After Bugzilla is read-only, if you have new information to add for a
bug that does not yet have a matching issue on Developer Community or
GitHub, you can create a follow-up issue in the new location. Copy and
paste the title and description from this bug, and then add your new
details. You can get a pre-formatted version of the title and
In special cases you might also want the comments:
Our sincere thanks to everyone who has contributed on this bug tracker
over the years. Thanks also for your understanding as we make these
adjustments and improvements for the future.