-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test Failed: Process terminated. Assertion failed. "!_fileHandle.IsClosed" #13295
Comments
This looks more like a test issue/race (using a closed file handle). @danmosemsft is there someone to take a look? |
I took a deeper look at this. The error output is not specific enough to know which of the sub tests is actually failing, but the test calls out there is an inherent race: https://github.com/dotnet/corefx/blob/master/src/System.Diagnostics.Process/tests/ProcessStreamReadTests.cs#L99 Through code review and experimentation I attempted to induce the race, but was not able to get the failure that occurred above. I ran this test on Windows X64 against a Check and Release build of master and saw it consistently pass. I am going to close this issue for now and we should keep an eye on this test. |
This failed again in #31629 on
|
Configuration:
|
Configuration:
console.480ab2ef.log: dotnet.exe.5304.dmp: |
Starting: System.Diagnostics.Process.Tests (parallel test collections = on, max threads = 2) System.Diagnostics.Tests.ProcessStartInfoTests.StartInfo_WebPage [SKIP] Manual test System.Diagnostics.Tests.ProcessStartInfoTests.ShellExecute_Nano_Fails_Start [SKIP] Condition(s) not met: "IsWindowsNanoServer" Process terminated. Assertion failed. !_fileHandle.IsClosed at System.IO.FileStream.AssertCanRead() in /_/src/libraries/System.Private.CoreLib/src/System/IO/FileStream.Windows.cs:line 481 at System.IO.FileStream.ReadNative(Span`1 buffer) in /_/src/libraries/System.Private.CoreLib/src/System/IO/FileStream.Windows.cs:line 494 at System.IO.FileStream.ReadSpan(Span`1 destination) in /_/src/libraries/System.Private.CoreLib/src/System/IO/FileStream.Windows.cs:line 429 at System.IO.FileStream.Read(Byte[] array, Int32 offset, Int32 count) in /_/src/libraries/System.Private.CoreLib/src/System/IO/FileStream.cs:line 305 at System.IO.Stream.<>c.b__45_0(Object ) in /_/src/libraries/System.Private.CoreLib/src/System/IO/Stream.cs:line 383 at System.Threading.Tasks.Task`1.InnerInvoke() in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Future.cs:line 504 at System.Threading.Tasks.Task.<>c.<.cctor>b__274_0(Object obj) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 2350 at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs:line 289 at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 2314 at System.Threading.Tasks.Task.ExecuteEntryUnsafe(Thread threadPoolThread) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 2246 at System.Threading.Tasks.Task.ExecuteFromThreadPool(Thread threadPoolThread) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 2237 at System.Threading.ThreadPoolWorkQueue.Dispatch() in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPool.cs:line 659 at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback() in /_/src/coreclr/src/System.Private.CoreLib/src/System/Threading/ThreadPool.CoreCLR.cs:line 29 ----- end Sun 03/22/2020 10:41:17.68 ----- exit code -2146232797 ---------------------------------------------------------- |
I'm currently building a checked runtime to help validate, but I suspect the issue is that:
Assuming I'm right, the fix is to add WaitForExit() calls into the offending tests. |
@stephentoub can you help me understand the assert here? (I realize this is in Unix, and this bug concerns Windows).
It seems to me a confusing design that |
I'm not understanding the question. What's the confusion? That assert you highlighted is just saying that either the handle was set or that the timeout wasn't infinite: if it was infinite and the handle hadn't been set, the call wouldn't have returned. As for the bug, it's not specific to Windows. The relevant part is what comes after the code you listed above, where we only wait on the output streams if the timeout is infinite. |
Detail:
https://helix.dot.net/api/2019-06-17/jobs/0c15185a-2331-4dcf-978c-cd7c4a4b3189/workitems/System.Diagnostics.Process.Tests/console
Log:
The text was updated successfully, but these errors were encountered: