Bug 32905

Summary: System.IO.IOException : Write fault on path ... during ProcessTest.DisposeWithDisposedStreams
Product: [Mono] Class Libraries Reporter: Alexander Köplinger <alex.koeplinger>
Component: SystemAssignee: Marek Safar <masafa>
Status: RESOLVED FIXED    
Severity: normal CC: masafa, mono-bugs+mono
Priority: ---    
Version: master   
Target Milestone: Untriaged   
Hardware: All   
OS: All   
Tags: Is this bug a regression?: ---
Last known good build:

Description Alexander Köplinger 2015-08-10 07:58:08 UTC
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?
Comment 1 Marek Safar 2015-08-19 08:14:04 UTC
Fixed in master