Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
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.
Please create a new report on
GitHub or Developer Community with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
We are using mono 18.104.22.168-0xamarin1 on ubuntu.
After the dispose of a System.Diagnostics.Process the VM often crashes with the following stack trace:
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'Stream has been closed'.
at System.IO.FileStream.BeginRead (System.Byte array, Int32 offset, Int32 numBytes, System.AsyncCallback userCallback, System.Object stateObject) <0x7f5f73f0c1a0 + 0x00235> in <filename unknown>:0
at System.Diagnostics.AsyncStreamReader.ReadBuffer (IAsyncResult ar) <0x4135bee0 + 0x00425> in <filename unknown>:0
at System.IO.Stream+ReadWriteTask.InvokeAsyncCallback (System.Object completedTask) <0x7f5f73d6b920 + 0x0004f> in <filename unknown>:0
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) <0x7f5f73e5a990 + 0x00178> in <filename unknown>:0
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) <0x7f5f73e5a960 + 0x00020> in <filename unknown>:0
at System.IO.Stream+ReadWriteTask.System.Threading.Tasks.ITaskCompletionAction.Invoke (System.Threading.Tasks.Task completingTask) <0x7f5f73d6b990 + 0x00103> in <filename unknown>:0
at System.Threading.Tasks.Task.FinishContinuations () <0x7f5f73e497e0 + 0x00214> in <filename unknown>:0
at System.Threading.Tasks.Task.FinishStageThree () <0x7f5f73e47bf0 + 0x00068> in <filename unknown>:0
at System.Threading.Tasks.Task.FinishStageTwo () <0x7f5f73e47a90 + 0x00133> in <filename unknown>:0
at System.Threading.Tasks.Task.Finish (Boolean bUserDelegateExecuted) <0x7f5f73e478f0 + 0x0008d> in <filename unknown>:0
at System.Threading.Tasks.Task.ExecuteWithThreadLocal (System.Threading.Tasks.Task& currentTaskSlot) <0x7f5f73e48620 + 0x00131> in <filename unknown>:0
at System.Threading.Tasks.Task.ExecuteEntry (Boolean bPreventDoubleExecution) <0x7f5f73e484c0 + 0x000ee> in <filename unknown>:0
at System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () <0x7f5f73e48440 + 0x0000e> in <filename unknown>:0
at System.Threading.ThreadPoolWorkQueue.Dispatch () <0x7f5f73e5f2e0 + 0x001d6> in <filename unknown>:0
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () <0x7f5f73e60bf0 + 0x00008> in <filename unknown>:0
This behaviour could not be confirmed for Mono "Stable 22.214.171.124/832de4b".
Maybe the process dispose, which only sets the streams to null, leaves the responsibility for the dispose of the streams to the GC which leads to a wrong dispose sequence of the streams. This might allow the AsyncStreamReader to read more data after the underlying stream has already been closed by the GC.
standardOutput = null;
standardInput = null;
standardError = null;
output = null; // AsyncStreamReader
error = null; // AsyncStreamReader
Maybe this PR which was merged into the mono-4.3.2-branch is related to this behaviour:
Could you provide some steps how to reproduce the issue?
We have not received the requested information. If you are still experiencing this issue please provide all the requested information and reopen the bug report.