ID Area Title Description 24597 area-System.Net HttpWebRequest Not Supported HTTP/1.0? ``` HttpRequest = (HttpWebRequest)WebRequest.CreateHttp(url); HttpRequest.Method = method; HttpRequest.ProtocolVersion = System.Net.HttpVersion.Version10; ``` Parameter 1.0 is specified, but is not valid Analysis of Using wireshark is still 1.1 24598 area-System.Diagnostics System.Diagnostics.Tests.ProcessCollectionTests.TestThreadCollectionBehavior failed in CI Failed test: System.Diagnostics.Tests.ProcessCollectionTests.TestThreadCollectionBehavior Configuration: osx10.12_debug Detail: https://ci.dot.net/job/dotnet_corefx/job/master/job/osx10.12_debug/3296/testReport/System.Diagnostics.Tests/ProcessCollectionTests/TestThreadCollectionBehavior/ MESSAGE: ~~~ System.IndexOutOfRangeException : Index was outside the bounds of the array. ~~~ STACK TRACE: ~~~ at System.Diagnostics.Tests.ProcessCollectionTests.TestThreadCollectionBehavior() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_debug/src/System.Diagnostics.Process/tests/ProcessCollectionTests.cs:line 95 ~~~ 24599 area-System.Diagnostics System.Diagnostics.Tests.ProcessStartInfoTests.TestEnvironmentOfChildProcess failed in CI Failed test: System.Diagnostics.Tests.ProcessStartInfoTests.TestEnvironmentOfChildProcess Configuration: osx10.12_debug Detail: https://ci.dot.net/job/dotnet_corefx/job/master/job/osx10.12_debug/3296/testReport/System.Diagnostics.Tests/ProcessStartInfoTests/TestEnvironmentOfChildProcess/ MESSAGE: Expected: HUDSON_COOKIE=2b6c4278-574d-442d-ad2f-c878bb995f20, WORKSPACE=/Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_debug, LANG=en_US.UTF-8, BUILD_TAG=jenkins-dotnet_corefx-master-osx10.12_debug-3296, GitBranchOrCommit=*/master, BUILD_NUMBER=3296, JOB_DISPLAY_URL=https://ci.dot.net/job/dotnet_corefx/job/master/job/osx10.12_debug/display/redirect, GIT_PREVIOUS_COMMIT=3143b836af48be68d3b02b45188b134dca25b27c, EXECUTION_DIR=/Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_debug/bin/tests/System.Diagnostics.Process.Tests/netcoreapp-OSX-Debug-x64, JENKINS_SERVER_COOKIE=637e320b5b282ff8, HOME=/Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_debug/tempHome, XPC_FLAGS=0x0, BranchName=master, SHLVL=7, QualifiedRepoName=dotnet/corefx, BUILD_TIMESTAMP=2017-10-11 21:36:27 PDT, HUDSON_SERVER_COOKIE=637e320b5b282ff8, GithubProjectName=corefx, GIT_BRANCH=origin/master, NODE_LABELS=dci-mac-build-054 dtap osx-10.12, OLDPWD=/Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_debug/src/System.Diagnostics.Process/tests, JENKINS_HOME=/jenkins, BUILD_DISPLAY_NAME=#3296, GIT_PREVIOUS_SUCCESSFUL_COMMIT=3143b836af48be68d3b02b45188b134dca25b27c, _=/Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_debug/bin/testhost/netcoreapp-OSX-Debug-x64//dotnet, CORECLR_SERVER_GC=0, com.apple.java.jvmTask=CommandLine, JAVA_ARCH=x86_64, HUDSON_URL=https://ci.dot.net/, BUILD_URL=https://ci.dot.net/job/dotnet_corefx/job/master/job/osx10.12_debug/3296/, __BUILDTOOLS_USE_CSPROJ=true, AutoSaveReproEnv=false, MSBuildLoadMicrosoftTargetsReadOnly=true, XPC_SERVICE_NAME=0, MSBuildForwardPropertiesFromChild=TargetPath, JENKINS_URL=https://ci.dot.net/, LC_ALL=en_US.UTF-8, RUNTIME_PATH=/Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_debug/bin/testhost/netcoreapp-OSX-Debug-x64/, GIT_COMMIT=882303fc6863f3cfd86c6860c37fd898905d781f, BUILD_ID=3296, PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin, NODE_NAME=dci-mac-build-054, EXECUTOR_NUMBER=0, DOTNET_CLI_TELEMETRY_PROFILE=IsInternal_CIServer;dotnet/corefx, GIT_URL=https://github.com/dotnet/corefx.git, __CF_USER_TEXT_ENCODING=0x0:0:0, JOB_URL=https://ci.dot.net/job/dotnet_corefx/job/master/job/osx10.12_debug/, JAVA_MAIN_CLASS_66742=hudson.remoting.Launcher, HUDSON_HOME=/jenkins, JOB_BASE_NAME=osx10.12_debug, TestEnvironmentOfChildProcess_SpecialStuff=ሴ\n噸, RUN_CHANGES_DISPLAY_URL=https://ci.dot.net/job/dotnet_corefx/job/master/job/osx10.12_debug/3296/display/redirect?page=changes, PWD=/Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_debug/bin/tests/System.Diagnostics.Process.Tests/netcoreapp-OSX-Debug-x64, RUN_DISPLAY_URL=https://ci.dot.net/job/dotnet_corefx/job/master/job/osx10.12_debug/3296/display/redirect, JOB_NAME=dotnet_corefx/master/osx10.12_debug, GithubOrgName=dotnet\n Actual: \n Expected: True\n Actual: False STACK TRACE: at System.Diagnostics.Tests.ProcessStartInfoTests.TestEnvironmentOfChildProcess() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_debug/src/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs:line 225 24600 area-System.Diagnostics System.Diagnostics.Tests.ProcessStreamReadTests.TestAsyncErrorStream failed in CI Failed test: System.Diagnostics.Tests.ProcessStreamReadTests.TestAsyncErrorStream Configuration: osx10.12_debug Detail: https://ci.dot.net/job/dotnet_corefx/job/master/job/osx10.12_debug/3296/testReport/System.Diagnostics.Tests/ProcessStreamReadTests/TestAsyncErrorStream/ MESSAGE: ~~~ Assert.Equal() Failure\n ↓ (pos 0)\nExpected: System.Diagnostics.Process.Tests started ···\nActual: A fatal error occurred, the required libr···\n ↑ (pos 0) ~~~ STACK TRACE: ~~~ at System.Diagnostics.Tests.ProcessStreamReadTests.TestAsyncErrorStream() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_debug/src/System.Diagnostics.Process/tests/ProcessStreamReadTests.cs:line 50 ~~~ 24601 area-System.Diagnostics System.Diagnostics.Tests.ProcessTests.TestBasePriorityOnUnix failed in CI Failed tests: * System.Diagnostics.Tests.ProcessTests.TestBasePriorityOnUnix * System.Diagnostics.Tests.ProcessStreamReadTests.TestAsyncErrorStream Configuration: osx10.12_debug Detail: * https://ci.dot.net/job/dotnet_corefx/job/master/job/osx10.12_debug/3296/testReport/System.Diagnostics.Tests/ProcessTests/TestBasePriorityOnUnix/ * https://ci.dot.net/job/dotnet_corefx/job/master/job/osx10.12_debug/3296/testReport/System.Diagnostics.Tests/ProcessStreamReadTests/TestAsyncErrorStream/ MESSAGE: (System.Diagnostics.Tests.ProcessTests.TestBasePriorityOnUnix) ~~~ System.ComponentModel.Win32Exception : No such process ~~~ STACK TRACE: ~~~ at System.Diagnostics.Process.get_PriorityClassCore() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_debug/src/System.Diagnostics.Process/src/System/Diagnostics/Process.Unix.cs:line 196 at System.Diagnostics.Process.get_PriorityClass() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_debug/src/System.Diagnostics.Process/src/System/Diagnostics/Process.cs:line 466 at System.Diagnostics.Tests.ProcessTests.TestBasePriorityOnUnix() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_debug/src/System.Diagnostics.Process/tests/ProcessTests.Unix.cs:line 238 ~~~ MESSAGE: (System.Diagnostics.Tests.ProcessStreamReadTests.TestAsyncErrorStream) ~~~ Assert.Equal() Failure\n ↓ (pos 0)\nExpected: System.Diagnostics.Process.Tests started ···\nActual: A fatal error occurred, the required libr···\n ↑ (pos 0) ~~~ STACK TRACE: ~~~ at System.Diagnostics.Tests.ProcessStreamReadTests.TestAsyncErrorStream() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_debug/src/System.Diagnostics.Process/tests/ProcessStreamReadTests.cs:line 50 ~~~ 24602 area-System.Diagnostics System.Diagnostics.Tests.ProcessThreadTests.TestThreadStateProperty failed in CI Failed test: System.Diagnostics.Tests.ProcessThreadTests.TestThreadStateProperty Configuration: osx10.12_debug Detail: https://ci.dot.net/job/dotnet_corefx/job/master/job/osx10.12_debug/3296/testReport/System.Diagnostics.Tests/ProcessThreadTests/TestThreadStateProperty/ MESSAGE: ~~~ System.ArgumentOutOfRangeException : Index was out of range. Must be non-negative and less than the size of the collection.\nParameter name: index ~~~ STACK TRACE: ~~~ at System.Collections.ArrayList.get_Item(Int32 index) at System.Diagnostics.ProcessThreadCollection.get_Item(Int32 index) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_debug/src/System.Diagnostics.Process/src/System/Diagnostics/ProcessThreadCollection.cs:line 35 at System.Diagnostics.Tests.ProcessThreadTests.TestThreadStateProperty() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_debug/src/System.Diagnostics.Process/tests/ProcessThreadTests.cs:line 199 ~~~ 24603 area-System.Diagnostics System.Diagnostics.Tests.ProcessWaitingTests.SingleProcess_EnableRaisingEvents_CorrectExitCode failed in CI Failed test: System.Diagnostics.Tests.ProcessWaitingTests.SingleProcess_EnableRaisingEvents_CorrectExitCode Configuration: osx10.12_debug Detail: https://ci.dot.net/job/dotnet_corefx/job/master/job/osx10.12_debug/3296/testReport/System.Diagnostics.Tests/ProcessWaitingTests/SingleProcess_EnableRaisingEvents_CorrectExitCode_exitCode__0_/ MESSAGE: ~~~ Assert.Equal() Failure\nExpected: 0\nActual: 131 ~~~ STACK TRACE: ~~~ at System.Diagnostics.Tests.ProcessWaitingTests.<SingleProcess_EnableRaisingEvents_CorrectExitCode>d__6.MoveNext() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_debug/src/System.Diagnostics.Process/tests/ProcessWaitingTests.cs:line 123 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in /Users/buildagent/agent/_work/153/s/src/mscorlib/src/System/Runtime/ExceptionServices/ExceptionServicesCommon.cs:line 130 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in /Users/buildagent/agent/_work/153/s/src/mscorlib/src/System/Runtime/CompilerServices/TaskAwaiter.cs:line 152 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in /Users/buildagent/agent/_work/153/s/src/mscorlib/src/System/Runtime/ExceptionServices/ExceptionServicesCommon.cs:line 130 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in /Users/buildagent/agent/_work/153/s/src/mscorlib/src/System/Runtime/CompilerServices/TaskAwaiter.cs:line 152 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in /Users/buildagent/agent/_work/153/s/src/mscorlib/src/System/Runtime/ExceptionServices/ExceptionServicesCommon.cs:line 130 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in /Users/buildagent/agent/_work/153/s/src/mscorlib/src/System/Runtime/CompilerServices/TaskAwaiter.cs:line 152 ~~~ 24606 area-System.Memory System.Memory package for netcoreapp2.0 is missing System.Numerics.Vectors reference *Steps to Reproduce*: 1. docker run -it --rm microsoft/dotnet:2.0-sdk 2. mkdir ~/project 3. cd ~/project 4. dotnet new console 5. dotnet add package System.Memory --version 4.5.0-preview1-25812-01 --source https://dotnet.myget.org/F/dotnet-core/api/v3/index.json 6. `static void Main() { System.SpanExtensions.SequenceEqual(new byte[123], new byte[123]); }` 7. dotnet run *Expected Behavior*: No error. *Actual Behavior*: ``` Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) at System.SpanHelpers.SequenceEqual(Byte& first, Byte& second, Int32 length) at System.SpanExtensions.SequenceEqual(Span`1 first, ReadOnlySpan`1 second) at project.Program.Main() ``` *Workaround*: 8. dotnet add package System.Numerics.Vectors --version 4.5.0-preview1-25812-01 --source https://dotnet.myget.org/F/dotnet-core/api/v3/index.json 24608 area-System.Data sni.dll bug or problem using the same login. I think there's a bug where I am using the same login to connect to a database, while another process is doing the same with connection pooling. The way to test is to create a login for sql server, have 2 different apps connect using the same login under a service (using nssm as the service host). And the messasge sni.dll not found is sent on the connection open command. The OS 2008 server sql server version 2008 r2. 24610 area-System.Net Is System.Net.Sockets a Implement Of NIO? @anthonywanted commented on [Thu Oct 12 2017](https://github.com/dotnet/core/issues/1025) # Issue Title Is System.Net.Sockets an Implement Of NIO? # General Just few questions. Is System.Net.Sockets an Implement of NIO? In windows, is it an implement of IOCP? In Linux, is it an implement of epoll? How about aspnet core? 24611 area-Serialization Ignore the type in SGEN if it contains any property that only have private setter Fix #19723 @shmao @zhenlan @mconnew 24612 area-Infrastructure Mark packages as stable for 2.0.3 cc: @weshaggard 24614 area-System.Memory Proposal: Span<T>.Sort Extensions ## Span<T>.Sort Extensions ```csharp public static class SpanExtensions { public static void Sort<T>(this Span<T> span) where T : IComparable<T> { } public static void Sort<T>(this Span<T> span, Collections.Generic.IComparer<T> comparer) { } public static void Sort<T>(this Span<T> span, Comparison<T> comparison) { } } ``` **Notes:** * No offset, length overloads as can slice before sort * Extensions so general case can be overridden by more more specific types e.g. ```csharp public static void Sort(this Span<byte> span) { } public static void Sort(this Span<MyType> span) { } ``` Mentioned in api review for array sort https://github.com/dotnet/apireviews/blob/master/2017/10-10-GitHub%20issues.md /cc @stephentoub @KrzysztofCwalina @terrajobst @karelz 24615 area-System.Net add some code to make sure we sent datagram before we try to receive it This has been long outstanding problem. I was able to reproduce this locally on old Ubuntu 14 and running ALL tests in loop. This did non repro while running only single test or running them in sequence. I was able to collect traces suggesting that in some cases send() is called after recv failed. I added Task.Wait() to increase changes that sent is actually done when we try to receive. With this change I was able to run the test for a day where it would fail in about one hour before. My original change had 1s wait. However after one day, it failed again with new debug message that the sending task did not complete in 1s time. This is Azure VM instance where it is not clear what else is happening at the same time. I feel it would be better to be more liberal and possibly wait longer than have random failures. I bumped wait() timeout to 3s and receive timeout to 1s. This is still best guess but the tests are still running right now. When I get 3-5 days without failure I'll update this PR. I just wanted to get it out so people can comment on it. fixes #17681 24616 area-System.IO Switch WaitNamedPipe and CreateNamedPipeClient invocation ordering. We need to do this as WaitNamedPipe is not supported in Windows Containers. With this change, CreateNamedPipeClient will be called first, with call to WaitNamedPipe as a fallback only. This will allow us to use NamedPipeClientStream inside Windows Containers. This should handle both https://github.com/dotnet/corefx/issues/24594 and https://github.com/dotnet/corefx/issues/22014. Fixes #22014 per @jiria request keeping #24594 open until it is ported to the next servicing release. [Edit: added last line to close one issue and make clear why the other one is still open] 24617 area-System.Memory Proposal: {ReadOnly}Memory<T> Extensions (mirror Span) ## `{ReadOnly}Memory<T>` Extensions ### Background Came up in https://github.com/dotnet/corefx/pull/24389#discussion_r142536789 Currently you can use all the `Span<T>` extensions and methods from `Memory<T>` by extracting the `Span<T>` e.g. ```csharp memory0.Span.SequenceEqual(memory1.Span); ``` However this has two downsides 1. Not discoverable; you need to use the Span property to find them 2. Span can't be used in an `async` method; so to use them you need to create a second method and call that ### Proposal Include the second method as extensions on `{ReadOnly}Memory<T>` that passes through to the Span ```csharp public static class MemoryExtensions { // Span methods converted to Memory extension public static void CopyTo<T>(this Memory<T> memory, Memory<T> destination) => memory.Span.CopyTo(destination.Span); public static void CopyTo<T>(this ReadOnlyMemory<T> memory, Memory<T> destination) => memory.Span.CopyTo(destination.Span); public static bool TryCopyTo<T>(this Memory<T> memory, Memory<T> destination) => memory.Span.TryCopyTo(destination.Span); public static bool TryCopyTo<T>(this ReadOnlyMemory<T> memory, Memory<T> destination) => memory.Span.TryCopyTo(destination.Span); public static void Fill<T>(this Memory<T> memory, T value) => memory.Span.Fill(value); // Array extension as per Span extension public static void CopyTo<T>(this T[] array, Memory<T> destination) => array.CopyTo(destination.Span); // Valid? via Owned memory? public static ReadOnlyMemory<char> AsReadOnlyMemory(this string text); // Discoverable conversions as per Span public static Memory<T> AsMemory<T>(this ArraySegment<T> arraySegment) => arraySegment; public static Memory<T> AsMemory<T>(this T[] array) => array; // Span extension pass-throughs public static int IndexOf(this Memory<byte> memory, byte value) => memory.Span.IndexOf(value); public static int IndexOf(this Memory<byte> memory, ReadOnlyMemory<byte> value) => memory.Span.IndexOf(value.Span); public static int IndexOf(this ReadOnlyMemory<byte> memory, byte value) => memory.Span.IndexOf(value); public static int IndexOf(this ReadOnlyMemory<byte> memory, ReadOnlyMemory<byte> value) => memory.Span.IndexOf(value.Span); public static int IndexOf<T>(this Memory<T> memory, T value) where T : struct, IEquatable<T> => memory.Span.IndexOf(value); public static int IndexOf<T>(this Memory<T> memory, ReadOnlyMemory<T> value) where T : struct, IEquatable<T> => memory.Span.IndexOf(value.Span); public static int IndexOf<T>(this ReadOnlyMemory<T> memory, T value) where T : struct, IEquatable<T> => memory.Span.IndexOf(value); public static int IndexOf<T>(this ReadOnlyMemory<T> memory, ReadOnlyMemory<T> value) where T : struct, IEquatable<T> => memory.Span.IndexOf(value.Span); public static int IndexOfAny(this Memory<byte> memory, byte value0, byte value1) => memory.Span.IndexOfAny(value0, value1); public static int IndexOfAny(this Memory<byte> memory, byte value0, byte value1, byte value2) => memory.Span.IndexOfAny(value0, value1, value2); public static int IndexOfAny(this Memory<byte> memory, ReadOnlyMemory<byte> values) => memory.Span.IndexOfAny(values.Span); public static int IndexOfAny(this ReadOnlyMemory<byte> memory, byte value0, byte value1) => memory.Span.IndexOfAny(value0, value1); public static int IndexOfAny(this ReadOnlyMemory<byte> memory, byte value0, byte value1, byte value2) => memory.Span.IndexOfAny(value0, value1, value2); public static int IndexOfAny(this ReadOnlyMemory<byte> memory, ReadOnlyMemory<byte> values) => memory.Span.IndexOfAny(values.Span); public static bool SequenceEqual(this Memory<byte> first, ReadOnlyMemory<byte> second) => first.Span.SequenceEqual(second.Span); public static bool SequenceEqual(this ReadOnlyMemory<byte> first, ReadOnlyMemory<byte> second) => first.Span.SequenceEqual(second.Span); public static bool SequenceEqual<T>(this Memory<T> first, ReadOnlyMemory<T> value) where T : struct, IEquatable<T> => first.Span.SequenceEqual(value.Span); public static bool SequenceEqual<T>(this ReadOnlyMemory<T> first, ReadOnlyMemory<T> value) where T : struct, IEquatable<T> => first.Span.SequenceEqual(value.Span); public static bool StartsWith(this Memory<byte> memory, ReadOnlyMemory<byte> value) => memory.Span.StartsWith(value.Span); public static bool StartsWith(this ReadOnlyMemory<byte> memory, ReadOnlyMemory<byte> value) => memory.Span.StartsWith(value.Span); public static bool StartsWith<T>(this Memory<T> memory, ReadOnlyMemory<T> value) where T : struct, IEquatable<T> => memory.Span.StartsWith(value.Span); public static bool StartsWith<T>(this ReadOnlyMemory<T> memory, ReadOnlyMemory<T> value) where T : struct, IEquatable<T> => memory.Span.StartsWith(value.Span); } ``` ### Notes Items that change length can't be replicated due to the backing store e,g, `AsBytes`, `NonPortableCast` ### Question Is a string conversion possible? ```csharp public static ReadOnlyMemory<char> AsReadOnlyMemory(this string text); ``` /cc @davidfowl @KrzysztofCwalina @stephentoub @jkotas 24618 area-System.Diagnostics Create the Microsoft.Diagnostics.EventSource.Redist Nuget Package The package will be completed once the following is done: - [X] Create project and solution file for Microsoft.Diagnostics.Tracing.EventSource.Redist. - [x] Copy the code into CoreFX and make it build. - [X] Migrate changes required for this nuget package (code changes and missing resource strings) back to CoreCLR. - [X] Mirror code from CoreCLR repo. - [X] Use SR for resource strings instead of using ResourceManager directly. - [X] Produce a nuget package. - [X] Enable EventSource tests to run against Microsoft.Diagnostics.Tracing.EventSource.Redist during CI. - [x] Add EventCounter source and tests. 24619 area-Infrastructure Fix call to create submission metadata We made a change to the Benchview tooling and did not update the use of it in the CoreFX repo. This fixes that. 24620 area-Infrastructure Fix call to create submission metadata We made a change to the Benchview tooling and did not update the use of it in the CoreFX repo. This fixes that. 24621 area-System.Data Improving System.Data.Odbc by making it adhere to interop conventions Reference: https://github.com/dotnet/corefx/blob/42ce0e696e08e190aceaf8613e47e67d57178550/Documentation/coding-guidelines/interop-guidelines.md cc: @safern @danmosemsft @stephentoub 24622 area-Infrastructure Mark as stable for 1.1.5 All the crypto bumps are for: https://github.com/dotnet/corefx/pull/24459 cc: @weshaggard @bartonjs @ianhays 24623 area-System.IO Remove search trimming Trimming prevents access to valid Windows paths. We've removed trimming from the rest of our API surface, this is the last place we have it. Fixes #21096 24625 area-Infrastructure Mark packages as stable for 1.0.8 servicing cc: @weshaggard @ianhays @bartonjs 24626 area-System.Memory Adding ValidateTypeIsBlittable SpanHelper method and rename constant Addressing leftover feedback from https://github.com/dotnet/corefx/pull/24400#pullrequestreview-69064639 cc @weshaggard, @KrzysztofCwalina, @jkotas 24627 area-System.Diagnostics Make stack traces readable "Now that Task, async and await are prevalent - stack traces have become a lot less readable. Here's one that I was sent today: ``` System.InvalidOperationException: The specified API ""ConditionedProperties"" is not available because ProjectLoadSettings.DoNotEvaluateElementsWithFalseCondition was set when loading this project. at Microsoft.Build.Shared.ErrorUtilities.ThrowInvalidOperation(String resourceName, Object[] args) in e:\projects\msbuild_3\src\Shared\ErrorUtilities.cs:line 304 at Microsoft.Build.Evaluation.Project.get_ConditionedProperties() in e:\projects\msbuild_3\src\Build\Definition\Project.cs:line 709 at Microsoft.VisualStudio.ProjectSystem.CoreProjectConfigurationsDimensionsProvider.<GetProjectConfigurationDimensionsAsync>d__7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.ProjectSystem.DeclaredDimensionsProjectConfigurationsService.<CalculateKnownProjectConfigurationsAsync>d__9.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.ProjectSystem.UnconfiguredProjectCache`1.<GetValueAsync>d__6.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.ProjectSystem.ProjectConfigurationsServiceBase.<GetKnownProjectConfigurationsAsync>d__55.MoveNext() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at Microsoft.VisualStudio.ProjectSystem.VS.Tree.Dependencies.CrossTarget.CrossTargetSubscriptionHostBase.<UpdateProjectContextAsync>d__24.MoveNext() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.ProjectSystem.DefaultingProjectConfigurationsServiceBase.<GetProjectConfigurationAsync>d__3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.ProjectSystem.VS.Tree.Dependencies.CrossTarget.CrossTargetSubscriptionHostBase.<UpdateProjectContextAndSubscriptionsAsync>d__23.MoveNext() at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.VSUnconfiguredProjectIntegrationService.<GetActiveProjectConfigurationAsync>d__68.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.VSUnconfiguredProjectIntegrationService.<RefreshActiveProjectConfigurationAsync>d__62.MoveNext() at Microsoft.VisualStudio.ProjectSystem.VS.Tree.Dependencies.CrossTarget.CrossTargetSubscriptionHostBase.<InitializeCoreAsync>d__20.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.ProjectSystem.VS.NuGet.NuGetRestorer.<RefreshActiveConfigurationAsync>d__18.MoveNext() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.ProjectSystem.VS.Tree.Dependencies.Subscriptions.DependencySubscriptionsHost.<InitializeCoreAsync>d__45.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.ProjectSystem.OnceInitializedOnceDisposedAsync.<<-ctor>b__4_0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.Threading.AsyncLazy`1.<>c__DisplayClass13_1.<<GetValueAsync>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.ProjectSystem.VS.Tree.Dependencies.CrossTarget.CrossTargetSubscriptionHostBase.<EnsureInitialized>d__19.MoveNext() ``` Here it is minus the noise: ``` System.InvalidOperationException: The specified API ""ConditionedProperties"" is not available because ProjectLoadSettings.DoNotEvaluateElementsWithFalseCondition was set when loading this project. at Microsoft.Build.Shared.ErrorUtilities.ThrowInvalidOperation(String resourceName, Object[] args) in e:\projects\msbuild_3\src\Shared\ErrorUtilities.cs:line 304 at Microsoft.Build.Evaluation.Project.get_ConditionedProperties() in e:\projects\msbuild_3\src\Build\Definition\Project.cs:line 709 at Microsoft.VisualStudio.ProjectSystem.CoreProjectConfigurationsDimensionsProvider.<GetProjectConfigurationDimensionsAsync>d__7.MoveNext() at Microsoft.VisualStudio.ProjectSystem.DeclaredDimensionsProjectConfigurationsService.<CalculateKnownProjectConfigurationsAsync>d__9.MoveNext() at Microsoft.VisualStudio.ProjectSystem.UnconfiguredProjectCache`1.<GetValueAsync>d__6.MoveNext() at Microsoft.VisualStudio.ProjectSystem.ProjectConfigurationsServiceBase.<GetKnownProjectConfigurationsAsync>d__55.MoveNext() at Microsoft.VisualStudio.ProjectSystem.VS.Tree.Dependencies.CrossTarget.CrossTargetSubscriptionHostBase.<UpdateProjectContextAsync>d__24.MoveNext() at Microsoft.VisualStudio.ProjectSystem.DefaultingProjectConfigurationsServiceBase.<GetProjectConfigurationAsync>d__3.MoveNext() at Microsoft.VisualStudio.ProjectSystem.VS.Tree.Dependencies.CrossTarget.CrossTargetSubscriptionHostBase.<UpdateProjectContextAndSubscriptionsAsync>d__23.MoveNext() at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.VSUnconfiguredProjectIntegrationService.<GetActiveProjectConfigurationAsync>d__68.MoveNext() at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.VSUnconfiguredProjectIntegrationService.<RefreshActiveProjectConfigurationAsync>d__62.MoveNext() at Microsoft.VisualStudio.ProjectSystem.VS.Tree.Dependencies.CrossTarget.CrossTargetSubscriptionHostBase.<InitializeCoreAsync>d__20.MoveNext() at Microsoft.VisualStudio.ProjectSystem.VS.NuGet.NuGetRestorer.<RefreshActiveConfigurationAsync>d__18.MoveNext() at Microsoft.VisualStudio.ProjectSystem.VS.Tree.Dependencies.Subscriptions.DependencySubscriptionsHost.<InitializeCoreAsync>d__45.MoveNext() at Microsoft.VisualStudio.ProjectSystem.OnceInitializedOnceDisposedAsync.<<-ctor>b__4_0>d.MoveNext() at Microsoft.VisualStudio.Threading.AsyncLazy`1.<>c__DisplayClass13_1.<<GetValueAsync>b__0>d.MoveNext() at Microsoft.VisualStudio.ProjectSystem.VS.Tree.Dependencies.CrossTarget.CrossTargetSubscriptionHostBase.<EnsureInitialized>d__19.MoveNext() ``` Much more understandable/readable. Is there something we can do to collapse/reduce the noise here?" 24628 area-System.Collections "Test: System.Collections.Tests.Perf_ArrayList/Indexer failed with ""System.OutOfMemoryException""" Opened on behalf of @Jiayili1 The test `System.Collections.Tests.Perf_ArrayList/Indexer` has failed. System.OutOfMemoryException : Exception of type 'System.OutOfMemoryException' was thrown. Stack Trace: Build : Master - 20171013.01 (Core Tests) Failing configurations: - Windows.81.Amd64-x86 - Release - Windows.7.Amd64-x86 - Release - Windows.10.Amd64.Core-x86 - Release - Windows.10.Amd64-x86 - Release Detail: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171013.01/workItem/System.Collections.NonGeneric.Performance.Tests/analysis/xunit/System.Collections.Tests.Perf_ArrayList~2FIndexer 24630 area-System.Data "Test: System.Data.Odbc.Tests.DependencyCheckTest/OdbcConnection_OpenWhenOdbcNotInstalled_ThrowsException failed with ""Xunit.Sdk.ThrowsException""" Opened on behalf of @Jiayili1 The test `System.Data.Odbc.Tests.DependencyCheckTest/OdbcConnection_OpenWhenOdbcNotInstalled_ThrowsException` has failed. Assert.Throws() Failure\r Expected: typeof(System.DllNotFoundException)\r Actual: (No exception was thrown) Stack Trace: at System.Data.Odbc.Tests.DependencyCheckTest.OdbcConnection_OpenWhenOdbcNotInstalled_ThrowsException() Build : Master - 20171013.01 (Core Tests) Failing configurations: - Windows.10.Amd64.Core-x86 - Release - Windows.10.Amd64.Core-x64 - Release Detail: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171013.01/workItem/System.Data.Odbc.Tests/analysis/xunit/System.Data.Odbc.Tests.DependencyCheckTest~2FOdbcConnection_OpenWhenOdbcNotInstalled_ThrowsException 24634 area-System.Net How to Disabled Customer HttpHeader (x-ms-* header) with HttpClient? How to Disabled Customer HttpHeader (x-ms-* header) with HttpClient? ``` x-ms-request-root-id: e3d90637-45d0d4c5cdb27076 x-ms-request-id: |e3d90637-45d0d4c5cdb27076.1. Request-Id: |e3d90637-45d0d4c5cdb27076.1.1. ``` 24635 area-System.IO NamedPipeClientStream not handling error cases correctly According to the documentation this isn't correct: ```C# // The timeout has expired. if (errorCode == Interop.Errors.ERROR_SUCCESS) { if (cancellationToken.CanBeCanceled) { ... ``` It should be checking ERROR_SEM_TIMEOUT. https://msdn.microsoft.com/en-us/library/windows/desktop/aa365800.aspx https://msdn.microsoft.com/en-us/library/cc232125.aspx 24637 area-System.Collections System.Collections.NonGeneric.Performance.Tests failed https://ci.dot.net/job/dotnet_corefx/job/master/job/outerloop_netcoreapp_centos7.1_debug/196/ No test result generated, but shows the following issue: /mnt/resource/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_centos7.1_debug/Tools/tests.targets(481,5): error : One or more tests failed while running tests from 'System.Collections.NonGeneric.Performance.Tests' please check /mnt/resource/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_centos7.1_debug/bin/tests/System.Collections.NonGeneric.Performance.Tests/netcoreapp-Linux-Debug-x64/testResults.xml for details! [/mnt/resource/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_centos7.1_debug/src/System.Collections.NonGeneric/tests/Performance/System.Collections.NonGeneric.Performance.Tests.csproj] 24638 area-System.Data NullReferenceException in SqlBulkCopy when setting ColumnMappings with names We use `SqlBulkCopy` to insert data. In full .NET framework (4, 4.6) it works. The same code in .net core 2 throws `NullReferenceException`. The problem has something to do with column mappings (`SqlBulkCopy.ColumnMappings`). When we set mappings using indexes, everything works. When we set mappings using column names, NRE is thrown. See the attached example. [SqlBulkCopySample.zip](https://github.com/dotnet/corefx/files/1382531/SqlBulkCopySample.zip) 24640 area-System.Diagnostics PerfCounter: Override SystemDiagnosticsSection.Properties I noticed `s_properties` in `SystemDiagnosticsSection` wasn't used. In the [reference source](https://github.com/Microsoft/referencesource/blob/master/System/compmod/system/diagnostics/SystemDiagnosticsSection.cs#L42-L46) `Properties` is overridden to return `s_properties`, so do that here. Also, minor cleanup while making changes here (and do the same in `PerfCounterSection`). 24641 area-System.Diagnostics EventSource: Improve debug message more clear string _EventSource_VarArgsParameterMismatch_ in Microsoft.Diagnostics.tracing.EventSource.Redist could be improved showing lists of mismatch type and how they are not match. Current debug message is > parameters to the Event method do not match the parameters to the WriteEvent method. This may cause the event to be displayed incorrectly. 24642 area-Infrastructure Port Pipeline and netci.groovy changes from master This is porting the netci.groovy and Pipeline files from CoreFx master to dev/release/2.0.0. I need to sync with @mmitche to understand what's the best way to merge this / roll it out. ie, I know I need to make an update to repolist.txt, it's not clear to me what the preferred method to validate these changes is. Is it worth validating these in my fork before merging to dotnet/corefx, or is validating post merge sufficient. 24643 area-System.Data Correcting OdbcIsAvailable condition check for windows Fixes #24630 cc: @danmosemsft 24644 area-System.Net Fix HttpWebRequest when sending with HTTP/1.0 The HttpWebRequest.ProtocolVersion property was implemented. But it was not checked when actually creating the request (which uses HttpClient underneath). So, all requests were sent with HTTP/1.1. This fix now uses the ProtocolVersion property and sends either HTTP/1.0 or HTTP/1.1. Note: HTTP/2.0 is currently not supported when setting the ProtocolVersion property. An ArgumentException is thrown. This is the existing .NET Framework behavior which was ported to .NET Core. We could investigate changing this in the future to allow ProtocolVersion to be set to 2.0. Fixes #24597 24645 area-Infrastructure Update package index This should fix https://github.com/dotnet/corefx/issues/24606. This is a follow-up of https://github.com/dotnet/corefx/pull/23168 which fixes the inbox assembly versions. cc @ericstj 24646 area-Infrastructure segfault in System.Net.Http.FunctionalTests on Windows code coverage https://ci.dot.net/job/dotnet_corefx/job/master/job/code_coverage_windows/346/consoleFull#-113183012733fe3402-0c0f-45a7-a707-47164965bab5 https://dumpling.azurewebsites.net/api/dumplings/archived/f0b9dd148029f34b6dd910d2c5edff204b06aa0c 24648 area-System.Net Incorrect SSLStream cipher suites on Linux "Currently SSLStream just passes ""All"" to OpenSSL for cipher suites. This is causing two unwanted choices: 1. It doesn't enable ECDHE or DHE cipher suites as that requires a separate call to set up. 2. It enables cipher suites using the SEED and CAMELLIA block ciphers, which can cause compliance issues. We should consider this as a servicing candidate since a better set of suites improves defense-in-depth. " 24650 area-System.ComponentModel System.ComponentModel.Win32Exception doesn't match ref contract I encountered an issue while working with the corefx libraries using custom tooling. It's possible that the following scenario is allowed, but here's what I'm seeing. In M.Win32.Primitives the Win32Exception class has the GetObjectData method defined in the ref contract. The method was removed from the implementation in https://github.com/dotnet/corefx/commit/9eafffc6054c8f039d788465621bcfd49a379ca1. Assemblies in corefx build against the ref contract and have a memberref to a non existing member. It is still implemented by a base type, but shouldn't this cause method binding errors? Is this a case that is allowed by CIL spec or is this actually an error hidden by coreclr? Edit for clarity: This isn't a binding question, it's more of a CIL decoding question. The particular error I encountered has a MemberReference token to the method in question. AFAIK a CIL decoder shouldn't need to do method resolution while trying to decode the stream. Edit: The method is also explicitly overridden by Win32Exception in the netstandard contract. 24652 area-System.Runtime UriTemplate from System.ServiceModel "It would be nice to be able to do something like this: ```csharp private static readonly UriTemplate _activationTemplate = new UriTemplate(""license/activate/{licenseKey}""); public async Task<LicenseActivationResponse> ActivateAsync(LicenseActivationRequest activationRequest) { var requestUrl = _activationTemplate.BindByPosition(_httpClient.BaseAddress, activationRequest.LicenseKey); var serialized = JsonConvert.SerializeObject(activationRequest, _serializerSettings); var content = new StringContent(serialized, Encoding.UTF8, ""application/json""); using (var response = await _httpClient.PutAsync(requestUrl, content).ConfigureAwait(false)) { // ... } // ... } ``` #7983 asks about the same thing, and the response was: > Thank you for the suggestion. It is a good idea in general about having templates, but we think it belongs where it is in WCF and is not generally applicable to .NET Core. I think that comment misunderstands the use case for `UriTemplate`s. There's nothing WCF-specific about `UriTemplate`. In fact, the code above is taken from a service client implementation that interacts with an ASP.NET Core web service. `UriTemplate` is used to safely build URLs. It's safer, and more capable than string concatenation. Building URLs isn't specific to WCF, so it would be nice if it were available in .NET Core." 24653 area-System.Runtime ValueTuple compatibility issues in .NET Framework 4.7.1 Cross posting for better visibility: Microsoft/dotnet-framework-early-access#9 Fall creators update is going live in two days. Heads up! It will generate nasty compat issues for applications using `Task<ValueTuple>`. Not sure if this is a known issue or by design, but I have lost entire day today trying to track it down. 24655 area-System.Data Correct row source field is used to get column ordinal. Current version uses `_DbDataReaderRowSource` field. This field is `null` in case of own implementation of `IDataReader`, which is not inherited from `DbDataReader`. Fixes #24638 24656 area-System.Drawing Fix for GraphicsPathIterator.CopyData throws EntrypointNotFoundException when index is out of range. Work related to (#22026) 24657 area-System.Text the Package: System.Text.Encoding.CodePages (ver:4.4.0) cannot be published "I found this package of version 4.4.0 cannot be publish when I use ""dotnet publish"". when I change to version 4.3.0, It's ok, It has rutimes\win and runtimes\unix. for version 4.4-preview, it has only runtimes\win, no runtimes\unix." 24660 area-Infrastructure Build step 'Execute shell' marked build as failure in CI https://ci.dot.net/job/dotnet_corefx/job/master/job/outerloop_netcoreapp_ubuntu14.04_debug/200/ Detail: https://ci.dot.net/job/dotnet_corefx/job/master/job/outerloop_netcoreapp_ubuntu14.04_debug/lastCompletedBuild/consoleFull#-8536224876a086b3e-df04-41d2-bc4d-43e8f9406d07 Configuration: outerloop_netcoreapp_ubuntu14.04_debug Build step 'Execute shell' marked build as failure 15:52:05 [xUnit] [INFO] - Starting to record. 15:52:05 [xUnit] [INFO] - Processing xUnit.Net-v2 (default) 15:52:06 [xUnit] [INFO] - [xUnit.Net-v2 (default)] - No test report file(s) were found with the pattern 'bin/**/testResults.xml' relative to '/mnt/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_ubuntu14.04_debug' for the testing framework 'xUnit.Net-v2 (default)'. Did you enter a pattern relative to the correct directory? Did you generate the result report(s) for 'xUnit.Net-v2 (default)'? 15:52:06 [xUnit] [ERROR] - No test reports found for the metric 'xUnit.Net' with the resolved pattern 'bin/**/testResults.xml'. Configuration error?. 15:52:06 [xUnit] [INFO] - Failing BUILD. 15:52:06 [xUnit] [INFO] - There are errors when processing test results. 15:52:06 [xUnit] [INFO] - Skipping tests recording. 15:52:06 [xUnit] [INFO] - Stop build. 24661 area-System.Net WinForms application referencing NuGet library (.NETStandard 1.3) will not deploy System.Net.Http Installing a NuGet package to a WinForms application which targets .NETStandard 1.3 results in an incomplete deployment. The dll System.Net.Http is not deployed (it's in the Debug/Release folder but not in the Publish folder) and also missing in Publish/Application Files. Steps to reproduce 1) Create a new WinForms project. 2) Reference (in my case) YouTrackSharp (3.1.0). 3) Publish the project and see that System.Net.Http is missing. 24662 area-System.Security Cannot decompress Rijndael encrypted Gzip Hello, we are using Rijndael encrypted gzips. The following code works just fine in .NET Framework 4.6.1 but throws exception in .NET Core 2.0 ``` using (var rijAlg = Rijndael.Create()) { rijAlg.Key = _configK; rijAlg.IV = _configI; rijAlg.BlockSize = 128; rijAlg.Padding = PaddingMode.PKCS7; // Create a decrytor to perform the stream transform. var decryptor = rijAlg.CreateDecryptor(rijAlg.Key, rijAlg.IV); // Create the streams used for decryption. using (var sourceStream = new MemoryStream(buffer)) { using (var decryptStream = new CryptoStream(sourceStream, decryptor, CryptoStreamMode.Read)) { if (isGzipped) { using (var unzipStream = new System.IO.Compression.GZipStream(decryptStream, System.IO.Compression.CompressionMode.Decompress)) { using (var targetStream = new MemoryStream()) { unzipStream.CopyTo(targetStream); Content = targetStream.ToArray(); } } } else { using (var targetStream = new MemoryStream()) { decryptStream.CopyTo(targetStream); Content = targetStream.ToArray(); } } } } } ``` The exception is: `The archive entry was compressed using an unsupported compression method.` Stack trace: ``` at System.IO.Compression.Inflater.Inflate(FlushCode flushCode) at System.IO.Compression.Inflater.ReadInflateOutput(Byte* bufPtr, Int32 length, FlushCode flushCode, Int32& bytesRead) at System.IO.Compression.Inflater.InflateVerified(Byte* bufPtr, Int32 length) at System.IO.Compression.Inflater.Inflate(Byte[] bytes, Int32 offset, Int32 length) at System.IO.Compression.DeflateStream.Read(Byte[] array, Int32 offset, Int32 count) at System.IO.Compression.GZipStream.Read(Byte[] array, Int32 offset, Int32 count) at System.IO.Stream.CopyTo(Stream destination, Int32 bufferSize) ``` Maybe the decryptor has a bug which results in an invalid decrypted data and that's why GzipStream fails to decompress it? 24663 area-System.Runtime SystemNative_SysConf does not check for errors It returns the result of calling `sysconf` directly: https://github.com/dotnet/corefx/blob/c4d0529c24a8abc50009e561e96efed6b3e002b9/src/Native/Unix/System.Native/pal_io.cpp#L844-L859 From the man page of `sysconf`: ``` RETURN VALUE The return value of sysconf() is one of the following: * On error, -1 is returned and errno is set to indicate the cause of the error (for example, EINVAL, indicating that name is invalid). * If name corresponds to a maximum or minimum limit, and that limit is indeterminate, -1 is returned and errno is not changed. (To distinguish an indeterminate limit from an error, set errno to zero before the call, and then check whether errno is nonzero when -1 is returned.) * If name corresponds to an option, a positive value is returned if the option is supported, and -1 is returned if the option is not supported. * Otherwise, the current value of the option or limit is returned. This value will not be more restrictive than the corresponding value that was described to the application in <unistd.h> or <limits.h> when the application was compiled. ``` Sysconf is indeed failing (I'm trying to get a minimal repro, but it's taking a while to narrow down). The end effect is [`Environment.ProcessorCount`](https://github.com/dotnet/corefx/blob/475c578fc77e16344679e337276c91a70fe1c79c/src/System.Runtime.Extensions/src/System/Environment.Unix.cs#L361) returns `-1`, which is... bizarre, to say the least! [EDIT] Making code link inline for readability by @karelz 24675 area-System.Drawing System.Drawing.Common needs netfx and netstandard configurations Right now it has only netcoreapp configuration. A netstandard configuration that simply throws would allow netstandard libraries that don't use drawing to reference the upcoming compat pack. Ideally it can be built properly for netstandard in which case this would allow netstandard libraries to use drawing. It also needs a netfx configuration to make a shim System.Drawing.Common that redirects to System.Drawing, so such netstandard libraries could also work on .NET Framework. fyi @weshaggard @terrajobst 24677 area-System.Net Disposing Socket during Socket.Receive behaves badly on *nix "### Repro app: ```C# using System; using System.Net; using System.Net.Sockets; using System.Threading.Tasks; namespace SocketInvalidArg { class Program { static void Main(string[] args) { using (var serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) { serverSocket.Bind(new IPEndPoint(IPAddress.Loopback, 5000)); serverSocket.Listen(512); var i = 0; try { for (;; i++) { using (var clientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) { clientSocket.Connect(IPAddress.Loopback, 5000); var acceptSocket = serverSocket.Accept(); Task.WaitAll(Task.Run(() => ReadInput(acceptSocket)), Task.Run(() => acceptSocket.Dispose())); } } } catch { Console.Write(""Failed after #{0} iterations"", i); throw; } } } static void ReadInput(Socket socket) { try { Console.WriteLine(""Calling socket.Receive""); var count = socket.Receive(new byte[256]); Console.WriteLine(""Called socket.Receive with count = {0}"", count); } catch (ObjectDisposedException) { Console.WriteLine(""Socket.Receive threw ODE""); } catch (SocketException ex) when (ex.SocketErrorCode != SocketError.InvalidArgument) { Console.WriteLine(ex + Environment.NewLine + ex.SocketErrorCode); } } } } ``` ### Actual Behavior (macOS 10.12 and Ubuntu 16.04) On macOS and Linux, Socket.Recieve() either throws an ""Invalid argument"" SocketException: ```$ dotnet run Calling socket.Receive Socket.Receive threw ODE Calling socket.Receive Socket.Receive threw ODE Calling socket.Receive Socket.Receive threw ODE Calling socket.Receive Socket.Receive threw ODE Calling socket.Receive Socket.Receive threw ODE Calling socket.Receive Socket.Receive threw ODE Calling socket.Receive Socket.Receive threw ODE Calling socket.Receive Socket.Receive threw ODE Calling socket.Receive Socket.Receive threw ODE Calling socket.Receive Socket.Receive threw ODE Calling socket.Receive Socket.Receive threw ODE Calling socket.Receive Socket.Receive threw ODE Calling socket.Receive Failed after #12 iterations Unhandled Exception: System.AggregateException: One or more errors occurred. (Invalid argument) ---> System.Net.Sockets.SocketException: Invalid argument at System.Net.Sockets.Socket.Receive(Byte[] buffer) at SocketInvalidArg.Program.ReadInput(Socket socket) in /Users/shalter/source/halter73/SocketInvalidArg/Program.cs:line 45 at SocketInvalidArg.Program.<>c__DisplayClass0_0.<Main>b__0() in /Users/shalter/source/halter73/SocketInvalidArg/Program.cs:line 28 at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) --- End of inner exception stack trace --- at System.ThrowHelper.ThrowAggregateException(List`1 exceptions) at System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken) at System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout) at System.Threading.Tasks.Task.WaitAll(Task[] tasks) at SocketInvalidArg.Program.Main(String[] args) in /Users/shalter/source/halter73/SocketInvalidArg/Program.cs:line 35 ``` Or hangs indefinitely on the call to Socket.Receive: ``` $ dotnet run Calling socket.Receive Socket.Receive threw ODE Calling socket.Receive ``` ### Expected Behavior (Current Behavior on Windows) Socket.Receive always completes. If the Socket is Disposed after the call to Socket.Receive, it throws a ""ConnectionAborted"" SocketException instead of an ""InvalidArgument"" SocketException. ``` ... Calling socket.Receive System.Net.Sockets.SocketException (0x80004005): An established connection was aborted by the software in your host machine at System.Net.Sockets.Socket.Receive(Byte[] buffer) at SocketInvalidArg.Program.ReadInput(Socket socket) in C:\Users\shalter\source\halter73\SocketInvalidArg\Program.cs:line 45 ConnectionAborted Calling socket.Receive Socket.Receive threw ODE Calling socket.Receive Socket.Receive threw ODE Calling socket.Receive Socket.Receive threw ODE Calling socket.Receive Socket.Receive threw ODE Calling socket.Receive Socket.Receive threw ODE Calling socket.Receive Socket.Receive threw ODE Calling socket.Receive Socket.Receive threw ODE Calling socket.Receive Socket.Receive threw ODE Calling socket.Receive Socket.Receive threw ODE Calling socket.Receive Socket.Receive threw ODE Calling socket.Receive Socket.Receive threw ODE Calling socket.Receive Socket.Receive threw ODE Calling socket.Receive Socket.Receive threw ODE Calling socket.Receive Socket.Receive threw ODE Calling socket.Receive Socket.Receive threw ODE Calling socket.Receive System.Net.Sockets.SocketException (0x80004005): An established connection was aborted by the software in your host machine at System.Net.Sockets.Socket.Receive(Byte[] buffer) at SocketInvalidArg.Program.ReadInput(Socket socket) in C:\Users\shalter\source\halter73\SocketInvalidArg\Program.cs:line 45 ConnectionAborted Calling socket.Receive Socket.Receive threw ODE ... (and so it goes forever) ```" 24678 area-System.Console "Tests under ""System.Console.Tests"" failed with ""Exit code was 131 but it should have been 42"" " failed test: CancelKeyPressTests.CanAddAndRemoveHandler_Remote Configuration: oxs10.12_release Detail: https://ci.dot.net/job/dotnet_corefx/job/master/job/osx10.12_release/3358/testReport/(root)/CancelKeyPressTests/CanAddAndRemoveHandler_Remote/ MESSAGE: ~~~ Exit code was 131 but it should have been 42\nExpected: True\nActual: False ~~~ STACK TRACE: ~~~ at System.Diagnostics.RemoteExecutorTestBase.RemoteInvokeHandle.Dispose() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_release/src/CoreFx.Private.TestUtilities/src/System/Diagnostics/RemoteExecutorTestBase.cs:line 189 ~~~ 24679 area-System.ComponentModel "Test: System.ComponentModel.EventBasedAsync.Tests.BackgroundWorkerTests/RunWorkerAsync_NoOnWorkHandler_SetsResultToNull failed with ""System.Exception : The background worker never completed""" Opened on behalf of @Jiayili1 The test `System.ComponentModel.EventBasedAsync.Tests.BackgroundWorkerTests/RunWorkerAsync_NoOnWorkHandler_SetsResultToNull` has failed. System.Exception : The background worker never completed. Stack Trace: at System.ComponentModel.EventBasedAsync.Tests.BackgroundWorkerTests.RunWorkerAsync_NoOnWorkHandler_SetsResultToNull() in E:\A\_work\598\s\corefx\src\System.ComponentModel.EventBasedAsync\tests\BackgroundWorkerTests.cs:line 93 at _$ILCT$.$ILT$ReflectionDynamicInvoke$.InvokeRetV(Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean targetIsThisCall) at System.InvokeUtils.CalliIntrinsics.Call(IntPtr dynamicInvokeHelperMethod, Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean isTargetThisCall) at System.InvokeUtils.CallDynamicInvokeMethod(Object thisPtr, IntPtr methodToCall, Object thisPtrDynamicInvokeMethod, IntPtr dynamicInvokeHelperMethod, IntPtr dynamicInvokeHelperGenericDictionary, Object targetMethodOrDelegate, Object[] parameters, BinderBundle binderBundle, Boolean wrapInTargetInvocationException, Boolean invokeMethodHelperIsThisCall, Boolean methodToCallIsThisCall) in CallDynamicInvokeMethod:line 16707566 Build : Master - 20171017.01 (UWP ILC Tests) Failing configurations: - Windows.10.Amd64.ClientRS3-x86 - Debug Detail: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Filc~2F/build/20171017.01/workItem/System.ComponentModel.EventBasedAsync.Tests/analysis/xunit/System.ComponentModel.EventBasedAsync.Tests.BackgroundWorkerTests~2FRunWorkerAsync_NoOnWorkHandler_SetsResultToNull 24680 area-System.Runtime Proposal : Full RFC 4122 for Guids # Description Provide full implementation of [RFC 4211](https://tools.ietf.org/html/rfc4122) for UUID as part of the Guid type. Having hash based predictible Guids (v5) which could be derived from string and don't collide with random based guids (v4) can be extremely useful in some scenarios. RFC4122 proposes a standard around UUIDs to address that. # Possible Use Cases Here are some of the use cases I see: * Slug projection to Guid primary key (eliminate the need to maintain an index for that matter, allows using the primary key which is usually the clustered index to get the data) * Mixing potentially identical ids but namespaced in the same keyspace. * Reducing a composite key to a single Guid. * More broadly every scenario where a hash is a good fit (not from a security perspective) but where we need guids. # Proposed API ``` public partial struct Guid { public static readonly Guid DnsNamespace // 6ba7b810-9dad-11d1-80b4-00c04fd430c8 public static readonly Guid UrlNamespace // 6ba7b811-9dad-11d1-80b4-00c04fd430c8 public static Guid NewGuid(); public static Guid NewUuidV1(); public static Guid NewUuidV4(); public static Guid NewUuidV5(string value, Guid namespace); public static Guid NewUuidV5(byte[] value, Guid namespace); } ``` # Details We would obviously keep the existing NewGuid() which in windows calls [`UuidCreate`](https://msdn.microsoft.com/en-us/library/windows/desktop/aa379205(v=vs.85).aspx). It seems that it uses UUID v4 under the hood. In addition we would add NewGuidV1, NewGuidV4 et NewGuidV5 methods. They would map to the adequate UUID generation method. # Related Issues # Open Questions Currently the byte order from the constructor and [ToByteArray is a bit unatural as it just reflect the underlying struct](https://stackoverflow.com/questions/10190817/guid-byte-order-in-net) as we could expect a more natural byte order. It could be worth it to add methods overload to read and write guid using the natural order. # See also * Current implementation: [part 1](https://source.dot.net/#System.Private.CoreLib/shared/System/Guid.cs,b622ef5f6b76c10a) and [part 2](https://source.dot.net/#System.Private.CoreLib/src/System/Guid.CoreCLR.cs,b622ef5f6b76c10a) * [Node JS implementation](https://www.npmjs.com/package/uuid) * [Unoptimized quick and dirty Guid V5 c# implementation](https://github.com/geeklearningio/gl-dotnet-primitives/blob/feature/guid-v5/src/GeekLearning.Primitives/GuidV5.cs) # Updates * December 12, 2017: Provide a first API proposal * January 18, 2017: Add use cases 24681 area-System.Diagnostics Then, what's the status of Code Contracts usage in .NET Core? Related: https://github.com/Microsoft/CodeContracts/issues/231 If the contracts feature is not usable, why included in corefx? 24683 area-System.Net HttpClient SendAsync Object disposed exception when request version is Http 1.1 passes when it is HTTP 1.0 "I am using HttpClient to send a post request to my service , where when user is unauthorized 401 status code is returned on receiving that i throw an exception from my client code, but once this use case is done my client program keeps throwing , i get an exception when i call HttpClient.SendAsync() method. > System.ObjectDisposedException occurred Message: A first chance exception of type 'System.ObjectDisposedException' occurred in System.dll Additional information: Cannot access a disposed object. and finally i get - > System.Net.Http.HttpRequestException occurred > _HResult=-2146233088 > _message=Error while copying content to a stream. > HResult=-2146233088 > IsTransient=false > Message=Error while copying content to a stream. > Source=mscorlib > StackTrace: > at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) > InnerException: System.IO.IOException > _HResult=-2146232800 > _message=The read operation failed, see inner exception. > HResult=-2146232800 > IsTransient=false > Message=The read operation failed, see inner exception. > Source=System.Net.Http > StackTrace: > at System.Net.Http.HttpClientHandler.WebExceptionWrapperStream.BeginRead(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state) > at System.Net.Http.StreamToStreamCopy.StartRead() > InnerException: System.Net.WebException > _HResult=-2146233079 > _message=The request was aborted: The connection was closed unexpectedly. > HResult=-2146233079 > IsTransient=false > Message=The request was aborted: The connection was closed unexpectedly. > Source=System > StackTrace: > at System.Net.ConnectStream.BeginRead(Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state) > at System.Net.Http.HttpClientHandler.WebExceptionWrapperStream.BeginRead(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state) > InnerException: I have to in fact restart service to get proper response again. Above behavior happens only if HttpRequestMessage.Version is set to HttpVersion.Version11 but when HttpVersion.Version10 everything works fine, following is a sample code i created to reproduce same , any insights on why this happens? ``` class Program { static HttpClientHandler handler = new HttpClientHandler{Credentials = CredentialCache.DefaultCredentials}; static void Main() { for (int i = 0; i < 10; i++) { try { Main2().Wait(); } catch (Exception e) { Console.WriteLine(e); } } Console.ReadLine(); } private static async Task Main2() { var client1 = new HttpClient(handler,false); client1.DefaultRequestHeaders.CacheControl = CacheControlHeaderValue.Parse(""no-cache""); HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, ""http://localhost/RestFramework/AuditEventService/AuditEvent"") { Content = new StringContent(""sdad""), Version = HttpVersion.Version11 }; request.Content.Headers.ContentType = new MediaTypeHeaderValue(""application/json""); HttpResponseMessage response = null; try { response = await client1.SendAsync(request); // i am expecting a 401 status code, this line cause issue if (!response.IsSuccessStatusCode) { var statusCode = response.StatusCode; throw new Exception(statusCode.ToString()); } } finally { client1.Dispose(); } } ``` my web api service returns a 401 for the request which i am passing, if i put a sleep in my filter code mentioned below everything works fine ,the code for filter looks below- ``` internal class IntegrateWindowsAuthenticationFilter : IActionFilter { /// <summary> /// user groups /// </summary> public IList<string> UserGroups { get; set; } /// <summary> /// user names /// </summary> public IList<string> UserNames { get; set; } #region IActionFilter Members /// <summary> /// Executes the action filter asynchronous. /// </summary> /// <param name=""actionContext"">The action context.</param> /// <param name=""cancellationToken"">The cancellation token.</param> /// <param name=""continuation"">The continuation.</param> /// <returns></returns> public Task<HttpResponseMessage> ExecuteActionFilterAsync(HttpActionContext actionContext, CancellationToken cancellationToken, Func<Task<HttpResponseMessage>> continuation) { //Thread.sleep(1000) // this make things work with http 1.1 var output = false; if (UserGroups != null) { foreach (var group in UserGroups) { output = actionContext.RequestContext.Principal.IsInRole(group); if (output) { return continuation(); } } } if (UserNames != null) { foreach (var user in UserNames) { output = actionContext.RequestContext.Principal.Identity.Name .Equals(user, StringComparison.OrdinalIgnoreCase); if (output) { return continuation(); } } } var outcome = new OperationOutcome(); outcome.Issue.Add(new IssueComponent { Details = Constants.UnauthorizedAccess }); return Task.FromResult(new HttpResponseMessage(HttpStatusCode.Unauthorized)); } #endregion #region IFilter Members /// <summary> /// Gets a value indicating whether [allow multiple]. /// </summary> /// <value> /// <c>true</c> if [allow multiple]; otherwise, <c>false</c>. /// </value> public bool AllowMultiple { get { return false; } } #endregion } ``` " 24685 area-System.IO Proposed API for canonical paths "# Rationale > ""It seems we need a new API that allows us to get the canonical path that hits the disk and follows links and fixes casing"" —[API Review 2015-08-27](https://github.com/dotnet/apireviews/tree/1894e009c6a3dfe9afa89da5c115aa43f3f8cb30/2015/08-26-long-path) # Proposed API ```C# public static class Path { public static string GetCanonicalPath( string path ); // Resolves symbolic links public static string GetCanonicalPath( string path, bool preserveSymbolicLinks ); } ``` # Details A canonical path - is a fully qualified path path, - uses only `DirectorySeparatorChar` as a directory separator, - has no trailing directory separator (unless it is a/the root), - contains no navigation elements (`.` and `..`) and no empty path elements (ex. `/foo//bar`), - contains no symbolic links (unless otherwise specified), - has its root in a canonical form (ex. on Windows, drive letters will be upper case), and - adopts the actual casing of the file and directory names if the file and directory names are case-insensitive. The behavior of `..` with respect to symbolic links is platform dependent. On Windows, it removes the symbolic link element. On Linux, it removes an element of path that was resolved from the symbolic link. Examples: - Windows: If `C:\Users\All Users` is a symbolic link to `C:\ProgramData` then the canonical form of `C:\Users\All Users\..\foo` is `C:\Users\foo`. - Linux: If `/var/lock` is a symbolic link to `/run/lock` then the canonical form of `/var/lock/../foo` is `/run/foo`. On Linux it is not always possible to preserve symbolic links while simplifying `..`. In these cases `Path.GetCanonicalPath(string, bool)` will resolve the symbolic link regardless of the value of `preserveSymbolicLinks`. For the purposes of this API, NTFS Junction Points are considered to be like Linux bind mounts and are not considered to be symbolic links. Since most of the members of `Path` do not do I/O there might be some objection to adding `GetCanonicalPath` to `Path`. There is at least one existing method that does do I/O — `Path.GetTempFileName` — so it would not be the first. # Open Questions - How should `GetCanonicalPath` handle paths in `\\?\` and `\\.\`? - Maybe return a `\\?\` path if and only if the input path was in `\\?\`. - Maybe reject paths in `\\.\`. - What should `GetCanonicalPath` do if the path does not exist? - Maybe canonicalize the existing part and append the rest as canonicalized as possible. - Does Linux provide a mechanism for determining the actual casing of a file or directory name for files and directories that reside on a file system that is mounted in a case-insensitive mode? If it doesn't then the provided casing will have to be returned. # Related Issues - #1086 # See Also - [Relevant portion of .NET Core Design Reviews: MAX_PATH Limitations](https://youtu.be/lpa2OFauASM?t=2721) # Updates - Replace `SymbolicLinkOption` with `bool`. - Split out #25569" 24690 area-System.Diagnostics EventLogTests.DeleteLogTest failed on Win7 in CI https://mc.dot.net/#/user/dotnet-maestro-bot/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/0105300fc3ca40d98db157cea91b097c68de6627/workItem/System.Diagnostics.EventLog.Tests/analysis/xunit/System.Diagnostics.Tests.EventLogTests~2FDeleteLogTest ``` Windows.7.Amd64.Open-Debug-x64 Unhandled Exception of Type System.ComponentModel.Win32Exception Message : System.ComponentModel.Win32Exception : Access is denied Stack Trace : at System.Diagnostics.EventLogInternal.Clear() at System.Diagnostics.EventLog.Clear() at System.Diagnostics.EventLog.Delete(String logName, String machineName) at System.Diagnostics.EventLog.Delete(String logName) at System.Diagnostics.Tests.EventLogTests.DeleteLogTest() ``` 24694 area-System.Diagnostics [ExcludeFromCodeCoverageAttribute] should be applicable to assemblies Following up on https://github.com/Microsoft/vstest/issues/1050, https://github.com/Microsoft/testfx/issues/248, https://github.com/dotnet/corefx/issues/14488. As of now `System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute` has the following [signature](https://msdn.microsoft.com/en-us/library/system.diagnostics.codeanalysis.excludefromcodecoverageattribute(v=vs.110).aspx): ```csharp [AttributeUsageAttribute (AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Event, Inherited = false, AllowMultiple = false)] public sealed class ExcludeFromCodeCoverageAttribute : Attribute ``` what doesn't allow to apply it to assemblies. I'd like to have the code like this in every tests project's AssemblyInfo.cs: ```csharp [assembly: ExcludeFromCodeCoverage] ``` I talked to @pvlakshm, a PM on the VS Unit Testing Framework, we agreed this would be a good enhancement which they would pick-up and address once the following API change has been made: ```csharp [AttributeUsageAttribute (AttributeTargets.Assembly | // <-- AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Event, Inherited = false, AllowMultiple = false)] public sealed class ExcludeFromCodeCoverageAttribute : Attribute ``` 24697 area-System.IO Remove dead code from System.IO.FileSystem.AccessControl PR addresses issue #17905, project **System.IO.FileSystem.AccessControl**. Removed just two unused string resources. Everything else is constants. 24698 area-Infrastructure "Downloaded dotnet.exe now picking up installed SDK's in ""Program Files""" "(Note this also affects CoreCLR and CoreFxLab - maybe this issue should be in buildtools) ``` c:\dd\CoreFx\bin\testhost\netcoreapp-Windows_NT-Debug-x64\dotnet.exe --info ... Base Path: C:\Program Files\dotnet\sdk\2.0.2\ ... ``` This means that the build on these repos are picking up whatever dogfood that VS wishes on us, and yes, some of them do break minor functionality like ""init-tools.cmd"" Expected: The dotnet tooling in these repos are truly isolated from the machine environment. " 24699 area-System.Collections Set.TryGetValue not-found behavior/docs inconsistent "Either the behavior or the inline documentation is incorrect for SortedSet/HashSet TryGetValue when the item is not found. The code returns default(T) but the inline comments state it should return the original value. I expect this is because the comments are copied from their Immutable counterparts where the original value is returned. TryGetValue not found out value for other classes: Function | actual out value when not found | what docs say the out value will be when not found --------- | ------------- | ------------- SortedSet.TryGetValue | [default(T)](https://github.com/dotnet/corefx/blob/6ad6bce5f9fd1f2d98ea30a049bdfcee3f4d0ed3/src/System.Collections/src/System/Collections/Generic/SortedSet.cs#L2108) | [original value](https://github.com/dotnet/corefx/blob/6ad6bce5f9fd1f2d98ea30a049bdfcee3f4d0ed3/src/System.Collections/src/System/Collections/Generic/SortedSet.cs#L2092) HashSet.TryGetValue | [default(T)](https://github.com/dotnet/corefx/blob/master/src/System.Collections/src/System/Collections/Generic/HashSet.cs#L480) | [original value](https://github.com/dotnet/corefx/blob/master/src/System.Collections/src/System/Collections/Generic/HashSet.cs#L461) ImmutableHashSet.TryGetValue | [original value](https://github.com/dotnet/corefx/blob/3143b836af48be68d3b02b45188b134dca25b27c/src/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableHashSet_1.cs#L237) | [original value](https://github.com/dotnet/corefx/blob/3143b836af48be68d3b02b45188b134dca25b27c/src/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableHashSet_1.cs#L219) ImmutableSortedSet.TryGetValue | [original value](https://github.com/dotnet/corefx/blob/3143b836af48be68d3b02b45188b134dca25b27c/src/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.cs#L219) | [original value](https://github.com/dotnet/corefx/blob/3143b836af48be68d3b02b45188b134dca25b27c/src/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.cs#L205) Dictionary | default(T) | default(T) SortedList| default(T) | default(T) SortedDictionary| default(T) | default(T) ""original value"" here refers to the `equalValue` for which we are searching. I expect we want to just fix the comment to match the behavior which this PR aims to do. If we decide else-wise, I will update the PR as necessary. cc: @TylerBrinkley @stephentoub " 24701 area-System.IO Remove dead code from System.IO.FileSystem PR addresses issue #17905, project **System.IO.FileSystem**. Not really much to do. Most of the red things in [diff](http://tempcoverage.blob.core.windows.net/report2/System.IO.FileSystem.diff.html) file are: - Classes in `src\Common` folder. - Methods that are in `*.Unix` files, so I am not sure if they are not used on that platform and therefore they can't be removed. 24703 area-Meta [Announcement] [Discussion] Microsoft Security Advisory CVE-2017-8585 : Malformed Culture can cause application crash # Microsoft Security Advisory CVE-2017-8585 ## Malformed Culture can cause application to crash ### Executive Summary Microsoft is releasing this security advisory to provide information about a vulnerability in the public versions of .NET Core 1.0 and 1.1. This advisory also provides guidance on what developers can do to update their applications correctly. Microsoft is aware of a security vulnerability in the public version of .NET Core where a malformed string request could cause an application to crash and lead to a denial of service. System administrators are advised to update their .NET Core runtimes to versions 1.0.7 and 1.1.4. Developers are advised to update their .NET Core SDK to version 1.1.4. ### Mitigation Factors .NET Core 2.0 is not affected by this issue. ,NET Core 1.x applications are only affected if running on Windows 10 or Windows 2016. ### Advisory FAQ #### How do I know if I am affected? Any application running against .NET Core 1.0.6 or lower versions, or 1.1.2 or lower versions is affected. The latest version of the .NET core runtime you have installed in your computer can be listed by running `dotnet --info`. Running that command produces an output similar to the following: ``` .NET Command Line Tools (2.0.2) Product Information: Version: 2.0.2 Commit SHA-1 hash: a04b4bf512 Runtime Environment: OS Name: Windows OS Version: 10.0.16299 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\2.0.2\ Microsoft .NET Core Shared Framework Host Version : 2.0.0 Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d ``` As this command only displays the latest version of the runtime installed (or the version set in the *global.json* file), it may hide the fact that you have a vulnerable runtime. A complete list of runtimes can be discovered by performing a directory listing in the install root directories. The default root directories are listed in the following table: | Operating System | Location | |------------------|-------------------| | Windows | C:\Program Files\dotnet\shared\Microsoft.NETCore.App\ | | macOS | /usr/local/share/dotnet/shared/Microsoft.NETCore.App/ | | [Supported Linux platforms](https://docs.microsoft.com/dotnet/core/linux-prerequisites#supported-linux-versions) | /usr/share/dotnet/shared/Microsoft.NETCore.App/ | Each runtime version is installed in its own directory, where the directory name is the version number. If you don't have a directory for 1.0.7 and 1.1.4, then any applications targeting 1.0 or 1.1 of .NET Core are vulnerable. Also, even if you have a directory for 1.0.7 and 1.1.4 present in your system, if you've deployed [self-contained applications](https://docs.microsoft.com/dotnet/core/deploying/#self-contained-deployments-scd) targeting the impacted versions, these applications are also vulnerable. #### How do I fix my affected application? Applications can be fixed by installing the latest .NET Core runtimes or SDKs. Typically, application servers only have runtime packages installed and developer machines have the SDKs installed. Installers for the runtimes can be downloaded from the [Runtime and SDK download archive](https://github.com/dotnet/core/blob/master/release-notes/download-archive.md). .NET Core 1.1.4 SDK installs both versions 1.0.7 and 1.1.4 of the .NET Core runtime. If you've built a [self-contained application](https://docs.microsoft.com/dotnet/core/deploying/#self-contained-deployments-scd), you must install the new runtime and SDK, recompile your application and redeploy. #### What if the update breaks my application? An application can be pinned to a previous version of the runtime by editing the [*application.runtime.config*](https://github.com/dotnet/cli/blob/ede74b6be1406ba0c086b6d5fc1a5d4eacff1f01/Documentation/specs/runtime-configuration-file.md#appnameruntimeconfigjson) file for that application. Set the framework version to the desired version and the `rollForward` property to `false`. These settings should be treated as a temporary measure and the application updated to work with the patched versions of the framework. Since the *application.runtime.config* file is an optional file, you may need to create one for each application and add it alongside the executable. ### Acknowledgments David Fernandez of [Sidertia Solutions](https://www.sidertia.com/Home) ### External Links [CVE-2017-8585](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-8585) [Sidertia blog on their discovery](https://www.sidertia.com/Home/Community/Blog/2017/07/14/Microsoft-fixes-the-CVE-2017-8585-security-vulnerability-discovered-by-Sidertia-Team) _Version 1.1_ _Last Updated 2017-18-10_ 24704 area-System.Diagnostics compatibility consideration for UseShellExecute with Process.Start() "This is fresh start of topic related to #23705 and #24000 At least on Unix ""UseShell"" has standard meaning: shell is used to execute requested command. There are many examples - like Python's popen() or simply difference between execv() and system(). On Windows his has different meaning and implies to open file with default application. Unix implementation was recently updated to match Windows behavior. However that possibly creates backward compatibility problem. 2.0 has been released with using /bin/sh to match traditional Unix experience. Change in behavior can break existing usage of Process.Star() - and it did even in trivial case for corefx tests. /bin/sh is pretty much guarantied to exist on any normal Unix system but new helpers may not. Process.Start(new ProcessStartInfo { UseShellExecute = true, FileName =""ls""}) works with 2.0 but it does not work with current master branch on my system. Further more, Unix users would expect normal shell behavior. Following examples will succeed when running with dotnet 2.0 ``` static void Main(string[] args) { String cmd=""if [ -e /etc/passwd ] ; then echo yes ; else echo no; fi""; var startInfo = new ProcessStartInfo(cmd); startInfo.UseShellExecute = true; startInfo.CreateNoWindow = true; using (Process px = Process.Start(startInfo)) { px.WaitForExit(); Console.WriteLine(""cmd returned {0}"", px.ExitCode); } } ``` One can pass in fragments of shell code with 2.0. ``` test@net-chip:~/process$ dotnet run yes cmd returned 0 ``` another common use case is use if command pipeline and have shell handling it: ``` String cmd=""cat /etc/passwd|grep root""; test@net-chip:~/process$ dotnet run root:x:0:0:root:/root:/bin/bash cmd returned 0 ``` In this case shell will run each command in separate process and it will redirect output from cat to stdin of grep. This is pretty typical use. Last part is use of .profile and shell variables. When used with shell, for example ""echo $HOME"" would expand to home directory. When used without shell, it would be passed in as string. " 24705 area-System.Threading Add method to avoid TaskScheduler.UnobservedTaskException for a given Task Unobserved `Task` exceptions are propagated to the `TaskScheduler.UnobservedTaskException` event. There are cases where we want to be able to ignore the results of a task without triggering that event. For example, we have an extension method, `task.WithTimeout(TimeSpan)` which will throw a `TimeoutException` if a task doesn't complete before a specified time. In this case we want to ignore the results of the original task. Currently we use an extension method to ignore individual tasks: ```C# public static void Ignore(this Task task) { if (task.IsCompleted) { var ignored = task.Exception; } else { IgnoreAsync(task); } async void IgnoreAsync(Task asyncTask) { try { await asyncTask.ConfigureAwait(false); } catch { // Ignored. } } } ``` That method still has a cost, though, and ideally we would like to remove most of that cost. A method inside the framework to ignore the results of a task without needing to register/allocate a continuation would be beneficial here. 24706 area-System.Net Test that matching cookies are found after non-matching cookies Test case for #24368. Adding a new non-matching cookie can cause matching cookies to not be returned. /aaa should return the following cookies because of a prefix match: 1. /aa 2. /a 3. / Adding a /ab cookie will cause it to only return 2/3 of the cookies. https://dotnetfiddle.net/xH5FVi helps show the issue. 24707 area-System.Net NegotiateStreamTest should be improved I bump into this while investigating #24000 - We have cases when tests would claim pass but it did not run. - test it self is trying to install and remove system packages during test execution. That will create reliability problems as well as it is unpleasant for anybody working on shared or production system. It would be better to document prerequisites and run tests when conditions are met. That would also mean checking or updating current CI images so we do not always skip runs due to lack of dependencies. We should also update documentation and explain what is needed for proper execution so anybody from community can successfully run the tests. 24709 area-System.ComponentModel Question about BindingList<T> Hello, I have a question about `BindingList<T>`. Is there any particular reason that the `RaiseListChangedEvents` property is not exposed via an interface like `IBindingList` or a new one called `IRaiseListChangedEvents`? I just ran into this today during work where I had a dynamic type created via `TypeBuilder` and an instance of `BindingList<T>` where `T` was this dynamic type. Before adding a bunch of items, I wanted to turn off the list changed notifications and turn them back on after and also call a `ResetBindings`. So because I have a dynamic type I can't cast my list to `BindingList<T>`, because I have no information about `T` during the writing of the program. If `BindingList<T>` implements a new interface `IRaiseListChangedEvents`, then I can just cast the collection to that and access the property. Same goes for `ResetBindings`. I ended up creating an empty class deriving from `BindingList<T>`, implementing a new interface with the needed properties/methods so I can access them even if `T` is dynamic and not known at compile time. What is the reason of not exposing these members as a new or as part of the existing interfaces? Thanks in advance. 24711 area-System.Collections "Fix for (#24628) - System.Collections.Tests.Perf_ArrayList/Indexer failed with ""System.OutOfMemoryException""" Fix for (#24628) - Optimizing System.Collections.Tests.Perf_ArrayListTests tests which were using over 2GB of memory. 24712 area-System.Net Test failure: System.Net.Http.Functional.Tests.ResponseStreamTest / ReadAsStreamAsync_InvalidServerResponse_ThrowsIOException ## Type of failures ### An error occurred while sending the request Failure [20171215.09](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171215.09/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.ResponseStreamTest~2FReadAsStreamAsync_InvalidServerResponse_ThrowsIOException(transferType:%20Chunked,%20transferError:%20MissingChunkTerminator)): ``` Assert.Throws() Failure Expected: typeof(System.IO.IOException) Actual: typeof(System.Net.Http.HttpRequestException): An error occurred while sending the request. at System.Net.Http.HttpClient.<FinishSendAsyncUnbuffered>d__59.MoveNext() in E:\A\_work\1212\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 489 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.ResponseStreamTest.<ReadAsStreamHelper>d__9.MoveNext() in E:\A\_work\1212\s\corefx\src\System.Net.Http\tests\FunctionalTests\ResponseStreamTest.cs:line 247 --- End of stack trace from previous location where exception was thrown --- ``` ### No exception was thrown Failure [20180118.04](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180118.04/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.ResponseStreamTest~2FReadAsStreamAsync_InvalidServerResponse_ThrowsIOException(transferType:%20ContentLength,%20transferError:%20ContentLengthTooLarge)): ``` Assert.Throws() Failure Expected: typeof(System.IO.IOException) Actual: (No exception was thrown) ``` ## History of failures Day | Build | OS | Details -- | -- | -- | -- 5/10 | 20170510.02 | Win10 | 5/17 | 20170517.01 | Win10 | 10/18 | 20171018.01 | Win7 | 11/15 | 20171115.01 | Win7 | 11/28 | 20171128.07 | Win7 | 12/1 | 20171201.03 | Win7 | 12/4 | 20171204.01 | Win7 | 12/5 | 20171215.06 | Win7 | [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171215.09/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.ResponseStreamTest~2FReadAsStreamAsync_InvalidServerResponse_ThrowsIOException(transferType:%20Chunked,%20transferError:%20MissingChunkTerminator)) 12/15 | 20171215.09 | Win7 | [link](https://mc.dot.net/#/product/netcore/master/source/official%7E2Fcorefx%7E2Fmaster%7E2F/type/test%7E2Ffunctional%7E2Fcli%7E2F/build/20171215.09/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.ResponseStreamTest%7E2FReadAsStreamAsync_InvalidServerResponse_ThrowsIOException(transferType:%20Chunked,%20transferError:%20MissingChunkTerminator)) 12/16 | 20171216.06 | Win8.1 | [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171216.06/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.ResponseStreamTest~2FReadAsStreamAsync_InvalidServerResponse_ThrowsIOException(transferType:%20Chunked,%20transferError:%20ChunkSizeTooLarge)) 1/6 | 20180106.01 | Win7 | [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180106.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.ResponseStreamTest~2FReadAsStreamAsync_InvalidServerResponse_ThrowsIOException(transferType:%20Chunked,%20transferError:%20ChunkSizeTooLarge)) 1/11 | 20180111.02 | Win7 | [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180111.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.ResponseStreamTest~2FReadAsStreamAsync_InvalidServerResponse_ThrowsIOException(transferType:%20Chunked,%20transferError:%20MissingChunkTerminator)) 1/18 | 20180118.04 | Win7 | No exception was thrown - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180118.04/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.ResponseStreamTest~2FReadAsStreamAsync_InvalidServerResponse_ThrowsIOException(transferType:%20ContentLength,%20transferError:%20ContentLengthTooLarge)) 1/25 | 20180125.01 | Win7 | [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180125.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.ResponseStreamTest~2FReadAsStreamAsync_InvalidServerResponse_ThrowsIOException(transferType:%20Chunked,%20transferError:%20MissingChunkTerminator)) 1/29 | 20180129.05 | Win7 | No exception was thrown - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180129.05/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.ResponseStreamTest~2FReadAsStreamAsync_InvalidServerResponse_ThrowsIOException(transferType:%20Chunked,%20transferError:%20ChunkSizeTooLarge)) 2/6 | 20180206.04 | Win7 | only in [catastrophic failure logs](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180206.04/workItem/System.Net.Http.Functional.Tests/wilogs) 3/19 | 20180319.06 | Win10 | 3/22 | 20180322.01 | Win7 | ## Failure details Opened on behalf of @Jiayili1 The test `System.Net.Http.Functional.Tests.ResponseStreamTest/ReadAsStreamAsync_InvalidServerResponse_ThrowsIOException(transferType: ContentLength, transferError: ContentLengthTooLarge)` has failed. ``` Assert.Throws() Failure Expected: typeof(System.IO.IOException) Actual: typeof(System.Net.Http.HttpRequestException): An error occurred while sending the request. at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.Http.HttpClient.<FinishSendAsyncUnbuffered>d__59.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.Http.Functional.Tests.ResponseStreamTest.<ReadAsStreamHelper>d__9.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) ``` Build : Master - 20171018.01 (Core Tests) Failing configurations: - Windows.7.Amd64-x86 - Release Detail: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171018.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.ResponseStreamTest~2FReadAsStreamAsync_InvalidServerResponse_ThrowsIOException(transferType:%20ContentLength,%20transferError:%20ContentLengthTooLarge) 24713 area-System.Net Status line handling differs between HttpClientHandler implementations Some status lines that cause client requests to fail on .NET Core on Windows are not failing on .NET Framework, and vice versa. Other status lines are failing on .NET Core on Windows and not failing on .NET Core on Linux. See HttpProtocolTests tests for details. 24714 area-Infrastructure update parameter parsing to be more flexible and be closer to coreclr and native build allow keyword variants with and without leading '-'. e.g. both 'release' and '-release' are valid. 24722 area-System.Threading Segfault in coreclr due to potential race with initializing thread statics on Linux "Run the test ```System.Net.Security.Tests.SslStream_StreamToStream_Alpn_Success``` for repro. On initial debugging, this is the call stack from the process, ``` * thread #15: tid = 34598, 0x00007ffff6e05c37 libc.so.6`gsignal + 55, name = 'dotnet', stop reason = signal SIGABRT * frame #0: 0x00007ffff6e05c37 libc.so.6`gsignal + 55 frame #1: 0x00007ffff6e09028 libc.so.6`abort + 328 frame #2: 0x00007ffff61aafd3 libcoreclr.so`::PROCAbort() + 19 at process.cpp:3046 frame #3: 0x00007ffff61a6a56 libcoreclr.so`PROCEndProcess(hProcess=0x00000000ffffff01, uExitCode=123456789, bTerminateUnconditionally=YES) + 1222 at process.cpp:1394 frame #4: 0x00007ffff61a6b55 libcoreclr.so`::TerminateProcess(hProcess=0x00000000ffffff01, uExitCode=123456789) + 181 at process.cpp:1310 frame #5: 0x00007ffff5834a6f libcoreclr.so`TerminateOnAssert() + 31 at debug.cpp:183 frame #6: 0x00007ffff583590c libcoreclr.so`::_DbgBreakCheck(szFile=""/home/lasekar/coreclr/src/vm/object.inl"", iLine=209, szExpr=""pMT->IsArray()"", fConstrained=NO) + 2428 at debug.cpp:436 frame #7: 0x00007ffff5835f14 libcoreclr.so`_DbgBreakCheckNoThrow(szFile=""/home/lasekar/coreclr/src/vm/object.inl"", iLine=209, szExpr=""pMT->IsArray()"", fConstrained=NO) + 180 at debug.cpp:548 frame #8: 0x00007ffff5836404 libcoreclr.so`::DbgAssertDialog(szFile=""/home/lasekar/coreclr/src/vm/object.inl"", iLine=209, szExpr=""pMT->IsArray()"") + 260 at debug.cpp:735 frame #9: 0x00007ffff5884c76 libcoreclr.so`ArrayBase::GetDataPtrOffset(pMT=0x00007fff7ce8a018) + 54 at object.inl:209 frame #10: 0x00007ffff5883a63 libcoreclr.so`ArrayBase::GetDataPtr(this=0x00007fff54e6a088, inGC=NO) const + 115 at object.h:832 frame #11: 0x00007ffff59c3220 libcoreclr.so`ThreadLocalModule::GetPrecomputedGCStaticsBasePointer(this=0x00007fff3800c530) + 160 at threadstatics.h:128 frame #12: 0x00007ffff5ad0047 libcoreclr.so`JIT_GetSharedGCThreadStaticBase(moduleDomainID=140735268991016, dwClassDomainID=532) + 167 at jithelpers.cpp:1911 frame #13: 0x00007fff7ca6162c frame #14: 0x00007fff7ca61c29 frame #15: 0x00007fff7cbbd000 frame #16: 0x00007ffff5cf8d0b libcoreclr.so`CallDescrWorkerInternal + 124 at unixasmmacrosamd64.inc:880 frame #17: 0x00007ffff5a1e09a libcoreclr.so`CallDescrWorkerWithHandler(pCallDescrData=0x00007fff78f2f2d8, fCriticalCall=NO) + 490 at callhelpers.cpp:78 frame #18: 0x00007ffff5a1f7ee libcoreclr.so`MethodDescCallSite::CallTargetWorker(this=0x00007fff78f2f3c0, pArguments=0x0000000000000000, pReturnValue=0x00007fff78f2f358, cbReturnValue=8) + 2862 at callhelpers.cpp:645 frame #19: 0x00007ffff5bb238a libcoreclr.so`MethodDescCallSite::Call_RetBool(this=0x00007fff78f2f3c0, pArguments=0x0000000000000000) + 202 at callhelpers.h:433 frame #20: 0x00007ffff5e5ace8 libcoreclr.so`QueueUserWorkItemManagedCallback(pArg=0x00007fff78f2fd56) + 200 at comthreadpool.cpp:472 frame #21: 0x00007ffff59b83be libcoreclr.so`ManagedThreadBase_DispatchInner(pCallState=0x00007fff78f2f880) + 206 at threads.cpp:9186 frame #22: 0x00007ffff59bd945 libcoreclr.so`ManagedThreadBase_DispatchMiddle(pCallState=0x00007fff78f2f880) + 149 at threads.cpp:9237 frame #23: 0x00007ffff59bd77d libcoreclr.so`ManagedThreadBase_DispatchOuter(this=0x00007fff78f2f758, pParam=0x00007fff78f2f810)::$_6::operator()(ManagedThreadBase_DispatchOuter(ManagedThreadCallState*)::TryArgs*) const::{lambda(Param*)#1}::operator()(Param*) const + 29 at threads.cpp:9475 frame #24: 0x00007ffff59bd57f libcoreclr.so`ManagedThreadBase_DispatchOuter(this=0x00007fff78f2f7e8, pArgs=0x00007fff78f2f7f0)::$_6::operator()(ManagedThreadBase_DispatchOuter(ManagedThreadCallState*)::TryArgs*) const + 111 at threads.cpp:9477 frame #25: 0x00007ffff59b8049 libcoreclr.so`ManagedThreadBase_DispatchOuter(pCallState=0x00007fff78f2f880) + 233 at threads.cpp:9514 frame #26: 0x00007ffff59b81d4 libcoreclr.so`ManagedThreadBase_FullTransitionWithAD(pAppDomain=(m_dwId = 1), pTarget=(libcoreclr.so`QueueUserWorkItemManagedCallback(void*) at comthreadpool.cpp:456), args=0x00007fff78f2fd56, filterType=ThreadPoolThread)(void*), void*, UnhandledExceptionLocation) + 84 at threads.cpp:9535 frame #27: 0x00007ffff59b823b libcoreclr.so`ManagedThreadBase::ThreadPool(pAppDomain=(m_dwId = 1), pTarget=(libcoreclr.so`QueueUserWorkItemManagedCallback(void*) at comthreadpool.cpp:456), args=0x00007fff78f2fd56)(void*), void*) + 59 at threads.cpp:9577 frame #28: 0x00007ffff5e1ccfb libcoreclr.so`ManagedPerAppDomainTPCount::DispatchWorkItem(this=0x00000000006b64c0, foundWork=0x00007fff78f2fd57, wasNotRecalled=0x00007fff78f2fd56) + 251 at threadpoolrequest.cpp:754 frame #29: 0x00007ffff59fcf0b libcoreclr.so`ThreadpoolMgr::ExecuteWorkRequest(foundWork=0x00007fff78f2fd57, wasNotRecalled=0x00007fff78f2fd56) + 203 at win32threadpool.cpp:1558 frame #30: 0x00007ffff59fe029 libcoreclr.so`ThreadpoolMgr::WorkerThreadStart(lpArgs=0x0000000000000000) + 937 at win32threadpool.cpp:2022 frame #31: 0x00007ffff59aa267 libcoreclr.so`Thread::intermediateThreadProc(arg=0x00007fff3401f540) + 167 at threads.cpp:2583 frame #32: 0x00007ffff61b1edd libcoreclr.so`CorUnix::CPalThread::ThreadEntry(pvParam=0x00007fff34020870) + 1677 at thread.cpp:1684 frame #33: 0x00007ffff79c0184 libpthread.so.0`start_thread + 196 frame #34: 0x00007ffff6eccffd libc.so.6`clone + 109 ``` and it looks like the assert is failing, as it is expecting an array object, instead receiving a Thread object. ``` frame #12: 0x00007ffff5ad0047 libcoreclr.so`JIT_GetSharedGCThreadStaticBase(moduleDomainID=140735268991016, dwClassDomainID=532) + 167 at jithelpers.cpp:1911 1908 // If the TLM has been allocated and the class has been marked as initialized, 1909 // get the pointer to the GC statics base and return 1910 if (pThreadLocalModule != NULL && pThreadLocalModule->IsPrecomputedClassInitialized(dwClassDomainID)) -> 1911 return (void*)pThreadLocalModule->GetPrecomputedGCStaticsBasePointer(); 1912 1913 // If the TLM was not allocated or if the class was not marked as initialized 1914 // then we have to go through the slow path (lldb) p pThreadLocalModule (ThreadLocalModule *) $0 = 0x00007fff3800c530 (lldb) p pThreadLocalModule->m_pGCStatics (OBJECTHANDLE) $1 = 0x00007ffff7fd10e0 (lldb) frame select 9 frame #9: 0x00007ffff5884c76 libcoreclr.so`ArrayBase::GetDataPtrOffset(pMT=0x00007fff7ce8a018) + 54 at object.inl:209 206 LIMITED_METHOD_CONTRACT; 207 SUPPORTS_DAC; 208 #if !defined(DACCESS_COMPILE) -> 209 _ASSERTE(pMT->IsArray()); 210 #endif // DACCESS_COMPILE 211 // The -sizeof(ObjHeader) is because of the sync block, which is before ""this"" 212 return pMT->GetBaseSize() - sizeof(ObjHeader); (lldb) dumpmt pMT EEClass: 00007FFF7BD76900 Module: 00007FFF7BC90400 Name: System.Threading.Thread mdToken: 000000000200020F File: /home/lasekar/corefx/bin/testhost/netcoreapp-Linux-Debug-x64/shared/Microsoft.NETCore.App/9.9.9/System.Private.CoreLib.dll BaseSize: 0x50 ComponentSize: 0x0 Slots in VTable: 44 Number of IFaces in IFaceMap: 0 ``` cc @janvorli @jkotas " 24723 area-System.Security Fix Rijndael IV/Blocksize bug resolves https://github.com/dotnet/corefx/issues/24662 cc: @bartonjs @gabor182 24726 area-System.Runtime Question: How are unmanaged code libraries loaded as SafeHandles? "**How are C++ libraries loaded into SafeHandle() classes in .Net Core on Linux (or any platform)?** I am attempting to port an application to .Net Core. The application makes external calls to a C++ library. Before doing so, it loads the library into a SafeHandle. Windows platform: ``` [DllImport(""Kernel32"", CharSet = CharSet.Auto, BestFitMapping = false, SetLastError = true)] private static extern SafeLibraryHandle LoadLibrary(string fileName); ``` Posix platform (via Mono): ``` [DllImport(__Internal, CallingConvention = CCCdecl)] private static extern SafeLibraryHandle dlopen(IntPtr filename, int flags); ``` The class ""SafeLibraryHandle"" inherits from Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid. (The SafeHandleZeroOrMinusOneIsInvalid base class was added in .Net Core 2.0.) The Kernel32 LoadLibrary() works as expected when running in .Net Core on Windows. When running on Linux, the Mono method is called and fails as expected because there is no __Internal library available. From what I've found, Mono wraps the [Linux dlopen() command](http://man7.org/linux/man-pages/man3/dlopen.3.html) like [this](https://github.com/mono/mono/blob/master/libgc/gc_dlopen.c). I'm rather unfamiliar with loading/using unmanaged code. From what I can tell, the purpose of these SafeHandle classes is to load the library files into memory and turn them into disposable types. Since the SafeHandle base class exists in .Net Standard and is used in .Net Core, it seems like there should be way to load libraries on any platform. **So how should C++ libraries be loaded into SafeHandle() classes in .Net Core on Linux?**" 24727 area-System.Net [release/2.0.0] Port SmtpClient fixes to 2.0 cc @stephentoub Fixes #24485 Port of #24536 to release/2.0.0 branch 24728 area-System.IO Rename new Stream.Read/Write{Async} Span/Memory arguments to buffer We'd previously decided to name these source/destination, but we also have an overriding principle that we should adhere to names used in existing overloads if possible, and we should only use source/destination to help in cases where we need to make the direction clear. Thus we should update the names in these new overloads before we ship them. 24730 area-Infrastructure Reset list for 2.0.4 servicing cc: @weshaggard 24732 area-Meta Replace 'enlistment' with 'repo' in a few places "Enlistment is a MS-internal term from Source Depot days for what in today's git world is now commonly called a ""repo"". Updating this in a few places to avoid confusing compiler errors. " 24735 area-System.Net Remove dead code from System.Net.Http PR addresses issue #17905, project **System.Net.Http**. 24738 area-System.ComponentModel Want features for data annotation _From @amitsaini12345 on October 14, 2017 14:21_ Please bring features to share common data annotations between each entity or model. I will be no need to define separate separate data annotations for each properties of each entity. It would be more easy and bring code reusablity more if one can declare common data annotations of different properties because we see that common data annotation is like max length 50, int, required etc. Are used to once and common for all entities. _Copied from original issue: aspnet/Mvc#6955_ 24739 area-Infrastructure Engineering System Epic This Epic is to track planned engineering work specific to the CoreFX repo. (The actual work may be in part in the BuildTools repo) Like all our Epics in order to see the child work items you must have the free [Zenhub browser plugin ](https://www.zenhub.com/) enabled. 24741 area-Meta Microservices and Cloud Epic This Epic is to track work we are doing in CoreFX to support ASP.NET Core. Like all our Epics in order to see the child work items you must have the free [Zenhub browser plugin ](https://www.zenhub.com/) enabled. 24742 area-System.Net Networking Epic This Epic is to track work we are doing in CoreFX for Networking for the next release. Like all our Epics in order to see the child work items you must have the free [Zenhub browser plugin ](https://www.zenhub.com/) enabled. 24743 area-System.Security Crypto Epic This Epic is to track work we are doing for Crypto for the next release. Like all our Epics in order to see the child work items you must have the free [Zenhub browser plugin ](https://www.zenhub.com/) enabled. 24744 area-Meta Azure IoT Hub Epic This Epic is to track work we are doing for Azure IoT hub for the next release. Like all our Epics in order to see the child work items you must have the free [Zenhub browser plugin ](https://www.zenhub.com/) enabled. 24745 area-Meta Security Epic This Epic is to track (non Crypto) work we are doing in CoreFX for Security for the next release. Like all our Epics in order to see the child work items you must have the free [Zenhub browser plugin ](https://www.zenhub.com/) enabled. 24746 area-System.IO SystemNative_GetPeerID and SystemNative_GetEUid are not exposed This is a blocking issue for Roslyn. We need to enforce that both ends of a unix domain socket are the same user (to disallow connecting to a compiler server that is not your own user, spitting junk at it, and potentially executing code as another (higher-privileged) user). These APIs allow us to do that. Related: https://github.com/dotnet/corefx/issues/10981 24747 area-Meta Performance Epic This Epic is to track work we are doing in CoreFX (and corelib) to monitor and improve performance for the next release - excepting Networking performance, which is likely in the [Networking Epic](https://github.com/dotnet/corefx/issues/24742). Like all our Epics in order to see the child work items you must have the free [Zenhub browser plugin ](https://www.zenhub.com/) enabled. 24749 area-System.Net Remove dead code from System.Net.HttpListener. PR addresses issue #17905, project **System.Net.HttpListener**. 24750 area-Meta Linux/Windows Parity Epic This Epic covers work to address places where Linux support is behind Windows support, and also potentially any Linux-specific features we add in CoreFX for this release. 24751 area-Meta Customer adoption Epic This Epic covers work we are doing in CoreFX to make it easier for existing .NET Framework customers to use .NET Core. For example, the recently announced portability package. It also covers outreach to NuGet package owners to help them repackage/support .NET Standard 2.0. Like all our Epics in order to see the child work items you must have the free [Zenhub browser plugin ](https://www.zenhub.com/) enabled. 24753 area-System.IO System.IO.IOException: The system cannot find message text for message number 0x%1 in the message file for %2\r\n Hi It seems there is bug in the way exception messages are looked up. I'm getting the following exception when trying to move a file: > System.IO.IOException: The system cannot find message text for message number 0x%1 in the message file for %2\r\n at System.IO.Win32FileSystem.MoveFile(String sourceFullPath, String destFullPath)\r\n at System.IO.File.Move(String sourceFileName, String destFileName) The exception seems to materialize from the call to Win32Marshal.GetExceptionForWin32Error in [System.IO.Win32FileSystem.MoveFile(String sourceFullPath, String destFullPath)](https://github.com/dotnet/corefx/blob/e791e8b7a4f1e4d6ff5b4295fad04a6c9f65e909/src/System.IO.FileSystem/src/System/IO/Win32FileSystem.cs#L381) Regards 24754 area-System.IO Dev Center Certification Fails for Microsoft.NETCore.UniversalWindowsPlatform 6.0.1 @EdiWang reported this here: https://github.com/Microsoft/dotnet/issues/528 **Steps to Reproducte:** 1. Upgrade UWP's nuget package to Microsoft.NETCore.UniversalWindowsPlatform 6.0.1 3. Target 16299 for both target and min version. 4. Generate an app package to upload to store **Actual Behaviour:** Certification Failed > PI ClearCommBreak in kernel32.dll is not supported for this application type. System.IO.Ports.dll calls this API. > API ClearCommError in kernel32.dll is not supported for this application type. System.IO.Ports.dll calls this API. > .... etc. **Workaround** Downgrade the package to 5.4.1 will fix the problem. **Note** I don't know if the dev center is not ready for verify 6.x uwp package, or it is the package itself have problem? FYI the question on MSDN forum https://social.msdn.microsoft.com/Forums/en-US/b7355d61-cbf9-42e6-a9eb-44ffa144aa1f/rs31709certification-failure-due-to-unsupported-apis-after-upgrading-to-16299-sdk?forum=wpsubmit 24755 area-System.ComponentModel Parse CultureInfo no longer supported in .NET Core "@viktor-morin commented on [Thu Oct 19 2017](https://github.com/dotnet/core/issues/1035) Hi! I reported an error using Newtonsoft.Json where I recieved that the error was in .NET Core and not Newtonsoft.Json itself. Copy paste the issue here below: We are now changing to .NET Core and we get following error when trying to parse a following class: `Dictionary<CultureInfo,string>` > ArgumentException: Could not cast or convert from System.String to System.Globalization.CultureInfo. > Newtonsoft.Json.Utilities.ConvertUtils.EnsureTypeAssignable(object value, Type initialType, Type targetType) > JsonSerializationException: Error converting value ""en-US"" to type 'System.Globalization.CultureInfo'. Path 'Name.en-US', line 1, position 17. > Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, object value, CultureInfo culture, JsonContract contract, Type targetType) > JsonSerializationException: Could not convert string 'en-US' to dictionary key type 'System.Globalization.CultureInfo'. Create a TypeConverter to convert from the string to the key type object. Path 'Name.en-US', line 1, position 17. > Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateDictionary(IDictionary dictionary, JsonReader reader, JsonDictionaryContract contract, JsonProperty containerProperty, string id) This is working in .NET Framwork. Link to original post: [https://github.com/JamesNK/Newtonsoft.Json/issues/1457](https://github.com/JamesNK/Newtonsoft.Json/issues/1457) [@danmosemsft edited to make link clickable]" 24756 area-System.Runtime Port System.Runtime.Caching to .NET Core Please do not merge (yet) Contributes to #14529 24757 area-System.Diagnostics Markdown Format was Erasing Information The markdown symbol pipe was creating a cell making the content that had a pipe not readable. 24759 area-System.Net Create aggressive read/write concurrency test for SslStream https://github.com/dotnet/corefx/issues/24142#issuecomment-330671855 has identified that we don't work well on macOS with the 2.0.0 product (in... some... circumstances?) when an async read is blocked-running while a write writes to the same SslStream object. Since the scenario is one that we find virtuous, we should have a test to ensure that once the macOS version is fixed that it doesn't regress (and that the other platforms are meeting the guarantee and not regressing, either). (cc @karelz @Priya91 @wfurt) 24761 area-Meta Machine Learning Epic This Epic is to track work in CoreFx for the ML scenario. We expect this to principally include introducing a Tensor exchange type. Like all our Epics in order to see the child work items you must have the free [Zenhub browser plugin ](https://www.zenhub.com/) enabled. 24763 area-System.Collections "Tests under ""System.Collections.Tests"" failed with ""Exit code was 131 but it should have been 42""" Failed tests: System.Collections.Tests.SortedListTests.Item_Get_DifferentCulture System.Collections.Tests.CaseInsensitiveComparerTests.DefaultInvariant_Compare System.Collections.Tests.CaseInsensitiveHashCodeProviderTests.Default_Compare_TurkishI System.Collections.Tests.CaseInsensitiveHashCodeProviderTests.Ctor_Empty_ChangeCurrentCulture_GetHashCodeCompare System.Collections.Tests.HashtableTests.Ctor_IDictionary_IEqualityComparer System.Collections.Tests.HashtableTests.Ctor_IDictionary_Int_IEqualityComparer System.Collections.Tests.HashtableTests.Ctor_IEqualityComparer System.Collections.Tests.HashtableTests.Ctor_Int_IEqualityComparer System.Collections.Tests.HashtableTests.Ctor_Int_Int_IEqualityComparer System.Collections.Tests.ComparerTests.DefaultInvariant_Compare Configuration: outerloop_netcoreapp_osx10.12_release Detail: https://ci.dot.net/job/dotnet_corefx/job/master/job/outerloop_netcoreapp_osx_release/221/testReport/System.Collections.Tests/SortedListTests/Item_Get_DifferentCulture/ MESSAGE: Exit code was 131 but it should have been 42\nExpected: True\nActual: False +++++++++++++++++++ STACK TRACE: at System.Diagnostics.RemoteExecutorTestBase.RemoteInvokeHandle.Dispose() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_osx_release/src/CoreFx.Private.TestUtilities/src/System/Diagnostics/RemoteExecutorTestBase.cs:line 172 24766 area-System.Net "Test: System.Net.Security.Tests.ServerAsyncAuthenticateTest/ServerAsyncAuthenticate_MismatchProtocols_Fails failed with ""System.InvalidProgramException""" Opened on behalf of @Jiayili1 The test `System.Net.Security.Tests.ServerAsyncAuthenticateTest/ServerAsyncAuthenticate_MismatchProtocols_Fails(serverProtocol: Tls, clientProtocol: Tls12, expectedException: typeof(System.Security.Auth...` has failed. Assert.Throws() Failure Expected: typeof(System.Security.Authentication.AuthenticationException) Actual: typeof(System.InvalidProgramException): No exception available to rethrow. Stack Trace: at System.Threading.Tasks.TaskFactory`1.FromAsyncImpl[TArg1,TArg2,TArg3](Func`6 beginMethod, Func`2 endFunction, Action`1 endAction, TArg1 arg1, TArg2 arg2, TArg3 arg3, Object state, TaskCreationOptions creationOptions) in /root/coreclr/src/mscorlib/src/System/Threading/Tasks/FutureFactory.cs:line 1218 at System.Threading.Tasks.TaskFactory.FromAsync[TArg1,TArg2,TArg3](Func`6 beginMethod, Action`1 endMethod, TArg1 arg1, TArg2 arg2, TArg3 arg3, Object state) in /root/coreclr/src/mscorlib/src/System/Threading/Tasks/TaskFactory.cs:line 1092 at System.Net.Security.SslStream.AuthenticateAsServerAsync(X509Certificate serverCertificate, Boolean clientCertificateRequired, SslProtocols enabledSslProtocols, Boolean checkCertificateRevocation) in /root/corefx-1075192/src/System.Net.Security/src/System/Net/Security/SslStream.cs:line 405 at System.Net.Security.Tests.ServerAsyncAuthenticateTest.<ServerAsyncSslHelper>d__11.MoveNext() in /root/corefx-1075192/src/System.Net.Security/tests/FunctionalTests/ServerAsyncAuthenticateTest.cs:line 154 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in /root/coreclr/src/mscorlib/src/System/Runtime/ExceptionServices/ExceptionServicesCommon.cs:line 130 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in /root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/TaskAwaiter.cs:line 152 Build : Master - 20171020.01 (Core Tests) Failing configurations: - SLES.12.Amd64-x64 - Debug Detail: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171020.01/workItem/System.Net.Security.Tests/analysis/xunit/System.Net.Security.Tests.ServerAsyncAuthenticateTest~2FServerAsyncAuthenticate_MismatchProtocols_Fails(serverProtocol:%20Tls,%20clientProtocol:%20Tls12,%20expectedException:%20typeof(System.Security.Auth... 24767 area-System.Net "Test: System.Net.Security.Tests.SslStreamStreamToStreamTest_Async/SslStream_StreamToStream_WriteAsync_ReadAsync_Pending_Success failed with ""System.NullReferenceException""" Opened on behalf of @Jiayili1 The test `System.Net.Security.Tests.SslStreamStreamToStreamTest_Async/SslStream_StreamToStream_WriteAsync_ReadAsync_Pending_Success` has failed. System.IO.IOException : The read operation failed, see inner exception. ---- System.NullReferenceException : Object reference not set to an instance of an object. Stack Trace: at System.Net.Security.SslStreamInternal.EndRead(IAsyncResult asyncResult) in /root/corefx-1075192/src/System.Net.Security/src/System/Net/Security/SslStreamInternal.cs:line 155 at System.Net.Security.SslStream.EndRead(IAsyncResult asyncResult) in /root/corefx-1075192/src/System.Net.Security/src/System/Net/Security/SslStream.cs:line 696 at System.Threading.Tasks.TaskFactory`1.FromAsyncTrimPromise`1.Complete(TInstance thisRef, Func`3 endMethod, IAsyncResult asyncResult, Boolean requiresSynchronization) in /root/coreclr/src/mscorlib/src/System/Threading/Tasks/FutureFactory.cs:line 1344 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in /root/coreclr/src/mscorlib/src/System/Runtime/ExceptionServices/ExceptionServicesCommon.cs:line 130 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in /root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/TaskAwaiter.cs:line 152 at System.Net.Security.Tests.SslStreamStreamToStreamTest.<SslStream_StreamToStream_WriteAsync_ReadAsync_Pending_Success>d__10.MoveNext() in /root/corefx-1075192/src/System.Net.Security/tests/FunctionalTests/SslStreamStreamToStreamTest.cs:line 316 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in /root/coreclr/src/mscorlib/src/System/Runtime/ExceptionServices/ExceptionServicesCommon.cs:line 130 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in /root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/TaskAwaiter.cs:line 152 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in /root/coreclr/src/mscorlib/src/System/Runtime/ExceptionServices/ExceptionServicesCommon.cs:line 130 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in /root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/TaskAwaiter.cs:line 152 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in /root/coreclr/src/mscorlib/src/System/Runtime/ExceptionServices/ExceptionServicesCommon.cs:line 130 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in /root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/TaskAwaiter.cs:line 152 ----- Inner Stack Trace ----- at System.Buffers.TlsOverPerCoreLockedStacksArrayPool`1.Return(T[] array, Boolean clearArray) in /root/coreclr/src/mscorlib/shared/System/Buffers/TlsOverPerCoreLockedStacksArrayPool.cs:line 178 at System.Net.Security.SslStreamInternal.ReturnReadBufferIfEmpty() in /root/corefx-1075192/src/System.Net.Security/src/System/Net/Security/SslStreamInternal.cs:line 54 at System.Net.Security.SslStreamInternal.CopyDecryptedData(Byte[] buffer, Int32 offset, Int32 count) in /root/corefx-1075192/src/System.Net.Security/src/System/Net/Security/SslStreamInternal.cs:line 517 at System.Net.Security.SslStreamInternal.ProcessFrameBody(Int32 readBytes, Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) in /root/corefx-1075192/src/System.Net.Security/src/System/Net/Security/SslStreamInternal.cs:line 697 at System.Net.Security.SslStreamInternal.StartFrameBody(Int32 readBytes, Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) in /root/corefx-1075192/src/System.Net.Security/src/System/Net/Security/SslStreamInternal.cs:line 652 at System.Net.Security.SslStreamInternal.ReadHeaderCallback(AsyncProtocolRequest asyncRequest) in /root/corefx-1075192/src/System.Net.Security/src/System/Net/Security/SslStreamInternal.cs:line 758 Build : Master - 20171020.01 (Core Tests) Failing configurations: - SLES.12.Amd64-x64 - Debug Detail: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171020.01/workItem/System.Net.Security.Tests/analysis/xunit/System.Net.Security.Tests.SslStreamStreamToStreamTest_Async~2FSslStream_StreamToStream_WriteAsync_ReadAsync_Pending_Success 24768 area-System.Net "Test: System.Net.Tests.SimpleHttpTests/UnknownHeaders_Success failed with ""Xunit.Sdk.EqualException""" Opened on behalf of @Jiayili1 The test `System.Net.Tests.SimpleHttpTests/UnknownHeaders_Success(numHeaders: 100)` has failed. Assert.Equal() Failure\r Expected: 0\r Actual: (null) Stack Trace: at System.Net.Tests.SimpleHttpTests.<UnknownHeaders_Success>d__13.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) Build : 2.0.0 - 20171020.01 (Core Tests) Failing configurations: - windows.10.amd64.iot-x64 - Release Detail: https://mc.dot.net/#/product/netcore/200/source/official~2Fcorefx~2Frelease~2F2.0.0~2F/type/test~2Ffunctional~2Fcli~2F/build/20171020.01/workItem/System.Net.HttpListener.Tests/analysis/xunit/System.Net.Tests.SimpleHttpTests~2FUnknownHeaders_Success(numHeaders:%20100) 24770 area-System.Collections Add RemoveIfValue to ConcurrentDictionary "This is similar to #24246, but I don't think it's quite the same. I have the following scenario: I use a ConcurrentDictionary<Key,Value> as the core of a simple memory cache. The Get function of the cache will look up the key, and check the value's timestamp to see if the entry is expired. If it is, I want to remove it from the dictionary. However, a different thread might have concurrently renewed the cache entry, thus making removal unnecessary. So I want to remove the entry, but only if it is still the same value as before. I am basically looking for TryUpdate, but with the updated value being ""not there"". Or to put it another way, I want ICollection.Remove(KeyValuePair) exposed and documented as a regular function. The implementation is actually trivial: ``` public bool RemoveIfValue(TKey key, TValue value) { if (key == null) throw new ArgumentNullException(nameof(key), SR.ConcurrentDictionary_ItemKeyIsNull); TValue throwAwayValue; return TryRemoveInternal(key, out throwAwayValue, true, value); } ``` This is basically a copy&paste of the explicit IDictionary.Remove implementation, but with separate arguments instead of a KeyValuePair, and exposed as a method accessible without casting. This can currently be worked around with this extension method: ``` public static bool RemoveIfValue<TKey, TValue>(this ConcurrentDictionary<TKey, TValue> self, TKey key, TValue value) { var asCollection = (ICollection<KeyValuePair<TKey, TValue>>)self; return asCollection.Remove(new KeyValuePair<TKey, TValue>(key, value)); } ```" 24771 area-System.Runtime Throw exception if SysConf fails in Environment.ProcessorCount This shouldn't happen in a valid configuration, but adding the exception to help highlight the problem with an invalid configuration. Related to https://github.com/dotnet/corefx/issues/24663 cc: @joperezr, @AlexGhiondea 24773 area-System.Linq Add optimized path for IReadOnlyCollection/IReadOnlyList in System.Linq It's kind of historical reason for the readonly interfaces not inherited by `ICollection<T>`/`IList<T>`. Adding a optimized path needs a copy of all `ICollection<T>`/`IList<T>` paths and classes. Implementing `ICollection<T>` with `IsReadOnly = true` does get the optimizations, but it's kind of violating the interfaces. 24774 area-System.Net Request for documentation of HttpClientHandler.ServerCertificateCustomValidationCallback Currently the behavior of the property ServerCertificateCustomValidationCallback of the class HttpClientHandler is not obvious and lacks proper documentation. This is a request to document the behavior of the property. I would expect the documentation to go into details on: - what behavior is support on different OS and frameworks (and probably how the version of the SSL/CURL stack affect this) - how this property should be used for different OS and frameworks - how to determine what is supported for the current OS/framework/network stack - its relation to the HttpClientHandler.DangerousAcceptAnyServerCertificateValidator - how and if it might affect or be affected by code that use ServicePointManager.ServerCertificateValidationCallback (e.g. potential race conditions) - how and if it might affect or be affected by code that use WebRequestHandler.ServerCertificateValidationCallback (e.g. potential race conditions) Also I would like to request similar documentation for the WebRequestHandler.ServerCertificateValidationCallback property. 24775 area-System.Net System.Net.Security tests hanging more often on Linux "e.g. https://mc.dot.net/#/user/stephentoub/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/f60e3fcc6d98a1e237ad36c302f421410267328c/workItem/System.Net.Security.Tests/wilogs ``` Executed on dnblup140000TTW 2017-10-20 14:09:11,846: INFO: scriptrunner(33): _main: BuildTools Helix Script Runner v0.1 starting 2017-10-20 14:09:11,847: INFO: helix_test_execution(24): __init__: Copying execution payload files from /home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip to /home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution 2017-10-20 14:09:11,847: INFO: io(27): copy_tree_to: Copying '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/kdc.conf.ubuntu' to '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution/kdc.conf.ubuntu' 2017-10-20 14:09:11,847: INFO: io(27): copy_tree_to: Copying '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/setup-kdc.sh' to '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution/setup-kdc.sh' 2017-10-20 14:09:11,848: INFO: io(27): copy_tree_to: Copying '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/krb5.conf' to '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution/krb5.conf' 2017-10-20 14:09:11,848: INFO: io(27): copy_tree_to: Copying '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/System.Net.Security.Tests.dll' to '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution/System.Net.Security.Tests.dll' 2017-10-20 14:09:11,848: INFO: io(27): copy_tree_to: Copying '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/System.Net.Security.Tests.pdb' to '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution/System.Net.Security.Tests.pdb' 2017-10-20 14:09:11,849: INFO: io(27): copy_tree_to: Copying '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/RemoteExecutorConsoleApp.pdb' to '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution/RemoteExecutorConsoleApp.pdb' 2017-10-20 14:09:11,849: INFO: io(27): copy_tree_to: Copying '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/kdc.conf.opensuse' to '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution/kdc.conf.opensuse' 2017-10-20 14:09:11,849: INFO: io(27): copy_tree_to: Copying '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/kdc.conf.centos' to '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution/kdc.conf.centos' 2017-10-20 14:09:11,849: INFO: io(27): copy_tree_to: Copying '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/xunit.console.netcore.runtimeconfig.json' to '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution/xunit.console.netcore.runtimeconfig.json' 2017-10-20 14:09:11,849: INFO: io(27): copy_tree_to: Copying '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/RunTests.sh' to '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution/RunTests.sh' 2017-10-20 14:09:11,850: INFO: io(27): copy_tree_to: Copying '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/RemoteExecutorConsoleApp.exe' to '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution/RemoteExecutorConsoleApp.exe' 2017-10-20 14:09:11,850: INFO: io(27): copy_tree_to: Copying '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/xunit.console.netcore.exe' to '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution/xunit.console.netcore.exe' 2017-10-20 14:09:11,850: INFO: io(27): copy_tree_to: Copying '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/RemoteExecutorConsoleApp.runtimeconfig.json' to '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution/RemoteExecutorConsoleApp.runtimeconfig.json' 2017-10-20 14:09:11,850: INFO: io(27): copy_tree_to: Copying '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/DumplingHelper.py' to '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution/DumplingHelper.py' 2017-10-20 14:09:11,850: INFO: io(27): copy_tree_to: Copying '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/TestData/testselfsignedservereku.contoso.com.p7b' to '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution/TestData/testselfsignedservereku.contoso.com.p7b' 2017-10-20 14:09:11,851: INFO: io(27): copy_tree_to: Copying '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/TestData/testnoeku.contoso.com.pfx' to '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution/TestData/testnoeku.contoso.com.pfx' 2017-10-20 14:09:11,851: INFO: io(27): copy_tree_to: Copying '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/TestData/testservereku.contoso.com.cer' to '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution/TestData/testservereku.contoso.com.cer' 2017-10-20 14:09:11,851: INFO: io(27): copy_tree_to: Copying '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/TestData/testselfsignedclienteku.contoso.com.pfx' to '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution/TestData/testselfsignedclienteku.contoso.com.pfx' 2017-10-20 14:09:11,851: INFO: io(27): copy_tree_to: Copying '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/TestData/testservereku.contoso.com.p7b' to '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution/TestData/testservereku.contoso.com.p7b' 2017-10-20 14:09:11,852: INFO: io(27): copy_tree_to: Copying '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/TestData/contoso.com.cer' to '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution/TestData/contoso.com.cer' 2017-10-20 14:09:11,852: INFO: io(27): copy_tree_to: Copying '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/TestData/testselfsignedclienteku.contoso.com.cer' to '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution/TestData/testselfsignedclienteku.contoso.com.cer' 2017-10-20 14:09:11,852: INFO: io(27): copy_tree_to: Copying '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/TestData/testclienteku.contoso.com.pfx' to '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution/TestData/testclienteku.contoso.com.pfx' 2017-10-20 14:09:11,852: INFO: io(27): copy_tree_to: Copying '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/TestData/testnoeku.contoso.com.p7b' to '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution/TestData/testnoeku.contoso.com.p7b' 2017-10-20 14:09:11,852: INFO: io(27): copy_tree_to: Copying '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/TestData/testservereku.contoso.com.pfx' to '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution/TestData/testservereku.contoso.com.pfx' 2017-10-20 14:09:11,853: INFO: io(27): copy_tree_to: Copying '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/TestData/testclient1_at_contoso.com.p7b' to '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution/TestData/testclient1_at_contoso.com.p7b' 2017-10-20 14:09:11,853: INFO: io(27): copy_tree_to: Copying '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/TestData/testclienteku.contoso.com.cer' to '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution/TestData/testclienteku.contoso.com.cer' 2017-10-20 14:09:11,853: INFO: io(27): copy_tree_to: Copying '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/TestData/testnoeku.contoso.com.cer' to '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution/TestData/testnoeku.contoso.com.cer' 2017-10-20 14:09:11,853: INFO: io(27): copy_tree_to: Copying '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/TestData/testselfsignedservereku.contoso.com.cer' to '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution/TestData/testselfsignedservereku.contoso.com.cer' 2017-10-20 14:09:11,853: INFO: io(27): copy_tree_to: Copying '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/TestData/DummyTcpServer.pfx' to '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution/TestData/DummyTcpServer.pfx' 2017-10-20 14:09:11,853: INFO: io(27): copy_tree_to: Copying '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/TestData/testselfsignedclienteku.contoso.com.p7b' to '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution/TestData/testselfsignedclienteku.contoso.com.p7b' 2017-10-20 14:09:11,854: INFO: io(27): copy_tree_to: Copying '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/TestData/contoso.com.pfx' to '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution/TestData/contoso.com.pfx' 2017-10-20 14:09:11,854: INFO: io(27): copy_tree_to: Copying '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/TestData/contoso.com.p7b' to '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution/TestData/contoso.com.p7b' 2017-10-20 14:09:11,854: INFO: io(27): copy_tree_to: Copying '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/TestData/testclient1_at_contoso.com.pfx' to '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution/TestData/testclient1_at_contoso.com.pfx' 2017-10-20 14:09:11,854: INFO: io(27): copy_tree_to: Copying '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/TestData/testclienteku.contoso.com.p7b' to '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution/TestData/testclienteku.contoso.com.p7b' 2017-10-20 14:09:11,854: INFO: io(27): copy_tree_to: Copying '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/TestData/testselfsignedservereku.contoso.com.pfx' to '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution/TestData/testselfsignedservereku.contoso.com.pfx' 2017-10-20 14:09:11,855: INFO: io(27): copy_tree_to: Copying '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/TestData/testclient1_at_contoso.com.cer' to '/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Exec/execution/TestData/testclient1_at_contoso.com.cer' 2017-10-20 14:09:11,855: INFO: proc(23): run_and_log_output: Running: /home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip/RunTests.sh /home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Payload 2017-10-20 14:09:11,855: INFO: proc(26): run_and_log_output: CWD: /home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip 2017-10-20 14:09:11,858: INFO: proc(54): run_and_log_output: Output: Using as the test runtime folder. 2017-10-20 14:09:11,860: INFO: proc(54): run_and_log_output: Output: Running tests... Start time: 14:09:11 2017-10-20 14:09:11,860: INFO: proc(54): run_and_log_output: Output: Commands: 2017-10-20 14:09:11,860: INFO: proc(54): run_and_log_output: Output: python DumplingHelper.py install_dumpling 2017-10-20 14:09:11,860: INFO: proc(54): run_and_log_output: Output: __TIMESTAMP=`python DumplingHelper.py get_timestamp` 2017-10-20 14:09:11,860: INFO: proc(54): run_and_log_output: Output: chmod +x /home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Payload/dotnet 2017-10-20 14:09:11,861: INFO: proc(54): run_and_log_output: Output: /home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Payload/dotnet xunit.console.netcore.exe System.Net.Security.Tests.dll -xml testResults.xml -notrait Benchmark=true -notrait category=nonnetcoreapptests -notrait category=nonlinuxtests -notrait category=OuterLoop -notrait category=failing 2017-10-20 14:09:11,861: INFO: proc(54): run_and_log_output: Output: python DumplingHelper.py collect_dump $\ `pwd` System.Net.Security.Tests /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/bin/runtime/netcoreapp-Linux-Release-x64/,/mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/bin/tests/System.Net.Security.Tests/netcoreapp-Linux-Release-x64/,/home/helixbot/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Payload,/lib/x86_64-linux-gnu/libgcc_s.so.1,/lib/x86_64-linux-gnu/libpthread.so.0,/lib/x86_64-linux-gnu/librt.so.1,/usr/lib/x86_64-linux-gnu/libunwind.so.8,/lib/x86_64-linux-gnu/libdl.so.2,/lib/x86_64-linux-gnu/libuuid.so.1,/usr/lib/x86_64-linux-gnu/libunwind-x86_64.so.8,/usr/lib/x86_64-linux-gnu/libstdc++.so.6,/lib/x86_64-linux-gnu/libm.so.6,/lib/x86_64-linux-gnu/libc.so.6,/lib64/ld-linux-x86-64.so.2,/lib/x86_64-linux-gnu/liblzma.so.5 2017-10-20 14:09:11,861: INFO: proc(54): run_and_log_output: Output: ~/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip ~/dotnetbuild/work/282ace74-88c4-48cc-a76d-4d82bfa600c7/Work/48747109-97f1-465f-973b-e824e0f189ff/Unzip 2017-10-20 14:09:12,187: INFO: proc(54): run_and_log_output: Output: downloaded dumpling.py 2017-10-20 14:09:12,188: INFO: proc(54): run_and_log_output: Output: total elapsed time 0:00:00.201976 2017-10-20 14:09:12,296: INFO: proc(54): run_and_log_output: Output: xUnit.net console test runner (64-bit .NET Core) 2017-10-20 14:09:12,296: INFO: proc(54): run_and_log_output: Output: Copyright (C) 2014 Outercurve Foundation. 2017-10-20 14:09:12,297: INFO: proc(54): run_and_log_output: Output: 2017-10-20 14:09:12,355: INFO: proc(54): run_and_log_output: Output: Discovering: System.Net.Security.Tests 2017-10-20 14:09:12,573: INFO: proc(54): run_and_log_output: Output: Discovered: System.Net.Security.Tests 2017-10-20 14:09:12,669: INFO: proc(54): run_and_log_output: Output: Starting: System.Net.Security.Tests 2017-10-20 14:09:16,107: INFO: proc(54): run_and_log_output: Output: System.Net.Security.Tests.SslStreamEKUTest.SslStream_NoEKUServerAuth_Ok [SKIP] 2017-10-20 14:09:16,108: INFO: proc(54): run_and_log_output: Output: Condition(s) not met: \""IsRootCertificateInstalled\"" 2017-10-20 14:09:16,109: INFO: proc(54): run_and_log_output: Output: System.Net.Security.Tests.SslStreamEKUTest.SslStream_SelfSignedClientEKUClientAuth_Ok [SKIP] 2017-10-20 14:09:16,109: INFO: proc(54): run_and_log_output: Output: Condition(s) not met: \""IsRootCertificateInstalled\"" 2017-10-20 14:09:16,109: INFO: proc(54): run_and_log_output: Output: System.Net.Security.Tests.SslStreamEKUTest.SslStream_NoEKUClientAuth_Ok [SKIP] 2017-10-20 14:09:16,109: INFO: proc(54): run_and_log_output: Output: Condition(s) not met: \""IsRootCertificateInstalled\"" 2017-10-20 14:09:16,109: INFO: proc(54): run_and_log_output: Output: System.Net.Security.Tests.SslStreamEKUTest.SslStream_ServerEKUClientAuth_Fails [SKIP] 2017-10-20 14:09:16,109: INFO: proc(54): run_and_log_output: Output: Condition(s) not met: \""IsRootCertificateInstalled\"" 2017-10-20 14:09:16,109: INFO: proc(54): run_and_log_output: Output: System.Net.Security.Tests.SslStreamEKUTest.SslStream_ClientEKUServerAuth_Fails [SKIP] 2017-10-20 14:09:16,109: INFO: proc(54): run_and_log_output: Output: Condition(s) not met: \""IsRootCertificateInstalled\"" Killed ``` cc: @geoffkizer, @Drawaes @Drawaes, I'm a little worried this is due to some of the recent SslStream changes. @safern, @danmosemsft, we don't yet have a way to know which test(s) hung, do we?" 24776 area-Infrastructure netcoreapp build vertical needs to be buildable without previous versions See comment at https://github.com/dotnet/corefx/pull/24708#discussion_r145993635. For our netcoreapp build vertical we need to be able to build it against the latest version without needing to restore the older packages. This is for the build-from-source efforts which require us to build all the assets instead of restoring them. 24778 area-System.Net ManagedHandler: Protocol corruption if 100-continue is expected but not received ManagedHandler has the same 100-continue bug as CurlHandler: https://github.com/dotnet/corefx/issues/24435 100-continue is an inherent race condition. The client is waiting for a 100 response or a final response, but only for a given timeout. When the server sends the final response without a 100, it has no way of knowing if the client's timer has expired and it has already started sending data. This would be an ambiguous situation as the server wouldn't reliably know if the next bytes it received were the body it was promised or the headers for the next request. To prevent this ambiguity the client must always send the data it promised, or a chunked terminator, or close the connection. For small bodies it's worth sending it to avoid the cost of creating a new connection, but for large bodies is far more economical close the connection. ManagedHandler (and CurlHandler) does not send the the request body if it receives a final response rather than a 100 continue. This causes protocol corruption on the next request and it is rejected by the server (e.g. 400 Bad Request). Final status codes are common in authentication scenarios like when the user's request is rejected due to missing or insufficient permissions. The client can send a new request with the required credentials, and many clients do this automatically. See AuthenticationHandler. Workaround: Apps must disable ExpectContinue on every request with a body. The fix for ManagedHandler looks small, handling for ReceivedOtherStatusCode needs to be added to the switch here: https://github.com/dotnet/corefx/blob/08802ff9c877f7f75a82d6704d84d321e99eb5c8/src/System.Net.Http/src/System/Net/Http/Managed/HttpConnection.cs#L457-L462 Sending the data is the minimal fix, but consider sending only the chunked terminator or closing the connection for non-trivial request bodies. This can also avoid problems with un-buffered HttpContent objects that can't be sent twice. 24779 area-System.Runtime Adding tests for Random Hashing Fixes #24466 cc: @danmosemsft @stephentoub 24781 area-System.Net [WIP] Checking Master with <XunitShowProgress>true</XunitShowProgress> Outerloop 24782 area-Infrastructure Update ProjectNTfs, ProjectNTfsTestILC, Standard to rel-25916-00, rel-25916-00, preview1-25916-01, respectively (release/uwp6.0) 24788 area-System.Linq Add a single parameter, with return type `ValueTuple` overload for `Enumerable.Zip`? "Instead of writing ```cs foreach (var (x, y) in Seq1.Zip(Seq2, (s1, s2) => (s1, s2))) ``` we could write: ```cs foreach (var (x, y) in Seq1.Zip(Seq2)) ``` The implementation seems to be trivial: ```cs public static class ZipExtensions { public static IEnumerable<(T, U)> Zip<T, U>(this IEnumerable<T> seq1, IEnumerable<U> seq2) { return seq1.Zip(seq2, (x, y) => (x, y)); } } ``` ## Usage ```cs var list = new List<int>{1, 2, 3, 4}; foreach(var (n, i) in list.Zip(Range(0, list.Count))) { Console.WriteLine($""{i}: {n}""); } ``` ## Other Languages `Zip`-like functions in Rust, C++ (Boost, range-v3) all return `tuple`s." 24789 area-System.Net Make Expect: 100-continue handling more robust "When libcurl sends an Expect: 100-continue header, if it gets back a success error code, it may avoid sending the remaining payload and also may keep the connection open, which can confuse servers that expect to receive the fully promised payload and that don't close the connection when sending a final success status code instead of 100 continue. To mitigate this, we simply change the default ExpectContinue == null behavior to be the equivalent of ExpectContinue == false rather than to be ""do whatever the platform decides"". This also more closely aligns with WinHttpHandler and ManagedHandler, where effectively the ""platform"" in those cases decides that the default is disabled. For ManagedHandler, currently we're mimicking behavior like that libcurl employed and may sometimes not send the full payload but still keep the connection open. Instead, make sure we either always send the full payload or close the connection. Fixes https://github.com/dotnet/corefx/issues/24435 Fixes https://github.com/dotnet/corefx/issues/24778 cc: @geoffkizer, @Tratcher, @Priya91, @wfurt " 24791 area-System.Net SSLStream Check for deallocated GCHandle The GCHandle can easily be deallocated (by closing the SSlStream or if it's cancelled) before OpenSsl calls back due to the otherside sending the Client Hello. Therefore if I am not mistaken we should check that the GCHandle is still allocated when we rehydrate it from a pointer handed in from unmanaged code? Also if it is null or deallocated, we don't want to throw an exception inside a Native callback because it can cause all kinds of havoc. 24792 area-System.Data SqlClient: OUTPUT clause causes exceptions to not get thrown until read "This scenario is a bit lengthy, so I'll load it into a gist: https://gist.github.com/benrr101/31628b57f1ab410090237c9018860e05 Basically what this boils down to is that if I `.ExecuteReader()` on a `SqlCommand` that has an `OUTPUT` clause in it, I don't get an exception from the query failing until I call `.Read()` on the `SqlDataReader` I gt back. For instance executing: ``` INSERT INTO [dbo].[testtable]([small_col]) VALUES (""this value will be truncated"") SELECT * FROM [dbo].[testtable] ``` ``` SqlDataReader reader = cmd.ExecuteReader(); // Doesn't throw reader.Read() // DOES throw ``` But executing: ``` INSERT INTO [dbo].[testtable]([small_col]) OUTPUT inserted.[small_col] VALUES (""this value will be truncated"") ``` ``` SqlDataReader reader = cmd.ExecuteReader(); // DOES throw reader.Read(); // Never executed ``` At this point I'm not sure if this is an expected behavior due to quirks in the TDS protocol or if it's a bug. Nevertheless, this is a bit of weird behavior that has already caused us a couple unexpected issue." 24793 area-System.Runtime Add Convert.cs performance tests. Add Convert.cs performance tests. (#18765) 24794 area-System.Runtime Environment.ProcessorCount is -1 "On my Linux system (a VPS running Debian, using the [KVM](https://www.linux-kvm.org/page/Main_Page) virtualization platform), `Environment.ProcessorCount` is returning `-1`. However, the native syscall works fine: ```csharp using System; using System.Runtime.InteropServices; namespace ConcurrentBug { class Program { private const int _SC_NPROCESSORS_ONLN = 84; [DllImport(""libc"")] private static extern long sysconf(int name); static void Main(string[] args) { Console.WriteLine($""Processor Count (Managed): {Environment.ProcessorCount}""); Console.WriteLine($""Processor Count (Native): {sysconf(_SC_NPROCESSORS_ONLN)}""); } } } ``` ``` 0:25 daniel@vps03 /tmp/ConcurrentBug % /usr/bin/dotnet ConcurrentBug.dll Processor Count (Managed): -1 Processor Count (Native): 1 ``` This breaks the default constructor for `ConcurrentDictionary` - **All** ASP.NET Core sites on this server fail with: ``` Unhandled Exception: System.ArgumentOutOfRangeException: The concurrencyLevel argument must be positive. Parameter name: concurrencyLevel at System.Collections.Concurrent.ConcurrentDictionary`2..ctor(Int32 concurrencyLevel, Int32 capacity, Boolean growLockArray, IEqualityComparer`1 comparer) at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher..ctor(String root, FileSystemWatcher fileSystemWatcher, Boolean pollForChanges) at Microsoft.Extensions.FileProviders.PhysicalFileProvider.CreateFileWatcher(String root) at Microsoft.AspNetCore.Hosting.Internal.HostingEnvironmentExtensions.Initialize(IHostingEnvironment hostingEnvironment, String applicationName, String contentRootPath, WebHostOptions options) at Microsoft.AspNetCore.Hosting.WebHostBuilder.BuildCommonServices(AggregateException& hostingStartupErrors) at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build() at Example.Web.Program.BuildWebHost(String[] args) in C:\src\Example\src\Example.Web\Program.cs:line 21 at Example.Web.Program.Main(String[] args) in C:\src\Example\src\Example.Web\Program.cs:line 17 ``` ## Environment ``` 0:16 daniel@vps03 /tmp/ConcurrentBug % /usr/bin/dotnet --info .NET Command Line Tools (2.0.0) Product Information: Version: 2.0.0 Commit SHA-1 hash: cdcd1928c9 Runtime Environment: OS Name: debian OS Version: OS Platform: Linux RID: debian-x64 Base Path: /usr/share/dotnet/sdk/2.0.0/ Microsoft .NET Core Shared Framework Host Version : 2.0.0 Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d 0:17 daniel@vps03 /tmp/ConcurrentBug % cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 60 model name : Intel(R) Xeon(R) CPU E3-1270 v3 @ 3.50GHz stepping : 3 microcode : 0x1 cpu MHz : 3500.014 cache size : 8192 KB physical id : 0 siblings : 1 core id : 0 cpu cores : 1 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm fsgsbase bmi1 avx2 smep bmi2 erms invpcid xsaveopt bugs : bogomips : 7000.02 clflush size : 64 cache_alignment : 64 address sizes : 40 bits physical, 48 bits virtual power management: ``` " 24796 area-System.Diagnostics [Api] StackTraceFormatting{Options} "## Motivation Stack traces are very noisy as they *post*-exception stacks (and ones used to produce the exception, like `ThrowHelper`s); that are the same for every exception: ``` at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at Program.<DelayedAsync>d__2.MoveNext() ``` When only ``` at Program.<DelayedAsync>d__2.MoveNext() ``` Is useful in diagnosing the exception. A way is needed to discard these post-error helper stacks; to make the stack-trace more useful and less noise. ## Proposed Api Adds extra .ctor overload + param to `DebuggerNonUserCodeAttribute` ```csharp [Flags] public enum StackTraceFormattingOptions { None = 0, StackTraceHidden = 1 << 0 ... } ``` ```csharp public partial class DebuggerNonUserCodeAttribute { /// <summary>Initializes the <see cref=""DebuggerNonUserCodeAttribute""/>.</summary> /// <param name=""stackTraceOptions"">The <see cref=""StackTraceFormattingOptions""/> hint.</param> public DebuggerNonUserCodeAttribute(StackTraceFormattingOptions stackTraceOptions) { StackTraceOptions = stackTraceOptions; } /// <summary>Gets the <see cref=""StackTraceFormattingOptions""/>.</summary> internal StackTraceFormattingOptions StackTraceOptions { get; } } ``` Adds StackTrace formatting configuration (which can be switched at runtime; if more detailed traces are needed) ```csharp [Flags] public enum StackTraceFormatting { None = 0, ExcludeStackTraceHidden = 1 << 0, // DebuggerNonUserCode /w StackTraceHidden ExcludeDispatchBoundaries = 1 << 1, ExcludeNonUserCode = 1 << 2 // DebuggerNonUserCode ... } ``` ```csharp public partial class StackTrace { public static StackTraceFormatting FormattingOptions { get; set; } } ``` **Related:** * ""Make stack traces readable"" https://github.com/dotnet/corefx/issues/24627 * ""Improved formatting for async stack traces"" https://github.com/dotnet/coreclr/issues/2813 * ""Provide an API for traversing/reasoning about async call stacks"" https://github.com/dotnet/corefx/issues/1370 * ""BuilderMethodAttribute"" https://github.com/dotnet/corefx/issues/24795" 24798 area-System.IO Change lifetime of Socket used in NamedPipeServerStream on Unix We currently create and destroy the unix domain socket each time WaitForConnection{Async} is called, and it lives until the client connects. This causes problems when multiple clients try to connect before WaitForConnection{Async} is called; any number that's under the min listen limit applied by the OS will have their connections completed, even though Accept hasn't been called, and then when the socket is closed, the connections will all fail. This change moves the UDS creation to when the NamedPipeServerStream is created, deleting it when the NPSS is disposed. cc: @pjanotti, @JeremyKuhne, @jaredpar, @khyperia 24799 area-System.Net SSLStream Fixing GC Hole 24800 area-System.Net Remove dead code from System.Net.NetworkInformation PR addresses issue #17905, project **System.Net.NetworkInformation**. Most of the red things in the [diff file](http://tempcoverage.blob.core.windows.net/report2/System.Net.NetworkInformation.diff.html) are in `src\Common` folder. 24801 area-System.Net Remove dead code from System.Net.Primitives PR addresses issue #17905, project **System.Net.Primitives**. 24802 area-System.Net Port WinRT WebSockets Client fix (#21600) to UWP servicing (netcore50) branch As as been reported [here](https://github.com/dotnet/corefx/issues/17317), if the connection of a `ClientWebSocket` in NETStandard16 is terminated, the process will crash because the exception cannot be handled. This issue has been adressed in NETStandard20/UWP6.0 and the FCU, and it works if you target W10 build 16299 on a desktop. However, on W10M devices like the Lumia 640, the build and thus NETStandard20 is unavailable and everytime a connection is disrupted the app will crash. Could a fix for this be made available, preferably in the near future? Seeing your app being killed without anything you can do for several months because of a known and identified issue is tiresome. 24803 area-Meta Adjust link fit to other URLs 24804 area-System.Net Test failure: System.Net.Sockets.Tests.TimeoutTest / SendTimesOut_Throws ## Types of failures ``` Assert.InRange() Failure Range: (1000 - 4000) Actual: 4846.0518 at System.Net.Sockets.Tests.TimeoutTest.SendTimesOut_Throws(Boolean forceNonBlocking) in /root/corefx-1079585/src/System.Net.Sockets/tests/FunctionalTests/TimeoutTest.cs:line 130 ``` ## History of failures Day | Build | OS | Error message -- | -- | -- | -- 8/16 | 20170816.01 | Debian90 | Range: (1500 - 3000), Actual: 3276.4603 8/16 | 20170816.01 | Debian90 | Range: (1500 - 3000), Actual: 726.4583 8/28 | 20170828.01 | Ubuntu14.04 | Range: (1500 - 3000), Actual: 1428.4429 10/23 | 20171023.01 | Suse42.2 | Range: (1000 - 4000), Actual: 4846.0518 - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171023.01/workItem/System.Net.Sockets.Tests/analysis/xunit/System.Net.Sockets.Tests.TimeoutTest~2FSendTimesOut_Throws(forceNonBlocking:%20False)) 24805 area-System.Security Test failure: System.Security.Cryptography.Csp.Tests.RSACryptoServiceProviderTests/Verify_InvalidPaddingMode_Throws Opened on behalf of @Jiayili1 The test `System.Security.Cryptography.Csp.Tests.RSACryptoServiceProviderTests/Verify_InvalidPaddingMode_Throws` has failed. $BlockedFromReflection_5_22711b8a : A device attached to the system is not functioning Stack Trace: at Internal.NativeCrypto.CapiHelper.SignValue($SafeProvHandle hProv, $SafeKeyHandle hKey, Int32 keyNumber, Int32 calgKey, Int32 calgHash, Byte[] hash) in E:\A\_work\1190\s\corefx\src\System.Security.Cryptography.Csp\src\System\Security\Cryptography\CapiHelper.Windows.cs:line 1223 at System.Security.Cryptography.RSACryptoServiceProvider.SignData(Byte[] buffer, Object halg) in E:\A\_work\1190\s\corefx\src\System.Security.Cryptography.Csp\src\System\Security\Cryptography\RSACryptoServiceProvider.Windows.cs:line 420 at System.Security.Cryptography.Csp.Tests.RSACryptoServiceProviderTests.Verify_InvalidPaddingMode_Throws() in E:\A\_work\1190\s\corefx\src\System.Security.Cryptography.Csp\tests\RSACryptoServiceProviderTests.cs:line 373 at _$ILCT$.$ILT$ReflectionDynamicInvoke$.InvokeRetV(Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean targetIsThisCall) at System.InvokeUtils.CalliIntrinsics.Call(IntPtr dynamicInvokeHelperMethod, Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean isTargetThisCall) at System.InvokeUtils.CallDynamicInvokeMethod(Object thisPtr, IntPtr methodToCall, Object thisPtrDynamicInvokeMethod, IntPtr dynamicInvokeHelperMethod, IntPtr dynamicInvokeHelperGenericDictionary, Object targetMethodOrDelegate, Object[] parameters, BinderBundle binderBundle, Boolean wrapInTargetInvocationException, Boolean invokeMethodHelperIsThisCall, Boolean methodToCallIsThisCall) in CallDynamicInvokeMethod:line 16707566 Build : Master - 20171023.01 (UWP ILC Tests) Failing configurations: - Windows.10.Amd64-arm - Debug Detail: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Filc~2F/build/20171023.01/workItem/System.Security.Cryptography.Csp.Tests.Execution/analysis/xunit/System.Security.Cryptography.Csp.Tests.RSACryptoServiceProviderTests~2FVerify_InvalidPaddingMode_Throws 24807 area-System.Net System.Net.Mail.Tests.LoggingTest.EventSource_EventsRaisedAsExpected failed in CI Failed test: System.Net.Mail.Tests.LoggingTest.EventSource_EventsRaisedAsExpected Detail: https://ci.dot.net/job/dotnet_corefx/job/master/job/osx10.12_release/3401/testReport/System.Net.Mail.Tests/LoggingTest/EventSource_EventsRaisedAsExpected/ Configuration: osx10.12_release MESSAGE: ~~~ Exit code was 131 but it should have been 42\nExpected: True\nActual: False ~~~ STACK TRACE: ~~~ at System.Diagnostics.RemoteExecutorTestBase.RemoteInvokeHandle.Dispose() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_release/src/CoreFx.Private.TestUtilities/src/System/Diagnostics/RemoteExecutorTestBase.cs:line 189 ~~~ 24809 area-System.Net Improve SO_REUSE{ADDR,PORT} xplat behavior for TCP Fixes #24562 The test cases added would fail on Unix and pass on Windows. The ProtocolType is passed to Bind, GetSockOpt and SetSockOpt to change the behavior for TCP in pal_networking.cpp. CC @wfurt @geoffkizer @Priya91 @halter73 @stephentoub 24812 area-System.Diagnostics Add PerformanceCounters Testing 24815 area-System.Net Remove dead code from System.Net.Requests PR addresses issue #17905, project **System.Net.Requests**. 24816 area-System.Net Remove dead code from System.Net.Security PR addresses issue #17905, project **System.Net.Security**. 24817 area-System.IO FileSystemWatcher misleading exception message "I encountered an exception being thrown in an ASP.NET Core 2.0 project which said ""The directory name {0} is invalid."" and it was misleading. [`FileSystemWatcher`](https://github.com/dotnet/corefx/blob/724ddb8fc95a5b1f639cfa508a32b9a8c50c1949/src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.cs#L108) throws an exception with this message, and in my case the path was valid but the directory did not exist. ""The directory name {0} does not exist."" would be a more helpful message for me." 24818 area-System.Net Socket.SendAsync not firing SocketAsyncEventArgs Completed event I noticed that with `netcoreapp2.0` the `SocketAsyncEventArgs.Completed` event is not fired when data is sent using the socket `SendAsync` method. This causes some issues when we implement a sending queue along with an `AutoResetEvent`. Since it's the first time I open an issue here, should I provide samples? Just let me know if you need more informations. I am finding this issue only with `netcoreapp2.0`. Doesn't have this issue with `netcoreapp1.0`. You can find here an implementation of my tcp socket client with `SocketAsyncEventArgs` : https://github.com/Eastrall/Ether.Network/blob/develop/src/Ether.Network/Client/NetClient.cs 24819 area-System.Net WinHttpHandler throws exception for redirect when there's no location header The .NET Framework does not. 24820 area-System.Net Fix a few ManagedHandler issues cc: @geoffkizer, @Tratcher 24821 area-System.Net ClientWebSocket produces malloc exception in multi-threaded environments. Running a .NET Core 2.0 CLI app on macOS 10.12.6. ClientWebSocket version is the latest I believe. When operating in a multi-threaded environment, I receive what looks like a C++ malloc exception. This appears to be happening when the remote host terminates the connection unexpectedly. I have locks on reads + writes so there is never more than one of each happening at once. When I make a call to either `SendAsync` or `ReceiveAsync` and the connection has been terminated unexpectedly, I receive the following error: ``` dotnet(75902,0x700010355000) malloc: *** error for object 0x7fe5669dbf20: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug ``` I can't say for certain whether or not the remote host has terminated the connection because I don't have a stack trace, but it is my suspicion as I know there is a rate limit on the web socket endpoint, and this issue only happens shortly after sustained requests exceed rate limit threshold. I can't think of any way of preventing this issue in user code (other than a rate limiter but that only stops a certain type of unexpected termination.) Adding a lock won't solve it because the the connection could be terminated between when I call ReceiveAsync and when ReceiveAsync reaches the point in native code where it breaks. 24822 area-System.IO Internal relative relationships for System.IO.Packaging.Package fail to load on Mono "Uri parsing on Mono has a quirk when parsing a Uri that if you pass `UriKind.RelativeOrAbsolute`, a forward slash `/` is treated as absolute while in .NET Framework this would be parsed as relative. This causes packaging to break when reading a package file (for a real example, see OfficeDev/Open-XML-SDK#249 where DocumentFormat.OpenXml fails to load documents on Xamarin) where internal relationships are managed by relative Uris. There are a few workarounds available (see www.mono-project.com/docs/faq/known-issues/urikind-relativeorabsolute/ for details): 1. Use a special `UriKind` defined by Mono when run on that runtime; ie `(UriKind)300` 2. Set an environment variable to force all Uri instances that start with a forward slash to be parsed as relative (`export MONO_URI_DOTNETRELATIVEORABSOLUTE=true`) ## Potential Fix There is a single instance of `UriKind.RelativeOrAbsolute` and it is while parsing internal relationships: https://source.dot.net/#System.IO.Packaging/System/IO/Packaging/InternalRelationshipCollection.cs,357. A potential fix to not require the environment variable would be to use `UriKind.Relative` when target mode is internal. ## Repro ```csharp using (var ms = new MemoryStream()) { using (var package = Package.Open(ms, FileMode.OpenOrCreate, FileAccess.ReadWrite)) { package.CreateRelationship(new Uri(""/target"", UriKind.Relative), TargetMode.Internal, ""type""); } ms.Position = 0; using (var package = Package.Open(ms, FileMode.OpenOrCreate, FileAccess.ReadWrite)) { var relationships = package.GetRelationships(); var relationship = Assert.Single(relationships); Assert.Equal(new Uri(""/"", UriKind.Relative), relationship.SourceUri); Assert.Equal(new Uri(""/target"", UriKind.Relative), relationship.TargetUri); Assert.Equal(TargetMode.Internal, relationship.TargetMode); } } ``` ## Expected Successfully retrieve relationships and have asserts pass ## Observed ``` Unhandled Exception when attempting to call `package.GetRelationships()`: System.ArgumentException: PackageRelationship target must be relative URI if TargetMode is Internal. Parameter name: targetUri ``` " 24823 area-System.Threading Tracking System.Threading.Channels Remaining Cleanup Tracking item for moving [System.Threading.Tasks.Channels](https://github.com/dotnet/corefxlab/commit/a7da3bc0a7eba50c345b21296f036989e92f949a) to corefx. Related #24174 24824 area-Meta System.IO.Pipelines Epic Tracking item for productizing [System.IO.Pipelines](https://github.com/dotnet/corefxlab/tree/master/src/System.IO.Pipelines) Related #24174 24825 area-System.Text System.Text.Encodings.Web.Utf8 Epic Tracking item for [System.Text.Encodings.Web.Utf8](https://github.com/dotnet/corefxlab/tree/master/src/System.Text.Encodings.Web.Utf8) Related #24174 24826 area-System.IO System.IO.Compression.Brotli Epic Tracking item for [System.IO.Compression.Brotli](https://github.com/dotnet/corefxlab/tree/master/src/System.IO.Compression.Brotli) Related #24174 24829 area-System.Diagnostics System.Diagnostics.TraceSource doesn't read configuration from App.config in .NET Core? "The following code outputs ""Hello, world!"" as a trace message to the console when in a .NET Framework console application. When the same code is used in a .NET Core console application, it outputs nothing. Program.cs ``` using System.Diagnostics; namespace ConsoleApp5 { class Program { private readonly static TraceSource traceSource = new TraceSource(""ConsoleApp5"", SourceLevels.All); static void Main(string[] args) { traceSource.TraceEvent(TraceEventType.Information, 0, ""Hello, world!""); } } } ``` App.config ``` <?xml version=""1.0"" encoding=""utf-8"" ?> <configuration> <system.diagnostics> <trace autoflush=""true""> <listeners> <add name=""consoleTraceListener"" /> <add name=""textWriterTraceListener"" /> </listeners> </trace> <sharedListeners> <add name=""consoleTraceListener"" type=""System.Diagnostics.ConsoleTraceListener"" traceOutputOptions=""DateTime,ThreadId"" /> <add name=""textWriterTraceListener"" type=""System.Diagnostics.TextWriterTraceListener"" traceOutputOptions=""DateTime,ThreadId"" initializeData=""Trace.log"" /> </sharedListeners> <sources> <source name=""ConsoleApp5"" switchValue=""Verbose""> <listeners> <add name=""consoleTraceListener"" /> <add name=""textWriterTraceListener"" /> </listeners> </source> </sources> </system.diagnostics> </configuration> ``` Also, I found that if I try to read a connection string using System.Configuration.ConfigurationManager and I have the system.diagnostics section in the App.config, I receive the following error. I'm assuming that .NET Core doesn't have a machine.config where the system.diagnostics section would normally be defined? ``` Unhandled Exception: System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> System.Configuration.ConfigurationErrorsException: Unrecognized configuration section system.diagnostics. (C:\Users\jemiller\Documents\Visual Studio 2017\Projects\Library2\LibraryConsoleApplication\bin\Debug\netcoreapp2.0\LibraryConsoleApplication.dll.config line 6) at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal) at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors) at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey) --- End of inner exception stack trace --- at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey) at System.Configuration.ClientConfigurationSystem.PrepareClientConfigSystem(String sectionName) at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String sectionName) at System.Configuration.ConfigurationManager.GetSection(String sectionName) at System.Configuration.ConfigurationManager.get_ConnectionStrings() at LibraryLibrary.LibraryContext..ctor(String name) in C:\Users\jemiller\Documents\Visual Studio 2017\Projects\Library2\LibraryLibrary\LibraryContext.cs:line 43 at LibraryLibrary.LibraryContext..ctor() in C:\Users\jemiller\Documents\Visual Studio 2017\Projects\Library2\LibraryLibrary\LibraryContext.cs:line 39 at LibraryConsoleApplication.Program.Main(String[] args) in C:\Users\jemiller\Documents\Visual Studio 2017\Projects\Library2\LibraryConsoleApplication\Program.cs:line 13 ``` Is there I way I could specify the section similar to the following to get it to work? That is how it is defined in machine.config for .NET Framework. ``` <configSections> <section name=""system.diagnostics"" type=""System.Diagnostics.SystemDiagnosticsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089""/> </configSections> ``` Is there some other way in .NET Core to specify that configuration settings for system.diagnostics? " 24833 area-System.Net Add locking to SecureTransport P/Invokes "Makes the macOS version of SslStream capable of doing one read and one write ""at the same time"" without taking down the process. Fixes #24821 (and perhaps others). Best tested by #24759 (TBD)" 24839 area-System.Memory Add SpanExtensions.LastIndexOf SpanExtensions have several IndexOf overloads. We should add similar LastIndexOf overloads: ```c# public static int LastIndexOf<T>(this Span<T> span, T value) where T: IEquatable<T> { throw null; } public static int LastIndexOf<T>(this Span<T> span, ReadOnlySpan<T> value) where T : IEquatable<T> { throw null; } public static int LastIndexOf<T>(this ReadOnlySpan<T> span, T value) where T : IEquatable<T> { throw null; } public static int LastIndexOf<T>(this ReadOnlySpan<T> span, ReadOnlySpan<T> value) where T : IEquatable<T> { throw null; } public static int LastIndexOfAny<T>(this Span<T> span, T value0, T value1) where T : IEquatable<T> { throw null; } public static int LastIndexOfAny<T>(this Span<T> span, T value0, T value1, T value2) where T : IEquatable<T> { throw null; } public static int LastIndexOfAny<T>(this Span<T> span, ReadOnlySpan<T> values) where T : IEquatable<T> { throw null; } public static int LastIndexOfAny<T>(this ReadOnlySpan<T> span, T value0, T value1) where T : IEquatable<T> { throw null; } public static int LastIndexOfAny<T>(this ReadOnlySpan<T> span, T value0, T value1, T value2) where T : IEquatable<T> { throw null; } public static int LastIndexOfAny<T>(this ReadOnlySpan<T> span, ReadOnlySpan<T> values) where T : IEquatable<T> { throw null; } ``` 24840 area-System.Memory Add SpanExtensions.EndsWith SpanExtensions have StartsWith overloads. We should add EndsWith counterparts: ```c# public static bool EndsWith<T>(this Span<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>; public static bool EndsWith<T>(this ReadOnlySpan<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>; ``` 24842 area-System.Net ManagedHandler: Must clear auth header on redirect "This overlaps with https://github.com/dotnet/corefx/issues/24387. RE: https://github.com/dotnet/corefx/blob/6d3804c5d9edec46c85797701834bbb135c8500f/src/System.Net.Http/src/System/Net/Http/Managed/AuthenticationHandler.cs#L48-L54 This code checks for redirects and clears the credentials field. However, it does not clear the Authorization header so the redirected request will contain the original credentials. The original credentials may have been scoped to a specific host/url, but there’s no check on where the redirect will send those credentials to. The Authorization header needs to be cleared. Considering this request flow: 1. Initial request Get http://example.com/ -> 401, www-Authenticate: Basic 2. Resubmitted for auth Get http://example.com/ Authorization: Basic foo <-- Added by AuthenticationHandler -> 301, Location: http://microsoft.com/ 3. Resubmitted for redirect Get http://microsoft.com/ Authorization: Basic foo <-- Left over from the prior request The Authorization header needs to be cleared after step 2 so that it doesn’t get forwarded to the redirect destination. This code block could be used to clear the header, but it would need to be moved to the bottom of the method to run after the auth resubmits. https://github.com/dotnet/corefx/blob/6d3804c5d9edec46c85797701834bbb135c8500f/src/System.Net.Http/src/System/Net/Http/Managed/AuthenticationHandler.cs#L48-L54 Compare to the desktop stack: https://github.com/Microsoft/referencesource/blob/7de0d30c7c5ef56ab60fee41fcdb50005d24979a/System/net/System/Net/HttpWebRequest.cs#L5840 https://github.com/Microsoft/referencesource/blob/7de0d30c7c5ef56ab60fee41fcdb50005d24979a/System/net/System/Net/_AuthenticationState.cs#L318 Repro: Dotnet –version: 2.1.0-preview1-007228 Output for Non-ManagedHandler: “Auth header after redirect: “ Output for ManagedHandler: “Auth header after redirect: Basic Zm9vOmJhcg==” ``` using System; using System.Net; using System.Net.Http; using System.Text; using System.Threading.Tasks; namespace ConsoleApp16 { class Program { static void Main(string[] args) { var listener = new HttpListener(); listener.Prefixes.Add(""http://localhost:5001/""); listener.Start(); RunServer(listener); RunClient().Wait(); } private static async Task RunClient() { var handler = new HttpClientHandler(); handler.Credentials = new NetworkCredential(""foo"", ""bar""); var client = new HttpClient(handler); var response = await client.GetStringAsync(""http://localhost:5001/basic""); Console.WriteLine(response); } private static async void RunServer(HttpListener listener) { while (true) { var context = await listener.GetContextAsync(); if (context.Request.Url.AbsolutePath.Equals(""/basic"")) { var authHeader = context.Request.Headers[""Authorization""]; if (!string.IsNullOrEmpty(authHeader) && authHeader.StartsWith(""Basic "")) { // Authenticated, redirect. context.Response.Redirect(""/other""); } else { // Not authenticated context.Response.StatusCode = 401; context.Response.Headers[HttpResponseHeader.WwwAuthenticate] = ""Basic""; } } else if (context.Request.Url.AbsolutePath.Equals(""/other"")) { var authHeader = context.Request.Headers[""Authorization""]; var bytes = Encoding.UTF8.GetBytes($""Auth header after redirect: {authHeader}""); await context.Response.OutputStream.WriteAsync(bytes, 0, bytes.Length); } else { context.Response.StatusCode = 404; } context.Response.Close(); } } } } ``` Note this repro will break differently on .NET Framework where HttpListener is more restrictive about what headers you can set." 24844 area-System.Net Increase tolerance on SendTimesOut_Throws Fixes https://github.com/dotnet/corefx/issues/24804 (assuming it's just because the machine is slow) 24846 area-System.Net Add `Memory<byte>` support to WebSockets This is split into several commits as there are multiple related but distinct changes: 1. First, I moved ManagedWebSocket from being based on `ArraySegment<byte>` internally to being based on `Memory<byte>` internally. That then allows it to be used with either `ArraySegment<byte>` or `Memory<Byte>`, as the former is convertible to the latter. 2. Then I added the new `CreateFromStream` method to WebSocket; this requires the `Memory<byte>` support in ManagedWebSocket because `CreateFromStream`'s scratch buffer is a `Memory<byte>`. 3. Then I used that new `CreateFromStream` method in both System.Net.WebSockets.Client and System.Net.HttpListener; ManagedWebSocket.cs now is only built into System.Net.WebSockets rather than into all three assemblies. 4. Then I added the new `Memory<byte>`-based Send/ReceiveAsync virtuals to WebSocket. 5. Then I overrode these on ManagedWebSocket, providing decent implementations for them. 6. And finally I overrode the `Memory<byte>`-based `ReceiveAsync` on WinHttpWebSocket. I didn't bother with `SendAsync` for now as the base implementation should be reasonable for common cases, and if we want to optimize this implementation, there are other things that can and should be done, too. cc: @geoffkizer, @davidsh, @anurse, @benaadams, @Priya91 Fixes https://github.com/dotnet/corefx/issues/22610 Contributes to https://github.com/dotnet/corefx/issues/21537 (we still need to expose it through an OOB) 24847 area-Infrastructure .NET Framework 4.7.1 compatibility issue with reflection-only loading "Now that netstandard.dll is in the GAC, this can cause failures when attempting to use reflection-only loading. For example, given the following: ```c# class Program { static void Main(string[] args) { var path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); Console.WriteLine(""Scanning assemblies""); foreach (var file in Directory.EnumerateFiles(path, ""*.dll"")) { Console.WriteLine($""Found {file}""); var assembly = Assembly.ReflectionOnlyLoadFrom(file); foreach (var referencedAssembly in assembly.GetReferencedAssemblies()) { Console.WriteLine($"" Reference: {referencedAssembly}""); try { var reference = Assembly.ReflectionOnlyLoad(referencedAssembly.FullName); } catch { } } } } } ``` If that project targets net461 and includes a reference to a project that targets netstandard2.0, then the behavior of this program will vary based on whether 4.7.1 is installed or not. If run on a machine that does not have 4.7.1 installed, then it will complete successfully. If run on a machine that does have 4.7.1 installed, then it it will fail with the following exception: ``` System.IO.FileLoadException: API restriction: The assembly 'file:///C:\LoadingRepro\LoadingRepro\bin\Debug\net461\netstandard.dll' has already loaded from a different location. It cannot be loaded from a new location within the same appdomain. ``` I've included a full repro solution: [LoadingRepro.zip](https://github.com/dotnet/corefx/files/1412644/LoadingRepro.zip) ATTN: @karelz @AlexGhiondea [EDIT] Added C# syntax by @karelz" 24848 area-System.IO Change IO to use CreateFileFromApp2 etc when in UWP Related to [this issue](https://github.com/dotnet/corefx/issues/18405). Pretty much all the System.IO.File functions won't work when used from UWP due to permission issues. I guess I shouldn't have been surprised, but it would be nice if somehow we could make those 2 APIs work together. 24849 area-System.Net Implement cancellation policy on sslstream. cc @stephentoub @Tratcher @geoffkizer @wfurt @karelz 24850 area-System.Net [ManagedHandler] Investigate other options for concurrent connection limits and allocations "The connection limit and connection allocation strategy are some of the most frequently hit problems for the prior .NET managed stack. This is one aspect of the new stack that warrants quite a bit of up-front scrutiny. There have already been design improvements here with the central queue vs the old queue-per-connection strategy, but the limits also need to be redesigned. I’m not aware of any consistent connection management behavior across stacks or good publicized algorithms. Interviewing the WinHttp team would be one starting point. The RFC has removed the old limit of two connections per host, it now says: https://tools.ietf.org/html/rfc7230#section-6.4 ""...this specification does not mandate a particular maximum number of connections but, instead, encourages clients to be conservative when opening multiple connections. ... Note that a server might reject traffic that it deems abusive or characteristic of a denial-of-service attack, such as an excessive number of open connections from a single client."" There is nothing conservative about the current allocation algorithm. MaxConnectionsPerServer defaults to int.MaxValue and there is no throttling on the rate at which new connections will be established. The old ServicePointManager.DefaultConnectionLimit started at 2 but also had no allocation throttle. A burst of requests will cause new connections to be established for every request up to the limit. This is likely more expensive and slower than queueing some of those requests to reuse existing connections as they become available. Customers regularly run into the DefaultConnectionLimit bottleneck and ask what the correct value should be. There is no good answer to this question, nor even an easy way for the user to work it out for a specific application. This implies that the limit concept and allocation strategy themselves are flawed. The new stack isn't much different in this respect except that the default is MaxValue. This will manifest as a series of less obvious problems like added latency per request when they create extra new connections, added memory and CPU usage creating and maintaining idle connections, more sporadic failures when a request gets assigned to an idle connection that has been dropped, etc.. So what would a new design look like? It would need avoid being an app bottleneck like DefaultConnectionLimit, and also throttle bursts to avoid wasting resources like MaxConnectionsPerServer. The .NET thread pool has these mechanics and would be an interesting design to test. Threads are analogous to connections except that connections are even more expensive to create and maintain. Work items are analogous to requests though requests can be assigned to connections a lot longer. The thread pool injects new threads at a throttled rate and only slowly approaches its configurable limit. Similarly the connection pool should explore only injecting new connections at a throttled rate to prevent bursts from wasting resources. The thread pool also has a configurable min thread limit to avoid bottlenecks at startup." 24852 area-System.Diagnostics Support System.Diagnostics.Eventing on Linux/Mac Port `System.Diagnostics.Eventing` to Linux & Mac -- for Windows Event Log parsing purposes. I created a [SO post here](https://stackoverflow.com/questions/46915998/eventing-namespace-does-not-exist-in-system-diagnostics-in-net-core-and-mon) documenting the issue I currently have with `dotnet` and `mono`. 24853 area-System.Net ALPN No matching protocol tests fail On Windows they seem to hang and timeout On Linux they don't throw an exception but return an empty protocol 24854 area-System.Memory Provide IEnumerable<T> support for Memory<T> ## Rationale Users should be able to pass `Memory<T>` to methods that take in `IEnumerable<T>` similar to array. Currently, this requires calling ToArray() to copy the contents of the `Memory<T>` into an array for it to work, and is unnecessary. For example (from @eerhardt): https://github.com/dotnet/corefxlab/blob/master/src/System.Numerics.Tensors/System/Numerics/DenseTensor.cs#L10 ```C# public void SomeMethod(DenseTensor<float> tensor) { Memory<float> memory = tensor.Buffer; var value = CreateBatch<T>(..., memory.ToArray(), ...); } ``` https://github.com/Microsoft/CNTK/blob/master/bindings/csharp/CNTKLibraryManagedDll/ShimApiClasses/ValueShim.cs#L104 ```C# public static Value CreateBatch<T>(NDShape sampleShape, IEnumerable<T> batch, DeviceDescriptor device, bool readOnly = false) { T[] batchAsArray = batch.ToArray(); return CreateBatch<T>(sampleShape, batchAsArray, 0, batchAsArray.Count(), device, readOnly); } ``` If `Memory<T>` implemented `IEnumerable<T>`, then the ToArray() call would not be required. However, this would cause applications that reference System.Memory and `Memory<T>` for any scenario to be larger (when compiled AOT). Furthermore, if `Memory<T>` was an `IEnumerable<T>`, it might result in a pit of failure as it could lead to users unintentionally using the enumerator to iterate over the data rather than the more performant indexer on Memory.Span (especially for primitive types like `Memory<byte>`). To discourage unnecessary use of the enumerator but still provide support for the scenarios where you need an IEnumerable, the proposed solution is to add an adapter class and a ToEnumerable extension method on `Memory<T>`. As an FYI, `Span<T>` cannot implement `IEnumerable<T>` since it is a stack-only, byref type, and casting it to an interface would cause boxing. The compiler will throw and error: `'Span<T>': ref structs cannot implement interfaces` ## Proposed API ```C# namespace System { public static class MemoryExtensions { public static IEnumerable<T> ToEnumerable(this Memory<T> memory); } } ``` ## Usage Taking the above example, it would look as follows: ```C# public void SomeMethod(DenseTensor<float> tensor) { Memory<float> memory = tensor.Buffer; var value = CreateBatch<T>(..., memory.ToEnumerable(), ...); } ``` ## Partial Implementation ```C# public static IEnumerable<T> ToEnumerable(this Memory<T> memory) => new MemoryEnumerable<T>(memory); internal class MemoryEnumerable<T> : IEnumerable<T> { ReadOnlyMemory<T> _memory; public MemoryEnumerable(ReadOnlyMemory<T> memory) => _memory = memory; public IEnumerator<T> GetEnumerator() => new MemoryEnumerator<T>(_memory); IEnumerator IEnumerable.GetEnumerator() => new MemoryEnumerator<T>(_memory); } internal class MemoryEnumerator<T> : IEnumerator<T> { ReadOnlyMemory<T> _memory; int _index; public MemoryEnumerator(ReadOnlyMemory<T> memory) => _memory = memory; public T Current => _memory.Span[_index]; object IEnumerator.Current => _memory.Span[_index]; public void Dispose() { throw new NotImplementedException(); } public bool MoveNext() { _index++; return _index <_memory.Length; } public void Reset() { _index = 0; } } ``` cc @eerhardt, @KrzysztofCwalina, @stephentoub, @jkotas, @terrajobst, @karelz, @ericstj 24855 area-System.ComponentModel CultureInfoConverter added CultureInfoConverter is added to list of IntrinsicTypeConvertersList to make deserialization of newtonsoft possible in .net core Fixes #24755 24856 area-Infrastructure Need to add Ubuntu 17.10 to the RID graph 24857 area-System.Net Implement cancellation token for SslStream new AuthenticateAs*Async methods also fixes #24853 cc @stephentoub @Tratcher @Drawaes 24861 area-System.Net Registered i/o We need interop delarations for RIO in the corefx repo 24862 area-System.Net WinHttpHandler is not using Host header in SSL handshake The .NET Framework does. 24863 area-System.Memory DO NOT MERGE, DO NOT REVIEW I only care what CI has to say at this time. 24865 area-Meta Memory problem My procedure is very simple, through the socket to accept the connection and then through the sslstream forward data to the back-end server, a simple socket proxy, but soon after the start of the system memory is exhausted, I guess there may be a memory leak, how should I find the problem The 24866 area-System.Net ALPN Failing Success on Debian All three tests SslStream_StreamToStream_Alpn_Success fail on Debian 90 24868 area-System.Net [release/2.0.0] Add locking to SecureTransport P/Invokes "Makes the macOS version of SslStream capable of doing one read and one write ""at the same time"" without taking down the process. release/2.0.0 port of #24833 Fixes #24821 Fixes #24142" 24869 area-System.Net IndexOutOfRangeException from Socket.MultipleAddressConnectAsyncResult.get_RemoteEndPoint https://mc.dot.net/#/user/Drawaes/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/3cac46b196961558ff0ddf1858e8a3429a7d643e/workItem/System.Net.Sockets.Tests/analysis/xunit/System.Net.Sockets.Tests.DnsEndPointTest~2FSocket_BeginConnectDnsEndPoint_Failure ``` Unhandled Exception of Type Xunit.Sdk.ThrowsException Message : Assert.Throws() Failure Expected: typeof(System.Net.Sockets.SocketException) Actual: typeof(System.IndexOutOfRangeException): Index was outside the bounds of the array. Stack Trace : at System.Net.Sockets.Socket.MultipleAddressConnectAsyncResult.get_RemoteEndPoint() in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_true_prtest/src/System.Net.Sockets/src/System/Net/Sockets/Socket.cs:line 5127 at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult) in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_true_prtest/src/System.Net.Sockets/src/System/Net/Sockets/Socket.cs:line 2458 at System.Net.Sockets.Tests.DnsEndPointTest.<>c__DisplayClass8_0.<Socket_BeginConnectDnsEndPoint_Failure>b__1() in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_true_prtest/src/System.Net.Sockets/tests/FunctionalTests/DnsEndPointTest.cs:line 164 ``` 24871 area-System.Data SqlBulkCopy can fail with a null ref exception for some IDataReader implementations SqlBulkCopy.WriteToServer accepts an IDataReader parameter. If the following two condition are met, the call will fail with a NullReferenceException: 1. The passed implementation of IDataReader does not inherit from DbDataReader 2. A column mapping is specified In the implementation of SqlBulkCopy.WriteToServer, the code attempts to cast the passed parameter to an DbDataReader, which is result in _DbDataReaderRowSource always being null. Attached is a zipped up .cs file with a repro: [Program.zip](https://github.com/dotnet/corefx/files/1415532/Program.zip) 24873 area-System.Net Add ManagedHandler support for canceling connect operations Logically two parts: - Passes the cancellation token down into the connect helper and uses it to cancel the connect. The connect is changed from using the instance Socket.ConnectAsync to using the static Socket.ConnectAsync with SocketAsyncEventArgs as it supports Socket.CancelConnectAsync. - Passes the cancellation token down into the pool and uses it to remove waiters from the queue. Fixes https://github.com/dotnet/corefx/issues/23151 cc: @geoffkizer, @Priya91, @koenigst 24874 area-System.Diagnostics EventLogEntryCollectionTests.CheckingEntryEqualityAndIndex failed with ArgumentException https://mc.dot.net/#/user/stephentoub/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/94474b7e9325802a019eace4ffce5cb6add96b0b/workItem/System.Diagnostics.EventLog.Tests/analysis/xunit/System.Diagnostics.Tests.EventLogEntryCollectionTests~2FCheckingEntryEqualityAndIndex ``` Unhandled Exception of Type System.ArgumentException Message : System.ArgumentException : Index -1 is out of bounds. Stack Trace : at System.Diagnostics.EventLogInternal.GetEntryAt(Int32 index) at System.Diagnostics.EventLogEntryCollection.get_Item(Int32 index) at System.Diagnostics.Tests.EventLogEntryCollectionTests.CheckingEntryEqualityAndIndex() ``` 24875 area-System.Net ServicePointManager_SecurityProtocolDefault_Ok failed Assert.Equal https://mc.dot.net/#/user/stephentoub/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/98d53f272c58b4df9ce997d816d853ddff43e7d8/workItem/System.Net.ServicePoint.Tests/analysis/xunit/System.Net.Tests.TlsSystemDefault~2FServicePointManager_SecurityProtocolDefault_Ok ``` Unhandled Exception of Type Xunit.Sdk.EqualException Message : Assert.Equal() Failure Expected: SystemDefault Actual: Tls11 Stack Trace : at System.Net.Tests.TlsSystemDefault.ServicePointManager_SecurityProtocolDefault_Ok() in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_true_prtest/src/System.Net.ServicePoint/tests/TlsSystemDefault.cs:line 14 ``` The test is reading a static property. Most likely there's another test in the project that's modifying that property and either it's not resetting it or they happened to run concurrently. 24876 area-Infrastructure Enable official builds for Alpine Linux This change enables official builds for Alpine 3.6. It doesn't enable tests since we don't have a way to create Alpine queue. 24877 area-Infrastructure [Question] Has anybody run xunit tests on linux-arm? I am trying to build a test project on windows and run the tests on linux-arm. I have a shared framework installed on the linux-arm hardware, but I do not have a full SDK installed on linux-arm because there is not one available. Because there is no cli, I cannot simply run 'dotnet test' on the project. I had hoped that I would be able to create a [Self Contained Deployment](https://docs.microsoft.com/en-us/dotnet/core/deploying/) from the test project and it would include the test runner in the published output, but this is not the case. I hacked together a deployment of vstest.console.dll and it's dependencies that runs on the shared framework on my linux-arm hardware. When I invoked 'dotnet vstest.console.dll mytest.dll' however, no tests are run. Example output: ``` pi@chuckr-pi:~/vstest $ dotnet --fx-version 2.0.4-servicing-25824-03 vstest.console.dll ../test/scratch.dll Microsoft (R) Test Execution Command Line Tool Version 15.6.0-dev Copyright (c) Microsoft Corporation. All rights reserved. Starting test execution, please wait... pi@chuckr-pi:~/vstest $ ``` In this example ../test/scratch.dll contains one xunit test that should fail. This is the contents of the test dir: ``` pi@chuckr-pi:~/test $ ls scratch.deps.json scratch.pdb scratch.runtimeconfig.json xunit.runner.utility.netstandard15.dll scratch.dll scratch.runtimeconfig.dev.json xunit.runner.reporters.netstandard15.dll xunit.runner.visualstudio.dotnetcore.testadapter.dll ``` Has anybody on the corefx team tried to do something similar? 24880 area-System.Memory Complete MemoryExtensions Feature - [x] Parity with Array APIs #25850 - [x] Move MemoryExtensions down to CoreLib #25182 - [x] MemoryExtensions.SequenceCompare #16878 - [x] ReadOnlySpan<char> string-like extension methods #21395 P2 - [x] String slice operations #24072 cc: @ahsonkhan, @joshfree 24883 area-System.Net Fix matching algo This removes the need for a pinned buffer, or a buffer at all on linux. It should give a consistent match across distros. This needs to be attached to the SslHandle because the SslCtxHandle is freed early (I am not sure that is correct openssl use but it's how it's been for a while so we will ignore that for now). 24884 area-Infrastructure Fix offical Alpine build - sync arguments It turns out that the sync.sh command needs to be passed the -BuildTests=false option too so that it doesn't try to sync core-setup packages that are used only for running tests. Since there are no core-setup packages for Alpine yet, the sync was failing. I have also noticed that there was a recent change in the sync arguments that I have not discovered after rebase of my changes to master. So I have added the new option there. 24885 area-System.Drawing Add XunitShowProgress as a temp workaround to find crashing tests in S.Drawing cc: @stephentoub @danmosemsft 24886 area-System.Net "WinHttp exception ""The handle is in the wrong state for the requested operation"" in GetAsync_AllowedSSLVersion_Succeeds test on Win7" https://mc.dot.net/#/user/stephentoub/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/5ecea8ff47c03a073a77916a9c7d1d806f8c7ce3/workItem/System.Net.Http.Functional.Tests/wilogs ``` 2017-10-26 00:34:29,598: INFO: proc(54): run_and_log_output: Output: System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test.GetAsync_AllowedSSLVersion_Succeeds(acceptedProtocol: Tls, requestOnlyThisProtocol: True) [FAIL] 2017-10-26 00:34:29,598: INFO: proc(54): run_and_log_output: Output: System.Net.Http.HttpRequestException : An error occurred while sending the request. 2017-10-26 00:34:29,614: INFO: proc(54): run_and_log_output: Output: ---- System.Net.Http.WinHttpException : The handle is in the wrong state for the requested operation 2017-10-26 00:34:29,614: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2017-10-26 00:34:29,677: INFO: proc(54): run_and_log_output: Output: at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() 2017-10-26 00:34:29,677: INFO: proc(54): run_and_log_output: Output: --- End of stack trace from previous location where exception was thrown --- 2017-10-26 00:34:29,677: INFO: proc(54): run_and_log_output: Output: at System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test.<>c__DisplayClass4_1.<<GetAsync_AllowedSSLVersion_Succeeds>b__0>d.MoveNext() 2017-10-26 00:34:29,677: INFO: proc(54): run_and_log_output: Output: --- End of stack trace from previous location where exception was thrown --- 2017-10-26 00:34:29,677: INFO: proc(54): run_and_log_output: Output: at System.Net.Test.Common.LoopbackServer.<>c__DisplayClass3_0.<CreateServerAsync>b__0(Task t) 2017-10-26 00:34:29,677: INFO: proc(54): run_and_log_output: Output: at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 2017-10-26 00:34:29,677: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) 2017-10-26 00:34:29,677: INFO: proc(54): run_and_log_output: Output: --- End of stack trace from previous location where exception was thrown --- 2017-10-26 00:34:29,677: INFO: proc(54): run_and_log_output: Output: at System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test.<GetAsync_AllowedSSLVersion_Succeeds>d__4.MoveNext() 2017-10-26 00:34:29,677: INFO: proc(54): run_and_log_output: Output: --- End of stack trace from previous location where exception was thrown --- 2017-10-26 00:34:29,677: INFO: proc(54): run_and_log_output: Output: --- End of stack trace from previous location where exception was thrown --- 2017-10-26 00:34:29,677: INFO: proc(54): run_and_log_output: Output: --- End of stack trace from previous location where exception was thrown --- 2017-10-26 00:34:29,677: INFO: proc(54): run_and_log_output: Output: ----- Inner Stack Trace ----- 2017-10-26 00:34:29,677: INFO: proc(54): run_and_log_output: Output: at System.Environment.get_StackTrace() 2017-10-26 00:34:29,677: INFO: proc(54): run_and_log_output: Output: at System.Runtime.ExceptionServices.ExceptionStackTrace.AddCurrentStack(Exception exception) 2017-10-26 00:34:29,677: INFO: proc(54): run_and_log_output: Output: at System.Net.Http.WinHttpException.CreateExceptionUsingError(Int32 error) 2017-10-26 00:34:29,677: INFO: proc(54): run_and_log_output: Output: at System.Net.Http.WinHttpRequestCallback.OnRequestError(WinHttpRequestState state, WINHTTP_ASYNC_RESULT asyncResult) 2017-10-26 00:34:29,677: INFO: proc(54): run_and_log_output: Output: at System.Net.Http.WinHttpRequestCallback.RequestCallback(IntPtr handle, WinHttpRequestState state, UInt32 internetStatus, IntPtr statusInformation, UInt32 statusInformationLength) 2017-10-26 00:34:29,677: INFO: proc(54): run_and_log_output: Output: at System.Net.Http.WinHttpRequestCallback.WinHttpCallback(IntPtr handle, IntPtr context, UInt32 internetStatus, IntPtr statusInformation, UInt32 statusInformationLength) 2017-10-26 00:34:29,677: INFO: proc(54): run_and_log_output: Output: at Interop.WinHttp.WinHttpReceiveResponse(SafeWinHttpHandle requestHandle, IntPtr reserved) 2017-10-26 00:34:29,677: INFO: proc(54): run_and_log_output: Output: at Interop.WinHttp.WinHttpReceiveResponse(SafeWinHttpHandle requestHandle, IntPtr reserved) 2017-10-26 00:34:29,677: INFO: proc(54): run_and_log_output: Output: at System.Net.Http.WinHttpHandler.InternalReceiveResponseHeadersAsync(WinHttpRequestState state) 2017-10-26 00:34:29,677: INFO: proc(54): run_and_log_output: Output: at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext() 2017-10-26 00:34:29,677: INFO: proc(54): run_and_log_output: Output: at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 2017-10-26 00:34:29,677: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext() 2017-10-26 00:34:29,677: INFO: proc(54): run_and_log_output: Output: at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 2017-10-26 00:34:29,677: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) 2017-10-26 00:34:29,677: INFO: proc(54): run_and_log_output: Output: at System.Threading.ThreadPoolWorkQueue.Dispatch() 2017-10-26 00:34:29,677: INFO: proc(54): run_and_log_output: Output: --- End of stack trace from AddCurrentStack --- 2017-10-26 00:34:29,677: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.RendezvousAwaitable`1.GetResult() 2017-10-26 00:34:29,677: INFO: proc(54): run_and_log_output: Output: at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext() ``` 24890 area-System.Net Make ServicePointManager tests run out of proc Fixes https://github.com/dotnet/corefx/issues/24875 Also allows RemoteExec() to accept delegates that do not return a value. If an exception (such as an assert failure) occurs within the delegate, the RemoteExec() infrastructure will cause the test to fail. There is no need to return an error code if it would be redundant. Depends on https://github.com/dotnet/buildtools/pull/1759 24891 area-System.Security Segfault in libcrypto.so.1.0.0 I'm getting this somewhere in my app (I suspect it's from a `HttpClient` call to a site that uses HTTPS): ``` #0 0x00007fc4a0e32d5d in ?? () from /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 #1 0x00007fc4a0e2dc7b in X509_verify_cert () from /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 #2 0x00007fc4a45770d6 in ?? () #3 0x00007fc3792d0d90 in ?? () #4 0x00007fc50c10a4b0 in ?? () #5 0x0000000021dfe8a3 in ?? () #6 0x00007fc51b3a7488 in vtable for InlinedCallFrame () from /var/www/dan.cx/staging/site/libcoreclr.so #7 0x00007fc3792d1688 in ?? () #8 0x00007fc4a495c918 in ?? () #9 0x00007fc4a495c918 in ?? () #10 0x00007fc3792d0d90 in ?? () #11 0x00007fc4a45770d6 in ?? () #12 0x00007fc3792d0e20 in ?? () #13 0x00007fc4a495c918 in ?? () #14 0x00007fc38474f960 in ?? () #15 0x0000000000000001 in ?? () #16 0x00007fc384741da8 in ?? () #17 0x00007fc38474f9d0 in ?? () #18 0x00007fc38474f960 in ?? () #19 0x00007fc38474f960 in ?? () #20 0x00007fc50c100ff0 in ?? () #21 0x00007fc3792d0e90 in ?? () #22 0x00007fc4a2d6ce57 in ?? () #23 0x00007fc3792d0e30 in ?? () #24 0x00007fc38474f960 in ?? () #25 0x00007fc384741da8 in ?? () #26 0x0000000000000000 in ?? () ``` ASP.NET Core 2.0 on .NET Core 2.0, running on Debian Linux ``` $ dotnet --info .NET Command Line Tools (2.0.0) Product Information: Version: 2.0.0 Commit SHA-1 hash: cdcd1928c9 Runtime Environment: OS Name: debian OS Version: OS Platform: Linux RID: debian-x64 Base Path: /usr/share/dotnet/sdk/2.0.0/ Microsoft .NET Core Shared Framework Host Version : 2.0.0 Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d $ dpkg -S /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 libssl1.0.0:amd64: /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 $ dpkg -s libssl1.0.0 | grep Version Version: 1.0.1t-1+deb8u5 $ ls /usr/lib/x86_64-linux-gnu/libssl* -lah -rw-r--r-- 1 root root 305K Sep 28 14:49 libssl3.so -rw-r--r-- 1 root root 721K Aug 8 07:13 libssl.a lrwxrwxrwx 1 root root 13 Aug 8 07:13 libssl.so -> libssl.so.1.1 -rw-r--r-- 1 root root 386K Sep 23 2016 libssl.so.1.0.0 -rw-r--r-- 1 root root 422K Jun 4 10:15 libssl.so.1.0.2 -rw-r--r-- 1 root root 429K Aug 8 07:13 libssl.so.1.1 ``` 24892 area-System.ComponentModel Result string of Win32Exception.ToString() method missing Win32Exception.NativeErrorCode "When we working with Win API via P/Invoke, it is common practice to check the result of called function and throw new [Win32Exception()](https://github.com/dotnet/corefx/blob/9eafffc6054c8f039d788465621bcfd49a379ca1/src/Microsoft.Win32.Primitives/src/System/ComponentModel/Win32Exception.cs#L21). We can pass error code explicitly, or the default constructor will catch the last one using [Marshal.GetLastWin32Error()](https://github.com/dotnet/coreclr/blob/da8b7181dbe362fbfe64c7ef72ff3a4a7db68f24/src/mscorlib/src/System/Runtime/InteropServices/Marshal.cs#L839). When we log the exception, the result string does not contain root *Win32Exception.NativeErrorCode*: ```csharp var winError = new System.ComponentModel.Win32Exception(0x35); /* winError.ToString() provides: ""System.ComponentModel.Win32Exception (0x80004005): The network path was not found"" */ ``` The *0x80004005* referes to the common HResult.E_FAIL, which is _Unspecified error_ in winerror.h; That's wrong (IMHO)! We have provided exact error code, it is well specified. Expected result: ```csharp /* winError.ToString() provides: ""System.ComponentModel.Win32Exception (0x80070035): The network path was not found"" OR ""System.ComponentModel.Win32Exception (0x00000035): The network path was not found"" */ ``` The last one logs the number we passed, the first one is the result of [Marshal.GetHRForLastWin32Error()](https://github.com/dotnet/coreclr/blob/da8b7181dbe362fbfe64c7ef72ff3a4a7db68f24/src/mscorlib/src/System/Runtime/InteropServices/Marshal.cs#L852)" 24895 area-System.Net System.Net.Mime.MediaTypeNames missing types "https://github.com/dotnet/corefx/blob/3f0bd5d8c3d019ad8b1561395030a58bc38ddfe9/src/System.Net.Mail/ref/System.Net.Mime.cs#L44 I tried using `System.Net.Mime.MediaTypeNames` in my asp net core api to remove ""magic strings"" ```c# [Consumes(System.Net.Mime.MediaTypeNames.Application...)] public IActionResult Post(...) { ... } ``` But it's missing quite a few MIME types. These come to mind: > text/css > text/javascript > > application/json > application/json-patch+json > application/xml > application/javascript > application/x-www-form-urlencoded > > multipart/form-data > multipart/byteranges > > image/png > image/bmp > image/webp > image/svg+xml > > audio/midi > audio/mpeg > audio/webm > audio/ogg > audio/wav > > video/webm > video/ogg" 24896 area-Infrastructure Add retry logic for setup of dotnet cli Fixes intermittent build issues where curl returns: curl: (56) GnuTLS recv error (-54): Error in the pull function. Retry added to re-download if the tar command fails to extract. 24897 area-System.Runtime Port System.Memory performance improvements to Convert.TryFromBase64Chars From https://github.com/dotnet/corefx/pull/24888#issuecomment-339646430 cc @jkotas, @stephentoub, @KrzysztofCwalina 24898 area-Infrastructure Disable alpine official tests build 24900 area-System.Runtime Nullable<T> must be a readonly struct `Nullable<T>` is known to be an immutable struct with sideeffect-free methods. C# compiler certainly relies on the implied purity for the soundness of null-propagating math as well as in various optimizations. Basically - while for other structs `readonly` is a good thing to have, if possible. I think the spec for `Nullable<T>` should _demand_ that `Nullable<T>` is formally `readonly`. In particular we consider methods like `HasValue` not mutating and therefore callable directly on references to readonly fields (which is currently unverifiable). When verification rules are updated to understand readonly references, we would need to special case `Nullable<T>` methods. - Unless the type is `readonly` by the spec, then the behavior would be subsumed by the general treatment or `readonly` structs. 24901 area-System.IO Check that long relative paths work on Windows We should check that long relative paths work on Windows. It appears (from looking at the source) that they do not. Problem is in [PathInternal.Windows.cs][1]: `EnsureExtendedPrefixOverMaxPath` simply returns if the path is relative, rather than calling `GetFullPathNameW` and then adding the extended prefix. As a result, the underlying Windows API function will fail. This is a rather simple fix, though I don’t have a Windows machine to test it with. [1]: https://github.com/dotnet/corefx/blob/f2e440450e8b52317f08c21fe66f70141c9e933c/src/Common/src/System/IO/PathInternal.Windows.cs#L117 24902 area-System.Runtime Remove Artificial Object Graph Limit in BinaryFormatter Since issue #16991 is solved we now can deserialize bigger object graphs with up to 12 million objects. As I have found since a long time ago: https://aloiskraus.wordpress.com/2017/04/23/the-definitive-serialization-performance-guide/ there are issues with the max object count BinaryFormatter can cope with because it contains a hard coded prime number table which ends at 6584983 objects. Please remove this artifical limit and do the same thing like e.g. in Dictionary which also needs prime numbers. 24903 area-Infrastructure Need a way to ignore build configurations when library is inbox For libraries like DirectoryServices which are inbox on a framework (https://github.com/dotnet/corefx/blob/master/src/System.DirectoryServices/pkg/System.DirectoryServices.pkgproj#L10) and only have a netstandard configuration without a netfx configuration because it shares the same identity as desktop, we need a way to tell our build system to ignore the netstandard configuration when building the netfx vertical. Without that we will end up selecting the netstandard asset and building and testing that when doing our netfx vertical testing. We can probably add a new property called something like IgnoreBuildConfigurations or InboxOnFramework and teach our configuration system (likely somewhere in https://github.com/dotnet/corefx/blob/master/buildvertical.targets#L70) to filter out and skip such configurations. 24904 area-System.Net Remove dead code from System.Net.Sockets PR addresses issue #17905, project **System.Net.Sockets**. 24907 area-System.IO Path.GetFullPath difference between Windows and Linux @YvonneArnoldus commented on [Thu Oct 26 2017](https://github.com/dotnet/coreclr/issues/14707) I have written some code that uses Path.GetFullPath(). I have found some different results for the same paths between Windows and Linux in my Docker image. Windows: input: a\b\\..\\..\c.\ -> output: C:\code\fontoxml-sdk-schemacompiler\test\FontoXml.Server.Utils.XmlCatalog.Tests\bin\Debug\netcoreapp2.0\c\ Linux: a/b/../../c./ -> output: /app/test/FontoXml.Server.Utils.XmlCatalog.Tests/bin/Release/netcoreapp2.0/c./ It seems the current directory indicator isn't resolved on Linux as it is on Windows while the parent directory indicator is. 24909 area-Meta Ship .NET Framework compatibility pack A meta package to include all the libraries released from CoreFX in 2.0 that aren't already included in the [Microsoft.NETCore.App package](https://dotnet.myget.org/feed/dotnet-core/package/nuget/Microsoft.NETCore.App) (aka the shared framework) plus a series of new ports and necessary facades. Some are Windows only currently. Aim to release at least a complete preview in November. ## Spec https://github.com/dotnet/designs/pull/16 ## Previously shipped packages: Package ID | Link | Windows Only -- | -- | -- Microsoft.Win32.Registry | NuGet | Yes Microsoft.Win32.Registry.AccessControl | NuGet | Yes System.CodeDom | NuGet | System.Configuration.ConfigurationManager | NuGet | System.Data.SqlClient | NuGet | System.Drawing.Common | NuGet | No System.IO.FileSystem.AccessControl | NuGet | Yes System.IO.Packaging | NuGet | System.IO.Pipes.AccessControl | NuGet | Yes System.IO.Ports | NuGet | System.Reflection.Context | NuGet | System.Security.AccessControl | NuGet | Yes System.Security.Cryptography.Cng | NuGet | Yes System.Security.Cryptography.Pkcs | NuGet | Yes System.Security.Cryptography.ProtectedData | NuGet | Yes System.Security.Cryptography.Xml | NuGet | Yes System.Security.Permissions | NuGet | System.Security.Principal.Windows | NuGet | Yes System.ServiceModel.Duplex | NuGet | System.ServiceModel.Http | NuGet | System.ServiceModel.NetTcp | NuGet | System.ServiceModel.Primitives | NuGet | System.ServiceModel.Security | NuGet | System.ServiceProcess.ServiceController | NuGet | System.Text.Encoding.CodePages | NuGet | No System.Threading.AccessControl | NuGet | Yes ## New Packages: ID | | Remaining work | UWP? | Unix? -- | -- | -- | -- | -- | Updated Shims package | Authoring | | 14529 | System.Runtime.Caching | Test, Pkg | not yet | not yet 14762 | System.Management (WMI) | Tests, Pkg | no | not yet 3906 | System.Diagnostics.PerformanceCounter | PR | no | no 2089 | System.DirectoryServices | Pkg | no | no 2089 | System.DirectoryServices.Protocols | Pkg | no | not yet 2089 | System.DirectoryServices.AccountManagement | Pkg | no | no | System.ServiceModel.Syndication | Tests, Pkg | ? | yes 6913 | System.Diagnostics.EventLog | DONE | no | no 11545 | System.Drawing | DONE | no | yes 11857 | System.ComponentModel.Composition (MEF1) | Test, Pkg | ? | yes 13035 | System.Data.Odbc | DONE | no | yes 19771 | System.Data.DatasetExtensions | DONE | yes | yes 6024 | System.ServiceProcess.ServiceController & ServiceBase | DONE | no | no 5766 | System.Xaml | No plans | -- | -- 8723 | System.ServiceModel (WCF) Message Security | No plans | -- | -- 6920 | System.Addin | No plans | -- | -- 2394 | System.Activities (WF) | No plans | -- | -- 24910 area-System.Memory Using latest System.Memory with old S.N.V causes NU1605 package downgrade error "Since @weshaggard fixed https://github.com/dotnet/corefx/issues/24606 with https://github.com/dotnet/corefx/pull/24645, we have an issue where if we have an app targeting netcoreapp2.0 that references both System.Memory and an older version of System.Numerics.Vectors, we get a package downgrade error. `D:\Debugger\Template.csproj : error NU1605: Detected package downgrade: System.Numerics.Vectors from 4.5.0-preview1-25825-08 to 4.3.0. Reference the package directly from the project to select a different version. D:\Debugger\Template.csproj : error NU1605: Template -> System.Memory 4.5.0-preview1-25825-08 -> System.Numerics.Vectors (>= 4.5.0-preview1-25825-08) D:\Debugger\Template.csproj : error NU1605: Template -> System.Numerics.Vectors (>= 4.3.0)` This issue is reproducible for netcoreapp2.0 (but not for netcoreapp2.1). ```csproj <Project Sdk=""Microsoft.NET.Sdk""> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>netcoreapp2.0</TargetFramework> </PropertyGroup> <ItemGroup> <PackageReference Include=""System.Memory"" Version=""4.5.0-preview1-25825-08"" /> <PackageReference Include=""System.Runtime.CompilerServices.Unsafe"" Version=""4.5.0-preview1-25825-08"" /> <PackageReference Include=""System.Numerics.Vectors"" Version=""4.3.0"" /> </ItemGroup> </Project> ``` - One workaround would be to update the application to target netcoreapp2.1. Why exactly does that resolve the package dependency issue? - Another workaround would be to explicitly reference the latest version of System.Numerics.Vectors (that System.Memory was built against). This shouldn't be required. **One solution for this issue would be to do the following (from https://github.com/dotnet/corefxlab/pull/1861#issuecomment-337747682):** > One thing to consider with System.Memory: shouldn't the netcoreapp2.0 implementation use the *inbox* version of System.Numerics.Vectors? If it did so we wouldn't emit a package dependency. How would we be able to do this? Any ideas how to resolve this issue? > You need to investigate how System.Memory is building for netcoreapp2.0 and where it is getting the System.Numerics.Vectors that it is building against. cc @KrzysztofCwalina, @ericstj, @weshaggard " 24913 area-System.Xml XPathNavigable.PrependChild/AppendChild not working for netcoreapp2.0 ## Description XPathNavigable.AppendChild and XPathNavigable.PrependChild are not behaving as expected for netcoreapp2.0 when the logic is present in ClassLibrary targetting netstandard1.4 [ConsoleApp7.zip](https://github.com/dotnet/corefx/files/1421267/ConsoleApp7.zip) ## Repro Steps 1. Unzip the attached project and open ConsoleApp7.sln 2. Run ConsoleApp7 project. ConsoleApp7 project refers ClassLibrary1 which as the logic to create xml file. 3. You will get this output ```xml <RunSettings> <DataCollectionRunSettings> <DataCollectors /> </DataCollectionRunSettings> </RunSettings> ``` 4. Run ConsoleApp1 project. ConsoleApp1 project has the same code that is present in ClassLibrary1. 5. You will get this output ```xml <RunSettings> <MSTest> <SettingsFile>C:\temp\r.testsettings</SettingsFile> <ForcedLegacyMode>true</ForcedLegacyMode> </MSTest> <DataCollectionRunSettings> <DataCollectors /> </DataCollectionRunSettings> </RunSettings> ``` ## Observation If you notice, there is a difference in the output of ConsoleApp7 and ConsoleApp1, even though same code is used. `navigator.PrependChild(settingsNode);`, PrependChild is not behaving as expected and is not appending setttingsNode. cc:@codito 24914 area-Serialization XmlSerializer generates list of empty values for attribute including whitespace character. "## Description While using `System.Xml.Serialization.XmlSerializer` with `XmlSerializer.Deserialize()` method, the output for an attribute which is supposed to be mapped to a List<string> outputs empty values if there is only a whitespace character in the attribute, Is this the intended behaviour? ## Reproduction Steps 1) Create a .NET Core 2.0.2 console application. 2) Copy the following code to `Program.cs` file. ```c# using System; using System.Collections.Generic; using System.IO; using System.Xml; using System.Xml.Serialization; namespace XmlTest { internal class Program { private static void Main() { string xml = ""<Test list=\"" \"" />""; List<string> outputList = new List<string>(); using (XmlReader reader = XmlReader.Create(new StringReader(xml))) { XmlSerializer serializer = new XmlSerializer(typeof(Test)); outputList = ((Test)serializer.Deserialize(reader)).List; } Console.WriteLine($""Input XML: {xml}""); Console.WriteLine($""Generated list's length: {outputList.Count}""); Console.WriteLine(""Listing the list contents:""); foreach (string output in outputList) { Console.WriteLine($""Content:'{output}', content length:{output.Length}""); } Console.WriteLine(""End of process. Press enter to exit...""); Console.ReadLine(); } } public class Test { [XmlAttribute(""list"")] public List<string> List { get; set; } } } ``` 3) Run the code and read the console outputs. ## Observation The output seems like the result of code similar to the following: ```c# string test = "" ""; string[] parts = test.Split(' '); List<string> output = new List<string>(parts); ``` I couldn't find the spot where the serialization is happening in the code though, however if it's really something like this _and it is not the intended behaviour_, changing the `test.Split(' ')` piece to `test.Split(' ', StringSplitOptions.RemoveEmptyEntries)` should be fixing the issue." 24915 area-System.Runtime Update System.ObsoleteAttribute targets to include assembly ## Rationale Currently, `ObsoleteAttribute` can be used with types and members only which is very inconvenient when you need to obsolete the whole assembly. We already have quite a few cases in Xamarin but .NET is having the same problem with assemblies like System.Data.OracleClient which has been fully deprecated. ## Proposed API Add `AttributeTargets.Assembly` to existing list of AttributeUsage values ```csharp [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Interface | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Delegate, Inherited = false)] public sealed class ObsoleteAttribute : Attribute ``` ## Details This change will also require C# compiler change to update the logic used to track ObsoleteAttribute. ## Related Issues ## Updates * Used the template as requested by @joperezr 24916 area-System.Runtime Investigate shim assembly load errors for exception serialization support in uap/uapaot configuration Related: https://github.com/dotnet/corefx/issues/24424 ``` (uapaot) Unable to find assembly 'System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a': - System.Configuration.ConfigurationErrorException - System.Configuration.ConfigurationErrorsException - System.Configuration.Provider.ProviderException (uapaot) Unable to find assembly 'System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089': - System.Runtime.Serialization.InvalidDataContractException (uapaot) Unable to find assembly 'System.Transactions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089': - System.Transactions.TransactionAbortedException - System.Transactions.TransactionException - System.Transactions.TransactionInDoubtException - System.Transactions.TransactionManagerCommunicationException - System.Transactions.TransactionPromotionException (uap & uapaot) Unable to find assembly 'System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35': - System.ComponentModel.DataAnnotations.ValidationException (uapaot) Unable to find assembly 'System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089': - System.Xml.XPath.XPathException - System.Xml.XmlException - System.Xml.Schema.XmlSchemaException - System.Xml.Schema.XmlSchemaInferenceException - System.Xml.Schema.XmlSchemaValidationException - System.Xml.Xsl.XsltCompileException - System.Xml.Xsl.XsltException ``` 24918 area-System.Net How to debug the source code of ServiceModel.Http (4.4.0) using Visual Studio 2017 "@SCKlausZ commented on [Thu Oct 26 2017](https://github.com/dotnet/core/issues/1048) Visual Studio 15.3.4 .net core 2.0.0 System.ServiceModel.Http NuGet package 4.4.0 I'm having a strange transient error when calling a web service and I would like to step into WinHttpHandler (and WinHttpRequestCallback) to get more information, but I just get an ""Source Not Available"". I have cloned both the coreclr and corefx repositories, I have setup VS2017 according to [Visual Studio Doc](https://docs.microsoft.com/en-us/visualstudio/debugger/specify-symbol-dot-pdb-and-source-files-in-the-visual-studio-debugger) and [issue 897](https://github.com/dotnet/core/issues/897), and I can step into things like System.Private.CoreLib.dll. In the Modules window, I can see that the System.ServiceModel.Http.pdb is loaded. I can find the source code in ...\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs. I can open the source file, and if I set a breakpoint it is brown (red?) as if it is enabled. But execution doesn't break at the breakpoint. I can set a breakpoint in ExceptionDispatchInfo, but when I try to switch to a frame in WinHttpHandler/WinHttpRequestCallback I get ""Source Not Available (see screendump).  Can I do something so that I can step into the source code for the System.ServiceModel.Http NuGet package? " 24919 area-System.Data System.Data.SQLClient throws an Exceoption by calling open Method @Martin-Stein commented on [Wed Oct 25 2017](https://github.com/dotnet/core/issues/1045) Hi folks, Its great to have direct SQL access, but my UWP Application, with target Fall Creators Update, runs into an IO Exception when I call open-Method on my SQLConnection object: System.IO.FileNotFoundException occurred. HResult=0x80070002 Message= Could not load file or assembly 'System.Threading.Thread, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. File not found at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) bei System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) bei System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) bei System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) bei System.Data.SqlClient.SqlConnection.Open() bei SQLDBDiagrammGenerator.UWP.MainPage.connect_Click(Object sender, RoutedEventArgs e) I have loaded System.data.common version 4.3.0 System.Data.SQLClient 4.4.0 Microsoft.NETCore.UniversalWindowsPlatform Ver. 6.0.1 via Nuget. What can it be, how can it be solved? Best regards, Martin 24920 area-System.IO GZipStream not working as expected on compress. @jgauffin commented on [Thu Oct 26 2017](https://github.com/dotnet/standard/issues/556) I'm using .NET standard and had ported some code from .NET 4.5.2. ## Expected outcome: `Dispose()` **_or_** `Flush()` should be enough for the compressed contents to get copied to the inner stream. ## Actual outcome ***Both*** Flush and Dispose are required to get the correct amount of bytes back from the gzipstream: ``` using (var gzip = new GZipStream(ms, CompressionLevel.Optimal, true)) { gzip.Write(jsonBytes, 0, jsonBytes.Length); gzip.Flush(); } buffer = ms.ToArray(); ``` With just flush, I get 190 instead of 200 bytes: ```csharp using (var gzip = new GZipStream(ms, CompressionLevel.Optimal)) { gzip.Write(jsonBytes, 0, jsonBytes.Length); gzip.Flush(); buffer = ms.ToArray(); } ``` With only Dispose i get 194 of the 200 expected bytes: ```csharp using (var gzip = new GZipStream(ms, CompressionLevel.Optimal, true)) { gzip.Write(jsonBytes, 0, jsonBytes.Length); } buffer = ms.ToArray(); ``` --- @Petermarcu commented on [Fri Oct 27 2017](https://github.com/dotnet/standard/issues/556#issuecomment-340018033) I am assuming you are trying to run the library on .NET Core? We need to get this bug to whichever implementation of .NET Standard you are running on. --- @jgauffin commented on [Fri Oct 27 2017](https://github.com/dotnet/standard/issues/556#issuecomment-340019795) The .NET library is compiled as .NET standard. I discovered the error in a .NET ASP.NET Core MVC application and reproduced it in a .NET Core console application. --- @Petermarcu commented on [Fri Oct 27 2017](https://github.com/dotnet/standard/issues/556#issuecomment-340022551) Great. Yeah, it will be compiled against .NET Standard but will run on an implementation of .NET Standard in one of the implementations. Sounds like this one is in .NET Core. I'm going to move this issue to the repo that has the Compression code for .NET Core. 24921 area-System.ComponentModel Adding System.ComponentModel.Composition Ports MEF1 sources cc: @danmosemsft @safern 24922 area-Infrastructure Update BuildTools, Standard to prerelease-02127-10, preview1-25827-06, respectively (master) 24923 area-System.ComponentModel Allow DisplayAttribute on Class declarations Contributes to #8123 cc: @divega 24924 area-Infrastructure Add blob feed as a restore source @jcagme @chcosta @weshaggard 24925 area-System.IO WIP: Move OpenCommPort to api set It will fail until changes in buildtools (https://github.com/dotnet/buildtools/pull/1766) reach corefx. 24929 area-System.Memory ReadOnlySpan indexer now returns ref readonly Fixes https://github.com/dotnet/corefx/issues/24105 Related PR: https://github.com/dotnet/coreclr/pull/14727 cc @ektrah, @VSadov, @jkotas, @KrzysztofCwalina 24930 area-System.Net Remove dead code from System.Net.WebClient PR addresses issue #17905, project **System.Net.WebClient**. 24931 area-Meta Performance improvements (CoreFX) Epic This sub epic is to track specific investments to improve performance in CoreFX functionality - other than networking performance which is tracked [elsewhere](https://github.com/dotnet/corefx/issues/24742). We plan to use data - such as Azure profiler; customer traces; CLBG, TechEmpower - to target performance improvements where they matter most, generally in widely-used existing API. Candidate areas include: Timers, Async methods, Cancellation, Synchronization, Linq, Regex, Collections, Strings. Often changes will be candidates for porting to .NET Framework. Performance improvements are made all the time they do not necessarily need to be linked to this. This is to track specific focus areas. 24932 area-System.Net Remove dead code from System.Net.WebSocket.Client PR addresses issue #17905, project **System.Net.WebSocket.Client**. 24936 area-Serialization Remove dead code from System.Private.DataContractSerialization PR addresses issue #17905, project **System.Private.DataContractSerialization**. **Notes** Some of the red issues in [diff file](http://tempcoverage.blob.core.windows.net/report2/System.Private.DataContractSerialization.diff.html) are already used somewhere, so they were not deleted. For example `Write*` methods in `XmlNodeWriter`, which take `byte[]` as first argument. Some of the issues are used in conditional compilation, so I did not remove them: `IDataNode`, `NMTOKENSDataContract`, `JsonReadWriteDelegates`, `XmlFormatGeneratorStatics`. I deleted `NamespaceManager.NamespaceBoundary` property because it is not used anywhere. But it sets `_nsTop` field. This field is used in some `for` loops, but now it is never set, so its value is always 0. So maybe here somebody with greater understanding shoud decide what to do with it. 24937 area-System.Net Remove dead code from System.Private.Uri PR addresses issue #17905, project **System.Private.Uri**. 24938 area-System.Runtime [Binary serialization] Dictionary<string,string> does not roundtrip with full .NET Framework "Run this on .NET Core: ``` using System; using System.IO; using System.Collections.Generic; using System.Runtime.Serialization.Formatters.Binary; class Program { static void Main(string[] args) { var d = new Dictionary<string,string>(); d.Add(""Hello"", ""World""); using (var fs = new FileStream(""DataFile.dat"", FileMode.Create)) { BinaryFormatter formatter = new BinaryFormatter(); formatter.Serialize(fs, d); } } } ``` Then run this on .NET Framework: ``` using System; using System.IO; using System.Collections.Generic; using System.Runtime.Serialization.Formatters.Binary; class Program { static void Main(string[] args) { using (var fs = new FileStream(""DataFile.dat"", FileMode.Open)) { BinaryFormatter formatter = new BinaryFormatter(); var d = (Dictionary<string,string>)formatter.Deserialize(fs); foreach (var e in d) Console.WriteLine($""{e.Key} {e.Value}""); } } } ``` Result: Deserialization on .NET Framework fails with: ``` Unhandled Exception: System.InvalidCastException: Object must implement IConvertible. at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider) at System.Runtime.Serialization.SerializationInfo.GetValue(String name, Type type) at System.Collections.Generic.Dictionary`2.OnDeserialization(Object sender) at System.Runtime.Serialization.ObjectManager.RaiseDeserializationEvent() at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream) at Program.Main(String[] args) ```" 24939 area-System.Collections Delete unnecessary internal forwarders The optimized enum comparers used can never show up in the binary serialization payload. We do not need the internal forwarders for them. 24940 area-System.Security Assistance with making first pull request I have implemented RIPE160 hashing as documented in the .NET 4.7.1 API reference by porting Antoon Bosselaers's C implementation to C#. As with most security algorithms, it is a bit messy, however I've tested it quite thoroughly. Is there anyone here who would like to hand-hold me while performing my first pull request? SSH.NET does not compile with .NET Core from the development branch because of lack of RIPE160 support. I considered making better #ifdefs in the SSH.NET code to detect and disable the feature, but reconsidered that adding RIPE160 was in fact the better solution. Thank you in advance... my repository is : https://github.com/darrenstarr/RIPEMD160.net and I believe I'm most of the way there. There is a single unit test which I don't understand well enough yet to provide the correct value as the result. I suppose once I properly get the code checked out and ready, it should be pretty easy to sort out. 24941 area-System.Diagnostics Segfault when calling Dispose() on a socket asynchronously accepting connections in AssemblyLoadContext.Default.Unloading Operating system: Debian Stretch Tested with both dotnet-runtime-2.0.0 debian package and git master (coreclr SHA 67a66156d0307b49522a13618522d289268bc1f9 and corefx SHA 389d7ee0630e71ff868b4d9ebcdcf8111d5acee3) Reproduction code: https://gist.github.com/LHCGreg/e2e044ae28f6cb5f786de742378c66ed Reproduction steps: ``` dotnet AsyncSocketStopTest.dll (from another terminal, replace 1008 with actual PID of program) kill -SIGTERM 1008 ``` Output: ``` Starting listening socket Started listening Registering SIGTERM handler Registering SIGINT handler Socket is accepting asynchronously. Kill this process with kill -SIGTERM 1008 In SIGTERM handler. Unregistered SIGTERM and SIGINT handlers in SIGTERM handler Signalling socket to stop accepting connections. Disposing of listening socket Caught OperationCanceledException from waiting on AcceptAsync(), good Unregistered SIGTERM and SIGINT handlers in Main Sleeping for 5 seconds. Segmentation fault ``` A stack trace from lldb: ``` OS Thread Id: 0x3ba (5) Child SP IP Call Site 00007FFFEF7FB6D0 00007ffff627ee40 [InlinedCallFrame: 00007fffef7fb6d0] System.Diagnostics.Tracing.EventPipeInternal.CreateProvider(System.Guid, EtwEnableCallback) 00007FFFEF7FB6D0 00007fff7cc753c1 [InlinedCallFrame: 00007fffef7fb6d0] System.Diagnostics.Tracing.EventPipeInternal.CreateProvider(System.Guid, EtwEnableCallback) 00007FFFEF7FB6C0 00007FFF7CC753C1 DomainNeutralILStubClass.IL_STUB_PInvoke(System.Guid, EtwEnableCallback) 00007FFFEF7FB780 00007FFF7CD00DBE System.Diagnostics.Tracing.EventPipeEventProvider.System.Diagnostics.Tracing.IEventProvider.EventRegister(System.Guid ByRef, EtwEnableCallback, Void*, Int64 ByRef) 00007FFFEF7FB7C0 00007FFF7CC3EE08 System.Diagnostics.Tracing.EventProvider.Register(System.Guid) 00007FFFEF7FB800 00007FFF7CC129E9 System.Diagnostics.Tracing.EventSource.Initialize(System.Guid, System.String, System.String[]) 00007FFFEF7FB890 00007FFF7CC4DA8C System.Diagnostics.Tracing.FrameworkEventSource..cctor() 00007FFFEF7FBBE0 00007ffff6344f07 [GCFrame: 00007fffef7fbbe0] 00007FFFEF7FC510 00007ffff6344f07 [HelperMethodFrame: 00007fffef7fc510] 00007FFFEF7FC650 00007FFF7CC1D3E4 System.Threading.ThreadPoolWorkQueue..ctor() 00007FFFEF7FC680 00007FFF7CD0BDCE System.Threading.ThreadPoolGlobals..cctor() 00007FFFEF7FCA40 00007ffff6344f07 [GCFrame: 00007fffef7fca40] 00007FFFEF7FD370 00007ffff6344f07 [HelperMethodFrame: 00007fffef7fd370] 00007FFFEF7FD4B0 00007FFF7CC1CD03 System.Threading.ThreadPool.QueueUserWorkItem(System.Threading.WaitCallback, System.Object) 00007FFFEF7FD4F0 00007FFF7D27FC96 System.Net.Sockets.SocketAsyncContext+AsyncOperation.TryCompleteOrAbortAsync(System.Net.Sockets.SocketAsyncContext, Boolean) 00007FFFEF7FD520 00007FFF7D280836 System.Net.Sockets.SocketAsyncContext+OperationQueue`1[[System.__Canon, System.Private.CoreLib]].StopAndAbort() 00007FFFEF7FD570 00007FFF7D27CB3C System.Net.Sockets.SocketAsyncContext.Close() 00007FFFEF7FD5A0 00007FFF7D27B832 System.Net.Sockets.SafeCloseSocket.ReleaseHandle() 00007FFFEF7FD680 00007ffff6344f07 [GCFrame: 00007fffef7fd680] 00007FFFEF7FD7F8 00007ffff6344f07 [GCFrame: 00007fffef7fd7f8] 00007FFFEF7FD890 00007ffff6344f07 [HelperMethodFrame_1OBJ: 00007fffef7fd890] System.Runtime.InteropServices.SafeHandle.InternalDispose() 00007FFFEF7FD9C0 00007FFF7D27B900 System.Net.Sockets.SafeCloseSocket.CloseAsIs() 00007FFFEF7FD9F0 00007FFF7D26C07F System.Net.Sockets.Socket.Dispose(Boolean) 00007FFFEF7FDAD0 00007FFF7D26C5EF System.Net.Sockets.Socket.Dispose() 00007FFFEF7FDB00 00007FFF7D169F27 AsyncSocketStopTest.Program.SigtermHandler(System.Runtime.Loader.AssemblyLoadContext) [D:\documents\Visual Studio 2017\Projects\SocketStoptest\AsyncSocketStopTest\Program.cs @ 29] 00007FFFEF7FDC30 00007ffff6344f07 [GCFrame: 00007fffef7fdc30] 00007FFFEF7FDCE8 00007ffff6344f07 [GCFrame: 00007fffef7fdce8] ``` The segfault only occurs when Disposing the socket in a handler for AssemblyLoadContext.Default.Unloading (SIGTERM). Disposing in a handler for Console.CancelKeyPress (SIGINT) does not segfault and works as expected, as does Disposing in response to user input. 24942 area-System.Net Memory leak when HttpClient.GetByteArrayAsync() is used "There is no this problem with memory when using HttpClient.GetStreamAsync() and getting byte array manually. After research of source code I've found HttpClient.GetByteArrayAsyncCore() and here some code from this method: ``` if (contentLength.HasValue) { // If we got a content length, then we assume that it's correct and create a MemoryStream // to which the content will be transferred. That way, assuming we actually get the exact // amount we were expecting, we can simply return the MemoryStream's underlying buffer. buffer = new HttpContent.LimitMemoryStream(_maxResponseContentBufferSize, (int)contentLength.GetValueOrDefault()); await responseStream.CopyToAsync(buffer).ConfigureAwait(false); if (buffer.Length > 0) { return ((HttpContent.LimitMemoryStream)buffer).GetSizedBuffer(); } } ``` As you can see _buffer_ is not disposed after the method returned. May it is a reason of memory leak? To continue a theme of used memory I run this small program targeting .Net Framework 4.7 and .Net Core 2.0. ``` using System; using System.IO; using System.Net.Http; using System.Threading.Tasks; namespace TestCsharp { internal class Program { private static void Main() { HttpClient client = new HttpClient(); Parallel.For(0, 100, i => { using (Stream stream = client.GetStreamAsync(""https://music.nashe.com.ua/ANEBO_-_Holos_za_pochuttia.mp3"").Result) using (MemoryStream memory = new MemoryStream()) { stream.CopyTo(memory); byte[] b = memory.ToArray(); } }); Console.ReadKey(); } } } ``` Using Diagnostic Tools I've noticed different GC behaviour (in .Net Framework it calls frequently and memory releasings are larger after it). During work .Net Core uses up to 1 GB (.Net Framework no more than 400 MB) and when tasks are done Process Memory in .Net Core is near 500 MB whereas .Net Framework program uses near 50 MB. How to achive the same usage of memory in .Net Core? (Except of targeting .Net Framework)." 24943 area-System.Net Calling Dispose() on a socket inside a synchronous Accept() on Linux hangs "Operation System: Debian Stretch Tested with git master (coreclr SHA 67a66156d0307b49522a13618522d289268bc1f9 and corefx SHA 389d7ee) Reproduction code: https://gist.github.com/LHCGreg/a8a144da68d59f225a4b2c4bd1cbd05d This program takes three arguments. First argument is 'async' or 'sync' for whether to call Accept() or AcceptAsync(). Second argument is 'shutdown' to try to stop listening socket by calling Shutdown(SocketShutdown.Both), then Dispose(), or 'dispose' to just call Dispose(). Third argument is 'signal' to register signal handlers for SIGINT (or ctrl+c on windows) and SIGTERM (netcore only), or 'auto' to automatically try to stop the listening socket after 3 seconds. Reproduction steps: On Linux, run ``` dotnet SocketStopTest.dll sync dispose auto ``` Expected result: A SocketException is thrown from the Accept() call and the program terminates. Actual result: The program hangs inside Socket.Dispose(). On Windows, both full framework and .net core, calling Dispose() on a Socket that is in a synchronous Accept() call will break it out of the Accept() call with a SocketException. On Linux, it hangs inside the Dispose(). On Linux, calling Shutdown(SocketShutdown.Both) before calling Dispose() works and causes a SocketException to be thrown from the Accept(), although the exception message is a little weird: ""Invalid argument"". But on Windows, whether full framework or .net core, calling Shutdown(SocketShutdown.Both) apparently hangs when called from regular code or throws a SocketException on the Shutdown (and does not interrupt the Accept) when called from a ctrl+c handler with a message of ""A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied"" With AcceptAsync(), Dispose() generally works as expected on Windows full framework, Windows .net core, and Linux .net core, with the small exception of Windows full framework raising ObjectDisposedException from the accept task instead of SocketException. See outcome.txt in the gist for outcomes of all combinations of Windows net47 vs Windows netcore vs Linux netcore, Accept() vs. AsyncAccept(), Shutdown(SocketShutdown.Both) + Dispose() vs. just Dispose(), and socket stopped from delayed Task vs. ctrl+c/SIGINT handler vs. SIGTERM handler. It's also far from clear from documentation what the correct way of interrupting an Accepting socket is. One might guess to call Dispose() on it, but calling Shutdown would be another reasonable guess and works on Linux but not Windows." 24945 area-System.Linq Remove private reflection agaist RuntimeWrappedException constructor RuntimeWrappedException constructor is public in CoreLib now. It can be called directly. 24946 area-System.Runtime Expose RuntimeWrappedException constructor High-fidelity interpreters need to create RuntimeWrappedException. There is no public constructor for RuntimeWrappedException today. # Proposed API ```C# public class RuntimeWrappedException { public RuntimeWrappedException(object thrownObject); } ``` # Details The constructor is public in the CoreLib implementation already. It is used by our own `System.Linq.Expression` interpreter (see #24945). This issue is about exposing it in the contract so that 3rd party libraries have access to it as well, and do not have to resort to private reflection. 24947 area-System.Net "Test: System.Net.Http.Functional.Tests.HttpClientHandlerTest/SendAsync_GetWithInvalidHostHeader_ThrowsException failed with ""Xunit.Sdk.ThrowsException""" Opened on behalf of @Jiayili1 The test `System.Net.Http.Functional.Tests.HttpClientHandlerTest/SendAsync_GetWithInvalidHostHeader_ThrowsException` has failed. Assert.Throws() Failure\r Expected: typeof(System.Net.Http.HttpRequestException)\r Actual: (No exception was thrown) Stack Trace: --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\ExceptionServices\ExceptionDispatchInfo.cs:line 63 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs:line 182 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs:line 150 at System.Runtime.CompilerServices.TaskAwaiter$1<System.__Canon>.GetResult() in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs:line 483 at System.Net.Http.Functional.Tests.HttpClientHandlerTest.<SendAsync_GetWithInvalidHostHeader_ThrowsException>d__34.MoveNext() in E:\A\_work\1598\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.cs:line 327 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\ExceptionServices\ExceptionDispatchInfo.cs:line 63 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs:line 182 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs:line 150 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\ExceptionServices\ExceptionDispatchInfo.cs:line 63 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs:line 182 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs:line 150 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\ExceptionServices\ExceptionDispatchInfo.cs:line 63 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs:line 182 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs:line 150 Build : Master - 20171030.01 (UWP ILC Tests) Failing configurations: - Windows.10.Amd64.ClientRS3-x86 - Release - Windows.10.Amd64.ClientRS3-x64 - Release Detail: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Filc~2F/build/20171030.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandlerTest~2FSendAsync_GetWithInvalidHostHeader_ThrowsException 24948 area-System.Runtime "Tests under: System.Runtime.Serialization.Formatters.Tests.BinaryFormatterTests failed with ""System.Runtime.Serialization.SerializationException""" Opened on behalf of @Jiayili1 The test `System.Runtime.Serialization.Formatters.Tests.BinaryFormatterTests/RoundtripManyObjectsInOneStream` has failed. System.Runtime.Serialization.SerializationException : Type 'System.Diagnostics.Tracing.EventSourceException' in Assembly 'System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not marked as serializable. Stack Trace: at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, $ISurrogateSelector surrogateSelector, StreamingContext context, $SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, $ObjectWriter objectWriter, $SerializationBinder binder) in E:\A\_work\1598\s\corefx\src\System.Runtime.Serialization.Formatters\src\System\Runtime\Serialization\Formatters\Binary\BinaryObjectInfo.cs:line 106 at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object obj, $ISurrogateSelector surrogateSelector, StreamingContext context, $SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, $ObjectWriter objectWriter, $SerializationBinder binder) in E:\A\_work\1598\s\corefx\src\System.Runtime.Serialization.Formatters\src\System\Runtime\Serialization\Formatters\Binary\BinaryObjectInfo.cs:line 70 at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, $BinaryFormatterWriter serWriter, Boolean fCheck) in E:\A\_work\1598\s\corefx\src\System.Runtime.Serialization.Formatters\src\System\Runtime\Serialization\Formatters\Binary\BinaryObjectWriter.cs:line 92 at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Boolean check) in E:\A\_work\1598\s\corefx\src\System.Runtime.Serialization.Formatters\src\System\Runtime\Serialization\Formatters\Binary\BinaryFormatter.cs:line 87 at System.Runtime.Serialization.Formatters.Tests.BinaryFormatterTests.RoundtripManyObjectsInOneStream() at _$ILCT$.$ILT$ReflectionDynamicInvoke$.InvokeRetV(Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean targetIsThisCall) at System.InvokeUtils.CalliIntrinsics.Call(IntPtr dynamicInvokeHelperMethod, Object thisPtrForDynamicInvokeHelperMethod, Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState) at System.InvokeUtils.CallDynamicInvokeMethod(Object thisPtr, IntPtr methodToCall, Object thisPtrDynamicInvokeMethod, IntPtr dynamicInvokeHelperMethod, IntPtr dynamicInvokeHelperGenericDictionary, Object targetMethodOrDelegate, Object[] parameters, BinderBundle binderBundle, Boolean wrapInTargetInvocationException, Boolean invokeMethodHelperIsThisCall, Boolean methodToCallIsThisCall) in CallDynamicInvokeMethod:line 16707566 Build : Master - 20171030.01 (UWP ILC Tests) Failing configurations: - Windows.10.Amd64.ClientRS3-x86 - Release - Debug - Windows.10.Amd64.ClientRS3-x64 - Debug - Release Detail: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Filc~2F/build/20171030.01/workItem/System.Runtime.Serialization.Formatters.Tests/analysis/xunit/System.Runtime.Serialization.Formatters.Tests.BinaryFormatterTests~2FRoundtripManyObjectsInOneStream 24949 area-System.Threading "Test: System.Threading.Channels.Tests.AsyncMultiReaderUnboundedChannelTests/ValidateDebuggerAttributes failed with ""System.InvalidOperationException""" Opened on behalf of @Jiayili1 The test `System.Threading.Channels.Tests.AsyncMultiReaderUnboundedChannelTests/ValidateDebuggerAttributes` has failed. System.InvalidOperationException : Expected one DebuggerDisplayAttribute on EETypeRva:0x00063A00. Stack Trace: at System.Diagnostics.DebuggerAttributes.ValidateDebuggerDisplayReferences(Object obj) in E:\A\_work\1598\s\corefx\src\System.Threading.Channels\tests\DebuggerAttributes.cs:line 60 at System.Threading.Channels.Tests.ChannelTestBase.ValidateDebuggerAttributes() in E:\A\_work\1598\s\corefx\src\System.Threading.Channels\tests\ChannelTestBase.cs:line 27 at _$ILCT$.$ILT$ReflectionDynamicInvoke$.InvokeRetV(Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean targetIsThisCall) at System.InvokeUtils.CalliIntrinsics.Call(IntPtr dynamicInvokeHelperMethod, Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean isTargetThisCall) at System.InvokeUtils.CallDynamicInvokeMethod(Object thisPtr, IntPtr methodToCall, Object thisPtrDynamicInvokeMethod, IntPtr dynamicInvokeHelperMethod, IntPtr dynamicInvokeHelperGenericDictionary, Object targetMethodOrDelegate, Object[] parameters, BinderBundle binderBundle, Boolean wrapInTargetInvocationException, Boolean invokeMethodHelperIsThisCall, Boolean methodToCallIsThisCall) in CallDynamicInvokeMethod:line 16707566 Build : Master - 20171030.01 (UWP ILC Tests) Failing configurations: - Windows.10.Amd64.ClientRS3-x86 - Release - Debug - Windows.10.Amd64.ClientRS3-x64 - Debug - Release Detail: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Filc~2F/build/20171030.01/workItem/System.Threading.Channels.Tests/analysis/xunit/System.Threading.Channels.Tests.AsyncMultiReaderUnboundedChannelTests~2FValidateDebuggerAttributes 24950 area-System.Threading "Test: System.Threading.Channels.Tests.AsyncSingleReaderUnboundedChannelTests/ValidateInternalDebuggerAttributes failed with ""System.NullReferenceException""" Opened on behalf of @Jiayili1 The test `System.Threading.Channels.Tests.AsyncSingleReaderUnboundedChannelTests/ValidateInternalDebuggerAttributes` has failed. System.NullReferenceException : Object reference not set to an instance of an object. Stack Trace: at System.Threading.Channels.Tests.SingleReaderUnboundedChannelTests.ValidateInternalDebuggerAttributes() in E:\A\_work\1598\s\corefx\src\System.Threading.Channels\tests\UnboundedChannelTests.cs:line 148 at _$ILCT$.$ILT$ReflectionDynamicInvoke$.InvokeRetV(Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean targetIsThisCall) at System.InvokeUtils.CalliIntrinsics.Call(IntPtr dynamicInvokeHelperMethod, Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean isTargetThisCall) at System.InvokeUtils.CallDynamicInvokeMethod(Object thisPtr, IntPtr methodToCall, Object thisPtrDynamicInvokeMethod, IntPtr dynamicInvokeHelperMethod, IntPtr dynamicInvokeHelperGenericDictionary, Object targetMethodOrDelegate, Object[] parameters, BinderBundle binderBundle, Boolean wrapInTargetInvocationException, Boolean invokeMethodHelperIsThisCall, Boolean methodToCallIsThisCall) in CallDynamicInvokeMethod:line 16707566 Build : Master - 20171030.01 (UWP ILC Tests) Failing configurations: - Windows.10.Amd64.ClientRS3-x86 - Release - Debug - Windows.10.Amd64.ClientRS3-x64 - Debug - Release Detail: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Filc~2F/build/20171030.01/workItem/System.Threading.Channels.Tests/analysis/xunit/System.Threading.Channels.Tests.AsyncSingleReaderUnboundedChannelTests~2FValidateInternalDebuggerAttributes 24951 area-System.Data "SqlClient doesn't support ""always encrypt"" (column encryption setting=enabled)" "SqlClient from .NET 4.6+ supports SQL Server 2016's ""always encrypted"" option using the connection string option ""column encryption setting=enabled"". This allows application code to transparently read/write data from columns such that it is automatically encrypted before sending to the database server, in such a way that it cannot be decrypted from other systems without access to the relevant keys. Unfortunately it's not yet supported under .NET Core, which limits the use of this feature in security-conscious platforms (e.g. payment systems)." 24952 area-System.Net System.Net.Http.CurlException: SSL connect error I have an n-tier dynamic-ish application that currently builds its elastic indexes I'm app startup, while this was ok to get things going, I'd prefer to have a small CLI application/util that I can later re-use in some scripts and or run ad hoc if i need to do things like, creating a new instance, seeding mock data etc. When I use the exact same code that worked in my dotnetcore web apps startup, in my console app. I get the following issue. Invalid NEST response built from a unsuccessful low level call on PUT: /jobs-ng # Audit trail of this API call: - [1] BadRequest: Node: https://localhost:9200/ Took: 00:00:01.3948230 # OriginalException: System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.CurlException: SSL connect error at System.Net.Http.CurlHandler.ThrowIfCURLEError(CURLcode error) at System.Net.Http.CurlHandler.MultiAgent.FinishRequest(StrongToWeakReference`1 easyWrapper, CURLcode messageResult) --- End of inner exception stack trace --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at Elasticsearch.Net.HttpConnection.Request[TReturn](RequestData requestData) in C:\Users\russ\source\elasticsearch-net-5.x\src\Elasticsearch.Net\Connection\HttpConnection-CoreFx.cs:line 78 # Request: <Request stream not captured or already read to completion by serializer. Set DisableDirectStreaming() on ConnectionSettings to force it to be set on the response.> # Response: <Response stream not captured or already read to completion by serializer. Set DisableDirectStreaming() on ConnectionSettings to force it to be set on the response.> So far my best guess is that the native console app is missing something that the default AspNetCore web app projects provide, but as to what, I dont know? I have set `DisableDirectStreaming()` as per the error log, but still no change. I believe this might be a bug within dotnetcore, but I'm hoping someone knows of a work around, or way around this issue for the time being (other that having this code be part of the we apps startup?) 24953 area-System.Data System.Data.Odbc support of SQL Server datetime2, time, date, datetimeoffset types "According to [ODBC documentation](https://docs.microsoft.com/en-us/sql/relational-databases/native-client-odbc-date-time/data-type-support-for-odbc-date-and-time-improvements), ODBC supports the SQL 2008+ types like `datetime2`, `date`, `time` and `datetimeoffset`. But it seems impossible to use them with `System.Data.Odbc` available on MyGet since #13035, excepted `Date`. They look unsupported by this ODBC client, although I have the ""ODBC Driver 13 for SQL Server"" and its ""SQL Server Native Client 11.0"" driver: - Trying to read a `Time` column with a `System.Data.Odbc` reader `GetValue` yields: System.ArgumentException : Unknown SQL type - SS_TIME_EX. at System.Data.Odbc.TypeMap.FromSqlType(SQL_TYPE sqltype) at System.Data.Odbc.OdbcDataReader.GetSqlType(Int32 i) at System.Data.Odbc.OdbcDataReader.GetValue(Int32 i) - Trying to read a `Time` column with a `System.Data.Odbc` reader `GetTime` cuts fractional seconds. - Trying to set a `Time` parameter on an `OdbcCommand` cuts its fractional seconds. - Trying to set a `DateTime2` parameter on an `OdbcCommand` yields: System.ArgumentException : No mapping exists from DbType DateTime2 to a known OdbcType. at System.Data.Odbc.TypeMap.FromDbType(DbType dbType) at System.Data.Odbc.OdbcParameter.set_DbType(DbType value) - Setting a `DateTimeOffset` parameter yields the same error with just the db-type name accordingly changed. - Trying to read a `DateTimeOffset` column with a `System.Data.Odbc` reader `GetValue` yields: System.ArgumentException : Unknown SQL type - -155. at System.Data.Odbc.TypeMap.FromSqlType(SQL_TYPE sqltype) at System.Data.Odbc.OdbcDataReader.GetSqlType(Int32 i) at System.Data.Odbc.OdbcDataReader.GetValue(Int32 i) - Trying to read a `DateTimeOffset` column with a `System.Data.Odbc` reader `GetDateTime` cuts offset (but preserves fractional seconds (all 7 digits)). - Checking [`OdbcType`](https://github.com/dotnet/corefx/blob/master/src/System.Data.Odbc/src/System/Data/Odbc/OdbcType.cs) enumeration, it does not have types for `datetimeoffset` or `datetime2`. - Trying to dodge the trouble for `datetime2` by using `DbType.DateTime` instead for parameter: - Requires to set the parameter scale, otherwise fails with: System.Data.Odbc.OdbcException : ERROR [22008] [Microsoft][SQL Server Native Client 11.0]Datetime field overflow. Fractional second precision exceeds the scale specified in the parameter binding. at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader, Object[] methodArguments, SQL_API odbcApiMethod) at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader) at System.Data.Odbc.OdbcCommand.ExecuteScalar() - When setting the parameter scale to 7, cuts fractional milliseconds even if the column in database is `datetime2`. This gives the one millisecond precision (compared to SQL Server `datetime` ten thirds of ms precision), but `datetime2` can go down to 100ns. Catching the query with SQL Server Profiler, we can see this: exec sp_executesql N'select count(*) from Types2008 where [DateTime2] = @P1', N'@P1 datetime2','2017-10-26 20:01:55.1630000' So the value is `datetime2` typed but has its fractional milliseconds zeroed out (yes my original value was not having them already zeroed). By the way this `datetime2` typing causes issues when the underlying table column is `datetime` instead, because it occurs in this case too. It causes `where` equality conditions to fail matching on two thirds of `datetime` values. Those ending with `3` or `7` milliseconds are not considered equal to the ""same"" value when typed `datetime2` with four trailing zero. Only those ending with 0 millisecond match. Those results were obtained with .Net Core 2.0, System.Data.Odbc 4.5.0-preview1-25829-02, a SQL Server Express 2016, and as connection string: Driver={SQL Server Native Client 11.0}; Server=.\sql_express; Database=test; Trusted_Connection=yes; Mars_Connection=yes; Here is a complete [gist](https://gist.github.com/fredericDelaporte/e1563b1510ce31a01e7d9dc9e9387e6d) of tests reproducing those issues. Those troubles exist with .Net Framework too, and are reported [here](https://connect.microsoft.com/VisualStudio/feedback/details/3143192)." 24954 area-System.Net " When calling web service in parallel: ""The server returned an invalid or unrecognized response""" Visual Studio 15.3.4 .net core 2.0.0 dotnet-svcutil 0.5.0.0 System.ServiceModel.Http NuGet package 4.4.0 I have created a console app calling a 3rd party web service, using dotnet-svcutil to generate the client. When I call the server asynchronously in parallel I sometimes get an HttpRequestException: An error occurred while sending the request. with an inner exception: WinHttpException (0x80072F78): The server returned an invalid or unrecognized response (NativeErrorCode: 12152) I can see that it's the HEAD call that fails. Using WireShark I can see that the server returns an HTTP 405 Method Not Allowed, with a body containing a soap envelope with a fault. If I create a client app in .net framework 4.7, I don't get the error. I think the server is a self-hosted wcf service - but I'm not sure. (If I look in System.ServiceModel.Channels.HttpChannelFactory.cs line 996, an exception during the head pre-auth request, should be ignored (but maybe I'm looking in the wrong place).) 24955 area-System.Threading Address System.Threading.Channels PR feedback Addressing a few pieces of feedback on the previous PR, plus some auto-cleanup. 24957 area-Infrastructure Adding required libraries to the net471 support package. cc: @weshaggard @AlexGhiondea @ericstj Adding the required libraries to the net471 support package. 24958 area-Infrastructure Add information on myget feed and local SDK Does anything else need updating here? 24960 area-Infrastructure Symbols publishing broken "I do not know why (apparently) this assembly does not have a PDB. Could symbols publishing have previously ignored this? @vancem it may be best to change this to a warning until the issue is solved. https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_build?_a=summary&buildId=1096440 fyi @Anipik ``` 2017-10-30T13:06:59.0898179Z Converting portable PDB 'E:\A\_work\1491\b\pipelineRepository\bin\obj\SymbolsRequest\ExtractedPackages\10\lib\net461\Microsoft.Win32.Registry.AccessControl.dll'... 2017-10-30T13:06:59.0898179Z E:\A\_work\1491\b\pipelineRepository\Tools\Symbols.targets(508,5): error MSB4018: The ""ConvertPortablePdbsToWindowsPdbs"" task failed unexpectedly. [E:\A\_work\1491\b\pipelineRepository\build.proj] 2017-10-30T13:06:59.0898179Z E:\A\_work\1491\b\pipelineRepository\Tools\Symbols.targets(508,5): error MSB4018: System.IO.InvalidDataException: Specified PE file doesn't have any PDB associated with it [E:\A\_work\1491\b\pipelineRepository\build.proj] 2017-10-30T13:06:59.0898179Z E:\A\_work\1491\b\pipelineRepository\Tools\Symbols.targets(508,5): error MSB4018: at Microsoft.DiaSymReader.Tools.PdbConverterPortableToWindows.Convert(PEReader peReader, MetadataReader pdbReader, SymUnmanagedWriter pdbWriter, PdbConversionOptions options) [E:\A\_work\1491\b\pipelineRepository\build.proj] 2017-10-30T13:06:59.0898179Z E:\A\_work\1491\b\pipelineRepository\Tools\Symbols.targets(508,5): error MSB4018: at Microsoft.DiaSymReader.Tools.PdbConverter.ConvertPortableToWindows(PEReader peReader, MetadataReader pdbReader, SymUnmanagedWriter pdbWriter, PdbConversionOptions options) [E:\A\_work\1491\b\pipelineRepository\build.proj] 2017-10-30T13:06:59.0898179Z E:\A\_work\1491\b\pipelineRepository\Tools\Symbols.targets(508,5): error MSB4018: at Microsoft.DiaSymReader.Tools.PdbConverter.ConvertPortableToWindows(PEReader peReader, MetadataReader pdbReader, Stream targetPdbStream, PdbConversionOptions options) [E:\A\_work\1491\b\pipelineRepository\build.proj] 2017-10-30T13:06:59.0898179Z E:\A\_work\1491\b\pipelineRepository\Tools\Symbols.targets(508,5): error MSB4018: at Microsoft.DiaSymReader.Tools.PdbConverter.ConvertPortableToWindows(PEReader peReader, Stream sourcePdbStream, Stream targetPdbStream, PdbConversionOptions options) [E:\A\_work\1491\b\pipelineRepository\build.proj] 2017-10-30T13:06:59.0898179Z E:\A\_work\1491\b\pipelineRepository\Tools\Symbols.targets(508,5): error MSB4018: at Microsoft.DotNet.Build.Tasks.ConvertPortablePdbsToWindowsPdbs.Execute() [E:\A\_work\1491\b\pipelineRepository\build.proj] 2017-10-30T13:06:59.0898179Z E:\A\_work\1491\b\pipelineRepository\Tools\Symbols.targets(508,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [E:\A\_work\1491\b\pipelineRepository\build.proj] 2017-10-30T13:06:59.0898179Z E:\A\_work\1491\b\pipelineRepository\Tools\Symbols.targets(508,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() [E:\A\_work\1491\b\pipelineRepository\build.proj] 2017-10-30T13:06:59.0898179Z Done executing task ""ConvertPortablePdbsToWindowsPdbs"" -- FAILED. 2017-10-30T13:06:59.0898179Z Done building target ""CreateWindowsPdbsFromPortablePdbs"" in project ""build.proj"" -- FAILED. 2017-10-30T13:06:59.0898179Z Done Building Project ""E:\A\_work\1491\b\pipelineRepository\build.proj"" (CreateWindowsPdbsFromPortablePdbs target(s)) -- FAILED. 2017-10-30T13:06:59.0898179Z ```" 24962 area-System.Runtime Fix UpdateBlobs regression, reenabling ValueTuple tests on Core, add Dictionary<string,string> serialization test case Related https://github.com/dotnet/corefx/pull/24962 The UpdateBlobs method which is manually triggered requires the netfx conditioned test cases to be at the end of the MemberData method. Otherwise it will replace wrong blobs. 24963 area-System.Net File URI cannot be parsed with @ sign The DocumentFormat.OpenXml library uses System.IO.Packaging to open office related documents. A user posted an issue where one of the package relationships uses a legacy URI format that fails to be parsed. This document opens fine in PowerPoint and would like to be able to open it with the .NET library. The URI in question has the form: ``` file:///\\contoso.com@SSL\user\content\path\projects\blank.xlsx ``` 24966 area-System.Data Connections from the pool are not reused when using async methods in parallel "Moved from https://github.com/aspnet/EntityFrameworkCore/issues/10169 reported by @wertzui Whem I'm using async methods (like `FirstOrDefaultAsync`) to get a result from the Database inside a `Parallel.For`, the connections are not correctly reused from the connection pool. The connections will rise to the configured `Max Pool Size` and after some time (around 1-2 minutes on my machine using localdb), exceptions will be thrown. Using either async methods and a normal for-loop or non-async methods an a Parallel.For-loop, the connections are properly reused and I can observe that a normal for-loop uses 1 connection and a Parallel.For-loop uses 4 connections which corresponds to MaxDegreeOfParallelism. ``` Exception message: System.InvalidOperationException occurred HResult=0x80131509 Message=Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached. Stack trace: at System.Data.Common.ADP.ExceptionWithStackTrace(Exception e) at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.<OpenAsync>d__31.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.EntityFrameworkCore.Query.Internal.AsyncQueryingEnumerable.AsyncEnumerator.<BufferlessMoveNext>d__9.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.<ExecuteImplementationAsync>d__33`2.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.<ExecuteImplementationAsync>d__33`2.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.EntityFrameworkCore.Query.Internal.AsyncQueryingEnumerable.AsyncEnumerator.<MoveNext>d__8.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.EntityFrameworkCore.Query.Internal.AsyncLinqOperatorProvider.SelectAsyncEnumerable`2.SelectAsyncEnumerator.<MoveNext>d__4.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.EntityFrameworkCore.Query.Internal.AsyncLinqOperatorProvider.<_FirstOrDefault>d__82`1.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.EntityFrameworkCore.Query.Internal.TaskResultAsyncEnumerable`1.Enumerator.<MoveNext>d__3.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.EntityFrameworkCore.Query.Internal.AsyncLinqOperatorProvider.SelectAsyncEnumerable`2.SelectAsyncEnumerator.<MoveNext>d__4.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.EntityFrameworkCore.Query.Internal.AsyncLinqOperatorProvider.ExceptionInterceptor`1.EnumeratorExceptionInterceptor.<MoveNext>d__5.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() at EfPoolingTest.UnitTest1.<>c.<NormalContextParallel>b__4_0(Int32 i) in C:\Users\xxx\documents\visual studio 2017\Projects\EfPoolingTest\EfPoolingTest\UnitTest1.cs:line 70 at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`1.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion) ``` ### Steps to reproduce - Clone https://github.com/wertzui/EfPoolingTest and open the project - Run the ""ViewConnections.sql"" script to see that there are no connections open (beside the 2 used for the script) - Run the test ""NormalContextParallelAsyncConfigureAwaitFalse"" (I suggest running in Debug mode, so you can see the output) - Run the ""ViewConnections.sql"" script multiple times to see the connections increase. - After some time you will also get an exception - Run the other tests and observe the connection count ### Further technical details EF Core version: 2.0.0 (also tested with 1.1.3) Database Provider: Microsoft.EntityFrameworkCore.SqlServer/localdb Operating system: Windows 10 FCU IDE: Visual Studio 2017 15.4.1 " 24967 area-Infrastructure Add Microsoft.Windows.Compatibility.Shims package and rename compat pack Also fix package versions in compat pack to be 4.5.0-preview-* as some of the new packages have dependencies to the preview versions of the already shipped packages. cc: @weshaggard @danmosemsft @terrajobst 24968 area-Infrastructure init-tools.cmd hangs when running out of disk space After open the cmd file,I just get the following info. Installing dotnet cli... I have checked the log file > Running init-tools.cmd > Installing 'https://dotnetcli.azureedge.net/dotnet/Sdk/2.0.0/dotnet-sdk-2.0.0-win-x64.zip' to 'D:\ChuckLu\Git\GitHub\dotnet\corefx\Tools\dotnetcli\dotnet-sdk-2.0.0-win-x64.zip' > 24969 area-System.Net "Test: System.Net.WebSockets.Client.Tests.CancelTest/ConnectAsync_Cancel_ThrowsWebSocketExceptionWithMessage failed with ""Xunit.Sdk.ThrowsException""" Opened on behalf of @Jiayili1 The test `System.Net.WebSockets.Client.Tests.CancelTest/ConnectAsync_Cancel_ThrowsWebSocketExceptionWithMessage(server: ws://corefx-net.cloudapp.net/WebSocket/EchoWebSocket.ashx)` has failed. Assert.Throws() Failure Expected: typeof(System.Net.WebSockets.WebSocketException) Actual: (No exception was thrown) Stack Trace: --- End of stack trace from previous location where exception was thrown --- at System.Net.WebSockets.Client.Tests.CancelTest.<ConnectAsync_Cancel_ThrowsWebSocketExceptionWithMessage>d__1.MoveNext() in /Users/buildagent/agent/_work/30/s/corefx/src/System.Net.WebSockets.Client/tests/CancelTest.cs:line 28 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- Build : Master - 20171031.01 (Core Tests) Failing configurations: - OSX.1012.Amd64-x64 - Release - RedHat.69.Amd64-x64 - Release - fedora.25.amd64-x64 - Release - Fedora.26.Amd64-x64 - Release - Ubuntu.1710.Amd64-x64 - Release - SLES.12.Amd64-x64 - Release - suse.422.amd64-x64 - Release - Ubuntu.1704.Amd64-x64 - Release - Ubuntu.1604.Amd64-x64 - Release - Debian.87.Amd64-x64 - Release - Debian.90.Amd64-x64 - Release - RedHat.73.Amd64-x64 - Release - RedHat.72.Amd64-x64 - Release - Ubuntu.1404.Amd64-x64 - Release - Centos.73.Amd64-x64 - Release Detail: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171031.01/workItem/System.Net.WebSockets.Client.Tests/analysis/xunit/System.Net.WebSockets.Client.Tests.CancelTest~2FConnectAsync_Cancel_ThrowsWebSocketExceptionWithMessage(server:%20ws:~2F~2Fcorefx-net.cloudapp.net~2FWebSocket~2FEchoWebSocket.ashx) 24970 area-Meta StackExchange.Redis.StrongName, Version=1.2.4.0 The type 'ConnectionMultiplexer' exists in both 'StackExchange.Redis.StrongName, Version=1.2.4.0, Culture=neutral, PublicKeyToken=c219ff1ca8c2ce46' and 'StackExchange.Redis, Version=1.2.6.0, Culture=neutral, PublicKeyToken=null' Hunter.Authorization.ApiCommandServer  24977 area-System.Security Add asynchronous overload of WindowsIdentity.RunImpersonated https://github.com/dotnet/corefx/issues/9996#issuecomment-307870746 https://github.com/aspnet/Home/issues/1805#issuecomment-339442334 ASP.NET Core is getting many requests for users that want to impersonate the authenticated user of the request and perform actions on their behalf. The main problem is that many of these actions are asynchronous, such as database access, but RunImpersonated is synchronous. Users have repeatedly made the mistake of starting an asynchronous operation within RunImpersonated and then returning the Task. Exiting RunImpersonated revokes the impersonation and can cause errors or reverting to the base identity in the Task. Proposal: `public static Task RunImpersonatedAsync(SafeAccessTokenHandle safeAccessTokenHandle, Func<Task> func)` `public static Task<T> RunImpersonatedAsync<T>(SafeAccessTokenHandle safeAccessTokenHandle, Func<Task<T>> func)` @brentschmaltz 24978 area-Infrastructure We should point to the release/2.0.0 version of standard We are not planning to ship a new stable version of the NETStandard.Library package in the 2.1 timeframe so we need to stick with what is currently shipping from the release/2.0.0 branch in standard repo. 24980 area-System.Memory Add Overlaps extension method to SpanExtensions Resolves #24103 API Review: https://github.com/dotnet/corefx/issues/24103#issuecomment-340856211 Previous PR with some details on the implementation: https://github.com/dotnet/corefx/pull/18731#issuecomment-296856781 24984 area-System.ComponentModel CultureInfoConverter added * Culture Converter added * space formatting * Expected and actual argument reordered * Removed to string * Reference Converter and its test added * fixing reference Converter * Skipping test on framework * CultureInfo added with others * Removed Reference Connverter Porting PR #24855 from master to release/2.0.0 branch Fixes #24755 Related: https://github.com/JamesNK/Newtonsoft.Json/issues/1457 24985 area-System.Memory Operations on default(Memory<T>) throw argument null exceptions e.g. ```C# private Memory<byte> _buffer; ... _buffer.TryGetArray(out ArraySegment<byte> s); ``` throws an `ArgumentNullException`, due to the implementation passing `null` to `ArraySegment`'s ctor. How do I know whether I can use `_buffer` or not? Should `TryGetArray` in this case return `false`? What about accessing `_buffer.Span`... it similarly throws, but should it just return an empty span? Or do we need a new property on it that tells me whether it's valid for use with various methods? I can do `_buffer.Equals(default)`, but that adds multiple unnecessary checks. cc: @ahsonkhan, @KrzysztofCwalina, @terrajobst 24986 area-System.Memory UTF8Parser parsing integers with 'N' format not implemented. Left-over debt from productizing Utf8Parser. Some questions need to be resolved (be compatible with .NET or actually insist that you know, commas appear only every third digit?) This affects at least 8 overloads (U/Int8/16/32/64). 24987 area-System.Memory UTF8Parser parsing TimeSpan not implemented. Left over debt from productizing Utf8Parser. Left undone for time reasons. 24990 area-System.Net TcpClient bug in branch release/1.1.0 (Unix) https://github.com/dotnet/corefx/blob/release/1.1.0/src/System.Net.Sockets/src/System/Net/Sockets/TCPClient.Unix.cs and https://github.com/dotnet/corefx/blob/release/1.1.0/src/System.Net.Sockets/src/System/Net/Sockets/TCPClient.cs ConnectAsync(string, int) will call ConnectAsyncCore(host, port); ConnectAsync(IPAddress[], int) will call ConnectAsyncCore(IPAddress[], int); ConnectAsync(IPAddress, int) will call BeginConnect In ConnectAsyncCore(host, port) and ConnectAsyncCore(IPAddress[], int) will do this if (_clientSocket != null) { throw new PlatformNotSupportedException(SR.net_sockets_connect_multiaddress_notsupported); } TcpClient.Client will call TcpClient.ClientCore TcpClient.ClientCore will set _clientSocket; So once we call TcpClient.Client, _clientSocket is not null, then ConnectAsyncCore(host, port) and ConnectAsyncCore(IPAddress[], int) will throw a wrong PlatformNotSupportedException 24994 area-System.IO Multi-server System.IO.Pipes tests hanging on OSX 24996 area-System.Security Remove dead code from System.Security.Cryptography.Cng PR addresses issue #17905, project **System.Security.Cryptography.Cng**. 24997 area-Meta Mark applicable structs as readonly Fixes #24900 Related to https://github.com/dotnet/coreclr/pull/14789 Related to https://github.com/dotnet/corert/pull/4855 cc: @jkotas, @jaredpar, @VSadov, @tmat for System.Reflection.Metadata (which has the bulk of the changes) 24998 area-System.Reflection Enhance System.Type.FullName to return non-null for open generic types. "Consider ```csharp class Foo<A,B> { } class H<T> { } class Bar<X> : Foo<Int, H<X>> { } ``` Currently `typeof (Bar<>).BaseType.FullName` returns `null`, as documented here https://docs.microsoft.com/en-us/dotnet/api/system.type.fullname?view=netcore-2.0#System_Type_FullName): > The fully qualified name of the type, including its namespace but not its assembly; or null if the current instance represents a generic type parameter, an array type, pointer type, or byref type based on a type parameter, or a generic type that is not a generic type definition but contains unresolved type parameters. I propose that instead `Type.FullName` is changed on .NET Core, .NET Framework and Xamarin to return a sensible string representation of open generic types. For the example above, for example, a reasonable result may be: `""Foo<Int, H<X>>""` " 25000 area-System.Security Remove dead code from System.Security.Cryptography.Csp. PR addresses issue #17905, project **System.Security.Cryptography.Csp**. 25002 area-Infrastructure How to build CoreFX for x86 Linux Hallo there im looking for a guide or a way to build the CoreFX project for an x86 Linux based Project. I have already sucessfully build coreclr for x86 following these [CoreCLR build guide](https://github.com/dotnet/coreclr/issues/13192#issuecomment-320188913). Now i need something like that for CoreFX, Im thankful for help. Greetings from Germany Philipp [EDIT] Fix link by @karelz 25003 area-System.Net Clean UdpReceiveResult - Deleted unnecesary check in GetHashCode() - Deleted unnecesary variables - Added Docs 25005 area-Meta System.Json bugs and perf issues "We're using `System.Json` quite extensively and have run into a couple of issues. Some looks like design (inconsistency) issues, some may be code bugs. 1. **Possible design bug**: Inconsistent handling of `null` array members: This works as expected: ```C# var a = new JsonArray(new JsonValue[] { ""abc"", 123, null }); // Note 3rd item is null ``` This alternative pattern `throws` inside `Add` due to an explicit `null` guard: ```C# var b = new JsonArray(new JsonValue[] { ""abc"", 123 }); b.Add(null); // ArgumentNullException ``` I see that the units support this behavior, but it seems to be an inconsistent design. Adding a `null` member to an array should be acceptable? 2. **Possible code bug**: `JsonType` derivation on `JsonPrimitive` seems faulty: ```C# var p = new JsonPrimitive(Guid.NewGuid()); // Guid var t = p.JsonType; // Expected: JsonType.String. Actual: JsonType.Number ``` (The nested conditionals here may be iffy: [JsonPrimitive.cs](https://github.com/dotnet/corefx/blob/master/src/System.Json/src/System/Json/JsonPrimitive.cs#L118-L120)) This case does not seem to be covered by any units. ```C# public override JsonType JsonType => _value == null || _value.GetType() == typeof(char) || _value.GetType() == typeof(string) || _value.GetType() == typeof(DateTime) || _value.GetType() == typeof(object) ? JsonType.String // DateTimeOffset || Guid || TimeSpan || Uri // <========= : _value.GetType() == typeof(bool) ? JsonType.Boolean : JsonType.Number; ``` 3. **Possible design bug**: `JsonPrimitive.ToString()` throws for some primitives. The following throws; I would expect to return the `Guid` in `string` form. Note that this is _not_ one of the expected errors that are explicitly `thrown` for some types (see notes on stack trace). I see that the units support this behavior, but it seems to be an inconsistent design. ```C# var p = new JsonPrimitive(Guid.NewGuid()); var t = p.JsonType; var s = p.ToString(); // FormatException // Note that GetFormattedString explicitly throws for some types // But that's not happening here, since it's making it all the way to Guid.ToString() System.FormatException Message=Format String can be only ""D"", ""d"", ""N"", ""n"", ""P"", ""p"", ""B"", ""b"", ""X"" or ""x"". Source=System.Private.CoreLib StackTrace: at System.Guid.ToString(String format, IFormatProvider provider) at System.Json.JsonPrimitive.GetFormattedString() at System.Json.JsonValue.SaveInternal(TextWriter w) at System.Json.JsonValue.ToString() ``` 4. **Perf: Equals is Expensive**: The straight-forward way to compare two `JsonValue` instances is to `ToString()` them both and then use a `StringComparer.Ordinal` comparer. But this is unnecessarily expensive considering the number of `string` allocs that need to happen internally while walking the tree. A better way would be to walk the tree regardless, but compare each individual `JsonObject`, `JsonArray` and `JsonPrimitive`. Something similar to this: [JsonValueComparer.cs](https://github.com/k2workflow/Clay/blob/master/src/SourceCode.Clay.Json/JsonValueComparer.cs) [Benchmark](https://github.com/k2workflow/Clay/blob/master/src/SourceCode.Clay.Json.Bench/JsonEqualsBench.cs) (**2x improvement in both time & memory**) ```C# Method | Mean | Error | StdDev | Scaled | ScaledSD | Gen 0 | Gen 1 | Gen 2 | Allocated | ---------------- |----------:|----------:|----------:|-------:|---------:|---------:|---------:|--------:|----------:| ToStringEquals | 13.998 ms | 0.2782 ms | 0.5807 ms | 1.00 | 0.00 | 809.3750 | 434.3750 | 90.6250 | 6267600 B | NewtonDeepEquals | 2.729 ms | 0.0514 ms | 0.0456 ms | 0.20 | 0.01 | - | - | - | 0 B | SmartEquals | 6.817 ms | 0.1334 ms | 0.1638 ms | 0.49 | 0.02 | 789.0625 | - | - | 3323776 B | ``` 5. **Perf: Clone is Expensive**: Similar reasoning to the previous bullet: `ToString` works but is expensive due to allocations on the way out and redundant parsing on the way back in. Here's an alternative approach that walks the tree and clones each node explicitly: [JsonClone.cs](https://github.com/k2workflow/Clay/blob/master/src/SourceCode.Clay.Json/JsonExtensions.cs#L304-L430) (Unfortunately even it isn't as memory-efficient as it could be, since `SortedDictionary` does not expose an `initialCapacity` parameter in order to pre-allocate an exact-sized map.) [Benchmark](https://github.com/k2workflow/Clay/blob/master/src/SourceCode.Clay.Json.Bench/JsonCloneBench.cs) (**2-3x improvement in both time & memory**) ``` Method | Mean | Error | StdDev | Scaled | ScaledSD | Gen 0 | Gen 1 | Gen 2 | Allocated | --------------- |---------:|----------:|----------:|-------:|---------:|----------:|---------:|--------:|----------:| ToStringClone | 29.21 ms | 0.5792 ms | 0.5948 ms | 1.00 | 0.00 | 1562.5000 | 812.5000 | 62.5000 | 9.92 MB | NewtonDeepClone | 19.16 ms | 0.3727 ms | 0.5101 ms | 0.66 | 0.02 | 1218.7500 | 562.5000 | 62.5000 | 7.02 MB | SmartClone | 10.14 ms | 0.1964 ms | 0.4311 ms | 0.35 | 0.02 | 671.8750 | 312.5000 | - | 3.94 MB | ``` " 25006 area-Infrastructure Update build definitions cc @karajas @dagood @mmitche 25008 area-System.IO Should Directory.GetDirectories (and related methods) take a StringComparison overload? This matters less on Windows, but it's more significant on platforms where case-sensitive filesystems are more common. 25009 area-System.Memory Add null checks in Memory<T> APIs to support default Fixes https://github.com/dotnet/corefx/issues/24985 Related PR: https://github.com/dotnet/coreclr/pull/14816 Also, applying the optimization from https://github.com/dotnet/coreclr/pull/14309 cc: @stephentoub, @KrzysztofCwalina 25010 area-System.Net Fix a few WebSocketHandle.Managed issues - At least until socket send/receives respect cancellation, we need to poll for cancellation after the handler's SendAsync completes. - We're unnecessarily allocating another CTS if no external cancellation was provided. - We're not disposing of the response object in the case of an error after SendAsync completes. Fixes https://github.com/dotnet/corefx/issues/24969 25011 area-System.Collections [API] Array and List have BinarySearch, but SortedList does not. This seems illogical. Binary search should be performed on an ordered list of items. Thus it's a natural operation for SortedList and not so natural for Array or List as they may be non-ordered causing BinarySearch to return incorrect answer. BCL should either add BinarySearch to SortedList or better yet make am extension method for IList<T>. 25012 area-Infrastructure Facades, PermissionSets and RedistList are missing from Microsoft.TargetingPack.NETFramework.* nuget packages. I really don't know if these packages are still in use but I cannot find any other nuget packages closer to the .NET Framework developer packs than these. My use-case is to build CPS projects targeting net* TFMs on a Windows machine without Visual Studio and on \*NIX systems without mono. Referencing a single nuget with an assistance of `<FrameworkPathOverride>` makes this a simple task. As far as I know these missing directories are required for dotnet to build projects targeting net\* TFMs and to run tests for them. Is there any chance to get the packages updated or is there any other approach that should be taken for my use-case? I already know that [aspnet/BuildTools](https://github.com/aspnet/BuildTools) is using https://aspnetcore.blob.core.windows.net/buildtools/netfx/4.6.1/netfx.4.6.1.tar.gz But I found no out-of-the-box way of unpacking tar.gz files on Windows. In addition this archive contains targeting packs for all previous version of .NET Framework. 25013 area-System.Numerics HashCode based on xxHash32 "Fixes #14354 ## Description Works by maintaining the xxHash32 state variables (v1 -> v4, length) as well as a queue of values that fall outside of the block size (16 bytes/4 ints). Seed is assumed to be zero as there is no ctor in the proposal - however, it is possible to add a seed without changing the structure. It's possible to do this without `unsafe`, but the code is much more messy. This can be changed if adding `AllowUnsafeBlocks` to System.Runtime is a problem. Tests against known xxHash32 vectors are provided. The hashes were calculated by providing chunks from `""abcd0123efgh4567ijkl8901mnop2345qrst6789uvwx0123yzab""` (increasing in length 4) to [this site](https://asecuritysite.com/encryption/xxHash). The integers are hard-coded in the tests because System.Text.Encoding.ASCII is not available. ## [Performance](https://github.com/jcdickinson/Benchmarks/tree/corefx-hashcode) ``` ini BenchmarkDotNet=v0.10.9, OS=Windows 10 Redstone 2 (10.0.15063) Processor=Intel Core i7-4800MQ CPU 2.70GHz (Haswell), ProcessorCount=8 Frequency=2630627 Hz, Resolution=380.1375 ns, Timer=TSC .NET Core SDK=2.0.2 [Host] : .NET Core 2.0.0 (Framework 4.6.00001.0), 64bit RyuJIT DefaultJob : .NET Core 2.0.0 (Framework 4.6.00001.0), 64bit RyuJIT ``` | Method | Mean | Error | StdDev | Scaled | |------------------------ |---------:|----------:|----------:|-------:| | Unsafe | 79.98 ns | 1.4723 ns | 1.3772 ns | 1.00 | | 'Calls, No Inlining' | 40.34 ns | 0.1778 ns | 0.1576 ns | 0.50 | | 'Unrolled, No Inlining' | 12.19 ns | 0.0433 ns | 0.0384 ns | 0.15 | | 'Calls, Inlining' | 34.55 ns | 0.1372 ns | 0.1216 ns | 0.43 | | 'Unrolled, Inlining' | 12.22 ns | 0.0885 ns | 0.0785 ns | 0.15 | ### Updates [(staged)](https://github.com/jcdickinson/corefx/tree/feature-system-hashcode-staged) The test vectors are now normally disabled due to the per-AppDomain seed randomization, define `SYSTEM_HASHCODE_TESTVECTORS` to enable them (which will disable the seed randomization, setting it to 0). NB: this has been excluded from netfx builds in the tests csproj. ## Deviations from xxHash32 * Length is stored as the number of hashed fields (not bytes). It is multiplied at the end by 4 so that it behaves exactly like xxHash32. * Due to the lazy state initialization (a necessity because HashCode is a struct), it is possible that the structure will re-initialize at field 4,294,967,300 (and multiples thereof) only if the xxHash32 state variables are somehow all zero. This could be deferred by changing the length field to a `ulong` (but would make the struct larger than a cache line). 4,294,967,300 fields ought to be enough for anyone; you have bigger problems if you are creating hash codes based on that much data (15GB). * The code that mixes in individual bytes is omitted - this struct only accepts `int`. I'll be online in a few hours for feedback and to sign the CLA. ## 3rd Party Code Submission containing materials of a third party: | Author | Project | License | Comments | |------- |--------:|--------:|---------:| | Cyan4973 | [xxHash](https://github.com/Cyan4973/xxHash) | MIT | Reference, not copied code | cc: @stephentoub, @KrzysztofCwalina " 25014 area-System.Security Fix incorrect HAVE_OPENSSL_ALPN testing This define is incorrectly tested using #ifdef instead of #if, so build on e.g. Ubuntu 14.04 where this symbol is set to zero fails. 25015 area-Serialization Area-Serialization Sprint 126 The issue is for tracking issues to be done in sprint 126 (due by 11/10/2017) 25016 area-System.Net Stopping HttpListener doesn't free up address in use for some time on macOS (System.Net.HttpListenerException: Address already in use) "I'm receiving the following error: ``` Unhandled Exception: System.Net.HttpListenerException: Address already in use at System.Net.HttpEndPointManager.GetEPListener(String host, Int32 port, HttpListener listener, Boolean secure) at System.Net.HttpEndPointManager.AddPrefixInternal(String p, HttpListener listener) at System.Net.HttpEndPointManager.AddListener(HttpListener listener) at System.Net.HttpListener.Start() at TestHttpListener.TestHttpListener.<SimpleListenerExample>d__3.MoveNext() in /Users/tylerleonhardt/Desktop/CompSci/DotNET/Core/TestHttpListener/TestHttpListener.cs:line 29 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at TestHttpListener.TestHttpListener.<>c__DisplayClass1_0.<<Start>b__0>d.MoveNext() in /Users/tylerleonhardt/Desktop/CompSci/DotNET/Core/TestHttpListener/TestHttpListener.cs:line 13 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadPoolWorkQueue.Dispatch() ``` I am writing an http server using HttpListener (I need to use HttpListener) and I run into this exception after starting and stoping and starting the server. Here is my (watered down) library: ```c# using System; using System.Net; using System.Threading; using System.Threading.Tasks; namespace TestHttpListener { public class TestHttpListener { public bool KeepGoing = true; public void Start(int Port) { Thread listenerThread = new Thread(async () => { await SimpleListenerExample(Port); }); listenerThread.Start(); } public void Stop() { KeepGoing = false; } public async Task SimpleListenerExample(int Port) { // Create a listener. HttpListener listener = new HttpListener(); // Add the prefixes. listener.Prefixes.Add(""http://localhost:"" + Port + ""/""); listener.Start(); Console.WriteLine(""Listening...""); while (KeepGoing) { // Note: The GetContext method blocks while waiting for a request. HttpListenerContext context = await listener.GetContextAsync(); HttpListenerRequest request = context.Request; // Obtain a response object. HttpListenerResponse response = context.Response; // Construct a response. string responseString = ""<HTML><BODY> Hello world!</BODY></HTML>""; byte[] buffer = System.Text.Encoding.UTF8.GetBytes(responseString); // Get a response stream and write the response to it. response.ContentLength64 = buffer.Length; System.IO.Stream output = response.OutputStream; output.Write(buffer,0,buffer.Length); // You must close the output stream. output.Close(); } listener.Stop(); } } } ``` I've also tried this with `listener.Close()` And the file I'm using to verify this behavior is: ```c# using System; using System.Net.Http; using System.Threading.Tasks; namespace TestHttpListener { class Program { private static readonly HttpClient client = new HttpClient(); static void Main(string[] args) { Run().Wait(); } static async Task Run() { var app = new TestHttpListener(); app.Start(8081); await Task.Delay(TimeSpan.FromSeconds(2)); var response = await client.GetAsync(""http://localhost:8081""); app.Stop(); // need second GetAsync becuase HttpListener GetContextAsync does not take a cancellation token response = await client.GetAsync(""http://localhost:8081""); await Task.Delay(TimeSpan.FromSeconds(2)); app.Start(8081); Console.ReadLine(); } } } ``` I noticed there was [this issue](https://github.com/dotnet/corefx/issues/24562) with ""Address already in use"" issues but it seemed unrelated to HttpListener class so I opened this. This is using the .NET Command Line Tools - 2.0.0 macOS - v10.12.6 (16G29) aka Sierra Please let me know if there's any additional info I can provide." 25018 area-Meta System.Json: JsonArray does not handle null consistently "Inconsistent handling of `null` array members: This works as expected: ```C# var a = new JsonArray(new JsonValue[] { ""abc"", 123, null }); // Note 3rd item is null ``` This alternative pattern `throws` inside `Add` due to an explicit `null` guard: ```C# var b = new JsonArray(new JsonValue[] { ""abc"", 123 }); b.Add(null); // ArgumentNullException new JsonArray().Add(null); // Minimum repro ``` I see that the units support this behavior, but it seems to be an inconsistent design. Adding a `null` member to an array should be acceptable? _See original issue summary [here](https://github.com/dotnet/corefx/issues/25005), @karelz suggested I submit separately_ " 25019 area-Meta System.Json: JsonPrimitive.JsonType returns incorrect value `JsonType` derivation on `JsonPrimitive` seems faulty: ```C# var p = new JsonPrimitive(Guid.NewGuid()); // Guid var t = p.JsonType; // Expected: JsonType.String. Actual: JsonType.Number ``` I am fairly certain that `Guid` should not return `JsonType == Number` This case does not appear to be covered by any units, so it may be that the issue was never picked up. The nested conditionals here may be iffy: [JsonPrimitive.cs](https://github.com/dotnet/corefx/blob/master/src/System.Json/src/System/Json/JsonPrimitive.cs#L118-L120)) ```C# public override JsonType JsonType => _value == null || _value.GetType() == typeof(char) || _value.GetType() == typeof(string) || _value.GetType() == typeof(DateTime) || _value.GetType() == typeof(object) ? JsonType.String // DateTimeOffset || Guid || TimeSpan || Uri // <========= : _value.GetType() == typeof(bool) ? JsonType.Boolean : JsonType.Number; ``` _See original issue summary [here](https://github.com/dotnet/corefx/issues/25005), @karelz suggested I submit separately_ 25020 area-Meta System.Json: JsonPrimitive.ToString() throws unexpectedly "The following throws; I would expect to return the `Guid` in `string` form. Note that this is _not_ one of the expected errors that are explicitly `thrown` for some types (see notes on stack trace). I see that the units support this behavior, but it seems to be an inconsistent design. ```C# var p = new JsonPrimitive(Guid.NewGuid()); var t = p.JsonType; var s = p.ToString(); // FormatException // Note that GetFormattedString explicitly throws for some types // But that's not happening here, since it's making it all the way to Guid.ToString() System.FormatException Message=Format String can be only ""D"", ""d"", ""N"", ""n"", ""P"", ""p"", ""B"", ""b"", ""X"" or ""x"". Source=System.Private.CoreLib StackTrace: at System.Guid.ToString(String format, IFormatProvider provider) at System.Json.JsonPrimitive.GetFormattedString() at System.Json.JsonValue.SaveInternal(TextWriter w) at System.Json.JsonValue.ToString() ``` _See original issue summary [here](https://github.com/dotnet/corefx/issues/25005), @karelz suggested I submit separately_" 25021 area-Meta System.Json: JsonValue.Equals() is expensive "Comparing two `JsonValue` instances for equality is a common operation. The current idiom is expensive compared to the alternatives. The provided prototype shows a micro-bench result of **2-3x** improvement. # Rationale and Usage The straight-forward way to compare two `JsonValue` instances is to `ToString()` them both and then use a `StringComparer.Ordinal` comparer. But this is unnecessarily expensive considering the number of internal `string` allocs that need to happen internally while walking the tree. ```C# var json1 = new JsonObject(...); var json2 = new JsonObject(...); // Current idiom for equality var str1 = json1.ToString(); // Many internal string allocs var str2 = json2.ToString(); var equal = StringComparer.Ordinal.Equals(str1, str2); // Proposed method var equal = JsonValueComparer.Strict.Equals(json1, json2); ``` An alternatively approach is to migrate to `Newtonsoft.Linq.JValue` which has similar semantics and performs adequately. # Proposed API ```C# public abstract class JsonValueComparer : IEqualityComparer<JsonValue> { /// <summary> /// Gets a <see cref=""JsonValueComparer""/> that compares all fields of a <see cref=""JsonValue""/> /// value in a strict manner (ordinal string comparisons, deterministic ordering of members). /// </summary> public static JsonValueComparer Strict { get; } = new JsonStrictComparer(); protected JsonValueComparer() { } /// <summary> /// Determines whether the specified objects are equal. /// </summary> /// <param name=""x"">The first object to compare.</param> /// <param name=""y"">The second object to compare.</param> /// <returns> /// true if the specified objects are equal; otherwise, false. /// </returns> public abstract bool Equals(JsonValue x, JsonValue y); /// <summary> /// Returns a hash code for this instance. /// </summary> /// <param name=""obj"">The object.</param> /// <returns> /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. /// </returns> public abstract int GetHashCode(JsonValue obj); private sealed class JsonStrictComparer : JsonValueComparer {...} } ``` # Details A less expensive way would be to walk the internal tree and directly compare each individual member directly, without converting to a `string`. Ideally this requires the introduction of a new `JsonValueComparer` class, similar to this prototype: [JsonValueComparer.cs](https://github.com/k2workflow/Clay/blob/master/src/SourceCode.Clay.Json/JsonValueComparer.cs) We'd need to decide on comparison semantics. For example the `Strict` comparer enforces ordinal string rules and co-located members. Perhaps there are other comparers. # Open Questions * Since `JsonValue` is `abstract`, end users may have inherited from it. Not sure how to handle equality in those cases, perhaps just using a traditional `object.Equals` check as the final fallback? * Do we need other comparers that (say) allow different orderings of members. # Pull Request I am happy to PR myself, given a finalized design. # Benchmarks _Per recommendation from @danmosemsft, included `Newtonsoft` in benchmark_ [Benchmark](https://github.com/k2workflow/Clay/blob/master/src/SourceCode.Clay.Json.Bench/JsonEqualsBench.cs) (**2-3x improvement in both time & memory**) ```C# Method | Mean | Error | StdDev | Scaled | Gen 0 | Gen 1 | Gen 2 | Allocated | ----------------- |----------:|----------:|----------:|-------:|---------:|---------:|--------:|----------:| ToStringEquals | 13.818 ms | 0.3012 ms | 0.3347 ms | 1.00 | 808.4677 | 435.9879 | 89.7177 | 6267582 B | NewtonDeepEquals | 3.028 ms | 0.0657 ms | 0.1854 ms | 0.22 | - | - | - | 0 B | JsonEquals | 5.940 ms | 0.1109 ms | 0.1187 ms | 0.43 | 531.2500 | - | - | 2258560 B | ``` _[See original issue summary [here](https://github.com/dotnet/corefx/issues/25005), @karelz suggested I submit separately]_" 25022 area-Meta System.Json: Clone() is expensive Cloning a `JsonValue` instance is expensive compared to the alternatives. Add new `Clone` method to `JsonValue` that operates efficiently in terms of memory/GC. The provided prototype shows a micro-bench result of **2-3x** improvement. # Rationale and Usage There is no existing `Clone` method on `JsonValue`, but it's not an uncommon operation. The workaround is to roundtrip the value via `ToString` and `Parse`. But this is unnecessarily expensive considering the number of `string` allocs that need to happen on the way out and expensive, redundant parsing on the way back in. ```C# var json = new JsonObject(...); // Current idiom for cloning var str = JsonValue.ToString(); // Lots of string allocs var clone = (JsonObject)JsonValue.Parse(str); // Wasteful parsing // Proposed method var clone = (JsonObject)json.Clone(); ``` An alternatively approach is to migrate to `Newtonsoft.Linq.JValue` which has similar semantics, and though it's heavier in terms of memory (and api surface) it performs adequately. # Proposed API ```C# public class JsonValue : ICloneable // See open questions { // Existing interface unchanged // New method public JsonValue Clone(this JsonValue json) { ... } } ``` # Details This requires the introduction of a new `Clone` method on `JsonValue`, similar to this prototype: [JsonClone.cs](https://github.com/k2workflow/Clay/blob/master/src/SourceCode.Clay.Json/JsonExtensions.cs#L306-L444). This code walks the internal tree and clones each node explicitly. (Unfortunately even it isn't as memory-efficient as it could be, since the `internal SortedDictionary` does not expose an `initialCapacity` parameter in order to pre-allocate an exact-sized map.) # Open Questions * Should we implement `Clone` directly or utilize `ICloneable.Clone`. If the former, the return type would be polymorphic over `JsonValue` which means it's more strongly-typed than the latter, which would of course return `object`. * Since JsonValue is abstract, end users may have inherited from it. Not sure how to handle equality in those cases, perhaps just using a traditional object.Equals check as the final fallback? # Pull Request I am happy to PR myself, given the go-ahead. # Benchmarks _Per recommendation from @danmosemsft, included `Newtonsoft` in benchmark_ [Benchmark](https://github.com/k2workflow/Clay/blob/master/src/SourceCode.Clay.Json.Bench/JsonCloneBench.cs) (**2-3x improvement in both time & memory**) ``` Method | Mean | Error | StdDev | Scaled | ScaledSD | Gen 0 | Gen 1 | Gen 2 | Allocated | --------------- |---------:|----------:|----------:|-------:|---------:|----------:|---------:|--------:|----------:| ToStringClone | 29.21 ms | 0.5792 ms | 0.5948 ms | 1.00 | 0.00 | 1562.5000 | 812.5000 | 62.5000 | 9.92 MB | NewtonDeepClone | 19.16 ms | 0.3727 ms | 0.5101 ms | 0.66 | 0.02 | 1218.7500 | 562.5000 | 62.5000 | 7.02 MB | SmartClone | 10.14 ms | 0.1964 ms | 0.4311 ms | 0.35 | 0.02 | 671.8750 | 312.5000 | - | 3.94 MB | ``` 25023 area-System.Collections System.Collections: Dictionary.Empty<K, V>() "Concrete implementations of `IDictionary<K, V>` and `IReadOnlyDictionary<K, V>` do not provide `Empty` singletons, per those for `Array.Empty` and `Enumerable.Empty`. This proposal would permit the same idiom to be available for `Dictionary`. # Rationale and Usage This is a nice-to-have, but helps in environments where resources are constrained. The current idiom is to create a `new Dictionary<K, V>(0)` but that incurs not-insignificant private state, and the semantics of 'immutably empty' are different to those for 'empty but not populated yet'. There are several data structures that build up maps of maps, for example `System.Json`. In scenarios where datasets are large, the cost and semantics of `pseudo-empty` add up. For scenarios where we have lists instead of maps, we already use `Array.Empty<T>` or `Enumerable.Empty<T>`. It would be consistent to provide the same facility for maps. ```C# var empty = Dictionary.Empty<string, Foo>(); empty.Count; // 0 empty.IsReadOnly; // true empty[""hi""]; // KeyNotFound or InvalidOperation (?) empty.Add(...); // InvalidOperation Keys; // Array.Empty<K> ``` # Proposed API ```C# public static class Dictionary // See open questions { /// <summary> /// Returns an empty dictionary that is immutable. /// </summary> /// <typeparam name=""TKey"">The type of keys in the dictionary.</typeparam> /// <typeparam name=""TValue"">The type of values in the dictionary.</typeparam> /// <returns>Returns an empty <see cref=""IDictionary{TKey, TValue}"".</returns> public static IDictionary<TKey, TValue> Empty<TKey, TValue>() => <singleton impl>; } public static class ReadOnlyDictionary { /// <summary> /// Returns an empty dictionary that is immutable. /// </summary> /// <typeparam name=""TKey"">The type of keys in the dictionary.</typeparam> /// <typeparam name=""TValue"">The type of values in the dictionary.</typeparam> /// <returns>Returns an empty <see cref=""IReadOnlyDictionary{TKey, TValue}"".</returns> public static IReadOnlyDictionary<TKey, TValue> ReadOnlyEmpty<TKey, TValue>() => <singleton impl>; } ``` # Details The singletons would return sensible defaults where possible for getters, though indexers would need to throw. Since `IsReadOnly==true`, mutators should throw too. All errors should align with those used when a traditional `Dictionary` has 'IsReadOnly=true`. # Open Questions * I am not sure what namespace & class name to use, since the chance of conflict (in user code) is high if we used `public static class Dictionary` to host the `Empty` singleton. Ditto for `ReadOnlyDictionary`. * I initially thought that the immutable nature of `Dictionary.Empty` might surprise or confuse users, but if we set `IsReadOnly=true` then it should cause less friction. `ReadOnlyDictionary.Empty` is already expected to be immutable, so it should not have the same problem. * Not sure exactly what errors to throw in the indexers and mutators. See previous bullet. Prototype comprises 3 classes; [ReadOnlyDictionary class](https://github.com/k2workflow/Clay/blob/master/src/SourceCode.Clay.Collections/Generic/ReadOnlyDictionary.cs), [Dictionary class](https://github.com/k2workflow/Clay/blob/master/src/SourceCode.Clay.Collections/Generic/Dictionary.cs) and [Singleton implementation](https://github.com/k2workflow/Clay/blob/master/src/SourceCode.Clay.Collections/Generic/EmptyDictionaryImpl.cs). # Pull Request I am happy to contribute the PR, when/if we gain consensus # Updates Happy to PR, but would especially need guidance on namespace, naming, decision on immutability. " 25024 area-System.Memory System.Memory doesn't work on UWP "Create a new blank UWP app. Ensure you set Target version and Min Version to ""Windows 10 Fall Creators Update (10.0; Build 16299)"" Add System.Memory Version=""4.5.0-preview1-25831-01"" nuget package. Write some code ``` Span<int> foo = new int[5]; ``` Build. This doesn't compile, saying there is no ""Span"" type. Now add a reference to the latest UWP package: ``` <PackageReference Include=""Microsoft.NETCore.UniversalWindowsPlatform""> <Version>6.1.0-preview1-25902-01</Version> </PackageReference> ``` which has the ref type for Span. Build. You get an error: ``` Payload contains two or more files with the same destination path 'System.Memory.dll'. Source files: C:\Users\eerhardt\.nuget\packages\runtime.win10-x64.microsoft.netcore.universalwindowsplatform\6.1.0-preview1-25902-01\runtimes\win10-x64\lib\uap10.0.15138\System.Memory.dllC:\Users\eerhardt\.nuget\packages\system.memory\4.5.0-preview1-25831-01\runtimes\win\lib\uap10.0.15138\System.Memory.dll ``` /cc @ahsonkhan @KrzysztofCwalina " 25025 area-System.Net Networking - SocketsHttpHandler Epic 25026 area-System.Threading [suggestion] add api to read/write multiple values from System.Threading.Channels right now im using buffered channel and the overhead of locking is currently limiting throughput. i limit the buffer to 10000 items and most of the time the buffer is full so i i guess i could read more than one item at a time to improve. 25027 area-System.Xml Some Xml tests projects do not run tests with /t:BuildAndTest "Issue found here: https://github.com/dotnet/corefx/issues/16646#issuecomment-341535914 I have confirmed this on my box and found that the issue is that many tests folders are missing Configuration.props cc: @WinCPP I'll send PR with the fix shortly. @WinCPP to unblock yourself you can add Configuration.props next to the csproj with content ``` <?xml version=""1.0"" encoding=""utf-8""?> <Project ToolsVersion=""14.0"" DefaultTargets=""Build"" xmlns=""http://schemas.microsoft.com/developer/msbuild/2003""> <PropertyGroup> <BuildConfigurations> netstandard; </BuildConfigurations> </PropertyGroup> </Project> ```" 25029 area-System.Diagnostics System.Diagnostics.Tracing.Tests: BasicEventSourceTests.TestEventCounter: Test_Write_Metric_EventListener "Failed on Ubuntu 16.04. `Unhandled Exception of Type BasicEventSourceTests.EventTestHarness+EventTestHarnessException` https://mc.dot.net/#/user/krwq/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/12f35b6c1d977d376e10916e883c49c8ffa8fbc4/workItem/System.Diagnostics.Tracing.Tests/analysis/xunit/BasicEventSourceTests.TestEventCounter~2FTest_Write_Metric_EventListener <details> <summary>Log</summary ``` BasicEventSourceTests.EventTestHarness+EventTestHarnessException : Error Detected in EventTestHarness.RunTest FAILURE IN SUBTEST: \""EventCounter: Log multiple events in multiple periods\"" ************* EXCEPTION INFO *************** Xunit.Sdk.TrueException: FAILURE: 12.80718 < 2 Expected: True Actual: False at Xunit.Assert.True(Nullable`1 condition, String userMessage) at BasicEventSourceTests.TestEventCounter.<>c__DisplayClass2_2.<Test_Write_Metric>b__7(List`1 evts) in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestEventCounter.cs:line 228 at BasicEventSourceTests.EventTestHarness.<>c__DisplayClass2_0.<RunTests>b__0(Event data) in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/Harness/EventTestHarness.cs:line 77 at System.Diagnostics.Tracing.EventSource.DispatchToAllListeners(Int32 eventId, Guid* childActivityID, EventWrittenEventArgs eventCallbackArgs) in /root/coreclr/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs:line 2271 *********** END EXCEPTION INFO ************* ************* LOGGING MESSAGES *************** 35:04.544 : STARTING Sub-Test EventCounter: Log multiple events in multiple periods 35:04.545 : Sending command MyEventSource to EventSource Enable Options <Options Keywords='ffffffffffffffff' Level'Verbose' ArgsCount='1' 35:04.545 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:1E-06}) 35:04.545 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:1E-06}) 35:04.646 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1006436}) 35:04.646 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1006436}) 35:04.646 : Tick 35:04.744 : Tick 35:04.744 : Received Event MyEventSource/EventCounters({Name:Request,Mean:1,StandardDeviation:0,Count:1,Min:1,Max:1,IntervalSec:0.0977184}) 35:04.744 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.0977184}) 35:04.844 : Tick 35:04.844 : Received Event MyEventSource/EventCounters({Name:Request,Mean:2,StandardDeviation:0,Count:1,Min:2,Max:2,IntervalSec:0.1002754}) 35:04.844 : Received Event MyEventSource/EventCounters({Name:Error,Mean:1,StandardDeviation:0,Count:1,Min:1,Max:1,IntervalSec:0.1002754}) 35:12.417 : Tick 35:12.417 : Received Event MyEventSource/EventCounters({Name:Request,Mean:6,StandardDeviation:2,Count:2,Min:4,Max:8,IntervalSec:7.572985}) 35:12.417 : Received Event MyEventSource/EventCounters({Name:Error,Mean:1,StandardDeviation:0,Count:1,Min:1,Max:1,IntervalSec:7.572985}) 35:05.044 : Tick 35:05.044 : Received Event MyEventSource/EventCounters({Name:Request,Mean:16,StandardDeviation:0,Count:1,Min:16,Max:16,IntervalSec:-7.373084}) 35:05.044 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:-7.373084}) 35:05.145 : Tick 35:05.145 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1011484}) 35:05.145 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1011484}) 35:05.245 : Tick 35:05.245 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1002009}) 35:05.245 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1002009}) 35:05.341 : Tick 35:05.342 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.0961988}) 35:05.342 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.0961988}) 35:05.442 : Tick 35:05.442 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1002006}) 35:05.442 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1002006}) 35:05.542 : Tick 35:05.542 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1002689}) 35:05.542 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1002689}) 35:05.642 : Tick 35:05.642 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1002006}) 35:05.642 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1002006}) 35:05.742 : Tick 35:05.742 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001882}) 35:05.742 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001882}) 35:05.843 : Tick 35:05.843 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1002072}) 35:05.843 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1002072}) 35:05.943 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1002359}) 35:05.943 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1002359}) 35:05.943 : Tick 35:06.043 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001861}) 35:06.043 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001861}) 35:06.043 : Tick 35:06.143 : Tick 35:06.143 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.10023}) 35:06.143 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.10023}) 35:06.243 : Tick 35:06.243 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1002741}) 35:06.244 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1002741}) 35:06.344 : 35:06.344 : Tick Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001985}) 35:06.344 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001985}) 35:06.444 : Tick 35:06.444 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001943}) 35:06.444 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001943}) 35:06.544 : Tick 35:06.544 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1002554}) 35:06.544 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1002554}) 35:06.644 : Tick 35:06.644 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001697}) 35:06.644 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001697}) 35:06.744 : Tick 35:06.744 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001996}) 35:06.745 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001996}) 35:06.845 : Tick 35:06.845 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001964}) 35:06.845 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001964}) 35:06.945 : Tick 35:06.945 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1002522}) 35:06.945 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1002522}) 35:07.041 : Tick 35:07.041 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.0961904}) 35:07.041 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.0961904}) 35:07.141 : Tick 35:07.141 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1002233}) 35:07.141 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1002233}) 35:07.242 : Tick 35:07.242 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001743}) 35:07.242 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001743}) 35:07.342 : Tick 35:07.342 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001687}) 35:07.342 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001687}) 35:07.442 : Tick 35:07.442 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001594}) 35:07.442 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001594}) 35:07.542 : Tick 35:07.542 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.100151}) 35:07.542 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.100151}) 35:07.642 : Tick 35:07.642 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.100154}) 35:07.642 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.100154}) 35:07.742 : Tick 35:07.742 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001557}) 35:07.742 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001557}) 35:07.842 : Tick 35:07.843 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001545}) 35:07.843 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001545}) 35:07.943 : Tick 35:07.943 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001534}) 35:07.943 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001534}) 35:08.043 : Tick 35:08.043 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001488}) 35:08.043 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001488}) 35:08.143 : Tick 35:08.143 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001554}) 35:08.143 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001554}) 35:08.243 : Tick 35:08.243 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001545}) 35:08.243 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001545}) 35:08.343 : Tick 35:08.343 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001576}) 35:08.343 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001576}) 35:08.443 : Tick 35:08.443 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001515}) 35:08.443 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001515}) 35:08.544 : Tick 35:08.544 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001516}) 35:08.544 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001516}) 35:08.644 : Tick 35:08.644 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001572}) 35:08.644 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001572}) 35:08.745 : Tick 35:08.745 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1013167}) 35:08.745 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1013167}) 35:08.845 : 35:08.845 : Tick Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1002308}) 35:08.845 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1002308}) 35:08.942 : 35:08.942 : Tick Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.0962678}) 35:08.942 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.0962678}) 35:09.042 : Tick 35:09.042 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1002529}) 35:09.042 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1002529}) 35:09.142 : Tick 35:09.142 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1002762}) 35:09.142 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1002762}) 35:09.242 : Tick 35:09.242 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.100278}) 35:09.242 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.100278}) 35:09.343 : Tick 35:09.343 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.100288}) 35:09.343 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.100288}) 35:09.443 : Tick 35:09.443 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001785}) 35:09.443 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001785}) 35:09.543 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001921}) 35:09.543 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1001921}) 35:09.543 : Tick 35:09.643 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1002047}) 35:09.643 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1002047}) 35:09.643 : Tick 35:09.743 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1002076}) 35:09.743 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1002076}) 35:09.743 : Tick 35:09.844 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1002079}) 35:09.844 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:0.1002079}) 35:09.844 : Tick 35:17.352 : Sending command MyEventSource to EventSource Enable Options <Options Keywords='ffffffffffffffff' Level'Verbose' ArgsCount='1' 35:17.353 : Received Event MyEventSource/EventCounters({Name:Request,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:7.508971}) 35:17.353 : Received Event MyEventSource/EventCounters({Name:Error,Mean:0,StandardDeviation:0,Count:0,Min:8,Max:-8,IntervalSec:7.508971}) 35:17.358 : Validating: Count=110 RequestSum=31.000 TimeSum=12.807 35:17.360 : Exception thrown: FAILURE: 12.80718 < 2 Expected: True Actual: False *********** END LOGGING MESSAGES ************* Version of Runtime 4.0.30319.42000 Version of OS Unix 4.4.0.47 ********************************************** ---- FAILURE: 12.80718 < 2 Expected: True Actual: False ``` </details> <details> <summary>Stack trace</summary> ``` at BasicEventSourceTests.EventTestHarness.RunTests(List`1 tests, Listener listener, EventSource source, FilteringOptions options) in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/Harness/EventTestHarness.cs:line 167 at BasicEventSourceTests.TestEventCounter.Test_Write_Metric(Listener listener) in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestEventCounter.cs:line 275 at BasicEventSourceTests.TestEventCounter.Test_Write_Metric_EventListener() in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestEventCounter.cs:line 59 ----- Inner Stack Trace ----- at BasicEventSourceTests.TestEventCounter.<>c__DisplayClass2_2.<Test_Write_Metric>b__7(List`1 evts) in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestEventCounter.cs:line 228 at BasicEventSourceTests.EventTestHarness.<>c__DisplayClass2_0.<RunTests>b__0(Event data) in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/src/System.Diagnostics.Tracing/tests/BasicEventSourceTest/Harness/EventTestHarness.cs:line 77 at System.Diagnostics.Tracing.EventSource.DispatchToAllListeners(Int32 eventId, Guid* childActivityID, EventWrittenEventArgs eventCallbackArgs) in /root/coreclr/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs:line 2271 ``` </details>" 25032 area-Meta Start switching System.Native from C++ to C Motivation: Sharing code between .NET Core and Mono. 25033 area-System.Net "Test: System.Net.Security.Tests.SslStreamAlpnTests/SslStream_StreamToStream_Alpn_Success failed with ""Xunit.Sdk.EqualException""" Opened on behalf of @Jiayili1 The test `System.Net.Security.Tests.SslStreamAlpnTests/SslStream_StreamToStream_Alpn_Success(clientProtocols: [http/1.1, h2], serverProtocols: [h2], expected: h2)` has failed. Assert.Equal() Failure Expected: h2 Actual: (null) Stack Trace: at System.Net.Security.Tests.SslStreamAlpnTests.SslStream_StreamToStream_Alpn_Success(List`1 clientProtocols, List`1 serverProtocols, SslApplicationProtocol expected) in /root/corefx-1108295/src/System.Net.Security/tests/FunctionalTests/SslStreamAlpnTests.cs:line 113 Build : Master - 20171103.01 (Core Tests) Failing configurations: - RedHat.69.Amd64-x64 - Debug - Release Detail: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171103.01/workItem/System.Net.Security.Tests/analysis/xunit/System.Net.Security.Tests.SslStreamAlpnTests~2FSslStream_StreamToStream_Alpn_Success(clientProtocols:%20%5Bhttp~2F1.1,%20h2%5D,%20serverProtocols:%20%5Bh2%5D,%20expected:%20h2) 25034 area-Meta Please support a modern very high performance version of System.IO.Log I'm looking for an very high performance version Algorithms for Recovery and Isolation Exploiting Semantics (ARIES) like .net standard/core namspace. It does not need to be exactly ARIES but would need to be sufficent to be the start of a number of different data oriented projects that choose .NET. I would use this and I think others would use this to start a new eco system of databases, no sql, messaging, streaming and data oriented .NET core open source projects. 25036 area-System.Console Implement an async version of the blocking System.Console.ReadKey In the PowerShell extension for Visual Studio Code, we have an async REPL loop where we'd love to be able to `await Console.ReadKeyAsync()` rather than blocking on `Console.ReadKey()`. The current implementation is problematic because we need cancellation support. We have tried to work around the blocking ReadKey() call by using KeyAvailable() but there is a known issue with KeyAvailable() causing the characters to be echo'd to the screen on Linux which is not desirable when you're asking for a user's password. 25037 area-System.IO System.IO.MemoryMappedFiles.Tests.CrossProcessTests.DataShared failed in CI Failed test: System.IO.MemoryMappedFiles.Tests.CrossProcessTests.DataShared Configuration: osx10.12_release Detail: https://ci.dot.net/job/dotnet_corefx/job/master/job/osx10.12_release/3498/testReport/System.IO.MemoryMappedFiles.Tests/CrossProcessTests/DataShared/ MESSAGE: ~~~ Exit code was 131 but it should have been 42\nExpected: True\nActual: False ~~~ STACK TRACE: ~~~ at System.Diagnostics.RemoteExecutorTestBase.RemoteInvokeHandle.Dispose() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_release/src/CoreFx.Private.TestUtilities/src/System/Diagnostics/RemoteExecutorTestBase.cs:line 203 at System.IO.MemoryMappedFiles.Tests.CrossProcessTests.DataShared() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_release/src/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CrossProcess.cs:line 33 ~~~ 25039 area-Infrastructure Add validation of contract/implementation consistency for readonly structs, parameters and returns readonliness is part of the contract. We need to add validation for this to our contract tooling to ensure consistency between reference assembly and implementation. From @weshaggard : It should be easy enough to add for anyone that wants to verify it. The code lives in Microsoft.Cci.Extensions in Buildtools. https://github.com/dotnet/coreclr/pull/14789#issuecomment-341579931 25040 area-System.Net Implement portable support for TCP_KEEPCNT, TCP_KEEPIDLE and TCP_KEEPINTVL socket options Allow for configuring TCP Keepalive in a portable manner. # Rationale TCP Keepalive is an optional feature of TCP that is implemented in most widely used OSes and the feature can already be enabled in .NET by using `SocketOptionName.KeepAlive`. However, it is not possible, as of now, to set the various keepalive options using a standard .NET API. Most platforms, more than simply allowing TCP keepalive, provide a subset of the following three options: * Keepalive Time * Keepalive Interval * Keepalive Retry Count Since Windows 2000, it has been possible to set both Keepalive Time and Keepalive Interval by using `SIO_KEEPALIVE_VALS` with Winsock IOCTL (Exposed via `Socket.IOControl` and `IOControlCode.KeepAliveValues` in .NET) Under Linux, TCP Keepalive can be configured with `setsockopt` under the `SOL_TCP` level. The allowed parameters are `TCP_KEEPCNT`, `TCP_KEEPIDLE` and `TCP_KEEPINTVL`. It seems OSX also has some good support for the feature since OSX Lion, only using slightly different names than Linux: https://lists.apple.com/archives/macnetworkprog/2012/Jul/msg00005.html From the docs, since Windows 10 version 1703 and 1709, settings that are code-compatible with Linux and OSX were introduced: https://msdn.microsoft.com/en-us/library/windows/desktop/ms738596(v=vs.85).aspx As explained in https://github.com/dotnet/corefx/issues/14237, it is impossible today to configure TCP keepalive on platforms other than Windows, where `Socket.IOControl` can do the trick. # Proposed API ```csharp enum SocketOptionName { //… #region SocketOptionLevel.Tcp //… // TCP KeepAlive options TcpKeepAliveRetryCount = 16, // TCP_KEEPCNT value from Ws2ipdef.h TcpKeepAliveTime = 3, // TCP_KEEPIDLE = TCP_KEEPALIVE value from Ws2ipdef.h TcpKeepAliveInterval = 17, // TCP_KEEPINTVL value from Ws2ipdef.h #endregion //… } ``` # Example ```csharp void EnableKeepAlive(Socket socket, byte retryCount, int keepAliveTimeInSeconds, int keepAliveIntervalInSeconds) { socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive, true); socket.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.TcpKeepAliveRetryCount, (int)retryCount); socket.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.TcpKeepAliveTime, keepAliveTimeInSeconds); socket.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.TcpKeepAliveInterval, keepAliveIntervalInSeconds); } ``` # Details The PAL for each supported platform would translate the call to `Socket.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.TcpKeepAlive*, *)` into the appropriate call for the platform. * On Linux, and OSX ≥ 10.7, .NET enumeration values would be translated to corresponding system values for `setsockopt()`. * On Windows 10 version 1709 and newer, the flags would be transferred as-is to the underlying Winsock API, as they already are today. * Ideally, `TcpKeepAliveTime` and `TcpKeepAliveInterval` would be marshalled to `socket.IOControl(IOControlCode.KeepAliveValues, KeepAliveValues, null)` for previous versions of windows, while `TcpKeepAliveRetryCount` would be simply ignored. ⚠️ Beware that commonly used socket option names `TCP_KEEPIDLE` (or `TCP_KEEPALIVE`) and `TCP_KEEPINTVL` are expressed in seconds, while `SIO_KEEPALIVE_VALS` expresses durations in milliseconds. # Questions The TCP keepalive feature being optional, it is not required that all platforms support it or provide any specific way of configuring the feature. * Should a call to a non supported TCP keepalive option throw an exception ? * How should a caller determine if a given option is indeed supported on the current platform ? * Should an additional socket property, similar to `Socket.LingerState` be also added (e.g. `KeepAliveState` of type `KeepAliveOption`), in order to group the various options and handle everything at one place ? * The feature could be used with something like `socket.KeepAliveState = new KeepAliveOption(true, 15, 7200, 1)` * This would also be more consistent with the way the feature is configured on legacy Windows system. 25041 area-Microsoft.CSharp Remove some redundances from Microsoft.CSharp * Remove dead path from `CheckAccessCore`. If `aggWhere` was null we return, otherwise last for must happen at least once. Within that if `atsThru` is null we return, therefore later path for `atsThru` being null cannot be hit. * Remove dead test from `TryReportLvalueFailure` If `!isNested` we are on the first loop so if `pObject != null` and `!(expr is ExprField)` then we know statically that `expr is ExprProperty` as only paths for it being `ExprField` or `ExprProperty` set `pObject`, so remove redundant test. * Remove parameter from `bindFloatOp` that is always overwritten. * Remove parameter from `LScalar` that is always overwritten. * Reduce duplication in `BindIncOpCore`. * Remove some unused assignments. 25042 area-Microsoft.CSharp MS.CSharp: Remove checks for locals as possible source of lvalue errors. Demonstrable as unreachable two ways: Firstly it is impossible to represent the sort of expression that cause CS1604 or CS1605 in dynamic code. Secondly as `ExprLocal` have Flags set to `EXPRFLAG.EXF_LVALUE` and that flag never removed, the paths for `expr.isLvalue` within both `checkLvalue` and `TryReportLvalueFailure` (just before it loops) will mean an `ExprLocal` is never examined within `TryReportLvalueFailure`, and so `ReportLocalError` can never be called. Entails removal of `ERR_RefReadonlyLocal` and `ERR_AssgReadonlyLocal`, contributes to #22470 Edit: Building on that: * Remove `CheckLvalueKind.OutParameter` Tested for, but never passed as a value. Entails removal of `ERR_RefReadonlyLocalCause`, `ERR_RefProperty`, `ERR_RefLvalueExpected`, `ERR_RefReadonly`, `ERR_RefReadonlyStatic`, `ERR_RefReadonly2` & `ERR_RefReadonlyStatic2`. Contributes to #22470 * Tidy up ReportReadOnlyError Remove no-longer-used `CheckLvalueKind` parameter. Store `field.FieldWithType` in local rather than calling twice. Since the index value lookup is not as useful with fewer possibilities, just pick the values to use in branches within the method. 25046 area-Infrastructure Port back improvements made to PlatformDetection related to version detection Changes: https://github.com/dotnet/corefx/pull/24340/files This is already in PR: https://github.com/dotnet/corefx/pull/24531 25047 area-Meta Release/2.0.0 - Make corefx exceptions serializable and add typeforwards Related https://github.com/dotnet/corefx/issues/24424 The cleanup code commit is need as otherwise the code would have diverged too much and cherry-picking would have been too bothersome. 25050 area-System.Net How to use System.Net.Http 4.3.3 with .NET 4.6.0 Two questions: 1. How can I ***force*** framework 4.6.0 to use System.Net.Http from the Reference package? 2. (if binding redirect is the only way) how can I add binding redirect in new csproj format? 25052 area-System.Net Cleanup Windows 10 version detection "Windows 10 Version 1709 (""Fall Creators Update"") has been released. This PR cleans up the version detection to use the latest RTM build numbers and removes obsolete InsiderPreview detection for those tests. Also, removed ActiveIssue for tests that are now fixed due to Windows 10 fixes. Fixes #22187" 25054 area-System.Xml Add xunit trait to xslt tests depending on xsltc.exe Fixes: https://github.com/dotnet/corefx/issues/25053 Unblocks: https://github.com/dotnet/coreclr/issues/14810 25056 area-System.Diagnostics Process.WaitForExit should validate the range of its input `Process.WaitForExit(int)` does not validate its parameter `milliseconds`, but passes it on: https://github.com/dotnet/corefx/blob/1100d8faa87656f447bfe8944686d13e7b3af5e9/src/System.Diagnostics.Process/src/System/Diagnostics/Process.cs#L1287-L1295 On Windows, it's then passed onto `WaitHandle.WaitOne(int)`: https://github.com/dotnet/corefx/blob/1fc008a7e174345826e658672b74aa449fb3573f/src/System.Diagnostics.Process/src/System/Diagnostics/Process.Windows.cs#L144-L156 This means that if the value of the parameter is invalid value for `WaitOne()`: * The thrown `System.ArgumentOutOfRangeException` has the wrong `ParamName` (`WaitOne`'s `millisecondsTimeout` instead of `WaitForExit`'s `milliseconds`). * If the handle is invalid, the parameter is not validated at all. (Though I haven't been able to reproduce this.) On Unix, it's passed onto `ProcessWaitState.WaitForExit(int)`: https://github.com/dotnet/corefx/blob/1fc008a7e174345826e658672b74aa449fb3573f/src/System.Diagnostics.Process/src/System/Diagnostics/Process.Unix.cs#L120-L122 Which then has a special case for -1 (`Timeout.Infinite`), but not other negative values: https://github.com/dotnet/corefx/blob/1fc008a7e174345826e658672b74aa449fb3573f/src/System.Diagnostics.Process/src/System/Diagnostics/ProcessWaitState.Unix.cs#L362-L379 As far as I can tell, this means that on Unix `process.WaitForExit(-2)` behaves effectively the same as `process.WaitForExit(0)`: it doesn't wait at all, it just returns whether the process already exited. The options I can see are: 1. Do nothing. 2. Validate the input only on Windows. This would fix the `ParamName` on Windows, and wouldn't cause a breaking change on Unix. But it would mean Windows and Unix are going to stay inconsistent. 3. Always validate the input. This would fix the `ParamName` on Windows and it would mean the behavior on Unix would be deliberate, not accidental. But it would also be a breaking change: code that didn't throw before would start throwing. What do you think is the best approach here? Personally, I prefer 3. 25057 area-Infrastructure Rename PlatformDetection.OSXKernelVersion to PlatformDetection.OSXVersion This is addressing feedback which was missed in https://github.com/dotnet/corefx/pull/24531 Background: My previous PR has changed underlying implementation of OSXKernelVersion to use core-setup implementation which uses OSX versioning system instead of OSX kernel versioning system. I've changed tests to use new numbers but did not update the name of the property cc: @tarekgh 25060 area-System.IO Compability of GZipStream between core and framework I`ve tried to port popular library for http requests called xNet and faced interesing issue. Library compiled for standart 2.0 works fine when it`s used in Windows Console project and falls with errow when used in Core Console Project (both test projects in my repo). Problem appiers when you try to download http content coded with gzip. Problem located to this line: https://github.com/Fedorus/xNetStandart/blob/master/~Http/HttpResponse.cs#L1487 ` int bytesRead = stream.Read(buffer, 0, bufferSize);` where int bufferSize = ~65k buffer = new byte[bufferSize] and real stream content is less. On such circumstances code will fail becouse stream will wait for data. I`ve tried fixing it but failed. Looks like there is something deeper but I haven`t located it yet. There is original repo of xNet and my modified version with 2 test projects (windows and core console) origin: https://github.com/X-rus/xNet ported: https://github.com/Fedorus/xNetStandart Thanks for atention. I hope someone will point me in my mistake or helps solving this issue. 25061 area-System.Threading Add test for setting min worker threads in thread pool to 0 Related to https://github.com/dotnet/coreclr/issues/14239 Depends on https://github.com/dotnet/coreclr/pull/14864 25062 area-System.Net How can I send some requests from authenticated proxy server ? Hi, I have an application wants to send some of outbound requests from an authenticated proxy server. I have `schema` `host` `port` `username` and `password` of my proxy server. I have 2 problem: 1. how can I implement for specific outbound addresses not all. 2. how can send this requests from proxy server! I just find [this](http://josephwoodward.co.uk/2016/07/proxying-http-requests-asp-net-core-using-kestrel) pkg, but it doesn't help me! thank 25063 area-Meta Build breaks when targetting UWP SDK 16299 (DotNet core) along with Microsoft advertising "The UWP app build in Release mode breaks when targeting the latest UWP SDK that uses dotnet core toolchain along with Microsoft advertising sdk. Environment: Visual Studio 2017 (15.4.1) UWP SDK 16299 Microsoft Advertising SDK 10.0.7 UWP App project ( Target Version 10.0.16299.0, Min Version 10.0.16299.0) Microsoft.NETCore.UniversalWindowsPlatform 6.0.1 NetStandard 2.0.0 Error Details: 1> Task ""ResolveToolchainRequiredAssemblyRoots"" 1> Done executing task ""ResolveToolchainRequiredAssemblyRoots"". 1> Task ""ILTransformAssemblyClosure"" 1>C:\Users\shubh\.nuget\packages\microsoft.net.native.compiler\2.0.0\tools\Microsoft.NetNative.targets(726,5): error : ILT1307: Assemblies 'D:\Next Applications\Near Me\SourceCode\Source Code-10.0\NextApps.MapsPlus.Universal\obj\x64\Release\ilc\in\WinMetadata\Microsoft.Advertising.winmd' and 'C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs\Microsoft.Advertising.Xaml\10.0\References\CommonConfiguration\neutral\Microsoft.Advertising.winmd' have conflicting simple names. 1> Done executing task ""ILTransformAssemblyClosure"" -- FAILED. 1> Done building target ""ConstructILTransformAssemblyClosure"" in file ""Preparation"" -- FAILED. 1> Done building project ""Preparation"" -- FAILED. 1> Compilation failed 1> 1> The command exited with code 1201. Problem is in Release mode only, debug builds are fine. Release mode has Compile with .Net native tool chain flag On. " 25064 area-System.Security X509Certificate2: Unclear error message when permission denied to file If the user running an ASP.NET Core app on Linux does not have permission to access the PFX file, this confusing error message is thrown: ``` Unhandled Exception: Interop+Crypto+OpenSslCryptographicException: error:2006D002:BIO routines:BIO_new_file:system lib at Interop.Crypto.CheckValidOpenSslHandle(SafeHandle handle) at Internal.Cryptography.Pal.CertificatePal.FromFile(String fileName, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags) at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(String fileName, String password, X509KeyStorageFlags keyStorageFlags) at System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(String fileName, String password) at Microsoft.AspNetCore.Hosting.ListenOptionsHttpsExtensions.UseHttps(ListenOptions listenOptions, String fileName, String password) at SecureSign.Web.Program.<>c__DisplayClass1_0.<BuildWebHost>b__2(ListenOptions listenOptions) in C:\src\SecureSign\src\SecureSign.Web\Program.cs:line 53 at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerOptions.Listen(IPEndPoint endPoint, Action`1 configure) at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerOptions.Listen(IPAddress address, Int32 port, Action`1 configure) at Microsoft.Extensions.Options.OptionsFactory`1.Create(String name) at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) at System.Lazy`1.CreateValue() at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.CreateServiceContext(IOptions`1 options, ILoggerFactory loggerFactory) at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer..ctor(IOptions`1 options, ITransportFactory transportFactory, ILoggerFactory loggerFactory) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProvider provider) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider) at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureServer() at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication() at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build() at SecureSign.Web.Program.Main(String[] args) in C:\src\SecureSign\src\SecureSign.Web\Program.cs:line 20 ``` Can this be improved to explain what the error actually is? 25065 area-System.Runtime Correct unit tests for Environment.SetEnvironmentVariable Fix #16766 25066 area-System.IO ARM/Linux: unable to cancel async read of /dev/input/input0 file I’m using System.IO.FileStream to read touch screen events. More specifically, I have an endless loop that calls `await stream.ReadAsync(…)` API on that file. It works OK and I’m getting my touch events (well, almost, because no multi-touch, but I don’t think .NET is responsible for that). I’m having problems implementing graceful shutdown. I’ve tried closing and disposing the stream, I.ve tried passing CancellationToken to ReadAsync() call, the result is the same, ReadAsync() only cancels with an exception when the next touch event becomes available. Which is kinda later than I’d like it to. I don’t have much experience with Linux, but it looks like there’s a bug in CoreFX here? 25067 area-Microsoft.CSharp NullReferenceException on unary operators on nullable enums in Microsoft.CSharp Given: ```C# CSharpArgumentInfo x = CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, null); CallSiteBinder binder = Binder.UnaryOperation( CSharpBinderFlags.None, ExpressionType.OnesComplement, GetType(), new[] { x }); CallSite<Func<CallSite, StringComparison?, object>> site = CallSite<Func<CallSite, StringComparison?, object>>.Create(binder); Func<CallSite, StringComparison?, object> targ = site.Target; object result = targ(site, StringComparison.InvariantCulture); ``` The invocation of `targ` will throw a `NullReferenceException`. The immediate problem is it hitting a path that assumes it is dealing with an `AggregateType` when it is dealing with a `NullableType`, but it seems a bit more than just a spot fix there will be needed to make it handle the combination of both lifting and between enumerable types and their underlying types. Code using `dynamic` will likely never hit this as nullable types will never be inferred from a single `dynamic` argument, but it'd be safer to have this work correctly, as well as it ideally being workable for explicit use as in the example above. 25069 area-System.Diagnostics Test failure: System.Diagnostics.Tests.EventLogEntryCollectionTests/CheckingEntryEqualityAndIndex Opened on behalf of @Sunny-pu The test `System.Diagnostics.Tests.EventLogEntryCollectionTests/CheckingEntryEqualityAndIndex` has failed. Assert.Equal() Failure\r Expected: 1\r Actual: 0 Stack Trace: at System.Diagnostics.Tests.Helpers.WaitForEventLog(EventLog eventLog, Int32 entriesExpected) in E:\A\_work\1586\s\corefx\src\System.Diagnostics.EventLog\tests\Helpers.cs:line 69 at System.Diagnostics.Tests.EventLogEntryCollectionTests.CheckingEntryEqualityAndIndex() in E:\A\_work\1586\s\corefx\src\System.Diagnostics.EventLog\tests\EventLogEntryCollectionTests.cs:line 85 Build : Master - 20171106.02 (Core Tests) Failing configurations: - Windows.81.Amd64-x86 - Release - Windows.7.Amd64-x86 - Release 25070 area-Infrastructure When I try to build the corefx in my local with VS2017 enterprise, it always point to community.  Actually I have installed an enterprise version of VS2017. 25072 area-System.Net Client cert auth doesn't work in HttpClientHandler "We have a Nginx server that lives behind a Barracuda Web Application Firewall. We configure the firewall to only allow request with specific client cert. I am writing code leveraging on `HttpClient` to access Nginx. With the following .Net Core 2.0 code, I always get `System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.WinHttpException: A security error occurred` ``` var cert = FindCertificateByThumbprint(""1A7201E21CA93CAFED9FDCD1736716F606A22651""); using (var handler = HttpMessageHandlerFactory.Create(cert)) using (var client = new HttpClient(handler)) { client.BaseAddress = new Uri(""https://release.sample.com""); client.DefaultRequestHeaders.Host = ""release.sample.com""; var postString = ... // some json data using (var postContent = new StringContent(postString, Encoding.UTF8, ""application/json"")) using (var response = await client.PostAsync(""/some_api"", postContent)) { var responseContent = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseContent); } } ``` ``` public static HttpMessageHandler Create(X509Certificate2 cert) { var handler = new HttpClientHandler(); handler.ClientCertificateOptions = ClientCertificateOption.Manual; handler.ClientCertificates.Add(cert); return handler; } ``` But if I switch to .Net Framework 4.6.1 with the following code change (1 line only), it works: ``` var handler = new WebRequestHandler(); ``` I have no ideas about this. What's the difference between .Net Core `HttpClientHandler` and .Net Framework `WebRequestHandler`?How can I make it work in .Net Core 2.0? Can anyone help me? Thanks in advance! My application is an Asp.Net Core 2.0 web app based on .Net Core 2.0 running on Windows 10 x64, and is deployed as an Azure WebApp Here is the simplest code that reproduces the issue, it is a console app: https://github.com/kchanlee/HttpMessageHandlerIssue " 25077 area-System.Memory Utf8Formatter.TryFormat(Double/Single) allocates a String. As it's a thin wrapper around the classic BCL api. The algorithm is extremely complex and we don't have a C# version and porting the C++ from CoreCLR would be time-consuming and it's not clear whether the engineering result would be to our pleasing. For now, this overload is more for completeness than a cloud need so for now, this issue is for tracking. 25078 area-System.Memory Productize Utf8Parser and Utf8Formatter "Fixes https://github.com/dotnet/corefx/issues/24607 Remaining debt (cut for time): Parsing Intgers with the ""N"" format https://github.com/dotnet/corefx/issues/24986 Some questions to be resolved as to whether to be compatible (BCL doesn't care where you put the commas) or correct. Format of floating point is still a wrapper hack https://github.com/dotnet/corefx/issues/25077 The portable DoubleToNumber() code was never ported to C# (though the big block comment advertising it was)." 25079 area-System.Linq Improve Enumerable.SingleOrDefault(predicate) Logic "@seanfisher commented on [Sun Nov 05 2017](https://github.com/dotnet/core/issues/1061) # Improve Enumerable.SingleOrDefault logic This improves performance for the case where more than one element is found that matches the predicate, especially in large data sets. # General Hi, I ran across the [reference source for Enumerable.cs](https://github.com/Microsoft/referencesource/blob/b31308b03e8bd5bf779fb80fda71f31eb959fe0b/System.Core/System/Linq/Enumerable.cs#L1204-L1220) and was surprised to see an improvement opportunity. I was about to open an issue over there but then read a closed issue where they recommended opening new issues over here instead. In the current reference source it appears that there is needless looping over the entire enumerable even if the count of elements that match the predicate is greater than one. Here's a quick one-liner example of a short-circuit exit improvement (notice the added line right after `checked { count++; }`), although I'm sure it could be improved even further: public static TSource SingleOrDefault<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate) { if (source == null) throw Error.ArgumentNull(""source""); if (predicate == null) throw Error.ArgumentNull(""predicate""); TSource result = default(TSource); long count = 0; foreach (TSource element in source) { if (predicate(element)) { result = element; checked { count++; } if (count == 2) { break; } } } switch (count) { case 0: return default(TSource); case 1: return result; } throw Error.MoreThanOneMatch(); } Let me know if this is the appropriate place for this issue. It could also be that the reference source doesn't reflect exactly what the implementation is doing, because I would expect something like the Enumerable methods would have long-since been hand-tuned for performance. --- @benaadams commented on [Sun Nov 05 2017](https://github.com/dotnet/core/issues/1061#issuecomment-342066802) It seems to be fixed in corefx? https://github.com/dotnet/corefx/blob/master/src/System.Linq/src/System/Linq/Single.cs However, for a performance improvement, you should be able to just open and Issue in the repository that has the source or open a PR change. Although what reference source shows is the code for full framework/desktop so it could probably still do with this change (or to pick up corefx's Linq code) --- @Petermarcu commented on [Mon Nov 06 2017](https://github.com/dotnet/core/issues/1061#issuecomment-342217436) I'm going to move this issue to corefx. The outcome here is probably to add a ref count to get this on the list of things to consider porting to .NET Framework. " 25081 area-System.Net ARM/Linux: NetworkChange.NetworkAddressChanged crashes "Here's a program: ``` using System; using System.Net.NetworkInformation; class Program { static void Main( string[] args ) { printAll(); NetworkChange.NetworkAddressChanged += addressChanged; Console.ReadLine(); } static void addressChanged( object sender, EventArgs e ) { printAll(); } static void printAll() { NetworkInterface[] all = NetworkInterface.GetAllNetworkInterfaces(); foreach( var i in all ) Console.WriteLine( ""{0}, status {1}"", i.Description, i.OperationalStatus ); } } ``` Here's the output when I unplug Ethernet cable from the device: ``` lo, status Unknown sit0, status Down eth0, status Up wlan0, status Down lo, status Unknown sit0, status Down eth0, status Down wlan0, status Down Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. at System.Net.NetworkInformation.NetworkChange.OnSocketEvent(NetworkChangeKind kind) at System.Net.NetworkInformation.NetworkChange.ProcessEvent(Int32 socket, NetworkChangeKind kind) at System.Net.NetworkInformation.NetworkChange.LoopReadSocket(Int32 socket) at System.Net.NetworkInformation.NetworkChange.<>c.<CreateSocket>b__17_0(Object s) at System.Threading.Tasks.Task.InnerInvoke() at System.Threading.Tasks.Task.<>c.<.cctor>b__276_1(Object obj) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) ```" 25082 area-Infrastructure Run tests on non-en-US culture Right now our CI and official runs all use en-US. When contributors run tests locally on a machine with different culture settings, they sometimes get failures - which we fix, but it would be nice to prevent this upstream especially as sometimes they are product bugs. 25083 area-Infrastructure Promote netcoreapp tests to netstandard as possible Tests that run only against .NET Standard surface area should run in the netstandard configuration so they can be reused against other netstandard implementations. It is likely that we currently have some tests running in the netcoreapp configuration that could be run in netstandard. We should do a pass through in order to beef up our netstandard coverage. 25084 area-Infrastructure Share .NET Standard test bed We already have good tools to ensure that .NET Standard implementations fulfil the .NET Standard API surface area. We should now also share tests in order to minimize functional differences. In CoreFX we have a attempted to separate out tests for .NET Standard. In discussion with @marek-safar and @luhenry of Xamarin it likely makes sense to make this test bed reuseable so we can run it against Xamarin as well. We expect this to also help us drive standardization/documentation of the behavior of .NET Standard API's, where it's not already clear. We’d like to establish principles (with examples) for which behavior we’d like to prescribe. There is inherent tension between making .NET behavior consistent across all platforms and making .NET behavior self-consistent on a given platform. Sharing tests will help map this out, and prevent divergence. Longer term we may want to run Mono tests against .NET Core, and run .NET Core (ie., full netcoreapp) tests against Mono where appropriate: these may have value but are not in scope of this epic. @marek-safar @luhenry @terrajobst 25085 area-System.Memory Add String support to ReadOnlyMemory<char> Today `ReadOnlySpan<char>` can reference a `System.String` (via `AsReadOnlySpan()`), but `ReadOnlyMemory<char>` can't. We should fix that so that `ReadOnlyMemory<char>` can be used as a way to slice strings where the slices can live on the heap. To me that means: 1. Allowing `ReadOnlyMemory<T>` to wrap a `string` in addition to wrapping a `T[]` and an `OwnedMemory<T>`. This will mean an extra type check on operations like `ReadOnlyMemory<T>.Span`, but it can be guarded behind a `typeof(T) == typeof(char)` check such that the additional branch and few additional instructions will only impact `T==char`, and `string` will end up being a very common case for `T==char`, making it worth it. 2. Adding an `AsReadOnlyMemory()` extension method for`string` just as there's an `AsReadOnlySpan()` extension. 3. Adding a `TryGetString` method on `MemoryMarshal` or some similar place that enables getting the string/offset/count out of a `ReadOnlyMemory<char>` if it's wrapping one. 4. Whatever string operation methods we want exposed added as extension methods for `ReadOnlyMemory<char>`, related to https://github.com/dotnet/corefx/issues/20378 and https://github.com/dotnet/corefx/issues/21395 cc: @KrzysztofCwalina, @ahsonkhan, @terrajobst, @jkotas Replaces https://github.com/dotnet/corefx/issues/20378? 25088 area-System.Net Socket.Listen() does not support UNIX Domain Socket "According to https://github.com/dotnet/corefx/issues/10981, I copied the implementation from corefx/src/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.cs and use it locally like below. (I'm using dotnet core 2.0.0 on Ubuntu) ```C# Socket s = new Socket(AddressFamily.Unix, SocketType.Dgram, ProtocolType.Unspecified); Console.WriteLine(s.SendBufferSize); Console.WriteLine(s.ReceiveBufferSize); var unixSocket = ""./my.sock.1""; var ep = new UnixDomainSocketEndPoint(unixSocket); Console.WriteLine(ep.AddressFamily); try { System.IO.File.Delete(unixSocket); s.Bind(ep); s.Listen(5); //// **Operation not supported** while(true) { var newS = s.Accept(); byte[] content = new byte[1000]; var result = s.Receive(content); Console.WriteLine(result); Console.WriteLine(Encoding.Default.GetString(content)); newS.Close(); } } catch(Exception e) { Console.WriteLine(e.Message); Console.WriteLine(e.StackTrace); s.Close(); } ``` The exception is something like below: ``` Operation not supported at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName) at System.Net.Sockets.Socket.Listen(Int32 backlog) at test01.Program.Main(String[] args) in /home/klein/code/temp/test01/Program.cs:line 106 ``` Is there any solution or workaround to let dotnet core build a domain socket server in Linux? Thanks!" 25089 area-System.Runtime Add methods for getting the current time in a specific time zone "We presently have `DateTime.Now` and `DateTimeOffset.Now` for getting the current time in the computer's local time zone. We also have `DateTime.UtcNow` and `DateTimeOffset.UtcNow` for getting the current time in UTC. However, we don't have a property or method to get the time in a *specific* time zone. To achieve that, one currently has to first get the UTC time, then get a specific time zone (if one doesn't have it already), and then convert the time to that time zone. This proposal is to add an API to make that one step instead of two or three. ## Proposed API ```diff namespace System { public class TimeZoneInfo { + public DateTimeOffset Now { get; } } } ``` ## Example Usage ```csharp DateTimeOffset now = TimeZoneInfo.FindSystemTimeZoneById(""Eastern Standard Time"").Now; ``` Note that the above has been edited based on the conversation in this thread. The original proposal was to add `NowInTimeZone` methods for `DateTime` and `DateTimeOffset`. Other alternatives to consider would be to have `.GetCurrentTime()` as a method instead of the `.Now` property, or to introduce a `ZonedDateTime` type." 25090 area-System.Net Reset auth settings on the request during redirect on managedhandler. cc @stephentoub @Tratcher fixes #24842 #24387 Update: In the latest rebased commit, I've combined the authentication and redirect handlers, to maintain the state as local information in SendAsync, as discussed internally with @stephentoub 25094 area-System.Runtime Proposal: String.Contains(char) ## Rationale and Usage Finding a character in a string is a fairly common primitive operation. Unfortunately we lead users to the pit of failure because `mystring.Contains(char)` will bind to the Linq version, which can easily be 20x slower than `mystring.IndexOf(char) != -1`. By adding these to string, the next recompile will give a performance improvement. ## Proposed API ```c# public sealed partial class String : System.Collections.Generic.IEnumerable<char>, System.Collections.IEnumerable, System.IComparable, System.IComparable<string>, System.IConvertible, System.IEquatable<string>, System.ICloneable { public bool Contains(char value) { throw null; } public bool Contains(char value, StringComparison comparisonType) { throw null; } public bool Contains(string value) { throw null; } // already exists public bool Contains(string value, StringComparison comparisonType) { throw null; } // already exists public int IndexOf(char value, StringComparison comparisonType) { throw null; } // to implement above } ``` the implementations will simply be ```c# public bool Contains(char value) { return IndexOf(value) != -1; } public bool Contains(char value, StringComparison comparisonType) { return IndexOf(value, comparisonType) != -1; } ``` ## Microbenchmark Searching in 10 and 1000 character strings: ``` Method | Mean | Error | StdDev | ---------- |-----------:|----------:|----------:| LinqShort | 142.750 ns | 0.4997 ns | 0.4430 ns | LinqLong | 180.121 ns | 0.4741 ns | 0.3428 ns | FastShort | 7.575 ns | 0.0196 ns | 0.0174 ns | FastLong | 8.508 ns | 0.0403 ns | 0.0377 ns | ``` ## Variations The StringComparison overload is in order to search case insensitively if desired. The IndexOf overload is needed to implement it. These could be discarded as the 90% case I would expect to not take a comparison. 25098 area-Serialization DCSerialization CriticalHelper.WriteMembers cleanup Name params (were comments) Check `List.Count` once Reduce calls to `Load` and `Call` by once each (to reduce inline bloat https://github.com/dotnet/coreclr/pull/14850#issuecomment-342256447) @stephentoub PTAL 25099 area-Meta Webpack failure on dot net core 2 gives wrong message. "DotNet Core 2.0 with Angular 5 If angular is updated to angular 5 and ngtools is not latest, then following error comes during runtime. Error: Version of @angular/compiler-cli needs to be 2.3.1 or greater. Current version is ""5.0.0"". Error message is clearly misleading." 25102 area-System.Drawing System.Drawing on CentOS: Unable to load DLL 'libdl' "Any code which uses System.Drawing fails on CentOS 7.4 with the following exception: ``` Unhandled Exception: System.TypeInitializationException: The type initializer for 'Gdip' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'libdl': The specified module or one of its dependencies could not be found. (Exception from HRESULT: 0x8007007E) at Interop.Libdl.dlopen(String fileName, Int32 flag) at System.Drawing.SafeNativeMethods.Gdip.LoadNativeLibrary() at System.Drawing.SafeNativeMethods.Gdip..cctor() --- End of inner exception stack trace --- at System.Drawing.SafeNativeMethods.Gdip.GdipCreateBitmapFromFile(String filename, IntPtr& bitmap) at System.Drawing.Bitmap..ctor(String filename, Boolean useIcm) at gdiplus.Program.Main(String[] args) in /root/gdiplus/Program.cs:line 12 ``` This is because by default `libdl.so` doesn't exist on CentOS whereas `libdl.so.2` does exist. As a workaround you can symlink `/lib64/libdl.so.2` to `/lib64/libdl.so`. ``` ln -s /lib64/libdl.so.2 /lib64/libdl.so ``` Program.cs: ```csharp using System; using System.Drawing; namespace gdiplus { class Program { static void Main(string[] args) { Console.WriteLine(""Hello World!""); var bitmap = new Bitmap(""test.bmp""); } } } ``` Project file: ```xml <Project Sdk=""Microsoft.NET.Sdk""> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>netcoreapp2.0</TargetFramework> </PropertyGroup> <ItemGroup> <PackageReference Include=""System.Drawing.Common"" Version=""4.5.0-preview1-25718-03""/> </ItemGroup> </Project> ```" 25105 area-System.Memory Productize System.Collections.Sequences Tracking item for [System.Collections.Sequences](https://github.com/dotnet/corefxlab/tree/master/src/System.Collections.Sequences) Related #24174 25110 area-System.Runtime Add methods for manipulating date and time with respect to a particular time zone "There currently is not an easy way to manipulate date and time values with respect to a particular time zone. For example, the US went through a DST transition recently. Using methods such as `AddDays` and similar do not reflect that correctly - even on the `DateTimeOffset` versions. I suggest adding the following: ## Proposed API ```diff namespace System { public struct DateTimeOffset { + public static DateTimeOffset AddYears(int years, TimeZoneInfo timeZone) + public static DateTimeOffset AddMonths(int months, TimeZoneInfo timeZone) + public static DateTimeOffset AddDays(int days, TimeZoneInfo timeZone) + public static DateTimeOffset AddHours(double hours, TimeZoneInfo timeZone) + public static DateTimeOffset AddMinutes(double minutes, TimeZoneInfo timeZone) + public static DateTimeOffset AddSeconds(double seconds, TimeZoneInfo timeZone) + public static DateTimeOffset AddMilliseconds(double milliseconds, TimeZoneInfo timeZone) + public static DateTimeOffset AddTicks(long ticks, TimeZoneInfo timeZone) + public static DateTimeOffset Add(TimeSpan timeSpan, TimeZoneInfo timeZone) + public static DateTimeOffset Subtract(TimeSpan timeSpan, TimeZoneInfo timeZone) } public struct DateTime { + public static DateTime AddYears(int years, TimeZoneInfo timeZone) + public static DateTime AddMonths(int months, TimeZoneInfo timeZone) + public static DateTime AddDays(int days, TimeZoneInfo timeZone) + public static DateTime AddHours(double hours, TimeZoneInfo timeZone) + public static DateTime AddMinutes(double minutes, TimeZoneInfo timeZone) + public static DateTime AddSeconds(double seconds, TimeZoneInfo timeZone) + public static DateTime AddMilliseconds(double milliseconds, TimeZoneInfo timeZone) + public static DateTime AddTicks(long ticks, TimeZoneInfo timeZone) + public static DateTime Add(TimeSpan timeSpan, TimeZoneInfo timeZone) + public static DateTime Subtract(TimeSpan timeSpan, TimeZoneInfo timeZone) } } ``` ## Example Usage ```csharp // setup TimeZoneInfo tz = TimeZoneInfo.FindSystemTimeZoneById(""Eastern Standard Time""); DateTimeOffset dto = DateTimeOffset.Parse(""2017-11-05T00:00:00-04:00""); // example of using AddDays in existing API DateTimeOffset result1 = dto.AddDays(1); // 2017-11-06T00:00:00-04:00 // example of using AddDays with respect to time zone in proposed API DateTimeOffset result2 = dto.AddDays(1, tz); // 2017-11-06T00:00:00-05:00 // example of using AddHours in existing API DateTimeOffset result3 = dto.AddHours(24); // 2017-11-06T00:00:00-04:00 // example of using AddHours with respect to time zone in proposed API DateTimeOffset result4 = dto.AddHours(24, tz); // 2017-11-05T23:00:00-05:00 ``` Note that in this context, `AddDays` is intended to manipulate a calendar day, not an elapsed 24-hour duration. Thus its argument is an `int` rather than a `double`. `AddMonths` and `AddYears` already behave similarly. Also, if #24555 goes through, then we'd also need `AddMicroseconds` versions of the above. For discussion: We could also include overloads that allow the user to supply a delegate to control how ambiguous results are handled, and how invalid or ambiguous `DateTime` inputs are resolved. Or we could default that behavior to existing behaviors present in the framework already, or to something more sensible for these scenarios. " 25111 area-Infrastructure NetCore package description commit hash could use some explanation? Microsoft.NETCore.App has the following description in its nuspec: ``` <description>A set of .NET API's that are included in the default .NET Core application model. e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d When using NuGet 3.x this package requires at least version 3.4.</description> ``` I just got a question asking if this was a NuGet.org or NuGet client bug... Perhaps changing that to something like the following would make it more helpful to more people? ``` <description>A set of .NET API's that are included in the default .NET Core application model. Commit hash: e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d When using NuGet 3.x this package requires at least version 3.4.</description> ``` 25112 area-System.Drawing Support loading libgdiplus from NuGet packages "This PR updates System.Drawing.Common so that it uses a logic very similar to that of `DllImport` when loading the `libgdiplus` native library. This allows NuGet packages to ship native versions of `libgdiplus` which can then be distributed as part of a self-contained application. We currently use this approach for `libgdiplus.dylib` on macOS, lifting the requirement for users to do `brew install mono-libgdiplus`. If we ever manage to create a portable version of `libgdiplus.so`, this approach could also work for Linux. With this change, `GdiplusNative.LoadNativeLibrary` will first attempt to open `libgdiplus.so` and `libgdiplus.so.0`. If neither of those two files are found in the default search path, it iterates over all directories in `AppContext.GetData(""NATIVE_DLL_SEARCH_DIRECTORIES"")` and will attempt to load `libgdiplus.so` from those directories. Fixes #24213" 25114 area-Meta "Consider writing analyzers to steer people towards ""Try"" variants of API's instead of using exceptions for control flow." 25115 area-System.Net Unsupported raw socket programming "@jakubaleksanderpolkowski commented on [Thu Nov 02 2017](https://github.com/dotnet/core/issues/1059) # Unsupported raw socket programming # Unable to create new raw socket using .net core and C# on armhf hardware under linux As above i can't create raw socket in any way. It seems like .net core does not support raw socket programming yet. Hardware: Raspberry Pi3 CPU: armhf OS: Raspbian Runtime: 2.0.0-preview1-001887-00 Language: C# Published on x64 Linux with sdk 2.0.0 Received error: > "" Unhandled Exception: System.Net.Sockets.SocketException: Protocol not supported > at System.Net.Sockets.Socket..ctor(AddressFamily addressFamily, SocketType socketType, ProtocolType > protocolType) "" Code that whrows error: `mainSocket = new Socket(AddressFamily.InterNetwork,SocketType.Raw, ProtocolType.IP);` --- @stephentoub commented on [Thu Nov 02 2017](https://github.com/dotnet/core/issues/1059#issuecomment-341410072) What happens if you run with sudo? Are you able to write/run a C program that creates a raw socket successfully? --- @jakubaleksanderpolkowski commented on [Fri Nov 03 2017](https://github.com/dotnet/core/issues/1059#issuecomment-341716434) I all ready run this as sudo, I even gave CAP_NET_RAW capability to this program --- @stephentoub commented on [Fri Nov 03 2017](https://github.com/dotnet/core/issues/1059#issuecomment-341716808) And what about a C program... you have a program in C that runs successfully opening a raw socket on the same machine? --- @wfurt commented on [Fri Nov 03 2017](https://github.com/dotnet/core/issues/1059#issuecomment-341777728) https://stackoverflow.com/questions/19732145/python-raw-socket-protocol-not-supported You need to use AF_PACKET (17 on Linux) but that does not seems to be defined for .net. Try Cprogram as @stephentoub suggested and check it with strace. " 25116 area-System.Runtime ObfuscationAttribute and ObfuscateAssemblyAttribute have wrong definitions in System.Runtime assembly "@hrumhurum commented on [Mon Oct 30 2017](https://github.com/dotnet/core/issues/1054) # System.Runtime assembly provides wrong definitions of obfuscation attributes _System.Reflection.ObfuscationAttribute_ and _System.Reflection.ObfuscateAssemblyAttribute_ are defined without _AttributeUsage_ declarations. This breaks the expected attribute usage semantics. # General .NET Core version: 2.0 OS version: Windows 10 1702 15063.674 Visual Studio version: 15.4.1 Related assembly: **System.Runtime,** Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a located at _C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Runtime.dll_ Please note that provided sample compiles and works as expected in .NET and .NET Standard 2.0 platforms. ## Steps to reproduce Try to compile the following .NET Core 2.0 console app: ```c# using System; using System.Reflection; [assembly: Obfuscation(Feature = ""Feat 1"")] [assembly: Obfuscation(Feature = ""Feat 2"")] namespace MyApp { class Program { static void Main(string[] args) { Console.WriteLine(""Hello World!""); } } } ``` ## Expected results Assembly successfully compiles. ## Actual results Program.cs(5,12,5,23): error CS0579: Duplicate 'Obfuscation' attribute " 25117 area-System.IO FileSystemWatcher events raise more than once This issue was filed here and has some more detailed discussions there. https://github.com/Microsoft/dotnet/issues/347 We should see if it repro's on .NET Core and then figure out if we need a fix or if there is an existing fix we can port to .NET Framework. 25118 area-System.Net Add sni implementation for client sslstream. fixes #23731 cc @stephentoub @Tratcher fyi @Drawaes 25121 area-System.Threading System.Threading.Channels is not compatible with .NETStandard 1.3 I was using [System.Threading.Tasks.Channels](https://www.nuget.org/packages/System.Threading.Tasks.Channels/) package for project with .NETStandard 1.3 target and was very excited it is on its way to become stable (by moving from corefxlab to corefx repo). But today I got frustrated that it suddenly dropped support for .NETStandard 1.3 and min possible target is set to .NETStandard 2.0 `Package System.Threading.Channels 4.5.0-preview1-25907-04 is not compatible with netstandard1.3 (.NETStandard,Version=v1.3). Package System.Threading.Channels 4.5.0-preview1-25907-04 supports: netstandard2.0 (.NETStandard,Version=v2.0) ` If there is no reason please support lowest possible version of .net standard. 25122 area-System.Threading Asp.Net Core App restarts when controller return type is void on Exception "Use the the below code as a controller action. ``` [HttpGet(""Test"")] public async void Test() { await _mgr.HttpContext.Request.ReadFormAsync(); //just to use an async method throw new Exception(""Test""); } ``` Ideally async method should return Task but returning void should not bring the application down." 25123 area-System.Security Make SignedXml.XmlDsigRSASHA256Url etc. public In the full framework the constants for the algorithm names (`XmlDsigRSASHA256Url` et. al) are public: http://referencesource.microsoft.com/#System.Security/system/security/cryptography/xml/signedxml.cs,83 In .NET Core they are `internal`: https://github.com/dotnet/corefx/blob/7b7da40c0b509fd902814529cbbd840da7698017/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/SignedXml.cs#L71 Is there any specific reason to why? If they are available to use the constants should be public. 25128 area-System.ComponentModel Provide localization for default error messages in System.ComponentModel.Annotations "Currently, using attributes like `[Required]` or `[Range(1, 20)]` in ASP.NET Core only gives you english error messages, no matter what culture you set. That is because .NET Core currently only has [one ](https://github.com/dotnet/corefx/tree/master/src/System.ComponentModel.Annotations/src/Resources)(english) resource file. In this [issue ](https://github.com/aspnet/Localization/issues/286), @ryanbrandenburg suggested to create a issue here instead of aspnet/Localization to see if this could get resolved, so this is what I'm doing. I wish I could just write, for example, `[Required]` and get localized error messages, without the need to write `[Required(ErrorMessage = ""bla bla bla"")]` all the time, or creating a lot of resource files, or creating a single big resource file for _every_ annotation... All of these options introduce a lot of hassle for anyone developing applications in any language other than english. It's especially frustrating when all the Annotations you use are the default ones." 25130 area-System.Memory Unroll loop for Utf8Parser unsigned integer parsers "This optimizes the Byte/UInt16/UInt32 parsers in the same way that their signed counterparts already were. Also, tuned up the signed counterparts before copy-pasting them: - Just subtract the '0' once rather than doing it once in IsDigit() and then again to add to the accumulator. - Eliminate the pre-overflow checks in the case where the accumulator is already a larger sized int than the value being parsed. The accumulator will never overflow as long we're under the digit count limit for the type. - Fix the Int32 parser's potential overflow comparison from ""int.MaxValue/10 - 1"" to ""int.MaxValue/10"" (the older value works with an unsigned accumulator but in a ""by accident"" type of way.) Perf improvement: +2.6% Int32 (int.MaxValue) +7.0% UInt32 (uint.MaxValue)" 25132 area-System.Data Tech Empower Fortunes System.Data perf improvements https://www.techempower.com/benchmarks/#section=data-r14&hw=ph&test=fortune Tracking issue for : 1. (~10%) Fix system.data.sqlclient!System.Data.ProviderBase.DbConnectionPoolIdentity.GetCurrent on windows to cache the windows identity, or to mimic what Linux does 2. (~4%) There are hot locks in system.data.sqlclient a. (2.7%) system.data.sqlclient!System.Data.ProviderBase.DbConnectionPool.PrepareConnection b. (.3%) system.data.sqlclient!System.Data.SqlClient.SqlConnection+OpenAsyncRetry.Retry c. (.5%) system.private.corelib!System.Threading.TimerQueueTimer.Change @vancem @mikeharder 25133 area-System.Xml XPathNavigator returns incorrect Name and LocalName for attribute node after call to ReadAttributeValue method "Consider the following XML: ```XML <root xmlns:x='urn:foo' xmlns='urn:default'></root> ``` Load the XML string into an `XmlDocument` to obtain an `XPathNavigator`, in turn to obtain `XmlReader`. Navigate to the attribute `xmlns:x` using `XmlReader.MoveToAttribute` API. The `XmlReader` properties `Name`, `Prefix`, `LocalName` respectively return `xmlns:x`, `xmlns` and `x`, which is correct. While the reader is positioned at the attribute, call `ReadAttributeValue`. Now, the `XmlReader` respectively returns values `xmlns:`, `xmlns` and `<Empty>` for the same attribute, This doesn't appear to be intuitive. Looks like this is because the `reader` is internally positioned at the attribute value node which is of type text and hence the `LocalName` property returns `<Empty>` as per the definition of the property. However, the end user would typically expect same values for `Name`, `Prefix` and 'LocalName` properties as from the user point of view, the reader is really not positioned at the ""text node"" that represents the _value of the attribute_. Opening this issue as per [this](https://github.com/dotnet/corefx/issues/16646#issuecomment-341919304) discussion in #16646 to know if this behavior is expected or is a bug. Appreciate your inputs. ```C# static void Main(string[] args) { string xml = ""<root xmlns:x='urn:foo' xmlns='urn:default'></root>""; var xmlDoc = new XmlDocument(); xmlDoc.LoadXml(xml); XPathNavigator nav = xmlDoc.CreateNavigator(); nav.MoveToRoot(); nav.MoveToFirstChild(); var reader = nav.ReadSubtree(); reader.Read(); if (!reader.MoveToAttribute(""xmlns:x"")) { Console.WriteLine(""Failed to move to attribute xmlns:x""); } Console.WriteLine(""Moving to attribute---------""); Console.WriteLine(""Name: "" + reader.Name); Console.WriteLine(""Prefix: "" + reader.Prefix); Console.WriteLine(""LocalName: "" + reader.LocalName); Console.WriteLine(); if (!reader.ReadAttributeValue()) { Console.WriteLine(""failed to read attribute value""); } Console.WriteLine(""Reading attribute---------""); Console.WriteLine(""Name: "" + reader.Name); // Returns 'xmlns:' instead of 'xmlns:x' Console.WriteLine(""Prefix: "" + reader.Prefix); // Correctly returns 'xmlns' Console.WriteLine(""LocalName: "" + reader.LocalName); // string.Empty instead of 'x' Console.WriteLine(); } ``` Output: ``` Moving to attribute--------- Name: xmlns:x Prefix: xmlns LocalName: x Reading attribute--------- Name: xmlns: Prefix: xmlns LocalName: ```" 25134 area-System.Drawing Move dlopen and dlsym to PAL System.Drawing P/Invokes into `dlopen` and `dlsym` to load the various libgdiplus/GDI+ functions. It currently assumes that `libdl.so` exists and contains `dlopen` and `dlsym`. This is not always the case - for example on CentOS you have `libdl.so.2` but not `libdl.so` and on FreeBSD `dlopen` does not live in `libdl` at all. Instead of trying figure out where `dlopen` lives at runtime, add `dlopen` and `dlsym` to the PAL and resolve it at compile time. 25135 area-System.Net Implementation of SecureChannel.cs in .NET Core does not verify client cert issuers Problem description: A Web Api (.NET Core 2.0) is hosted via Kestrel on Windows 10, MobiLinux and Docker. It's configured in the code to request a client certificate. Kestrel is configured with a CA issued server certificate and exposes port 443. Testing 1. A client application written in .NET 4.5-6 uses a self-signed client certificate (using makecert) 2. A client application written in .NET Core 1.1 and 2.0 uses the same self-signed client certificate (using makecert). In a case of .NET 4.5X, the code seems to verify the list of cert issuers from the server against the client certificate it's trying to send. It finds no matching CA and fails to send the cert to the server and closes the connection as expected by TLS spec. In a case of .NET Core, the code seems to not perform the same comparison and just sends the client cert to the server and allows the connection to remain open. A potential security vulnerability is seems. A support case [REG:117102516555348] with Microsoft has been opened previously to explore this issue. 25136 area-System.Net Add some basic Socket SendAsync/ReceiveAsync perf tests Microbenchmarks around SendAsync/ReceiveAsync cc: @wfurt, @geoffkizer 25137 area-System.Net ManagedHandler: move Debug.Assert(_writeOffset == 0) after code trying to handle that case There is code in ReturnConnectionToPool() to finish pending write. However the assert was executed before that. With this change I could run HTTP unit tests for while without hitting the assert. Before the change, I would hit this every 1-2 hours. 25138 area-Serialization Introducing Xml Serializer Generator for .NET Core # Introducing Xml Serializer Generator for .NET Core Like the Xml Serializer Generator (sgen.exe) on desktop, Microsoft.XmlSerializer.Generator NuGet package is the solution for .NET Core and .NET Standard Libraries. It creates an Xml serialization assembly for types contained in an assembly in order to improve the startup performance of Xml serialization when serializing or de-serializing objects of those types using XmlSerializer. You can start using the tool today by following the [instructions](https://github.com/dotnet/core/blob/master/samples/xmlserializergenerator-instructions.md). ## Details When the Xml Serializer Generator is not used, an XmlSerializer generates serialization code for each type every time when an application runs. You can improve the startup performance of Xml serialization by simply adding the reference of Microsoft.XmlSerializer.Generator NuGet package to your project. Xml Serializer Generator will generate the serialization code and compile it into an assembly next to your output assembly at build time in advance. This assembly can then be deployed and ran with your application. Please create an issue with your feedback at [dotnet/corefx](https://github.com/dotnet/corefx/issues). We are actively looking to improve the tool and your input is a valuable part of the process. 25142 area-System.Data Add UDT support to System.Data.SqlClient. 25144 area-System.Threading Fix some tests after https://github.com/dotnet/coreclr/pull/14864 Fix for some test failures in https://github.com/dotnet/corefx/pull/25131 25145 area-Infrastructure Question: How do we do performance test? I had a small conversation with @karelz on the Gitter Coreclr channel. Here is the chat transcript Hi, Just wondering how the performance test is done for the core clr Karel Zikmund @karelz Nov 08 23:05 We have a perf lab with perf test cases. The perf lab and its results is internal only at this moment. What exactly are you interested in? @karelz I am more interested in how it’s done. What OS? And what parameters we are monitoring?. Knowing OS is important because in my office we have guy coming from a well know anti virus software company and he said that his company has profiled that Windows 7 is much better than Windows 10 for doing perf tests and it's stats because windows 10 has lot of background services running which hinders the stats. Its hard to believe for me. So thought of knowing how your team does and what's the rational Karel Zikmund @karelz 06:46 @sherry-ummen our perf lab removes all noise from machines - disables all kind of background services and OS features (PreFetcher, etc.), which could interfere with our measurements and introduce noise. Key thing for performance is to focus on things which matter and remove noise/variance of the environment. For micro-benchmarks we measure time and memory. .NET Core perf tests use xunit-performance harness (see Microsoft/xunit-performance) and we are discussing merging it with BenchmarkDotNet. However, it does not contain all the perf lab scripts to set up the machines, etc. Sherry Ummen @sherry-ummen 06:52 So then I assume you are using windows OS for perf test? Which OS? And do you have some scripts to disable all the background noise? Any plans to share those? Karel Zikmund @karelz 08:55 We run perf on Linux and Mac as well. Windows is just something we run for 10+ years ...I am not sure if the infra scripts are open or not (I know that few years ago the perf test harness was way too involved to be open-sourced). It would be best to ask on GH - I can loop in perf team if you tag me (I haven't been involved in perf team work for last 2 years) Sherry Ummen @sherry-ummen 09:07 I assume GH means Github? And which Repo in Github I should ask? Coreclr Repo? Karel Zikmund @karelz 09:11 coreclr or corefx will both work fine ------------------------------------------------------ So in short I am interested in the said infra scripts which are used to setup a machine. In my case a Windows machine. Whether its open sourced if not then any plans to open source it? 25148 area-System.Reflection IndexOutOfRangeExceptions on multiple System.Reflection.Metadata tests in CI on macOS https://mc.dot.net/#/user/benaadams/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/80f4db8dc2ef1b73a0dbccc693c0d05b22bcf4eb/workItem/System.Reflection.Metadata.Tests/wilogs ``` 2017-11-09 08:30:15,600: INFO: proc(54): run_and_log_output: Output: System.Reflection.Metadata.Tests.MetadataReaderTests.ValidateNamespaceFunctionality [FAIL] 2017-11-09 08:30:15,602: INFO: proc(54): run_and_log_output: Output: System.IndexOutOfRangeException : Index was outside the bounds of the array. 2017-11-09 08:30:15,607: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2017-11-09 08:30:15,715: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(398,0): at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) 2017-11-09 08:30:15,715: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(248,0): at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) 2017-11-09 08:30:15,716: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(89,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetPinnedPEImage(Byte[] peImage) 2017-11-09 08:30:15,716: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(78,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Int32& metadataStartOffset, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:15,716: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(73,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:15,717: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(1093,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.ValidateNamespaceFunctionality() 2017-11-09 08:30:15,718: INFO: proc(54): run_and_log_output: Output: System.Reflection.Metadata.Tests.MetadataReaderTests.ValidateConstantTable [FAIL] 2017-11-09 08:30:15,718: INFO: proc(54): run_and_log_output: Output: System.IndexOutOfRangeException : Index was outside the bounds of the array. 2017-11-09 08:30:15,718: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2017-11-09 08:30:15,718: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(398,0): at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) 2017-11-09 08:30:15,718: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(248,0): at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) 2017-11-09 08:30:15,719: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(89,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetPinnedPEImage(Byte[] peImage) 2017-11-09 08:30:15,719: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(78,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Int32& metadataStartOffset, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:15,719: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(73,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:15,720: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(2310,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.ValidateConstantTable() 2017-11-09 08:30:15,720: INFO: proc(54): run_and_log_output: Output: System.Reflection.Metadata.Tests.MetadataReaderTests.ValidateGenericParamTable [FAIL] 2017-11-09 08:30:15,720: INFO: proc(54): run_and_log_output: Output: System.IndexOutOfRangeException : Index was outside the bounds of the array. 2017-11-09 08:30:15,720: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2017-11-09 08:30:15,720: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(398,0): at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) 2017-11-09 08:30:15,721: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(248,0): at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) 2017-11-09 08:30:15,721: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(89,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetPinnedPEImage(Byte[] peImage) 2017-11-09 08:30:15,721: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(78,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Int32& metadataStartOffset, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:15,722: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(73,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:15,722: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(1878,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.ValidateGenericParamTable() 2017-11-09 08:30:15,722: INFO: proc(54): run_and_log_output: Output: System.Reflection.Metadata.Tests.MetadataReaderTests.ValidateTypeRefTableMod [FAIL] 2017-11-09 08:30:15,722: INFO: proc(54): run_and_log_output: Output: System.IndexOutOfRangeException : Index was outside the bounds of the array. 2017-11-09 08:30:15,723: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2017-11-09 08:30:15,723: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(398,0): at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) 2017-11-09 08:30:15,723: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(248,0): at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) 2017-11-09 08:30:15,723: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(89,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetPinnedPEImage(Byte[] peImage) 2017-11-09 08:30:15,724: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(78,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Int32& metadataStartOffset, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:15,724: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(73,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:15,725: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(706,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.ValidateTypeRefTableMod() 2017-11-09 08:30:15,743: INFO: proc(54): run_and_log_output: Output: System.Reflection.Metadata.Tests.MetadataReaderTests.GetCustomAttributes [FAIL] 2017-11-09 08:30:15,744: INFO: proc(54): run_and_log_output: Output: System.IndexOutOfRangeException : Index was outside the bounds of the array. 2017-11-09 08:30:15,744: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2017-11-09 08:30:15,744: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(398,0): at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) 2017-11-09 08:30:15,744: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(248,0): at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) 2017-11-09 08:30:15,744: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(89,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetPinnedPEImage(Byte[] peImage) 2017-11-09 08:30:15,745: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(78,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Int32& metadataStartOffset, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:15,745: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(73,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:15,746: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(2150,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetCustomAttributes() 2017-11-09 08:30:15,769: INFO: proc(54): run_and_log_output: Output: System.Reflection.Metadata.Tests.MetadataReaderTests.ValidateMethodSemanticsTable [FAIL] 2017-11-09 08:30:15,770: INFO: proc(54): run_and_log_output: Output: System.IndexOutOfRangeException : Index was outside the bounds of the array. 2017-11-09 08:30:15,770: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2017-11-09 08:30:15,770: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(398,0): at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) 2017-11-09 08:30:15,771: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(248,0): at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) 2017-11-09 08:30:15,771: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(89,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetPinnedPEImage(Byte[] peImage) 2017-11-09 08:30:15,772: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(78,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Int32& metadataStartOffset, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:15,772: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(73,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:15,773: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(2177,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.ValidateMethodSemanticsTable() 2017-11-09 08:30:15,801: INFO: proc(54): run_and_log_output: Output: System.Reflection.Metadata.Tests.MetadataReaderTests.CanCustomizeReaderUtf8Fallback [FAIL] 2017-11-09 08:30:15,802: INFO: proc(54): run_and_log_output: Output: System.IndexOutOfRangeException : Index was outside the bounds of the array. 2017-11-09 08:30:15,802: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2017-11-09 08:30:15,802: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(398,0): at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) 2017-11-09 08:30:15,802: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(248,0): at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) 2017-11-09 08:30:15,803: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(89,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetPinnedPEImage(Byte[] peImage) 2017-11-09 08:30:15,803: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(78,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Int32& metadataStartOffset, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:15,803: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(144,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.CanCustomizeReaderUtf8Fallback() 2017-11-09 08:30:15,827: INFO: proc(54): run_and_log_output: Output: System.Reflection.Metadata.Tests.MetadataReaderTests.ValidateFieldMarshal [FAIL] 2017-11-09 08:30:15,827: INFO: proc(54): run_and_log_output: Output: System.IndexOutOfRangeException : Index was outside the bounds of the array. 2017-11-09 08:30:15,827: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2017-11-09 08:30:15,827: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(398,0): at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) 2017-11-09 08:30:15,828: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(248,0): at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) 2017-11-09 08:30:15,828: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(89,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetPinnedPEImage(Byte[] peImage) 2017-11-09 08:30:15,828: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(78,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Int32& metadataStartOffset, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:15,829: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(73,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:15,829: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(1976,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.ValidateFieldMarshal() 2017-11-09 08:30:15,845: INFO: proc(54): run_and_log_output: Output: System.Reflection.Metadata.Tests.MetadataReaderTests.ValidateUserStringStream [FAIL] 2017-11-09 08:30:15,845: INFO: proc(54): run_and_log_output: Output: System.IndexOutOfRangeException : Index was outside the bounds of the array. 2017-11-09 08:30:15,845: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2017-11-09 08:30:15,846: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(398,0): at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) 2017-11-09 08:30:15,846: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(248,0): at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) 2017-11-09 08:30:15,846: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(89,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetPinnedPEImage(Byte[] peImage) 2017-11-09 08:30:15,847: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(78,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Int32& metadataStartOffset, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:15,847: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(73,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:15,847: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(2381,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.ValidateUserStringStream() 2017-11-09 08:30:15,858: INFO: proc(54): run_and_log_output: Output: System.Reflection.Metadata.Tests.MetadataReaderTests.ValidateCustomAttribute [FAIL] 2017-11-09 08:30:15,858: INFO: proc(54): run_and_log_output: Output: System.IndexOutOfRangeException : Index was outside the bounds of the array. 2017-11-09 08:30:15,858: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2017-11-09 08:30:15,859: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(398,0): at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) 2017-11-09 08:30:15,859: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(248,0): at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) 2017-11-09 08:30:15,859: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(89,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetPinnedPEImage(Byte[] peImage) 2017-11-09 08:30:15,860: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(78,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Int32& metadataStartOffset, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:15,860: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(73,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:15,860: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(2102,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.ValidateCustomAttribute() 2017-11-09 08:30:15,870: INFO: proc(54): run_and_log_output: Output: System.Reflection.Metadata.Tests.MetadataReaderTests.Bug17109 [FAIL] 2017-11-09 08:30:15,870: INFO: proc(54): run_and_log_output: Output: System.IndexOutOfRangeException : Index was outside the bounds of the array. 2017-11-09 08:30:15,870: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2017-11-09 08:30:15,870: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(398,0): at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) 2017-11-09 08:30:15,871: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(248,0): at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) 2017-11-09 08:30:15,872: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(89,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetPinnedPEImage(Byte[] peImage) 2017-11-09 08:30:15,872: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(78,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Int32& metadataStartOffset, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:15,873: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(73,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:15,873: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(2416,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.Bug17109() 2017-11-09 08:30:16,345: INFO: proc(54): run_and_log_output: Output: System.Reflection.Metadata.Tests.MetadataReaderTests.ValidateSignature [FAIL] 2017-11-09 08:30:16,345: INFO: proc(54): run_and_log_output: Output: System.IndexOutOfRangeException : Index was outside the bounds of the array. 2017-11-09 08:30:16,346: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2017-11-09 08:30:16,346: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(398,0): at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) 2017-11-09 08:30:16,346: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(248,0): at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) 2017-11-09 08:30:16,346: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(89,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetPinnedPEImage(Byte[] peImage) 2017-11-09 08:30:16,347: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(78,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Int32& metadataStartOffset, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:16,347: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(73,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:16,348: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(2219,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.ValidateSignature() 2017-11-09 08:30:16,356: INFO: proc(54): run_and_log_output: Output: System.Reflection.Metadata.Tests.MetadataReaderTests.ValidateModuleRefTableMod [FAIL] 2017-11-09 08:30:16,357: INFO: proc(54): run_and_log_output: Output: System.IndexOutOfRangeException : Index was outside the bounds of the array. 2017-11-09 08:30:16,357: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2017-11-09 08:30:16,357: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(398,0): at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) 2017-11-09 08:30:16,357: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(248,0): at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) 2017-11-09 08:30:16,357: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(89,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetPinnedPEImage(Byte[] peImage) 2017-11-09 08:30:16,358: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(78,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Int32& metadataStartOffset, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:16,358: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(73,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:16,359: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(553,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.ValidateModuleRefTableMod() 2017-11-09 08:30:16,388: INFO: proc(54): run_and_log_output: Output: System.Reflection.Metadata.Tests.MetadataReaderTests.ValidateClassLayoutTable [FAIL] 2017-11-09 08:30:16,388: INFO: proc(54): run_and_log_output: Output: System.IndexOutOfRangeException : Index was outside the bounds of the array. 2017-11-09 08:30:16,388: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2017-11-09 08:30:16,388: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(398,0): at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) 2017-11-09 08:30:16,388: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(248,0): at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) 2017-11-09 08:30:16,389: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(89,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetPinnedPEImage(Byte[] peImage) 2017-11-09 08:30:16,389: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(78,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Int32& metadataStartOffset, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:16,389: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(73,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:16,389: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(1912,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.ValidateClassLayoutTable() 2017-11-09 08:30:16,393: INFO: proc(54): run_and_log_output: Output: System.Reflection.Metadata.Tests.MetadataReaderTests.MemberCollections_TypeMembers_LastTypeDef [FAIL] 2017-11-09 08:30:16,393: INFO: proc(54): run_and_log_output: Output: System.IndexOutOfRangeException : Index was outside the bounds of the array. 2017-11-09 08:30:16,393: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2017-11-09 08:30:16,394: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(398,0): at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) 2017-11-09 08:30:16,394: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(248,0): at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) 2017-11-09 08:30:16,394: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(89,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetPinnedPEImage(Byte[] peImage) 2017-11-09 08:30:16,394: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(78,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Int32& metadataStartOffset, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:16,395: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(73,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:16,395: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(2621,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.MemberCollections_TypeMembers_LastTypeDef() 2017-11-09 08:30:16,399: INFO: proc(54): run_and_log_output: Output: System.Reflection.Metadata.Tests.MetadataReaderTests.EmptyType [FAIL] 2017-11-09 08:30:16,399: INFO: proc(54): run_and_log_output: Output: System.IndexOutOfRangeException : Index was outside the bounds of the array. 2017-11-09 08:30:16,400: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2017-11-09 08:30:16,400: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(398,0): at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) 2017-11-09 08:30:16,400: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(248,0): at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) 2017-11-09 08:30:16,400: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(89,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetPinnedPEImage(Byte[] peImage) 2017-11-09 08:30:16,400: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(78,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Int32& metadataStartOffset, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:16,401: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(73,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:16,401: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(2394,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.EmptyType() 2017-11-09 08:30:16,404: INFO: proc(54): run_and_log_output: Output: System.Reflection.Metadata.Tests.MetadataReaderTests.MemberCollections_AllMembers [FAIL] 2017-11-09 08:30:16,405: INFO: proc(54): run_and_log_output: Output: System.IndexOutOfRangeException : Index was outside the bounds of the array. 2017-11-09 08:30:16,405: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2017-11-09 08:30:16,405: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(398,0): at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) 2017-11-09 08:30:16,405: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(248,0): at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) 2017-11-09 08:30:16,405: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(89,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetPinnedPEImage(Byte[] peImage) 2017-11-09 08:30:16,406: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(78,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Int32& metadataStartOffset, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:16,406: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(73,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:16,406: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(2486,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.MemberCollections_AllMembers() 2017-11-09 08:30:16,411: INFO: proc(54): run_and_log_output: Output: System.Reflection.Metadata.Tests.MetadataReaderTests.MemberCollections_TypeMembers_FirstTypeDef [FAIL] 2017-11-09 08:30:16,411: INFO: proc(54): run_and_log_output: Output: System.IndexOutOfRangeException : Index was outside the bounds of the array. 2017-11-09 08:30:16,411: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2017-11-09 08:30:16,411: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(398,0): at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) 2017-11-09 08:30:16,411: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(248,0): at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) 2017-11-09 08:30:16,412: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(89,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetPinnedPEImage(Byte[] peImage) 2017-11-09 08:30:16,412: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(78,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Int32& metadataStartOffset, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:16,412: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(73,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:16,412: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(2551,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.MemberCollections_TypeMembers_FirstTypeDef() 2017-11-09 08:30:16,415: INFO: proc(54): run_and_log_output: Output: System.Reflection.Metadata.Tests.MetadataReaderTests.ValidateMethodImplTable [FAIL] 2017-11-09 08:30:16,415: INFO: proc(54): run_and_log_output: Output: System.IndexOutOfRangeException : Index was outside the bounds of the array. 2017-11-09 08:30:16,416: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2017-11-09 08:30:16,416: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(398,0): at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) 2017-11-09 08:30:16,416: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(248,0): at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) 2017-11-09 08:30:16,416: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(89,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetPinnedPEImage(Byte[] peImage) 2017-11-09 08:30:16,416: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(78,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Int32& metadataStartOffset, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:16,417: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(73,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:16,417: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(2039,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.ValidateMethodImplTable() 2017-11-09 08:30:16,424: INFO: proc(54): run_and_log_output: Output: System.Reflection.Metadata.Tests.MetadataReaderTests.ValidateInterfaceImplTableMod [FAIL] 2017-11-09 08:30:16,424: INFO: proc(54): run_and_log_output: Output: System.IndexOutOfRangeException : Index was outside the bounds of the array. 2017-11-09 08:30:16,424: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2017-11-09 08:30:16,424: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(398,0): at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) 2017-11-09 08:30:16,424: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(248,0): at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) 2017-11-09 08:30:16,425: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(89,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetPinnedPEImage(Byte[] peImage) 2017-11-09 08:30:16,425: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(78,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Int32& metadataStartOffset, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:16,425: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(73,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:16,425: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(1807,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.ValidateInterfaceImplTableMod() 2017-11-09 08:30:16,430: INFO: proc(54): run_and_log_output: Output: System.Reflection.Metadata.Tests.MetadataReaderTests.CannotInstantiateReaderWithNonUtf8Decoder [FAIL] 2017-11-09 08:30:16,430: INFO: proc(54): run_and_log_output: Output: Assert.Throws() Failure 2017-11-09 08:30:16,430: INFO: proc(54): run_and_log_output: Output: Expected: typeof(System.ArgumentException) 2017-11-09 08:30:16,430: INFO: proc(54): run_and_log_output: Output: Actual: typeof(System.IndexOutOfRangeException): Index was outside the bounds of the array. 2017-11-09 08:30:16,430: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2017-11-09 08:30:16,430: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(398,0): at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) 2017-11-09 08:30:16,430: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(248,0): at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) 2017-11-09 08:30:16,431: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(89,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetPinnedPEImage(Byte[] peImage) 2017-11-09 08:30:16,431: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(78,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Int32& metadataStartOffset, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:16,431: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(73,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:16,431: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(133,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.<>c__DisplayClass8_0.<CannotInstantiateReaderWithNonUtf8Decoder>b__0() 2017-11-09 08:30:16,436: INFO: proc(54): run_and_log_output: Output: System.Reflection.Metadata.Tests.MetadataReaderTests.ValidateFieldLayoutTable [FAIL] 2017-11-09 08:30:16,436: INFO: proc(54): run_and_log_output: Output: System.IndexOutOfRangeException : Index was outside the bounds of the array. 2017-11-09 08:30:16,436: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2017-11-09 08:30:16,436: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(398,0): at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) 2017-11-09 08:30:16,436: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(248,0): at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) 2017-11-09 08:30:16,437: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(89,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetPinnedPEImage(Byte[] peImage) 2017-11-09 08:30:16,437: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(78,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Int32& metadataStartOffset, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:16,437: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(73,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:16,437: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(1943,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.ValidateFieldLayoutTable() 2017-11-09 08:30:16,449: INFO: proc(54): run_and_log_output: Output: System.Reflection.Metadata.Tests.MetadataReaderTests.ValidateInterfaceImplTable [FAIL] 2017-11-09 08:30:16,449: INFO: proc(54): run_and_log_output: Output: System.IndexOutOfRangeException : Index was outside the bounds of the array. 2017-11-09 08:30:16,449: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2017-11-09 08:30:16,450: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(398,0): at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) 2017-11-09 08:30:16,450: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(248,0): at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) 2017-11-09 08:30:16,450: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(89,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetPinnedPEImage(Byte[] peImage) 2017-11-09 08:30:16,450: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(78,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Int32& metadataStartOffset, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:16,451: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(73,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:16,451: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(2009,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.ValidateInterfaceImplTable() 2017-11-09 08:30:16,459: INFO: proc(54): run_and_log_output: Output: System.Reflection.Metadata.Tests.MetadataReaderTests.MemberCollections_TypeMembers_MiddleTypeDef [FAIL] 2017-11-09 08:30:16,459: INFO: proc(54): run_and_log_output: Output: System.IndexOutOfRangeException : Index was outside the bounds of the array. 2017-11-09 08:30:16,459: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2017-11-09 08:30:16,459: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(398,0): at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) 2017-11-09 08:30:16,460: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(248,0): at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) 2017-11-09 08:30:16,460: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(89,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetPinnedPEImage(Byte[] peImage) 2017-11-09 08:30:16,460: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(78,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Int32& metadataStartOffset, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:16,460: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(73,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:16,460: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(2576,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.MemberCollections_TypeMembers_MiddleTypeDef() 2017-11-09 08:30:16,463: INFO: proc(54): run_and_log_output: Output: System.Reflection.Metadata.Tests.MetadataReaderTests.OtherAccessors [FAIL] 2017-11-09 08:30:16,463: INFO: proc(54): run_and_log_output: Output: System.IndexOutOfRangeException : Index was outside the bounds of the array. 2017-11-09 08:30:16,463: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2017-11-09 08:30:16,463: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(398,0): at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) 2017-11-09 08:30:16,463: INFO: proc(54): run_and_log_output: Output: /Users/buildagent/agent/_work/128/s/src/mscorlib/src/System/Collections/Generic/Dictionary.cs(248,0): at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) 2017-11-09 08:30:16,463: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(89,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetPinnedPEImage(Byte[] peImage) 2017-11-09 08:30:16,464: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(78,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Int32& metadataStartOffset, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:16,464: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(73,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) 2017-11-09 08:30:16,464: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs(2436,0): at System.Reflection.Metadata.Tests.MetadataReaderTests.OtherAccessors() ``` 25149 area-System.Data SqlException: Cannot access Kerberos ticket. Ensure Kerberos has been initialized with 'kinit'. I am trying to connect to mssql using integrated security credential, dotnet core 2.0 runtime/sdk, running on Macox 10.12.6, dot net core version 2.0.2 tried setting up kinit, i also see klist - list the credential. tried to set up open ssl. got following exception, any pointers `SqlException: Cannot access Kerberos ticket. Ensure Kerberos has been initialized with 'kinit'. ErrorCode=InternalError, Exception=Interop+NetSecurityNative+GssApiException: GSSAPI operation failed with error - An unsupported mechanism was requested (unknown mech-code 0 for mech unknown). at System.Net.Security.NegotiateStreamPal.GssInitSecurityContext(SafeGssContextHandle& context, SafeGssCredHandle credential, Boolean isNtlm, SafeGssNameHandle targetName, GssFlags inFlags, Byte[] buffer, Byte[]& outputBuffer, UInt32& outFlags, Int32& isNtlmUsed) at System.Net.Security.NegotiateStreamPal.EstablishSecurityContext(SafeFreeNegoCredentials credential, SafeDeleteContext& context, String targetName, ContextFlagsPal inFlags, SecurityBuffer inputBuffer, SecurityBuffer outputBuffer, ContextFlagsPal& outFlags) at System.Data.SqlClient.SNI.SNIProxy.GenSspiClientContext(SspiClientContextStatus sspiClientContextStatus, Byte[] receivedBuff, Byte[]& sendBuff, Byte[] serverName) at System.Data.SqlClient.SNI.TdsParserStateObjectManaged.GenerateSspiClientContext(Byte[] receivedBuff, UInt32 receivedLength, Byte[]& sendBuff, UInt32& sendLength, Byte[] _sniSpnBuffer) at System.Data.SqlClient.TdsParser.SNISSPIData(Byte[] receivedBuff, UInt32 receivedLength, Byte[]& sendBuff, UInt32& sendLength)` -vimal 25153 area-Serialization Area-Serialization Sprint 127 The issue is for tracking issues to be done in sprint 127 (due by 11/30/2017) 25154 area-System.Threading Document that CancellationToken in Stream.ReadAsync() is advisory At https://docs.microsoft.com/en-us/dotnet/api/system.io.stream.readasync?view=netframework-4.7.1 I read: > If the operation is canceled before it completes, the returned task contains the [`Canceled`](https://docs.microsoft.com/en-us/dotnet/api/system.threading.tasks.taskstatus.canceled?view=netframework-4.7.1) value for the [`Status`](https://docs.microsoft.com/en-us/dotnet/api/system.threading.tasks.task.status?view=netframework-4.7.1) property. As described in #15033, this is not true in actual practice. Especially because `NetworkStream.ReadAsync()` ignores the `CancellationToken` altogether. Thus, I think the documentation for `Stream.ReadAsync()` should be changed to indicate that the parameter is advisory. For code accepting a `Stream`, there is no way (without reflection which should not be required of consumers—and, even with reflection, one may be consuming a stream which wraps `NetworkStream`) to tell if the `CancellationToken` will be ignored or not. So such code always needs to be written in such a way as to support streams with uncancellable read (and write?) operations. 25157 area-System.Diagnostics System.DllNotFoundException: Unable to load DLL 'libproc': "_From @livarcocc on October 6, 2017 16:16_ _From @Petermarcu on October 6, 2017 16:3_ @m2b commented on [Thu Apr 20 2017](https://github.com/dotnet/core/issues/599) **Here is the simple test project code** using System; using Xunit; namespace ITVizion.ActionBoard.RepositoryInMemory { public class Test { [Fact] public void Test1() { Assert.Equal(1,1); } } } ========================================================================= **Here is the command window output. dotnet crashes!** blackielanetMBP:actionboard.git blackie$ dotnet test ITVizion.ActionBoard.RepositoryInMemory.Test/ITVizion.ActionBoard.RepositoryInMemory.Test.csproj Welcome to .NET Core! --------------------- Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs. Telemetry -------------- The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry. Configuring... ------------------- A command is running to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once. Decompressing 100% 5896 ms Expanding 100% 7278 ms Failed to create prime the NuGet cache. restore failed with: 134 Unhandled Exception: System.DllNotFoundException: Unable to load DLL 'libproc': The specified module could not be found. (Exception from HRESULT: 0x8007007E) at Interop.libproc.proc_pidpath(Int32 pid, Byte* buffer, UInt32 bufferSize) at Interop.libproc.proc_pidpath(Int32 pid) at System.Diagnostics.Process.ResolvePath(String filename) at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at Microsoft.DotNet.Cli.ForwardingApp.Execute() at Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingApp.Execute() at Microsoft.DotNet.Tools.Test.TestCommand.<>c__DisplayClass0_0.<Run>b__0() at Microsoft.DotNet.Cli.CommandLine.CommandLineApplication.Execute(String[] args) at Microsoft.DotNet.Tools.Test.TestCommand.Run(String[] args) at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, ITelemetry telemetryClient) at Microsoft.DotNet.Cli.Program.Main(String[] args) Abort trap: 6 ========================================================================= **Here is the Mac Problem Report** Process: dotnet [26183] Path: /usr/local/share/dotnet/dotnet Identifier: dotnet Version: 0 Code Type: X86-64 (Native) Parent Process: dotnet [26170] Responsible: dotnet [26183] User ID: 501 Date/Time: 2017-04-20 17:28:26.552 -0700 OS Version: Mac OS X 10.12.4 (16E195) Report Version: 12 Anonymous UUID: E3FC06FA-F158-98C8-DDAD-74F8F018A97A Sleep/Wake UUID: ECCEF7E0-8ED4-4B9C-9EF0-00E0D60B0BBE Time Awake Since Boot: 470000 seconds Time Since Wake: 5600 seconds System Integrity Protection: disabled Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Application Specific Information: abort() called Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libsystem_kernel.dylib 0x00007fffa33bed42 __pthread_kill + 10 1 libsystem_pthread.dylib 0x00007fffa34ac5bf pthread_kill + 90 2 libsystem_c.dylib 0x00007fffa3324420 abort + 129 3 libcoreclr.dylib 0x0000000104dc1312 PROCEndProcess(void*, unsigned int, int) + 226 4 libcoreclr.dylib 0x00000001050928c1 UnwindManagedExceptionPass1(PAL_SEHException&, _CONTEXT*) + 833 5 libcoreclr.dylib 0x0000000105092979 DispatchManagedException(PAL_SEHException&, bool) + 73 6 libcoreclr.dylib 0x0000000104f1c6c9 PreStubWorker + 937 7 libcoreclr.dylib 0x00000001050a0579 ThePreStub + 92 8 ??? 0x000000010c1cad79 0 + 4498173305 9 ??? 0x000000010c1c66b1 0 + 4498155185 10 ??? 0x000000010c1c6181 0 + 4498153857 11 ??? 0x000000010c1c51cb 0 + 4498149835 12 ??? 0x000000010bc5cabd 0 + 4492479165 13 ??? 0x000000010bc574b2 0 + 4492457138 14 ??? 0x000000010bc6271b 0 + 4492502811 15 ??? 0x000000010bc5f21f 0 + 4492489247 16 ??? 0x000000010bc55bc2 0 + 4492450754 17 ??? 0x000000010bc5d4df 0 + 4492481759 18 ??? 0x000000010bc5cf8d 0 + 4492480397 19 libcoreclr.dylib 0x000000010509f9a1 CallDescrWorkerInternal + 124 20 libcoreclr.dylib 0x0000000104f8bb43 MethodDescCallSite::CallTargetWorker(unsigned long const*, unsigned long*, int) + 707 21 libcoreclr.dylib 0x0000000104e59fc4 RunMain(MethodDesc*, short, int*, PtrArray**) + 932 22 libcoreclr.dylib 0x0000000104e5a18d Assembly::ExecuteMainMethod(PtrArray**, int) + 221 23 libcoreclr.dylib 0x0000000104e9762a CorHost2::ExecuteAssembly(unsigned int, char16_t const*, int, char16_t const**, unsigned int*) + 442 24 libcoreclr.dylib 0x0000000104dca4f3 coreclr_execute_assembly + 259 25 libhostpolicy.dylib 0x0000000104d027e8 coreclr::execute_assembly(void*, unsigned int, int, char const**, char const*, unsigned int*) + 152 26 libhostpolicy.dylib 0x0000000104cf1388 run(arguments_t const&) + 20568 27 libhostpolicy.dylib 0x0000000104cf1d0d corehost_main + 1405 28 libhostfxr.dylib 0x0000000104c3c90e execute_app(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, corehost_init_t*, int, char const**) + 446 29 libhostfxr.dylib 0x0000000104c52679 fx_muxer_t::read_config_and_execute(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > > > const&, int, char const**, host_mode_t) + 8441 30 libhostfxr.dylib 0x0000000104c504a9 fx_muxer_t::parse_args_and_execute(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, int, char const**, bool, host_mode_t, bool*) + 8425 31 libhostfxr.dylib 0x0000000104c53a09 fx_muxer_t::execute(int, char const**) + 4537 32 libhostfxr.dylib 0x0000000104c3c985 hostfxr_main + 53 33 dotnet 0x0000000104b707ac run(int, char const**) + 1420 34 dotnet 0x0000000104b708ee main + 158 35 libdyld.dylib 0x00007fffa3290235 start + 1 Thread 1: 0 libsystem_kernel.dylib 0x00007fffa33b734a mach_msg_trap + 10 1 libsystem_kernel.dylib 0x00007fffa33b6797 mach_msg + 55 2 libcoreclr.dylib 0x0000000104dc761a MachMessage::Receive(unsigned int) + 74 3 libcoreclr.dylib 0x0000000104dc6539 SEHExceptionThread(void*) + 105 4 libsystem_pthread.dylib 0x00007fffa34a99af _pthread_body + 180 5 libsystem_pthread.dylib 0x00007fffa34a98fb _pthread_start + 286 6 libsystem_pthread.dylib 0x00007fffa34a9101 thread_start + 13 Thread 2: 0 libsystem_kernel.dylib 0x00007fffa33c019e poll + 10 1 libcoreclr.dylib 0x0000000104db9afe CorUnix::CPalSynchronizationManager::ThreadPrepareForShutdown() + 30 2 libcoreclr.dylib 0x0000000104dbb729 CorUnix::CPalSynchronizationManager::WorkerThread(void*) + 1177 3 libcoreclr.dylib 0x0000000104dc3e48 CorUnix::CPalThread::ThreadEntry(void*) + 328 4 libsystem_pthread.dylib 0x00007fffa34a99af _pthread_body + 180 5 libsystem_pthread.dylib 0x00007fffa34a98fb _pthread_start + 286 6 libsystem_pthread.dylib 0x00007fffa34a9101 thread_start + 13 Thread 3: 0 libsystem_kernel.dylib 0x00007fffa33bea3e __open + 10 1 libcoreclr.dylib 0x0000000104e36b0f TwoWayPipe::WaitForConnection() + 31 2 libcoreclr.dylib 0x0000000104e2e8c1 DbgTransportSession::TransportWorker() + 145 3 libcoreclr.dylib 0x0000000104e2d4e9 DbgTransportSession::TransportWorkerStatic(void*) + 9 4 libcoreclr.dylib 0x0000000104dc3e48 CorUnix::CPalThread::ThreadEntry(void*) + 328 5 libsystem_pthread.dylib 0x00007fffa34a99af _pthread_body + 180 6 libsystem_pthread.dylib 0x00007fffa34a98fb _pthread_start + 286 7 libsystem_pthread.dylib 0x00007fffa34a9101 thread_start + 13 Thread 4: 0 libsystem_kernel.dylib 0x00007fffa33bebf2 __psynch_cvwait + 10 1 libsystem_pthread.dylib 0x00007fffa34aa86e _pthread_cond_wait + 712 2 libcoreclr.dylib 0x0000000104db97a2 CorUnix::CPalSynchronizationManager::ThreadNativeWait(CorUnix::_ThreadNativeWaitData*, unsigned int, CorUnix::ThreadWakeupReason*, unsigned int*) + 306 3 libcoreclr.dylib 0x0000000104db93f6 CorUnix::CPalSynchronizationManager::BlockThread(CorUnix::CPalThread*, unsigned int, bool, bool, CorUnix::ThreadWakeupReason*, unsigned int*) + 390 4 libcoreclr.dylib 0x0000000104dbe3e8 CorUnix::InternalWaitForMultipleObjectsEx(CorUnix::CPalThread*, unsigned int, void* const*, int, unsigned int, int) + 1912 5 libcoreclr.dylib 0x0000000104e2bc73 DebuggerRCThread::MainLoop() + 755 6 libcoreclr.dylib 0x0000000104e2b927 DebuggerRCThread::ThreadProc() + 263 7 libcoreclr.dylib 0x0000000104e2b5d4 DebuggerRCThread::ThreadProcStatic(void*) + 132 8 libcoreclr.dylib 0x0000000104dc3e48 CorUnix::CPalThread::ThreadEntry(void*) + 328 9 libsystem_pthread.dylib 0x00007fffa34a99af _pthread_body + 180 10 libsystem_pthread.dylib 0x00007fffa34a98fb _pthread_start + 286 11 libsystem_pthread.dylib 0x00007fffa34a9101 thread_start + 13 Thread 5: 0 libsystem_kernel.dylib 0x00007fffa33bebf2 __psynch_cvwait + 10 1 libsystem_pthread.dylib 0x00007fffa34aa86e _pthread_cond_wait + 712 2 libcoreclr.dylib 0x0000000104db9785 CorUnix::CPalSynchronizationManager::ThreadNativeWait(CorUnix::_ThreadNativeWaitData*, unsigned int, CorUnix::ThreadWakeupReason*, unsigned int*) + 277 3 libcoreclr.dylib 0x0000000104db93f6 CorUnix::CPalSynchronizationManager::BlockThread(CorUnix::CPalThread*, unsigned int, bool, bool, CorUnix::ThreadWakeupReason*, unsigned int*) + 390 4 libcoreclr.dylib 0x0000000104dbe3e8 CorUnix::InternalWaitForMultipleObjectsEx(CorUnix::CPalThread*, unsigned int, void* const*, int, unsigned int, int) + 1912 5 libcoreclr.dylib 0x0000000104dbe636 WaitForSingleObjectEx + 70 6 libcoreclr.dylib 0x000000010507b340 CLREventBase::WaitEx(unsigned int, WaitMode, PendingSync*) + 176 7 libcoreclr.dylib 0x0000000104fd0e6f FinalizerThread::WaitForFinalizerEvent(CLREvent*) + 31 8 libcoreclr.dylib 0x0000000104fd0fe3 FinalizerThread::FinalizerThreadWorker(void*) + 115 9 libcoreclr.dylib 0x0000000104f4b15a ManagedThreadBase_DispatchOuter(ManagedThreadCallState*) + 378 10 libcoreclr.dylib 0x0000000104f4b859 ManagedThreadBase::FinalizerBase(void (*)(void*)) + 73 11 libcoreclr.dylib 0x0000000104fd13cc FinalizerThread::FinalizerThreadStart(void*) + 204 12 libcoreclr.dylib 0x0000000104dc3e48 CorUnix::CPalThread::ThreadEntry(void*) + 328 13 libsystem_pthread.dylib 0x00007fffa34a99af _pthread_body + 180 14 libsystem_pthread.dylib 0x00007fffa34a98fb _pthread_start + 286 15 libsystem_pthread.dylib 0x00007fffa34a9101 thread_start + 13 Thread 6: 0 libsystem_kernel.dylib 0x00007fffa33b734a mach_msg_trap + 10 1 libsystem_kernel.dylib 0x00007fffa33b6797 mach_msg + 55 2 libclrjit.dylib 0x0000000105bb174a MachMessage::Receive(unsigned int) + 74 3 libclrjit.dylib 0x0000000105bb0669 SEHExceptionThread(void*) + 105 4 libsystem_pthread.dylib 0x00007fffa34a99af _pthread_body + 180 5 libsystem_pthread.dylib 0x00007fffa34a98fb _pthread_start + 286 6 libsystem_pthread.dylib 0x00007fffa34a9101 thread_start + 13 Thread 7: 0 libsystem_kernel.dylib 0x00007fffa33bf44e __workq_kernreturn + 10 1 libsystem_pthread.dylib 0x00007fffa34a9695 _pthread_wqthread + 1426 2 libsystem_pthread.dylib 0x00007fffa34a90f1 start_wqthread + 13 Thread 0 crashed with X86 Thread State (64-bit): rax: 0x0000000000000000 rbx: 0x0000000000000006 rcx: 0x00007fff5b0927c8 rdx: 0x0000000000000000 rdi: 0x0000000000000307 rsi: 0x0000000000000006 rbp: 0x00007fff5b0927f0 rsp: 0x00007fff5b0927c8 r8: 0x00007faa1b8088f8 r9: 0x00000000007a682f r10: 0x0000000008000000 r11: 0x0000000000000206 r12: 0x00007fff5b092e30 r13: 0x0000000000000000 r14: 0x00007fffac1f43c0 r15: 0x0000000000000000 rip: 0x00007fffa33bed42 rfl: 0x0000000000000206 cr2: 0x00007fffac1d6128 Logical CPU: 0 Error Code: 0x02000148 Trap Number: 133 Binary Images: 0x104b65000 - 0x104b81ff3 +dotnet (0) <3D909F9D-70EC-3599-8378-D1E3D3F3C4C2> /usr/local/share/dotnet/dotnet 0x104bbf000 - 0x104c62ff7 +libhostfxr.dylib (0) <C0FDA7FE-45E6-3289-8926-3DA0A4901323> /usr/local/share/dotnet/host/fxr/1.1.0/libhostfxr.dylib 0x104c8c000 - 0x104d48ff3 +libhostpolicy.dylib (0) <BFE7338C-2137-3433-A8F8-FEB0390BAF83> /usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.1.1/libhostpolicy.dylib 0x104d79000 - 0x10529cfff +libcoreclr.dylib (0) <40FA6CB2-53C9-3176-8516-FE40B2D8F3C8> /usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.1.1/libcoreclr.dylib 0x1055cc000 - 0x105609dc7 dyld (433.5) <8239D0D7-66F6-3C44-A77F-586F74525DA3> /usr/lib/dyld 0x1059f4000 - 0x105bf6fff +libclrjit.dylib (0) <C4B9490D-6AC6-3CEE-9A9C-90495E36699C> /usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.1.1/libclrjit.dylib 0x105cc0000 - 0x105cc8fff +System.Globalization.Native.dylib (0) <60FCF655-55BA-37A9-924C-157C9E8E7AC1> /usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.1.1/System.Globalization.Native.dylib 0x10759d000 - 0x1075a4ffb +System.Native.dylib (0) <5F1F2A95-1960-379D-A897-AF4F76F06D11> /usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.1.1/System.Native.dylib 0x7fff8a057000 - 0x7fff8a057fff com.apple.Accelerate (1.11 - Accelerate 1.11) <D7745BB9-42FD-3443-9265-151413E4C8AD> /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate 0x7fff8a070000 - 0x7fff8a6b0fe3 com.apple.vImage (8.1 - ???) <B1786726-6477-327E-83F4-8EFF4D15DFAC> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage 0x7fff8a6b1000 - 0x7fff8a878fef libBLAS.dylib (1185.50.4) <7AF8DB9A-E33B-30EB-8767-87AFB951E231> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 0x7fff8a879000 - 0x7fff8a890fff libBNNS.dylib (15) <26F32264-148E-35E5-A280-CA035CB3D6F0> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBNNS.dylib 0x7fff8a891000 - 0x7fff8ac9cfff libLAPACK.dylib (1185.50.4) <51B2BABA-F736-3663-885A-65A8991D3560> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib 0x7fff8ac9d000 - 0x7fff8acb3fff libLinearAlgebra.dylib (1185.50.4) <0EC25E70-05DC-3615-85B6-81721566CF1D> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLinearAlgebra.dylib 0x7fff8acb4000 - 0x7fff8acbafff libQuadrature.dylib (3) <EF56C8E6-DE22-3C69-B543-A8648F335FDD> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libQuadrature.dylib 0x7fff8acbb000 - 0x7fff8acceff7 libSparseBLAS.dylib (1185.50.4) <0BDCF6A7-0228-3719-81C7-B6EBC7911320> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparseBLAS.dylib 0x7fff8accf000 - 0x7fff8ae1cff7 libvDSP.dylib (600) <9D9CFF97-2A64-341A-AB35-DC0C76068B9C> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib 0x7fff8ae1d000 - 0x7fff8aed4fff libvMisc.dylib (600) <661B825D-274E-3B85-B160-89873AD65A62> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib 0x7fff8aed5000 - 0x7fff8aed5fff com.apple.Accelerate.vecLib (3.11 - vecLib 3.11) <B8F2814E-0927-3905-A394-EFEB5636DE76> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib 0x7fff8bf7f000 - 0x7fff8bf7ffff com.apple.ApplicationServices (48 - 48) <847E54B5-DEA4-3B50-93CE-4FC67789F179> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices 0x7fff8bf80000 - 0x7fff8bfeeff7 com.apple.ApplicationServices.ATS (377 - 422.2) <012ACEE0-9A90-3998-8495-734E105117C0> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS 0x7fff8c088000 - 0x7fff8c1b7ff7 libFontParser.dylib (194.11) <635DF6EF-18DF-3D06-90AA-88C509B43068> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontParser.dylib 0x7fff8c1b8000 - 0x7fff8c202fff libFontRegistry.dylib (196.4) <EA96AE47-3369-3DEA-BB82-98348ADBD85B> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontRegistry.dylib 0x7fff8c2fe000 - 0x7fff8c3a8ff7 com.apple.ColorSync (4.12.0 - 502.2) <ACA4001E-A0E3-33F6-9CD6-EEC2AA15E322> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSync.framework/Versions/A/ColorSync 0x7fff8c3a9000 - 0x7fff8c3f9ff7 com.apple.HIServices (1.22 - 591) <D16A5699-F3A2-3AF5-93B1-9E2F487F1577> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices 0x7fff8c3fa000 - 0x7fff8c409ff3 com.apple.LangAnalysis (1.7.0 - 1.7.0) <2CBE7F61-2056-3F96-99A1-0D527796AFA6> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LangAnalysis.framework/Versions/A/LangAnalysis 0x7fff8c40a000 - 0x7fff8c457fff com.apple.print.framework.PrintCore (12 - 491) <5027FD58-F0EE-33E4-8577-934CA06CD2AF> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore 0x7fff8c458000 - 0x7fff8c493fff com.apple.QD (3.12 - 313) <B339C41D-8CDF-3342-8414-F9717DCCADD4> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD 0x7fff8c494000 - 0x7fff8c49fff7 com.apple.speech.synthesis.framework (6.3.3 - 6.3.3) <5808F070-8199-36C9-B3C9-F9B98D5AA359> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis 0x7fff8c4a0000 - 0x7fff8c6acfff com.apple.audio.toolbox.AudioToolbox (1.14 - 1.14) <6EEF498D-8233-3622-B34B-49FDD9D4DF14> /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox 0x7fff8c816000 - 0x7fff8cbf0ff7 com.apple.CFNetwork (811.4.18 - 811.4.18) <9CE329E8-6177-3474-976D-F5C63FC875CD> /System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork 0x7fff8d20c000 - 0x7fff8d299fff com.apple.audio.CoreAudio (4.3.0 - 4.3.0) <184D9C49-248F-3374-944C-FD1A99A6B32E> /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio 0x7fff8d2ae000 - 0x7fff8d5adff3 com.apple.CoreData (120 - 754.2) <C9933C8C-85D5-3FB9-8D6D-DB80AB3F496B> /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData 0x7fff8d65b000 - 0x7fff8daeefff com.apple.CoreFoundation (6.9 - 1349.65) <2B7C4BA4-D69E-3651-93DF-3930880B5084> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation 0x7fff8daef000 - 0x7fff8e192ff7 com.apple.CoreGraphics (2.0 - 1070.22) <1676F5EC-AEE3-3C52-97C4-43CBF705EA2A> /System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics 0x7fff8e53b000 - 0x7fff8e53bfff com.apple.CoreServices (775.19 - 775.19) <8AA95E32-AB13-3792-B248-FA150D8E6583> /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices 0x7fff8e53c000 - 0x7fff8e58dfff com.apple.AE (712.5 - 712.5) <F0B36ABC-C0D4-370E-8257-11A7F351EC7F> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE 0x7fff8e58e000 - 0x7fff8e869ff7 com.apple.CoreServices.CarbonCore (1159.6 - 1159.6) <08AC074C-965B-3EDF-8E45-0707C8DE9EAD> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore 0x7fff8e86a000 - 0x7fff8e89dfff com.apple.DictionaryServices (1.2 - 274) <D23866E2-F7C8-3984-A9D4-96552CCDE573> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices 0x7fff8e89e000 - 0x7fff8e8a6ff3 com.apple.CoreServices.FSEvents (1230.50.1 - 1230.50.1) <2AD1B0E5-7214-37C4-8D11-A27C9CAC0F74> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents 0x7fff8e8a7000 - 0x7fff8ea13ff7 com.apple.LaunchServices (775.19 - 775.19) <1CF81B5F-BA1A-3FC6-B4F9-E0A319AE94D0> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices 0x7fff8ea14000 - 0x7fff8eac4ffb com.apple.Metadata (10.7.0 - 1075.40) <F205A001-250D-3D9A-8375-0F7A834C46E6> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata 0x7fff8eac5000 - 0x7fff8eb24fff com.apple.CoreServices.OSServices (775.19 - 775.19) <724312AC-5CE8-333C-BC35-BC5AB1583D9A> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices 0x7fff8eb25000 - 0x7fff8eb95fff com.apple.SearchKit (1.4.0 - 1.4.0) <7A6DDA2B-03F1-3137-BA9E-1CC211973E26> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit 0x7fff8eb96000 - 0x7fff8ebdbff7 com.apple.coreservices.SharedFileList (38 - 38) <DA096678-93AB-3291-BDE2-482F1D544589> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList 0x7fff8ec64000 - 0x7fff8edb0ff3 com.apple.CoreText (352.0 - 544.12) <1ED17C4A-9E2D-3537-8C5F-FB675492A002> /System/Library/Frameworks/CoreText.framework/Versions/A/CoreText 0x7fff8ef56000 - 0x7fff8ef5bfff com.apple.DiskArbitration (2.7 - 2.7) <A4DCD470-D8EA-37E9-BDCA-A2B469754C12> /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration 0x7fff8f0ed000 - 0x7fff8f493ff3 com.apple.Foundation (6.9 - 1349.64) <49C8DA40-9E5B-33F9-B092-F50115B59E95> /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation 0x7fff8f4bf000 - 0x7fff8f4f0ff7 com.apple.GSS (4.0 - 2.0) <6FADED0B-0425-3567-A75A-040C5A4638EB> /System/Library/Frameworks/GSS.framework/Versions/A/GSS 0x7fff8f654000 - 0x7fff8f6e9fff com.apple.framework.IOKit (2.0.2 - 1324.50.21) <BA7DC917-35A9-3D1B-BBEC-ADF4495A166D> /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit 0x7fff8f6ea000 - 0x7fff8f6f0ffb com.apple.IOSurface (159.6 - 159.6) <661BFCC0-85AB-3343-853E-3797932871D4> /System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface 0x7fff8f743000 - 0x7fff8f8a5fff com.apple.ImageIO.framework (3.3.0 - 1599.7) <EFABDE90-A1B0-3211-978B-FF1414355087> /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO 0x7fff8f8a6000 - 0x7fff8f8aafff libGIF.dylib (1599.7) <6004F3A9-A9F3-3287-A105-72870ED4537A> /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib 0x7fff8f8ab000 - 0x7fff8f99cff7 libJP2.dylib (1599.7) <447C19DA-1EC7-3145-9C03-392084CEC012> /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJP2.dylib 0x7fff8f99d000 - 0x7fff8f9c0fff libJPEG.dylib (1599.7) <CA292CD5-38A5-33B2-B84C-185E46ABDD85> /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib 0x7fff8f9c1000 - 0x7fff8f9e7fff libPng.dylib (1599.7) <5EFC9938-CA0F-3AAD-AB70-210089939A74> /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib 0x7fff8f9e8000 - 0x7fff8f9eaff3 libRadiance.dylib (1599.7) <AE2355C1-1C5F-3F41-A156-3D0CE09FBF6D> /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib 0x7fff8f9eb000 - 0x7fff8fa39ff7 libTIFF.dylib (1599.7) <5CE8FC45-4B15-355F-AF40-8A98F0ADC9CF> /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib 0x7fff907a0000 - 0x7fff907b9ff7 com.apple.Kerberos (3.0 - 1) <B9D242EB-E325-3A21-9812-C77CBBFB0D51> /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos 0x7fff918dc000 - 0x7fff918e4fff com.apple.NetFS (6.0 - 4.0) <14A24D00-5673-330A-959D-87F72040DEFF> /System/Library/Frameworks/NetFS.framework/Versions/A/NetFS 0x7fff91cdb000 - 0x7fff91cf4ffb com.apple.CFOpenDirectory (10.12 - 194) <2D856BB1-4865-3B54-A39A-CCBB25A4A935> /System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework/Versions/A/CFOpenDirectory 0x7fff91cf5000 - 0x7fff91d00ff7 com.apple.OpenDirectory (10.12 - 194) <D5977817-7507-3005-8DDC-AB059672BEA0> /System/Library/Frameworks/OpenDirectory.framework/Versions/A/OpenDirectory 0x7fff93d19000 - 0x7fff9401afff com.apple.security (7.0 - 57740.51.3) <E8E40839-4F2C-3954-9870-9F9BA185BC81> /System/Library/Frameworks/Security.framework/Versions/A/Security 0x7fff9401b000 - 0x7fff94090fff com.apple.securityfoundation (6.0 - 55132.50.7) <2A013E36-EEB5-3E9A-AAA7-8E10EC49E75C> /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation 0x7fff940bb000 - 0x7fff940beffb com.apple.xpc.ServiceManagement (1.0 - 1) <00B5C305-37B4-378A-BCAE-5EC441A889C8> /System/Library/Frameworks/ServiceManagement.framework/Versions/A/ServiceManagement 0x7fff94445000 - 0x7fff944b4ff7 com.apple.SystemConfiguration (1.14 - 1.14) <A4B97859-CB45-3910-9785-0CAF015B46BC> /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration 0x7fff96e54000 - 0x7fff96edf97f com.apple.AppleJPEG (1.0 - 1) <B9E9570D-04A4-34E4-B756-D200043B25B8> /System/Library/PrivateFrameworks/AppleJPEG.framework/Versions/A/AppleJPEG 0x7fff98966000 - 0x7fff9896fffb com.apple.CommonAuth (4.0 - 2.0) <216950CB-269F-3476-BA17-D6363AC49FBC> /System/Library/PrivateFrameworks/CommonAuth.framework/Versions/A/CommonAuth 0x7fff990b7000 - 0x7fff990c7fff com.apple.CoreEmoji (1.0 - 40.3.3) <E9A28301-2D79-3A97-A046-028258A6ABE5> /System/Library/PrivateFrameworks/CoreEmoji.framework/Versions/A/CoreEmoji 0x7fff9c14c000 - 0x7fff9c1c2ff3 com.apple.Heimdal (4.0 - 2.0) <8F9C9041-66D5-36C9-8A4C-1658035C311D> /System/Library/PrivateFrameworks/Heimdal.framework/Versions/A/Heimdal 0x7fff9c903000 - 0x7fff9cabafff com.apple.LanguageModeling (1.0 - 123.2.5) <E7EDBA2B-8B97-3EC8-BDB1-232287E07581> /System/Library/PrivateFrameworks/LanguageModeling.framework/Versions/A/LanguageModeling 0x7fff9d5d8000 - 0x7fff9d600fff com.apple.MultitouchSupport.framework (368.14 - 368.14) <930109A4-6949-377F-AD30-F9B542CBAE1C> /System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/A/MultitouchSupport 0x7fff9d6b2000 - 0x7fff9d6bdfff com.apple.NetAuth (6.2 - 6.2) <97F487D6-8089-31A8-B68C-6C1EAC6ED1B5> /System/Library/PrivateFrameworks/NetAuth.framework/Versions/A/NetAuth 0x7fffa0515000 - 0x7fffa051bff7 com.apple.TCC (1.0 - 1) <911B534B-4AC7-34E4-935E-E42ECD008CBC> /System/Library/PrivateFrameworks/TCC.framework/Versions/A/TCC 0x7fffa1924000 - 0x7fffa1926ffb com.apple.loginsupport (1.0 - 1) <F3140B97-12C3-35A7-9D3D-43DA2D13C113> /System/Library/PrivateFrameworks/login.framework/Versions/A/Frameworks/loginsupport.framework/Versions/A/loginsupport 0x7fffa197b000 - 0x7fffa1996ff7 libCRFSuite.dylib (34) <F78B7F5F-0B4F-35C6-AA2F-84EE9CB22137> /usr/lib/libCRFSuite.dylib 0x7fffa1997000 - 0x7fffa19a2fff libChineseTokenizer.dylib (21) <0886E908-A825-36AF-B94B-2361FD8BC2A1> /usr/lib/libChineseTokenizer.dylib 0x7fffa1a34000 - 0x7fffa1a35ff3 libDiagnosticMessagesClient.dylib (102) <84A04D24-0E60-3810-A8C0-90A65E2DF61A> /usr/lib/libDiagnosticMessagesClient.dylib 0x7fffa1c6d000 - 0x7fffa1c6dfff libOpenScriptingUtil.dylib (172) <90743888-C1E8-34E3-924E-1A754B2B63B9> /usr/lib/libOpenScriptingUtil.dylib 0x7fffa1c73000 - 0x7fffa1c74ffb libSystem.B.dylib (1238.51.1) <D9B20A4F-87BC-36CB-9405-80E105666725> /usr/lib/libSystem.B.dylib 0x7fffa1ce0000 - 0x7fffa1d0bff3 libarchive.2.dylib (41.50.2) <B4F507BC-B24E-3BE7-B658-94D798E2CD81> /usr/lib/libarchive.2.dylib 0x7fffa1e05000 - 0x7fffa1e05ff3 libauto.dylib (187) <34388D0B-C539-3C1B-9408-2BC152162E43> /usr/lib/libauto.dylib 0x7fffa1e06000 - 0x7fffa1e16ff3 libbsm.0.dylib (34) <20084796-B04D-3B35-A003-EA11459557A9> /usr/lib/libbsm.0.dylib 0x7fffa1e17000 - 0x7fffa1e25ff7 libbz2.1.0.dylib (38) <25D9FACF-5583-348A-80A0-2B51DCE37680> /usr/lib/libbz2.1.0.dylib 0x7fffa1e26000 - 0x7fffa1e7cff7 libc++.1.dylib (307.5) <0B43BB5D-E6EB-3464-8DE9-B41AC8ED9D1C> /usr/lib/libc++.1.dylib 0x7fffa1e7d000 - 0x7fffa1ea7fff libc++abi.dylib (307.3) <30199352-88BF-30BD-8CFF-2A4FBE247523> /usr/lib/libc++abi.dylib 0x7fffa1ea8000 - 0x7fffa1eb8ffb libcmph.dylib (6) <2B5D405E-2D0B-3320-ABD6-622934C86ABE> /usr/lib/libcmph.dylib 0x7fffa1eb9000 - 0x7fffa1ecfff7 libcompression.dylib (39) <BDAA8CC7-0BFC-36EC-9E75-58BDC15AC3B6> /usr/lib/libcompression.dylib 0x7fffa1ed0000 - 0x7fffa1ed0ff7 libcoretls.dylib (121.50.4) <64B1001E-10F6-3542-A3B2-C4B49F51817F> /usr/lib/libcoretls.dylib 0x7fffa1ed1000 - 0x7fffa1ed2ff3 libcoretls_cfhelpers.dylib (121.50.4) <1A10303E-5EB0-3C7C-9165-021FCDFD934D> /usr/lib/libcoretls_cfhelpers.dylib 0x7fffa220f000 - 0x7fffa2262ff7 libcups.2.dylib (450) <F7AC4FF1-9755-3CFF-8CE3-F4FFACC43BEC> /usr/lib/libcups.2.dylib 0x7fffa22dd000 - 0x7fffa22ddfff libenergytrace.dylib (15) <A1B040A2-7977-3097-9ADF-34FF181EB970> /usr/lib/libenergytrace.dylib 0x7fffa22ed000 - 0x7fffa22f2ff7 libheimdal-asn1.dylib (498.50.8) <A40E3196-235E-34CE-AD9A-8D1AFC5DE004> /usr/lib/libheimdal-asn1.dylib 0x7fffa22f3000 - 0x7fffa23e5ff7 libiconv.2.dylib (50) <42125B35-81D7-3FC4-9475-A26DBE10884D> /usr/lib/libiconv.2.dylib 0x7fffa23e6000 - 0x7fffa260bffb libicucore.A.dylib (57163.0.1) <325E1C97-1C45-3A7E-9AFB-D1328E31D879> /usr/lib/libicucore.A.dylib 0x7fffa2611000 - 0x7fffa2612fff liblangid.dylib (126) <2085E7A7-9A34-3735-87F4-F174EF8EABF0> /usr/lib/liblangid.dylib 0x7fffa2613000 - 0x7fffa262cffb liblzma.5.dylib (10) <44BD0279-99DD-36B5-8A6E-C11432E2098D> /usr/lib/liblzma.5.dylib 0x7fffa262d000 - 0x7fffa2643ff7 libmarisa.dylib (5) <9030D214-5D0F-30CB-AC03-902C63909362> /usr/lib/libmarisa.dylib 0x7fffa2644000 - 0x7fffa28ecff7 libmecabra.dylib (744.8) <D429FCC9-42A4-38B3-8784-44024BC859EF> /usr/lib/libmecabra.dylib 0x7fffa291f000 - 0x7fffa2999ff3 libnetwork.dylib (856.50.56) <021B3FCF-6CFC-359D-845A-8A6AD7C54D73> /usr/lib/libnetwork.dylib 0x7fffa299a000 - 0x7fffa2d6fbc7 libobjc.A.dylib (709) <54CD8D1A-5C98-3559-B13A-932B3D3DD338> /usr/lib/libobjc.A.dylib 0x7fffa2d72000 - 0x7fffa2d76fff libpam.2.dylib (21.30.1) <71EB0D88-DE84-3C8D-A2C5-58AA282BC5BC> /usr/lib/libpam.2.dylib 0x7fffa2d77000 - 0x7fffa2da8ff7 libpcap.A.dylib (67.50.2) <D4A7EFB6-15FE-3C9C-A47C-1CA3CB75D06C> /usr/lib/libpcap.A.dylib 0x7fffa2dc5000 - 0x7fffa2de1ffb libresolv.9.dylib (64) <A244AE4C-00B0-396C-98FF-97FE4DB3DA30> /usr/lib/libresolv.9.dylib 0x7fffa2e31000 - 0x7fffa2f77fff libsqlite3.dylib (254.5) <71E9B5E9-67D8-329E-86A6-894B885A542E> /usr/lib/libsqlite3.dylib 0x7fffa306c000 - 0x7fffa3079fff libxar.1.dylib (357) <69547C64-E811-326F-BBED-490C6361BDCB> /usr/lib/libxar.1.dylib 0x7fffa307a000 - 0x7fffa3169ffb libxml2.2.dylib (30.15) <99A58C37-98A2-3430-942A-D6038C1A198C> /usr/lib/libxml2.2.dylib 0x7fffa316a000 - 0x7fffa3193fff libxslt.1.dylib (15.9) <71FFCDFF-4AAF-394C-8452-92F301FB1A46> /usr/lib/libxslt.1.dylib 0x7fffa3194000 - 0x7fffa31a5ff3 libz.1.dylib (67) <46E3FFA2-4328-327A-8D34-A03E20BFFB8E> /usr/lib/libz.1.dylib 0x7fffa31b4000 - 0x7fffa31b8ff7 libcache.dylib (79) <093A4DAB-8385-3D47-A350-E20CB7CCF7BF> /usr/lib/system/libcache.dylib 0x7fffa31b9000 - 0x7fffa31c3fff libcommonCrypto.dylib (60092.50.5) <BE8380C5-C09D-3F48-A502-AEBB58231067> /usr/lib/system/libcommonCrypto.dylib 0x7fffa31c4000 - 0x7fffa31cbfff libcompiler_rt.dylib (62) <55D47421-772A-32AB-B529-1A46C2F43B4D> /usr/lib/system/libcompiler_rt.dylib 0x7fffa31cc000 - 0x7fffa31d4fff libcopyfile.dylib (138) <819BEA3C-DF11-3E3D-A1A1-5A51C5BF1961> /usr/lib/system/libcopyfile.dylib 0x7fffa31d5000 - 0x7fffa3258fdf libcorecrypto.dylib (442.50.19) <8A39EE06-121C-3731-A9E9-35847064B3EE> /usr/lib/system/libcorecrypto.dylib 0x7fffa3259000 - 0x7fffa328afff libdispatch.dylib (703.50.37) <D122E712-9593-31CA-BAC4-4A54410BF4A0> /usr/lib/system/libdispatch.dylib 0x7fffa328b000 - 0x7fffa3290ffb libdyld.dylib (433.5) <129D3B44-FB21-3750-9A68-48B5C3DC632B> /usr/lib/system/libdyld.dylib 0x7fffa3291000 - 0x7fffa3291ffb libkeymgr.dylib (28) <7AA011A9-DC21-3488-BF73-3B5B14D1FDD6> /usr/lib/system/libkeymgr.dylib 0x7fffa3292000 - 0x7fffa329effb libkxld.dylib (3789.51.2) <0BD544C8-A376-3F91-8426-564B4F7FE7E6> /usr/lib/system/libkxld.dylib 0x7fffa329f000 - 0x7fffa329ffff liblaunch.dylib (972.50.27) <037D198D-9B02-3EF9-A8E9-6F43EA555A9E> /usr/lib/system/liblaunch.dylib 0x7fffa32a0000 - 0x7fffa32a5ff3 libmacho.dylib (898) <17D5D855-F6C3-3B04-B680-E9BF02EF8AED> /usr/lib/system/libmacho.dylib 0x7fffa32a6000 - 0x7fffa32a8ff3 libquarantine.dylib (85.50.1) <7B32EA91-AB8B-32A4-8E52-9D3ED46CAC8E> /usr/lib/system/libquarantine.dylib 0x7fffa32a9000 - 0x7fffa32aaffb libremovefile.dylib (45) <38D4CB9C-10CD-30D3-8B7B-A515EC75FE85> /usr/lib/system/libremovefile.dylib 0x7fffa32ab000 - 0x7fffa32c3ff7 libsystem_asl.dylib (349.50.5) <096E4228-3B7C-30A6-8B13-EC909A64499A> /usr/lib/system/libsystem_asl.dylib 0x7fffa32c4000 - 0x7fffa32c4ff7 libsystem_blocks.dylib (67) <10DC5404-73AB-35B3-A277-A8AFECB476EB> /usr/lib/system/libsystem_blocks.dylib 0x7fffa32c5000 - 0x7fffa3352fef libsystem_c.dylib (1158.50.2) <B03F8915-1E9B-3C84-AED5-68E2E0031630> /usr/lib/system/libsystem_c.dylib 0x7fffa3353000 - 0x7fffa3356ffb libsystem_configuration.dylib (888.51.2) <872C8A42-0871-3424-830B-84E587A75D27> /usr/lib/system/libsystem_configuration.dylib 0x7fffa3357000 - 0x7fffa335afff libsystem_coreservices.dylib (41.4) <FD0915E8-9C43-3FCB-94E0-33C45DF028CD> /usr/lib/system/libsystem_coreservices.dylib 0x7fffa335b000 - 0x7fffa3373fff libsystem_coretls.dylib (121.50.4) <EC6FCF07-DCFB-3A03-9CC9-6DD3709974C6> /usr/lib/system/libsystem_coretls.dylib 0x7fffa3374000 - 0x7fffa337afff libsystem_dnssd.dylib (765.50.9) <FF02A197-7CEF-3684-8155-E5E225051E44> /usr/lib/system/libsystem_dnssd.dylib 0x7fffa337b000 - 0x7fffa33a4ff7 libsystem_info.dylib (503.50.4) <611DB84C-BF70-3F92-8702-B9F28A900920> /usr/lib/system/libsystem_info.dylib 0x7fffa33a5000 - 0x7fffa33c7ff7 libsystem_kernel.dylib (3789.51.2) <FC51D7B0-8292-3F6A-9231-64340B237EB7> /usr/lib/system/libsystem_kernel.dylib 0x7fffa33c8000 - 0x7fffa340ffe7 libsystem_m.dylib (3121.6) <A790C9A5-DD24-32F5-8FD7-33BFCE79AC87> /usr/lib/system/libsystem_m.dylib 0x7fffa3410000 - 0x7fffa342eff7 libsystem_malloc.dylib (116.50.8) <48D1BBA3-914E-3C65-AF70-C33B4A1B5233> /usr/lib/system/libsystem_malloc.dylib 0x7fffa342f000 - 0x7fffa3488ffb libsystem_network.dylib (856.50.56) <FDE14243-4328-3EFD-824C-C0D314D7B540> /usr/lib/system/libsystem_network.dylib 0x7fffa3489000 - 0x7fffa3492ff3 libsystem_networkextension.dylib (563.50.32) <D5381DA9-529C-3588-BE16-A2245DE93423> /usr/lib/system/libsystem_networkextension.dylib 0x7fffa3493000 - 0x7fffa349cff3 libsystem_notify.dylib (165.20.1) <B8160190-A069-3B3A-BDF6-2AA408221FAE> /usr/lib/system/libsystem_notify.dylib 0x7fffa349d000 - 0x7fffa34a5fe7 libsystem_platform.dylib (126.50.8) <5940EAB7-84D6-34DC-9B38-111648B2B589> /usr/lib/system/libsystem_platform.dylib 0x7fffa34a6000 - 0x7fffa34b0ff7 libsystem_pthread.dylib (218.51.1) <62A84A68-431D-3B54-A7B6-31367CCF2884> /usr/lib/system/libsystem_pthread.dylib 0x7fffa34b1000 - 0x7fffa34b4ff7 libsystem_sandbox.dylib (592.50.47) <87A2327D-B7A1-3E4C-A85D-D3D9484003DB> /usr/lib/system/libsystem_sandbox.dylib 0x7fffa34b5000 - 0x7fffa34b6ff3 libsystem_secinit.dylib (24.50.4) <F78B847B-3565-3E4B-98A6-F7AD40392E2D> /usr/lib/system/libsystem_secinit.dylib 0x7fffa34b7000 - 0x7fffa34beffb libsystem_symptoms.dylib (532.50.47) <9CF6A47C-8343-3E85-9C27-A8D98E726A8B> /usr/lib/system/libsystem_symptoms.dylib 0x7fffa34bf000 - 0x7fffa34d2ff7 libsystem_trace.dylib (518.51.1) <E1D540D8-CC88-3901-92BA-FC4B802FE0E8> /usr/lib/system/libsystem_trace.dylib 0x7fffa34d3000 - 0x7fffa34d8ffb libunwind.dylib (35.3) <3D50D8A8-C460-334D-A519-2DA841102C6B> /usr/lib/system/libunwind.dylib 0x7fffa34d9000 - 0x7fffa3502ff7 libxpc.dylib (972.50.27) <ABC45890-DA23-3A4A-B50B-1384BD4CBBDF> /usr/lib/system/libxpc.dylib External Modification Summary: Calls made by other processes targeting this process: task_for_pid: 0 thread_create: 0 thread_set_state: 0 Calls made by this process: task_for_pid: 0 thread_create: 0 thread_set_state: 0 Calls made by all processes on this machine: task_for_pid: 317840 thread_create: 0 thread_set_state: 0 VM Region Summary: ReadOnly portion of Libraries: Total=204.7M resident=0K(0%) swapped_out_or_unallocated=204.7M(100%) Writable regions: Total=97.1M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=97.1M(100%) VIRTUAL REGION REGION TYPE SIZE COUNT (non-coalesced) =========== ======= ======= Dispatch continuations 16.0M 2 Kernel Alloc Once 8K 2 MALLOC 65.0M 12 MALLOC guard page 16K 4 MALLOC_LARGE (reserved) 1168K 3 reserved VM address space (unallocated) STACK GUARD 56.0M 9 Stack 11.6M 9 VM_ALLOCATE 2.3G 77 VM_ALLOCATE (reserved) 64K 2 reserved VM address space (unallocated) __DATA 9928K 145 __LINKEDIT 116.5M 10 __TEXT 88.2M 149 __UNICODE 556K 2 mapped file 40.3M 130 shared memory 8K 3 =========== ======= ======= TOTAL 2.7G 544 TOTAL, minus reserved VM space 2.7G 544 Model: MacBookPro10,1, BootROM MBP101.00EE.B12, 4 processors, Intel Core i7, 2.3 GHz, 16 GB, SMC 2.3f35 Graphics: Intel HD Graphics 4000, Intel HD Graphics 4000, Built-In Graphics: NVIDIA GeForce GT 650M, NVIDIA GeForce GT 650M, PCIe, 1024 MB Memory Module: BANK 0/DIMM0, 8 GB, DDR3, 1600 MHz, 0x802C, 0x384B54463531323634485A2D314736453120 Memory Module: BANK 1/DIMM0, 8 GB, DDR3, 1600 MHz, 0x802C, 0x384B54463531323634485A2D314736453120 AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0xEF), Broadcom BCM43xx 1.0 (7.21.171.124.1a2) Bluetooth: Version 5.0.4f18, 3 services, 27 devices, 1 incoming serial ports Network Service: Thunderbolt Ethernet, Ethernet, en4 PCI Card: Apple 57762-A0, Ethernet Controller, Thunderbolt@195,0,0 Serial ATA Device: APPLE SSD SM512E, 500.28 GB USB Device: USB 2.0 Bus USB Device: Hub USB Device: FaceTime HD Camera (Built-in) USB Device: USB 2.0 Bus USB Device: Hub USB Device: Hub USB Device: Apple Internal Keyboard / Trackpad USB Device: BRCM20702 Hub USB Device: Bluetooth USB Host Controller USB Device: USB 3.0 Bus Thunderbolt Bus: MacBook Pro, Apple Inc., 23.4 Thunderbolt Device: Thunderbolt to Gigabit Ethernet Adapter, Apple Inc., 3, 5.5 --- @Petermarcu commented on [Wed Jun 14 2017](https://github.com/dotnet/core/issues/599#issuecomment-308614973) @m2b , Any chance you can share more about which version of everything you are running and how you installed it? Through the installer or from the tar.gz? --- @Petermarcu commented on [Wed Jun 28 2017](https://github.com/dotnet/core/issues/599#issuecomment-311856464) I'm going to close this because we need more info. Please reopen if you have more info you can share. Thanks! --- @jpcarrascal commented on [Sun Jul 09 2017](https://github.com/dotnet/core/issues/599#issuecomment-313953236) I have exactly the same problem. I am running OS X El Capitan (10.11.6). dotnet --version output is 1.0.4. I tried both the installer and running the binary from the tar.gz and the result is the same. The only difference is that in the former case I also get a ""dotnet quit unexpectedly"" window. I'd appreciate any help and I'll be happy to provide more diagnostics information if needed. Thanks! JP --- @richlander commented on [Sun Jul 09 2017](https://github.com/dotnet/core/issues/599#issuecomment-313994521) /cc @livarcocc _Copied from original issue: dotnet/cli#7777_ _Copied from original issue: dotnet/core-setup#3279_" 25159 area-System.Drawing Remove forced GC during System.Drawing.Common shutdown System.Drawing.Common is forcing GC and waiting for pending finalizers during shutdown: https://github.com/dotnet/corefx/blob/7d3cd2adff8272efcf1bc6e0bf1902de6fd9e8e9/src/System.Drawing.Common/src/System/Drawing/GdiplusNative.Unix.cs#L95 This is potential reliability and performance and problem. This sequence is only going to collect unreachable objects, and so it is not providing any sort of guarantees that there are no outstanding GDI references. If this is really necessary for some reason, the code needs to have a good comment describing why. 25162 area-System.Threading Improve Diagnose Api of (Buffered)Channel _From @JanEggers on September 23, 2017 9:39_ hi there, im currently experimenting with System.Threading.Tasks.Channels.Channel. for perfromance analysis it would be really great if BoundedChannel would be a public type and has properties that express the current buffer fill level. Right now im using reflection to get that Info but i wonder why you make that an internal. (the info is there via debugview but neither toString or any public api can be used to get that information) im using that information to determine performance bottlenecks in my app. I know that consumers of buffers with growing fill level have to be optimized. _Copied from original issue: dotnet/corefxlab#1782_ 25163 area-System.Net [ManagedHandler] Do not change the request object provided by the user It is general implementation policy in other handlers in System.Net.Http, to not modify the HttpRequestMessage object provided by the user through the SendAsync method. In managed handler implementation, this object is modified in several places, revisit this design to minimize altering the request object from user. For more information refer to the conversation in PR #25090 25168 area-System.Runtime Refactor S.R.Caching ObjectCache.Host tests to be able to run without creating a separate AppDomain A handful of tests for System.Runtime.Caching borrowed from Mono are using a separate app domains to test ObjectCache.Host extensibility points. They would need some refactoring before we can run them in Core. One simple option would be to put each of them into a separate project; another is to combine them all to run once. In my preliminary tests they would add about 2-3% of additional code coverage. 25169 area-System.Runtime Adding tests for System.Runtime.Caching Also adding a solution file for all System.Runtime.Caching projects 25171 area-Infrastructure System.Threading.Tasks.Dataflow 4.8.0 requires too many packages to install in VS 2015 We use System.Threading.Tasks.Dataflow library 4.7.0 in VS 2015 project. It is a single library for .NET 4.5 When we upgrade to 4.8.0, it requires a lot of other libraries. This makes is painful to upgrade and to create new deployment and installer for our project because we must now include many unnecessary libraries. ``` Attempting to gather dependency information for package 'System.Threading.Tasks.Dataflow.4.8.0' with respect to project 'src\Project1', targeting '.NETFramework,Version=v4.6.2' Gathering dependency information took 5,32 sec Attempting to resolve dependencies for package 'System.Threading.Tasks.Dataflow.4.8.0' with DependencyBehavior 'Lowest' One or more unresolved package dependency constraints detected in the existing packages.config file. All dependency constraints must be resolved to add or update packages. If these packages are being updated this message may be ignored, if not the following error(s) may be blocking the current package operation: 'System.Threading.Tasks.Dataflow 4.7.0' Resolving dependency information took 0 ms Resolving actions to install package 'System.Threading.Tasks.Dataflow.4.8.0' Resolved actions to install package 'System.Threading.Tasks.Dataflow.4.8.0' Found package 'Microsoft.NETCore.Platforms 1.1.0' in 'C:\dev\Project1\packages'. Found package 'NETStandard.Library 1.6.1' in 'C:\dev\Project1\packages'. Found package 'Microsoft.Win32.Primitives 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.AppContext 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Collections 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Collections.Concurrent 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Console 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Diagnostics.Debug 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Diagnostics.DiagnosticSource 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Diagnostics.Tools 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Diagnostics.Tracing 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Dynamic.Runtime 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Globalization 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Globalization.Calendars 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.IO 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.IO.Compression 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.IO.Compression.ZipFile 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.IO.FileSystem.Primitives 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.IO.FileSystem 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Linq 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Linq.Expressions 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Net.Primitives 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Net.Sockets 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.ObjectModel 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Reflection 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Reflection.Extensions 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Reflection.Primitives 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Resources.ResourceManager 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Runtime 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Runtime.Extensions 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Runtime.Handles 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Runtime.InteropServices 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Runtime.InteropServices.RuntimeInformation 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Runtime.Numerics 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Security.Cryptography.Encoding 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Security.Cryptography.Primitives 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Security.Cryptography.Algorithms 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Security.Cryptography.X509Certificates 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Net.Http 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Text.Encoding 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Text.Encoding.Extensions 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Text.RegularExpressions 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Threading 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Threading.Tasks 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Threading.Timer 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Xml.ReaderWriter 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Xml.XDocument 4.3.0' in 'C:\dev\Project1\packages'. Found package 'System.Threading.Tasks.Dataflow 4.8.0' in 'C:\dev\Project1\packages'. Removed package 'System.Threading.Tasks.Dataflow.4.7.0' from 'packages.config' Successfully uninstalled 'System.Threading.Tasks.Dataflow.4.7.0' from Project1 Package 'Microsoft.NETCore.Platforms.1.1.0' already exists in folder 'C:\dev\Project1\packages' Added package 'Microsoft.NETCore.Platforms.1.1.0' to 'packages.config' Successfully installed 'Microsoft.NETCore.Platforms 1.1.0' to Project1 Package 'Microsoft.Win32.Primitives.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'Microsoft.Win32.Primitives.4.3.0' to 'packages.config' Successfully installed 'Microsoft.Win32.Primitives 4.3.0' to Project1 Package 'System.AppContext.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.AppContext.4.3.0' to 'packages.config' Successfully installed 'System.AppContext 4.3.0' to Project1 Package 'System.Collections.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Collections.4.3.0' to 'packages.config' Successfully installed 'System.Collections 4.3.0' to Project1 Package 'System.Collections.Concurrent.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Collections.Concurrent.4.3.0' to 'packages.config' Successfully installed 'System.Collections.Concurrent 4.3.0' to Project1 Package 'System.Console.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Console.4.3.0' to 'packages.config' Successfully installed 'System.Console 4.3.0' to Project1 Package 'System.Diagnostics.Debug.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Diagnostics.Debug.4.3.0' to 'packages.config' Successfully installed 'System.Diagnostics.Debug 4.3.0' to Project1 Package 'System.Diagnostics.DiagnosticSource.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Diagnostics.DiagnosticSource.4.3.0' to 'packages.config' Successfully installed 'System.Diagnostics.DiagnosticSource 4.3.0' to Project1 Package 'System.Diagnostics.Tools.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Diagnostics.Tools.4.3.0' to 'packages.config' Successfully installed 'System.Diagnostics.Tools 4.3.0' to Project1 Package 'System.Diagnostics.Tracing.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Diagnostics.Tracing.4.3.0' to 'packages.config' Successfully installed 'System.Diagnostics.Tracing 4.3.0' to Project1 Package 'System.Dynamic.Runtime.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Dynamic.Runtime.4.3.0' to 'packages.config' Successfully installed 'System.Dynamic.Runtime 4.3.0' to Project1 Package 'System.Globalization.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Globalization.4.3.0' to 'packages.config' Successfully installed 'System.Globalization 4.3.0' to Project1 Package 'System.Globalization.Calendars.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Globalization.Calendars.4.3.0' to 'packages.config' Successfully installed 'System.Globalization.Calendars 4.3.0' to Project1 Package 'System.IO.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.IO.4.3.0' to 'packages.config' Successfully installed 'System.IO 4.3.0' to Project1 Package 'System.IO.Compression.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.IO.Compression.4.3.0' to 'packages.config' Successfully installed 'System.IO.Compression 4.3.0' to Project1 Package 'System.IO.Compression.ZipFile.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.IO.Compression.ZipFile.4.3.0' to 'packages.config' Successfully installed 'System.IO.Compression.ZipFile 4.3.0' to Project1 Package 'System.IO.FileSystem.Primitives.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.IO.FileSystem.Primitives.4.3.0' to 'packages.config' Successfully installed 'System.IO.FileSystem.Primitives 4.3.0' to Project1 Package 'System.IO.FileSystem.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.IO.FileSystem.4.3.0' to 'packages.config' Successfully installed 'System.IO.FileSystem 4.3.0' to Project1 Package 'System.Linq.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Linq.4.3.0' to 'packages.config' Successfully installed 'System.Linq 4.3.0' to Project1 Package 'System.Linq.Expressions.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Linq.Expressions.4.3.0' to 'packages.config' Successfully installed 'System.Linq.Expressions 4.3.0' to Project1 Package 'System.Net.Primitives.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Net.Primitives.4.3.0' to 'packages.config' Successfully installed 'System.Net.Primitives 4.3.0' to Project1 Package 'System.Net.Sockets.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Net.Sockets.4.3.0' to 'packages.config' Successfully installed 'System.Net.Sockets 4.3.0' to Project1 Package 'System.ObjectModel.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.ObjectModel.4.3.0' to 'packages.config' Successfully installed 'System.ObjectModel 4.3.0' to Project1 Package 'System.Reflection.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Reflection.4.3.0' to 'packages.config' Successfully installed 'System.Reflection 4.3.0' to Project1 Package 'System.Reflection.Extensions.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Reflection.Extensions.4.3.0' to 'packages.config' Successfully installed 'System.Reflection.Extensions 4.3.0' to Project1 Package 'System.Reflection.Primitives.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Reflection.Primitives.4.3.0' to 'packages.config' Successfully installed 'System.Reflection.Primitives 4.3.0' to Project1 Package 'System.Resources.ResourceManager.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Resources.ResourceManager.4.3.0' to 'packages.config' Successfully installed 'System.Resources.ResourceManager 4.3.0' to Project1 Package 'System.Runtime.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Runtime.4.3.0' to 'packages.config' Successfully installed 'System.Runtime 4.3.0' to Project1 Package 'System.Runtime.Extensions.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Runtime.Extensions.4.3.0' to 'packages.config' Successfully installed 'System.Runtime.Extensions 4.3.0' to Project1 Package 'System.Runtime.Handles.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Runtime.Handles.4.3.0' to 'packages.config' Successfully installed 'System.Runtime.Handles 4.3.0' to Project1 Package 'System.Runtime.InteropServices.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Runtime.InteropServices.4.3.0' to 'packages.config' Successfully installed 'System.Runtime.InteropServices 4.3.0' to Project1 Package 'System.Runtime.InteropServices.RuntimeInformation.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Runtime.InteropServices.RuntimeInformation.4.3.0' to 'packages.config' Successfully installed 'System.Runtime.InteropServices.RuntimeInformation 4.3.0' to Project1 Package 'System.Runtime.Numerics.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Runtime.Numerics.4.3.0' to 'packages.config' Successfully installed 'System.Runtime.Numerics 4.3.0' to Project1 Package 'System.Security.Cryptography.Encoding.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Security.Cryptography.Encoding.4.3.0' to 'packages.config' Successfully installed 'System.Security.Cryptography.Encoding 4.3.0' to Project1 Package 'System.Security.Cryptography.Primitives.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Security.Cryptography.Primitives.4.3.0' to 'packages.config' Successfully installed 'System.Security.Cryptography.Primitives 4.3.0' to Project1 Package 'System.Security.Cryptography.Algorithms.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Security.Cryptography.Algorithms.4.3.0' to 'packages.config' Successfully installed 'System.Security.Cryptography.Algorithms 4.3.0' to Project1 Package 'System.Security.Cryptography.X509Certificates.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Security.Cryptography.X509Certificates.4.3.0' to 'packages.config' Successfully installed 'System.Security.Cryptography.X509Certificates 4.3.0' to Project1 Package 'System.Net.Http.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Net.Http.4.3.0' to 'packages.config' Successfully installed 'System.Net.Http 4.3.0' to Project1 Package 'System.Text.Encoding.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Text.Encoding.4.3.0' to 'packages.config' Successfully installed 'System.Text.Encoding 4.3.0' to Project1 Package 'System.Text.Encoding.Extensions.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Text.Encoding.Extensions.4.3.0' to 'packages.config' Successfully installed 'System.Text.Encoding.Extensions 4.3.0' to Project1 Package 'System.Text.RegularExpressions.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Text.RegularExpressions.4.3.0' to 'packages.config' Successfully installed 'System.Text.RegularExpressions 4.3.0' to Project1 Package 'System.Threading.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Threading.4.3.0' to 'packages.config' Successfully installed 'System.Threading 4.3.0' to Project1 Package 'System.Threading.Tasks.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Threading.Tasks.4.3.0' to 'packages.config' Successfully installed 'System.Threading.Tasks 4.3.0' to Project1 Package 'System.Threading.Timer.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Threading.Timer.4.3.0' to 'packages.config' Successfully installed 'System.Threading.Timer 4.3.0' to Project1 Package 'System.Xml.ReaderWriter.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Xml.ReaderWriter.4.3.0' to 'packages.config' Successfully installed 'System.Xml.ReaderWriter 4.3.0' to Project1 Package 'System.Xml.XDocument.4.3.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Xml.XDocument.4.3.0' to 'packages.config' Successfully installed 'System.Xml.XDocument 4.3.0' to Project1 Adding package 'NETStandard.Library.1.6.1', which only has dependencies, to project 'Project1'. Package 'NETStandard.Library.1.6.1' already exists in folder 'C:\dev\Project1\packages' Added package 'NETStandard.Library.1.6.1' to 'packages.config' Successfully installed 'NETStandard.Library 1.6.1' to Project1 Package 'System.Threading.Tasks.Dataflow.4.8.0' already exists in folder 'C:\dev\Project1\packages' Added package 'System.Threading.Tasks.Dataflow.4.8.0' to 'packages.config' Successfully installed 'System.Threading.Tasks.Dataflow 4.8.0' to Project1 Removing package 'System.Threading.Tasks.Dataflow.4.7.0' from folder 'C:\dev\Project1\packages' Removed package 'System.Threading.Tasks.Dataflow.4.7.0' from folder 'C:\dev\Project1\packages' Executing nuget actions took 29,5 sec ========== Finished ========== Time Elapsed: 00:01:19.7792723 ``` 25172 area-System.Collections [API] Stack constructed from another Stack is not the same as the original. `Stack<T>` has only only one copy constructor and it accepts `IEnumerable<T>`. The constructor does not try to check whether the given collection is another `Stack<T>`. The constructor just enumerates the source stack (in the `Pop()` order) and pushes all values in the new stack. The result is that the new stack is actually reversed. I consider this behavior unexpected and an example of bad API. http://referencesource.microsoft.com/#System/compmod/system/collections/generic/stack.cs,66 25173 area-Microsoft.CSharp Simplify Microsoft.CSharp's NameManager and root namespace symbol "Now that it's static a few further simplifications are possible. * Remove `NameTable.Lookup(key, length)` No longer used. * Make ""void"" and the empty string predefined names. Use `GetPredefinedName` rather than Lookup to retrieve them. * Remove `NameManager.Lookup` and `NameTable.Lookup` Former no longer used after the above. Latter only used in an assertion that another assertion duplicates. * Make root namespace's `NamespaceSymbol` singleton in `NamespaceSymbol` Since it has no parent and isn't stored in the symbol table, and since name management is now static, it need no longer hang off `BSYMMGR`. " 25174 area-Microsoft.CSharp Merge CheckedConstant & CheckedNormal in MS.CSharp's BindingContext Always set to the same value (and indeed the distinction isn't meaningful in dynamic code), so just have one such property. 25177 area-Infrastructure Referencing a standard 2 library with enums from 4.7.1 app doesn't work. "Create a console app targeting 4.7.1 (you can start with a windows app or a netcore 2 app template. Just make sure you target 4.7.1 on both) Create a helper assembly targeting standard 2.0 reference helper assembly from console app 4.7.1 add a public enum in helper assembly targeting standard 2.0 use public enum in console ap 4.7.1 you will receive error: 2>Program.cs(10,13,10,21): error CS0012: The type 'Enum' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. 2>Program.cs(10,26,10,34): error CS0012: The type 'Enum' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. 2>Program.cs(10,35,10,38): error CS0012: The type 'Enum' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. 2>Done building project ""ConsoleOne.csproj"" -- FAILED. Switch target of console app from 4.7.1 to 4.6.1 Error goes away. Everything works. Adding package from nuget to 4.7.1 app doesn't seem to do anything to fix the problem. See attached. [LibStandard.zip](https://github.com/dotnet/corefx/files/1461883/LibStandard.zip) " 25178 area-Serialization Update the link of the instruction and use fwlink. @shmao @zhenlan @mconnew 25180 area-System.Net HttpClient throws 'The server returned an invalid or unrecognized response' error When connecting to an SSE stream and in chunked mode, the HttpClient will throw an 'The server returned an invalid or unrecognized response' error every single time. To see the issue, try to connect to [This API Call ](https://horizon-testnet.stellar.org/accounts/GAZHWW2NBPDVJ6PEEOZ2X43QV5JUDYS3XN4OWOTBR6WUACTUML2CCJLI/transactions?limit=50)and use the header Accept: text/event-stream, HttpClient will throw an exception every single time. It's easy to reproduce, Fiddler seems to return back the results just fine. 25182 area-System.Memory Add MemoryExtensions to CoreLib and type forward for .NET Core > A larger concern for me around the extension method isn't that they're exposed from System.Memory.dll, but that they're not available for use inside corelib, such that we've had to duplicate some of the functionality in order to implement various things in corelib, and those duplicated implementations aren't as good / efficient / complex as the ones in System.Memory.dll. https://github.com/dotnet/coreclr/blob/master/src/mscorlib/shared/System/StringSpanHelpers.cs, for example the trivial IndexOf implementation here versus the optimized implementation in https://github.com/dotnet/corefx/blob/master/src/System.Memory/src/System/SpanExtensions.cs This is a good reason why to move SpanExtensions into CoreLib. From thread (for context): https://github.com/dotnet/corefx/pull/25120#discussion_r149837741 cc @KrzysztofCwalina, @jkotas, @stephentoub 25183 area-Microsoft.CSharp MS.CSharp: Avoid allocation in AllocParams(int, TypeArray, int) This is called to split the type arguments for nested classes between those for the type itself and those for the outer type. The most common case will return the empty array or the source array (only really splitting for a type both within a generic type, that also adds further type parameters), but getting there will allocate an array and possibly do a lookup. Catch and short-circuit on these cases. 25184 area-Meta PowerShell v6.0.0-beta.7 xml save on Linux and MacOS X has an additional [] in DOCTYPE "[xml]$XmlDoc = get-content 'Info.plist' $XmlDoc.Save('def.plist') The two lines above work correctly in PowerShell 5.1 on Windows 10 but incorrectly with PowerShell v6 on Linux and MacOSX. Notice the [] just before the end in DOCTYPE. <!DOCTYPE plist PUBLIC ""-//Apple//DTD PLIST 1.0//EN"" ""http://www.apple.com/DTDs/PropertyList-1.0.dtd""[]>" 25187 area-System.Net [WIP] SslStream Throttle This would satisfy the throttling. I will test the perf on windows and linux and see if it makes any difference on windows. If it does then I will need to push the semaphore down into the PAL. I am submitting the PR to check the outerloop. 25188 area-Infrastructure Infra: Sync the sources of {ReadOnly}Memory and friends between corefx and corelib > I'd suggest someone compares the files in the two repos and gets them to be as close as possible. I noticed there are various discrepancies between them that make diff'ing harder, like differences in XML comments, differences in the ordering of members, etc. Use ifdefs for small differences From https://github.com/dotnet/coreclr/pull/14906#discussion_r149799699 (for context) Also figure out and setup a source mirroring strategy between the two repos. cc @stephentoub, @KrzysztofCwalina, @jkotas, @brianrob, @safern 25189 area-Meta ItemRef - Ref element accessor for types that already have an indexer. "We have a number of **existing** indexable types that could benefit from a ref-returning element accessor. For example `ImmutableArray`. A typical problem is that such types already have a get/set indexer, so the only way to add an indexed byref access to elements is to add a ref returning method. I believe this will happen one way or another, since there is a motivation. So, I think we should standardize on the name of such method. Here I want to propose the following convention: ```C# // when container is readonly - I.E. ImmutableArray<T> public ref readonly T ItemRef(int index); // when container is writeable - I.E. List<T> public ref T ItemRef(int index); ``` The alternatives could be - “ElementAt” – often already taken - “Item” – clashes with the underlying name of the indexer - “Address” - could work too, but I think “ItemRef” reads a lot better. - “ItemAt” – original proposed name, ""ItemRef"" still seems better Examples of uses: ```C# public class Program { static void Main(string[] args) { var o = new MyCollection<int>(); // use for assignment o.ItemRef(1) = 42; // bind to a ref local ref var first = ref o.ItemRef(1); first = 42; // read indirectly. (assume the API takes ""in"" parameter) Print(o.ItemRef(1)); } } class MyCollection<T> { public ref T ItemRef(int index) => throw null; } ``` Once we agree on the name/pattern we can enter separate bugs for particular APIs. " 25190 area-Microsoft.CSharp Microsoft.CSharp should allow operations on identically-named types "In the rare case that two types have exactly the same type name, dynamic operations will fail: ```C# dynamic x = Activator.CreateInstance( AssemblyBuilder .DefineDynamicAssembly(new AssemblyName(""TestAssembly""), AssemblyBuilderAccess.Run) .DefineDynamicModule(""TestModule"") .DefineType(""TestType"", TypeAttributes.Public) .CreateType()); dynamic y = Activator.CreateInstance( AssemblyBuilder .DefineDynamicAssembly(new AssemblyName(""TestAssembly""), AssemblyBuilderAccess.Run) .DefineDynamicModule(""TestModule"") .DefineType(""TestType"", TypeAttributes.Public) .CreateType()); x.Equals(y); // This or any other operation with both objects fails. ``` #23021 changed the exception thrown in this case from `RuntimeBinderInternalCompilerException` to `RuntimeBinderException`; pretty much a change from ""sorry, we got this wrong"" to ""sorry, you can't do that"". Ideally such cases should succeed. While the case is extremely rare: 1. It's always better to allow users to do something that prohibit. 2. By the very nature of dynamic binding, there's no theoretical justification for disallowing it. 3. Handling the exception requires resetting a lot of state. Allowing this reset means a lot of objects being passed around so that the type manager, symbol manager, etc. can be accessed by those objects that need them, tying those objects to each other, in order to deal with this rare case. While the first two points relate to what is an obscure edge case, the third is a greater motivation for allowing this IMO. CC: @VSadov @OmarTawfik " 25191 area-Microsoft.CSharp Allow dynamic use objects of different, identically-named, types. Fixes #25190 * Remove `ResetBindException` No longer used. * Cache types' arity for `FindSymWithMatchingArity` instead of on each loop * Move byref handling out of `LoadSymbolsFromType()` Only one caller can possibly pass byref types, so handle it there. * Further simplify type matching. Since we're looking to match types, and types with different arity don't match, just look for the type itself. * Remove dead code and tidy up. Paths within the case of the type `.IsNullableType()` handle the possibility of the type itself being `Nullable<T>`, but that type returns false for the nullable type check (possibly not true in the static compiler?). Remove the branches for that, and tidy up. * Move handling of nullable types. Since there can be corresponding `AggregateSymbol`s we have to test for it anyway, so may as well test before any more work is done. * Use `InsertRange` instead of repeated inserts. Fewer allocations and copies. 25193 area-System.Runtime Environment.ProcessorCount does not take into account cgroup/Docker limits This leads to managed code over-dimensioning when running in Docker. coreclr takes into account docker cpu limits: https://github.com/dotnet/coreclr/blob/dbfd10c94055fb5af823b4a7e30774641afcb3b2/src/classlibnative/bcltype/system.cpp#L349-L350 25196 area-Microsoft.CSharp Defer calculation of AggregateType.GetBaseClass() in Microsoft.CSharp Push logic for calculating the substitution necessary on base types when type or the base are generic into `AggregateType` and defer it until first call. This allows cycling chains of derivation and type parameters. Fixes #7527 * Add test for variant of cyclic type definitions. Confirms fix for #7527 also fixes #23706 * Overrides for `SubstType` and `SubstTypeCore` for `AggregateType` when used In one case replaces the equivalent existing override completely. Allows type-checking and casting to be avoided. 25197 area-System.IO Change timeout errorCode from ERROR_SUCCESS to ERROR_SEM_TIMEOUT fixes #24635 25198 area-System.Net [WIP] Test Only to compare outerloop for SslStream 25199 area-System.Net Reverts Cancellation on SslStream Checking that this now passes the outerloop 25202 area-Microsoft.CSharp Key AggregateType lookup on triple of symbol, outer type and type args Avoid potential for false key matching. Fixes #25201 * Remove `ErrorType.typeArgs` Consistently empty for named errors, null for unnamed, so have no real effect. Allows removal of remaining use of `GetNameFromPtrs()` * Add multiply into KeyPair.GetHashCode() Mix the bits a bit more. 25204 area-System.IO Add Crc32 to ZipArchiveEntry fixes #22292 25205 area-System.Data System.Data.SqlClient packaging From https://github.com/dotnet/corefx/pull/25134#discussion_r150415393: > And for better or worse, we already have some such dependencies, e.g. System.Data.SqlClient isn't part of the .NET Runtime download but it does P/Invoke into the System.Net.Security.Native.so/dylib shim. We either need to fix that, or we need to add a test coverage to ensure that you can mix and match different versions of .NET Core Runtime (that bundles `System.Net.Security.Native.so/dylib`) with different versions of `System.Data.SqlClient` and document/enforce the supported mixing and matching. The packaging for `System.Data.SqlClient` is suspect in general: All build configurations in https://github.com/dotnet/corefx/blob/master/src/System.Data.SqlClient/src/Configurations.props are netstandard. How am I going to get the .NET Core shims that the implementation depends on when I install it on Mono? 25206 area-System.Net Support cancellation on SslStream.AuthenticateAs*Async methods cc: @Priya91 Previous attempt in https://github.com/dotnet/corefx/pull/24857 reverted in https://github.com/dotnet/corefx/pull/25203 due to it causing a failing outerloop test SslStream_StreamToStream_WriteAsync_ReadAsync_Pending_Success (outerloop tests weren't run on the original PR). 25207 area-System.Net Disable SendAsync_ExpectedDiagnosticCancelledActivityLogging test It's failing sporadically on outerloop, both Windows and Unix, both WinHttp/CurlHandler and ManagedHandler. 25209 area-Microsoft.CSharp Fix handling of unary operations on nullable enums in Microsoft.CSharp The code that covered this case would put a `NullableType` where an `AggregateType` would then be expected, and throw `NullReferenceException` after an `as AggregateType` it would hit. There was also no code to handle the necessary cast, then lifted operation, then cast back. Catch the case of nullable enums early, and turn it into a cast on the operation on a cast to the underlying type (or `int` if smaller than `int`) Fixes #25067 * Remove now-dead buggy code for unary operators and nullable enums. * Remove dead code in `ExpressionTreeRewriter` Would carry out the cast-of-operation-of-cast rewrite already done in the initial bind, but this having been already done makes it unreachable. 25210 area-System.Threading Test failure: System.Threading.Channels.Tests.ChannelTests/DefaultReadAsync_CatchesTryWriteExceptions Opened on behalf of @Sunny-pu The test `System.Threading.Channels.Tests.ChannelTests/DefaultReadAsync_CatchesTryWriteExceptions` has failed. Assert.Equal() Failure\r Expected: Faulted\r Actual: RanToCompletion Stack Trace: at System.Threading.Channels.Tests.ChannelTests.<DefaultReadAsync_CatchesTryWriteExceptions>d__10.MoveNext() in E:\A\_work\722\s\corefx\src\System.Threading.Channels\tests\ChannelTests.cs:line 134 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\ExceptionServices\ExceptionDispatchInfo.cs:line 63 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs:line 182 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs:line 150 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\ExceptionServices\ExceptionDispatchInfo.cs:line 63 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs:line 182 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs:line 150 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\ExceptionServices\ExceptionDispatchInfo.cs:line 63 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs:line 182 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs:line 150 Build : Master - 20171113.01 (UWP ILC Tests) Failing configurations: - Windows.10.Amd64.ClientRS3-x64 - Debug - Release 25211 area-System.IO Fix misleading exception message, cleanup code I'm newbie(on contributing), i grab the issue and try to help. Fixes #24817 25212 area-Infrastructure How to integrate CoreFX Binaries manually in a Linux System Hallo .Net Core Community, im looking for a way to integrate my selfbuild Binaries of coreclr and corefx in an UbuntuSystem. I build the binaries for x86 to get .Net Core running on a x86 Ubuntu System. Now i need a guide where and how to place the binaries in this UbuntuSystem. Can someone give me a instruction or a link to an guide wich i was not able to find. Greetings Philipp 25214 area-Microsoft.CSharp Microsoft.CSharp: Remove check for ExprMemberGroup being used as a lvalue `ExprMemberGroup`s only exist within `ExprCall` and `ExprProperty` objects and can never be passed as operands, so this is unreachable. (Unlike in static compilation where it would be the result of someone trying e.g. `obj.ToString = 3`). Results in removal of ERR_AssgReadonlyLocalCause, contributes to #22470. * Remove `ErrArgIds` class Only place it was instantiated has now been removed. Clean-up all unused `ErrArgKind` as well as `Ids` that this makes unused. 25215 area-Microsoft.CSharp Microsoft.CSharp: Replace IExprWithArgs interface with ExprWithArgs class in hierarchy Allows for less casting, and tighter return types. * Preliminary: Remove always-null parameter to `BindToProperty` Removal of paths for that parameter being null allows tightening return type from `Expr` to `ExprProperty`. * Replace `IExprWithArgs` interface with `ExprWithArgs` class in hierarchy Makes `OptionalArguments` non-virtual Allows implicit cast from `ExprWithArgs` to `Expr` for reduced casting. * Change return types from `Expr` to `ExprWithArgs` where possible. * Remove redundant cast from `ReorderArgumentsForNamedAndOptional` Also make it void, since it always returns the same argument, to be clearer it's mutating its argument. * Remove redundant call to `ExprMemberGroup.OptionalObject` property. Stored as part of extension-method handling, but dynamic doesn't support extension methods. 25217 area-Microsoft.CSharp Microsoft.CSharp: Remove code for checking possible membergroup → delegate conversion * Remove `MethodGroupReturnTypeInference()` method. Initial `if (!(pSource is ExprMemberGroup memGrp))` will always be hit, since we can't have a member group expression as an argument within dynamic code, so it will always return false. * Remove `GroupToArgsBinder._pDelegate` The only remaining call to the constructor always passes null to this. Remove it, and paths for it being non-null. Results in removal of `ERR_MethDelegateMismatch`. Contributes to #22470 25219 area-System.Net Make curl http handler use SSL_CERT_FILE/SSL_CERT_DIR environment variables. Implements https://github.com/dotnet/corefx/issues/24281 CC @stephentoub @bartonjs Some interesting points: - The curl command ignores SSL_CERT_FILE when SSL_CERT_DIR is set. The underlying libcurl supports passing both to OpenSSL. - HTTPS proxy support requires a recent version of libcurl. The SSL config for the proxy is passed as separate options. 25220 area-Meta Generic Range type "Currently there is the non-generic `Range` type in the corefxlab repository ([link](https://github.com/dotnet/corefxlab/blob/2711e0824729fb318eb4e25544236bb2f53fa33e/src/System.Buffers.Experimental/System/Range.cs#L5-L20)) which is designed for a new C# slice syntax. As you can see, it's limited only to `int` values. ```csharp public readonly struct Range { public readonly long Index; public readonly long Length; } public readonly ref struct Span<T> { public Span<T> Slice(Range range) => Slice(range.Index, range.Length); public Span<T> Slice(int index, int length) { throw null; } } ``` ```csharp var buffer = new Span<int>(); var slice1 = buffer[3..4]; // with syntax sugar var slice2 = buffer.Slice(new Range(3, 4 - 3)); // without it ``` So it would be nice to have a generic one instead it to represent ranges of different types. ## Rationale and Usage Implementing the generic version would allow to have a common type to represent ranges. There are too many areas where it could be used including numeric processing, range based operations, and simply to store intervals (for example `Range<Time> OpenHours`). ## Proposed API ```csharp [Serializable] public readonly struct Range<T> : IEquatable<Range<T>>, IFormattable, ISerializable where T : IComparable<T> { public readonly T From; public readonly T To; public Range(T from, T to) { throw null; } private Range(SerializationInfo info, StreamingContext context) { throw null; } public void Deconstruct(out T from, out T to) { throw null; } public override bool Equals(object obj) { throw null; } public bool Equals(Range<T> other) { throw null; } public override int GetHashCode() { throw null; } public override string ToString() { throw null; } public override string ToString(string forma) { throw null; } public override string ToString(string format, IFormatProvider formatProvider) { throw null; } void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { throw null; } } public static class Range { // all methods should be aggressively inlined public static bool IsNormalized<T>(this Range<T> range) where T : IComparable<T> { throw null; } public static Range<T> Normalize<T>(this Range<T> range) where T : IComparable<T> { throw null; } public static bool IsEmpty<T>(this Range<T> range) where T : IComparable<T> { throw null; } public static bool Contains<T>(this Range<T> range, T value) where T : IComparable<T> { throw null; } public static bool Intersects(this Range<T> range, Range<T> other) where T : IComparable<T> { throw null; } public static Range<T> Intersect(this Range<T> range, Range<T> other) where T : IComparable<T> { throw null; } // Specialized versions of the previous methods for numeric and time types public static bool IsNormalized(this Range<int> range) { throw null; } // Only for numeric and time types public static int Length(this Range<int> range) { throw null; } } ``` ## Details There is no `struct` constraint to support `string` because it's a good candidate for range based operations, but there are methods which accept `IComparable<T>` as the second parameter should exist to do culture specific actions. ```csharp var range = new Range<string>(""A"", ""a""); var emptyCS = range.IsEmpty(StringComparer.InvariantCulture); // false var emptyCI = range.IsEmpty(StringComparer.InvariantCultureIgnoreCase); // true ``` The implementations wouldn't conflict with the syntax sugar for slices and would not hurt performance because the length computation is inlined: ```csharp public readonly ref struct Span<T> { public Span<T> Slice(Range<int> range) => Slice(range.From, range.Length()); public Span<T> Slice(int index, int length) { throw null; } } ``` ```csharp var buffer = new Span<int>(); var slice1 = buffer[3..4]; var slice2 = buffer.Slice(new Range<int>(3, 4)); // without it ``` It's possible to implement `IsEmpty`, `IsNormalized` and other things as instance members using generic type parameter checks, but that will cause poor performance for non-BCL types. ### Benchmark ```csharp public static class Range { [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool IsNormalizedSpecialized(this Range<long> range) => range.To >= range.From; [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool IsNormalizedGeneric<T>(this Range<T> range) where T : IComparable<T> => range.To.CompareTo(range.From) >= 0; [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool IsNormalizedComparer<T>(this Range<T> range, IComparer<T> comparer) where T : IComparable<T> => comparer.Compare(range.To, range.From) >= 0; } ``` Test environment: Intel Xeon E5-2687W, 3100 MHz, 8 cores, 16 threads Iterations: 1000000 for inner loop, 1000000 for outer loop | Method | Duration (msec) | |:------------------------|----------------:| | IsNormalizedSpecialized | 643 | | IsNormalizedGeneric | 975 | | IsNormalizedComparer | 1336 | Duration is measured for a single outer loop iteration. ## Open Questions * Should `Range<T>` support nullable values? That prevents being of `IComparable<T>` constraint on the generic type parameter, but at the same time allows to have open-ended ranges. Type safety could be implemented in the static constructor of `Range<T>`. ```csharp static Range() { var valueType = typeof(T); if (valueType.IsGenericType && valueType.GetGenericTypeDefinition() == typeof(Nullable<>)) { valueType = valueType.GetGenericArguments()[0]; } var comparableType = typeof(IComparable<>).MakeGenericType(valueType); if (!comparableType.IsAssignableFrom(valueType)) { throw new Exception($""The {valueType.Name} type doesn't implement {typeof(IComparable<>).Name}.""); } } ``` Another way to do that is to use `T?` as the field type, but it would increase the size of generic instances and would cause performance lose. ```csharp public readonly struct Range<T> : IEquatable<Range<T>>, IFormattable, ISerializable where T : IComparable<T> { public readonly T? From; public readonly T? To; } public static class Range { public static int? Length(this Range<int?> range) { throw null; } } ``` | Implementation (`T` is `int`) | Size (bytes) | |:------------------------------|-------------:| | `Range(T, T)` | 8 | | `Range(T?, T?)` | 16 |" 25222 area-System.Runtime Add DateTimeOffset.To[Short/Long][Date/Time]String, include invariant and ISO forms "It is still very common to see developers using the `ToShortDateString`, `ToShortTimeString`, `ToLongDateString`, and `ToLongTimeString` methods on the `DateTime` struct. However, there are no corresponding methods on the `DateTimeOffset` struct, and there probably should be, for consistency. This also aids developers who may not be completely familiar with the various string format specifiers. Additionally, I think it's not completely obvious that the culture is `CultureInfo.CurrentCulture` unless explicitly specified. IMHO, it would make sense to have invariant forms of these methods. Lastly, the invariant form is not the ISO standard year-month-day, but rather the US month-day-year, which is nonsortable. IMHO, it would make sense to have ISO forms of both the date methods and for date-time. The intent is to improve reliability, by making it crystal clear to developers which format they are getting, such that they don't wind up writing in bugs because they didn't think too much about dates. (very common) ## Proposed API ```diff namespace System { public struct DateTimeOffset { + public static string ToShortDateString(); + public static string ToShortTimeString(); + public static string ToLongDateString(); + public static string ToLongTimeString(); + public static string ToShortDateInvariantString(); + public static string ToShortTimeInvariantString(); + public static string ToLongDateInvariantString(); + public static string ToLongTimeInvariantString(); + public static string ToISODateString(); + public static string ToISOString(); } public struct DateTime { + public static string ToShortDateInvariantString(); + public static string ToShortTimeInvariantString(); + public static string ToLongDateInvariantString(); + public static string ToLongTimeInvariantString(); + public static string ToISODateString(); + public static string ToISOString(); } } ``` ## Example Usage ```csharp DateTimeOffset dto = new DateTimeOffset(2017, 7, 4, 1, 59, 59, 59, TimeSpan.Zero); string s = dto.ToShortDateString(); // ""7/4/2017"" (en-US) ""04/07/2017"" (en-GB) string s = dto.ToShortTimeString(); // ""2:59 AM"" (en-US) ""02:59"" (en-GB) string s = dto.ToLongDateString(); // ""Tuesday, July 4, 2017"" (en-US) ""04 July 2017"" (en-GB) string s = dto.ToLongTimeString(); // ""2:59:59 AM"" (en-US) ""02:59:59"" (en-GB) string s = dto.ToShortDateInvariantString(); // ""07/04/2017"" string s = dto.ToShortTimeInvariantString(); // ""02:59"" string s = dto.ToLongDateInvariantString(); // ""Tuesday, July 4, 2017"" string s = dto.ToLongTimeInvariantString(); // ""02:59:59"" string s = dto.ToISODateString(); // ""2017-07-04"" string s = dto.ToISOString(); // ""2017-07-04T01:59:59+00:00"" DateTime dt = new DateTime(2017, 7, 4, 2, 59, 59, 59, DateTimeKind.Utc); string s = dt.ToShortDateInvariantString(); // ""07/04/2017"" string s = dt.ToShortTimeInvariantString(); // ""02:59"" string s = dt.ToLongDateInvariantString(); // ""Tuesday, July 4, 2017"" string s = dt.ToLongTimeInvariantString(); // ""02:59:59"" string s = dt.ToISODateString(); // ""2017-07-04"" string s = dt.ToISOString(); // ""2017-07-04T01:59:59Z"" ``` " 25223 area-System.Collections SecurityTransparent should be removed from Collections.Immutable SecurityTransparent is a bit of a vestige nowdays, but is still enforced on desktop runtime. As such the presence of the attribute is a blocker for the new language/runtime features such as ref returns, readonly references, spans... Use of readonly references, in particular, makes a lot of sense, since the collections are _Immutable_ NOTE: Nearly no other library in CoreFx uses SecurityTransparent. ( https://github.com/dotnet/corefx/search?utf8=%E2%9C%93&q=SecurityTransparent&type= ) It is surprising that Collections.Immutable still does. I think the attribute needs to be removed and soon since it is already causing troubles. (Example: change https://github.com/dotnet/corefx/commit/fc4b1adb7f06687aa15f0416d83d2c27a0abf8dd when upgrade to C#7.2 had to be paired with disabling certain optimizations - we are not even using new features yet) 25224 area-System.Net "HttpClient possibly causing ""Unresolved P/Invoke"" crash" "Case Link: https://social.msdn.microsoft.com/Forums/windowsapps/en-US/15f89674-8c49-43d5-920b-d0997bb607f5/rs31709systemnethttphttpclient-possibly-causing-unresolved-pinvoke-crash?forum=wpdevelop Issue Descrption: Many customers in our MSDN forum report that when running app from the Windows Store, any HTTP requests made with the System.Net.Http.HttpClient class causes an exception: ""Unresolved P/Invoke method 'kernel32.dll!LocalAlloc' from this method. But it works fine in the debug and release mode, it only happens when running the app from the store. Repro Environment: Windows 10 (16299.19) App Target and Minimum SDK: 16299.15 .NETCore UWP: 6.0.1 Visual Studio: 15.4.2 Ref: Internal Microsoft WDG Bug 14634810" 25226 area-Microsoft.CSharp Ensure Microsoft.CSharp's binders only enumerate arguments once. Fixes #25225 25228 area-System.Diagnostics PerformanceCounterCategory_Create_Obsolete test failed with InvalidOperationException https://mc.dot.net/#/user/stephentoub/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/3eb7408de3fa474f21e4107091731f7d412ef9f2/workItem/System.Diagnostics.PerformanceCounter.Tests/analysis/xunit/System.Diagnostics.Tests.PerformanceCounterCategoryTests~2FPerformanceCounterCategory_Create_Obsolete ``` Unhandled Exception of Type System.InvalidOperationException Message : System.InvalidOperationException : Cannot load Counter Name data because an invalid index '' was read from the registry. Stack Trace : at System.Diagnostics.PerformanceCounterLib.GetStringTable(Boolean isHelp) in D:\j\workspace\windows-TGrou---f8ac6754\src\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\PerformanceCounterLib.cs:line 1097 at System.Diagnostics.PerformanceCounterLib.get_NameTable() in D:\j\workspace\windows-TGrou---f8ac6754\src\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\PerformanceCounterLib.cs:line 235 at System.Diagnostics.PerformanceCounterLib.get_CategoryTable() in D:\j\workspace\windows-TGrou---f8ac6754\src\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\PerformanceCounterLib.cs:line 167 at System.Diagnostics.PerformanceCounterLib.CategoryExists(String machine, String category) in D:\j\workspace\windows-TGrou---f8ac6754\src\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\PerformanceCounterLib.cs:line 275 at System.Diagnostics.PerformanceCounterCategory.Exists(String categoryName, String machineName) in D:\j\workspace\windows-TGrou---f8ac6754\src\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\PerformanceCounterCategory.cs:line 432 at System.Diagnostics.PerformanceCounterCategory.Exists(String categoryName) in D:\j\workspace\windows-TGrou---f8ac6754\src\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\PerformanceCounterCategory.cs:line 414 at System.Diagnostics.Tests.Helpers.DeleteCategory(String name) in D:\j\workspace\windows-TGrou---f8ac6754\src\System.Diagnostics.PerformanceCounter\tests\Helpers.cs:line 40 at System.Diagnostics.Tests.PerformanceCounterCategoryTests.PerformanceCounterCategory_Create_Obsolete() in D:\j\workspace\windows-TGrou---f8ac6754\src\System.Diagnostics.PerformanceCounter\tests\PerformanceCounterCategoryTests.cs:line 115 ``` 25229 area-System.Memory Change OwnedMemory Pin to take an optional integer offset Related to https://github.com/dotnet/corefx/issues/24317 and https://github.com/dotnet/corefx/pull/24323#discussion_r141769638 > the scenario is I use OwnedMemory and MemoryHandle directly, without using Memory, e.g. I implement my own Memory-like factory for spans. If we don't like AddOffset, we should add OwnedMemory.Pin overload that takes offset to the added to the pointer inside the handle. ## API Proposal Change: ```C# namespace System.Buffers { public abstract class OwnedMemory<T> : IDisposable, IRetainable { public abstract MemoryHandle Pin(); } } ``` To: ```C# namespace System.Buffers { public abstract class OwnedMemory<T> : IDisposable, IRetainable { public abstract MemoryHandle Pin(int offset = 0); } } ``` ## Usage **Example** from [NativeOwnedMemory](https://github.com/dotnet/corefx/blob/master/src/Common/tests/System/Buffers/NativeOwnedMemory.cs#L56): ```C# public override unsafe MemoryHandle Pin() => new MemoryHandle(this, (void*)_ptr); ``` Would become: ```C# public override unsafe MemoryHandle Pin(int offset = 0) { void* pointer = (void*)((byte*)_ptr + offset); return new MemoryHandle(this, pointer); } ``` The following can then be re-written from [Memory.Retain](https://github.com/dotnet/corefx/blob/master/src/System.Memory/src/System/Memory.cs#L193-L197): ```C# if (_index < 0) { memoryHandle = ((OwnedMemory<T>)_arrayOrOwnedMemory).Pin(); memoryHandle.AddOffset((_index & RemoveOwnedFlagBitMask) * Unsafe.SizeOf<T>()); } ``` To: ```C# if (_index < 0) { memoryHandle = ((OwnedMemory<T>)_arrayOrOwnedMemory).Pin((_index & RemoveOwnedFlagBitMask) * Unsafe.SizeOf<T>()); } ``` We can then remove the internal AddOffset method [here](https://github.com/dotnet/corefx/blob/master/src/System.Memory/src/System/Buffers/MemoryHandle.cs#L48-L58) which was added in https://github.com/dotnet/corefx/pull/24323. cc @KrzysztofCwalina, @stephentoub, @karelz, @terrajobst, @pakrym 25230 area-System.Net HTTP unit tests crashes sometimes This is on Ubuntu 17.04. I'm not sure yet if other platforms are affected. I build HTTP uni tests and than I use RunTest.sh to it in loop with outer-loop tests enabled. *** Error in `/home/build/github/corefx/bin/testhost/netcoreapp-Linux-Debug-x64//dotnet': double free or corruption (fasttop): 0x00007f07f800e680 *** if enabled, core file is created ``` (lldb) bt * thread #1: tid = 32784, 0x00007f08a74ed77f libc.so.6`__GI_raise(sig=2) + 159 at raise.c:58, name = 'dotnet', stop reason = signal SIGABRT * frame #0: 0x00007f08a74ed77f libc.so.6`__GI_raise(sig=2) + 159 at raise.c:58 frame #1: 0x00007f08a74ef37a libc.so.6`__GI_abort + 362 at abort.c:89 frame #2: 0x00007f08a7531090 libc.so.6`__libc_message(do_abort=2, fmt=<unavailable>) + 704 at libc_fatal.c:175 frame #3: 0x00007f08a753ac3a libc.so.6`_int_free + 1578 at malloc.c:5048 frame #4: 0x00007f08a753abad libc.so.6`_int_free(av=<unavailable>, p=<unavailable>, have_lock=<unavailable>) + 1437 at malloc.c:3904 frame #5: 0x00007f08a753ed2c libc.so.6`__GI___libc_free(mem=<unavailable>) + 76 at malloc.c:2984 frame #6: 0x00007f0805b650dd libcrypto.so.1.0.0`CRYPTO_free + 29 frame #7: 0x00007f0805b67c3c libcrypto.so.1.0.0`OBJ_NAME_add + 140 frame #8: 0x00007f0805c26a68 libcrypto.so.1.0.0`EVP_add_digest + 40 frame #9: 0x00007f0805f91d3f libssl.so.1.0.0`SSL_library_init + 399 frame #10: 0x00007f07dd138651 System.Security.Cryptography.Native.OpenSsl.so`::CryptoNative_EnsureLibSslInitialized() + 17 at pal_ssl.cpp:19 frame #11: 0x00007f082db42bc6 frame #12: 0x00007f082db41bc4 ``` 25231 area-Microsoft.CSharp Remove some unreachable errors from Microsoft.CSharp * Remove `Error.BindBinaryOperatorRequireTwoArguments()` `BindBinaryOperation` is only called by `DispatchPayload`, which is only called by `RuntimeBinder.BindCore`, which is only called by `RuntimeBinder.Bind`, which is only called with a `CSharpBinaryOperationBinder` as the first argument from `CSharpBinaryOperationBinder.FallbackBinaryOperation` which passes a fixed 2-element array. Anything but 2-elements is hence impossible. Include tests that try to pass an different number, which throw in the `DynamicMetaObjectBinder` base. * Remove `Error.BindUnaryOperatorRequireOneArgument()` `BindUnaryOperation` is only called by `DispatchPayload`, which is only called by `RuntimeBinder.BindCore`, which is only called by `RuntimeBinder.Bind`, which is only called with a `CSharpUnaryOperationBinder` as the first argument from `CSharpUnaryOperationBinder.FallbackBinaryOperation` which passes a fixed 1-element array. Anything but 1 element is hence impossible. * Remove `Error.BindBinaryAssignmentRequireTwoArguments()` `BindUnaryOperation` is only called by `CSharpSetIndexBinder.DispatchPayload` or `CSharpSetMemberBinder.DispatchPayload`. `CSharpSetMemberBinder.DispatchPayload` will only be calling with a fixed 2-element array. `CSharpSetIndexBinder.DispatchPayload` will only be called with an array with at least 3 elements. Anything but with fewer than 2 elements is hence impossible. * Remove `Error.BindRequireArguments()` All calls include the target in the arguments, some include more, so there's never fewer than one `arg`. * Remove check that payload to `RuntimeBinder.Bind` is `ICSharpBinder` Call always traces back to an `ICSharpBinder` implementation passing this so can never not be so. 25232 area-System.Security Move RandomNumberGenerator to coreclr There are many cases where RandomNumberGenerator needs to be used. Currently it requires pulling in whole System.Security.Cryptography.Algorithms. It would be useful to have it defined in coreclr to avoid this dependency. cc: @bartonjs @morganbr 25234 area-System.Net SocketException in SmtpClient takes down process "With the following code, the resulting ExtendedSocketException is not caught and the process crashes: static void Main(string[] args) { try { using (var smtpClient = new SmtpClient()) { smtpClient.Host = ""bogusdomainnotreal.com""; smtpClient.Port = 587; smtpClient.EnableSsl = true; smtpClient.Timeout = 5; smtpClient.SendMailAsync(""me@me.com"", ""test@test.com"", ""subj"", ""body"").Wait(); } } catch (Exception ex) { Console.WriteLine(ex); } }" 25235 area-System.Runtime Added UnixEpoch to DateTime and DateTimeOffset Fixes #24449 25236 area-System.Diagnostics "Tests under ""System.Diagnostics.Tests.PerformanceCounterTests.PerformanceCounter_CreateCounter_SetReadOnly"" failed with ""Assert.NotEqual() Failure\r\nExpected: Not 0\r\nActual: 0""" failed test: System.Diagnostics.Tests.PerformanceCounterTests.PerformanceCounter_CreateCounter_SetReadOnly (from (empty)) Detail: https://ci.dot.net/job/dotnet_corefx/job/master/job/outerloop_netcoreapp_windows_nt_release/lastCompletedBuild/testReport/System.Diagnostics.Tests/PerformanceCounterTests/PerformanceCounter_CreateCounter_SetReadOnly/ MESSAGE: ~~~ Assert.NotEqual() Failure\r\nExpected: Not 0\r\nActual: 0 ~~~ STACK TRACE: ~~~ at System.Diagnostics.Tests.Helpers.RetryOnAllPlatforms[T](Func`1 func) in D:\j\workspace\outerloop_net---7a39cc82\src\System.Diagnostics.PerformanceCounter\tests\Helpers.cs:line 71 at System.Diagnostics.Tests.PerformanceCounterTests.PerformanceCounter_CreateCounter_SetReadOnly() in D:\j\workspace\outerloop_net---7a39cc82\src\System.Diagnostics.PerformanceCounter\tests\PerformanceCounterTests.cs:line 78 ~~~ 25240 area-System.Linq Should we randomise pivots in remaining S.Linq quicksorts? "In #24116 @stephentoub replaced Linq's main use of quicksort with `Array.Sort` (which uses a hybrid sort) to avoid the worse case scenarios identified in #24110 Linq still uses variants of quicksort; partial quicksort to find just part of an ordered sequence and quickselect to find a single element in the ordered sequence. Both of these have the same worse cases as quicksort. `Array.Sort()` is not amenable to these variants. (Also Linq.Parallel still uses quicksort). 4c538585453895abbdde2d4c1e13f1adf1578b3e tests for similar cases to those #24110 complains of. I ran them on the current code, the previous code, and the previous code modified to use random pivots with a xorshift128+ random (faster than `Random.Next()` and no heap allocation). Along with those existing tests that touch on ordering, I found the following: |Test Name|Reverted|Array|Random|Improvement Array|Improvement Random| |---|---|---|---|---|---| |OrderBy(size: 100, iteration: 1000, wrapType: ICollection)|7.12835916007773|8.44284162141898|9.55231274424703|-18.4401828221983|-34.0043694451399| |OrderBy(size: 100, iteration: 1000, wrapType: IEnumerable)|8.31319256253207|9.64644876629239|13.3377040230432|-16.0378361710201|-60.4402150283013| |OrderBy(size: 100, iteration: 1000, wrapType: IReadOnlyCollection)|8.287985653899|9.66300892106141|10.8402846595428|-16.5905604157935|-30.7951667899316| |OrderBy(size: 100, iteration: 1000, wrapType: NoWrap)|7.12519855811195|8.4986142334852|9.83434900229923|-19.2754723138155|-38.0221045363423| |OrderByDescending(size: 100, iteration: 1000, wrapType: ICollection)|6.83798124538432|6.16107873794186|9.04367368779049|9.89915712183875|-32.256485697369| |OrderByDescending(size: 100, iteration: 1000, wrapType: IEnumerable)|8.09819885341283|7.30799004841846|10.9410867061306|9.75783404801615|-35.1051870196999| |OrderByDescending(size: 100, iteration: 1000, wrapType: IReadOnlyCollection)|8.03923158418696|7.69064121266405|10.3879201120447|4.33611555871311|-29.2153361084606| |OrderByDescending(size: 100, iteration: 1000, wrapType: NoWrap)|6.83359279037543|6.07240320977215|9.14982792796568|11.1389367782546|-33.8948370007133| |OrderByThenBy(size: 100, iteration: 1000, wrapType: ICollection)|7.61908238511442|9.08396891367261|10.1217532816741|-19.2265479556984|-32.8474056331141| |OrderByThenBy(size: 100, iteration: 1000, wrapType: IEnumerable)|8.80899047807415|10.277000339993|11.3423225286133|-16.6649046286606|-28.7584832432807| |OrderByThenBy(size: 100, iteration: 1000, wrapType: IReadOnlyCollection)|9.17246763473642|10.5101108520149|11.2456625407076|-14.5832427057337|-22.6023681797462| |OrderByThenBy(size: 100, iteration: 1000, wrapType: NoWrap)|7.60360406591007|9.20888756607525|9.93286135010613|-21.1121395360694|-30.6335951215428| |OrderDifferentSequencePatterns(size: 1000, iterationCount: 1000, pattern: ""asc and desc mixed"", sequence: [0, 999, 2, 997, 4, ...])|105.411336048631|97.9249670353268|143.400279892381|7.10205305608725|-36.0387651535163| |OrderDifferentSequencePatterns(size: 1000, iterationCount: 1000, pattern: ""asc then desc"", sequence: [1000, 999, 998, 997, 996, ...])|420.020209192197|263.470161474411|195.16256008508|37.2720274624096|53.5349595533925| |OrderDifferentSequencePatterns(size: 1000, iterationCount: 1000, pattern: ""asc"", sequence: [0, 1, 2, 3, 4, ...])|105.362480225828|86.9211643744856|141.131704381542|17.5027351404564|-33.9487302112177| |OrderDifferentSequencePatterns(size: 1000, iterationCount: 1000, pattern: ""desc then asc"", sequence: [0, 1, 2, 3, 4, ...])|2805.12054839126|306.402120712674|197.79463755362|89.077042664409|92.9488008040491| |OrderDifferentSequencePatterns(size: 1000, iterationCount: 1000, pattern: ""desc"", sequence: [999, 998, 997, 996, 995, ...])|106.657028249226|136.226477408211|143.234062552128|-27.7238637194071|-34.2940684766055| |OrderDifferentSequencePatterns(size: 1000, iterationCount: 1000, pattern: ""random"", sequence: [534011718, 237820880, 1002897798, 1657007234, 1412011072, ...])|200.154685225037|178.204408640957|217.880368583894|10.9666563934794|-8.85599222367827| `Array.Sort` is worse for many cases, but better for a few and much better for quicksort's worse cases. Randomised-pivot quicksort is worse for almost all cases, but even better than `Array.Sort` for the worse cases. Randomised pivots are also usable with the variants like quickselect. It would seem that randomised pivots aren't worth it for the full sorts, but what about the partials? Is the cost to the general case worth the benefit of avoiding the worse case? Should a different pivot strategy again be used?" 25242 area-System.Net HttpClient GET methods does not call virtual SendAsync method "I want to decorate all requests to `System.Net.Http.HttpClient` in some generic way, e.g. log request uri. I create a subclass of `HttpClient` and override method `SendAsync(HttpRequestMessage, CancellationToken)`. It turns out that overridden method is executed for `PostAsync`, `DeleteAsync`, `PutAsync`, but not executed for `GetAsync`. ``` using System.Net.Http; class HttClientEx : HttpClient { public override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) { Console.WriteLine(""{0} {1}"", request.Method, request.RequestUri); return base.SendAsync(request, cancellationToken); } } ``` Adding some generic request decorators would be much easier if `SendAsync(HttpRequestMessage, HttpCompletionOption, CancellationToken)` would be virtual, but `SendAsync(HttpRequestMessage, CancellationToken)` sealed." 25243 area-System.Net Fix IndexOutOfRangeException in Socket.Begin/EndConnect There is a race condition in Socket.EndConnect, where it attempts to access the RemoteEndPoint of the async result before waiting for the async result to complete. Thus if EndConnect is used immediately after BeginConnect (e.g. without a callback and just invoking it synchronosuly), we might access the remote end point before it's been initialized. Fixes https://github.com/dotnet/corefx/issues/24869 cc: @davidsh 25245 area-Meta [Announcement] [Discussion] Microsoft Security Advisory CVE-2017-11770 # Microsoft Security Advisory CVE-2017-11770 ## Malformed Certificate can cause Denial of Service ### Executive Summary Microsoft is releasing this security advisory to provide information about a vulnerability in the public versions of .NET Core 1.0 and 1.1, and 2.0. This advisory also provides guidance on what developers can do to update their applications correctly. Microsoft is aware of a security vulnerability in the public version of .NET Core where a malformed certificate or other ASN.1 formatted data could lead to a denial of service via an infinite loop on Linux and macOS. System administrators are advised to update their .NET Core runtimes to versions 1.0.8, 1.1.5 and 2.0.3. Developers are advised to update their .NET Core SDK to version 2.0.3 or 1.1.5. ### Announcement https://github.com/dotnet/announcements/issues/44 is the locked announcement for this issue. ### Mitigation Factors .NET Core applications running on Windows are not affected by this vulnerability. ## Affected Software The vulnerabilities affect any Microsoft .NET Core project if it uses any of affected runtime versions listed below and is running on Linux. Platform | Runtime Version | Fixed runtime version ----------------|----------------| ------------------------- Linux | 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.7<br />1.1.0, 1.1.1, 1.1.2, 1.1.4<br />2.0.0 | 1.0.8<br />1.1.5<br />2.0.3 macOS | 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.7<br />1.1.0, 1.1.1, 1.1.2, 1.1.4 | 1.0.8<br />1.1.5 ### Advisory FAQ #### How do I know if I am affected? Any application running against .NET Core 1.0.7 or lower, or 1.1.2 or lower, or 2.0.0 is affected. The default version of the .NET core runtime can be listed by running `dotnet --info`, which should produce output in the form of ``` .NET Command Line Tools (2.0.2) Product Information: Version: 2.0.2 Commit SHA-1 hash: a04b4bf512 Runtime Environment: OS Name: Windows OS Version: 10.0.16299 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\2.0.2\ Microsoft .NET Core Shared Framework Host Version : 2.0.0 Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d ``` As this only displays the latest version of the runtime installed it may hide the fact that you have a vulnerable runtime. A complete list of runtimes can be discovered by performing a directory listing in the install root directories. By default these are | Operating System | Location | |---------------------------|-------------------| | macOS | /usr/local/share/dotnet/shared/Microsoft.NETCore.App/ | | Supported Linux platforms | /usr/share/dotnet/shared/Microsoft.NETCore.App/ | Each runtime version is installed in its own directory, where the directory name is the version number. If you do not have a directory for 1.0.8, 1.1.5 or 2.0.3 then any applications targeting .NET Core will be vulnerable. #### How do I fix my affected application? Applications can be fixed by installing the latest runtimes or SDKs. Typically application servers only install a runtime package, developer machines install SDKs. Installers for the runtimes can be downloaded from the [Runtime and SDK download archive](https://github.com/dotnet/core/blob/master/release-notes/download-archive.md). Version 1.1.5 will also install version 1.0.8 of the runtime. If you have built a [self-contained application](https://docs.microsoft.com/en-us/dotnet/core/deploying/#self-contained-deployments-scd) you must install the new runtime and SDK, recompile your application and redeploy. ## Other Information ### Reporting Security Issues If you have found a potential security issue in .NET Core, please email details to secure@microsoft.com. Reports may qualify for the .NET Core Bug Bounty. Details of the .NET Core Bug Bounty including Terms and Conditions are at [https://aka.ms/corebounty](https://aka.ms/corebounty). ### Support You can ask questions about this issue on GitHub in the .NET Core or ASP.NET Core organizations. These are located at https://github.com/dotnet/ and https://github.com/aspnet/. The Announcements repo for each product (https://github.com/dotnet/Announcements and https://github.com/aspnet/Announcements) will contain this bulletin as an issue and will include a link to a discussion issue where you can ask questions. ### What if the update breaks my application? An application can be pinned to a previous version of the runtime by editing the [application.runtime.config](https://github.com/dotnet/cli/blob/ede74b6be1406ba0c086b6d5fc1a5d4eacff1f01/Documentation/specs/runtime-configuration-file.md#appnameruntimeconfigjson) file for that application and editing the framework version and setting `rollForward` to `false`. This should be treated as a temporary measure and the application updated to work with the patched versions of the framework. Note that this file is optional, you may need to create it for each application alongside the executable. ### Acknowledgments Thanks to Bachraty Gergely for reporting this issue. ### External Links [CVE-2017-11770](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-11770) ### Revisions V1.0 (Nov 14, 2017): Advisory published. V1.1 (Nov 14, 2017): Link to CVE corrected. V1.2 (Nov 14, 2017): Version numbers updated to reflect the correct version, 2.0.3 _Version 1.2_ _Last Updated 2017-11-15_ 25246 area-System.Net Add support for Unix Domain Sockets Exposing a public UnixDomainSocketEndPoint end point to allow users to communicate with Unix domain sockets. Fix #10981 Note - the API is still going through API Review. The major question remaining right now is whether the class should be sealed, or if the class should be unsealed but sealing any virtual methods. I won't merge this until the API has been approved. /cc @khyperia 25248 area-Serialization Fix the SGEN performance issue The app that use SGEN take much longer than the app not use SGEN. This is caused by the super long “if…else if …else if” statement in the Wrte_Object/Read_Object methods. Need port the fix in SG to corefx. 25249 area-System.Memory System.Text.Formatting Epic Tracking item for [System.Text.Formatting](https://github.com/dotnet/corefxlab/tree/master/src/System.Text.Formatting) Related #24174 25251 area-Infrastructure Reference assembly for Nullable<T> needs to contain a private field of type T The reference assembly's declaration for `Nullable<T>` should contain a private field of type `T`. But it does not. ------------------------------------------ @hughbe commented on [Mon Jul 03 2017](https://github.com/dotnet/roslyn/issues/20624) **Version Used**: Microsoft (R) Visual C# Compiler version 2.2.0.61624 **Steps to Reproduce**: 1. `git clone https://github.com/hughbe/excel-mapper/tree/roslyn-demo` 2. `cd excel-mapper/src` 3. `dotnet restore` 4. `dotnet build` 5. `cd ExcelMapper.Tests` 6. `dotnet test` **Expected Behavior**: Compilation fails at step 4. > Pipeline\PipelineResult.cs(9,35): error CS0523: Struct member 'PipelineResult<T>.PreviousResult' of type 'PipelineResult<T>?' causes a cycle in the struct layout [C:\Users\hugh\Documents\GitHub\excel-mapper\src\ExcelMapper\ExcelMapper.csproj] **Note**: changing the [ExcelMapper.csproj](https://github.com/hughbe/excel-mapper/blob/roslyn-demo/src/ExcelMapper/ExcelMapper.csproj) from ```xml <PropertyGroup> <TargetFrameworks>netstandard1.4</TargetFrameworks> </PropertyGroup> ``` to ```xml <PropertyGroup> <TargetFrameworks>netstandard1.4;net46</TargetFrameworks> </PropertyGroup> ``` causes the compilation to fail, and no TypeLoadException to be thrown. **Actual Behavior**: `TypeLoadException` thrown running the unit tests in step 6. ``` Failed ExcelMapper.Tests.ExcelSheetTests.ReadRow_FirstRow_ReturnsExpected Error Message: System.TypeLoadException : Could not load type 'ExcelMapper.Pipeline.PipelineResult`1' from assembly 'ExcelMapper, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Stack Trace: at ExcelMapper.Pipeline.Pipeline`1.CompletePipeline(String stringValue) at ExcelMapper.Pipeline.ColumnPipeline`1.Execute(ExcelSheet sheet, ExcelRow row) in C:\Users\hugh\Documents\GitHub\excel-mapper\src\ExcelMapper\Pipeline\ColumnPipeline.cs:line 29 at ExcelMapper.ExcelPropertyMap.Execute(Object value, ExcelSheet sheet, ExcelRow row) in C:\Users\hugh\Documents\GitHub\excel-mapper\src\ExcelMapper\ExcelPropertyMap.cs:line 21 at ExcelMapper.ExcelClassMap.Execute(ExcelSheet sheet, ExcelRow row) in C:\Users\hugh\Documents\GitHub\excel-mapper\src\ExcelMapper\ExcelClassMap.cs:line 26 at ExcelMapper.ExcelSheet.TryReadRow[T](T& value) in C:\Users\hugh\Documents\GitHub\excel-mapper\src\ExcelMapper\ExcelSheet.cs:line 81 at ExcelMapper.ExcelSheet.ReadRow[T]() in C:\Users\hugh\Documents\GitHub\excel-mapper\src\ExcelMapper\ExcelSheet.cs:line 61 at ExcelMapper.Tests.ExcelSheetTests.ReadRow_FirstRow_ReturnsExpected() in C:\Users\hugh\Documents\GitHub\excel-mapper\src\ExcelMapper.Tests\ExcelMapper\ExcelSheetTests.cs:line 66 ``` --- @gafter commented on [Wed Jul 05 2017](https://github.com/dotnet/roslyn/issues/20624#issuecomment-313159516) The offending code is this ``` c# public struct PipelineResult<T> { public PipelineResult<T>? PreviousResult { get; } ``` This auto-property creates a backing field of type `Nullable<PipelineResult<T>>`, which contains a private field of type `PipelineResult<T>`, thus inducing a cycle. I don't know why the compiler doesn't see this in a `net46` project. --- @hughbe commented on [Wed Jul 05 2017](https://github.com/dotnet/roslyn/issues/20624#issuecomment-313266564) Neal, I believe the compiler doesn't see this in a netstandard project - the netstandard project is the one that crashes on runtime --- @gafter commented on [Sat Nov 11 2017](https://github.com/dotnet/roslyn/issues/20624#issuecomment-343690567) I suspect the reference assembly for the netstandard framework does not contain the private backing field of type `T` for the struct `Nullable<T>`. If so, the bug is in the reference assembly, not the compiler. 25252 area-Infrastructure Add RID for Fedora 27 and enable CoreFX runs https://fedoramagazine.org/announcing-fedora-27/ https://fedoraproject.org/wiki/Releases/27/Schedule https://fedoraproject.org/wiki/End_of_life Related: https://github.com/dotnet/corefx/pull/16302 25253 area-System.Net Linux sockets: Consider removing multi-threading support in SocketAsyncEngine PR #23115 makes this likely unnecessary. There's some additional tuning work planned to try to better optimize epoll_wait behavior, and as part of this, we should remove the multi-threading support in SocketAsyncEngine (or at least rework it). 25254 area-System.Memory Large memory test fails on outerloop /cc @AtsushiKan ref #24497 From System.Memory.Tests Suspected test : (thanks @benaadams ) At a guess... would be the ParserTests.2gbOverflow which needs 4 * 2BG > 8 GB to run ``` Executed on dw7opv3vs0003HH 2017-11-14 20:31:24,865: INFO: scriptrunner(33): _main: BuildTools Helix Script Runner v0.1 starting 2017-11-14 20:31:24,865: INFO: helix_test_execution(24): __init__: Copying execution payload files from C:\dotnetbuild\work\0f6bf7e2-4ce4-4832-b62e-da821b97c51b\Work\4b5eacd6-b225-4ea9-a5f7-441d3c2eba3b\Unzip to C:\dotnetbuild\work\0f6bf7e2-4ce4-4832-b62e-da821b97c51b\Work\4b5eacd6-b225-4ea9-a5f7-441d3c2eba3b\Exec\execution 2017-11-14 20:31:24,865: INFO: io(27): copy_tree_to: Copying 'C:\dotnetbuild\work\0f6bf7e2-4ce4-4832-b62e-da821b97c51b\Work\4b5eacd6-b225-4ea9-a5f7-441d3c2eba3b\Unzip\RunTests.cmd' to 'C:\dotnetbuild\work\0f6bf7e2-4ce4-4832-b62e-da821b97c51b\Work\4b5eacd6-b225-4ea9-a5f7-441d3c2eba3b\Exec\execution\RunTests.cmd' 2017-11-14 20:31:24,865: INFO: io(27): copy_tree_to: Copying 'C:\dotnetbuild\work\0f6bf7e2-4ce4-4832-b62e-da821b97c51b\Work\4b5eacd6-b225-4ea9-a5f7-441d3c2eba3b\Unzip\System.Memory.Tests.dll' to 'C:\dotnetbuild\work\0f6bf7e2-4ce4-4832-b62e-da821b97c51b\Work\4b5eacd6-b225-4ea9-a5f7-441d3c2eba3b\Exec\execution\System.Memory.Tests.dll' 2017-11-14 20:31:24,865: INFO: io(27): copy_tree_to: Copying 'C:\dotnetbuild\work\0f6bf7e2-4ce4-4832-b62e-da821b97c51b\Work\4b5eacd6-b225-4ea9-a5f7-441d3c2eba3b\Unzip\System.Memory.Tests.pdb' to 'C:\dotnetbuild\work\0f6bf7e2-4ce4-4832-b62e-da821b97c51b\Work\4b5eacd6-b225-4ea9-a5f7-441d3c2eba3b\Exec\execution\System.Memory.Tests.pdb' 2017-11-14 20:31:24,880: INFO: io(27): copy_tree_to: Copying 'C:\dotnetbuild\work\0f6bf7e2-4ce4-4832-b62e-da821b97c51b\Work\4b5eacd6-b225-4ea9-a5f7-441d3c2eba3b\Unzip\xunit.console.netcore.exe' to 'C:\dotnetbuild\work\0f6bf7e2-4ce4-4832-b62e-da821b97c51b\Work\4b5eacd6-b225-4ea9-a5f7-441d3c2eba3b\Exec\execution\xunit.console.netcore.exe' 2017-11-14 20:31:24,880: INFO: io(27): copy_tree_to: Copying 'C:\dotnetbuild\work\0f6bf7e2-4ce4-4832-b62e-da821b97c51b\Work\4b5eacd6-b225-4ea9-a5f7-441d3c2eba3b\Unzip\xunit.console.netcore.runtimeconfig.json' to 'C:\dotnetbuild\work\0f6bf7e2-4ce4-4832-b62e-da821b97c51b\Work\4b5eacd6-b225-4ea9-a5f7-441d3c2eba3b\Exec\execution\xunit.console.netcore.runtimeconfig.json' 2017-11-14 20:31:24,880: INFO: proc(23): run_and_log_output: Running: C:\dotnetbuild\work\0f6bf7e2-4ce4-4832-b62e-da821b97c51b\Work\4b5eacd6-b225-4ea9-a5f7-441d3c2eba3b\Unzip\RunTests.cmd C:\dotnetbuild\work\0f6bf7e2-4ce4-4832-b62e-da821b97c51b\Payload 2017-11-14 20:31:24,880: INFO: proc(26): run_and_log_output: CWD: C:\dotnetbuild\work\0f6bf7e2-4ce4-4832-b62e-da821b97c51b\Work\4b5eacd6-b225-4ea9-a5f7-441d3c2eba3b\Unzip 2017-11-14 20:31:24,895: INFO: proc(54): run_and_log_output: Output: Using C:\dotnetbuild\work\0f6bf7e2-4ce4-4832-b62e-da821b97c51b\Payload as the test runtime folder. 2017-11-14 20:31:24,895: INFO: proc(54): run_and_log_output: Output: Executing in C:\dotnetbuild\work\0f6bf7e2-4ce4-4832-b62e-da821b97c51b\Work\4b5eacd6-b225-4ea9-a5f7-441d3c2eba3b\Unzip\ 2017-11-14 20:31:24,895: INFO: proc(54): run_and_log_output: Output: Running tests... Start time: 20:31:24.89 2017-11-14 20:31:24,895: INFO: proc(54): run_and_log_output: Output: 2017-11-14 20:31:24,895: INFO: proc(54): run_and_log_output: Output: C:\dotnetbuild\work\0f6bf7e2-4ce4-4832-b62e-da821b97c51b\Work\4b5eacd6-b225-4ea9-a5f7-441d3c2eba3b\Unzip>set XUNIT_PERFORMANCE_MIN_ITERATION=1 2017-11-14 20:31:24,895: INFO: proc(54): run_and_log_output: Output: 2017-11-14 20:31:24,895: INFO: proc(54): run_and_log_output: Output: C:\dotnetbuild\work\0f6bf7e2-4ce4-4832-b62e-da821b97c51b\Work\4b5eacd6-b225-4ea9-a5f7-441d3c2eba3b\Unzip>set XUNIT_PERFORMANCE_MAX_ITERATION=1 2017-11-14 20:31:24,895: INFO: proc(54): run_and_log_output: Output: 2017-11-14 20:31:24,895: INFO: proc(54): run_and_log_output: Output: C:\dotnetbuild\work\0f6bf7e2-4ce4-4832-b62e-da821b97c51b\Work\4b5eacd6-b225-4ea9-a5f7-441d3c2eba3b\Unzip>call C:\dotnetbuild\work\0f6bf7e2-4ce4-4832-b62e-da821b97c51b\Payload\dotnet.exe xunit.console.netcore.exe System.Memory.Tests.dll -xml testResults.xml -notrait category=nonnetcoreapptests -notrait category=nonwindowstests -notrait category=failing 2017-11-14 20:31:24,990: INFO: proc(54): run_and_log_output: Output: xUnit.net console test runner (64-bit .NET Core) 2017-11-14 20:31:24,990: INFO: proc(54): run_and_log_output: Output: Copyright (C) 2014 Outercurve Foundation. 2017-11-14 20:31:24,990: INFO: proc(54): run_and_log_output: Output: 2017-11-14 20:31:25,084: INFO: proc(54): run_and_log_output: Output: Discovering: System.Memory.Tests 2017-11-14 20:31:25,411: INFO: proc(54): run_and_log_output: Output: Discovered: System.Memory.Tests 2017-11-14 20:31:25,693: INFO: proc(54): run_and_log_output: Output: Starting: System.Memory.Tests 2017-11-14 20:31:27,661: INFO: proc(54): run_and_log_output: Output: [ParseInt32 '0',D to 0)] 2017-11-14 20:31:48,457: INFO: proc(54): run_and_log_output: Output: [ParseInt32 '2',D to 2)] 2017-11-14 20:32:06,128: INFO: proc(54): run_and_log_output: Output: [ParseInt32 '21',D to 21)] 2017-11-14 20:32:23,223: INFO: proc(54): run_and_log_output: Output: [ParseInt32 '+2',D to 2)] 2017-11-14 20:32:40,924: INFO: proc(54): run_and_log_output: Output: [ParseInt32 '-2',D to -2)] 2017-11-14 20:32:57,706: INFO: proc(54): run_and_log_output: Output: [ParseInt32 '2147483647',D to 2147483647)] 2017-11-14 20:33:14,471: INFO: proc(54): run_and_log_output: Output: [ParseInt32 '-2147483648',D to -2147483648)] 2017-11-14 20:33:31,707: INFO: proc(54): run_and_log_output: Output: [ParseInt32 '2147483648',D to (should-not-parse))] 2017-11-14 20:33:48,144: INFO: proc(54): run_and_log_output: Output: [ParseInt32 '-2147483649',D to (should-not-parse))] 2017-11-14 20:34:00,503: INFO: proc(54): run_and_log_output: Output: [ParseInt32 '12345abcdefg1',D to 12345)] 2017-11-14 20:34:11,926: INFO: proc(54): run_and_log_output: Output: [ParseInt32 '1234145abcdefg1',D to 1234145)] 2017-11-14 20:34:23,176: INFO: proc(54): run_and_log_output: Output: [ParseInt32 'abcdefghijklmnop1',D to 0)] 2017-11-14 20:34:34,815: INFO: proc(54): run_and_log_output: Output: [ParseInt32 '1147483648',D to 1147483648)] 2017-11-14 20:34:46,362: INFO: proc(54): run_and_log_output: Output: [ParseInt32 '-1147483649',D to -1147483649)] ``` 25255 area-Serialization Change `releaseNotes` in Sgen package's nuspec The current releaseNotes points to the release notes of .NET Core runtime 1.0.0 release. We should update it to a new fwlink. 25257 area-System.Memory Adding null check for implicit cast from array to Span. Fixes https://github.com/dotnet/corefx/issues/24409 **Edit:** Also fixes https://github.com/dotnet/corefx/issues/16730 ~Will depend on the corresponding PR in coreclr (which will be identical to this one and I will submit it after I address the feedback here).~ Depends on https://github.com/dotnet/coreclr/pull/15044 cc @stephentoub, @KrzysztofCwalina, @benaadams, @ericstj 25259 area-Serialization System.Runtime.Serialization.Primitives (DataContractSerializer) 4.3 is not compatible with coreapp 2.0 Derived Exceptions "DataContractSerializer in System.Runtime.Serialization.Primitives 4.3 is not compatible with Derived Exception objects in coreapp2. In coreapp2, run this code below: ```c# Type type = typeof(NotSupportedException); DataContractSerializer serializer = new DataContractSerializer(type); var test = new NotSupportedException(); object target; using (var stream = new MemoryStream()) { serializer.WriteObject(stream, test); stream.Seek(0, SeekOrigin.Begin); try { target = serializer.ReadObject(stream); } catch (Exception ex) { Console.WriteLine(ex.ToString()); Console.ReadKey(); throw; } } Console.WriteLine(""OK""); Console.ReadKey(); ``` System.PlatformNotSupportedException will be observed. This code works like a charm in coreapp1. Problem is still existed in System.Runtime.Serialization.Primitives 4.4.0-beta-24913-02. [EDIT] Add C# syntax highlighting by @karelz" 25260 area-Meta Error: CS1703: System.Runtime, Version=4.1.2.0 When my MVC.core project tries to open any page, I face with the following error: > CS1703: An assembly with the same identity 'System.Runtime, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' has already been imported. I tried to clean Temporary folder and checked about the conflicts within the projects but I found nothing. 25261 area-System.Net Set handshake failure for alpn failure on Linux. cc @stephentoub @Drawaes fixes #24853 The client throws a TimeoutException, because the server is not sending fatal handshake failed alert before terminating the connection, so the client times out waiting for reply from handshake. @davidsh When i was debugging this on windows, the ```ProtocolToken.Status``` was ```ApplicationProtocolMismatch``` error, but the ```ProtocolToken.Payload``` was null, which means there are no outgoing buffers from Schannel. Does SChannel not send alert for ALPN failure? 25263 area-System.Threading Test failure: System.Threading.ThreadPools.Tests.ThreadPoolTests/SetMinThreadsTo0Test Opened on behalf of @Sunny-pu The test `System.Threading.ThreadPools.Tests.ThreadPoolTests/SetMinThreadsTo0Test` has failed. Assert.True() Failure\r Expected: True\r Actual: False Stack Trace: at System.Threading.ThreadPools.Tests.ThreadPoolTests.SetMinThreadsTo0Test$fin$0() in E:\A\_work\1217\s\corefx\src\System.Threading.ThreadPool\tests\ThreadPoolTests.cs:line 221 at _$ILCT$.$ILT$ReflectionDynamicInvoke$.InvokeRetV(Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean targetIsThisCall) at System.InvokeUtils.CalliIntrinsics.Call(IntPtr dynamicInvokeHelperMethod, Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean isTargetThisCall) at System.InvokeUtils.CallDynamicInvokeMethod(Object thisPtr, IntPtr methodToCall, Object thisPtrDynamicInvokeMethod, IntPtr dynamicInvokeHelperMethod, IntPtr dynamicInvokeHelperGenericDictionary, Object targetMethodOrDelegate, Object[] parameters, BinderBundle binderBundle, Boolean wrapInTargetInvocationException, Boolean invokeMethodHelperIsThisCall, Boolean methodToCallIsThisCall) in CallDynamicInvokeMethod:line 16707566 Build : Master - 20171115.02 (UWP ILC Tests) Failing configurations: - Windows.10.Amd64.ClientRS3-x64 - Debug - Release - Windows.10.Amd64.ClientRS3-x86 - Debug - Release 25264 area-System.Net NetworkInterface.GetPhysicalAddress() will return null for `tun*` on netcore2.0 and linux Not sure if the method is expected to return not null, but seems it does? <details> * On windows([core](https://github.com/dotnet/corefx/blob/v2.0.0/src/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemNetworkInterface.cs#L168)/framework/[mono](https://github.com/mono/mono/blob/mono-5.4.1.7/mcs/class/System/System.Net.NetworkInformation/NetworkInterface.cs#L892)), it always return an new PhysicalAddress(empty for `loopback` but not null). * On linux([mono](https://github.com/mono/mono/blob/mono-5.4.1.7/mcs/class/System/System.Net.NetworkInformation/NetworkInterface.cs#L578)), it always return an new PhysicalAddress if exists, and PhysicalAddress.None if not exists or `loopback`. * On linux([core](https://github.com/dotnet/corefx/blob/v2.0.3/src/System.Net.NetworkInformation/src/System/Net/NetworkInformation/UnixNetworkInterface.cs#L37)), it return the preload PhysicalAddress(but null with `tun*`, and 6 * `00` for `loopback`), and there is already an Assert to ensure it's not null. * The [doc](https://docs.microsoft.com/zh-cn/dotnet/api/system.net.networkinformation.networkinterface.getphysicaladdress?view=netframework-4.7.1) doesn't say the method may return null and the example directly use ToString() on the result. </details> Reproduce step(Tested On Ubuntu, netcore2.0): --- 1. use `tunctl -3` or `openvpn --mktun -dev tun0` or some others to create an tun; 2. use `ifconfig` or some others to add an ipaddr to the card 3. use `NetworkInterface.GetAllNetworkInterfaces()` and `NetworkInterface.GetPhysicalAddress()` in netcore to the the card's macAddr, and get `null`. --- Cross Link: Azure/DotNetty#309 25266 area-System.Diagnostics Make Process.Start throw Win32Exception when child process doesn't exec. This improves the behavior when a child process can't be successfully started. CC @stephentoub 25267 area-System.Runtime RuntimeInformation.ProcessArchitecture is a lie on desktop "1. In Visual Studio 2017, create a new console app targeting .NET Framework 4.7.1 (you might need to grab the [targeting pack](https://www.microsoft.com/net/download/visual-studio-sdks)). 2. Create a x64 solution configuration and switch to it. 3. Put this in `Main()`: `Console.WriteLine($""Arch {RuntimeInformation.ProcessArchitecture}, IntPtr.Size: {IntPtr.Size}"");` 4. Run the app Expected result: ``` Arch X64, IntPtr.Size: 8 ``` Observed result: ``` Arch X86, IntPtr.Size: 8 ```" 25268 area-System.Data Test failure: System.Data.Tests.DataTableTest.PropertyExceptions The test `System.Data.Tests.DataTableTest.PropertyExceptions ` has failed. Assert.Throws() Failure Expected: typeof(System.ArgumentException) Actual: (No exception was thrown) ``` Stack trace: at System.Data.Tests.DataTableTest.<>c.<PropertyExceptions>b__16_0() in D:\git\dotnetfix\corefx\src\System.Data.Common\tests\System\Data\DataTableTest.cs:line 886 Child process: System.Data.Common.Tests, Version=4.2.1.0, Culture=neutral, PublicKeyToken=9d77cc7ad39b68eb System.Data.Tests.DataTableTest+<>c Int32 <PropertyExceptions>b__16_0() ``` - Config: netcoreapp-Windows_NT-Debug-x64 - OS: Microsoft Windows [Version 6.1.7601] 25269 area-System.Data Unhandled Exception: System.Data.Odbc.OdbcException: ERROR [H] [unixODBC][ ```sh # odbcinst -j unixODBC 2.3.4 DRIVERS............: /etc/odbcinst.ini SYSTEM DATA SOURCES: /etc/odbc.ini FILE DATA SOURCES..: /etc/ODBCDataSources USER DATA SOURCES..: /root/.odbc.ini SQLULEN Size.......: 8 SQLLEN Size........: 8 SQLSETPOSIROW Size.: 8 ``` ```sh # dotnet --info .NET Command Line Tools (2.0.0) Product Information: Version: 2.0.0 Commit SHA-1 hash: cdcd1928c9 Runtime Environment: OS Name: debian OS Version: 9 OS Platform: Linux RID: linux-x64 Base Path: /usr/share/dotnet/sdk/2.0.0/ Microsoft .NET Core Shared Framework Host Version : 2.0.0 Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d ``` ```sh # cat /root/.odbcinst.ini [ODBC] TraceFile=/tmp/sql.log Trace=Yes [ODBC Drivers] Cloudera ODBC Driver for Impala=Installed [Cloudera ODBC Driver for Impala] Description=Cloudera ODBC Driver for Impala Driver=/opt/cloudera/impalaodbc/lib/64/libclouderaimpalaodbc64.so ``` ```sh # odbcinst -q -d [ODBC Drivers] [Cloudera ODBC Driver for Impala] ``` ```sh # dpkg -l | grep cloudera ii clouderaimpalaodbc 2.5.40.1025-2 all Cloudera ODBC Driver for Impala ``` ```sh # dotnet run Unhandled Exception: System.Data.Odbc.OdbcException: ERROR [H] [unixODBC][ at System.Data.Odbc.OdbcConnectionHandle..ctor(OdbcConnection connection, OdbcConnectionString constr, OdbcEnvironmentHandle environmentHandle) at System.Data.Odbc.OdbcConnectionOpen..ctor(OdbcConnection outerConnection, OdbcConnectionString connectionOptions) at System.Data.Odbc.OdbcConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionInternal.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.Odbc.OdbcConnection.Open() at dotnet_cross_odbc.Program.Main(String[] args) in /root/dotnet-cross-odbc/src/dotnet-cross-odbc/Program.cs:line 12 ``` *P.S: the host and database has been replaced with '*.*.*.*'* ```txt # cat /tmp/sql.log [ODBC][4192][1510748384.915616][__handles.c][460] Exit:[SQL_SUCCESS] Environment = 0x171d2e0 [ODBC][4192][1510748384.917195][SQLSetEnvAttr.c][189] Entry: Environment = 0x171d2e0 Attribute = SQL_ATTR_ODBC_VERSION Value = 0x3 StrLen = -6 [ODBC][4192][1510748384.917219][SQLSetEnvAttr.c][364] Exit:[SQL_SUCCESS] [ODBC][4192][1510748384.917230][SQLSetEnvAttr.c][189] Entry: Environment = 0x171d2e0 Attribute = SQL_ATTR_CONNECTION_POOLING Value = 0x2 StrLen = -6 [ODBC][4192][1510748384.917237][SQLSetEnvAttr.c][364] Exit:[SQL_SUCCESS] [ODBC][4192][1510748384.918088][SQLAllocHandle.c][375] Entry: Handle Type = 2 Input Handle = 0x171d2e0 [ODBC][4192][1510748384.918112][SQLAllocHandle.c][493] Exit:[SQL_SUCCESS] Output Handle = 0x171df10 [ODBC][4192][1510748384.918506][SQLSetConnectAttrW.c][332] Entry: Connection = 0x171df10 Attribute = SQL_ATTR_LOGIN_TIMEOUT Value = 0xf StrLen = -5 [ODBC][4192][1510748384.918646][SQLSetConnectAttrW.c][606] Exit:[SQL_SUCCESS] [ODBC][4192][1510748384.919578][SQLDriverConnectW.c][290] Entry: Connection = 0x171df10 Window Hdl = (nil) Str In = [Driver=Cloudera ODBC Driver for Impala;Host=*.*.*.*;Port=21050;Database=*;][length = 82 (SQL_NTS)] Str Out = (nil) Str Out Max = 0 Str Out Ptr = 0x7ffe4c382190 Completion = 0 UNICODE Using encoding ASCII 'ANSI_X3.4-1968' and UNICODE 'UCS-2LE' [ODBC][4192][1510748384.928525][SQLDriverConnectW.c][699] Exit:[SQL_ERROR] [ODBC][4192][1510748384.931695][SQLGetDiagRecW.c][514] Entry: Connection = 0x171df10 Rec Number = 1 SQLState = 0x7ffe4c381f40 Native = 0x7ffe4c382130 Message Text = 0x17ba0f0 Buffer Length = 1024 Text Len Ptr = 0x7ffe4c382128 [ODBC][4192][1510748384.931733][SQLGetDiagRecW.c][561] Exit:[SQL_SUCCESS] SQLState = [H] Native = 0x7ffe4c382130 -> 10360 Message Text = [[unixODBC][] [ODBC][4192][1510748384.931772][SQLGetDiagRecW.c][514] Entry: Connection = 0x171df10 Rec Number = 2 SQLState = 0x7ffe4c381f40 Native = 0x7ffe4c382130 Message Text = 0x17ba0f0 Buffer Length = 1024 Text Len Ptr = 0x7ffe4c382128 [ODBC][4192][1510748384.931783][SQLGetDiagRecW.c][561] Exit:[SQL_NO_DATA] ``` Source Repo on GitHub: https://github.com/qqbuby/dotnet-cross-odbc 25273 area-System.IO Add Flush to ZipArchive "When creating a package on .NET Core, you have to call Dispose or Close to get the contents written out to the underlying stream. This works on .NET Framework, but fails on .NET Core: ```csharp [Fact] public void FlushSavesPackageContents() { var uri = new Uri(""/something"", UriKind.Relative); var contentType = ""something/other""; byte[] CreatePackage() { using (var ms = new MemoryStream()) { using (var package = Package.Open(ms, FileMode.Create)) { package.CreatePart(uri, contentType); Assert.Empty(ms.ToArray()); package.Flush(); // All data should be written after calling flush return ms.ToArray(); } } } var bytes = CreatePackage(); Assert.NotEmpty(bytes); using (var ms = new MemoryStream(bytes)) using (var package = Package.Open(ms)) { Assert.True(package.PartExists(uri)); Assert.Equal(contentType, package.GetPart(uri).ContentType); } } ``` " 25274 area-System.Net [release/1.1.x] Port WinRT WebSockets Client fix to UWP/netcore50 servicing Port WinRT WebSockets Client fix (#21600) to UWP servicing (netcore50) branch Fixes #24802 25275 area-System.IO Use Mono workaround to parse internal Uri relationships in packages Uri parsing on Mono has a quirk when parsing a Uri that if you pass UriKind.RelativeOrAbsolute, a forward slash / is treated as absolute while in .NET Framework this would be parsed as relative. This causes `System.IO.Packaging.Package` to not be able to load relative URIs that are used as part of internal relationships. Fixes #24822 25276 area-Infrastructure Add retry logic for setup of dotnet cli Copy init-tools.sh retry logic from corefx. Also adding display_error_message() function. Fixes dotnet/core-eng#1966 25277 area-Serialization "Add a test to verify the XmlQualifiedName ""duration"" of TimeSpan type." "Add a test to verify ""duration"" in the following line. `AddNonXsdPrimitive(typeof(TimeSpan), ""TimeSpan"", UrtTypes.Namespace, ""TimeSpan"", new XmlQualifiedName(""duration"", XmlSchema.Namespace), new XmlSchemaFacet[0], TypeFlags.CanBeAttributeValue | TypeFlags.CanBeElementValue | TypeFlags.XmlEncodingNotRequired);` Fix #18854 @shmao @zhenlan @mconnew " 25280 area-System.Net Throw when ManagedHandler's ConnectHelper completes sync but unsuccessfully https://github.com/dotnet/corefx/pull/23115#issuecomment-344735964 cc: @geoffkizer 25284 area-Infrastructure Change label to use new machine pool Backport of #25283 25285 area-Infrastructure Change label to use new machine pool Backport of #25283 25286 area-System.Net [WIP] Ssl stream bug hunt - trying to find the outerloop failure I have just free'd the GCHandle rather than setting it to null. 25287 area-Infrastructure Is it possible to run test against runtime only? I was able to build and run corefx tests. My work has a constraint that it need to use docker image less than 500MB in size. The docker image contains corefx, coreclr and with built tests is 13.4 GB I wonder if it is possible that I copy minimum required files to the microsoft/dotnet:2.0-runtime-jessie image and have the test run? 25289 area-System.Net HttpListener failure on Windows ARM System.Net.HttpListenerException: Invalid access to memory location at System.Net.HttpListener.BeginGetContext(AsyncCallback callback, Object state) at DotNetCoreHttpListener.Program.Main(String[] args) in C:\src\DotNetCoreHttpListener\Program.cs:line 22 25290 area-System.Net StringContent doesn't have an option to remove charset "I'm using `HttpClient `to send the request but it seems `StringContent ` doesn't have an option to remove `charset `and I have to do it manually REST endpoint only support `{application/json}` not `{application/json; charset=utf-8}` ``` apiClient.BaseAddress = new Uri(""http://endpoint:8888""); apiClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(""application/json"")); var json = JsonConvert.SerializeObject(new Dictionary<string, string> { {""username"", username}, {""password"", password} }); var content = new StringContent(json, Encoding.UTF8, ""application/json""); content.Headers.Remove(""Content-Type""); // ""{application/json; charset=utf-8}"" content.Headers.Add(""Content-Type"", ""application/json""); var loginResponse = await apiClient.PostAsync(""api/login"", content); ``` **Environment**: .NET Core 2.0, .NET Standard 2.0 " 25291 area-System.Diagnostics Linux Process.StartTime is in the future TestStartTimeProperty failed on my laptop: ``` System.Diagnostics.Tests.ProcessThreadTests.TestStartTimeProperty [FAIL] Assert.InRange() Failure Range: (11/17/17 3:21:16 AM - 11/16/17 12:10:45 PM) Actual: 11/17/17 3:21:17 AM Stack Trace: /home/tmds/repos/corefx/src/System.Diagnostics.Process/tests/ProcessThreadTests.cs(115,0): at System.Diagnostics.Tests.ProcessThreadTests.<TestStartTimeProperty>d__3.MoveNext() --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- Finished: System.Diagnostics.Process.Tests ``` The actual and lower range values are in the future. To calculate the StartTime, the boot time of the system is used. It is calculated as follows: https://github.com/dotnet/corefx/blob/c280881a048ee9d9fbfc629ca55d755d3e2b045d/src/System.Diagnostics.Process/src/System/Diagnostics/Process.Unix.cs#L483 Probably Stopwatch.GetTimestamp doesn't increment while my laptop is sleeping. 25292 area-System.Net Fix Socket span tests in light of ArraySegment->Span cast change The tests were depending on a cast from a default ArraySegment to a Span throwing an exception. Now that it's not, fix the tests accordingly. cc: @ahsonkhan 25293 area-Infrastructure Problem building the build-managed.sh for an x86 CoreFX Linux build Hallo Github Community, im facing following problems building the build-managed.sh for an corefx x86 build: ``` /home/arbeit/Tools/depProj.targets(83,5): error : Error no assets were resolved from NuGet packages. [/home/arbeit/corefx/external/netstandard/netstandard.depproj] /home/arbeit/Tools/depProj.targets(83,5): error : Error no assets were resolved from NuGet packages. [/home/arbeit/corefx/external/docs/docs.depproj] /home/arbeit/Tools/depProj.targets(83,5): error : Error no assets were resolved from NuGet packages. [/home/arbeit/corefx/external/ILLink/ILLink.depproj] ``` I was following these steps: ``` git clone https://github.com/dotnet/corefx.git cd corefx sudo ./cross/build-rootfs.sh x86 ./build-native.sh -debug -- clang3.8 ./build-native.sh -debug -buildArch=x86 -- cross clang3.8 ./build-managed.sh -BuildTests=false ``` The build-native.sh builds working fine, but the managed build not. I also tried -release instead of -debug. I found [these issue with a workaround](https://github.com/dotnet/corefx/issues/15274) but i have no src/Tools/CoreFx.Tools/CoreFx.Tools.csproj. Can someone help me with that problems? Greetings Philipp. 25294 area-System.IO IsolatedStorageException using System.IO.Packaging We are getting an IsolatedStorageException in the System.IO.Packaging code ([details here](https://github.com/OfficeDev/Open-XML-SDK/issues/292#issuecomment-344715377)). Two questions: 1. What is the best way to avoid this using the existing code. 2. I'm willing to contribute a fix to eliminate this issue - can I volunteer to do so? thanks - dave 25295 area-System.Net TryParse for email addresses "Currently we have to write this code: ```c# public static bool IsEmailAddress(this string value) { try { new System.Net.Mail.MailAddress(value); return true; } catch () { return false; } } ``` MailAddress should have a TryParse method like Int32.TryParse. ## Rationale and Usage Throwing and catching exceptions can have a significant impact on performance. So when possible there should be a non-throwing alternative for methods that commonly fail. An example would be `Int32.Parse` and `Int32.TryParse`. There is also an impact on debugger. If you have the IDE set to ""Break on All Exceptions"" in order to see where an exception is being thrown, it will also catch this even though it is not interesting. ## Proposed API ```csharp class MailAddress { [...] public static bool TryParse( string address, out MailAddress result); public static bool TryParse( string address, string displayName, out MailAddress result); public static bool TryParse( string address, string displayName, Encoding displayNameEncoding, out MailAddress result); ``` ## Details ## Open Questions " 25296 area-System.Security Create a Memory/Span-based ASN.1 reader and writer "The AsnReader type can read any BER-encoded value for the types that it supports (for tag values up to int.MaxValue). It also understands the CER and DER restrictions, and when reading in those modes it will enforce the restrictions that those encoding rulesets dictate. The AsnWriter type mostly writes in DER (except where CER demands a different encoding). The only significant ""BER-relaxation"" it takes is that closing a SET OF value will not sort the contents. Unlike its predecessor, the DerEncoder class, AsnWriter never involves `byte[][]`. The reader and writer (and helper classes) are all in one file because they're expected to be consumed as shared source until we're fully happy with things, then it can become public API and split into multiple files accordingly. Reference materials: * [ITU-T-REC-X.680-201508](https://www.itu.int/rec/dologin_pub.asp?lang=e&id=T-REC-X.680-201508-I!!PDF-E&type=items) (ASN.1 language, and some semantics behind the values) * [ITU-T-REC-X.690-201508](https://www.itu.int/rec/dologin_pub.asp?lang=e&id=T-REC-X.690-201508-I!!PDF-E&type=items) (the BER encoding family (BER, CER, DER)). Contributes to #21833." 25297 area-System.Security make sure crypto_Init is done before calling ssl_init fixes #25230 The problem is that openssl initialization is not re-entrant/thread safe. The trace shows SSL_library_init calls OBJ_NAME_add() This is exactly what crypto init would do. Further more, locking needs to be set in openssl. This change ensures crypto init is called before ssl_init. That should be no-op if CryptoNative_EnsureOpenSslInitialized() was already called. With this change did 5000 iterations of HTTP test suite without any crash. 25298 area-Serialization XmlSerializer.CreateWriter Throws NotImplementedException The tests being added by https://github.com/dotnet/wcf/compare/master...imcarolwang:SFxTest?expand=1 got the following exceptions. We need to investigate if it's issue in serialization or in WCF. ``` Exception details: System.ServiceModel.CommunicationException: There was an error in serializing body of message : 'There was an error generating the XML document.'. Please see InnerException for more details. ---> System.InvalidOperationException: There was an error generating the XML document. ---> System.NotImplementedException: The method or operation is not implemented. at System.Xml.Serialization.XmlSerializer.CreateWriter() in E:\A\_work\1360\s\corefx\src\System.Private.Xml\src\Sy stem\Xml\Serialization\XmlSerializer.cs:line 1039 at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespa ces, String encodingStyle, String id) in E:\A\_work\1360\s\corefx\src\System.Private.Xml\src\System\Xml\Serialization \XmlSerializer.cs:line 465 --- End of inner exception stack trace --- at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespa ces, String encodingStyle, String id) in E:\A\_work\1360\s\corefx\src\System.Private.Xml\src\System\Xml\Serialization \XmlSerializer.cs:line 514 at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespa ces) in E:\A\_work\1360\s\corefx\src\System.Private.Xml\src\System\Xml\Serialization\XmlSerializer.cs:line 437 at System.ServiceModel.Dispatcher.XmlSerializerOperationFormatter.SerializeBody(XmlDictionaryWriter writer, Messag eVersion version, XmlSerializer serializer, MessagePartDescription returnPart, MessagePartDescriptionCollection bodyP arts, Object returnValue, Object[] parameters) in E:\OSS\carol\wcf\src\System.Private.ServiceModel\src\System\ServiceModel\Dispatcher\XmlSerializerOperationFormatter.cs:line 324 at System.ServiceModel.Dispatcher.XmlSerializerOperationFormatter.SerializeBody(XmlDictionaryWriter writer, Messag eVersion version, String action, MessageDescription messageDescription, Object returnValue, Object[] parameters, Boolean isRequest) in E:\OSS\carol\wcf\src\System.Private.ServiceModel\src\System\ServiceModel\Dispatcher\XmlSerializerOperationFormatter.cs:line 276 --- End of inner exception stack trace --- ``` 25301 area-System.Linq S.L.Expressions produces unnecessary nop instructions for high-arity delegates Any use of `ldarg`, `ldarga` or `starg` is followed by two redundant `nop` functions due to passing a four-byte signed integer where a two-byte unsigned is expected. In theory this could produce even worse IL for very large values, but since that would be an attempt to use more that 65535 arguments, would fail on that ground anyway. 25302 area-System.Linq S.L.Expressions interpreter defers and differs on excepton for excessive arguments. If you try to compile a lambda expression with more than 65535 parameters it throws `InvalidProgramException` which is to be expected since .NET methods cannot have more arguments than that. The interpreter doesn't throw until attempted invocation, and at that point throws `TargetInvocationException` instead. 25303 area-System.Text Regex should have a static TryParse() method "[edit by @ViktorHofer to put into review format] # Issue from @udlose The `System.Text.RegularExpression` class does not have a true ability to test for valid regular expression syntax from a string input. The only way that this can currently be accomplished is to surround the `Regex `ctor (that takes a string) with a `try/catch` and look for an `ArgumentException `if the string is not a valid regular expression. # Rationale from @udlose This is not desirable for 3 reasons: 1. It doesn't follow the ""TryParse"" pattern used by other types for ""conversion"" from strings such as `Int32.TryParse( string )`, etc. 2. Performance of possible exception throwing 3. Exceptions should not be used for control flow # Proposal from @ViktorHofer ```csharp namespace System.Text.RegularExpressions { public class Regex : ISerializable { public static bool TryParse(string pattern, out Regex regex); public static bool TryParse(string pattern, RegexOptions options, out Regex regex); public static bool TryParse(string pattern, RegexOptions options, TimeSpan matchTimeout, out Regex regex); public static bool Validate(string pattern); public static bool Validate(string pattern, Regexoptions options); } } ``` Names are not final. Could either be `TryCreate(...)` and `ValidatePattern(...)` # Discussion from @ViktorHofer For this to work we would need to make some changes in `RegexParser`. Everywhere where we are currently throwing an exception with the helper method `MakeException(string)` we would need to add a condition and return null if no exceptions are desired (TryParse scenario). We would also need to make sure that the changes won't harm existing inlining optimizations. It would involve adding a lot of repetitive code." 25304 area-System.Linq Fix two issues related to high-arity lambda expressions. * Only use two bytes for arguments of `ldarg` and relatives in S.L.Expressions. Fixes #25301 * Always throw InvalidProgramException compiling lambdas too many params Consistent between interpreter and compiler, and later code can depend on the count being valid. Fixes #25302 25305 area-Infrastructure Fix issue where CI perf builds fail by invoking sudo [This build](https://ci2.dot.net/job/dotnet_corefx/job/perf/job/master/job/perf_ubuntu14.04_release/1373/console) failed on the new Ubuntu machine pool because of a call to sudo, and no longer running as root. Root permissions are not required to run these commands, so the sudo call should not be needed 25306 area-System.Security X509Store.Add pops up a dialog, fails on OneCore systems "Repro: ```c# using System; using System.Security.Cryptography.X509Certificates; namespace CertTest { class Program { static void Main(string[] args) { X509Store store = new X509Store(StoreName.Root, StoreLocation.CurrentUser); store.Open(OpenFlags.ReadWrite); string certPath = ""c:\\test\\t.cer""; store.Add(new X509Certificate2(X509Certificate2.CreateFromCertFile(certPath))); Console.WriteLine(""Added Cert: "" + certPath); store.Close(); } } } ``` The code below pops up a dialog: ""You are about to install a certificate from a certification authority... "":  when run on a desktop version on Windows. On a GUI-less OneCore system (such as Nano or IoT Core), it fails immediately with exception `Internal.Cryptography.CryptoThrowHelper.WindowsCryptographicException: 'The operation was canceled by the user'` making this API completely unusable. Interestingly, the API succeeds on Linux. So either we have a security hole on Linux, or we need to fix it on Windows (at least OneCore SKUs) to avoid the dialog. The popup can be avoided when the certificate is added to the local machine root, however that only works for an administrator and is not possible for many scenarios. [EDIT] Add C# syntax highlight by @karelz" 25307 area-System.Runtime Expose and test TryFormat methods on {S}Byte, {U}Int16/32/64, Boolean Depends on https://github.com/dotnet/coreclr/pull/15069 Depends on https://github.com/dotnet/corert/pull/4953 Fixes https://github.com/dotnet/corefx/issues/22403 25308 area-System.Linq S.L.Expressions: Remove pre-generated delegate for CallSite-only delegate. Has no actual dynamic arguments. 25310 area-Meta Feature request: Add a method to get the core framework version. "Due to some function is brought in with newer version of core framework, I need to test the installed version of core framework on client side while my app running. Is there any way to get the framework version, e.g. ""2.0.3"" ? Currently, Environment.Version is set to netfx version even the app is running as core app. Thanks." 25311 area-System.Net "Tests under ""System.Net.Tests"" failed with ""Exit code was 131 but it should have been 42""" Failed tests: System.Net.Tests.WebRequestTest.DefaultWebProxy_SetThenGet_ValuesMatch System.Net.Tests.GlobalProxySelectionTest.Select_Success System.Net.Tests.HttpWebRequestTest.DefaultMaximumResponseHeadersLength_SetAndGetLength_ValuesMatch System.Net.Tests.HttpWebRequestTest.DefaultMaximumErrorResponseLength_SetAndGetLength_ValuesMatch System.Net.Tests.HttpWebRequestTest.DefaultCachePolicy_SetAndGetPolicyReload_ValuesMatch System.Net.Tests.AuthenticationManagerTest.CredentialPolicy_Roundtrip System.Net.Tests.AuthenticationManagerTest.CustomTargetNameDictionary_ValidCollection System.Net.Tests.AuthenticationManagerTest.Register_Unregister_ModuleCountUnchanged Configuration: osx10.12_debug Detail: https://ci.dot.net/job/dotnet_corefx/job/master/job/osx10.12_debug/3587/testReport/ MESSAGE: Exit code was 131 but it should have been 42\nExpected: True\nActual: False +++++++++++++++++++ STACK TRACE: at System.Diagnostics.RemoteExecutorTestBase.RemoteInvokeHandle.Dispose() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_debug/src/CoreFx.Private.TestUtilities/src/System/Diagnostics/RemoteExecutorTestBase.cs:line 205 at System.Net.Tests.WebRequestTest.DefaultWebProxy_SetThenGet_ValuesMatch() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_debug/src/System.Net.Requests/tests/WebRequestTest.cs:line 36 25312 area-System.Diagnostics Fix Process StartTime offset on Linux due to device sleeping Fixes https://github.com/dotnet/corefx/issues/25291 25313 area-Meta Getting MSB3027 (access denied) in MSDEV during compilation after dotnet.exe crash "Hey there, I'm devolping a dotnet core console application with Visual Studio Pro 2017 (15.4.0). Sometimes I'm starting my console app from the Powershell, sometimes directly hitting F5 from the Visual Studio. It occurs from time to time, that when I start the Project from Powershell, that dotnet.exe crashes in case of an unhandled application exception. From that Point on, I can't compile my Project anymore getting: Error MSB3027 Could not copy ""obj\Debug\netcoreapp2.0\projectname.dll"" to ""bin\Debug\netcoreapp2.0\projectname.dll"". Exceeded retry count of 10. Failed. In the taskmanager, there is no dotnet process open, closing all MSDEV instances doesn't help. At the Moment I'm forced to do a reboot. Any guesses? " 25316 area-Serialization Add releasenotes and projecturl in the nuget package. Fix #25255 @shmao @zhenlan @mconnew 25319 area-Infrastructure Use BuildTools PackageVersionPropsUrl tooling https://github.com/dotnet/core-eng/issues/2037 BuildTools PR this is using: https://github.com/dotnet/buildtools/pull/1787 --- All definitions need `PB_PackageVersionPropsUrl` to default to empty string, not undefined. If it were undefined, VSTS could leave in `$(PB_PackageVersionPropsUrl)` which would make the build fail when it fails to download it. For Docker, map the environment variable on each run command. For OSX/Windows, have VSTS set the environment variable by creating a definition variable. 25320 area-Serialization SGEN need support .exe It only works for .dll not works for .exe. This is because in the target, we always load <AssemblyName>.dll. In full framework, the output is <AssemblyName>.exe. 25321 area-Infrastructure Mark packages as stable for 2.0.4 cc: @weshaggard FYI: @danmosemsft 25323 area-System.IO Porting: Switch WaitNamedPipe and CreateNamedPipeClient invocation ordering. (Original PR #24616) * Switch WaitNamedPipe and CreateNamedPipeClient invocation ordering. We need to do this as WaitNamedPipe is not supported in Windows Containers. By default using CreateNamedPipeClient first with call to WaitNamedPipe as a fallback only will allow us to use NamedPipeClientStream inside Windows Containers. * Integrate feedback from PR. 25324 area-System.Numerics Add support for Big-Endian and unsigned byte patterns to BigInteger Fixes #24575 25326 area-System.Runtime Temporarily removing use of ReadOnlySpan indexer in Runtime.Extensions Removing the use of the ReadOnlySpan indexer to help the implementation change go through with the least disabling of tests. This is a temporary workaround that is required to reduce the number of failing tests that would need to be disabled due to the change to ReadOnlySpan indexer to return ref readonly, here: https://github.com/dotnet/coreclr/pull/14727 cc @weshaggard, @stephentoub, @KrzysztofCwalina, @jkotas **This change should be reverted once the change propogates (and the tests enabled): https://github.com/dotnet/coreclr/issues/15089** 25328 area-System.Data Better error messaging for Integrated Auth Failure in SqlClient SqlClient error should also point the user to check if Kerberos is enabled on Sql Server for authentication when Integrated Authentication fails. 25329 area-System.Net [release/1.0.0] Port WinRT WebSockets Client fix (#21600) Port WinRT WebSockets Client fix (#21600) to UWP servicing (netcore50) branch Contributes to #24802 25330 area-System.Net WebSocket broken after failed close handshake Server: AspNet Core 2.0 Client: websocket-sharp If you connect with websocket-sharp to AspNet Core's Websocket server, then kills the client app, reopen it, and connect again, you get an exception on server's ReceiveAsync(). After that, you can't connect from any source, even from browsers. ``` [2017-11-18 03:51:33] info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] Request starting HTTP/1.1 GET http://localhost:5000/ws [2017-11-18 03:51:35] fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[0] An unhandled exception has occurred while executing the request System.Net.WebSockets.WebSocketException (0x80004005): The remote party closed the WebSocket connection without completing the close handshake. ---> Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException: Unexpected end of request content. at Microsoft.AspNetCore.Server.Kestrel.Internal.System.IO.Pipelines.PipeCompletion.ThrowFailed() at Microsoft.AspNetCore.Server.Kestrel.Internal.System.IO.Pipelines.Pipe.GetResult(ReadResult& result) at Microsoft.AspNetCore.Server.Kestrel.Internal.System.IO.Pipelines.Pipe.Microsoft.AspNetCore.Server.Kestrel.Internal.System.IO.Pipelines.IReadableBufferAwaiter.GetResult() at Microsoft.AspNetCore.Server.Kestrel.Internal.System.IO.Pipelines.ReadableBufferAwaitable.GetResult() at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.MessageBody.<ReadAsync>d__22.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.FrameRequestStream.<ReadAsyncInternal>d__21.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() at System.Net.WebSockets.ManagedWebSocket.<EnsureBufferContainsAsync>d__70.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.WebSockets.ManagedWebSocket.<ReceiveAsyncPrivate>d__61.MoveNext() at System.Net.WebSockets.ManagedWebSocket.<ReceiveAsyncPrivate>d__61.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at Test.Web.WebSocketManager.WebSocketManagerMiddleware.<Receive>d__7.MoveNext() in D:\Projects\...\Test-web\Test.Web\WebSocketManager\WebSocketManagerMiddleware.cs:line 92 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Test.Web.WebSocketManager.WebSocketManagerMiddleware.<Invoke>d__6.MoveNext() in D:\Projects\...\Test-web\Test.Web\WebSocketManager\WebSocketManagerMiddleware.cs:line 31 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.<Invoke>d__3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.<Invoke>d__3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware.<Invoke>d__7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.SpaServices.Webpack.ConditionalProxyMiddleware.<Invoke>d__6.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.SpaServices.Webpack.ConditionalProxyMiddleware.<Invoke>d__6.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.MigrationsEndPointMiddleware.<Invoke>d__4.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.DatabaseErrorPageMiddleware.<Invoke>d__6.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.DatabaseErrorPageMiddleware.<Invoke>d__6.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.<Invoke>d__7.MoveNext() ``` Exception while trying to connect with Chrome after the server is broken: ``` [2017-11-18 03:55:11] info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] Request starting HTTP/1.1 GET http://localhost:5000/ws [2017-11-18 03:55:11] info: Microsoft.AspNetCore.Cors.Infrastructure.CorsService[4] Policy execution successful. [2017-11-18 03:55:11] fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[0] An unhandled exception has occurred while executing the request System.Net.WebSockets.WebSocketException (0x80004005): The remote party closed the WebSocket connection without completing the close handshake. ---> System.ObjectDisposedException: Cannot access a disposed object. Object name: 'FrameResponseStream'. at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.FrameResponseStream.ValidateState(CancellationToken cancellationToken) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.FrameResponseStream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.FrameDuplexStream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) at System.Net.WebSockets.ManagedWebSocket.SendFrameLockAcquiredNonCancelableAsync(MessageOpcode opcode, Boolean endOfMessage, ArraySegment`1 payloadBuffer) at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Test.Web.WebSocketManager.WebSocketHandler.<SendMessageAsync>d__8.MoveNext() in D:\Projects\...\Test-web\Test.Web\WebSocketManager\WebSocketHandler.cs:line 49 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Test.Web.WebSocketManager.WebSocketHandler.<SendMessageToAllAsync>d__10.MoveNext() in D:\Projects\...\Test-web\Test.Web\WebSocketManager\WebSocketHandler.cs:line 68 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Test.Web.MasterServer.MasterServerHandler.<OnConnected>d__1.MoveNext() in D:\Projects\...\Test-web\Test.Web\MasterServer\MasterServerHandler.cs:line 28 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Test.Web.WebSocketManager.WebSocketManagerMiddleware.<Invoke>d__6.MoveNext() in D:\Projects\...\Test-web\Test.Web\WebSocketManager\WebSocketManagerMiddleware.cs:line 29 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.<Invoke>d__3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.<Invoke>d__3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware.<Invoke>d__7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.SpaServices.Webpack.ConditionalProxyMiddleware.<Invoke>d__6.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.SpaServices.Webpack.ConditionalProxyMiddleware.<Invoke>d__6.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.MigrationsEndPointMiddleware.<Invoke>d__4.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.DatabaseErrorPageMiddleware.<Invoke>d__6.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.DatabaseErrorPageMiddleware.<Invoke>d__6.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.<Invoke>d__7.MoveNext() ``` Workaround: ```c# try { await socket.ReceiveAsync(...); } catch (Exception) { await socket.CloseOutputAsync(...); } ``` 25332 area-Microsoft.CSharp Don't cache TypeParameterType in table. There's only one per symbol, and its stored in the symbol and looked-for there first, so never found in the lookup table. Remove the table. 25333 area-Infrastructure cant cross build arm64 on Ubuntu 17.10 simply put i cant cross build arm64 on Ubuntu 17.10 all i need is a arm64 mscorlib.dll cant built the crossbuild rootfs to compile and cant compile it based on the guide https://github.com/dotnet/corefx/blob/master/Documentation/building/cross-building.md nothing in the guide appears to work 25334 area-System.Numerics Add support System.Numerics.Vectors types with double precision Vector2, Vector3, Vector4, Matrix3x2, Matrix4x4, Plane, Quaternion are currently implemented with single precission numbers. Theare are requests (above) and some miror implementations of System.Numerics.* can be found across Internet where double is supported. These classes should support float and double precission and maybe in future more types. One of possile solution is to miror them as generics with support for both double and single precission numbers. ## Rationale and Usage This is request that developers ask about, one of usages is CAD software. For example, to use Vector3<T> and Matrix4x4<T> with double precission we will be able to write: ```csharp var v1 = new Vector3<double>(4,5,4); var v2 = new Vector3<double>(1,3,2); double d = Vector3<double>.Dot(v1, v2); Matrix4x4<double> xRot = Matrix4x4<double>.CreateTranslation(v1); Vector3<double> tr = Vector3<double>.Transform(v2,xRot); ``` ## Proposed API (mirrored from Vector2, Vector3, Vector4, Matrix3x2, Matrix4x4, Plane) The following APIs are duplicates of the existing `float` based APIs, but with `float` replaced with `T` to allow for `float`, `double`, and in the future `System.Half`. ### File Vector2OfT.cs ```csharp public partial struct Vector2<T> : IEquatable<Vector2<T>>, IFormattable { public static Vector2<T> Zero { get; } public static Vector2<T> One { get; } public static Vector2<T> UnitX { get; } public static Vector2<T> UnitY { get; } public override int GetHashCode(); [MethodImpl(MethodImplOptions.AggressiveInlining)] public override bool Equals(object obj); public override string ToString(); public string ToString(string format); public string ToString(string format, IFormatProvider formatProvider); [MethodImpl(MethodImplOptions.AggressiveInlining)] public T Length(); [MethodImpl(MethodImplOptions.AggressiveInlining)] public T LengthSquared(); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T Distance(Vector2<T> value1, Vector2<T> value2); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T DistanceSquared(Vector2<T> value1, Vector2<T> value2); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector2<T> Normalize(Vector2<T> value); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector2<T> Reflect(Vector2<T> vector, Vector2<T> normal); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector2<T> Clamp(Vector2<T> value1, Vector2<T> min, Vector2<T> max); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector2<T> Lerp(Vector2<T> value1, Vector2<T> value2, T amount); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector2<T> Transform(Vector2<T> position, Matrix3x2<T> matrix); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector2<T> Transform(Vector2<T> position, Matrix4x4<T> matrix); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector2<T> TransformNormal(Vector2<T> normal, Matrix3x2<T> matrix); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector2<T> TransformNormal(Vector2<T> normal, Matrix4x4<T> matrix); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector2<T> Transform(Vector2<T> value, Quaternion<T> rotation); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector2<T> Add(Vector2<T> left, Vector2<T> right); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector2<T> Subtract(Vector2<T> left, Vector2<T> right); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector2<T> Multiply(Vector2<T> left, Vector2<T> right); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector2<T> Multiply(Vector2<T> left, T right); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector2<T> Multiply(T left, Vector2<T> right); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector2<T> Divide(Vector2<T> left, Vector2<T> right); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector2<T> Divide(Vector2<T> left, T divisor); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector2<T> Negate(Vector2<T> value); } ``` ### File Vector2_IntrinsicsOfT.cs ```csharp public partial struct Vector2<T> { public T X; public T Y; [JitIntrinsic] public Vector2(T value); [JitIntrinsic] public Vector2(T x, T y); [MethodImpl(MethodImplOptions.AggressiveInlining)] public void CopyTo(T[] array); public void CopyTo(T[] array, int index); [JitIntrinsic] public bool Equals(global::System.Numerics.Vector2<T> other); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T Dot(global::System.Numerics.Vector2<T> value1, global::System.Numerics.Vector2<T> value2); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static global::System.Numerics.Vector2<T> Min(global::System.Numerics.Vector2<T> value1, global::System.Numerics.Vector2<T> value2); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static global::System.Numerics.Vector2<T> Max(global::System.Numerics.Vector2<T> value1, global::System.Numerics.Vector2<T> value2); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static global::System.Numerics.Vector2<T> Abs(global::System.Numerics.Vector2<T> value); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static global::System.Numerics.Vector2<T> SquareRoot(global::System.Numerics.Vector2<T> value); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static global::System.Numerics.Vector2<T> operator +(global::System.Numerics.Vector2<T> left, global::System.Numerics.Vector2<T> right); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static global::System.Numerics.Vector2<T> operator -(global::System.Numerics.Vector2<T> left, global::System.Numerics.Vector2<T> right); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static global::System.Numerics.Vector2<T> operator *(global::System.Numerics.Vector2<T> left, global::System.Numerics.Vector2<T> right); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static global::System.Numerics.Vector2<T> operator *(T left, global::System.Numerics.Vector2<T> right); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static global::System.Numerics.Vector2<T> operator *(global::System.Numerics.Vector2<T> left, T right); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static global::System.Numerics.Vector2<T> operator /(global::System.Numerics.Vector2<T> left, global::System.Numerics.Vector2<T> right); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static global::System.Numerics.Vector2<T> operator /(global::System.Numerics.Vector2<T> value1, T value2); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static global::System.Numerics.Vector2<T> operator -(global::System.Numerics.Vector2<T> value); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool operator ==(global::System.Numerics.Vector2<T> left, global::System.Numerics.Vector2<T> right); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool operator !=(global::System.Numerics.Vector2<T> left, global::System.Numerics.Vector2<T> right); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static explicit operator Vector2<T>(Vector2 value); } ``` ### File Vector3OfT.cs ```csharp public partial struct Vector3<T> : IEquatable<Vector3<T>>, IFormattable { public static Vector3<T> Zero { get; } public static Vector3<T> One { get; } public static Vector3<T> UnitX { get; } public static Vector3<T> UnitY { get; } public static Vector3<T> UnitZ { get; } public override int GetHashCode(); [MethodImpl(MethodImplOptions.AggressiveInlining)] public override bool Equals(object obj); public override string ToString(); public string ToString(string format); public string ToString(string format, IFormatProvider formatProvider); [MethodImpl(MethodImplOptions.AggressiveInlining)] public T Length(); [MethodImpl(MethodImplOptions.AggressiveInlining)] public T LengthSquared(); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T Distance(Vector3<T> value1, Vector3<T> value2); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T DistanceSquared(Vector3<T> value1, Vector3<T> value2); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector3<T> Normalize(Vector3<T> value); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector3<T> Cross(Vector3<T> vector1, Vector3<T> vector2); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector3<T> Reflect(Vector3<T> vector, Vector3<T> normal); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector3<T> Clamp(Vector3<T> value1, Vector3<T> min, Vector3<T> max); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector3<T> Lerp(Vector3<T> value1, Vector3<T> value2, T amount); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector3<T> Transform(Vector3<T> position, Matrix4x4<T> matrix); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector3<T> TransformNormal(Vector3<T> normal, Matrix4x4<T> matrix); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector3<T> Transform(Vector3<T> value, Quaternion<T> rotation); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector3<T> Add(Vector3<T> left, Vector3<T> right); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector3<T> Subtract(Vector3<T> left, Vector3<T> right); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector3<T> Multiply(Vector3<T> left, Vector3<T> right); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector3<T> Multiply(Vector3<T> left, T right); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector3<T> Multiply(T left, Vector3<T> right); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector3<T> Divide(Vector3<T> left, Vector3<T> right); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector3<T> Divide(Vector3<T> left, T divisor); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector3<T> Negate(Vector3<T> value); } ``` ### File Vector3_IntrinsicsOfT.cs ```csharp public partial struct Vector3<T> { public T X; public T Y; public T Z; [JitIntrinsic] public Vector3(T value); public Vector3(Vector2<T> value, T z); [JitIntrinsic] public Vector3(T x, T y, T z); [MethodImpl(MethodImplOptions.AggressiveInlining)] public void CopyTo(T[] array); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public void CopyTo(T[] array, int index); [JitIntrinsic] public bool Equals(Vector3<T> other); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T Dot(Vector3<T> vector1, Vector3<T> vector2); [JitIntrinsic] public static Vector3<T> Min(Vector3<T> value1, Vector3<T> value2); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector3<T> Max(Vector3<T> value1, Vector3<T> value2); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector3<T> Abs(Vector3<T> value); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector3<T> SquareRoot(Vector3<T> value); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector3<T> operator +(Vector3<T> left, Vector3<T> right); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector3<T> operator -(Vector3<T> left, Vector3<T> right); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector3<T> operator *(Vector3<T> left, Vector3<T> right); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector3<T> operator *(Vector3<T> left, T right); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector3<T> operator *(T left, Vector3<T> right); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector3<T> operator /(Vector3<T> left, Vector3<T> right); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector3<T> operator /(Vector3<T> value1, T value2); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector3<T> operator -(Vector3<T> value); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool operator ==(Vector3<T> left, Vector3<T> right); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool operator !=(Vector3<T> left, Vector3<T> right); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static explicit operator Vector3<T>(Vector3 value); } ``` ### File Vector4OfT.cs ```csharp public partial struct Vector4<T> : IEquatable<Vector4<T>>, IFormattable { public static Vector4<T> Zero { get; } public static Vector4<T> One { get; } public static Vector4<T> UnitX { get; } public static Vector4<T> UnitY { get ; } public static Vector4<T> UnitZ { get; } public static Vector4<T> UnitW { get; }; public override int GetHashCode(); [MethodImpl(MethodImplOptions.AggressiveInlining)] public override bool Equals(object obj); public override string ToString(); public string ToString(string format); public string ToString(string format, IFormatProvider formatProvider); [MethodImpl(MethodImplOptions.AggressiveInlining)] public T Length(); [MethodImpl(MethodImplOptions.AggressiveInlining)] public T LengthSquared(); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T Distance(Vector4<T> value1, Vector4<T> value2); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T DistanceSquared(Vector4<T> value1, Vector4<T> value2); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4<T> Normalize(Vector4<T> vector); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4<T> Clamp(Vector4<T> value1, Vector4<T> min, Vector4<T> max); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4<T> Lerp(Vector4<T> value1, Vector4<T> value2, T amount); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4<T> Transform(Vector2<T> position, Matrix4x4<T> matrix); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4<T> Transform(Vector3<T> position, Matrix4x4<T> matrix); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4<T> Transform(Vector4<T> vector, Matrix4x4<T> matrix); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4<T> Transform(Vector2<T> value, Quaternion<T> rotation); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4<T> Transform(Vector3<T> value, Quaternion<T> rotation); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4<T> Transform(Vector4<T> value, Quaternion<T> rotation); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4<T> Add(Vector4<T> left, Vector4<T> right); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4<T> Subtract(Vector4<T> left, Vector4<T> right); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4<T> Multiply(Vector4<T> left, Vector4<T> right); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4<T> Multiply(Vector4<T> left, T right); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4<T> Multiply(T left, Vector4<T> right); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4<T> Divide(Vector4<T> left, Vector4<T> right); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4<T> Divide(Vector4<T> left, T divisor); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4<T> Negate(Vector4<T> value); } ``` ### File Vector4OfT_Intrinsics.cs ```csharp public partial struct Vector4<T> { public T X; public T Y; public T Z; public T W; [JitIntrinsic] public Vector4(T value); [JitIntrinsic] public Vector4(T x, T y, T z, T w); public Vector4(Vector2<T> value, T z, T w); public Vector4(Vector3<T> value, T w); [MethodImpl(MethodImplOptions.AggressiveInlining)] public void CopyTo(T[] array); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public void CopyTo(T[] array, int index); [JitIntrinsic] public bool Equals(Vector4<T> other); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T Dot(Vector4<T> vector1, Vector4<T> vector2); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4<T> Min(Vector4<T> value1, Vector4<T> value2); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4<T> Max(Vector4<T> value1, Vector4<T> value2); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4<T> Abs(Vector4<T> value); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4<T> SquareRoot(Vector4<T> value); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4<T> operator +(Vector4<T> left, Vector4<T> right); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4<T> operator -(Vector4<T> left, Vector4<T> right); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4<T> operator *(Vector4<T> left, Vector4<T> right); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4<T> operator *(Vector4<T> left, T right); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4<T> operator *(T left, Vector4<T> right); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4<T> operator /(Vector4<T> left, Vector4<T> right); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4<T> operator /(Vector4<T> value1, T value2); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Vector4<T> operator -(Vector4<T> value); [JitIntrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool operator ==(Vector4<T> left, Vector4<T> right); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool operator !=(Vector4<T> left, Vector4<T> right); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static explicit operator Vector4<T>(Vector4 value); } ``` ### File Matrix3x2OfT.cs ```csharp public struct Matrix3x2<T> : IEquatable<Matrix3x2<T>> { public T M11; public T M12; public T M21; public T M22; public T M31; public T M32; public static Matrix3x2<T> Identity { get; } public bool IsIdentity { get; } public Vector2<T> Translation { get; set; } public Matrix3x2(T m11, T m12, T m21, T m22, T m31, T m32); public static Matrix3x2<T> CreateTranslation(Vector2<T> position); public static Matrix3x2<T> CreateTranslation(T xPosition, T yPosition); public static Matrix3x2<T> CreateScale(T xScale, T yScale); public static Matrix3x2<T> CreateScale(T xScale, T yScale, Vector2<T> centerPoint); public static Matrix3x2<T> CreateScale(Vector2<T> scales); public static Matrix3x2<T> CreateScale(Vector2<T> scales, Vector2<T> centerPoint); public static Matrix3x2<T> CreateScale(T scale); public static Matrix3x2<T> CreateScale(T scale, Vector2<T> centerPoint); public static Matrix3x2<T> CreateSkew(T radiansX, T radiansY); public static Matrix3x2<T> CreateSkew(T radiansX, T radiansY, Vector2<T> centerPoint); public static Matrix3x2<T> CreateRotation(T radians); public static Matrix3x2<T> CreateRotation(T radians, Vector2<T> centerPoint); public T GetDeterminant(); public static bool Invert(Matrix3x2<T> matrix, out Matrix3x2<T> result); public static Matrix3x2<T> Lerp(Matrix3x2<T> matrix1, Matrix3x2<T> matrix2, T amount); public static Matrix3x2<T> Negate(Matrix3x2<T> value); public static Matrix3x2<T> Add(Matrix3x2<T> value1, Matrix3x2<T> value2); public static Matrix3x2<T> Subtract(Matrix3x2<T> value1, Matrix3x2<T> value2); public static Matrix3x2<T> Multiply(Matrix3x2<T> value1, Matrix3x2<T> value2); public static Matrix3x2<T> Multiply(Matrix3x2<T> value1, T value2); public static Matrix3x2<T> operator -(Matrix3x2<T> value); public static Matrix3x2<T> operator +(Matrix3x2<T> value1, Matrix3x2<T> value2); public static Matrix3x2<T> operator -(Matrix3x2<T> value1, Matrix3x2<T> value2); public static Matrix3x2<T> operator *(Matrix3x2<T> value1, Matrix3x2<T> value2); public static Matrix3x2<T> operator *(Matrix3x2<T> value1, T value2); public static bool operator ==(Matrix3x2<T> value1, Matrix3x2<T> value2); public static bool operator !=(Matrix3x2<T> value1, Matrix3x2<T> value2); public bool Equals(Matrix3x2<T> other); public override bool Equals(object obj); public override string ToString(); public override int GetHashCode(); public static explicit operator Matrix3x2<T>(Matrix3x2 value); } ``` ### File Matrix4x4ofT.cs ```csharp public struct Matrix4x4<T> : IEquatable<Matrix4x4<T>> { public T M11; public T M12; public T M13; public T M14; public T M21; public T M22; public T M23; public T M24; public T M31; public T M32; public T M33; public T M34; public T M41; public T M42; public T M43; public T M44; public static Matrix4x4<T> Identity { get; } public bool IsIdentity { get; } public Vector3<T> Translation { get; set; } public Matrix4x4(T m11, T m12, T m13, T m14, T m21, T m22, T m23, T m24, T m31, T m32, T m33, T m34, T m41, T m42, T m43, T m44); public Matrix4x4(Matrix3x2<T> value); public static Matrix4x4<T> CreateBillboard(Vector3<T> objectPosition, Vector3<T> cameraPosition, Vector3<T> cameraUpVector, Vector3<T> cameraForwardVector); public static Matrix4x4<T> CreateConstrainedBillboard(Vector3<T> objectPosition, Vector3<T> cameraPosition, Vector3<T> rotateAxis, Vector3<T> cameraForwardVector, Vector3<T> objectForwardVector); public static Matrix4x4<T> CreateTranslation(Vector3<T> position); public static Matrix4x4<T> CreateTranslation(T xPosition, T yPosition, T zPosition); public static Matrix4x4<T> CreateScale(T xScale, T yScale, T zScale); public static Matrix4x4<T> CreateScale(T xScale, T yScale, T zScale, Vector3<T> centerPoint); public static Matrix4x4<T> CreateScale(Vector3<T> scales); public static Matrix4x4<T> CreateScale(Vector3<T> scales, Vector3<T> centerPoint); public static Matrix4x4<T> CreateScale(T scale); public static Matrix4x4<T> CreateScale(T scale, Vector3<T> centerPoint); public static Matrix4x4<T> CreateRotationX(T radians); public static Matrix4x4<T> CreateRotationX(T radians, Vector3<T> centerPoint); public static Matrix4x4<T> CreateRotationY(T radians); public static Matrix4x4<T> CreateRotationY(T radians, Vector3<T> centerPoint); public static Matrix4x4<T> CreateRotationZ(T radians); public static Matrix4x4<T> CreateRotationZ(T radians, Vector3<T> centerPoint); public static Matrix4x4<T> CreateFromAxisAngle(Vector3<T> axis, T angle); public static Matrix4x4<T> CreatePerspectiveFieldOfView(T fieldOfView, T aspectRatio, T nearPlaneDistance, T farPlaneDistance); public static Matrix4x4<T> CreatePerspective(T width, T height, T nearPlaneDistance, T farPlaneDistance); public static Matrix4x4<T> CreatePerspectiveOffCenter(T left, T right, T bottom, T top, T nearPlaneDistance, T farPlaneDistance); public static Matrix4x4<T> CreateOrthographic(T width, T height, T zNearPlane, T zFarPlane); public static Matrix4x4<T> CreateOrthographicOffCenter(T left, T right, T bottom, T top, T zNearPlane, T zFarPlane); public static Matrix4x4<T> CreateLookAt(Vector3<T> cameraPosition, Vector3<T> cameraTarget, Vector3<T> cameraUpVector); public static Matrix4x4<T> CreateWorld(Vector3<T> position, Vector3<T> forward, Vector3<T> up); public static Matrix4x4<T> CreateFromQuaternion(Quaternion<T> quaternion); public static Matrix4x4<T> CreateFromYawPitchRoll(T yaw, T pitch, T roll); public static Matrix4x4<T> CreateShadow(Vector3<T> lightDirection, Plane<T> plane); public static Matrix4x4<T> CreateReflection(Plane<T> value); public T GetDeterminant(); public static bool Invert(Matrix4x4<T> matrix, out Matrix4x4<T> result); public static bool Decompose(Matrix4x4<T> matrix, out Vector3<T> scale, out Quaternion<T> rotation, out Vector3<T> translation); public static Matrix4x4<T> Transform(Matrix4x4<T> value, Quaternion<T> rotation); public static Matrix4x4<T> Transpose(Matrix4x4<T> matrix); public static Matrix4x4<T> Lerp(Matrix4x4<T> matrix1, Matrix4x4<T> matrix2, T amount); public static Matrix4x4<T> Negate(Matrix4x4<T> value); public static Matrix4x4<T> Add(Matrix4x4<T> value1, Matrix4x4<T> value2); public static Matrix4x4<T> Subtract(Matrix4x4<T> value1, Matrix4x4<T> value2); public static Matrix4x4<T> Multiply(Matrix4x4<T> value1, Matrix4x4<T> value2); public static Matrix4x4<T> Multiply(Matrix4x4<T> value1, T value2); public static Matrix4x4<T> operator -(Matrix4x4<T> value); public static Matrix4x4<T> operator +(Matrix4x4<T> value1, Matrix4x4<T> value2); public static Matrix4x4<T> operator -(Matrix4x4<T> value1, Matrix4x4<T> value2); public static Matrix4x4<T> operator *(Matrix4x4<T> value1, Matrix4x4<T> value2); public static Matrix4x4<T> operator *(Matrix4x4<T> value1, T value2); public static bool operator ==(Matrix4x4<T> value1, Matrix4x4<T> value2); public static bool operator !=(Matrix4x4<T> value1, Matrix4x4<T> value2); public bool Equals(Matrix4x4<T> other); public override bool Equals(object obj); public override string ToString(); public override int GetHashCode(); public static explicit operator Matrix4x4<T>(Matrix4x4 value); } ``` ### File PlaneOfT.cs ```csharp public struct Plane<T> : IEquatable<Plane<T>> { public Vector3<T> Normal; public T D; public Plane(T x, T y, T z, T d); public Plane(Vector3<T> normal, T d); public Plane(Vector4<T> value); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Plane<T> CreateFromVertices(Vector3<T> point1, Vector3<T> point2, Vector3<T> point3); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Plane<T> Normalize(Plane<T> value); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Plane<T> Transform(Plane<T> plane, Matrix4x4<T> matrix); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Plane<T> Transform(Plane<T> plane, Quaternion<T> rotation); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T Dot(Plane<T> plane, Vector4<T> value); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T DotCoordinate(Plane<T> plane, Vector3<T> value); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T DotNormal(Plane<T> plane, Vector3<T> value); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool operator ==(Plane<T> value1, Plane<T> value2); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool operator !=(Plane<T> value1, Plane<T> value2); [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool Equals(Plane<T> other); [MethodImpl(MethodImplOptions.AggressiveInlining)] public override bool Equals(object obj); public override string ToString(); public override int GetHashCode(); public static explicit operator Plane<T>(Plane value); } ``` ### File QuaternionOfT.cs ```csharp public struct Quaternion<T> : IEquatable<Quaternion<T>> { public T X; public T Y; public T Z; public T W; public static Quaternion<T> Identity { get; } public bool IsIdentity { get; } public Quaternion(T x, T y, T z, T w); public Quaternion(Vector3<T> vectorPart, T scalarPart); public T Length(); public T LengthSquared(); public static Quaternion<T> Normalize(Quaternion<T> value); public static Quaternion<T> Conjugate(Quaternion<T> value); public static Quaternion<T> Inverse(Quaternion<T> value); public static Quaternion<T> CreateFromAxisAngle(Vector3<T> axis, T angle); public static Quaternion<T> CreateFromYawPitchRoll(T yaw, T pitch, T roll); public static Quaternion<T> CreateFromRotationMatrix(Matrix4x4<T> matrix); public static T Dot(Quaternion<T> quaternion1, Quaternion<T> quaternion2); public static Quaternion<T> Slerp(Quaternion<T> quaternion1, Quaternion<T> quaternion2, T amount); public static Quaternion<T> Lerp(Quaternion<T> quaternion1, Quaternion<T> quaternion2, T amount); public static Quaternion<T> Concatenate(Quaternion<T> value1, Quaternion<T> value2); public static Quaternion<T> Negate(Quaternion<T> value); public static Quaternion<T> Add(Quaternion<T> value1, Quaternion<T> value2); public static Quaternion<T> Subtract(Quaternion<T> value1, Quaternion<T> value2); public static Quaternion<T> Multiply(Quaternion<T> value1, Quaternion<T> value2); public static Quaternion<T> Multiply(Quaternion<T> value1, T value2); public static Quaternion<T> Divide(Quaternion<T> value1, Quaternion<T> value2); public static Quaternion<T> operator -(Quaternion<T> value); public static Quaternion<T> operator +(Quaternion<T> value1, Quaternion<T> value2); public static Quaternion<T> operator -(Quaternion<T> value1, Quaternion<T> value2); public static Quaternion<T> operator *(Quaternion<T> value1, Quaternion<T> value2); public static Quaternion<T> operator *(Quaternion<T> value1, T value2); public static Quaternion<T> operator /(Quaternion<T> value1, Quaternion<T> value2); public static bool operator ==(Quaternion<T> value1, Quaternion<T> value2); public static bool operator !=(Quaternion<T> value1, Quaternion<T> value2); public bool Equals(Quaternion<T> other); public override bool Equals(object obj); public override string ToString(); public override int GetHashCode(); public static explicit operator Quaternion<T>(Quaternion value); } ``` ### class Vector2 extended with: ```csharp public static implicit operator Vector2(Vector2<double> value); public static implicit operator Vector2(Vector2<float> value); ``` ### class Vector3 extended with: ```csharp public static implicit operator Vector3(Vector3<double> value); public static implicit operator Vector3(Vector3<float> value); ``` ### class Vector4 extended with: ```csharp public static implicit operator Vector4(Vector4<double> value); public static implicit operator Vector4(Vector4<float> value); ``` ### class Matrix3x2 extended with: ```csharp public static implicit operator Matrix3x2(Matrix3x2<double> value); public static implicit operator Matrix3x2(Matrix3x2<float> value); ``` ### class Matrix4x4 extended with: ```csharp public static implicit operator Matrix4x4(Matrix4x4<double> value); public static implicit operator Matrix4x4(Matrix4x4<float> value); ``` ### class Quaternion extended with: ```csharp public static implicit operator Quaternion(Quaternion<double> value); public static implicit operator Quaternion(Quaternion<float> value); ``` ### class Plane extended with: ```csharp public static implicit operator Plane(Plane<double> value); public static implicit operator Plane(Plane<float> value); ``` ## Original Text _From @acecebov on August 25, 2017 16:50_ Add support System.Numerics.Vectors types with double precision: Vector2d, Vector3d, Vector4d, Matrix3x2d, Matrix4x4d, PlaneD, QuaternionD. There are lots of scientific/gaming cases when we want to work with double precision and benefit of SIMD! _Copied from original issue: dotnet/coreclr#13591_ 25335 area-System.Collections IntrospectiveSortUtilities.FloorLog2 method is misleadingly named. coreclr/src/mscorlib/src/System/Collections/Generic/ArraySortHelper.cs The method FloorLog2 does not actually return FloorLog2. It also does not return CeilingLog2. It returns FloorLog2 + 1 unless x is 0, where 0 is returned. Examples (where x is a signed 32 bit integer and f(x) does what FloorLog2 actually does). x => f(x) x = 1: f(x) = 1 x = 2 : f(x) = 2 x = 3 : f(x) = 2 x = 4 : f(x) = 3 x = 7 : f(x) = 3 x = 8 : f(x) = 4 x = 16 : f(x) = 5 x = 100 : f(x) = 7 It appears that the method does what it is supposed to do-- the introsort routine uses and it works for that purpose. The method, however, is poorly named: it should be renamed to something like FloorLog2PlusOne or at least commented to indicate what actually does. I came across this when translating the IntroSort routines into another language but replacing the FloorLog2 method with a method that calculates FloorLog2 which I already had on hand in the target language. 25336 area-System.Runtime Add BigInteger.TryFormat method for outputting to a span I accidentally omitted this when doing the BigInteger work. cc: @bartonjs 25337 area-System.Memory TryFormat with format strings as ReadOnlySpan<char> or string "We've approved and added a bunch of `TryFormat` methods for doing the equivalent of `ToString`, but rendering into a supplied `Span<char>` instead of allocating a `string`. Many of these `TryFormat` methods accept a `string format` argument, just as does `ToString`. @justinvp raised the question of whether these should instead be `ReadOnlySpan<char> format`. Example scenario: His scenario was in looking at changing the implementation of `string.Format`, `StringBuilder.AppendFormat`, etc.: today they allocate substrings when parsing out formats from holes, e.g. `""blah {0:D4} blah {1:[##-##-##]}""`, in order to supply that format string to the formatting API. We can achieve this internally for these methods; the question is whether we should expose that publicly so that other scenarios can benefit from it as well, if there are other scenarios. Another scenario: https://github.com/dotnet/corefx/blob/master/src/System.Runtime.Numerics/src/System/Numerics/BigNumber.cs#L578 BigInteger creates a format string to use when formatting its _sign value, in order to specify the number of digits. If format supported `ReadOnlySpan<char>`, we could use stack space instead of allocating a string. The main downside to this change is it makes the methods a bit harder to use, in particular because there's no implicit cast from `string` to `ReadOnlySpan<char>`, so instead of passing in a format like `""D4""`, you need to do `""D4"".AsReadOnlySpan()`. `TryFormat` methods on the following types would be affected: ```C# BigInteger // TryFormat not yet implemented Byte DateTime DateTimeOffset Decimal Double // TryFormat not yet implemented Guid Int16 Int32 Int64 SByte Single // TryFormat not yet implemented TimeSpan UInt16 UInt32 UInt64 ``` Options --- 1. Leave the design as-is. We could using `string format`, we can address `string.Format`/`StringBuilder.AppendFormat` internally, and rare public uses can allocate strings when needed. 2. Change the methods to use `ReadOnlySpan<char> format` instead of `string format`. Callers use `AsReadOnlySpan()` when they have a string. 3. Change the methods to use `ReadOnlySpan<char> format` instead of `string format`, and add an implicit cast on `string` from `string` to `ReadOnlySpan<char>`. 4. Keep the existing `string format` methods, and add overloads that take `ReadOnlySpan<char>`." 25338 area-Microsoft.CSharp Dynamic overload resolution with conversions fails to distinguish between numeric and string + "Give a class implicitly castable to both `string` and a numeric type: ```C# public class Castable { public static implicit operator int(Castable obj) => 0 public static implicit operator string(Castable obj) => """"; } ``` Then the following: ``` dynamic d = new Castable(); var result = d + 2; ``` Throws `IndexOutOfRangeException` (NetFX throws `RuntimeBinderInternalCompilerException`)." 25339 area-Microsoft.CSharp "MS.CSharp: Stop string conversion being incorrectly considered ""simple""" Correct check that the predefined type must be `<= NUM_EXT_TYPES` to the correct `< NUM_EXT_TYPES`. Stops string conversion being considered when not appropriate. Fixes #25338 25342 area-Microsoft.CSharp MS.CSharp some error improvements * Have `HandleAmbiguity` return `RuntimeBinderException` to throw at callsite Should have been done in #22748 but was missed. Also remove unused argument. * Remove unused boolean parameter passed through `GroupToArgsBinder.Bind()` * Replace always true result from `GroupToArgsBinder.Bind()` with void. Replace always true result from `BindMethodGroupToArgumentsCore` with `GroupToArgsBinderResult` that was `out` parameter. Remove unreachable debug-time error catch. Also remove incorrect comment about extension methods. 25344 area-System.Numerics IndexOutOfRangeException in System.Numerics.Vector<T>(array) Where array Size < 32 Bytes `System.Numerics.Vector<byte> vec = new System.Numerics.Vector<byte>(new byte[] { 4, 3, 2, 1, 6, 4, 2, 4 });` This call will crash with an `IndexOutOfRangeException` exception. I'm pulling in this library as a NuGet package. If I pass in >= 32 bytes, this code works. The same logic applies to other data types if they do not fill enough at least 32 bytes. Is there a reason for this behavior? My use case involves passing variable length bytes (anywhere from 1 to millions). The constructor does not make this behavior clear, and I'd prefer to not have to pad my byte arrays to use this. If the library is not supposed to support values less than the size of the XMM/YMM register, then it would be ideal to at least throw a more specific exception. 25345 area-System.Net Remove blocking in SslStream Tests that should be async This removes a load of blocking in the functional Tests for SslStream. ref PR #25286 ref Issue #19705 This should also unblock #24853 and allow the test changes to be reverted there /cc @stephentoub @Priya91 25346 area-System.Net Tests : Remove the number of unneeded blocking tasks in tests I am launching this as a tracking issue for Tests in general. There a number of cases where Tests block (Task.WaitAll is the biggest culprit it seems) across the Repo. You can get away with this for a certain amount of time, but as the test coverage grows, you tend to hit threadpool starvation and random timeouts, it also has the potential to deadlock xunit. I have launched this issue to track the PR's and to link them back to why I am making the changes. Also to identify other tests that need changing. Areas that need PR's to fix - [x] System.Net.Security (SslStream) - [ ] System.Net.Sockets - [x] System.Net.Http - [x] System.Net.NameResolution - [x] System.Net.Security (Negotiate) I will update this list with more that I find. ref #25345 ref #19705 ref #25360 25347 area-System.Net System.Net.Sockets Remove some Task blocks to make tests async "I have removed the ""easy"" blocking points in the tests in here. There is more work to be done, but they require a lot more refactoring so much closer code reviewing. These the ""low hanging"" fruit and I will look at further PR's to sort this out. ref #25346 " 25349 area-System.Diagnostics PerformanceCounter_IncrementBy_IncrementByReadOnly Failure for Windows 8.1 The failure on Windows is only on Windows.81.Amd64.Open (the test is skipped on a number of the win10 versions) System.Diagnostics.Tests.PerformanceCounterTests/PerformanceCounter_IncrementBy_IncrementByReadOnly Assert.NotEqual() Failure Expected: Not 0 Actual: 0 https://mc.dot.net/#/user/Drawaes/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/95937940636258caa156046fa21fca91a45682d3/workItem/System.Diagnostics.PerformanceCounter.Tests/analysis/xunit/System.Diagnostics.Tests.PerformanceCounterTests~2FPerformanceCounter_IncrementBy_IncrementByReadOnly Trace ``` at System.Diagnostics.Tests.Helpers.RetryOnAllPlatforms[T](Func`1 func) in D:\j\workspace\windows-TGrou---6368dffa\src\System.Diagnostics.PerformanceCounter\tests\Helpers.cs:line 71 at System.Diagnostics.Tests.PerformanceCounterTests.CreateCounterWithCategory(String name, Boolean readOnly, PerformanceCounterCategoryType categoryType) in D:\j\workspace\windows-TGrou---6368dffa\src\System.Diagnostics.PerformanceCounter\tests\PerformanceCounterTests.cs:line 297 at System.Diagnostics.Tests.PerformanceCounterTests.PerformanceCounter_IncrementBy_IncrementByReadOnly() in D:\j\workspace\windows-TGrou---6368dffa\src\System.Diagnostics.PerformanceCounter\tests\PerformanceCounterTests.cs:line 228 ``` 25353 area-System.Numerics "Improve performance of BigInteger.ToString(""x"")" "Benchmark: ```C# using System; using System.Numerics; using BenchmarkDotNet.Attributes.Jobs; using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Running; [MemoryDiagnoser] [InProcess] public class Program { public static void Main() => BenchmarkRunner.Run<Program>(); private static BigInteger s_smallBigInt = new BigInteger(100); private static BigInteger s_largeBigInt = BigInteger.Parse(new string('9', 2000)); [Benchmark] public void BigIntegerToString_Small() { BigInteger small = s_smallBigInt; for (int i = 0; i < 100_000; i++) small.ToString(""x""); } [Benchmark] public void BigIntegerToString_Large() { BigInteger large = s_largeBigInt; for (int i = 0; i < 1_000; i++) large.ToString(""x""); } } ``` Before: ``` | Method | Mean | Error | StdDev | Gen 0 | Allocated | |------------------------- |---------:|----------:|----------:|----------:|----------:| | BigIntegerToString_Small | 20.01 ms | 0.4187 ms | 0.6519 ms | 6843.7500 | 27.47 MB | | BigIntegerToString_Large | 29.62 ms | 0.3435 ms | 0.3045 ms | 8468.7500 | 33.91 MB | ``` After: ``` | Method | Mean | Error | StdDev | Gen 0 | Allocated | |------------------------- |---------:|----------:|----------:|----------:|----------:| | BigIntegerToString_Small | 9.445 ms | 0.1153 ms | 0.0834 ms | 750.0000 | 3.05 MB | | BigIntegerToString_Large | 3.946 ms | 0.0603 ms | 0.0534 ms | 1000.0000 | 4.01 MB | ``` So for this small value, an ~2x throughput improvement, and for this large value, an ~8x throughput improvement, and for both, an ~9x reduction in allocation. cc: @bartonjs " 25354 area-System.Net Add FileStream and int64 overloads to SendPacketsElement "# Approved API shape https://github.com/dotnet/corefx/issues/25354#issuecomment-352854380 ```c# public partial class SendPacketsElement { // EXISTING APIs public SendPacketsElement(byte[] buffer) public SendPacketsElement(byte[] buffer, int offset, int count) public SendPacketsElement(byte[] buffer, int offset, int count, bool endOfPacket) public SendPacketsElement(string filepath) public SendPacketsElement(string filepath, int offset, int count) public SendPacketsElement(string filepath, int offset, int count, bool endOfPacket) public byte[] Buffer { get; } public bool EndOfPacket { get; } public string FilePath { get; } // These properties will throw if constructed from a file with a long offsets. // NotSupportedException(""Count/Offset is larger than int.MaxValue. Use CountLong/OffsetLong instead.""); public int Count { get; } public int Offset { get; } // NEW APIs public long OffsetLong { get; } public long CountLong { get; } public SendPacketsElement(string filepath, long offset, long count); public SendPacketsElement(string filepath, long offset, long count, bool endOfPacket); // We only take the long ones as this as an advanced scenario and the int // ones don't buy you anything really. public SendPacketsElement(FileStream file); public SendPacketsElement(FileStream file, long offset, long count); public SendPacketsElement(FileStream file, long offset, long count, bool endOfPacket); public FileStream FileStream { get; } } ``` # Original proposal `SendPacketsElement`, `SendFile` and `BeginSendFile` currently take a `string` filename to indicate the file (or part thereof) to send. Under the hood, the implementation of these methods creates and manages `FileStream`s. I suggest that you add overloads that take `FileStream`. This makes it possible for applications to manage file handles directly - for example, to manage the lifetime of open handles, control how the file is accessed, shared and file options, buffer size. For example, turning off the file system cache on read is critical for performance for file servers. In addition, through the `FileStream` constructors it becomes possible to interop with file handles coming from unmanaged code and to use these with the socket API directly. Concretely: ```csharp public partial class Socket : System.IDisposable { // irrelevant methods omitted // existing send file API public IAsyncResult BeginSendFile(string fileName, AsyncCallback callback, object state) { throw null; } public IAsyncResult BeginSendFile(string fileName, byte[] preBuffer, byte[] postBuffer, TransmitFileOptions flags, AsyncCallback callback, object state) { throw null; } public void SendFile(string fileName) { } public void SendFile(string fileName, byte[] preBuffer, byte[] postBuffer, TransmitFileOptions flags){ } // suggested API additions public IAsyncResult BeginSendFile(FileStream file, AsyncCallback callback, object state) { throw null; } public IAsyncResult BeginSendFile(FileStream file, byte[] preBuffer, byte[] postBuffer, TransmitFileOptions flags, AsyncCallback callback, object state) { throw null; } public void SendFile(FileStream file) { } public void SendFile(FileStream file, byte[] preBuffer, byte[] postBuffer, TransmitFileOptions flags){ } } public partial class SendPacketsElement { // existing API - ctors public SendPacketsElement(byte[] buffer) { } public SendPacketsElement(byte[] buffer, int offset, int count) { } public SendPacketsElement(byte[] buffer, int offset, int count, bool endOfPacket) { } public SendPacketsElement(string filepath) { } public SendPacketsElement(string filepath, int offset, int count) { } public SendPacketsElement(string filepath, int offset, int count, bool endOfPacket) { } // suggested API - ctors public SendPacketsElement(FileStream file) { } public SendPacketsElement(FileStream file, int offset, int count) { } public SendPacketsElement(FileStream file, int offset, int count, bool endOfPacket) { } // existing API - properties public byte[] Buffer { get { throw null; } } public int Count { get { throw null; } } public bool EndOfPacket { get { throw null; } } public string FilePath { get { throw null; } } public int Offset { get { throw null; } } // suggested API - property public FileStream FileStream { get { throw null; } } } ``` As for the behavior of `SendPacketsElement.FilePath` vs `FileStream`, I suggest that depending on which constructor is used only one of them returns a non-null result. This is pretty much the behavior of the other properties (i.e. if a filepath ctor is used, `Buffer` returns null). " 25355 area-System.Collections Dictionary (etc) optimization suggestion, use readonly ref "Now that readonly ref (in) is being added to the language, Dictionary.Contains, TryGetValue etc. can all use ""in"" parameters as they only read from the input. This would improve dictionary lookups of keys which value-tuples since they would be passed by ref and not by value. Really this is relavent for any method that doesn't modify its parameters. This may be a clr/jit level optimization, since this can be identified by an analyser." 25357 area-Microsoft.CSharp Simplify some casting and conversion related code in Microsoft.CSharp * Remove `pDestinationTypeForLambdaErrorReporting` from conversions. Stored in a field and passed around, but never used for anything beside. * Don't use `ExprClass` in casts and `ExprTypeOf` Acts as a wrapper around the type, but provides nothing beyond that wrapper, so it is just unwrapped again. (Visiting an `ExprClass` is always a nop, so that's not a reason to wrap it). Use the `CType` directly instead. (`ExprClass` remains in use as the target of static calls). * Make visiting `ExprClass` explicitly just return it directly. This is what happens anyway, but since the previous change depends on this, making this clear makes that being correct clearer, as well as a minor efficiency gain. 25359 area-System.ComponentModel CategoryProperties_GetCategory_ReturnsExpected failed on netfx in CI "https://ci3.dot.net/job/dotnet_corefx/job/master/job/windows-TGroup_netfx+CGroup_Release+AGroup_x86+TestOuter_false_prtest/5395/consoleText ``` System.ComponentModel.Tests.CategoryAttributeTests.CategoryProperties_GetCategory_ReturnsExpected(attributeThunk: Func`1 { Method = System.ComponentModel.CategoryAttribute <DefaultProperties_TestData>b__8_4(), Target = <>c { } }, expectedCategory: ""Misc"") [FAIL] Assert.Equal() Failure (pos 0) Expected: Misc Actual: Default (pos 0) Stack Trace: at System.ComponentModel.Tests.CategoryAttributeTests.CategoryProperties_GetCategory_ReturnsExpected(Func`1 attributeThunk, String expectedCategory) ```" 25360 area-System.Net Negotiate Async tests - remove blocking "ref #25346 Found a bunch more in the Negotiate tests, this should be it doing a search for "".Wait"" on all files here. I cleaned up the unneeded ConfigureAwait and added a range to the SslTest as well." 25364 area-System.IO Test failure: System.IO.Tests.FileSystemWatcherTests_netstandard17/EndInit_ResumesPausedEnableRaisingEvents(setBeforeBeginInit: True) Opened on behalf of @Sunny-pu The test `System.IO.Tests.FileSystemWatcherTests_netstandard17/EndInit_ResumesPausedEnableRaisingEvents(setBeforeBeginInit: True)` has failed. Deleted event did not occur as expected\r Expected: True\r Actual: False Stack Trace: at System.IO.Tests.FileSystemWatcherTest.ExecuteAndVerifyEvents($FileSystemWatcher watcher, $WatcherChangeTypes expectedEvents, Action action, Boolean assertExpected, String[] expectedPaths, Int32 timeout) in E:\A\_work\398\s\corefx\src\System.IO.FileSystem.Watcher\tests\Utility\FileSystemWatcherTest.cs:line 244 at System.IO.Tests.FileSystemWatcherTest.ExpectEvent($FileSystemWatcher watcher, $WatcherChangeTypes expectedEvents, Action action, Action cleanup, String[] expectedPaths, Int32 attempts, Int32 timeout) in E:\A\_work\398\s\corefx\src\System.IO.FileSystem.Watcher\tests\Utility\FileSystemWatcherTest.cs:line 183 at System.IO.Tests.FileSystemWatcherTest.ExpectEvent($FileSystemWatcher watcher, $WatcherChangeTypes expectedEvents, Action action, Action cleanup) in E:\A\_work\398\s\corefx\src\System.IO.FileSystem.Watcher\tests\Utility\FileSystemWatcherTest.cs:line 132 at System.IO.Tests.FileSystemWatcherTests_netstandard17.EndInit_ResumesPausedEnableRaisingEvents(Boolean setBeforeBeginInit) in E:\A\_work\398\s\corefx\src\System.IO.FileSystem.Watcher\tests\FileSystemWatcher.cs:line 229 at _$ILCT$.$ILT$ReflectionDynamicInvoke$.InvokeRetVI<System.Boolean>(Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean targetIsThisCall) at System.InvokeUtils.CalliIntrinsics.Call(IntPtr dynamicInvokeHelperMethod, Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean isTargetThisCall) at System.InvokeUtils.CallDynamicInvokeMethod(Object thisPtr, IntPtr methodToCall, Object thisPtrDynamicInvokeMethod, IntPtr dynamicInvokeHelperMethod, IntPtr dynamicInvokeHelperGenericDictionary, Object targetMethodOrDelegate, Object[] parameters, BinderBundle binderBundle, Boolean wrapInTargetInvocationException, Boolean invokeMethodHelperIsThisCall, Boolean methodToCallIsThisCall) in CallDynamicInvokeMethod:line 16707566 Build : Master - 20171120.01 (UWP ILC Tests) Failing configurations: - Windows.10.Amd64.ClientRS3-x64 - Release 25367 area-System.Drawing FromHandle_BitmapHandleOneTime_Success failed in CI on Linux https://mc.dot.net/#/user/tmds/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/cfe7984c51ef3590fed2e50ddfb38619dda9f89d/workItem/System.Drawing.Common.Tests/analysis/xunit/System.Drawing.Tests.IconTests~2FFromHandle_BitmapHandleOneTime_Success ``` Unhandled Exception of Type System.ArgumentException Message : System.ArgumentException : handle Stack Trace : at System.Drawing.Icon.FromHandle(IntPtr handle) in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/src/System.Drawing.Common/src/System/Drawing/Icon.Unix.cs:line 335 at System.Drawing.Tests.IconTests.FromHandle_BitmapHandleOneTime_Success() in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/src/System.Drawing.Common/tests/IconTests.cs:line 688 ``` 25369 area-System.Net Cannot catch exception on SmtpClient.SendMailAsync when no server is listening See repo here https://github.com/MrAntix/cant-catch-exception I need to be able to catch an exception when the emailing fails for what ever reason 25370 area-System.Memory Added explicit conversion APIs for Span to ROSpan and Memory to ROMemory Added explicit conversion APIs to ```Span<T>``` and ```Memory<T>```: ```csharp public static ReadOnlyMemory<T> AsReadOnlyMemory(this Memory<T> memory); public static ReadOnlySpan<T> AsReadOnlySpan(this Span<T> span); ``` Resolves #24564 I'm not sure if tests required. 25371 area-System.Diagnostics PerformanceCounterCategory_CounterExists_InterruptsPerSec test failed in CI https://mc.dot.net/#/user/dotnet-maestro-bot/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/fee59555b693b03698e9f626932d3d224fde9306/workItem/System.Diagnostics.PerformanceCounter.Tests/analysis/xunit/System.Diagnostics.Tests.PerformanceCounterCategoryTests~2FPerformanceCounterCategory_CounterExists_InterruptsPerSec ``` Unhandled Exception of Type System.InvalidOperationException Message : System.InvalidOperationException : Cannot load Counter Name data because an invalid index '' was read from the registry. Stack Trace : at System.Diagnostics.PerformanceCounterLib.GetStringTable(Boolean isHelp) in D:\j\workspace\windows-TGrou---f8ac6754\src\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\PerformanceCounterLib.cs:line 1097 at System.Diagnostics.PerformanceCounterLib.get_NameTable() in D:\j\workspace\windows-TGrou---f8ac6754\src\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\PerformanceCounterLib.cs:line 235 at System.Diagnostics.PerformanceCounterLib.get_CategoryTable() in D:\j\workspace\windows-TGrou---f8ac6754\src\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\PerformanceCounterLib.cs:line 167 at System.Diagnostics.PerformanceCounterLib.CounterExists(String category, String counter, Boolean& categoryExists) in D:\j\workspace\windows-TGrou---f8ac6754\src\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\PerformanceCounterLib.cs:line 369 at System.Diagnostics.PerformanceCounterLib.CounterExists(String machine, String category, String counter) in D:\j\workspace\windows-TGrou---f8ac6754\src\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\PerformanceCounterLib.cs:line 341 at System.Diagnostics.PerformanceCounterCategory.CounterExists(String counterName) in D:\j\workspace\windows-TGrou---f8ac6754\src\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\PerformanceCounterCategory.cs:line 160 at System.Diagnostics.Tests.PerformanceCounterCategoryTests.PerformanceCounterCategory_CounterExists_InterruptsPerSec() in D:\j\workspace\windows-TGrou---f8ac6754\src\System.Diagnostics.PerformanceCounter\tests\PerformanceCounterCategoryTests.cs:line 174 ``` 25372 area-System.Runtime Add Decimal.TryFormat span-based method Separated out of https://github.com/dotnet/corefx/issues/22403 and https://github.com/dotnet/corefx/issues/22616 Add: ```C# public bool TryFormat(Span<char> destination, out int charsWritten, string format = null, IFormatProvider provider = null); ``` and use it in `StringBuilder.Append(decimal)`. 25373 area-System.Runtime Add Double/Single.TryFormat span-based methods Separated out of https://github.com/dotnet/corefx/issues/22403 and https://github.com/dotnet/corefx/issues/22616 Add: ```C# public bool TryFormat(Span<char> destination, out int charsWritten, string format = null, IFormatProvider provider = null); ``` and use it in `StringBuilder.Append(double)`. 25375 area-System.IO readdir and multi-threading readdir_r has been made obsolete in glibc, and using readdir is recommended instead. To accomodate, corefx falls back to readdir when readdir_r is not available (https://github.com/dotnet/corefx/pull/10795). The readdir implementation in glibc is thread-safe in that it allows multiple different DIRs (which may point to the same path) to be enumerated simultaneously. It does **NOT** allow a single DIR to be iterated by multiple threads. Is it expected from functions like `Directory.EnumerateFiles` to return an iterator that can be consumed simultaneously by multiple threads? 25376 area-Meta HttpBinding HttpClientCredentialType.Windows IIS10 - Core 2.0 "Trying to connect to SSRS Execution. Works fine on my development machine, soon as I move to IIS I get errors with the same exact remote SSRS server. Any tips tricks, most of the help from Google is the old way of doing it with XML file configurations. What really gets me is that it works from my development machine using IISExpress, why not on a TEST Server using IIS? AppPool No Managed Code The rest of the Core 2.0 MVC application works perfectly. Why would it work remote on my machine via VPN then throw error like that on TEST server which is on same network? I really think this has something to do with IIS. ``` basicHttpBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows; var serviceSoapClient = new ReportExecutionServiceSoapClient(basicHttpBinding, new EndpointAddress($""{model.ReportServerUrl}/ReportExecution2005.asmx"")); serviceSoapClient.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation; serviceSoapClient.ClientCredentials.Windows.ClientCredential = (NetworkCredential)(new NetworkCredential() { UserName = model.Username, Password = model.Password, Domain = model.Domain }); ``` Error: System.AggregateException: One or more errors occurred. (The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was ''.) ---> System.ServiceModel.Security.MessageSecurityException: The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was ''. https://github.com/aspnet/Hosting/issues/1276" 25378 area-Infrastructure Manually run CoreFX netstandard tests against Mono Get an idea of the pass rate and any complications in doing this. 25379 area-Infrastructure Plan for running netstandard test bed against Mono We assume that Mono would consume our tests out of their CoreFX submodule. What technical changes are needed on CoreFX side to make the tests run? What work is needed on the Mono side? 25380 area-Meta Investigate and categorize Linux/Windows performance discrepancies Most of our performance benchmarking has been against Windows, except for the key public benchmarks like Techempower and CLBG. Our xunit `[Benchmark]` tests are run on Linux and Windows, and there are some areas where Linux does not match Windows performance on the same hardware. Investigate, categorize and triage. 25381 area-Meta Update man pages documentation for Linux developers The `man` pages installed by .NET Core have outdated content eg relating to project.json and commands that no longer exist. Clean this up and make it more useful: `man` pages are where Unix users start. 25382 area-Infrastructure Only run Debug corefx official builds and tests runs weekly We don't need to do official builds for both release and debug multiple times daily. Our general official builds should be defaulted to Release but we should enable a weekly Debug build for extra test validation. @danmosemsft any preference on which day of the week so you can pay extra attention to the test results? 25383 area-Meta Outreach to Nuget package owners with potentially compatible assets Reach out to the owners of popular packages that do not declare compatibility with with .NET Standard 2.0 (or at least .NET Core 2.0) although their desktop assets are in fact API compatible. Ask and help the owners to add packaging and test for .NET Standard/.NET Core so that the packages can be consumed more confidently from VS, without a warning. Also, reach out to the owners of packages that do have compatible assets but the assets seem to have cut down functionality because they were targeting the limited pre 2.0 surface area. These too can be repackaged. Use our Nuget data lake and API scanners to prioritize and track this work. 25385 area-Infrastructure Relationship with Mono.Posix We don't want to replicate Mono.Posix, which has had time to stabilize. The [version that supports .NET Core ](https://www.nuget.org/packages/Mono.Posix.NETStandard/) has not been heavily downloaded. Is it sufficient? Or just poorly known? Does it need contributions or extension? Also, if we want code in CoreFX to depend on it, we need to figure out how to do that technically. 25386 area-Meta Use hardware intrinsics Intel and others are adding support for general use of hardware intrinsics (as opposed to code explicitly recognized by code gen which is the approach of Vector). As these come on line, use them where they help: eg string searching, regex, CRC, ... 25387 area-System.IO Improve GetFiles performance (Windows) @JeremyKuhne has identified possibilities for substantial performance improvement. Some of this is already complete. 25388 area-System.Numerics Add ref/in/out overloads of methods for Vectors and Matrices "Adding overloads to Vector and Matrix types for better memory and performance characteristics. Fixes #157 ## Notes 1. ~The EOF newline changes came from merging these old commits into the master branch. I wanted to preserve the commit history, so I didn't try fixing up these newline changes.~ FIXED 2. I wasn't excited about all the `#if FEATURE_REF_OVERLOADS` in the tests. But I didn't see a great way to factor them without the `#if`s. I felt keeping the tests contained together was a high priority, that way the ""expected"" values were only in a single place. I'm open to better ideas here." 25390 area-Microsoft.CSharp MS.CSharp Refactoring of producing lambda for dynamic operation and rewriting it "* Tighten type of parents in symbol factory methods to those valid. Makes the correctness of what follows clearer. * Remove parent parameter to `SymFactory.CreateScope()` Always null; we only ever work with one `Scope`. Let's make that explicit * Remove `RewriteLambdaParameters` Pulls locals that are sibling to scope into lambda expression (for hoisting) but there is never a sibling to any scope in the dynamic binder. * Remove `ExpressionTreeRewriter.DestroyWraps` Unwraps hoisted locals that are siblings to the scope, but we never have any. * Remove `ExpressionTreeRewriter.currentAnonMeth` We only ever have one bound lambda at a time; never another nested within that, so this check is unnecessary. * Remove check `createParameters != null` Always true. Indeed `ExpressionTreeCallRewriter.Rewrite` depends on this as it expects an `ExprBinOp`, and if this path wasn't taken we'd return an `ExprCall` instead. * Take `VisitBOUNDLAMBDA` out of the main visiting loop. Can only be reached from the top of an `ExpressionTreeRewriter` visit, so only call it from there, tightening parameter types. * Tighten `VisitBoundLambda` to return `ExprBinOp` Pass this tightened type definition through to `ExpressionTreeCallRewriter.Rewrite`, making one asserted fact there statically known. * Remove `ExpressionKind.SequenceReverse` No such expression is ever created. * Create predefined type for `Func<>` Since we're using it with every dynamic operation, it should be in the faster lookup. * Tighten `ExprBoundLambda` ctor parameter types and assertions. * Place lambda's return expression directly inside `ExprBoundLambda` Since the expression is always a single block with a single return that returns a single expression, just store that single expression. Essentially this changes the restrictions from what one can do in C# in defining an anonymous delegate to what one can do in C# in defining an expresson with `=>` syntax. This matches what we are actually using the object for better, and removes two levels of indirection through other objects, with the possibility of errors in them. * Remove `ExprBlock`, `ExprReturn` & `ExprStatement` No longer used. Remove commented-out `ExpressionKind`s along with those removed here. * Don't add ""`this`"" local to scope. Never given meaning, only ever deliberately avoided in rewrites. When a dynamic operation uses `this`, it does so by having `this` passed-in explicitly. * Remove `LocalVariableSymbol.fUsedInAnonMeth` Never not set to true, so no real significance. * Pass deferred binding to out parameter directly. We'll always get the correct final result there, so don't replicate logic we just called into. * Remove path in `ExpressionTreeRewriter.VisitLOCAL` for null `wrap`. Since the only locals have just had this set to non-null, this is unreachable. Since the code removed here is the only use of `ExprHoistedLocalExpr`, remove it too." 25392 area-System.Net Mark System.Net.WebSockets.Client 4.0.2 package stable cc @safern @davidsh 25393 area-System.Runtime Support for Base32 encoding Currently there is no official support in .NET for Base32 encoding, unlike Base64 encoding. There is also no nuget package with this functionality that's widely used: https://www.nuget.org/packages?q=base32 Have you considered adding this to .NET? What's the recommendation for developers that need this? 25394 area-System.Net Mark System.Net.WebSockets.Client 4.3.2 package stable cc @safern @davidsh 25396 area-System.Runtime There's no way to get the managed object size in memory "# Public API to detect the size of the managed object. As mentioned [in this article](https://blogs.msdn.microsoft.com/cbrumme/2003/04/15/size-of-a-managed-object/), we don't have such API to get the size in the runtime. So far, if we want to do so, we have a choice to use some tools or techniques (not at the runtime), such as: - using dotMemory. - using WinDBG and calculate the object fields one by one. - measuring the GC before and after ccreating the objects. On of the very good example of that need, in the case we build customized cache and we want to keep the maximum size limit under control. The developers around the world [still asking](www.google.com/search?q=.net+Size+of+a+managed+object) and requesting such API. # How we can implement such thing The good news that we already have this mechanism already implemented internally by SizedReference Type. ``` internal class SizedReference : IDisposable { //some code here public SizedReference(Object target) { ... } public Object Target { get {...} } public Int64 ApproximateSize { get { ... } } public void Dispose() {} } ``` What we gonna do is just to expose it as Public API # Proposed API I suggest to add some class under System.Runtime to as a wrapper to SizedReference or just as extension to the object. ``` /// <summary> /// Get the approximate size allocated for this object in the memory in bytes /// </summary> /// <param name=""obj"">the object that you want to know its size</param> /// <returns>size in bytes</returns> public static long GetSize(this object obj) { //using SizedReference Type to get the approximate size } ``` --- --- @alden-menzalgy commented on [Sun Nov 05 2017](https://github.com/dotnet/standard/issues/573) Hi, There is no way to get the actual (or even an approximate) size of the cached object in the memory. The case is, we have +100 customized cache for different purposes to accelerate our platform, for each cache we have - Cache MaxSize - Cache ConsumedSize - Cache RemainingSize Whenever we insert some object to be cached, we should detect its size to re-calculate aforementioned cache properties. I know that's a complex issue and depends on many factors, so far we have some workarounds but non of them is official and we afraid to be changed in any minor or major release. Should you add any API to get the object size in the memory ? or at least Type size and then we can add the object-specific data length. Related Topics [Workaround 1](https://stackoverflow.com/questions/1128315/find-size-of-object-instance-in-bytes-in-c-sharp) [What Microsoft says about this issue](https://blogs.msdn.microsoft.com/cbrumme/2003/04/15/size-of-a-managed-object/) --- @JanEggers commented on [Sat Nov 11 2017](https://github.com/dotnet/standard/issues/573#issuecomment-343669631) you can use structs for your cache items and Marshal.Sizeof --- @alden-menzalgy commented on [Mon Nov 13 2017](https://github.com/dotnet/standard/issues/573#issuecomment-343930349) It requires changing the structure that we've built the application with. It may consider a workaround but not permanent solution " 25397 area-Infrastructure Configure build definitions but only run Release builds by default cc @MattGal 25399 area-System.Net System.Net.Http Removing unneeded blocking from tests Removed anywhere that had an WaitAll ref #25346 25400 area-System.Diagnostics Category does not exist. errors in PerformanceCounter tests https://mc.dot.net/#/user/Drawaes/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/ab1336f6c46534d55ac9b1fce42111c05ca65f94/workItem/System.Diagnostics.PerformanceCounter.Tests/wilogs ``` 2017-11-20 16:11:23,493: INFO: proc(54): run_and_log_output: Output: Discovering: System.Diagnostics.PerformanceCounter.Tests 2017-11-20 16:11:23,697: INFO: proc(54): run_and_log_output: Output: Discovered: System.Diagnostics.PerformanceCounter.Tests 2017-11-20 16:11:23,775: INFO: proc(54): run_and_log_output: Output: Starting: System.Diagnostics.PerformanceCounter.Tests 2017-11-20 16:11:25,900: INFO: proc(54): run_and_log_output: Output: System.Diagnostics.Tests.PerformanceCounterCategoryTests.PerformanceCounterCategory_GetCounters [FAIL] 2017-11-20 16:11:25,900: INFO: proc(54): run_and_log_output: Output: System.InvalidOperationException : Could not Read Category Index: 10170. 2017-11-20 16:11:25,900: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2017-11-20 16:11:26,009: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---f8ac6754\src\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\PerformanceCounterLib.cs(1424,0): at System.Diagnostics.CategorySample..ctor(Byte[] data, CategoryEntry entry, PerformanceCounterLib library) 2017-11-20 16:11:26,009: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---f8ac6754\src\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\PerformanceCounterLib.cs(822,0): at System.Diagnostics.PerformanceCounterLib.GetCategorySample(String category) 2017-11-20 16:11:26,009: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---f8ac6754\src\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\PerformanceCounterLib.cs(791,0): at System.Diagnostics.PerformanceCounterLib.GetCategorySample(String machine, String category) 2017-11-20 16:11:26,009: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---f8ac6754\src\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\PerformanceCounterCategory.cs(443,0): at System.Diagnostics.PerformanceCounterCategory.GetCounterInstances(String categoryName, String machineName) 2017-11-20 16:11:26,009: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---f8ac6754\src\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\PerformanceCounterCategory.cs(517,0): at System.Diagnostics.PerformanceCounterCategory.GetInstanceNames() 2017-11-20 16:11:26,009: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---f8ac6754\src\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\PerformanceCounterCategory.cs(460,0): at System.Diagnostics.PerformanceCounterCategory.GetCounters() 2017-11-20 16:11:26,009: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---f8ac6754\src\System.Diagnostics.PerformanceCounter\tests\PerformanceCounterCategoryTests.cs(234,0): at System.Diagnostics.Tests.PerformanceCounterCategoryTests.PerformanceCounterCategory_GetCounters() 2017-11-20 16:11:28,973: INFO: proc(54): run_and_log_output: Output: System.Diagnostics.Tests.PerformanceCounterTests.PerformanceCounter_BeginInitEndInit_ProcessorCounter [FAIL] 2017-11-20 16:11:28,973: INFO: proc(54): run_and_log_output: Output: System.InvalidOperationException : Category does not exist. 2017-11-20 16:11:28,973: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2017-11-20 16:11:28,973: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---f8ac6754\src\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\PerformanceCounterLib.cs(360,0): at System.Diagnostics.PerformanceCounterLib.CounterExists(String machine, String category, String counter) 2017-11-20 16:11:28,973: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---f8ac6754\src\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\PerformanceCounter.cs(478,0): at System.Diagnostics.PerformanceCounter.InitializeImpl() 2017-11-20 16:11:28,973: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---f8ac6754\src\System.Diagnostics.PerformanceCounter\tests\PerformanceCounterTests.cs(177,0): at System.Diagnostics.Tests.PerformanceCounterTests.PerformanceCounter_BeginInitEndInit_ProcessorCounter() 2017-11-20 16:11:28,973: INFO: proc(54): run_and_log_output: Output: System.Diagnostics.Tests.PerformanceCounterCategoryTests.PerformanceCounterCategory_CounterExists_StaticInterruptsPerSec [FAIL] 2017-11-20 16:11:28,973: INFO: proc(54): run_and_log_output: Output: System.InvalidOperationException : Category does not exist. 2017-11-20 16:11:28,973: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2017-11-20 16:11:28,973: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---f8ac6754\src\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\PerformanceCounterLib.cs(360,0): at System.Diagnostics.PerformanceCounterLib.CounterExists(String machine, String category, String counter) 2017-11-20 16:11:28,973: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---f8ac6754\src\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\PerformanceCounterCategory.cs(188,0): at System.Diagnostics.PerformanceCounterCategory.CounterExists(String counterName, String categoryName, String machineName) 2017-11-20 16:11:28,973: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---f8ac6754\src\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\PerformanceCounterCategory.cs(168,0): at System.Diagnostics.PerformanceCounterCategory.CounterExists(String counterName, String categoryName) 2017-11-20 16:11:28,973: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---f8ac6754\src\System.Diagnostics.PerformanceCounter\tests\PerformanceCounterCategoryTests.cs(191,0): at System.Diagnostics.Tests.PerformanceCounterCategoryTests.PerformanceCounterCategory_CounterExists_StaticInterruptsPerSec() ``` 25402 area-System.Net Several improvements to Sockets "Two main changes: - Fully enable `Memory<byte>` with SocketAsyncEventArgs. When adding the `Memory<byte>`-based APIs, we only did so at a cursory level; the implementation was still array-based, and we'd just fish out the array from the `Memory<byte>`, which meant it wouldn't work if the `Memory<byte>` wrapped a native pointer. This fixes that. SocketAsyncEventArgs now relies on `Memory<byte>` internally, as well as on Windows relying on its `Retain` method instead of using `GCHandle` directly, which means `OwnedMemory<T>` implementations can do pre-pinning and then make Retain a nop to avoid some overheads. The change also makes it so we don't pin buffers handed to us for longer than a given operation, but we also avoid calling Retain for common operations until we know we're going async. - Cache AsyncOperation instances on Unix on the SocketAsyncContext. Currently when an operation completes asynchronously on Unix, we allocate an AsyncOperation-derived instance to store the state for that operation. For several of the most common operations, this change caches a AsyncOperation instance for each common type, and reuses that instance if it's available, avoiding most of the allocation associated with async completion on Unix (there's still currently the cost of the queued work item for callback handling). Some additional cleanup is included as well, in particular eliminating the ""InnerStart"" pattern that was introduced when the PAL was added in. This pattern made it more difficult to find where state was being created and stored, and was largely unnecessary. By unraveling it, it also made it possible to remove more fields from SocketAsyncEventArgs. This PR shrinks the size of SAEA by 10% on Windows. Fixes https://github.com/dotnet/corefx/issues/24429 cc: @geoffkizer " 25403 area-System.Diagnostics PerformanceCounterLib is not fully thread safe PerformanceCounterLib instances are stored in a static table such that there's a single instance for a machine/LCID combination. As such there is an expectation that operations are thread safe (since to the caller they appear to be static operations) The code attempts to achieve this but it appears to have holes, eg _customCategoryTable, a HashTable, is modified [here ](https://github.com/dotnet/corefx/blob/master/src/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterLib.cs#L706 )without protection against concurrent write at this same location (or in other places). Make a pss through PerformanceCounterLib to make it thread safe through its static members. https://github.com/dotnet/corefx/pull/25401 25405 area-System.Linq Test failure: System.Linq.Expressions.Tests.LambdaTests/AboveByteMaxArityArg(useInterpreter: True) Opened on behalf of @Sunny-pu The test `System.Linq.Expressions.Tests.LambdaTests/AboveByteMaxArityArg(useInterpreter: True)` has failed. System.PlatformNotSupportedException : Operation is not supported on this platform. Stack Trace: at System.Linq.Expressions.Compiler.DelegateHelpers.MakeNewDelegate(Type[] types) in E:\A\_work\903\s\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\DelegateHelpers.Generated.cs:line 170 at System.Linq.Expressions.Compiler.DelegateHelpers.MakeDelegateType(Type[] types) in E:\A\_work\903\s\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\DelegateHelpers.Generated.cs:line 34 at System.Linq.Expressions.Expression.Lambda($Expression body, String name, Boolean tailCall, IEnumerable$1<$ParameterExpression> parameters) in E:\A\_work\903\s\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\LambdaExpression.cs:line 846 at System.Linq.Expressions.Tests.LambdaTests.AboveByteMaxArityArg(Boolean useInterpreter) in E:\A\_work\903\s\corefx\src\System.Linq.Expressions\tests\Lambda\LambdaTests.cs:line 787 at _$ILCT$.$ILT$ReflectionDynamicInvoke$.InvokeRetVI<System.Boolean>(Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean targetIsThisCall) at System.InvokeUtils.CalliIntrinsics.Call(IntPtr dynamicInvokeHelperMethod, Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean isTargetThisCall) at System.InvokeUtils.CallDynamicInvokeMethod(Object thisPtr, IntPtr methodToCall, Object thisPtrDynamicInvokeMethod, IntPtr dynamicInvokeHelperMethod, IntPtr dynamicInvokeHelperGenericDictionary, Object targetMethodOrDelegate, Object[] parameters, BinderBundle binderBundle, Boolean wrapInTargetInvocationException, Boolean invokeMethodHelperIsThisCall, Boolean methodToCallIsThisCall) in CallDynamicInvokeMethod:line 16707566 Build : Master - 20171121.03 (UWP ILC Tests) Failing configurations: - Windows.10.Amd64.ClientRS3-x64 - Debug - Release - Windows.10.Amd64.ClientRS3-x86 - Debug - Release 25407 area-System.IO Eliminate dirent memcpy when using readdir. @stephentoub this eliminates the memcpy for the readdir case as suggested in https://github.com/dotnet/corefx/issues/25375. I have included a check to throw on concurrent readdir. I can remove that if it is not desired. 25408 area-System.Net Could DecompressionHandler be made public? I'm in a situation where I'm reading an HTTP response with a Content-Encoding of gzip. I need the output of an `HttpClient` to be the decompressed data, but I need to intercept the compressed data in order to hash it. I can do this by creating an `HttpMessageHandler` in three layers: - `HttpClientHandler` with decompression disabled - A custom handler which creates a content stream to intercept the data as it's being read - A [DecompressionHandler](https://github.com/dotnet/corefx/blob/master/src/System.Net.Http/src/System/Net/Http/Managed/DecompressionHandler.cs) to perform the decompression Unfortunately, `DecompressionHandler` is internal. I can potentially fork it, but a) it uses internal methods which would need working round; b) I'd really rather not have the duplication. Would it be possible for this to be made public? (If there's a better way to do this, I'm all ears - there's a [Stack Overflow question](https://stackoverflow.com/questions/47324282) with a few more details.) 25409 area-System.Data Test failure: System.Data.Tests.AppDomainsAndFormatInfo.Bug55978 The test `System.Data.Tests.AppDomainsAndFormatInfo.Bug55978` has failed. ``` Stack trace: System.Data.EvaluateException : Cannot perform '>=' operation on System.DateTime and System.String. at System.Data.BinaryNode.SetTypeMismatchError(Int32 op, Type left, Type right) in D:\git\dotnetfix\corefx\src\System.Data.Common\src\System\Data\Filter\BinaryNode.cs:line 135 at System.Data.BinaryNode.BinaryCompare(Object vLeft, Object vRight, StorageType resultType, Int32 op, CompareInfo comparer) in D:\git\dotnetfix\corefx\src\System.Data.Common\src\System\Data\Filter\BinaryNode.cs:line 267 at System.Data.BinaryNode.BinaryCompare(Object vLeft, Object vRight, StorageType resultType, Int32 op) in D:\git\dotnetfix\corefx\src\System.Data.Common\src\System\Data\Filter\BinaryNode.cs:line 152 at System.Data.BinaryNode.EvalBinaryOp(Int32 op, ExpressionNode left, ExpressionNode right, DataRow row, DataRowVersion version, Int32[] recordNos) in D:\git\dotnetfix\corefx\src\System.Data.Common\src\System\Data\Filter\BinaryNode.cs:line 871 at System.Data.BinaryNode.Eval(DataRow row, DataRowVersion version) in D:\git\dotnetfix\corefx\src\System.Data.Common\src\System\Data\Filter\BinaryNode.cs:line 41 at System.Data.BinaryNode.Eval(ExpressionNode expr, DataRow row, DataRowVersion version, Int32[] recordNos) in D:\git\dotnetfix\corefx\src\System.Data.Common\src\System\Data\Filter\BinaryNode.cs:line 142 at System.Data.BinaryNode.EvalBinaryOp(Int32 op, ExpressionNode left, ExpressionNode right, DataRow row, DataRowVersion version, Int32[] recordNos) in D:\git\dotnetfix\corefx\src\System.Data.Common\src\System\Data\Filter\BinaryNode.cs:line 908 at System.Data.BinaryNode.Eval(DataRow row, DataRowVersion version) in D:\git\dotnetfix\corefx\src\System.Data.Common\src\System\Data\Filter\BinaryNode.cs:line 41 at System.Data.DataExpression.Invoke(DataRow row, DataRowVersion version) in D:\git\dotnetfix\corefx\src\System.Data.Common\src\System\Data\Filter\DataExpression.cs:line 195 at System.Data.Index.AcceptRecord(Int32 record, IFilter filter) in D:\git\dotnetfix\corefx\src\System.Data.Common\src\System\Data\Selection.cs:line 217 at System.Data.Index.InitRecords(IFilter filter) in D:\git\dotnetfix\corefx\src\System.Data.Common\src\System\Data\Selection.cs:line 745 at System.Data.Index..ctor(DataTable table, IndexField[] indexFields, Comparison`1 comparison, DataViewRowState recordStates, IFilter rowFilter) in D:\git\dotnetfix\corefx\src\System.Data.Common\src\System\Data\Selection.cs:line 138 at System.Data.Index..ctor(DataTable table, IndexField[] indexFields, DataViewRowState recordStates, IFilter rowFilter) in D:\git\dotnetfix\corefx\src\System.Data.Common\src\System\Data\Selection.cs:line 89 at System.Data.DataTable.GetIndex(IndexField[] indexDesc, DataViewRowState recordStates, IFilter rowFilter) in D:\git\dotnetfix\corefx\src\System.Data.Common\src\System\Data\DataTable.cs:line 3184 at System.Data.DataTable.GetIndex(String sort, DataViewRowState recordStates, IFilter rowFilter) in D:\git\dotnetfix\corefx\src\System.Data.Common\src\System\Data\DataTable.cs:line 3161 at System.Data.DataView.UpdateIndex(Boolean force, Boolean fireEvent) in D:\git\dotnetfix\corefx\src\System.Data.Common\src\System\Data\DataView.cs:line 1557 at System.Data.DataView.UpdateIndex(Boolean force) in D:\git\dotnetfix\corefx\src\System.Data.Common\src\System\Data\DataView.cs:line 1531 at System.Data.DataView.SetIndex2(String newSort, DataViewRowState newRowStates, IFilter newRowFilter, Boolean fireEvent) in D:\git\dotnetfix\corefx\src\System.Data.Common\src\System\Data\DataView.cs:line 1508 at System.Data.DataView.SetIndex(String newSort, DataViewRowState newRowStates, IFilter newRowFilter) in D:\git\dotnetfix\corefx\src\System.Data.Common\src\System\Data\DataView.cs:line 1486 at System.Data.DataView.set_RowFilter(String value) in D:\git\dotnetfix\corefx\src\System.Data.Common\src\System\Data\DataView.cs:line 301 at System.Data.Tests.AppDomainsAndFormatInfo.Bug55978() in D:\git\dotnetfix\corefx\src\System.Data.Common\tests\System\Data\DataTableTest.cs:line 4043 ``` - Config: netcoreapp-Windows_NT-Debug-x64 - OS: Microsoft Windows [Version 6.1.7601] 25410 area-System.Data Implementation of DbProviderFactories. "This PR implements API reviewed here: #20903 ""Additional API for DbProviderFactories in .NET Core"". Fixes #4571 Design decisions: - `GetFactory(DataRow)` follows the same behavior as on NetFX: it will return the factory which type is present in the DataRow present. This can lead to undefined behavior when a different factory is registered in the DbProviderFactories for a given invariant name than the one specified in the DataRow. As this is a catch-22 situation with no true answer, the decision for now was made to make it behave the same as on NetFX - `RegisterFactory(string providerInvariantName, string factoryTypeAssemblyQualifiedName)` registers the type name but doesn't check the type as that would require the load of the assembly and this method is meant to be used to pre-register factories which might not be present on the system (yet) (e.g. by an ORM). The type registration is deferred till the factory is requested through a `GetFactory` method. This might cause a false sense of correctness: the type registered might not be valid. This is a situation following from the nature of the method. - `TryGetFactory(string providerInvariantName, out DbProviderFactory factory)` will still throw an exception when the factory type associated with the providerInvariantName was registered with `RegisterFactory(string, string)` and the type is invalid, as the type checking was deferred when the registration took place. In the API review thread it was undecided what to do, so I decided to stick with the exception in this case: the alternative, swallow the exception and returning false could suggest the registration earlier was successful, or that the factory isn't there/not registered, which isn't the case: a factory is registered, the type specified just couldn't be loaded. - Internal implementation is using a ConcurrentDictionary instead of a DataTable, which is used in NetFx. This is done to avoid locks as the `IEnumerable<string> GetProviderInvariantNames()` method would lead to upscaling a ReaderWriterLockSlim lock to write level in the case of an internal Datatable - The method `DataTable GetFactoryClasses()` builds the datatable every time. Initially I had a cached version to avoid re-allocating columns again, but maintaining that construct was rather tedious and this method isn't expected to be on a hot path at all (it's likely called once in an application's life) so I've chosen for a lock-free rebuild of the datatable every time. NetFx creates a copy of the internal table, for comparison. - The method `IEnumerable<string> GetProviderInvariantNames()` returns a `List<T>` as that was the most simplest of implementations. If an array is preferred I could change that. As the internal structure is a concurrentdictionary and to keep things threadsafe, yield-ing over the keys set of the concurrent dictionary didn't feel correct, but please correct me if this should be updated. :) // cc @karelz @divega @terrajobst " 25411 area-System.ComponentModel Packaging System.ComponentModel.Composition Fixes #11857 25412 area-System.Memory Move (ReadOnly)Span.DangerousGetPinnableReference to MemoryMarshal Separated from https://github.com/dotnet/corefx/issues/23879#issuecomment-341482899 We should also rename it as part of the move. Pinnable does not make sense if it is not going to be used for pinning. And Dangerous can be omitted too because of methods under `System.Runtime.InteropServices` are dangerous by convention. So what about: ```c# namespace System.Runtime.InteropServices { public static class MemoryMarshal { public static readonly ref T GetReference<T>(in ReadOnlySpan<T> span); public static ref T GetReference<T>(in Span<T> span); } } ``` 25413 area-System.Memory Add implicit cast from string to ReadOnlySpan<char> Proposal: ```C# public class String { public static implicit operator ReadOnlySpan<char>(string value) => value != null ? new ReadOnlySpan<char>(ref value.GetRawStringData(), value.Length) : default; ... } ``` 25414 area-System.Diagnostics Make ExcludeFromCodeCoverageAttribute applicable to assemblies. Closes #24694 25415 area-Infrastructure Alpine3.6-x64: Segmentation fault on publish attempt @dotnet-mc-bot commented on [Tue Nov 21 2017](https://github.com/dotnet/core-eng/issues/2149) Opened on behalf of @jcagme Warnings: 0 Status Message: failed Build : Master - 20171121.04 (Product Build) Failing configurations: - Alpine3.6 - Debug-x64 [Mission Control Build Info](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/build~2Fproduct~2F/build/20171121.04/workItem/Orchestration/analysis/external/Visual%20Studio%20Build%20Information) 25416 area-System.Memory Added SpanExtensions.EndsWith Added Span extensions methods ```csharp public static bool EndsWith<T>(this Span<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>; public static bool EndsWith<T>(this ReadOnlySpan<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>; ``` Resolves #24840 25417 area-System.Runtime Expose and test Decimal.TryParse Depends on https://github.com/dotnet/coreclr/pull/15145 Depends on https://github.com/dotnet/corert/pull/4980 Fixes https://github.com/dotnet/corefx/issues/25372 cc: @jkotas 25424 area-System.Memory Optimize Utf-8 Integer Formatter for the default case Using the 'D' Standard Format has too much overhead due to precision checks. Also, instead of calculating the digit count first and then writing the digits (which results in `O(2n)` operations, where n is the length of the number), write the digits in reverse order and then reverse the digits in place (which results in `O(n + n/2)` operations).  cc @AtsushiKan, @KrzysztofCwalina, @jkotas 25425 area-System.Memory Try to reduce overhead of abstraction in Utf-8 integer formatter APIs Currently, the overhead to calling the Utf-8 integer formatter APIs is high for the simple/default case. **Any ideas on what we can do to reduce this overhead caused by the abstraction layer and the desire to reduce code duplication?** Let's say we just want to write an integer starting from the end of the provided buffer (instead of the front), and we provide a StandardFormat 'R' to support that (see scenario in [SignalR](https://github.com/aspnet/SignalR/pull/1128) here: https://github.com/aspnet/SignalR/pull/1128/files#diff-d04b54105a83f4a2e21723409df7b9b1R37). The function calls look like this: TryFormat(int value, ..., 'R') => TryFormatInt64(value, 0xffffffff, buffer, out bytesWritten, format) => if check + switch statement => TryFormatInt64R https://github.com/dotnet/corefx/blob/master/src/System.Memory/src/System/Buffers/Text/Utf8Formatter/Utf8Formatter.Integer.Signed.cs#L18 Even if TryFormatInt64R is essentially a no-op, the overhead is higher than implementing your own (relatively naiive) method and calling it directly. ```C# private static bool TryFormatInt64R(long value, Span<byte> buffer, out int bytesWritten) { bytesWritten = 0; return false; } ``` ```C# // Note: Not tested, just an example public static bool MyReverseFormat(uint value, Span<byte> buffer, out int bytesWritten) { int digits = 0; bytesWritten = 0; do { int index = buffer.Length - 1 - digits; if (index < 0) { buffer.Clear(); return false; } buffer[index] = (byte)('0' + value % 10); value /= 10; digits++; } while (value > 0); bytesWritten = digits; return true; } ``` **Overhead of calling no-op TryFormat:**  **We never overcome the overhead, even though the per loop iteration performance of our algorithm is better:**   Related PR: https://github.com/dotnet/corefx/pull/25424 cc @KrzysztofCwalina, @AtsushiKan, @jkotas 25426 area-System.IO Fast file enumeration for Windows Implements an optimized, low allocation replacement for file enumeration on Windows. In preliminary tests this improves performance at least two fold, particularly for recursive searches. Removes agressive filter validation. Copies and cleans up filename matching code from FileSystemWatcher. Other notes: - Attempting to build the DosMatcher for Unix as well - Specific unit tests for DosMatcher forthcoming- existing tests cover it pretty well, however - Intent is to take the internal model and make it public and cross platform to allow custom filtering and transforms for enumeration - Also investigating exposing options for error and link handling - Intent is to make the Span combine code public as well (likely as part of Path) - Need to follow up on conversion of NTSTATUS errors- might have to do a fallback to GetFileInformationFromHandleEx if the conversion API isn't actually available on OneCore - Win7 doesn't have the right options for GetFileInformationFromHandleEx and WinRT can't use the NT API 25427 area-System.IO Add PipeOptions.CurrentUserOnly option Systems that use named pipes often want to try to lock down access, validating that only the user that created the server is able to connect to it, and similarly validating that the client is connecting to a server it expects. On Windows this can be done with a complicated dance involving ACLs. On Unix where our PipeStream is built on top of domain sockets, it can be done with a complicated dance involving creating a directory that's permissioned just to the user, creating the domain socket on a path in there, etc. As we've seen several systems want to do this, including for example Roslyn with its compiler server, we should expose an option and handle the difficulties of this in one place so that customers of NamedPipeServer/ClientStream don't need to reinvent the wheel each time. Proposal: ```C# namespace System.IO.Pipes { [Flags] public enum PipeOptions // existing type { ... CurrentUserOnly = unchecked((int)0x20000000) // new value proposed } } ``` (Note that today the implementation on Windows just passes PipeOptions in by value to CreateNamedPipe. We would strip off this new value if it was set before doing so, but for extra good measure we should also choose a value that's not currently accepted by CreateNamedPipe.) [edit by @danmosemsft: this flag will cause a check that the pipe is owned by the same user with the same elevation level ] 25428 area-System.IO Remove trimming and validation for file find filter strings "The complexity here has to do with limited trust scenarios. We shouldn't trim or care about "".."". #25426 handles this for Windows. Working on Unix." 25429 area-System.Net Test failure: System.Net.Sockets.Tests.ConnectApm/Connect_Success(listenAt: 127.0.0.1) Opened on behalf of @Sunny-pu The test `System.Net.Sockets.Tests.ConnectApm/Connect_Success(listenAt: 127.0.0.1)` has failed. System.TimeoutException : WhenAllOrAnyFailed timed out after 10000 Stack Trace: at System.Threading.Tasks.TaskTimeoutExtensions.<WhenAllOrAnyFailed>d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Net.Sockets.Tests.Connect`1.<Connect_Success>d__0.MoveNext() in E:\A\_work\1035\s\corefx\src\System.Net.Sockets\tests\FunctionalTests\Connect.cs:line 23 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- Build : Master - 20171122.01 (Core Tests) Failing configurations: - Windows.7.Amd64-x64 - Release https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171122.01/workItem/System.Net.Sockets.Tests 25431 area-System.Runtime Fix SSE2 and SSE4.1 APIs Reflect mscorlib change https://github.com/dotnet/coreclr/pull/15160 25432 area-System.Net SslApplicationProtocols.ToString() shouldn't allocate for known protocols For http/1.1 and h2 it shouldn't allocate a new string https://github.com/dotnet/corefx/blob/1d95739cf905df31685fed2451aedeec95880ade/src/System.Net.Security/src/System/Net/Security/SslApplicationProtocol.cs#L97. Those 2 should be hardcoded to return constants. /cc @Priya91 @stephentoub @karelz 25434 area-System.Data SqlBulkCopy.WriteToServer fails with null reference exception when using a named column mapping and IDataReader not implemented via DbDataReader "How to reproduce: 1) implment IDataReader *without inherting from DbDataReader* 2) Create a SqlBulkCopy object having a column mapping where from and to are column names. 3) WriteToServer will fail due to a null reference exception. ```c# //how to repro. (Using DataBoss.Data 0.0.42 from NuGet on netstandard 2.0) using DataBoss.Data; using System; using System.Data.SqlClient; using System.Diagnostics; namespace ConsoleApp3 { class Program { static void Main(string[] args) { var db = new SqlConnection(""Server=.;Integrated Security=SSPI""); db.Open(); db.ExecuteNonQuery(""create table #Temp(id int not null)""); var toInsert = SequenceDataReader.Create(new[] { 1, 2, 3 }, x => x.Map(""id"", id => id)); var bulkCopy = new SqlBulkCopy(db) { DestinationTableName = ""#Temp"", }; for (var i = 0; i != toInsert.FieldCount; ++i) { var n = toInsert.GetName(i); bulkCopy.ColumnMappings.Add(n, n); } bulkCopy.WriteToServer(toInsert); } } } ``` Known workaround: Create the column mapping by ordinal (change bulkCopy.ColumnMappings.Add(n, n); to 2.Add(i, n)"". [Likely culprit as far as I can discern is mishandling the _DbDataReaderSource here:](https://github.com/dotnet/corefx/blob/master/src/System.Data.SqlClient/src/System/Data/SqlClient/SqlBulkCopy.cs#L848)  [EDIT] Add C# syntax highlight + space formatting by @karelz [EDIT] Clarified repro code, added link to my guess on source. @drunkcod" 25435 area-System.Net UnixDomainSocketEndPoint: support Linux abstract socket address. This adds support for Linux abstract socket addresses. The added test round-trips the address _managed -> native -> managed_ to ensure we have connected to the correct address. To succeed for pathname addresses, the terminating null needed to be stripped. CC @stephentoub @eerhardt 25437 area-System.ComponentModel Porting first half of the System.ComponentModel.Composition tests Fixing #11857 Adding 347 tests Sets line and branch coverage to 73% and 65% respectively. 25438 area-System.Memory Expose and test string implicit cast to ReadOnlySpan<char> Fixes https://github.com/dotnet/corefx/issues/25413 Depends on https://github.com/dotnet/coreclr/pull/15167 Depends on https://github.com/dotnet/corert/pull/4990 cc: @jkotas, @ahsonkhan 25439 area-System.Net Fix AsyncOperation caching in SocketAsyncContext.Unix.cs https://github.com/dotnet/corefx/pull/25402 introduced caching for several key AsyncOperation objects, in order to avoid the extra allocations on hot/common paths in async socket operations on Unix. But something about the implementation doesn't work correctly, resulting in sporadic errors where the callback is null, suggesting that we returned the object for subsequent reuse while it was still in use. The caching has been temporarily disabled, but this should be revisited. 25440 area-System.Diagnostics EventLog is not supported in .Net Core? When is it going to be avaiable next? I have trying hard to see if EventLog works in .Net Core but it doesn't. Is it going to be also shipped with dot net core version 2.1 ? 25442 area-System.Runtime "Proposal BitConverter.ToString to have ""N"" formatter to omit the dashes" "# Rationale With GUID, we have option to omit the dashes: ```c# var guid = Guid.NewGuid(); guid.ToString(); // -> 994fd7bc-ddb3-48ea-9eb1-49df7ed9c5ac guid.ToString(""N""); // -> 994fd7bcddb348ea9eb149df7ed9c5ac ``` The BitConverter does not present such an overload to omit the dashes. # Proposal In addition to the existing ToString overloads in BitConverter: ```c# public static string ToString(byte[] value) public static string ToString(byte[] value, int startIndex) public static string ToString(byte[] value, int startIndex, int length) ``` Please consider: ```c# public static string ToString(byte[] value, string format) public static string ToString(byte[] value, int startIndex, string format) public static string ToString(byte[] value, int startIndex, int length, string format) ``` # Example: ```c# var bytes= new byte[16]; var random = new Random(); random.NextBytes(bytes); var testString = BitConverter.ToString(bytes, ""N""); Assert.DoesNotContain('-', testString); ```" 25443 area-System.Threading TaskScheduler should be able to cancel pending tasks _From @JeffCyr on November 22, 2017 18:48_ ## Rationale After a `Task` is enqueued with `TaskScheduler.QueueTask(Task task)`, it is currently not possible to cancel or fail the task if the `TaskScheduler` can't execute the task. This makes it hard to implement a disposable `TaskScheduler` because `Dispose` needs to block until all pending tasks are executed, which is not always possible, or have to leave the pending tasks uncompleted, which is not ideal either. ## Proposed API ```c# public abstract class TaskScheduler { //... protected bool TrySetCanceled(Task task); protected bool TrySetException(Task task, Exception exception); } ``` ## Details - `TrySetCanceled` and `TrySetException` can only be called for a `Task` assigned to this `TaskScheduler`. This is similar to `TryExecuteTask`. - `TrySetCanceled` and `TrySetException` are implemented with best effort. They will return `false` if the tasks is already running or canceled by a `CancellationToken`. ## Pull Request A PR with the proposed changes is available on my fork: https://github.com/JeffCyr/coreclr/pull/1 _Copied from original issue: dotnet/coreclr#15171_ 25444 area-System.Net SslApplicationProtocol: Use the copied byte array When `copy` is true, the `protocol` byte array is copied to a new array, but then the new array is never used. Instead, use the new array. 25448 area-System.Runtime Tests for new string.contains Api Fixes #25094 PR implementation link = https://github.com/dotnet/coreclr/pull/15180 25449 area-System.Security CMS: enable adding certificates and unsigned attributes post-signing CMS permits post-signing changes to `SignedData.certificates` and `SignerInfo.unsignedAttrs` collections; however, `System.Security.Cryptography.Pkcs.SignedCms.Certificates` and `System.Security.Cryptography.Pkcs.SignerInfo.UnsignedAttributes` properties return copies of the data and mutations of these collections are not persisted back to the root `SignedCms` object. Example 1: to an existing `SignerInfo` object attempt to add a timestamp per [RFC 3161 appendix A](https://tools.ietf.org/html/rfc3161#page-20). Example 2: to an existing `SignedCms` object attempt to add additional certificates found during a chain building for the timestamp authority's certificate in example 1. (According to RFC 3161, if `certReq` is TRUE in the timestamp request, the TSA is only obliged to return in its response the signing certificate, not all certificates in a complete chain for the signing certificate.) While this issue was discovered on .NET Framework, it is relevant to both .NET Framework and .NET Core's #14197 and #24524 and NuGet package signing's cross-platform plan. NuGet has a Windows-only workaround (P/Invoking) and a cross-platform workaround too, but the cross-platform workaround is a hack and a blocker for other features (like ECDSA support). One option is to introduce add/remove helper methods on `SignedCms` and `SignerInfo` classes. CC @bartonjs, @rido-min 25450 area-System.IO Should remove CheckInvalidPathChars The check for invalid path chars on the majority of System.IO APIs aggregates to a significant cost in real world performance metrics. There is little benefit to premptively checking- we should start by removing the check from everything but Path.GetFullPath(). http://source.dot.net/#System.Private.CoreLib/shared/System/IO/PathInternal.cs,486d9b8f9e6ecd64,references We need to remove checks in CoreCLR (where Path lives) and System.IO.FileSystem. 25456 area-System.Diagnostics ProcessStartInfo doesn't pass empty string to the target process "Following code is to pass ""test1"" and an empty string as arguments to netcoretest application. It works well on Windows. On Ubuntu (16.10 and 17.04), it just passes ""test1"" to netcoretest, and ignores the empty string. Could anyone help to take a look? ``` ProcessStartInfo psi = new ProcessStartInfo(""/usr/bin/dotnet""); psi.Arguments = ""netcoretest.dll test1 \""\""""; Process p1 = Process.Start(psi); p1.OutputDataReceived += (s, eventArg) => { Console.WriteLine(""P1 {0}"", eventArg.Data.ToString()); }; ``` " 25458 area-System.IO Removed Check Invalid Path Chars Fixes #25450 coreclr pr - dotnet/coreclr#15191 25459 area-System.Linq FindIndex for IReadOnlyList<T>? ## Rationale and Usage I think the usage for this API is almost same with `List<T>.FindIndex`. But this **is** a readonly API and should exist in `IReadOnlyList<T>`. Otherwise we have to fallback to mutable type, `List<T>` as interface, which is ... bad, or write a `FindIndex` extension method ourselves. ## Questions 1. If we just use type switch to optimize for `List<T>` internally, what about custom class (such as my `SortedList`) which implements `IReadOnlyList`, and also use an array internal, and I want to have a high-perf `FindIndex`? 2. Should we generalize to `IEnumerable`? What's the usage for `IEnumerable.FindIndex`? 25460 area-System.Net Quick removal of more blocking in Sockets Found a group of tests that use a mix of async and APM but the entire test can be made non blocking. Hopefully removing these is making the outerloop more stable/worth it :) Ref #25346 /cc @stephentoub @davidsh 25461 area-Microsoft.CSharp RuntimeBinderException when using Task extension method on the result of an async method in a call tree that includes a dynamic parameter "_From @bungeemonkee on November 22, 2017 23:31_ I ran into a very specific case where the clr appears to not properly resolve extension methods at runtime for code involving both dynamics and async and throws a RuntimeBinderException. CLI version: 2.0.3 CLR versioin: 2.0.3 If the code below is added to a netcoreapp2.0 console project it will reproduce the exception. Program.cs ```csharp using System; using System.Threading.Tasks; namespace RuntimeBinderException { public static class Program { public static void Main(string[] args) { Go(args).Wait(); Console.WriteLine(""Should not get here.""); } public static async Task Go(dynamic thing) { await DoSomething(thing).TaskExtension(); } public static async Task DoSomething(object parameter) { // The function needs only be declared async - it doesn't need to actually await anything } } } TaskExtensions.cs ```csharp using System.Runtime.CompilerServices; using System.Threading.Tasks; namespace RuntimeBinderException { public static class TaskExtensions { public static async Task TaskExtension(this Task task) { await task; } } } ``` The exception is: >Unhandled Exception: System.AggregateException: One or more errors occurred. ('System.Threading.Tasks.Task' does not contain a definition for 'TaskExtension') ---> Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'System.Threading.Tasks.Task' does not contain a definition for 'TaskExtension' > at CallSite.Target(Closure , CallSite , Object ) > at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0) > at RuntimeBinderException.Program.<Go>d__1.MoveNext() in /mnt/c/_Local/Playground/RuntimeBinderException/RuntimeBinderException/Program.cs:line 17 > --- End of inner exception stack trace --- > at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) > at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) > at System.Threading.Tasks.Task.Wait() > at RuntimeBinderException.Program.Main(String[] args) in /mnt/c/_Local/Playground/RuntimeBinderException/RuntimeBinderException/Program.cs:line 10 I have included a zip archive of the solution to reproduce the issue. [RuntimeBinderException.zip](https://github.com/dotnet/coreclr/files/1497723/RuntimeBinderException.zip) _Copied from original issue: dotnet/coreclr#15186_" 25463 area-System.Net SmtpClient should enable predictable filenames when using SpecifiedPickupDirectory delivery method "## Current Situation Currently we can write an email to the filesystem so we can verify the content without actually sending a communication. ```c# string from = ""someone@example.com""; string to = ""someone-else@example.com""; SmtpClient client = new SmtpClient(""smtp.example.com""); client.PickupDirectoryLocation = @""C:\temp""; client.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory; MailMessage m = new MailMessage(from, to); m.Body = ""Hey core-coders!""; m.Subject = ""Example.com email""; client.SendMail(m); ``` Which predictably writes a file to **C:\temp** - however the filename is an auto generated guid (e.g. *e98d022e-8885-4969-b87e-c16b03c02712.eml*). ## Rational and Usage This works well, however it doesn't scale well if you have a routine that sends 20+ emails and you're interested in looking at 1 of them. A simple way to improve this is to add a method on the **MailMessage** class to stipulate how the filename should be written to the filesystem. ```c# m.SpecifiedPickupFile = ""my-filename.eml""; ``` ### Proposed API ```c# namespace System.Net.Mail { public class MailMessage : IDisposable { public string SpecifiedPickupFile { get; set; } .... } } ``` ## Details - Above change would also help with integration testing. ## Open Questions - What happens if the file already exists in the **SpecifiedPickupDirectory**? Personally I think an exception would be the sensible choice (duplicate file exception?). ## Pull Request Proposal not yet approved. ## Updates - Initial version " 25466 area-Microsoft.CSharp Remove some pointer-related dead code from Microsoft.CSharp * Remove `GetPtrBinOpSigs` and code used by it. Is only called by `GetSpecialBinopSignatures`, which is only called by `BindStandardBinop`, which is only called by `BindBinaryOperation`, which creates its arguments from `ArgumentObject` objects which cannot contain pointers, so there is no way to reach this with a `PointerType`. * Remove `BindPtrBinOp` Now only called by `BindIncOpCore`, only called by `BindLiftedIncOp` & `BindNonliftedIncOp`, both only called by `BindIncOp`, only called by `BindStandardUnaryOperator` which is only called by `BindUnaryOperation`, which creates its argument from an `ArgumentObject` object which cannot contain a pointer, so there is no way to reach this with a `PointerType`. * Update comments on possible binary operations excluding pointers. * Remove `PointerType` branch from `PopulateSignatureList` Only called from `BindStandardUnaryOperator`, so can't have pointers as per above. * Remove pointer condition on `BindToField`. Only called by `CreateField`, called by `BindProperty` which creates the relevant expression from an `ArgumentObject`. 25467 area-System.Net Socket.IOcontrol handles Windows-specific control codes and is not supported in linux _From @ms0713 on November 23, 2017 5:53_ Using DllImport in my .Net code, I was using **ws2_32.dll**. While running same in Linux it says dll cant be load. So I stopped using DllImport and used Socket.IOControl() to read my data from socket. This time linux gives following error: Socket.IOControl handles Windows -specific control codes and is not supported in linux. What could be the common way to recieve data in Windows and Linux??? _Copied from original issue: dotnet/coreclr#15194_ 25468 area-Microsoft.CSharp Remove some dead code from Microsoft.CSharp's PredefinedMembers "* Remove `MethodSignatureEnum.SIG_REF` and `.SIG_OUT` No predefined methods used these. * Remove checks that `GetOptPredefAgg` may have returned null. It can't, as we won't start up without types we expect are there. Rename to `GetPredefAgg`, since it's not ""Opt"". * Remove branches for `LoadTypeFromSignature` returning null. Since we can now see that this can never happen * Remove `PredefinedType.PT_G_OPTIONAL` branch in `LoadTypeArrayFromSignature` No parameter list contains it. * Skip getting type arguments for predefined members when there are none. Avoids creating and throwing away an array." 25469 area-System.Data SqlConnection should NOT be sealed (nothing should be sealed, really) "Imagine the following scenario: For security reasons (or performance, or policies, or whatever), I want to have a readonly sql connection to some features and a read/write connection for others. What's the most easy way to accomplish this? Using .net core dependency injection: ``` services.AddScoped(_ => new ReadOnlySqlConnection(Configuration.GetConnectionString(""ReadOnlySqlConnectionStringWithAReadOnlyUser""))); services.AddScoped(_ => new ReadWriteSqlConnection(Configuration.GetConnectionString(""ReadWriteSqlConnectionStringWithAReadOnlyUser""))); ``` Then, I could implement a simple inheritance to resolve what type of connection I want: ``` public class ReadOnlySqlConnection : SqlConnection { } public class ReadWriteSqlConnection : SqlConnection { } ``` I could even create a specialized SqlCommand to throw exceptions on write methods while using a ReadOnly connection (overriding ExecuteNonQuery to throw an exception). So I could make a specialized method on it: ``` public class ReadOnlySqlConnection : SqlConnection { public ReadOnlySqlCommand CreateCommand(...) { ... } } public class ReadWriteSqlConnection : SqlConnection { public ReadWriteSqlCommand CreateCommand(...) { ... } } ``` Sealing classes is bad for the extensible nature of .net :( I KNOW there are other ways to doing this... but, why seal anything, really? Let's us extend all we want \O/" 25470 area-Meta Port System.Messaging 25473 area-Microsoft.CSharp Remove invalid assertion from Microsoft.CSharp's BindIsEvent Missed when #25420 removed two similar from `InvokeMember`. Also include tests for `IsEvent`, `BindIsEvent`, etc. 25477 area-System.Security AsyncLocal.OnValueChanged seems to be called with a stale change, crashing the process I've attempted to write a middleware service to use WindowsIdentity.RunImpersonated, Wait()-ing for the next handler to return. However I've seen that WindowsIdentity.CurrentImpersonatedTokenChanged is called a final time after my middleware finishes, with a closed but valid windows token. This leads to Environment.FailFast being called in ExecutionContext.OnContextChanged, which is logging the stack trace from OnContextChanged, but isn't logging the details of the exception that was caught. There seem to be a number of problems here; - We need an async version of RunImpersonated (#24977) - WindowsIdentity.CurrentImpersonatedTokenChanged should check for closed tokens - Environment.FailFast should log the exception details (https://github.com/dotnet/coreclr/issues/15203) - AsyncLocal.OnValueChanged seems to be called with a stale change after an async task has completed. In the meantime, I've worked around the problem by calling advapi32.dll ImpersonateLoggedOnUser / RevertToSelf directly from an AsyncLocal change handler, essentially implementing an async version of RunImpersonated myself. EDIT by @ViktorHofer: added issue link for failfast. 25480 area-System.Linq ExpressionTree serialization and reflection fallback? The expression tree is a great tools for making standard dynamic script. But there is 2 features I think we need to let it contain in expression tree library One is standardize serialization/deserialization for making it portable and could transfer the logic across network and also save it as data in a file or database Another is fallback to reflection in addition to `Compile()` to delegate. In place where we can't do a runtime code generation such as when we doing AoT compilation 25481 area-System.Net Fix NetworkStream.Write() when UNIX signal interrupts the system call Comment in the code has stated, that since the socket is in the blocking mode send() operation will always complete after all requested bytes were transferred. On UNIX systems send() system call can be interrupted by a signal. This change makes sure that all bytes were transferred, even in case when the system call was interrupted. 25483 area-Microsoft.CSharp NRE from MS.CSharp's Binder.Convert on identity or upcasts If we explicitly set the source type of a use of `Binder.Convert` and if the conversion is either the identity conversion or an upcast of a reference type to either a base type or implemented interface, then the delegate produced will throw `NullReferenceException` on execution. ```C# var binder = Binder.Convert(CSharpBinderFlags.None, typeof(int), GetType()); var callSite = CallSite<Func<CallSite, int, int>>.Create(binder); var func = callSite.Target; int result = func(callSite, 2); // throws NRE ``` The `ExpressionTreeRewriter` removes such casts whenever it finds them, since they can be skipped, but the `ExpressionTreeCallRewriter` can't handle the `p0 => p0` result if that conversion was the only operation. 25484 area-Microsoft.CSharp Correct identity expression results in MS.CSharp Have `ExpressionTreeCallRewriter` correctly handle CSharp expressions that only access a parameter, so that conversions that have been fully optimised away can be correctly converted into Linq expressions. Fixes #25483 Also include some tests for implicit conversions. 25485 area-System.IO Fix misleading exception message, cleanup code FileSystemWatcher @danmosemsft found another place where message could be more precise again on FileSystemWatcher. Fixes #24817 25487 area-System.Linq Remove FEATURE_INTERPRET from System.Linq.Expressions Since it's been set on every build for some time, it no longer serves any purpose, and it existing implies it could perhaps not be set. 25488 area-Microsoft.CSharp Remove code in Microsoft.CSharp related to casting method groups or unbound lambdas * Remove branches for inferring method group arguments to methods. We can never have a method-group or bound lambda expression as an argument, so these branches can never find a result. * Remove `MethodTypeInferrer._pClassTypeArguments` Set, but never used. * Remove `ArgInfos.fHasExprs` and paths for it being false. Always set to true in `FillInArgInfoFromArgList` immediately after creation. Removing the dead code this orphans removes `InferForMethodGroupConversion`, which dealt with passing generic method groups as arguments, and hence irrelevant to dynamic binding. 25489 area-System.Net Implement managed and independent websocket support According to the code here, there's no websocket implementation for Windows 7. Since windows 7 isn't EOL and it's listed as a supported plaform, this is a bug . Since Microsoft I guess wants to keep ubiquitous web technology out of Windows 7 I guess to coerce people into upgrading to Windows Spy edition, probably should implement this or strip windows 7 from the list of supported operating systems. 25495 area-System.ComponentModel Issue when calling Validator.TryValidateObject Hi, The method TryValidateObject will throw an exception when trying to validate an object. It seems that the GetObjectValidationErrors method does not check if result of alidatable.Validate(validationContext) is not null. Is this a bug or a desired design? Regards, Jérôme Piquot Method : System.ComponentModel.DataAnnotations.GetObjectValidationErrors // Step 3: Test for IValidatableObject implementation if (instance is IValidatableObject validatable) { var results = validatable.Validate(validationContext); **===>** foreach (var result in results.Where(r => r != ValidationResult.Success)) { errors.Add(new ValidationError(null, instance, result)); } } Call Stack : System.ArgumentNullException: Value cannot be null. Parameter name: source at System.Linq.Enumerable.Where[TSource](IEnumerable`1 source, Func`2 predicate) at System.ComponentModel.DataAnnotations.Validator.GetObjectValidationErrors(Object instance, ValidationContext validationContext, Boolean validateAllProperties, Boolean breakOnFirstError) at System.ComponentModel.DataAnnotations.Validator.TryValidateObject(Object instance, ValidationContext validationContext, ICollection`1 validationResults, Boolean validateAllProperties) at Flexmind.Framework.Database.ApplicationDbContext.ValidateObject(IValidatableObject toValidate) in C:\Dev\Tyndareus\Flexmind.Framework\Flexmind.Framework\src\Core\Flexmind.Framework.Database\ApplicationDbContext.cs:line 148 at Flexmind.Framework.Database.ApplicationDbContext.BeforeSave() in C:\Dev\Tyndareus\Flexmind.Framework\Flexmind.Framework\src\Core\Flexmind.Framework.Database\ApplicationDbContext.cs:line 127 at Flexmind.Framework.Database.ApplicationDbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) in C:\Dev\Tyndareus\Flexmind.Framework\Flexmind.Framework\src\Core\Flexmind.Framework.Database\ApplicationDbContext.cs:line 102 at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(CancellationToken cancellationToken) 25497 area-System.Net URI thread safety documentation "The URI class is immutable, and glancing at the [code](https://github.com/dotnet/corefx/blob/master/src/System.Private.Uri/src/System/Uri.cs) it seems as though [thread-safety](https://github.com/dotnet/corefx/blob/c4ebdbe5f5fbf53ec73b2c2e16f610387945151f/src/System.Private.Uri/src/System/Uri.cs#L128) is considered. However, the [URI docs](https://msdn.microsoft.com/en-us/library/system.uri(v=vs.110).aspx) say _""Any instance members are not guaranteed to be thread safe""_. Is that really the case? If not, and the class is thread-safe, the docs should be updated." 25498 area-System.ComponentModel Fixing disabled tests in System.ComponentModel.Composition This issue tracks the disabled failing tests for System.ComponentModel.Composition identified during port to core 25499 area-System.Memory ReadOnlySpan<T> debug view error "VS 15.5.0 Preview 4.0 System.Memory 4.5.0-preview1-25925-02 The error occurs when viewing debug information of the ""readonlySpan"" variable. repro: ``` var stringData = ""hello Steve""; var readonlySpan = stringData.AsReadOnlySpan(); ``` error: ``` Specified cast is not valid. at System.SpanDebugView`1[[System.Char, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]..ctor(ReadOnlySpan`1 collection) ```" 25500 area-System.Linq S.L.Expressions interpreter fails to widen rhs of coalese expressions With a coalesce expression where the left hand side is wider than the right hand side (ignoring that the left may be nullable and the right not), then the right hand side should be widened to the value of the node of the two (that is, the wider of the two if both are nullable, the non-nullable form of the wider of the two otherwise). The compiler handles this fine, but the interpreter will throw `InvalidCastException` if the left hand operand had been null. Repro: ```C# Expression.Lambda<Func<long>>( Expression.Coalesce(Expression.Constant(null, typeof(long?)), Expression.Constant(2)) ).Compile(true)(); 25501 area-System.Linq Correctly handle coalesce linq expressions that widen the rhs operand Fixes #25500 25503 area-Microsoft.CSharp Presence of overloads with __arglist can prevent dynamic binding finding correct overload Given ```C# public class HasVarargs { public int Binary(int i, int j, __arglist) => 0; public int Binary(int i, int j) => i + j; // This should be fine with dynamic public int Binary(int i, __arglist) => 0; } ``` Then the code: ```C# dynamic d = new HasVarargs(); Console.WriteLine(d.Binary(3, 4)); ``` Can throw a `RuntimeBinderException` with a message of `The best overloaded method match for 'UserQuery.HasVarargs.Binary(int, __arglist, ...)' has some invalid arguments` or of `No overload for method 'Binary' takes '2' arguments` or perhaps work, depending on the order the methods are put in the class' source (I would guess, affecting the order reflection finds them in). 25504 area-Microsoft.CSharp Stop Microsoft.CSharp getting confused by varargs overloads to callable members * Include calling convention in `MemberInfo` equality checks Prevents the binder from thinking a callable method is a varargs (and hence uncallable) method it has already seen, and not recording it. Fixes #25503 * Record whether a constructor is varargs. Constructors were assumed to not be varargs, so a varargs constructor could be erroneously called. * Remove vararg handling from `AdjustCallArgumentsForParams` We will never get this far with a vararg method. * Don't include ellipses in error messages about varargs members. Since we're including `__arglist`, the ellipsis representing the argument list is redundant. Fixes #25506 * Remove `isVarargs` and `isAbstract` from `MethodSymbol` `isVarargs` had only been used in error messages (no longer the case) and an assertion added when vararg handling was removed from `AdjustCallArgumentsForParams` above (can be replaced with a check for an `ArgumentListType` parameter), with varargs members correctly failing overload resolution due to the `ArgumentListType` parameter not matching rather than the `isVarargs` flag. `isAbstract` was set but never used. 25505 area-System.Data Add PrepareAsync() to DbCommand ADO.NET includes `DbCommand.Prepare()` for command preparation, to speed up subsequent repeated executions of the command. As this method may perform I/O to create a server-side statement, it should have a `DbCommand.PrepareAsync()` counterpart. As with other ADO.NET async overloads, `DbCommand` should provide a default implementation which delegates to the sync version. 25506 area-Microsoft.CSharp Microsoft.CSharp represents __arglist in error messages twice. Given the following: ```C# public class HasVarargs { public void OnlyVarargs(__arglist) { } } ``` Then attempting: ```C# dynamic d = new HasVarargs(); d.OnlyVarargs(1); ``` Raises an exception with the message `The best overloaded method match for 'UserQuery.HasVarargs.OnlyVarargs(__arglist, ...)' has some invalid arguments` Really it should either use `__arglist` to represent the varargs component or `...` but not both. Considering that the static error message would be `Argument 1: cannot convert from 'int' to '__arglist'` it would seem that the former would be preferred to the latter. 25507 area-Microsoft.CSharp Microsoft.CSharp picks incorrect default for optional MarshalAs(UnmanagedType.IDispatch) With ```C# public class Class { public object GetVal([Optional, MarshalAsAttribute(UnmanagedType.IDispatch)]object val) => val; } ``` Then a static call to `GetVal()` will return null, but via `dynamic` it will return `System.Reflection.Missing`. This works correctly in NetFX. (Was `UnmanagedType.IDispatch` once not available in CoreFX?) 25508 area-Microsoft.CSharp Have Microsoft.CSharp pick correct default for optional MarshalAs(UnmanagedType.IDispatch) * Use null as default for optional parameters that marshal as `IDispatch` Fixes #25507 * Don't allocate six arrays for empty parameters in `MethodOrPropertySymbol` (A common case) * More tests for default parameter value handling * Remove dead path from `SetParameterAttributes` Looks for default decimal value, but we've already looked for that via `DecimalConstantAttribute` which is the only way to set it. 25509 area-System.Runtime Reuse HashHelpers for BinaryFormatter objectholder hashes Fixes https://github.com/dotnet/corefx/issues/25533 Fixes https://github.com/dotnet/corefx/issues/24902 With https://github.com/dotnet/corefx/pull/17949 we increased the MaxArrazSize of ObjectHolders. Because of that change our largest prime number 6584983 can now be smaller than the max size of an array. By @danmosemsft suggestion I'm reusing the HashHelpers utility class to utilize larger pre-computed prime numbers and remove the logic for calculating the next optimal prime number. This also changes the start prime number size as before it was 5 and now it is 3. When I'm off plane I will add benchmarks with performance numbers. A quick test didn't show any noticeable performance regressions. @Alois-xx I'm marking issue #24902 as fixed. As @stephentoub already mentioned we brought back BinaryFormatter for a smoother transition from .NET Framework to .NET Core and don't intend to optimize it further. If you want to, you can work by yourself on changing the data structure to remove the necessity of the pre-computed prime numbers and therefore the virtual limit. That would require extensive tests to be confident that we don't break or regress existing code. cc @joperezr 25510 area-System.Numerics Vectorize Quaternion Contributes to https://github.com/dotnet/corefx/issues/7751 PTAL @mellinoe @eerhardt @tannergooding @CarolEidt 25511 area-System.Net Issue #23141 Fix ManagedHandler cancellation Tests An attempt to solve #23141. There are two parts to the PR. 1. Improving the cancellation support in ManagedHandler: this employs handling the cancellation via the CancellationToken while allowing the operation to still run in background (as discussed in [this](https://github.com/dotnet/corefx/issues/23141#issuecomment-346678600) comment). The idea is based on the blog article [here](https://blogs.msdn.microsoft.com/pfxteam/2012/10/05/how-do-i-cancel-non-cancelable-async-operations/) :-) 2. Even with the above 'by-pass' fix, the test 'ReadAsStreamAsync_ReadAsync_Cancel_TaskCanceledQuickly' still hanged while doing `ReadAsync` from the stream. In case of `ManagedHandler` the response stream is of type `ContentLengthReadStream` which needed fix on the lines of cancelable functionality in `WinHttpResponseStream` ([here](https://github.com/dotnet/corefx/blob/035b1e367c18db600c9d7158102fd2ab4e7a7ed2/src/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpResponseStream.cs#L216)) I am still trying to find out how to close / dispose the HttpConnection or the stream instead of allowing the operations to run in the background, consequences of which I am not very sure of. @stephentoub, I have created this PR as we discussed [here](https://github.com/dotnet/corefx/issues/23141#issuecomment-340493361). Appreciate your inputs. Thanks, Mandar 25512 area-Infrastructure "Remove suffix "".sh"" from Unix shell scripts such as ""build.sh"" - let the shebang line do its job" On Unix platforms, it is solely the executable bit that determines whether files are executable - irrespective of the filename or its suffix (extension, in Windows-speak). A file marked as executable that happens to be a _script_ file specifies the executable (interpreter) to use via its _shebang line_, the very first line which looks something like `#!/usr/bin/env bash`. Therefore, **rename `build.sh` to just `build`, ...** - **suffix `.sh` is technically unnecessary and generally a bad habit.** Omitting the `.sh` suffix will make invocation on Unix more like on Windows: ```cmd :: cmd.exe build # PowerShell ./build ``` ```sh # bash ./build ``` Note that, for security reasons, the `./` part is necessary in order to invoke an executable in the current dir. on Unix platforms, just as it is in PowerShell. 25513 area-System.Net The certificate authority is invalid or incorrect exception while using .NET standard 2.0 @jainankit2474 commented on [Sun Nov 26 2017](https://github.com/dotnet/standard/issues/592) My problem here is specifically in .Net standard 2.0 and .Net core 2.0, since the same code, seems to work fine with .net framework 4.6.1. In .NET framework, we are using following code to trust all certificates: `ServicePointManager.ServiceCertificateValidationCallback += (o, c, ch, er) => true;` But the same code is not working with .NET core 2.0 and .NET standard 2.0. I have also tried the below code: `var httpClientHandler = new HttpClientHandler(); httpClientHandler.ServiceCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;` But this is not working for me. 'An error occurred while sending the request, The certificate authority is invalid or incorrect' exception has been thrown.  Please suggest me any alternative solution for the self-signed certificate in .NET standard 2.0. --- @Petermarcu commented on [Sun Nov 26 2017](https://github.com/dotnet/standard/issues/592#issuecomment-347051864) This may be an issue with the implementation of those API's in .NET Core 2.0. I'm going to move this issue to .NET Core so that can be determined. 25515 area-Infrastructure corefx build fails with zero as null pointer constant I am trying to build corefx for raspberry pi with clang 5.0. I am betting below error at multiple places. /src/Native/Unix/System.Native/pal_random.cpp::9494::2222:: errorerror: : zero as null pointer constant [-Werror,-Wzero-as-null-pointer-constant]zero as null pointer constant [-Werror,-Wzero-as-null-pointer-constant] srand48(time(NULL)); srand48(time(NULL)); ^~~~ ^~~~ nullptr nullptr /corefx/2.0.0-r0/recipe-sysroot-native/usr/lib/clang/5.0.1/include/stddef.h::100100::1818:: notenote: : expanded from macro NULL expanded from macro NULL `#` define NULL __null# define NULL __null Any suggestion would be of great help. 25516 area-System.Net System.Net.Http.dll 4.6.25220.1和 System.Net.Http.dll 4.6.25514.4不兼容 @ghd258 commented on [Thu Nov 16 2017](https://github.com/dotnet/core/issues/1098) System.Net.Http.dll 4.6.25220.1和 System.Net.Http.dll 4.6.25514.4 不兼容 而且NuGet就没有4.6.25514.4 这个版本 --- @Petermarcu commented on [Sun Nov 26 2017](https://github.com/dotnet/core/issues/1098#issuecomment-347080256) Translated: System.Net.Http.dll 4.6.25220.1 and System.Net.Http.dll 4.6.25514.4 is not compatible and NuGet is not 4.6.25514.4 this version @davidsh is this another instance of the OOB/Binding redirect challenges with System.Net.Http? 25517 area-Infrastructure FreeBSD: building corefx managed components fails on ODBC32 namespace Dear All, I am on Windows 10, and I am referring specifically to: https://github.com/dotnet/corefx/wiki/Building-.NET-Core--2.x-on-FreeBSD#user-content-building-managed-components-on-windows As well as the Linux counterpart. I tried: 1) `build.cmd` with default flags. This works, but I am well uncertain what to copy to my FreeBSD (11) system. 2) `build-managed.cmd` with the same flags recommended for Linux. The build fails at: ```System.Data.forwards.cs(10,83): error CS0234: The type or namespace name 'ODBC32' does not exist in the namespace 'System.Data.Odbc' (are you missing an assembly reference?)``` 3) The same on Ubuntu 16.04, on Hyper-V (using both build.sh and build-managed.sh). Same failure as on Windows. Corefx revision is: `commit d61b6095568c18cb5e24cff24e0ecf488dfe0f75` Furthermore, I am uncertain what to do with the binaries, should I be able to produce them. From the following passage, I seem to understand which binaries/libraries are required for testing: should I just move that set of files to `/usr/.../bin` in order to access them globally? 25518 area-System.IO readdir_r: align read buffer at dirent This avoids unaligned access when readdir_r is filling the dirent. CC @stephentoub 25519 area-System.Net System.Uri fails for umlaut characters Loading a XML document (System.Xml.Linq.XDocument.Load(String uri, LoadOptions options)) fails when the path to the XML file contains an umlaut. Call stack ``` ERROR: The given path's format is not supported. at System.IO.Path.GetFullPath(String path) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize) at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy) at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn) at System.Xml.XmlTextReaderImpl.FinishInitUriString() at System.Xml.XmlTextReaderImpl..ctor(String uriStr, XmlReaderSettings settings, XmlParserContext context, XmlResolver uriResolver) at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext) at System.Xml.XmlReader.Create(String inputUri, XmlReaderSettings settings) at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options) at Fable.CLI.ProjectCracker.getFsprojSourceFiles(String projFile) at Fable.CLI.ProjectCracker.crackProjects@242(FSharpList`1 acc, FSharpChoice`2 projFile) at Microsoft.FSharp.Collections.SeqModule.FoldBack[T,TState](FSharpFunc`2 folder, IEnumerable`1 source, TState state) at Fable.CLI.ProjectCracker.getProjectOptionsFromFsproj(Message msg, String projFile) at Fable.CLI.ProjectCracker.retry@286(FSharpChecker checker, Message msg, String projFile, DateTime retryUntil, Unit unitVar0) at Fable.CLI.ProjectCracker.retryGetProjectOpts(FSharpChecker checker, Message msg, String projFile) at Fable.CLI.ProjectCracker.getFullProjectOpts(FSharpChecker checker, Message msg, String projFile) at Fable.CLI.StateUtil.createProject(FSharpChecker checker, Boolean isWatchCompile, FSharpOption`1 prevProject, Message msg, String projFile) at Fable.CLI.StateUtil.updateState(FSharpChecker checker, FSharpMap`2 state, Message msg) at Fable.CLI.StateUtil.loop@195-6.Invoke(Tuple`2 _arg1) ``` Issue arose when trying to build Fable (http://fable.io/ - uses dotnet core to compile F# to javascript ) project and it seems that any umlaut in the path will case an error. More background information available here: https://github.com/fable-elmish/templates/issues/46 25520 area-System.Net Weird issue with httpClient I am testing my code in my win10 dev machine and works fine. ``` //mycode HttpResponseMessage response = await client.GetAsync(uri); ``` When i try it in a winServer2012 r2 I get ``` System.Net.Http.WinHttpException (0x80072F8F): A security error occurred at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Threading.Tasks.RendezvousAwaitable`1.GetResult() at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext() An error occurred while sending the request. at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at NextcloudClient.NextCloudPublicSharesClient.<_getLoginRequestToken>d__15.MoveNext() in C:\Projects\httpIssues\httpIssues\NextcloudClient\NextCloudPublicClient.cs:line 396 ... ``` My pc with is in the same network with the devServer in the same AD My code was working before upgrading to .net core 2.0.3 25521 area-Microsoft.CSharp dynamic and private protected "Currently Microsoft.CSharp treats access to a method that `IsFamilyAndAssembly` the same as it does one that `IsAssembly`, allowing it to be called as long as the call-site is from the same assembly. Until recently this was valid for the static compiler (since it couldn't create a method that was `IsFamilyAndAssembly` there couldn't be one in the assembly being compiled, so any encountered must be in another assembly and therefore the access in practice must be the same as if it was `IsAssembly`) and incorrect but obscure for the dynamic binder (you can create a situation where it comes up, through manually coding against the API, but not through the use of `dynamic`). With C#7.2 introducing [`private protected`](https://github.com/dotnet/csharplang/issues/37) this is no longer the case and it would be quite easy to write a dynamic call that broke the rules: ```C# public class A { private protected void Method(int x) { } } public class B { public void CheatPrivateProtected(A a) { dynamic d = a; d.Method(2); } } ``` This should probably be changed. Doing so is a breaking change, but an obscure one: In order to have code that would be broken until recently it would have to be: 1. Using a library that had a `IsFamilyAndAssembly` member (rare) 2. Manually calling `Binder.InvokeMember` or such rather than using `dynamic` (rare, and using a method documented as ""This API supports the product infrastructure and is not intended to be used directly from your code."") 3. Setting the call site of the `CallSite` created to be a type that is internal to the other library (very rare) but neither the type invoked on nor a type derived from it (extremely rare, and pointless). Doing so after there is more use of `private protected` would be a bigger break, so it is probably a good idea to make the change before then. It will also mean incompatibility with netfx unless it also makes a comparable change." 25523 area-Microsoft.CSharp Implement private protected in Microsoft.CSharp Make Microsoft.CSharp honour the access of `IsFamilyAndAssembly` as is set by [private protected in C#7.2](https://github.com/dotnet/csharplang/issues/37) Fixes #25521 See #25521 for discussion on both change impact and potential issues if C# makes `IsFamilyAndAssembly` more available but this change is not made. 25524 area-System.IO Unix: Remove MaxPath, MaxName PATH_MAX is not an upper bound on path lengths on Unix. system function return values should be used to determine behavior, instead of limiting the path length. MaxName is not used. When used, it should take into account the file system at that path. 25525 area-System.Net SocketOptionName.MulticastInterface not supported with Linux IPv6 Set the multicast interface socket option on IPv6 socket causes a SocketException ```c# using System; using System.Net.Sockets; namespace client { class Program { static void Main(string[] args) { var socket = new Socket(AddressFamily.InterNetworkV6, SocketType.Dgram, ProtocolType.Udp); socket.SetSocketOption(SocketOptionLevel.IPv6, SocketOptionName.MulticastInterface, 1); } } } ``` When run this on Ubuntu Linux with dotnet 2.0.4 results in a SocketException ``` Unhandled Exception: System.Net.Sockets.SocketException: Operation not supported at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName) at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Int32 optionValue, Boolean silent) at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Int32 optionValue) at client.Program.Main(String[] args) in /home/jose/client/Program.cs:line 11 ``` [EDIT] Add C# syntax highlight by @karelz 25526 area-System.Drawing Don't directly throw Exception System.Drawing "@safern i'm trying to fix ""throw new Exception()"" on System.Drawing(#23748) but as @karelz thought may be a compatibility concerns, with netfx. What do you think?I could split tests per platform, but i think that is not a good idea. Is it better to skip System.Drawing and go on with other?" 25527 area-System.Data Don't directly throw Exception System.Data.SqlClient "I did some test [here](https://github.com/dotnet/corefx/compare/master...MarcoRossignoli:issue_23748_SqlClient#diff-4443802483f189746d4dcd5ca6e8d62c) on SqlClient(#23748) and i think it's a special case when exception is catch after throw. Maybe ""InvalidOperationException""? @JonHanna do you think is fine here? @saurabh500 @corivera" 25528 area-System.Runtime Added test for Delegate.CreateDelegate method Added test for dotnet/coreclr#15196 25529 area-System.Runtime thread contention at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.GetTypeInformation @AndresPabloGomez commented 4 days ago Please change the method GetTypeInformation to use ReaderWriterLockSlim or something else, to access typeNameCache dictionary. @msisterna commented 4 days ago I have the same problem. 25530 area-System.Runtime Design capability APIs "We need to list & drive a design of capability APIs as explained here: https://github.com/dotnet/designs/blob/master/accepted/compat-pack/compat-pack.md#non-goals Instead of writing code like this: ```csharp private static string GetLoggingPath() { if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { using (var key = Registry.CurrentUser.OpenSubKey(@""Software\Fabrikam\AssetManagement"")) { if (key?.GetValue(""LoggingDirectoryPath"") is string configuredPath) return configuredPath; } } var appDataPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); return Path.Combine(appDataPath, ""Fabrikam"", ""AssetManagement"", ""Logging""); } ``` we should be promoting code like this: ```csharp private static string GetLoggingPath() { if (Registry.IsSupported) { using (var key = Registry.CurrentUser.OpenSubKey(@""Software\Fabrikam\AssetManagement"")) { if (key?.GetValue(""LoggingDirectoryPath"") is string configuredPath) return configuredPath; } } var appDataPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); return Path.Combine(appDataPath, ""Fabrikam"", ""AssetManagement"", ""Logging""); } ```" 25531 area-System.Console WindowAndCursorProps.Title_Set_Windows(lengthOfTitle: 1024) failed with ThrowsException "Happening on my local machine: Windows 10 RS4 17046 ``` <test name=""WindowAndCursorProps.Title_Set_Windows(lengthOfTitle: 1024)"" type=""WindowAndCursorProps"" method=""Title_Set_Windows"" time=""14.5858609"" result=""Fail""> <traits> <trait name=""category"" value=""nonlinuxtests"" /> <trait name=""category"" value=""nonosxtests"" /> <trait name=""category"" value=""nonfreebsdtests"" /> <trait name=""category"" value=""nonnetbsdtests"" /> <trait name=""category"" value=""nonuaptests"" /> <trait name=""category"" value=""nonuapaottests"" /> </traits> <failure exception-type=""System.Diagnostics.RemoteExecutorTestBase+RemoteInvokeHandle+RemoteExecutionException""> <message><![CDATA[System.Diagnostics.RemoteExecutorTestBase+RemoteInvokeHandle+RemoteExecutionException : Remote process failed with an unhandled exception.]]></message> <stack-trace><![CDATA[ Child exception: Xunit.Sdk.ThrowsException: Assert.Throws() Failure Expected: typeof(System.IO.IOException) Actual: (No exception was thrown) at WindowAndCursorProps.<>c.<Title_Set_Windows>b__11_0(String lengthOfTitleString) in D:\git\corefx\src\System.Console\tests\WindowAndCursorProps.cs:line 161 Child process: System.Console.Tests, Version=4.1.1.0, Culture=neutral, PublicKeyToken=9d77cc7ad39b68eb WindowAndCursorProps+<>c Int32 <Title_Set_Windows>b__11_0(System.String) Child arguments: 1024 ]]></stack-trace> </failure> </test> ```" 25532 area-System.Console Disable console title workaround for >=RS4 Fixes https://github.com/dotnet/corefx/issues/25531 cc @joperezr @ianhays 25533 area-System.Collections Right sizing HashSet ctor is allocating too many elements When initializing a HashSet like this: ```csharp new HashSet<string>(80_000_000); ``` the underlying arrays (buckets and slots) will not have the size of ~80M (its next prime number) but the size of the next prime number in the pre-computed list, which is 92_434_613. This is an oversize of 11.55% and is not expected by the user. The worst case is that the array gets oversized by 20% because of the layout of the pre-computed prime numbers. This was introduced by https://github.com/dotnet/corefx/pull/6203 cc @jkotas @stephentoub @danmosemsft 25535 area-System.IO Add overload to Path.GetFullPath() to specify base path "We should add an overload that allows specifying the base path to resolve against if the given `path` isn't fully qualified. ## Rationale and Usage Resolving partially qualified paths (paths that are relative to the current directory) is error prone as it depends on the process-wide state of the current working directory. Allowing users to specify a virtual ""working directory"" will avoid many common errors caused by setting the current directory to resolve paths ""correctly"". ``` C# foreach (string file in sourceFiles) { resolvedSources.Add(Path.GetFullPath(file, projectRoot)); } ``` ## Proposed API ``` C# namespace System.IO { public static class Path { public static string GetFullPath(string path, string basePath); } } ``` ## Implementation Notes - `basePath` will throw ArgumentNullException if null. - `basePath` will throw ArgumentException if it does not meet `Path.IsPathFullyQualified()`. - If `path` does not meet `Path.IsPathFullyQualified()`, it will be combined with the `basePath` before resolving. - If the given path is drive relative on Windows (`C:foo`) we will combine with the `basePath` **if** the drive matches. If it does not, we will assume it is meant to be at the root of the specified drive. (Option: we could throw in this case...) " 25536 area-System.IO Need Span based path join API "We need an API that does a simple join of `ReadOnlySpan<char>` segments, adding a directory separator only if needed. ## Rationale and Usage We don't have API for combining paths that works with `Span<char>`. It will become common that segments of existing strings will be combined into paths. A simple example will be getting a filename from an existing path and adding it to the directory of another. ``` C# // entry.FileName being a ReadOnlySpan<char>, directory being a string or span string path = Path.Join(directory, entry.FileName); ``` We could add overloads for `Path.Combine()`, but the behavior of returning the last argument that passes `IsPathRooted()` isn't intuitive, and is not desired in the common case. If the intent was to ""resolve"" a path against another, getting the final path correct is difficult to do, particularly on Windows. Take the following: ``` C# string result = Path.Combine(@""C:\Foo"", @""\Bar""); ``` This returns `\Bar`, which can only be correctly resolved (via `Path.GetFullPath()`) if the current directory happens to be on the `C:` drive. This can be better handled by the #25535 proposal for Path.GetFullPath(). Additionally, it is common for people to use the existing `Combine()` APIs on paths that aren't file system paths (URIs, registry paths, etc.). ## Proposed API ``` C# namespace System.IO { public static class Path { public static string Join(ReadOnlySpan<char> path1, ReadOnlySpan<char> path2); public static string Join(ReadOnlySpan<char> path1, ReadOnlySpan<char> path2, ReadOnlySpan<char> path3); public static bool TryJoin(Span<char> destination, out int charsWritten, ReadOnlySpan<char> path1, ReadOnlySpan<char> path2); } } ``` ## Implementation Notes - We will add the default directory separator if either type of separator is not already present (we'll allow an existing AltDirectorySeparator to be valid) - Only spans that have a length will be combined - We will not care about rooting (unlike the existing Combine APIs) - This will not check the validity of the given paths in any way (character validity, etc)" 25539 area-System.IO Need Span overloads for Path APIs In order to reduce allocations for path generation and manipulation we need Span overloads for `System.IO.Path` APIs. ## Proposed API ``` C# namespace System.IO { public static class Path { public static ReadOnlySpan<char> GetDirectoryName(ReadOnlySpan<char> path); public static ReadOnlySpan<char> GetExtension(ReadOnlySpan<char> path); public static ReadOnlySpan<char> GetFileName(ReadOnlySpan<char> path); public static ReadOnlySpan<char> GetFileNameWithoutExtension(ReadOnlySpan<char> path); public static ReadOnlySpan<char> GetPathRoot(ReadOnlySpan<char> path); public static bool HasExtension(ReadOnlySpan<char> path); public static bool IsPathFullyQualified(ReadOnlySpan<char> path); public static bool IsPathRooted(ReadOnlySpan<char> path); } } ``` ## Implementation Notes - If the current APIs return null, these would return an empty span. 25542 area-System.Data Don't directly throw Exception System.Data.SqlClient Closes #25527 and contributes to #23748 25544 area-System.Net Fix MulticasInterface SocketOption to work with IPv6 on Linux Fixes #25525 25546 area-System.Runtime Expose Stream.CopyToAsync overload without buffer size How do you feel about tests for this? Do you have any pointers to any existing tests for reference? Closes #23312 25548 area-System.Net Ctor of System.Uri transform Uri to lowercase "I got into this bug when was moving library to .Net Standard 2: When we construct Uri by combining two Uri's, one with absolute path, and another with Relative: `var sut = new Uri(new Uri(""https://your_azure_account.restv2.westeurope.media.azure.net/api/"", UriKind.Absolute), new Uri(""ContentKeys('nb:kid:UUID:7deef38d-3432-4747-a5b2-0cd2f06a6edd')/GetKeyDeliveryUrl"", UriKind.Relative));` It lowers ""ContentKeys"": `https://your_azure_account.restv2.westeurope.media.azure.net/api/contentkeys('nb:kid:UUID:7deef38d-3432-4747-a5b2-0cd2f06a6edd')/GetKeyDeliveryUrl` instead of `https://your_azure_account.restv2.westeurope.media.azure.net/api/ContentKeys('nb:kid:UUID:7deef38d-3432-4747-a5b2-0cd2f06a6edd')/GetKeyDeliveryUrl` which you'll get e.g. in .Net 4.7.2. Interesting, but GetKeyDeliveryUrl isn't getting lowered. This bug breaks retrieving of key delivery Url if you're using Microsoft.Data.Services.Client library." 25550 area-System.Drawing IconCodecTest.Bitmap16Pixels failed on netfx in CI https://ci3.dot.net/job/dotnet_corefx/job/master/job/windows-TGroup_netfx+CGroup_Release+AGroup_x86+TestOuter_false_prtest/5682/consoleText ``` MonoTests.System.Drawing.Imaging.IconCodecTest.Bitmap16Pixels [FAIL] System.ArgumentException : Parameter is not valid. Stack Trace: at System.Drawing.Bitmap..ctor(String filename) at MonoTests.System.Drawing.Imaging.IconCodecTest.Bitmap16Pixels() ``` 25552 area-System.Net enable multicast test on Fedora again https://github.com/dotnet/corefx/issues/24036 should fix the problem. @dotnet-bot test Outerloop Linux x64 Debug Build please @dotnet-bot test Outerloop Linux x64 Release Build please 25553 area-System.Runtime Expose/test double.TryFormat and float.TryFormat Depends on https://github.com/dotnet/coreclr/pull/15246 Depends on https://github.com/dotnet/corert/pull/5036 Fixes dotnet/corefx#25373 25554 area-Infrastructure Missing line numbers for NETFX test and code In at least some cases, eg https://github.com/dotnet/corefx/issues/25550 dumped: ``` Stack Trace: at System.Drawing.Bitmap..ctor(String filename) at MonoTests.System.Drawing.Imaging.IconCodecTest.Bitmap16Pixels() ``` May need someone to use the Helix repro tool to see why. 25557 area-System.Data fix ODBC build break on FreeBSD "Unlike some other assemblies where there is stub of UnknownUnix ODBC failed on FreeBSD. This fixes #25517 and it is part of #1626 Odbc on FreeBSD is same as Linux and comes from unixODBC package. With this ""./build.sh -OS=FreeBSD -SkipManagedPackageBuild"" works again on FreeBSD 11. " 25559 area-System.Diagnostics Make Process.Start wait for child process to exec on OSX OSX doesn't have pipe2. SystemNative_Pipe() is used instead. https://github.com/dotnet/corefx/pull/5421 this workaround seems only working on Linux. SystemNative_Pipe() can be used to allow OSX which doesn't have `pipe2()` to create `waitForChildToExecPipe` pipe with `FD_CLOEXEC` flag set during child process creation. Please review. Thanks. Fixes: https://github.com/dotnet/corefx/issues/23972 Refs: https://github.com/dotnet/corefx/pull/5421 25560 area-System.Net " Revert ""Minor change to avoid an allocation in Uri""" Fixes https://github.com/dotnet/corefx/issues/25548 While https://github.com/dotnet/corefx/pull/12061 looked simple, the removal of the allocation actually broke this behavior (and worse, broke string immutability) because the CheckSchemeSyntax method that's called actually mutates the `char*` that's passed in. This code was bad to begin with, as this was always (even in netfx) mutating a string instance, but that PR made it worse and broke this because it ends up passing in / mutating the original string rather than a copy that's mutated and then thrown away. The removal of the allocation can be re-done in a different way. For now, though, we need to revert. cc: @davidsh, @jamesqo 25561 area-System.Net Unsealing HttpRequestHeaders and HttpResponseHeaders "The built-in [HttpRequestHeaders](https://github.com/dotnet/corefx/blob/master/src/System.Net.Http/src/System/Net/Http/Headers/HttpRequestHeaders.cs) and [HttpResponseHeaders](https://github.com/dotnet/corefx/blob/master/src/System.Net.Http/src/System/Net/Http/Headers/HttpResponseHeaders.cs) types contain properties for many HTTP headers like `ExpectContinue`, `Host` and so on. It would be useful if users could add extend these types and add their own properties (maybe Acme Inc. uses a custom `X-Acme-Awesomeness` header for internal usage and wants to add a property for easy access). However, this can currently not be done since the types are sealed. The closest alternative is to use `GetValues(""X-Acme-Awesomeness"").First()`, which is messier. A good example is that `HttpResponseHeaders` does not contain a property for the HTTP `Set-Cookie` field. Another idea may be to wait to see if C# 8.0 includes extension properties, which would be a solution here." 25562 area-Serialization fix sgen if/else issue Port the if/else fix from SG to corefx. Fix another if/else issue when write member elements only when the total number of members is bigger than 1000. Fix #25248 @shmao @zhenlan @mconnew 25563 area-System.Net Ensure HttpListener request buffer is aligned as required by the host processor On Windows, the HttpRecieveHttpRequest function requires a buffer with a memory alignment greater than or equal to the required alignment of the HTTP_REQUEST struct. This fix ensures that alignment requirements are respected when allocating buffers in HttpListener RequestContextBase. Since HttpReceiveHttpRequest copies both the HTTP_REQUEST struct and the variable length request body into the buffer, we need to be able to allocate a buffer with variable size and with a set alignment. Since C# does not provide a method for specifying the alignment of byte arrays, I switched the underlying buffer to be unmanaged. This unmanaged buffer is allocated using Marshal.AllocHGlobal, which allocates memory at the maximum alignment required by the host processor. I'm new to writing code on the border between managed and unmanaged, and so I would appreciate any suggestions on how to improve things here. Fixes #25289 25565 area-Infrastructure Not For Merge This is to check whether dumpling and helix are creating dumps for hung processes 25566 area-System.Runtime Improve BinaryFormatter equality check logging If I could rewrite time I would have made all the equality checks with Assert... PS: the GitHub diff is useless here. 25567 area-Serialization Make the target works for exe. Fix #25320 @shmao @zhenlan @mconnew 25569 area-System.IO Proposed API for symbolic links # Rationale The ability to interact with symbolic links (symlinks) in .NET is currently limited to determining that a file is `ReparsePoint`. This proposed API provides the ability to identify, read, and create symbolic links. # Proposed API ```C# public class Directory { public static DirectoryInfo CreateSymbolicLink(string linkPath, string targetPath); public static string GetSymbolicLinkTargetPath(string linkPath); public static bool IsSymbolicLink(string path); } public class File { public static FileInfo CreateSymbolicLink(string linkPath, string targetPath); public static string GetSymbolicLinkTargetPath(string linkPath); public static bool IsSymbolicLink(string path); } public class FileSystemInfo { public bool IsSymbolicLink { get; } public string SymbolicLinkTargetPath { get; } public void CreateSymbolicLink(string linkPath); } ``` # Details The path returned from `GetSymbolicLinkTargetPath(string)`/`SymbolicLinkTargetPath` will be returned exactly as it is stored in the symbolic link. It may reference a non-existent file or directory. For the purposes of this API, NTFS Junction Points are considered to be like Linux bind mounts and are not considered to be symbolic links. # Updates - Move `GetSymbolicLinkTargetPath` and `IsSymbolicLink` from `Path` to `Directory`, `DirectoryInfo`, `File` and `FileInfo`. - Add `CreateSymbolicLink`. - Split from #24685. - Change `path` to `linkPath` where a link file's path is desired. - Move the APIs to the `FileSystemInfo` base class. 25572 area-System.Net .net core 2.0 calling Socket.Select caused high cpu usage. _From @zl-cn on November 29, 2017 5:54_ System: windows 10 Platform: .net core 2.0 under .net core 2.0 calling Socket.Select caused high cpu usage. but under .net 4.6 it's ok. simple code: while(true) { Socket.Select(checkRead, checkWrite, checkError, 0); if (checkError.Count == 0 && checkWrite.Count == 0 && checkRead.Count == 0) { Thread.Sleep(10); continue; } } _Copied from original issue: dotnet/coreclr#15264_ 25574 area-System.Net SslStream RemoteCertificateValidationCallback cannot access protocol/cipher info The `RemoteCertificateValidationCallback` is [documented](https://msdn.microsoft.com/en-us/library/ms145057(v=vs.110).aspx?f=255&mspperror=-2147217396#Anchor_2) as being able to access these values and potentially choose to reject the connection based on them: > The security protocol and cryptographic algorithms are already selected when the `userCertificateValidationCallback` delegate's method is invoked. You can use the method to determine whether the selected cryptographic algorithms and strengths are sufficient for your application. If not, the method should return false to prevent the `SslStream` from being created. Currently this doesn't work, because attempting to access them [throws an `InvalidOperationException`](https://github.com/dotnet/corefx/blob/master/src/System.Net.Security/src/System/Net/Security/SslState.cs#L244). Ideally, please can this be fixed to work as documented (I only skimmed the code briefly but I don't see any need for the `authSuccessCheck` here?). If it's not practical to make it work as advertised for some reason, please can the documentation be fixed - which I will happily do myself if someone points me in the direction of the right place to PR. N.B. I am trying to implement this with `AuthenticateAsServer()`, I haven't checked whether it may work as documented for a client-side stream, I will try it out when I can and update the issue if no-one else has checked it first. Related to https://github.com/dotnet/corefx/issues/24588 / https://github.com/dotnet/corefx/issues/21577 in the sense that if I was able to specify the cipher set that can be used, I wouldn't need to do this as I could simply disable the ciphers I want to disallow with high-level configuration rather than manually checking per-connection. 25575 area-System.Runtime DataTable serialization incorrectly depends on the Current Culture's Number Format Info "Ported manually from here https://github.com/Microsoft/dotnet/issues/471 (Zenhub doesn't allow moving issues between organizations) @logiclrd commented on Sep 1: We have a client reporting problems with our application because they have configured the Windows Region & Language settings to use the string ""()"" as the negative sign for number formatting. This seems to be traceable back to the fact that the DataTable in question has a custom schema that specifies negative values for the autoincrement seed & step. When DataTable is trying to deserialize the schema, it assumes that the quantity negative one should look like ""()1"" and therefore does not recognize the ""-1"" in the XML data. Some quick testing reveals that a DataTable serialized under these conditions produces correct XML representing ""-1"" as ""-1""; this issue affects only deserialization. This issue only comes up when properties in the table's schema have negative values. Negative values in the row data do not trigger the problem. Our client has informed us that this configuration is deliberate and desired. The only control we have over DataTable deserialization seems to be to override the entire process's CultureInfo.CurrentCulture, which in turn means that reports produced by our software will not use the ""()1"" format the client desires. There does not appear to be a way to work around this issue only for DataTable serialization/deserialization and without affecting other number formatting in the application. The following code reproduces the issue: ```csharp var serializer = new BinaryFormatter(); var table = new DataTable(); table.Columns.Add( new DataColumn(""RowID"", typeof(int)) { AutoIncrement = true, AutoIncrementSeed = -1, // These lines produce attributes within the schema portion of the underlying XML representation of the DataTable with the value ""-1"". AutoIncrementStep = -1, }); table.Columns.Add(""Value"", typeof(string)); table.Rows.Add(1, ""Test""); table.Rows.Add(2, ""Data""); var buffer = new MemoryStream(); serializer.Serialize(buffer, table); CultureInfo.CurrentCulture = new CultureInfo(""en-US"") { NumberFormat = new NumberFormatInfo() { NegativeSign = ""()"" // DataTable's deserialization incorrectly uses this to ascertain the number format for deserializing the schema properties. } }; buffer.Position = 0; var table2 = (DataTable)serializer.Deserialize(buffer); // System.Exception: ""-1 is not a valid value for Int64."" ``` cc @weshaggard @danmosemsft @richlander " 25578 area-System.Net Remove XunitShowProgress from System.Net.Sockets.Tests Shouldn't have been merged. It's spamming the log. 25579 area-System.Net Add basic Socket.IOControl implementation on Unix Socket.IOControl uses Windows-specific code values, both in terms of the actual code numbers and in terms of lots of them being Windows-specific functionality. But a few of the codes do translate across OSes in terms of functionality, and we've heard from at least a few developers who were using these codes and expected them to work on Unix. cc: @geoffkizer, @tmds 25580 area-Infrastructure DatasetExtensions is not in the compat pack Nor on Nuget. It looks like it was overlooked. We need to grab a signed version and put it up on Nuget. Also add to the pack authoring, but we don't need to republish the whole pack for this. @safern 25581 area-System.Net SslStream using intermediate CA certificates The SslStream class on Linux doesn't use the user personal certificate store to build the certificate chain I have create a simple client server test to reproduce the issue https://github.com/pepone/netstreamtest 25582 area-System.Runtime Make DateTIme.Now as efficient as DateTime.UtcNow @vancem commented on [Tue Sep 05 2017](https://github.com/dotnet/coreclr/issues/13789) I thought we fixed this but I just checked and we have not, so I am logging an issue. DateTime.Now is over 10X SLOWER than DateTime.UtcNow. I ran the the trivial program below ```c# var start = DateTime.Now; while ((DateTime.Now-start).TotalSeconds < 5) { } ``` while profiling with [PerfView](https://github.com/Microsoft/perfview) to get the following data Name | Inc % | Inc -- | -- | -- \|\| \|+ system.private.corelib!System.DateTime.get_Now() | 95.4 | 4,832 \|\| \| + system.private.corelib!TimeZoneInfo.GetDateTimeNowUtcOffsetFromUtc | 88.1 | 4,462 \|\| \| + system.private.corelib!System.DateTime.get_UtcNow() | 5.8 | 293 which show that only 6% of time is spent actually fetching the time, and 95% of the time was figuring out what time zone we are in. This mapping from Utc time to local time could be cached and all the inefficiency removed. This is important because people DO use DateTIme.Now to measure the durations of fast things (in fact we improved DateTime.UtcNow so that it has a accuracy of < 1msec). Currently we tell people to avoid DateTime.Now (use DateTime.UtcNow), to avoid this inefficiency, but we could easily make DateTIme.Now almost the same cost This is only a small amount of work, we should just do it. @danmosemsft , @karelz --- @mikedn commented on [Tue Sep 05 2017](https://github.com/dotnet/coreclr/issues/13789#issuecomment-327262909) > Currently we tell people to avoid DateTime.Now (use DateTime.UtcNow), to avoid this inefficiency I don't know about others but I avoid `DateTime.Now` not because it's inefficient but because it is plain wrong to use it to measure durations. Or more generally, to use it for anything that doesn't involve displaying the local time to the user... Let's keep `DateTime.Now` slow to encourage devs to do the right thing 😁 --- @karelz commented on [Tue Sep 05 2017](https://github.com/dotnet/coreclr/issues/13789#issuecomment-327279813) Marking as up-for-grabs. Moderate cost (as it requires perf measurements before and after the change) --- @danmosemsft commented on [Tue Sep 05 2017](https://github.com/dotnet/coreclr/issues/13789#issuecomment-327292376) > mapping from Utc time to local time could be cached Of course, daylight savings could begin one second from now so it presumably can't be trivially cached. @tarekgh is there a way that DateTime can be told when the local time offset changes, instead of asking each call? I'm sure there has been thinking about this in the past. --- @tarekgh commented on [Tue Sep 05 2017](https://github.com/dotnet/coreclr/issues/13789#issuecomment-327297374) > is there a way that DateTime can be told when the local time offset changes No, we don't have a way to know that. We looked before, and the way you can know that (on Windows) is either you have a Window and listen to some window message or you use WinRT API. Obviously, both are not a good solution for us. Also, it is difficult to know if we are passing the daylight saving at any moment to know we need to adjust the calculation (or the cache). We already have some optimization here: http://source.dot.net/#System.Private.CoreLib/src/System/TimeZoneInfo.Win32.cs,50 but we still doing the calculations here: http://source.dot.net/#System.Private.CoreLib/src/System/TimeZoneInfo.Win32.cs,402 because of we cannot know if we crossed the daylight or not. by the way, the optimization we have there has a bug. that can tell when trying to optimize, you can run into some other problems. --- @vancem commented on [Tue Sep 05 2017](https://github.com/dotnet/coreclr/issues/13789#issuecomment-327306683) On the caching issue: It seems to me that when you calculate daylight savings time, you can also know when it will change (at worst you probe say 4 hours into the future and see if it is different, since you know that daylight savings time only happens 2 a year, if you get the same number for now and 4 hours from now, you can know that for the next 4 hours it will not change). The next time you want Now you can then just check if the time is in the 'known' region and if so use the cached DST value. @mikedn - yes, arguably DateTime.Now is bad for computing deltas (since any time you cross DST, you get a weird value). However giving bad perf does not actually change behavior, it just makes their code that much worse. There are also correct usages (when you just want a timestamp). The bottom line is that if people use it at all frequently (and we have evidence that they do), it is worth optimizing. --- @tarekgh commented on [Tue Sep 05 2017](https://github.com/dotnet/coreclr/issues/13789#issuecomment-327316508) @vancem yes, in general, I agree there is a way we can optimize. we just want to be careful to not affect the functionality and not have a complex solution. To mention, instead of probing for some time (4 hours in your example) we can just calculate the exact time we are going to switch the daylight when we create the cache. and then we always check against this time to know if we need to update the cache or just use the cached offset. --- @danmosemsft commented on [Tue Sep 05 2017](https://github.com/dotnet/coreclr/issues/13789#issuecomment-327320861) If the machine time zone changes, do we need to listen to that? --- @tarekgh commented on [Tue Sep 05 2017](https://github.com/dotnet/coreclr/issues/13789#issuecomment-327322383) > If the machine time zone changes, do we need to listen to that? Same answer: ``` No, we don't have a way to know that. We looked before, and the way you can know that (on Windows) is either you have a Window and listen to some window message or you use WinRT API. Obviously, both are not a good solution for us. ``` Today we ask the apps to listen to the TZ changes on the machine and then call us to clear the cache. --- @danmosemsft commented on [Wed Nov 29 2017](https://github.com/dotnet/coreclr/issues/13789#issuecomment-348010037) Moving to CoreFX to track more easily. 25586 area-Infrastructure Create new property for OfficialBuildLeg and set it for offline build "When doing an offline build, we need the identity package and runtime package to be built. Adding an ""OfficialBuildLeg"" property and setting it based on OfficialBuildId being set or an OfflineBuild being in progress." 25588 area-System.Net System.IO.FileNotFoundException: Could not load file or assembly 'System.Net.Http, Version=4.1.1.0 "I recently created a .NET Core 2.0 library that multitargeted `net46`. It included this in the .csproj file: ``` <ItemGroup Condition=""'$(TargetFramework)'=='net46'""> <Reference Include=""System.Net.Http"" /> </ItemGroup> <ItemGroup Condition=""'$(TargetFramework)'=='netstandard2.0'""> <PackageReference Include=""System.Net.Http"" Version=""4.3.3"" /> <PackageReference Include=""System.Net.Primitives"" Version=""4.3.0"" /> <PackageReference Include=""System.Net.Requests"" Version=""4.3.0"" /> <PackageReference Include=""System.Net.Sockets"" Version=""4.3.0"" /> </ItemGroup> ``` I referenced this library is a .NET Framework 4.7 console app and get this exception: ``` Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. ``` I didn't see any warnings in the error list, but I decided to check the build log and found a conflict. This is what I see in the detailed build log: ``` 1> There was a conflict between ""System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" and ""System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"". 1> ""System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" was chosen because it was primary and ""System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" was not. 1> References which depend on ""System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" [C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.Net.Http.dll]. 1> C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.Net.Http.dll 1> Project file item includes which caused reference ""C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.Net.Http.dll"". 1> System.Net.Http ``` My `App.config` includes a redirect which should have been used ``` <dependentAssembly> <assemblyIdentity name=""System.Net.Http"" publicKeyToken=""b03f5f7f11d50a3a"" culture=""neutral"" /> <bindingRedirect oldVersion=""0.0.0.0-4.1.1.0"" newVersion=""4.1.1.0"" /> </dependentAssembly> ``` What I don't fully understand in why System.Net.Http includes a reference to itself. Is this corruption of some sort or am I missing something?" 25590 area-System.Runtime Concurrent Dictionary for BinaryFormatters Fixes #25529 25591 area-System.Reflection Assembly.Load doesn't work for ASP.NET Core Web Application assembly targeting at net461 "Repro Step: 1. Create a ASP.NET Core Web Application targeting at net461. 2. Create a console app targeting netcoreapp2.0. 3. Use Assembly.Load to load the asp.net core app assembly created in step#1. I will get the FileLoadException ""Could not load file or assembly ..."". Is it expected?" 25595 area-Microsoft.CSharp Test failure: Microsoft.Internal.GenerationServicesTests/EnumType Opened on behalf of @Sunny-pu The test `Microsoft.Internal.GenerationServicesTests/EnumType` has failed. System.MissingMethodException : Method 'DynamicMethod..ctor(string, Type, Type[])' from assembly 'System.Reflection.Emit.Lightweight' was not included in compilation, but was referenced in GenerationServicesTests.CreateValueGenerator(T). There may have been a missing assembly, or a dependency on a more recent Windows SDK release. Stack Trace: at Microsoft.Internal.GenerationServicesTests.TestSuccessfulValueGeneration<System.UInt32>(UInt32 value) at Microsoft.Internal.GenerationServicesTests.EnumType() in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\tests\System\ComponentModel\Composition\GenerationServicesTests.cs:line 66 at _$ILCT$.$ILT$ReflectionDynamicInvoke$.InvokeRetV(Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean targetIsThisCall) at System.InvokeUtils.CalliIntrinsics.Call(IntPtr dynamicInvokeHelperMethod, Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean isTargetThisCall) at System.InvokeUtils.CallDynamicInvokeMethod(Object thisPtr, IntPtr methodToCall, Object thisPtrDynamicInvokeMethod, IntPtr dynamicInvokeHelperMethod, IntPtr dynamicInvokeHelperGenericDictionary, Object targetMethodOrDelegate, Object[] parameters, BinderBundle binderBundle, Boolean wrapInTargetInvocationException, Boolean invokeMethodHelperIsThisCall, Boolean methodToCallIsThisCall) in CallDynamicInvokeMethod:line 16707566 Build : Master - 20171130.02 (UWP ILC Tests) Failing configurations: - Windows.10.Amd64.ClientRS3-x86 - Release - Windows.10.Amd64.ClientRS3-x64 - Release 25596 area-System.ComponentModel Test failure: System.ComponentModel.Composition.AdaptingCollectionTests/TestDyamicallyFilteringImports Opened on behalf of @Sunny-pu The test `System.ComponentModel.Composition.AdaptingCollectionTests/TestDyamicallyFilteringImports` has failed. System.NullReferenceException : Object reference not set to an instance of an object. Stack Trace: at System.ComponentModel.Composition.ExportServices.CreateStronglyTypedLazyFactory(Type exportType, Type metadataViewType) in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\ExportServices.cs:line 57 at System.ComponentModel.Composition.ReflectionModel.ImportType.TryGetCastFunction(Type genericType, Boolean isOpenGeneric, Type[] arguments, Func$2<$Export,Object>& castFunction) in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\ReflectionModel\ImportType.cs:line 169 at System.ComponentModel.Composition.ReflectionModel.ImportType.Initialize(Type type) in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\ReflectionModel\ImportType.cs:line 135 at System.ComponentModel.Composition.ReflectionModel.ImportType..ctor(Type type, $ImportCardinality cardinality) in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\ReflectionModel\ImportType.cs:line 52 at System.ComponentModel.Composition.AttributedModel.AttributedModelDiscovery.CreateMemberImportDefinition(MemberInfo member, $ICompositionElement origin) in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\AttributedModel\AttributedModelDiscovery.cs:line 115 at System.ComponentModel.Composition.AttributedModel.AttributedPartCreationInfo.GetImportDefinitions() in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\AttributedModel\AttributedPartCreationInfo.cs:line 429 at System.ComponentModel.Composition.AttributedModel.AttributedPartCreationInfo.DiscoverExportsAndImports() in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\AttributedModel\AttributedPartCreationInfo.cs:line 256 at System.ComponentModel.Composition.AttributedModel.AttributedPartCreationInfo.GetExports() in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\AttributedModel\AttributedPartCreationInfo.cs:line 64 at System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePartDefinition.get_ExportDefinitionsInternal() in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\ReflectionModel\ReflectionComposablePartDefinition.cs:line 65 at System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.get_ExportDefinitions() in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\ReflectionModel\ReflectionComposablePart.cs:line 144 at System.ComponentModel.Composition.Factories.ExportProviderFactory.RecomposableExportProvider.<>c.<ChangeExports>b__5_1($Export export) in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\Hosting\ComposablePartExportProvider.cs:line 371 at System.ComponentModel.Composition.MetadataViewGenerator.MetadataViewFactory.Invoke(IDictionary$2<String,Object> metadata) in Invoke:line 16707566 at System.Linq.Enumerable.SelectManySingleSelectorIterator$2<System.__Canon,System.__Canon>.ToArray() in E:\A\_work\356\s\corefx\src\System.Linq\src\System\Linq\SelectMany.cs:line 232 at System.Linq.Enumerable.ToArray<System.__Canon>(IEnumerable$1<__Canon> source) in E:\A\_work\356\s\corefx\src\System.Linq\src\System\Linq\ToCollection.cs:line 18 at System.ComponentModel.Composition.Hosting.ComposablePartExportProvider.Recompose($CompositionBatch batch, $AtomicComposition atomicComposition) in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\Hosting\ComposablePartExportProvider.cs:line 370 at System.ComponentModel.Composition.Hosting.ComposablePartExportProvider.Compose($CompositionBatch batch) in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\Hosting\ComposablePartExportProvider.cs:line 273 at System.ComponentModel.Composition.Hosting.CompositionContainer.Compose($CompositionBatch batch) in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\Hosting\CompositionContainer.cs:line 397 at System.ComponentModel.Composition.AttributedModelServices.ComposeParts($CompositionContainer container, Object[] attributedParts) in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\AttributedModelServices.cs:line 169 at System.ComponentModel.Composition.AdaptingCollectionTests.TestDyamicallyFilteringImports() in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\tests\System\Integration\AdaptingCollectionTests.cs:line 351 at _$ILCT$.$ILT$ReflectionDynamicInvoke$.InvokeRetV(Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean targetIsThisCall) at System.InvokeUtils.CalliIntrinsics.Call(IntPtr dynamicInvokeHelperMethod, Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean isTargetThisCall) at System.InvokeUtils.CallDynamicInvokeMethod(Object thisPtr, IntPtr methodToCall, Object thisPtrDynamicInvokeMethod, IntPtr dynamicInvokeHelperMethod, IntPtr dynamicInvokeHelperGenericDictionary, Object targetMethodOrDelegate, Object[] parameters, BinderBundle binderBundle, Boolean wrapInTargetInvocationException, Boolean invokeMethodHelperIsThisCall, Boolean methodToCallIsThisCall) in CallDynamicInvokeMethod:line 16707566 Build : Master - 20171130.02 (UWP ILC Tests) Failing configurations: - Windows.10.Amd64.ClientRS3-x86 - Release - Windows.10.Amd64.ClientRS3-x64 - Release 25597 area-System.ComponentModel Test failure: System.ComponentModel.Composition.CatalogFilteringTests/FilteredCatalog_ScopeB Opened on behalf of @Sunny-pu The test `System.ComponentModel.Composition.CatalogFilteringTests/FilteredCatalog_ScopeB` has failed. System.InvalidOperationException : There is no metadata token available for the given member. Stack Trace: at System.Reflection.Runtime.TypeInfos.RuntimeNoMetadataNamedTypeInfo.get_MetadataToken() in f:\dd\ndp\fxcore\CoreRT\src\System.Private.Reflection.Core\src\System\Reflection\Runtime\MethodInfos\RuntimeSyntheticMethodInfo.cs:line 146 at System.ComponentModel.Composition.ReflectionModel.ReflectionMemberExportDefinition.GetIndex() in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\ReflectionModel\ReflectionMemberExportDefinition.cs:line 67 at System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.GetExportingMemberFromDefinition($ExportDefinition definition) in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\ReflectionModel\ReflectionComposablePart.cs:line 567 at System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.<RequiresActivation>b__39_0($ExportDefinition definition) in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\ReflectionModel\ReflectionComposablePart.cs:line 352 at System.Func$2<System.__Canon,System.Int32>.Invoke(__Canon arg) in Invoke:line 16707566 at System.Linq.Enumerable.Any<System.__Canon>(IEnumerable$1<__Canon> source, Func$2<__Canon,Boolean> predicate) in E:\A\_work\356\s\corefx\src\System.Linq\src\System\Linq\AnyAll.cs:line 38 at System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.RequiresActivation() in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\ReflectionModel\ReflectionComposablePart.cs:line 350 at System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.GetInstanceActivatingIfNeeded() in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\ReflectionModel\ReflectionComposablePart.cs:line 267 at System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.NotifyImportSatisfied() in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\ReflectionModel\ReflectionComposablePart.cs:line 526 at System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.Activate() in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\ReflectionModel\ReflectionComposablePart.cs:line 214 at System.ComponentModel.Composition.Hosting.ImportEngine.PartManager.TryOnComposed() in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\Hosting\ImportEngine.PartManager.cs:line 139 at System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImportsStateMachine($PartManager partManager, $ComposablePart part) in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\Hosting\ImportEngine.cs:line 369 at System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImports($PartManager partManager, $ComposablePart part, Boolean shouldTrackImports) in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\Hosting\ImportEngine.cs:line 435 at System.ComponentModel.Composition.Hosting.ImportEngine.SatisfyImports($ComposablePart part) in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\Hosting\ImportEngine.cs:line 172 at System.ComponentModel.Composition.Hosting.CompositionServices.GetExportedValueFromComposedPart($ImportEngine engine, $ComposablePart part, $ExportDefinition definition) in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\Hosting\CompositionServices.cs:line 537 at System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportedValue($CatalogPart part, $ExportDefinition export, Boolean isSharedPart) in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\Hosting\CatalogExportProvider.cs:line 536 at System.ComponentModel.Composition.Hosting.CatalogExportProvider.CatalogExport.GetExportedValueCore() in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\Hosting\CatalogExportProvider.CatalogExport.cs:line 61 at System.ComponentModel.Composition.Primitives.Export.get_Value() in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\Primitives\Export.cs:line 207 at System.ComponentModel.Composition.ExportServices.GetCastedExportedValue<System.__Canon>($Export export) in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\ExportServices.cs:line 134 at System.ComponentModel.Composition.Hosting.ExportProvider.GetExportedValueCore<System.__Canon>(String contractName, $ImportCardinality cardinality) in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\Hosting\ExportProvider.GetExportOverrides.cs:line 735 at System.ComponentModel.Composition.CompositionContainerExtensions.IsPresent<System.__Canon>($CompositionContainer container) in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\tests\System\ComponentModel\Composition\CompositionContainerExtensions.cs:line 17 at System.ComponentModel.Composition.CatalogFilteringTests.FilteredCatalog_ScopeB() in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\tests\System\Integration\CatalogFilteringTests.cs:line 33 at _$ILCT$.$ILT$ReflectionDynamicInvoke$.InvokeRetV(Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean targetIsThisCall) at System.InvokeUtils.CalliIntrinsics.Call(IntPtr dynamicInvokeHelperMethod, Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean isTargetThisCall) at System.InvokeUtils.CallDynamicInvokeMethod(Object thisPtr, IntPtr methodToCall, Object thisPtrDynamicInvokeMethod, IntPtr dynamicInvokeHelperMethod, IntPtr dynamicInvokeHelperGenericDictionary, Object targetMethodOrDelegate, Object[] parameters, BinderBundle binderBundle, Boolean wrapInTargetInvocationException, Boolean invokeMethodHelperIsThisCall, Boolean methodToCallIsThisCall) in CallDynamicInvokeMethod:line 16707566 Build : Master - 20171130.02 (UWP ILC Tests) Failing configurations: - Windows.10.Amd64.ClientRS3-x86 - Release - Windows.10.Amd64.ClientRS3-x64 - Release 25598 area-System.ComponentModel Test failure: System.ComponentModel.Composition.CompositionErrorIdTests/CompositionErrorIdsAreInSyncWithErrorIds Opened on behalf of @Sunny-pu The test `System.ComponentModel.Composition.CompositionErrorIdTests/CompositionErrorIdsAreInSyncWithErrorIds` has failed. Assert.Equal() Failure\r Expected: Unknown\r Actual: (null) Stack Trace: at System.UnitTesting.ExtendedAssert.EnumsContainSameValuesCore<System.ComponentModel.Composition.ErrorId, System.ComponentModel.Composition.CompositionErrorId>() in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\tests\System\ComponentModel\Composition\UnitTesting\ExtendedAssert.cs:line 30 at System.ComponentModel.Composition.CompositionErrorIdTests.CompositionErrorIdsAreInSyncWithErrorIds() in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\tests\System\ComponentModel\Composition\CompositionErrorIdTests.cs:line 15 at _$ILCT$.$ILT$ReflectionDynamicInvoke$.InvokeRetV(Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean targetIsThisCall) at System.InvokeUtils.CalliIntrinsics.Call(IntPtr dynamicInvokeHelperMethod, Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean isTargetThisCall) at System.InvokeUtils.CallDynamicInvokeMethod(Object thisPtr, IntPtr methodToCall, Object thisPtrDynamicInvokeMethod, IntPtr dynamicInvokeHelperMethod, IntPtr dynamicInvokeHelperGenericDictionary, Object targetMethodOrDelegate, Object[] parameters, BinderBundle binderBundle, Boolean wrapInTargetInvocationException, Boolean invokeMethodHelperIsThisCall, Boolean methodToCallIsThisCall) in CallDynamicInvokeMethod:line 16707566 Build : Master - 20171130.02 (UWP ILC Tests) Failing configurations: - Windows.10.Amd64.ClientRS3-x86 - Release - Windows.10.Amd64.ClientRS3-x64 - Release 25599 area-System.ComponentModel Test failure: System.ComponentModel.Composition.Diagnostics.CompositionTraceIdTests/CompositionTraceIdsAreInSyncWithTraceIds Opened on behalf of @Sunny-pu The test `System.ComponentModel.Composition.Diagnostics.CompositionTraceIdTests/CompositionTraceIdsAreInSyncWithTraceIds` has failed. Assert.Equal() Failure\r Expected: Rejection_DefinitionRejected\r Actual: (null) Stack Trace: at System.UnitTesting.ExtendedAssert.EnumsContainSameValuesCore<System.ComponentModel.Composition.Diagnostics.TraceId, System.ComponentModel.Composition.Diagnostics.CompositionTraceId>() in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\tests\System\ComponentModel\Composition\UnitTesting\ExtendedAssert.cs:line 30 at System.ComponentModel.Composition.Diagnostics.CompositionTraceIdTests.CompositionTraceIdsAreInSyncWithTraceIds() in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\tests\System\ComponentModel\Composition\Diagnostics\CompositionTraceIdTests.cs:line 15 at _$ILCT$.$ILT$ReflectionDynamicInvoke$.InvokeRetV(Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean targetIsThisCall) at System.InvokeUtils.CalliIntrinsics.Call(IntPtr dynamicInvokeHelperMethod, Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean isTargetThisCall) at System.InvokeUtils.CallDynamicInvokeMethod(Object thisPtr, IntPtr methodToCall, Object thisPtrDynamicInvokeMethod, IntPtr dynamicInvokeHelperMethod, IntPtr dynamicInvokeHelperGenericDictionary, Object targetMethodOrDelegate, Object[] parameters, BinderBundle binderBundle, Boolean wrapInTargetInvocationException, Boolean invokeMethodHelperIsThisCall, Boolean methodToCallIsThisCall) in CallDynamicInvokeMethod:line 16707566 Build : Master - 20171130.02 (UWP ILC Tests) Failing configurations: - Windows.10.Amd64.ClientRS3-x86 - Release - Windows.10.Amd64.ClientRS3-x64 - Release 25600 area-System.ComponentModel Test failure: System.ComponentModel.Composition.Hosting.FilteredCatalogTransitiveClosureTests/IncludeDependenciesChainWithCycles Opened on behalf of @Sunny-pu The test `System.ComponentModel.Composition.Hosting.FilteredCatalogTransitiveClosureTests/IncludeDependenciesChainWithCycles` has failed. System.Reflection.MissingMetadataException : This operation cannot be carried out because metadata for the following object was removed for performance reasons:\ \ EETypeRva:0x000331C0\ \ No further information is available. Rebuild in debug mode for better information.\ \ Stack Trace: at System.Reflection.Runtime.TypeInfos.RuntimeNoMetadataNamedTypeInfo.CoreGetDeclaredNestedTypes($NameFilter optionalNameFilter) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.Reflection.Core\src\System\Reflection\Runtime\TypeInfos\RuntimeBlockedTypeInfo.cs:line 229 at System.Linq.EnumerableRewriter.GetPublicType(Type t) in E:\A\_work\356\s\corefx\src\System.Linq.Queryable\src\System\Linq\EnumerableRewriter.cs:line 125 at System.Linq.EnumerableRewriter.VisitConstant($ConstantExpression c) in E:\A\_work\356\s\corefx\src\System.Linq.Queryable\src\System\Linq\EnumerableRewriter.cs:line 202 at System.Linq.Expressions.ConstantExpression.Accept($ExpressionVisitor visitor) in E:\A\_work\356\s\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\ConstantExpression.cs:line 55 at System.Linq.Expressions.ExpressionVisitor.Visit(ReadOnlyCollection$1<$Expression> nodes) in E:\A\_work\356\s\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\ExpressionVisitor.cs:line 48 at System.Linq.EnumerableRewriter.VisitMethodCall($MethodCallExpression m) in E:\A\_work\356\s\corefx\src\System.Linq.Queryable\src\System\Linq\EnumerableRewriter.cs:line 25 at System.Linq.Expressions.MethodCallExpression.Accept($ExpressionVisitor visitor) in E:\A\_work\356\s\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\MethodCallExpression.cs:line 109 at System.Linq.EnumerableExecutor$1<System.Int32>.Execute() in E:\A\_work\356\s\corefx\src\System.Linq.Queryable\src\System\Linq\EnumerableExecutor.cs:line 38 at System.Linq.EnumerableQuery$1<System.__Canon>.System.Linq.IQueryProvider.Execute<System.Int32>($Expression expression) in E:\A\_work\356\s\corefx\src\System.Linq.Queryable\src\System\Linq\EnumerableQuery.cs:line 100 at System.Linq.Queryable.Count<System.__Canon>($IQueryable$1<__Canon> source) in E:\A\_work\356\s\corefx\src\System.Linq.Queryable\src\System\Linq\Queryable.cs:line 999 at System.ComponentModel.Composition.Hosting.FilteredCatalogTransitiveClosureTests.IncludeDependenciesChainWithCycles() in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\tests\System\ComponentModel\Composition\Hosting\FilteredCatalogTransitiveClosureTests.cs:line 236 at _$ILCT$.$ILT$ReflectionDynamicInvoke$.InvokeRetV(Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean targetIsThisCall) at System.InvokeUtils.CalliIntrinsics.Call(IntPtr dynamicInvokeHelperMethod, Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean isTargetThisCall) at System.InvokeUtils.CallDynamicInvokeMethod(Object thisPtr, IntPtr methodToCall, Object thisPtrDynamicInvokeMethod, IntPtr dynamicInvokeHelperMethod, IntPtr dynamicInvokeHelperGenericDictionary, Object targetMethodOrDelegate, Object[] parameters, BinderBundle binderBundle, Boolean wrapInTargetInvocationException, Boolean invokeMethodHelperIsThisCall, Boolean methodToCallIsThisCall) in CallDynamicInvokeMethod:line 16707566 Build : Master - 20171130.02 (UWP ILC Tests) Failing configurations: - Windows.10.Amd64.ClientRS3-x86 - Release - Windows.10.Amd64.ClientRS3-x64 - Release 25601 area-System.ComponentModel Test failure: System.ComponentModel.Composition.ImportEngineTests/PreviewImports_ReleaseImports_ShouldNotBlockChanges Opened on behalf of @Sunny-pu The test `System.ComponentModel.Composition.ImportEngineTests/PreviewImports_ReleaseImports_ShouldNotBlockChanges` has failed. Assert.Throws() Failure\r Expected: typeof(System.ComponentModel.Composition.ChangeRejectedException)\r Actual: typeof(System.ArgumentNullException): Value cannot be null.\r Parameter name: source Stack Trace: at System.Linq.Enumerable.ToArray<System.__Canon>(IEnumerable$1<__Canon> source) in E:\A\_work\404\s\corefx\src\System.Linq\src\System\Linq\ToCollection.cs:line 15 at System.ComponentModel.Composition.Hosting.ImportEngine.TryRecomposeImport($PartManager partManager, Boolean partComposed, $ImportDefinition import, $AtomicComposition atomicComposition) in E:\A\_work\404\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\Hosting\ImportEngine.cs:line 584 at System.ComponentModel.Composition.Hosting.ImportEngine.TryRecomposeImports($PartManager partManager, IEnumerable$1<$ExportDefinition> changedExports, $AtomicComposition atomicComposition) in E:\A\_work\404\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\Hosting\ImportEngine.cs:line 545 at System.ComponentModel.Composition.Hosting.ImportEngine.OnExportsChanging(Object sender, $ExportsChangeEventArgs e) in E:\A\_work\404\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\Hosting\ImportEngine.cs:line 514 at System.Action$2<System.__Canon,System.__Canon>.Invoke(__Canon arg1, __Canon arg2) in Invoke:line 16707566 at System.ComponentModel.Composition.Hosting.CompositionServices.TryFire<System.__Canon>(EventHandler$1<__Canon> _delegate, Object sender, __Canon e) in E:\A\_work\404\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\Hosting\CompositionServices.cs:line 581 at System.ComponentModel.Composition.Hosting.ExportProvider.OnExportsChanging($ExportsChangeEventArgs e) in E:\A\_work\404\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\Hosting\ExportProvider.cs:line 202 at System.ComponentModel.Composition.Factories.ExportProviderFactory.RecomposableExportProvider.ChangeExports(List$1<$Export> newExports) in E:\A\_work\404\s\corefx\src\System.ComponentModel.Composition\tests\System\ComponentModel\Composition\Factories\ExportProviderFactory.RecomposableExportProvider.cs:line 64 at System.ComponentModel.Composition.Factories.ExportProviderFactory.RecomposableExportProvider.AddExport(String contractName, Object value) in E:\A\_work\404\s\corefx\src\System.ComponentModel.Composition\tests\System\ComponentModel\Composition\Factories\ExportProviderFactory.RecomposableExportProvider.cs:line 26 at System.ComponentModel.Composition.ImportEngineTests.<>c__DisplayClass5_0.<PreviewImports_ReleaseImports_ShouldNotBlockChanges>b__0() in E:\A\_work\404\s\corefx\src\System.ComponentModel.Composition\tests\System\ComponentModel\Composition\Hosting\ImportEngineTests.cs:line 141 Build : Master - 20171130.02 (UWP ILC Tests) Failing configurations: - Windows.10.Amd64.ClientRS3-x64 - Release 25602 area-System.ComponentModel Test failure: System.ComponentModel.Composition.MetadataViewProviderTests/GetMetadataView_AbstractClassWithConstructor_ShouldThrowMemberAccessException Opened on behalf of @Sunny-pu The test `System.ComponentModel.Composition.MetadataViewProviderTests/GetMetadataView_AbstractClassWithConstructor_ShouldThrowMemberAccessException` has failed. Assert.Throws() Failure\r Expected: typeof(System.MemberAccessException)\r Actual: typeof(System.ComponentModel.Composition.CompositionContractMismatchException): Unable to create an instance of the Metadata view 'System.ComponentModel.Composition.MetadataViewProviderTests+AbstractClassWithConstructorMetadataView, System.ComponentModel.Composition.Tests, Version=4.0.0.0, Culture=neutral, PublicKeyToken=9d77cc7ad39b68eb' because a constructor could not be selected. Ensure that the type implements a constructor which takes an argument of type IDictionary<string, object>. Stack Trace: at System.ComponentModel.Composition.MetadataViewProvider.GetMetadataView<System.__Canon>$catch$1() in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\src\System\ComponentModel\Composition\MetadataViewProvider.cs:line 89 at System.ComponentModel.Composition.MetadataViewProviderTests.<>c__DisplayClass5_0.<GetMetadataView_AbstractClassWithConstructor_ShouldThrowMemberAccessException>b__0() in E:\A\_work\356\s\corefx\src\System.ComponentModel.Composition\tests\System\ComponentModel\Composition\MetadataViewProviderTests.cs:line 119 at System.Action.Invoke() in Invoke:line 16707566 Build : Master - 20171130.02 (UWP ILC Tests) Failing configurations: - Windows.10.Amd64.ClientRS3-x86 - Release - Windows.10.Amd64.ClientRS3-x64 - Release 25603 area-System.Threading Add Run(Func<Task>) overload to TaskFactory Could be convenient and more consistent with [`Task`](https://msdn.microsoft.com/en-us/library/system.threading.tasks.task.run%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396). 25605 area-Meta Dispose should not throw PlatformNotSupportedException even when the type is not supported As reported by @ayende in [a blog post](https://ayende.com/blog/180641/if-you-have-a-finalizer-watch-your-ctor?Key=e518b670-167f-4582-afaa-0e201896bd4f), some types throw `PlatformNotSupportedException` from `Dispose(bool disposing)` on platforms that are not supported. This is problematic, because: 1. The big issue: The finalizer of a base class of some of those types (like `Component`) calls `Dispose(false)`, which causes the process to crash. 2. The smaller issue: It's against [the Framework Design Guidelines](https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/dispose-pattern#basic-dispose-pattern): > X AVOID throwing an exception from within `Dispose(bool)` except under critical situations where the containing process has been corrupted (leaks, inconsistent shared state, etc.). > > Users expect that a call to `Dispose` will not raise an exception. I think this applies even for types that are not supported. The original example was `SqlConnection`, but I think a simpler repro is with `SerialPort`, which is not supported on .Net Core on Linux: 0. The following should apply to any Linux machine with .Net Core installed (in my case, Ubuntu 16.04 and .Net Core SDK 2.0.3). 1. `dotnet new console` 2. `dotnet add package System.IO.Ports` 3. Change `Program.cs` to: ```c# using System; using System.IO.Ports; class Program { static void Main() { try { new SerialPort(); } catch (Exception ex) { Console.WriteLine(ex); } // to simulate GC and subsequent finalization at some point in the future GC.Collect(); GC.WaitForPendingFinalizers(); } } ``` 4. Run it in Release mode (to make sure the finalizer is run): `dotnet run -c Release` 5. The program first correctly catches the exception thrown from the `SerialPort` constructor, but then it crashes: ``` System.PlatformNotSupportedException: System.IO.Ports is currently only supported on Windows. at System.IO.Ports.SerialPort..ctor() at Program.Main() in /home/osboxes/hwapp/Program.cs:line 10 Unhandled Exception: System.PlatformNotSupportedException: System.IO.Ports is currently only supported on Windows. at System.IO.Ports.SerialPort.Dispose(Boolean disposing) at System.ComponentModel.Component.Finalize() ``` I think that for unsupported types, `Dispose` should be empty. It should not throw, to avoid crash that cannot be prevented (and to follow Framework Design Guidelines). 25606 area-System.ComponentModel Skipping test on uap Relates to #25498 cc: @danmosemsft @safern 25607 area-System.IO System.IO.Compression compatability issues "Hi, I have a project, using 4.6.1 with the new project format, which creates nuget packages (the idea being we will eventually change to target .NETStandard 2.0). I have another project, which is using 4.6.1 with the traditional xml project format, which consumes that package. This project uses System.IO.Compression.ZipFile to extract the contents of uploaded zips. This is where the problems start to happen though; 1) On my development machine, where I have installed the .NET 2.0 SDKS, I have to do an assembly redirect of version 4.1.2.0 of System.IO.Compression to 4.2.0.0. This seems to resolve the problems for me. However, on other machines, where the SDK is not installed, but the 461 runtime is installed, this fails with `System.IO.FileLoadException: Could not load file or assembly 'System.IO.Compression, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) ---> System.IO.FileLoadException: Could not load file or assembly 'System.IO.Compression, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its depend encies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)` 2) If I do not do the redirect (and in fact, just redirect down to 4.1.2.0), it works on the other machines, but fails for me with `Could not load file or assembly 'System.IO.Compression, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)` I should point out that prior to importing the 461 package, the code was using 4.1.2.0 happily. If it helps, here is the project file for the package - you'll note there is no reference to System.IO.Compression or System.IO.Compression.FileSystem; ```xml <Project Sdk=""Microsoft.NET.Sdk""> <PropertyGroup Condition=""'$(Configuration)|$(Platform)'=='Release|AnyCPU'""> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <WarningsAsErrors /> </PropertyGroup> <PropertyGroup> <TargetFramework>net461</TargetFramework> <DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences> <OutputType>Library</OutputType> </PropertyGroup> <PropertyGroup Condition=""'$(Configuration)|$(Platform)'=='Debug|AnyCPU'""> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <WarningsAsErrors /> </PropertyGroup> <ItemGroup> <PackageReference Include=""AWSSDK.IdentityManagement"" Version=""3.3.5.3"" /> <PackageReference Include=""AWSSDK.S3"" Version=""3.3.12.1"" /> <PackageReference Include=""Dapper"" Version=""1.50.2"" /> <PackageReference Include=""Microsoft.AspNetCore.Http.Abstractions"" Version=""2.0.0"" /> <PackageReference Include=""Microsoft.CSharp"" Version=""4.4.0"" /> <PackageReference Include=""System.Configuration.ConfigurationManager"" Version=""4.4.0"" /> <PackageReference Include=""System.Security.Cryptography.ProtectedData"" Version=""4.4.0"" /> </ItemGroup> <ItemGroup> <Reference Include=""Security.Cryptography""> <HintPath>..\packages\Security.Cryptography.1.7.2\lib\net35\Security.Cryptography.dll</HintPath> </Reference> <Reference Include=""System.Core"" /> <Reference Include=""System.Runtime.Caching"" /> </ItemGroup> </Project> ``` My worry is that I can only seem to fix this by installing the SDK - which is not something I'd anticipate doing on our production systems. " 25610 area-Serialization Area-Serialization Sprint 128 The issue is for tracking issues to be done in sprint 128 (due by 12/21/2017) 25613 area-System.IO Unix file enumerator isn't thread safe New test in #25426 uncovered this. ``` Unhandled Exception of Type System.NullReferenceException Message : System.NullReferenceException : Object reference not set to an instance of an object. Stack Trace : at Interop.Sys.ReadDir(SafeDirectoryHandle dir, DirectoryEntry& outputEntry) at System.IO.UnixFileSystem.FileSystemEnumerable`1.<Enumerate>d__11.MoveNext() at System.IO.Tests.Regressions.ThreadSafeRepro.Race(IEnumerator`1 s) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.IO.FileSystem/tests/Directory/Regressions.cs:line 30 at System.IO.Tests.Regressions.ThreadSafeRepro.Execute(String directory) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.IO.FileSystem/tests/Directory/Regressions.cs:line 53 at System.IO.Tests.Regressions.FileEnumeratorIsThreadSafe() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.IO.FileSystem/tests/Directory/Regressions.cs:line 21 ``` 25614 area-System.Runtime system.valuetuple in .nuget conflicts with system.valuetuple in Microsoft.NET.Build.Extensions. I have a solution that mixes .net standard and .net framework projects. I encountered the following error: ``` 10> Encountered conflict between 'Reference:C:\Users\Zhivko\.nuget\packages\system.valuetuple\4.4.0\ref\net47\System.ValueTuple.dll' and 'Reference:C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\\net47\ref\System.ValueTuple.dll'. Choosing 'Reference:C:\Users\Zhivko\.nuget\packages\system.valuetuple\4.4.0\ref\net47\System.ValueTuple.dll' because file version '4.6.25519.3' is greater than '4.6.25514.4'. 10> Encountered conflict between 'CopyLocal:C:\Users\Zhivko\.nuget\packages\system.valuetuple\4.4.0\lib\net47\System.ValueTuple.dll' and 'CopyLocal:C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\\net47\lib\System.ValueTuple.dll'. Choosing 'CopyLocal:C:\Users\Zhivko\.nuget\packages\system.valuetuple\4.4.0\lib\net47\System.ValueTuple.dll' because file version '4.6.25519.3' is greater than '4.6.25514.4'. 10>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1988,5): warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. ``` Can I do anything to resolve the conflict? Thanks [EDIT] Fixed log formatting by @karelz 25615 area-System.Memory Move DangerousTryGetArray from a ReadOnlyMemory to MemoryMarshal Leftover from the approved API proposal: https://github.com/dotnet/corefx/issues/23879#issuecomment-333306452 Rename the DangerousTryGetArray instance method on ReadOnlyMemory to TryGetArray and move it to the MemoryMarshal class. ```C# namespace System.Runtime.InteropServices { public static class MemoryMarshal { public static bool TryGetArray<T>(ReadOnlyMemory<T> readOnlyMemory, out ArraySegment<T> arraySegment); } } ``` cc @KrzysztofCwalina, @stephentoub 25616 area-Serialization Suppress compiler warnings from XmlSerializer.Generator When using the new XmlSerializer.Generator, there is a lot of warnings like: warning CS0219: The variable 'tmp' is assigned but its value is never used warning CS0219: The variable 'a_2' is assigned but its value is never used see: https://ci.appveyor.com/project/ublsharp/ublsharp/build/108 Looking at the msbuild targets here https://github.com/dotnet/corefx/blob/master/src/Microsoft.XmlSerializer.Generator/pkg/build/Microsoft.XmlSerializer.Generator.targets#L16 I see there's no way to pass nowarn/DisabledWarnings to the Csc tasks. Any way to take a variable here? On a side-note, should I even be doing this (including the sgen dll with the nuget packge), or is that something for the package consumer? What are the recommendations? 25617 area-System.Runtime Provide a method to query memory status on Linux and OSX This could be similar to [Interop.GlobalMemoryStatusEx.cs](https://github.com/dotnet/corefx/blob/master/src/Common/src/Interop/Windows/kernel32/Interop.GlobalMemoryStatusEx.cs) and provide information similar to the one in MEMORYSTATUSEX. While the memory management is different on Windows and other platforms and this functionality is arguably low level, it still could be useful in a range of user scenarios such as determining memory pressure (e.g. to see if the cache needs to be trimmed) or trying to evaluate memory usage before reserving/mapping/committing large chunks of memory, or trying to decide whether a service wants to reject processing a new request. It appears that most of the groundwork is already done in [sysinfo.cpp](https://github.com/dotnet/coreclr/blob/master/src/pal/src/misc/sysinfo.cpp#L221) but is not exposed via managed APIs. 25618 area-System.Runtime Add BigInteger.TryFormat Note that I'm waiting for https://github.com/dotnet/corefx/issues/25337 to land and will then update this with using `ReadOnlySpan<char>` instead of `string` for the `format`. After that I'll run some perf tests to verify nothing's regressed. Contributes to https://github.com/dotnet/corefx/issues/25336 cc: @bartonjs 25619 area-System.Data SqlCommand ExecuteNonQuery port Port the following APIs from .Net Framework to .Net Core. M:System.Data.SqlClient.SqlCommand.BeginExecuteNonQuery M:System.Data.SqlClient.SqlCommand.BeginExecuteNonQuery(System.AsyncCallback,System.Object) M:System.Data.SqlClient.SqlCommand.EndExecuteNonQuery(System.IAsyncResult) 25620 area-System.Data Possible Critical Bug/Issue with SqlConnection in .NET Core 2.0 when running on Linux or Linux Containers and having multiple concurrent users like in a Load Test "POSSIBLE ISSUE/BUG When load testing with not many concurrent users (just like 20, 50 or more concurrent users) we've found a Possible Critical Bug/Issue with SqlConnection in .NET Core 2.0 when running on Linux or Linux Containers. We might be missing something, but I don't see it. This is happening only when running SqlClient in .NET Core 2.0 on Linux or Linux-containers. When running on Windows or Windows Containers, there are no issues, so, that is a bad symptom... ``` Error when load testing: System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 40 - Could not open a connection to SQL Server) at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(... ``` REPRO: We have created a very simple project to repro the issue. It is an ASP.NET Core Web API with two methods to run: 1. Method running a plain native SqlConnection with a query. 2. Method running a query with Dapper based on a query. 3. When using EF Core, it should happen the same, but for the repro we perefered to go to the simplest repro which is just to use a SqlConntection. Basically, the issue is related to SqlConnection, not from higher level frameworks like EF Core or Dapper, as it happens whenever .NET Core 2.0 SqlConnection is used on LINUX. You can get the repro code from here (Simple ASP.NET Core 2.0 Web API with SqlConnection): [https://github.com/CESARDELATORRE/SQLConnNetCore2IssueRepro](https://github.com/CESARDELATORRE/SQLConnNetCore2IssueRepro) This is the Web API method when using simply a SqlConntection: ```C# [HttpGet(""native"")] public async Task<IActionResult> GetNative() { var connectionString = ""Server=tcp:eshopsql-e3h5ug5xd3rfs.database.windows.net,1433;Initial Catalog=orderingdb;Persist Security Info=False;User ID=eshop;Password=MY-PASSWORD;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Max Pool Size=400;Connection Timeout=30;""; using (var connection = new SqlConnection(connectionString)) { try { connection.Open(); var command = connection.CreateCommand(); command.CommandText = @""SELECT o.[Id] as ordernumber,o.[OrderDate] as [date],os.[Name] as [status],SUM(oi.units*oi.unitprice) as total FROM [ordering].[Orders] o LEFT JOIN[ordering].[orderitems] oi ON o.Id = oi.orderid LEFT JOIN[ordering].[orderstatus] os on o.OrderStatusId = os.Id GROUP BY o.[Id], o.[OrderDate], os.[Name] ORDER BY o.[Id]""; var reader = command.ExecuteReader(System.Data.CommandBehavior.CloseConnection); var count = 0; while (reader.Read()) { count += 1; } return Ok(count); } catch (Exception x) { throw new InvalidOperationException(x.ToString()); } } } ``` The database is actually running on an Azure SQL Database so we test it against a hypothetical ""production"" database. But this issue happens the same way if the SQL Database is running in a SQL Container. If I deploy the container/solution from VS into Docker for Windows (running on the Linux VM), the Web API runs OK, as in the following screenshot: NOTE that the URL has to provide ""/native"" at the end. The tables in SQL currently have no registries, hence ""0"" as return value. But the query is being executed:  If you want to try with Dapper, try the same URL but ending on ""/dapper"" which will execute a different code/method. You can see the Web API container running in the local Docker Linux VM:  Then, if we do Load Testing and simulate concurrent users, this is when we start getting a lot of errors from SqlConntection, like this: `System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 40 - Could not open a connection to SQL Server) at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) at System.Data.SqlClient.SqlConnection.Open() at ` Contact me at cesardl at microsoft.com for further info about the issue. " 25621 area-System.Data Performance issue fix for manged sni Setting buffer size of socket manually causes the performance issue. This is a fix for the issue: https://github.com/dotnet/corefx/issues/24480 25623 area-Microsoft.CSharp Microsoft.CSharp: Remove unused SymWithType fields from MemberLookup * Remove `_swtAmbigWarn` Not sure if setting it can be reached, but it's never used if it is, because we can only error or not, with no mechanism to warn. * Remove `_swtOverride` Set, but never used (since we can't have a bogus override against an already-compiled type, which it is stored to potentially error against in static compilation). 25626 area-System.Memory Optimize UTF-8 Int64/UInt64 Formatter for x86 - If the number is larger than a quintillion (10^18), split it into three parts that can each fit in a uint32: `{1-2 digits}{9 digits}{9 digits}`. Otherwise, split it into two parts that can each fit in a uint32: `{1-9 digits}{9 digits}`. - Inlining some methods.    **Edit2:** Out-dated result2 !~[image](https://user-images.githubusercontent.com/6527137/33466160-1076d362-d601-11e7-9e4b-922bb330a841.png)~ **Edit:** Out-dated result !~[image](https://user-images.githubusercontent.com/6527137/33464650-2f293150-d5f8-11e7-85bf-6d0a29420bf5.png)~ **Questions:** **Edit:** Ignore question 1. I can no longer reproduce those results. 1. ~I am surprised that formatting '0' is faster for x86 than for x64 (by around 30%). I have no idea why given the assembly is the same for both. Any ideas as to why this is?~ The code is identical for both! ```C# if ((ulong)value < 10) { return TryFormatUInt32SingleDigit((uint)value, buffer, out bytesWritten); } ``` 2. Even after the optimizations in this PR, x64 is still 1-3x faster than x86 for numbers above int.MaxValue (since all int64 operations expand into several instructions). I am not sure what else can be done about this. Thoughts? **Edit2:** The difference has been shrunk to 1-2x (rather than 3x) which is to be expected. cc @AtsushiKan, @KrzysztofCwalina, @jkotas, @davidfowl, @stephentoub 25627 area-System.Data DbConnectionPool.CleanupCallback with short lived windows impersonation tokens causes kestrel process to crash "Add the following reproducer to an empty dotnet core 2 project and wait for the timer DbConnectionPool.CleanupCallback to fire. Since the WindowsIdentity token that was being impersonated has now been closed, an ObjectDisposedException will be thrown while attempting to run the timer in the captured execution context. This causes ExecutionContext.OnContextChanged to call FailFast and crash the process. ```c# public class Startup { public void ConfigureServices(IServiceCollection services) { services.AddEntityFrameworkSqlServer(); services.AddDbContextPool<DbContext>(o => { var server = ""localhost""; var database = ""master""; o.UseSqlServer($""Server={server};Database={database};integrated security=True;Trusted_Connection=true"", options => { } ); }); } private async Task WhoAmI(HttpContext context) { var dbContext = context.RequestServices.GetRequiredService<DbContext>(); var parm = new SqlParameter(""name"", SqlDbType.VarChar, 50); parm.Value = """"; parm.Direction = ParameterDirection.InputOutput; await dbContext.Database.ExecuteSqlCommandAsync(""select @name = loginame from master.sys.sysprocesses where spid = @@SPID"", parm); var name = (parm.Value as string).Trim(); await context.Response.WriteAsync($""Hello {name}!""); } public void Configure(IApplicationBuilder app, IHostingEnvironment env) { app.Run(context => { WindowsIdentity.RunImpersonated( ((WindowsIdentity)context.User.Identity).AccessToken, () => WhoAmI(context).Wait()); return Task.CompletedTask; }); } } ``` Is there an easy way to run this (and any other) timer to avoid capturing the execution context? [EDIT] Add C# syntax highlighting by @karelz" 25628 area-Infrastructure Add static library definitions to CMakeLists for CoreRT Add static library definitions to be consumed by CoreRT, similar to the current build of System.Native. 25629 area-System.Net HttpCompletionOption.ResponseHeadersRead behavior with AllowAutoRedirect=true "This is a question regarding the behavior of `HttpCompletionOption.ResponseHeadersRead` when `AllowAutoRedirect` is set to true. When a redirect occurs, which of the following behaviors takes place? 1. The completion option is only respected for the first request (i.e. it is ""best-effort""; since a redirect took place, we cannot respect the completion option. So we read the response body and then follow redirects ignoring the original completion option). 2. The completion option is respected for all requests (a new connection is created for each redirect, wasting a new connection each time). 3. The completion option is only respected for the last request (we read response bodies as long as the status code asks us to redirect. The destination response body is not read). 4. When a redirect occurs, the completion option has no effect. Since HTTP/1.1 is the default protocol, `keep-alive`s are enabled. This means that if a response body is not read, then a new request cannot be made on the same TCP connection. So it seems that (3) or (4) are most likely. However, RFC2616 does not forbid `HTTP 302` responses from having response bodies. So a problem arises when the responses are huge (say many GBs each). In this case, every redirect will take very long and it would actually be beneficial to re-create a new connection for each redirect. I realize that this is a hypothetical scenario, but wanted to check anyway since the behavior was not documented (and I couldn't make much from the source). **Extra**: How do timeouts work with regard to redirects? Are they per-request or for all of them?" 25630 area-System.Runtime Environment.ProcessorCount: use runtime implementation via EnvironmentAugments This doesn't build on my machine (yet): > 'EnvironmentAugments' does not contain a definition for 'ProcessorCount' EnvironmentAugments.ProcessorCount was added in https://github.com/dotnet/coreclr/pull/15297. I've made the change for all platforms (i.e. also Windows) and removed the corefx implementation. CC @stephentoub @jkotas 25631 area-System.Security Cannot import PKCS12 certificates on OS X "```c# using System; using System.Security.Cryptography.X509Certificates; namespace x509import { class Program { static void Main(string[] args) { try { X509Store certStore = new X509Store(""My"", StoreLocation.CurrentUser); certStore.Open(OpenFlags.ReadWrite); X509Certificate2Collection certs = new X509Certificate2Collection(); try { certs.Import(""s_rsa_cai1.p12"", ""password"", X509KeyStorageFlags.DefaultKeySet); foreach(X509Certificate2 c in certs) { certStore.Add(c); } } finally { foreach(X509Certificate2 c in certs) { certStore.Remove(c); } } } catch(Exception ex) { Console.WriteLine(ex); } } } } ``` This program fails in OS X with the following exception ``` Interop+AppleCrypto+AppleCommonCryptoCryptographicException: The contents of this item cannot be retrieved. at Interop.AppleCrypto.X509StoreAddCertificate(SafeKeychainItemHandle certOrIdentity, SafeKeychainHandle keychain) at Internal.Cryptography.Pal.StorePal.AppleKeychainStore.Add(ICertificatePal cert) at System.Security.Cryptography.X509Certificates.X509Store.Add(X509Certificate2 certificate) at x509import.Program.Main(String[] args) in /Users/jose/x509import/Program.cs:line 21 ``` The same program works fine with Linux and Windows, The test certificate can be download from https://github.com/zeroc-ice/ice/raw/3.7/csharp/test/IceSSL/certs/s_rsa_cai1.p12 [EDIT] Add C# syntax highlighting by @karelz" 25632 area-System.Net Failing code with forward slashes as path separators with paths containing umlauts "As mentioned in this issue( https://github.com/dotnet/corefx/issues/25519 ) there is a problem for me with paths using forward slashes as path separators and umlauts (probably all characters outside the 0000-007F range?). Found using System.Xml.Linq.XDocument.Load(), can't reproduce with just System.IO.Path.GetFullPath() so my guess is the path gets malformed somewhere along the call stack between those calls but I am not setup to debug the .net core code so unsure where. Tested with .Net Core 2.0.3 on Windows 10 64-bit (dotnet-sdk-2.0.3-win-x64.exe installer) Simple test code (project created with ```dotnet new console```): ```c# using System; using System.Xml.Linq; namespace forwardslashwithumlaut { class Program { static void Main(string[] args) { var xmlDoc1 = XDocument.Load(@""c:/elmish/dotnetcoreissue/o/test.xml""); Console.WriteLine(""Nonumlaut forward slash path passed""); //passes on .Net core and .Net Framework 4.6.1 var xmlDoc2 = XDocument.Load(@""c:/elmish/dotnetcoreissue/ö/test.xml""); Console.WriteLine(""Umlaut forward slash path passed""); // failson .Net core and passes on.Net Framework 4.6.1 } } } ``` Console output: ``` dotnet run Nonumlaut forward slash path passed Unhandled Exception: System.NotSupportedException: The given path's format is not supported. at System.IO.Path.GetFullPath(String path) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize) at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy) at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn) at System.Xml.XmlTextReaderImpl.FinishInitUriString() at System.Xml.XmlTextReaderImpl..ctor(String uriStr, XmlReaderSettings settings, XmlParserContext context, XmlResolver uriResolver) at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext) at System.Xml.XmlReader.Create(String inputUri, XmlReaderSettings settings) at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options) at System.Xml.Linq.XDocument.Load(String uri) at backslashpathwithumlaut.Program.Main(String[] args) in C:\elmish\backslashpathwithumlaut\Program.cs:line 12 ``` [EDIT] Add C# syntax highlighting by @karelz" 25633 area-Infrastructure dotnet publish on FreeBSD This is more of a question. I apologize in advance if this is not the proper place to ask for a clarification. I was able to compile the runtime for FreeBSD, by following the instructions at: https://github.com/dotnet/corefx/wiki/Building-.NET-Core--2.x-on-FreeBSD I have applications that need to be `dotnet run` from the SDK. If I `dotnet publish` those applications on a Windows host, barring some very particular dependencies, should they run on my FreeBSD environment? 25634 area-System.Console ConsoleColor.White isn't white on macosx _From @equiman on December 1, 2017 13:25_ I'm working in a console project in dotnet core. But white color on mac is represented as lighter gray and not as white color. Example img: https://ibb.co/kKoXPb 1) is background color in terminal by default. 2) is `Console.BackgroundColor = ConsoleColor.White; ` but is represented as lighter gray. I'm using default terminal application on macos. $> dotnet --version 2.0.0 $> sw_vers ProductName: Mac OS X ProductVersion: 10.13.1 BuildVersion: 17B1003 Code using to format with color: https://github.com/equiman/hardhat/blob/master/dev/tools/Colorify.cs _Copied from original issue: dotnet/coreclr#15320_ 25635 area-System.Threading BufferBlock.OutputAvailableAsync does not set CancellationToken when canceled When I await BufferBlock<T>.OutputAvailableAsync(token) and the token gets canceled a TaskCanceledException is thrown (which is correct) with a CancellationToken set to CancellationToken.None. It should be set to the canceled token. I think this is because OutputAvailableAsyncTarget<T>.CancelAndUnlink() calls thisTarget.TrySetCanceled() without the token as parameter. 25636 area-System.Memory Span/Memory Epic Groups all remaining work for Span and Memory for 2.1 25637 area-System.Net Add logic to skip alpn tests where unsupported. Fixes #25033, #25661 Adding logic to detect openssl version is greater than 1.0.2 before running the alpn tests. This has been causing test failures in several runs redhat6.9 distro was not added in the distro skip list. This method is more reliable. cc @stephentoub @wfurt @karelz 25638 area-Meta Alpine Linux hierarchy chain is incorrect "In https://github.com/dotnet/corefx/blob/master/pkg/Microsoft.NETCore.Platforms/runtimeGroups.props, the alpine linux has incorrect parent ""any"" instead of ""unix"". " 25639 area-System.Net IOControl_SIOCATMARK_Success test not working on macOS/Windows The new IOControl_SIOCATMARK_Success is failing on macOS. Needs investigation to understand whether it's a test issue (e.g. a subtle behavioral difference between unix implementations) or something deeper. 25640 area-System.Net [ManagedHandler] ProxySetViaEnvironmentVariable_DefaultProxyCredentialsUsed test disabled This may not be specific to ManagedHandler. We are disabling them for now to reduce noise for 2.1. ProxySetViaEnvironmentVariable_DefaultProxyCredentialsUsed: failing sometimes on Windows (this used to be Unix test only) 12 failures so far in November. 25641 area-System.Net disable ProxySetViaEnvironmentVariable_DefaultProxyCredentialsUsed on windows disabling for now per agreement with @karelz failed 12 times in November on various windows version. #25640 filed to track it. 25642 area-System.Net Avoid filling the TRUSTED_ISSUERS entry in SSL handshake on Linux Discussion is here: https://github.com/dotnet/corefx/issues/23938 This PR avoid filling in the TRUSTED_ISSUERS field in the SSL handshake on Linux to maintain comparability with the behavior of SslStream on Windows. As for Windows 8 / Windows Server 2012 SChannel is no longer sending the trusted issuers by default (see: https://technet.microsoft.com/en-us/library/dn786429(v=ws.11).aspx) This can reduce the number of bytes in an SSL handshake from `21,939` to `1,486` and help comparability and ease of use when using client certificates with SslStream. 25643 area-System.Net "[release/2.0.0] Revert ""Minor change to avoid an allocation in Uri""" Quoting @stephentoub -- > While #12061 looked simple, the removal of the allocation actually broke this behavior (and worse, broke string immutability) because the CheckSchemeSyntax method that's called actually mutates the char* that's passed in. This code was bad to begin with, as this was always (even in netfx) mutating a string instance, but that PR made it worse and broke this because it ends up passing in / mutating the original string rather than a copy that's mutated and then thrown away. > > The removal of the allocation can be re-done in a different way. For now, though, we need to revert. The break is bad enough that it renders System.Uri unusable in many situations, so the fix warrants porting back to 2.0.x. Fixes #25548 cc: @stephentoub @karelz @davidsh 25645 area-System.Net Fix subprotocol check in WebSocketHandle.Managed @qmfrederik, I'm not sure how to repro what you were seeing, but the condition here looked wrong regardless, so hopefully this addresses your issue. 25647 area-System.IO Position in the input stream is always end after decompression On desktop when you run decompression the position in the input stream is a first position after compressed data aligned to the input buffer while on Core we always read stream until the end. Problem is in here: https://github.com/dotnet/corefx/blob/master/src/System.IO.Compression/src/System/IO/Compression/DeflateZLib/Inflater.cs#L42 We should not be checking for `AvailIn == 0` and `AvailOut == 0` which may be non-zero when we are finished (AvailIn tells us how much data can we still read from the input and AvailOut tells us how much space there is in the output buffer). 25648 area-System.Memory Remove use of Unsafe in the UTF-8 formatter Just like the parsers, the formatters should not be using unsafe code. [This](https://github.com/dotnet/corefx/pull/25424) PR removes the use of unsafe code from the default integer formatter. We need to remove it from all the places. See https://github.com/dotnet/corefx/pull/25424#discussion_r152992177 for more context. cc @KrzysztofCwalina, @jkotas, @AtsushiKan, @morganbr, @GrabYourPitchforks 25650 area-System.Console We need a cross-platform way to detect key-down state "_From @masonwheeler on July 1, 2015 14:48_ Right now, if you want to answer the question ""Is <insert key here> on the keyboard currently down?"", you do it with a PInvoke call to `GetAsyncKeyState`. Problem is, that will only work for winapi-based platforms. There should be a cross-platform solution for this, and ISTM it's low-level enough that it belongs in CoreCLR and not CoreFX. Feel free to correct me if this isn't the case, and I'll open the issue on CoreFX instead. _Copied from original issue: dotnet/coreclr#1190_" 25652 area-System.Diagnostics System.Diagnostics.Process.GetProcesses and System.Diagnostics.ProcessModule "_From @diamondes3 on August 11, 2017 18:47_ I'm creating a program that needs to get a list of currently executing processes in memory and take action to kill a given process, if it's a different instance of the same (currently executing program) that has become hung for some reason; where I have a criteria based on start time to declare a given process as being hung. This logic is being developed on a windows machine using ""dotnet"" core, then packaged and run on a Ubuntu machine. If I get a list of processes via ""Process.GetProcesses"", I can see my currently executing logic in the list as ""dotnet"". This isn't real helpful, as what if there are X different ""dotnet"" programs running on this machine, they all look like they are the same logic due to the ""dotnet"" name. Some of them MIGHT be hung instances of the logic I'm after, some of them MIGHT be totally other ""dotnet"" assemblies. I figured out, that if I examine the list of modules for a given process (ProcessModule), the ProcessModule.ModuleName is the name of the underlying .dll that the ""dotnet"" core environment is running. This works fine on the Windows machine running Visual Studio. When I compile and package the logic and run it on the Linux machine, I get can get the list of Processes, examine their corresponding modules; however, the underlying .dll that the ""dotnet"" core is executing is missing from the list of modules that should be in that given process. In other words, the .dll name shows up as a module in the Windows process, but does NOT show up as a module in the Linux process; even though numerous other modules DO show up in the Linux environment for the given process. There are no exceptions or any other errors that I'm seeing, just not seeing the underlying .dll listed as a module for a given process on the Linux machine. Any constructive thoughts on this? _Copied from original issue: dotnet/coreclr#13340_" 25653 area-System.Xml XmlReader.Read with Async settings should not throw AggregateException "Consider the following code: ```c# using System.Xml; class Program { static void Main() { var reader = XmlReader.Create(""a"", new XmlReaderSettings { Async = true }); reader.Read(); } } ``` Assuming the file `a` doesn't exist, this code is expected to throw `FileNotFoundException`. .Net Core 1.x does exactly that. But .Net Core 2.x and .Net Framework 4.x don't, they throw the exception wrapped in `AggreagteException`: ``` > dotnet run -f netcoreapp1.1 Unhandled Exception: System.IO.FileNotFoundException: Could not find file 'C:\code\tmp\coreapp\a'. at System.IO.Win32FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, FileStream parent) at System.IO.Win32FileSystem.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, FileStream parent) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) at System.Xml.XmlSystemPathResolver.GetEntity(Uri uri, String role, Type typeOfObjectToReturn) at System.Xml.XmlTextReaderImpl.FinishInitUriString() at System.Xml.XmlTextReaderImpl.FinishInit() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.XmlAsyncCheckReader.Read() at Program.Main() in C:\code\tmp\coreapp\Program.cs:line 8 > dotnet run -f netcoreapp2.0 Unhandled Exception: System.AggregateException: One or more errors occurred. (Could not find file 'C:\code\tmp\coreapp\a'.) ---> System.IO.FileNotFoundException: Could not find file 'C:\code\tmp\coreapp\a'. at System.IO.FileStream.OpenHandle(FileMode mode, FileShare share, FileOptions options) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.Xml.XmlDownloadManager.<>c__DisplayClass2_0.<GetStreamAsync>b__0() at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() at System.Xml.XmlUrlResolver.<GetEntityAsync>d__15.MoveNext() --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at System.Threading.Tasks.Task.Wait() at System.Xml.XmlTextReaderImpl.FinishInitUriString() at System.Xml.XmlTextReaderImpl.FinishInit() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.XmlAsyncCheckReader.Read() at Program.Main() in C:\code\tmp\coreapp\Program.cs:line 8 > dotnet run -f netcoreapp2.1 Unhandled Exception: System.AggregateException: One or more errors occurred. (Could not find file 'C:\code\tmp\coreapp\a'.) ---> System.IO.FileNotFoundException: Could not find file 'C:\code\tmp\coreapp\a'. at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle) at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.Xml.XmlDownloadManager.<>c__DisplayClass2_0.<GetStreamAsync>b__0() at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) --- End of stack trace from previous location where exception was thrown --- at System.Xml.XmlUrlResolver.<GetEntityAsync>d__15.MoveNext() --- End of inner exception stack trace --- at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at System.Threading.Tasks.Task.Wait() at System.Xml.XmlTextReaderImpl.FinishInitUriString() at System.Xml.XmlTextReaderImpl.FinishInit() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.XmlAsyncCheckReader.Read() at Program.Main() in C:\code\tmp\coreapp\Program.cs:line 8 > dotnet run -f net45 Unhandled Exception: System.AggregateException: One or more errors occurred. ---> System.IO.FileNotFoundException: Could not find file 'C:\code\tmp\coreapp\a'. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync) at System.Xml.XmlDownloadManager.<>c__DisplayClass4_0.<GetStreamAsync>b__0() at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.Tasks.Task.Execute() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Xml.XmlUrlResolver.<GetEntityAsync>d__15.MoveNext() --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at System.Threading.Tasks.Task.Wait() at System.Xml.XmlTextReaderImpl.FinishInitUriString() at System.Xml.XmlTextReaderImpl.Read() at Program.Main() in C:\code\tmp\coreapp\Program.cs:line 8 > dotnet run -f net47 Unhandled Exception: System.AggregateException: One or more errors occurred. ---> System.IO.FileNotFoundException: Could not find file 'C:\code\tmp\coreapp\a'. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync) at System.Xml.XmlDownloadManager.<>c__DisplayClass4_0.<GetStreamAsync>b__0() at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.Tasks.Task.Execute() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Xml.XmlUrlResolver.<GetEntityAsync>d__15.MoveNext() --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at System.Threading.Tasks.Task.Wait() at System.Xml.XmlTextReaderImpl.FinishInitUriString() at System.Xml.XmlTextReaderImpl.Read() at Program.Main() in C:\code\tmp\coreapp\Program.cs:line 8 ``` I think that `XmlReader.Read()` should not throw `AggregateException`, even though `Async` is set in the settings. The code responsible for this behavior on .Net Core is: https://github.com/dotnet/corefx/blob/8229cb7e33a40b990cdef2fd83a7a021636a89aa/src/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImpl.cs#L625-L629 Changing it from `.Wait()` and `.Result` to `.GetAwaiter().GetResult()` should fix the issue." 25654 area-System.Runtime Overload to String.Replace that can take multiple strings to replace "Sometime I want to replace multiple texts from a string, and the code become something like this: ```C# var toReplace = new[] {""aaa"", ""bbb"", ""ccc""}; var replaceWith = """"; foreach (var s in toReplace ) { foo = foo.Replace(s, replaceWith ); } ``` Of course, I can use `Regex `for such situations, but it feels a bit unnecessarily complicated for such a common case. I suggest to create an overload to String.Replace with following signature: ```C# string Replace(IEnumerable<string>, string) ``` Whit this, I can rerwite the example to following: ```C# var toReplace = new[] {""aaa"", ""bbb"", ""ccc""}; var replaceWith = """"; foo = foo.Replace(toReplace , replaceWith ); ``` " 25655 area-System.Net Please add RememberMe to NetworkCredentials ### Suggestion Would be nice to have a `RemeberMe` property in the `NetworkCredentials` class, to make it easier to use as a standard username and password DTO unit. ### Proposed API Add a `bool` or `bool?` property named `RememberMe` to the `NetworkCredential` class, to make it easier to attach this piece of info with the request. ### Motive In the client side it will make it easier to use the `NetworkCredential` class as a DTO from the UI/ViewModel or some other high layer in the app down to the DAL and embedded in the request, and in the server side to be able to store cookies accordingly. Not something that will always be used, but something that's many times worth sitting there. 25656 area-System.Net Added RememberMe field to NetworkCredential See #25655. 25658 area-System.Net System.Net.Sockets - Tests - Removed more blocking on APM tests 25659 area-System.Threading Please consider ReusableTask and ReusableValueTask What makes reference type important is its reusability, but Task as a reference type is not designed to be reused. Considering REST Api or RPC, the most frequent functions are to be called millions of times from Internet requests, if task or valueTask would be able to be reused, the time for heap allocation or stack initialization(deep copy does cost time) could be saved at somewhat degree. Reusable must take some disadvantage, but just like valueTask, it could bring some goodness. 25660 area-System.Text Overload to Regex.Escape with RegexOptions.IgnorePatternWhitespace option By default Regex treats space character as literal i.e. it doesn't use RegexOptions.IgnorePatternWhitespace. But Regex.Escape escapes space characters as if I use RegexOptions.IgnorePatternWhitespace. And there is no way to change it. 25661 area-System.Net ALPN tests failing on RedHat https://mc.dot.net/#/user/Drawaes/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/5e70fee9f1339db71f723caac7a85d55346c9a09/workItem/System.Net.Security.Tests/wilogs ``` 2017-12-02 23:41:32,500: INFO: proc(54): run_and_log_output: Output: System.Net.Security.Tests.SslStreamAlpnTests.SslStream_StreamToStream_Alpn_NonMatchingProtocols_Fail [FAIL] 2017-12-02 23:41:32,500: INFO: proc(54): run_and_log_output: Output: AuthenticationException was not thrown. 2017-12-02 23:41:32,500: INFO: proc(54): run_and_log_output: Output: Expected: True 2017-12-02 23:41:32,501: INFO: proc(54): run_and_log_output: Output: Actual: False 2017-12-02 23:41:32,513: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2017-12-02 23:41:32,870: INFO: proc(54): run_and_log_output: Output: /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/src/System.Net.Security/tests/FunctionalTests/SslStreamAlpnTests.cs(157,0): at System.Net.Security.Tests.SslStreamAlpnTests.<SslStream_StreamToStream_Alpn_NonMatchingProtocols_Fail>d__4.MoveNext() 2017-12-02 23:41:32,870: INFO: proc(54): run_and_log_output: Output: --- End of stack trace from previous location where exception was thrown --- 2017-12-02 23:41:32,870: INFO: proc(54): run_and_log_output: Output: --- End of stack trace from previous location where exception was thrown --- 2017-12-02 23:41:32,870: INFO: proc(54): run_and_log_output: Output: --- End of stack trace from previous location where exception was thrown --- 2017-12-02 23:41:32,870: INFO: proc(54): run_and_log_output: Output: System.Net.Security.Tests.SslStreamAlpnTests.SslStream_StreamToStream_Alpn_Success(clientProtocols: [http/1.1, h2], serverProtocols: [h2], expected: h2) [FAIL] 2017-12-02 23:41:32,870: INFO: proc(54): run_and_log_output: Output: Assert.Equal() Failure 2017-12-02 23:41:32,870: INFO: proc(54): run_and_log_output: Output: Expected: h2 2017-12-02 23:41:32,870: INFO: proc(54): run_and_log_output: Output: Actual: (null) 2017-12-02 23:41:32,870: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2017-12-02 23:41:32,871: INFO: proc(54): run_and_log_output: Output: /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/src/System.Net.Security/tests/FunctionalTests/SslStreamAlpnTests.cs(116,0): at System.Net.Security.Tests.SslStreamAlpnTests.<SslStream_StreamToStream_Alpn_Success>d__3.MoveNext() 2017-12-02 23:41:32,871: INFO: proc(54): run_and_log_output: Output: --- End of stack trace from previous location where exception was thrown --- 2017-12-02 23:41:32,871: INFO: proc(54): run_and_log_output: Output: --- End of stack trace from previous location where exception was thrown --- 2017-12-02 23:41:32,871: INFO: proc(54): run_and_log_output: Output: --- End of stack trace from previous location where exception was thrown --- 2017-12-02 23:41:33,124: INFO: proc(54): run_and_log_output: Output: System.Net.Security.Tests.SslStreamAlpnTests.SslStream_StreamToStream_Alpn_Success(clientProtocols: [http/1.1], serverProtocols: [http/1.1, h2], expected: http/1.1) [FAIL] 2017-12-02 23:41:33,124: INFO: proc(54): run_and_log_output: Output: Assert.Equal() Failure 2017-12-02 23:41:33,124: INFO: proc(54): run_and_log_output: Output: Expected: http/1.1 2017-12-02 23:41:33,124: INFO: proc(54): run_and_log_output: Output: Actual: (null) 2017-12-02 23:41:33,124: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2017-12-02 23:41:33,125: INFO: proc(54): run_and_log_output: Output: /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/src/System.Net.Security/tests/FunctionalTests/SslStreamAlpnTests.cs(116,0): at System.Net.Security.Tests.SslStreamAlpnTests.<SslStream_StreamToStream_Alpn_Success>d__3.MoveNext() 2017-12-02 23:41:33,125: INFO: proc(54): run_and_log_output: Output: --- End of stack trace from previous location where exception was thrown --- 2017-12-02 23:41:33,125: INFO: proc(54): run_and_log_output: Output: --- End of stack trace from previous location where exception was thrown --- 2017-12-02 23:41:33,125: INFO: proc(54): run_and_log_output: Output: --- End of stack trace from previous location where exception was thrown --- 2017-12-02 23:41:33,214: INFO: proc(54): run_and_log_output: Output: System.Net.Security.Tests.SslStreamAlpnTests.SslStream_StreamToStream_Alpn_Success(clientProtocols: [http/1.1, h2], serverProtocols: [http/1.1, h2], expected: http/1.1) [FAIL] 2017-12-02 23:41:33,214: INFO: proc(54): run_and_log_output: Output: Assert.Equal() Failure 2017-12-02 23:41:33,214: INFO: proc(54): run_and_log_output: Output: Expected: http/1.1 2017-12-02 23:41:33,214: INFO: proc(54): run_and_log_output: Output: Actual: (null) 2017-12-02 23:41:33,214: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2017-12-02 23:41:33,215: INFO: proc(54): run_and_log_output: Output: /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/src/System.Net.Security/tests/FunctionalTests/SslStreamAlpnTests.cs(116,0): at System.Net.Security.Tests.SslStreamAlpnTests.<SslStream_StreamToStream_Alpn_Success>d__3.MoveNext() 2017-12-02 23:41:33,215: INFO: proc(54): run_and_log_output: Output: --- End of stack trace from previous location where exception was thrown --- 2017-12-02 23:41:33,215: INFO: proc(54): run_and_log_output: Output: --- End of stack trace from previous location where exception was thrown --- 2017-12-02 23:41:33,215: INFO: proc(54): run_and_log_output: Output: --- End of stack trace from previous location where exception was thrown --- ``` 25662 area-System.Drawing Several System.Drawing.Common tests fail locally deterministically Maybe because I actually have a printer attached, or the specifics of the printer I have attached? Regardless I should be able to run the tests locally and cleanly. ``` Discovering: System.Drawing.Common.Tests Discovered: System.Drawing.Common.Tests Starting: System.Drawing.Common.Tests System.Drawing.Printing.Tests.PrinterSettingsTests.IsDirectPrintingSupported_ImageFormatSupported_ReturnsExpected(imageFormat: Jpeg) [FAIL] Assert.Equal() Failure Expected: True Actual: False Stack Trace: c:\Users\stoub\Source\Repos\corefx\src\System.Drawing.Common\tests\Printing\PrinterSettingsTests.cs(399,0): at System.Drawing.Printing.Tests.PrinterSettingsTests.IsDirectPrintingSupported_ImageFormat Supported_ReturnsExpected(ImageFormat imageFormat) System.Drawing.Printing.Tests.PrinterSettingsTests.IsDirectPrintingSupported_ImageFormatSupported_ReturnsExpected(imageFormat: Png) [FAIL] Assert.Equal() Failure Expected: True Actual: False Stack Trace: c:\Users\stoub\Source\Repos\corefx\src\System.Drawing.Common\tests\Printing\PrinterSettingsTests.cs(399,0): at System.Drawing.Printing.Tests.PrinterSettingsTests.IsDirectPrintingSupported_ImageFormat Supported_ReturnsExpected(ImageFormat imageFormat) System.Drawing.Printing.Tests.PrintDocumentTests.Ctor_Default_Success [FAIL] Assert.Equal() Failure Expected: FormSource Actual: AutomaticFeed Stack Trace: c:\Users\stoub\Source\Repos\corefx\src\System.Drawing.Common\tests\Printing\PrintDocumentTests.cs(260,0): at System.Drawing.Printing.Tests.PrintDocumentTests.AssertDefaultPageSettings(PageSettings pa geSettings) c:\Users\stoub\Source\Repos\corefx\src\System.Drawing.Common\tests\Printing\PrintDocumentTests.cs(48,0): at System.Drawing.Printing.Tests.PrintDocumentTests.Ctor_Default_Success() System.Drawing.Printing.Tests.PrintDocumentTests.DefaultPageSettings_Null_ReturnsExpected [FAIL] Assert.Equal() Failure Expected: FormSource Actual: AutomaticFeed Stack Trace: c:\Users\stoub\Source\Repos\corefx\src\System.Drawing.Common\tests\Printing\PrintDocumentTests.cs(260,0): at System.Drawing.Printing.Tests.PrintDocumentTests.AssertDefaultPageSettings(PageSettings pa geSettings) c:\Users\stoub\Source\Repos\corefx\src\System.Drawing.Common\tests\Printing\PrintDocumentTests.cs(73,0): at System.Drawing.Printing.Tests.PrintDocumentTests.DefaultPageSettings_Null_ReturnsExpected() Finished: System.Drawing.Common.Tests === TEST EXECUTION SUMMARY === c:\Users\stoub\Source\Repos\corefx\Tools\tests.targets(484,5): warning : System.Drawing.Common.Tests Total: 4506, Errors: 0, Failed: 4, Skipped: 0, Time: 7.297s [c:\Users\stoub\Source\Repos\corefx\src\Syste m.Drawing.Common\tests\System.Drawing.Common.Tests.csproj] ``` 25663 area-System.Linq Soundness feedback requested: Increasing cache success in S.L.Expressions "Expressions contains a `CanCache(Type)` method that reports on the safety of caching a delegate or information about a method based on whether the type is a mscrolib type that (if generic) has only mscorlib type parameters. The netfx version allows not just mscorlib types to be considered safe, but also those in System.Core where the cache lives. While there aren't as many types in corefx's S.L.Expressions as there are in netfx's S.Core, this basic principle seems sound to me. It also seems worth doing, tracking hits and misses (of the outer calls only, ignoring its recursive calls on generic parameters except as they affect the final result) has the tests for Microsoft.CSharp go from 0.05% hits to 54.40% and the tests for System.Dynamic.Runtime go from 0.27% to 41.87%. (S.L.Expressions itself goes from 49.59% to 54.34%, and if anything I was expecting it to be an unfair comparison in explicitly using Expressions types more than other tests would, but it it also does a lot of permutations on the primitive types that would have a high hit rate). That would seem to be enough to suggest that dynamic is attempting to cache with so low a success rate as to maybe not be worth trying, but with the change to include Expressions' types it becomes much more useful. And it **seems** safe to me, as surely if the types in Expressions were collectible then collecting would also make the static cache collected. Question 1: Am I wrong in this? Could a type in Expressions be collectible without the `TypeUtils` type becoming collectible (unreachable at least, even if not yet collected) and making the static cache collectible? Because if I am wrong, then this idea isn't safe. Question 2: If I'm correct in this, and caching uses of these types would be safe, would it also be safe to consider types in assemblies referenced by Expressions (transitively) safe to cache? Question 3: Iff the answer to the first question is ""safe"" and to the second is ""not safe"", would the assemblies of types that are base types or implemented interfaces of safe types, also be safe (probably too much of a burden to check that to pay off anyway, but figuring out an efficient way to check on this is a separate investigation)." 25665 area-System.IO Many tests failing after path validation updates Search for `[ActiveIssue(25665)]` in the tests. 25666 area-System.Numerics [Discussion] General purpose non-cryptographic hashing API for .NET Context from https://github.com/dotnet/corefx/issues/14354#issuecomment-348003785: > @JonHanna, I'd be interested to hear how your testing goes so we can start thinking about what would be useful in a general-purpose non-cryptographic hashing API. > @morganbr Where would be an appropriate forum to discuss such an API? I expect that such an API would consist of more than just the lowest common denominator, and maybe a good API will also need an improved JIT w.r.t. handling of larger structs. Discussing all that might be better done in a separate issue... /cc @gimpf, @morganbr, @JonHanna 25669 area-System.Memory [System.Memory] Embedded Reference Types compiler bug "Code that was previously working (on 4.5.0-preview2-25707-02 , which seems to have disappeared!?) breaks on the latest preview: 4.5.0-preview1-26002-01, this is breaking deployment of new CI infrastructure as the working package is not obtainable. I have tried to hunt down the the issue, but it is beyond my understanding. #### Repro steps 1. dotnet new console 2. dotnet add package System.Memory -v 4.5.0-preview1-26002-01 -s https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json 3. Edit Program.cs and insert `ReadOnlySpan<char> x = ""hello"".AsReadOnlySpan();` before the print statement 4. Run `dotnet build` #### Project file (repo.csproj) ``` <Project Sdk=""Microsoft.NET.Sdk""> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>netcoreapp2.0</TargetFramework> </PropertyGroup> <ItemGroup> <PackageReference Include=""System.Memory"" Version=""4.5.0-preview1-26002-01"" /> </ItemGroup> </Project> ``` #### Source file (Program.cs) ``` using System; namespace repo { class Program { static void Main(string[] args) { ReadOnlySpan<char> x = ""hello"".AsReadOnlySpan(); Console.WriteLine(""Hello World!""); } } } ``` #### Expected behavior Expected that the above code works, the usage was taken from the Span doco (https://github.com/dotnet/corefxlab/blob/master/docs/specs/span.md) #### Actual behavior Compiler error: Program.cs(10,12): error CS0619: 'ReadOnlySpan<char>' is obsolete: 'Types with embedded references are not supported in this version of your compiler.' [/tmp/repo/repo.csproj] #### Known workarounds If you have a cached version of 4.5.0-preview2-25707-02 , you can use this and there will be no errors #### Related information Output of dotnet --info ``` .NET Command Line Tools (2.0.3) Product Information: Version: 2.0.3 Commit SHA-1 hash: eb1d5ee318 Runtime Environment: OS Name: debian OS Version: 9 OS Platform: Linux RID: linux-x64 Base Path: /usr/share/dotnet/sdk/2.0.3/ Microsoft .NET Core Shared Framework Host Version : 2.0.3 Build : a9190d4a75f4a982ae4b4fa8d1a24526566c69df ``` Edit: Tagging area owners @KrzysztofCwalina and @ahsonkhan" 25671 area-System.Reflection Add MemberInfo.IsCollectible & Assembly.IsCollectible We may wish to treat a collectible assembly or member info differently to a non-collectible. Most obviously, we might want to avoid caching a collectible type or method for a long time and preventing that possible collection. (`Type` has an `IsCollectible` method, but it is not exposed.) Proposed API: ```C# namespace System.Reflection { public abstract class Assembly { public virtual bool IsCollectible { get; } } public abstract class MemberInfo { public virtual bool IsCollectible { get; } } } ``` Note that collectibility of assemblies is not the only factor on collectibility of member infos. `TypeBuilder` is derived from `Type` and instances are always collectible. `TypeDelegator` is itself collectible, but it should report on its delegatee. **Editted to include all of `MemberInfo` and also `Assembly`.** 25672 area-Microsoft.CSharp Issue with Workaround: Missing compiler required member 'Microsoft.CSharp.RuntimeBinder.Binder.InvokeMember' Hi all. Today, while I'm using Roslyn to compile some code under netcoreapp 2, I got such an error: Missing compiler required member 'Microsoft.CSharp.RuntimeBinder.Binder.InvokeMember' If you google this, it will point you to add Microsoft.CSharp as reference while calling Roslyn method. But sadly, it's done in my project. After several hour digging and testing, I found the problem and solution: It seems that some methods related to Linq are used in my code. Adding **System.Linq.Expressions** as reference to Roslyn fixes the problem. Note: Images of these references should be loaded only from TRUSTED_PLATFORM_ASSEMBLIES. 25674 area-System.IO Test failure: System.IO.Tests.DirectoryInfo_EnumerateFiles_str_str/SearchPatternByExtension Opened on behalf of @Sunny-pu The test `System.IO.Tests.DirectoryInfo_EnumerateFiles_str_str/SearchPatternByExtension` has failed. Assert.Equal() Failure\r Expected: 2\r Actual: 0 Stack Trace: at System.IO.Tests.Directory_GetFileSystemEntries_str_str.SearchPatternByExtension() in E:\A\_work\965\s\corefx\src\System.IO.FileSystem\tests\Directory\GetFileSystemEntries_str_str.cs:line 158 at _$ILCT$.$ILT$ReflectionDynamicInvoke$.InvokeRetV(Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean targetIsThisCall) at System.InvokeUtils.CalliIntrinsics.Call(IntPtr dynamicInvokeHelperMethod, Object thisPtrForDynamicInvokeHelperMethod, Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState) at System.InvokeUtils.CallDynamicInvokeMethod(Object thisPtr, IntPtr methodToCall, Object thisPtrDynamicInvokeMethod, IntPtr dynamicInvokeHelperMethod, IntPtr dynamicInvokeHelperGenericDictionary, Object targetMethodOrDelegate, Object[] parameters, BinderBundle binderBundle, Boolean wrapInTargetInvocationException, Boolean invokeMethodHelperIsThisCall, Boolean methodToCallIsThisCall) in CallDynamicInvokeMethod:line 16707566 Build : Master - 20171204.01 (UWP ILC Tests) Failing configurations: - Windows.10.Amd64.ClientRS3-x86 - Release - Windows.10.Amd64.ClientRS3-x64 - Release 25675 area-System.Runtime Test failure: System.Runtime.Serialization.Formatters.Tests.BinaryFormatterTests/RoundtripManyObjectsInOneStream Opened on behalf of @Sunny-pu The test `System.Runtime.Serialization.Formatters.Tests.BinaryFormatterTests/RoundtripManyObjectsInOneStream` has failed. System.Runtime.Serialization.SerializationException : The constructor to deserialize an object of type 'System.ComponentModel.Composition.CompositionContractMismatchException' was not found.\r ---- System.Runtime.Serialization.SerializationException : The constructor to deserialize an object of type 'System.ComponentModel.Composition.CompositionContractMismatchException' was not found. Stack Trace: at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject$catch$0() in E:\A\_work\965\s\corefx\src\System.Runtime.Serialization.Formatters\src\System\Runtime\Serialization\ObjectManager.cs:line 774 at System.Runtime.Serialization.ObjectManager.FixupSpecialObject($ObjectHolder holder) in E:\A\_work\965\s\corefx\src\System.Runtime.Serialization.Formatters\src\System\Runtime\Serialization\ObjectManager.cs:line 198 at System.Runtime.Serialization.ObjectManager.DoFixups() in E:\A\_work\965\s\corefx\src\System.Runtime.Serialization.Formatters\src\System\Runtime\Serialization\ObjectManager.cs:line 826 at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize($BinaryParser serParser, Boolean fCheck) in E:\A\_work\965\s\corefx\src\System.Runtime.Serialization.Formatters\src\System\Runtime\Serialization\Formatters\Binary\BinaryObjectReader.cs:line 103 at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, Boolean check) in E:\A\_work\965\s\corefx\src\System.Runtime.Serialization.Formatters\src\System\Runtime\Serialization\Formatters\Binary\BinaryFormatter.cs:line 66 at System.Runtime.Serialization.Formatters.Tests.BinaryFormatterTests.RoundtripManyObjectsInOneStream() at _$ILCT$.$ILT$ReflectionDynamicInvoke$.InvokeRetV(Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean targetIsThisCall) at System.InvokeUtils.CalliIntrinsics.Call(IntPtr dynamicInvokeHelperMethod, Object thisPtrForDynamicInvokeHelperMethod, Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState) at System.InvokeUtils.CallDynamicInvokeMethod(Object thisPtr, IntPtr methodToCall, Object thisPtrDynamicInvokeMethod, IntPtr dynamicInvokeHelperMethod, IntPtr dynamicInvokeHelperGenericDictionary, Object targetMethodOrDelegate, Object[] parameters, BinderBundle binderBundle, Boolean wrapInTargetInvocationException, Boolean invokeMethodHelperIsThisCall, Boolean methodToCallIsThisCall) in CallDynamicInvokeMethod:line 16707566 ----- Inner Stack Trace ----- at System.Runtime.Serialization.ObjectManager.GetDeserializationConstructor(Type t) in E:\A\_work\965\s\corefx\src\System.Runtime.Serialization.Formatters\src\System\Runtime\Serialization\ObjectManager.cs:line 794 at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object obj, SerializationInfo info, StreamingContext context) in E:\A\_work\965\s\corefx\src\System.Runtime.Serialization.Formatters\src\System\Runtime\Serialization\ObjectManager.cs:line 770 Build : Master - 20171204.01 (UWP ILC Tests) Failing configurations: - Windows.10.Amd64.ClientRS3-x86 - Release - Windows.10.Amd64.ClientRS3-x64 - Release 25676 area-System.Net [Regression] Test failed: System.Net.Http.Functional.Tests.HttpClientHandler_DangerousAcceptAllCertificatesValidator_Test / SetDelegate_ConnectionSucceeds ## Types of failures ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.IO.IOException : The decryption operation failed, see inner exception. -------- Interop+OpenSsl+SslException : Decrypt failed with OpenSSL error - SSL_ERROR_SSL. ------------ System.Security.Cryptography.CryptographicException : Error occurred during a cryptographic operation. at System.Net.Http.HttpConnection.<SendAsync>d__38.MoveNext() in /root/corefx-1259674/src/System.Net.Http/src/System/Net/Http/Managed/HttpConnection.cs:line 438 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.HttpConnectionHandler.<SendAsyncWithAwaitedConnection>d__4.MoveNext() in /root/corefx-1259674/src/System.Net.Http/src/System/Net/Http/Managed/HttpConnectionHandler.cs:line 43 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.CookieHandler.<SendAsync>d__3.MoveNext() in /root/corefx-1259674/src/System.Net.Http/src/System/Net/Http/Managed/CookieHandler.cs:line 31 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.AuthenticateAndRedirectHandler.<SendAsync>d__7.MoveNext() in /root/corefx-1259674/src/System.Net.Http/src/System/Net/Http/Managed/AuthenticateAndRedirectHandler.cs:line 62 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__62.MoveNext() in /root/corefx-1259674/src/System.Net.Http/src/System/Net/Http/HttpClient.cs:line 488 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpClientHandler_DangerousAcceptAllCertificatesValidator_Test.<>c__DisplayClass3_1.<<SetDelegate_ConnectionSucceeds>b__0>d.MoveNext() in /root/corefx-1259674/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.AcceptAllCerts.cs:line 54 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.<>c__DisplayClass3_0.<CreateServerAsync>b__0(Task t) in /root/corefx-1259674/src/Common/tests/System/Net/Http/LoopbackServer.cs:line 68 at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) in /root/coreclr/src/mscorlib/shared/System/Threading/ExecutionContext.cs:line 151 at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) in /root/coreclr/src/mscorlib/src/System/Threading/Tasks/Task.cs:line 2440 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpClientHandler_DangerousAcceptAllCertificatesValidator_Test.<SetDelegate_ConnectionSucceeds>d__3.MoveNext() in /root/corefx-1259674/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.AcceptAllCerts.cs:line 52 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Net.Security.SslStreamInternal.<ReadAsyncInternal>d__32`1.MoveNext() in /root/corefx-1259674/src/System.Net.Security/src/System/Net/Security/SslStreamInternal.cs:line 285 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.HttpConnection.<FillAsync>d__64.MoveNext() in /root/corefx-1259674/src/System.Net.Http/src/System/Net/Http/Managed/HttpConnection.cs:line 958 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.HttpConnection.<ReadNextLineAsync>d__62.MoveNext() in /root/corefx-1259674/src/System.Net.Http/src/System/Net/Http/Managed/HttpConnection.cs:line 867 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.HttpConnection.<SendAsync>d__38.MoveNext() in /root/corefx-1259674/src/System.Net.Http/src/System/Net/Http/Managed/HttpConnection.cs:line 313 ----- Inner Stack Trace ----- at Interop.OpenSsl.Decrypt(SafeSslHandle context, Byte[] outBuffer, Int32 offset, Int32 count, SslErrorCode& errorCode) in /root/corefx-1259674/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSsl.cs:line 269 at System.Net.Security.SslStreamPal.EncryptDecryptHelper(SafeDeleteContext securityContext, ReadOnlyMemory`1 input, Int32 offset, Int32 size, Boolean encrypt, Byte[]& output, Int32& resultSize) in /root/corefx-1259674/src/System.Net.Security/src/System/Net/Security/SslStreamPal.Unix.cs:line 207 ----- Inner Stack Trace ----- ``` ## History of failures Lots of failures in CI: * 12/2-12/18 - 58 failures (avg 3+/day) - see https://github.com/dotnet/corefx/issues/25676#issuecomment-353659053 for details on first failures on 12/2 * 12/19-1/5 - 44 failures (avg 2.5/day) * 1/6-1/14 - 44 failures (avg 5/day) Day | Build | OS | Details --- | --- | --- | --- 1/3 | 20180103.03 | Fedora25 | [ManagedHandler] [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180103.03/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.ManagedHandler_HttpClientHandler_DangerousAcceptAllCertificatesValidator_Test~2FSetDelegate_ConnectionSucceeds(acceptedProtocol:%20Tls,%20requestOnlyThisProtocol:%20False)) # Original report Related to #25646? cc: @Drawaes 25677 area-System.IO Don't directly throw Exception System.IO.FileSystem.AccessControl Hi @JeremyKuhne, @pjanotti, i'm working on this #23748. I did some change on exception type [here](https://github.com/dotnet/corefx/compare/master...MarcoRossignoli:issue_23748_Filesystem), what do you think?(tests on my x64 platform are ok) 25680 area-System.Net Making sure errors with the BIO's are picked up Currently just an investigation of #25676 25681 area-System.Xml XmlReader.Read shouldn't throw AggregateException Fixes https://github.com/dotnet/corefx/issues/25653. 25682 area-Infrastructure 'Implicit conversion loses integer precision' error Of the last 5 builds, 4 have failed with the following: > /root/corefx-1191223/src/Native/Unix/System.Native/pal_networking.c:2286:29: error: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Werror,-Wshorten-64-to-32] Links to these: https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_build?_a=summary&buildId=1190370 https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_build?_a=summary&buildId=1191223 https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_build?_a=summary&buildId=1191695 https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_build?_a=summary&buildId=1192572 25683 area-System.Runtime Add composition assembly to rd.xml to unblock reflection on exceptions Fixes https://github.com/dotnet/corefx/issues/25675 Currently building locally to validate. 25684 area-Infrastructure build.cmd fails when only VS pre-release is installed On this line https://github.com/dotnet/corefx/blob/master/run.cmd#L24 I only have VS2017 15.6 which is pre-release. `vswhere.exe` fails to list it as it now requires the `-prerelease` flag to list these versions. It then falls back to VS14 and fails to build binary assets. 25685 area-Meta Fix Alpine Linux dependency chain "The alpine Linux has incorrect parent set to ""any"" instead of ""unix"". This change fixes that." 25688 area-System.IO Fix tests for path validation changes on Windows The tests broke after removing the check for invalid characters api. This Pr fixes the test for the windows platform while keeping them disabled for other platforms 25689 area-Infrastructure Including pre-release versions of VS for builds Fixes #25684 25690 area-Infrastructure CoreFX downloads cli every build Hi, is there a way to prevent the system from downloading the cli tools every time I build? I'm trying to build on a laptop using a hotspot and it seems unnecessary to download a binary tool every time. 25691 area-System.IO Explore making state part of the find data Making the change to put state in RawFindData as suggested by @svick on https://github.com/dotnet/designs/pull/24#issuecomment-348785224. I think this way is better- note that I haven't added state to the transform delegate before, but it is intended to have it per the spec. @svick, @danmosemsft, @terrajobst 25692 area-System.Net Fix Alpine CURL concurrency issue On Alpine Linux, CURL uses LibreSSL for its HTTPS needs. That creates the same concurrency issue that we had with LibreSSL on OSX. It was fixed for OSX only in the past by detecting which SSL library CURL uses and using shared MultiAgent for all CurlHandler instances. This change extends it to all Unixes, since if CURL uses LibreSSL on a Linux distro, we need the same workaround. 25693 area-System.ComponentModel Fix ArgumentNullException in case of IValidatableObject returns null - GetObjectValidationErrors method was updated with checking validate results for null; - A several unit tests were appended; (#25495) 25694 area-System.Net Add missing Shutdown calls in HTTP loopback servers General goodness, but potentially the cause of https://github.com/dotnet/corefx/issues/25640 and maybe some other issues. cc: @davidsh, @wfurt, @Priya91 25696 area-System.IO Don't directly throw Exception System.IO.FileSystem.AccessControl Close #25677. @JeremyKuhne @pjanotti could be System.SecurityException a proper exception to throw?I haven't found any exception class defined under System.Security.AccessControl. 25697 area-System.Threading Add NS1.3 support to Channels Fix https://github.com/dotnet/corefx/issues/25121 @weshaggard is this correct? cc @joshfree there is a cost to supporting other versions -- @weshaggard suggest we not do it unless there's real value. It's your call. 25698 area-System.Data Don't directly throw Exception System.Data.SqlClient "@saurabh500 i've found other place where there are ""throw new Exception()"" what do you think?Instead of ArgumentException i found also a more specialized exception InvalidUdtException(but i'm not sure if make sense). " 25699 area-System.Net MulticastInterface set to loopback index does not work on OSX setsockopt with IP_MULTICAST_IF value should be a struct in_addr See https://github.com/dotnet/corefx/blob/9a563e12649a5f407d57605dc07a82637a22ef48/src/Native/Unix/System.Native/pal_networking.c#L2172 This is call from https://github.com/dotnet/corefx/blob/8f8b04afb41156aba5530992e3ed062d8bfad611/src/System.Net.Sockets/src/System/Net/Sockets/SocketPal.Unix.cs#L1135 So far seems to me we are just passing an interface index as an integer when linux setsockopt expects and in_addr struct [EDIT] Link the source code (don't reference master) by @karelz 25702 area-System.Numerics API Proposal: Add System.Numerics.Half 16 bit floating point number conforming to IEEE 754:2008 binary16 This proposal introduce `System.Half` numeric structure conforming to IEEE 754:2008 `binary16` specification and defines it mainly as a interchange format used at interface between managed code and external code capable of handling `binary16` arithmetic operations. It can be extended to support full `binary16` arithmetic when required coreclr runtime support will be available. Additional extension of functionality could be available in future via language support for new floating-point number literals. Rationale and Proposed API ================== Changing computation requirements have led to extension of IEEE 754 floating point standard with new floating-point number sizes named as `binary16`, `binary32` (equivalent to float), `binary64` (equivalent to double) and `binary128`. Any further extensions are possible in 32 bits increments. Current computation workloads in AI, graphics, media and gaming take advantage of `binary16` format to simultaneously speed up calculations and keep data size small. Increasing number of hardware supports `binary16` (or similar) arithmetic: graphics cards from Nvidia and AMD, Arm processors, Arm and Intel SIMD conversion instructions. Adding `System.Numerics.Half` API should enable implementation and usage of F16C Intel conversion intrinsics as well as of several Arm intrinsics. In addition `System.Numerics.Half` can be used to support partially IEEE 754 conforming Arm floating-point 16 bit arithmetic. `System.Numerics.Half` format can represent normalized positive and negative values in the range of `2^{-14}` to `65504`. System.Numerics.Half API ----------------- `System.Numerics.Half` is a binary - power of 2 floating point number and its bit representation is as follows: (i) 1 bit represents sign, (ii) 5 bits represent mantissa, and (iii) 11 bits (10 explicitly stored) represent significand. ```C# namespace System.Numerics { // // Summary: // Represents a half-precision floating-point number. public struct Half : IComparable, IFormattable, IComparable<Half>, IEquatable<Half> { public static readonly Half MinValue; public static readonly Half Epsilon; public static readonly Half MaxValue; public static readonly Half PositiveInfinity; public static readonly Half NegativeInfinity; public static readonly Half NaN; public static bool IsInfinity(Half h); public static bool IsNaN(Half h); public static bool IsNegativeInfinity(Half h); public static bool IsPositiveInfinity(Half h); public static bool IsNormal(Half h); public static bool IsSubnormal(Half h); public static bool IsNegative(Half h); public static Half Parse(string s); public static Half Parse(string s, NumberStyles style); public static Half Parse(string s, NumberStyles style, IFormatProvider provider); public static Half Parse(string s, IFormatProvider provider); public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider provider = null); public static bool TryParse(string s, out Half result); public static bool TryParse(string s, NumberStyles style, IFormatProvider provider, out Half result); public static bool TryParse(ReadOnlySpan<char> s, out Half result); public static bool TryParse(ReadOnlySpan<char> s, NumberStyles style, IFormatProvider provider, out Half result); public int CompareTo(object value); public int CompareTo(Half value); public bool Equals(Half obj); public override bool Equals(object obj); public override int GetHashCode(); public TypeCode GetTypeCode(); public string ToString(IFormatProvider provider); public string ToString(string format); public string ToString(string format, IFormatProvider provider); public override string ToString(); public static bool operator ==(Half left, Half right); public static bool operator !=(Half left, Half right); public static bool operator <(Half left, Half right); public static bool operator >(Half left, Half right); public static bool operator <=(Half left, Half right); public static bool operator >=(Half left, Half right); public static implicit operator Single(Half value); public static implicit operator Double(Half value); public static implicit operator Int32(Half value); public static implicit operator Int64(Half value); public static implicit operator Half(Byte value); public static implicit operator Half(SByte value); public static implicit operator Half(Int16 value); public static explicit operator Half(Single value); public static explicit operator Half(Double value); public static explicit operator Byte(Half value); public static explicit operator SByte(Half value); public static explicit operator Int16(Half value); public static explicit operator Half(Int32 value); public static explicit operator Half(Int64 value); } } ``` Naming --------- Existing implementations use either Half or _FloatN (_Float16, _Float32) as the name of type implementing IEEE 754 binary16. _FloatN is alredy defined in ISO/IEC TS 18661-3:2015 C language standard. Since IEEE 754 specifies extended binary floating-point types it was naturally adopted by C2x ISO standard as _FloatNx, i.e. _Float64x. Similar naming convention could be useful in .NET framework where besides Single and Double there could be defined IEEE 754:2008 binaryN, binaryNx conformant `System.Numerics.Float8`, `System.Numerics.Float16`, `System.Numerics.Float32`, `System.Numerics.Float64`, `System.Numerics.Float128` etc. types and equivalent to binaryNx `System.Numerics.Float8Ext` ... `System.Numerics.Float64Ext`, `System.Numerics.Float128Ext` types. This type of naming convention would be intuitively very familiar to programmers due to signed and unsigned integer naming and in addition similar naming convention could be used in the case of implementing decimal numbers covering wider range of bit sizes. Language support -------------------- Despite that this part of proposal should go into csharplang repository for the sake of completeness it is included here as well. Full support of new `System.Numerics.Half` numeric type would require introduction of new numeric literals allowing for type initialization in code. C#/VB/F# language support may be achieved with new numeric floating-point literal suffixes `fxx` for all floating-point type initialization: ``` Half h = 0.45e-11f16; Single f = 0.45768e-35f32; Double d = 0.45678342987e-57f64; ``` Such scheme would be future proof by allowing support of any size of floating point literal by adjusting `fxx` numeric value. Furthermore, it would allow to support extended precision binary floating-point literals just by adding `e` or `x` at the end of the suffix i.e. `f64e` or `f64x`. It is not necessary to introduce new language keyword i.e. `half` to provide language level support for new type, however, it could be beneficial. The timing for such support should be dependent on arithmetic operations support by the runtime. Arithmetic operations ------------------------ It is possible to support arithmetic operations on `System.Numerics.Half` on all architectures by implicitly promoting it to `System.Single` and performing calculation using `System.Single` native CPU support and converting result back to `System.Half` and alternatively by using partial support available currently on some Arm processors. Arm `Half` implementation is similar but not conforming to IEEE 754:2008 as it does not support infinities or NaNs. Instead, the range of exponents is extended, so that this format can represent normalized values in the range of 2^{-14} to 131008. Several vendors are in process of implementing support for Half IEEE 754:2008 arithmetic in silicon and full support for hardware based arithmetic operations should be coming soon. Updates --------- Converted `const Half` syntax to `static readonly`. Added implicit conversion operators to `Single` and `Double` and explicit conversion operators from `Single` and `Double` and additional possible implicit integer conversions with matching reverse explicit conversions. Open Problems ----------------- ### Namespace It is not entirely clear in which namespace `Half` should be defined. Should it be `System.Half` or `System.Numerics.Half`. C11 standard defines _FloatN (_Float16, _Float32) as supported basic types, therefore, due to C# being in a C language family could follow C. ### Naming Referring to existing standardization efforts in C2x it could be desired to keep naming scheme similar and consistent with current naming scheme for integrals. Additional types introduced in IEEE 754:2008 and emergence of 8bit binary float usage may support using FloatNN naming scheme i.e. Float16, Float32, Float64 and in near future Float8 and Float128. 25703 area-Serialization Pull out the SerializeAndDeseriaze method into common Pull out the SerializeAndDeseriaze method into common so the other team can use it for the DCS tests of their types. #20329 @shmao @zhenlan @mconnew 25704 area-System.Runtime In-place Array.Resize Is there anything blocking us from providing in-place `Array.Resize` experience when the new size is smaller than the current size of the array? It would leave empty space in the heap, but that would be fixed the next time GC compaction runs. 25705 area-System.Net Dotnet Core 2.0.3 Migration | Encoding unable to translate bytes [8B] "Hi folks, Im not sure if this is the correct place for this issue so please tell me if i should move it. I recently have upgraded one of my apps to use dotnet core 2.0.3 from 1.1.4. Everything works fine locally but when I deploy to my app service in azure I get the following exception. ```c# System.Text.DecoderFallbackException: Unable to translate bytes [8B] at index 1 from specified code page to Unicode. ``` The code that calls it is a httpclient that talks between the apps. ```c# public async Task<T1> Get<T1>(string url, Dictionary<string, string> urlParameters = null) where T1 : DefaultResponse, new() { var authToken = _contextAccessor.HttpContext.Request.Cookies[""authToken""]; using (var client = new HttpClient().AcceptJson().Acceptgzip().AddAuthToken(authToken)) { var apiResponse = await client.GetAsync(CreateRequest(url, urlParameters)); T1 output; if (apiResponse.IsSuccessStatusCode) { output = await apiResponse.Content.ReadAsAsync<T1>(); //output.Succeeded = true; } else { output = new T1(); var errorData = GlobalNonSuccessResponseHandler.Handle(apiResponse); output.Succeeded = false; output.Messages.Add(errorData); } return output; } } public static HttpClient AcceptJson(this HttpClient client) { client.DefaultRequestHeaders.Clear(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(""application/json"")); return client; } public static HttpClient Acceptgzip(this HttpClient client) { // Commenting this out fixes the issue. //client.DefaultRequestHeaders.AcceptEncoding.Add(StringWithQualityHeaderValue.Parse(""gzip"")); client.DefaultRequestHeaders.AcceptEncoding.Add(StringWithQualityHeaderValue.Parse(""deflate"")); return client; } public static HttpClient AddAuthToken(this HttpClient client, string authToken) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(""Bearer"", authToken); return client; } ``` I'm a bit stumped as to whats going on. So I have 2 apps which we call client and server from now on. Client uses the above code to talk to the server. Locally this is fine on azure not so, this all worked fine before upgrading. So I setup the client locally to talk to the server on azure I was able to replicate the issue. I had a look at the response in fiddler and it is able to correctly decode it. I decided to remove gzip and then everything started working. ```c# client.DefaultRequestHeaders.AcceptEncoding.Add(StringWithQualityHeaderValue.Parse(""gzip"")); ``` Can anyone explain this? SO question for ref https://stackoverflow.com/questions/47625708/dotnet-core-2-0-3-migration-encoding-unable-to-translate-bytes-8b [EDIT] Add C# syntax highlighting by @karelz" 25706 area-System.Runtime RuntimeInformation.OSArchitecture returns wrong value between net461 and netstandard2.0 and loads two different assemblies "## **Example:** Create a new application and a new library: `dotnet new console` Repro.cs: ```csharp using System; using System.Runtime.InteropServices; namespace Repro { class Program { public static void Main() { Console.WriteLine(RuntimeInformation.OSArchitecture + typeof(RuntimeInformation).AssemblyQualifiedName); var temp = typeof(Environment).GetProperty(""Is64BitOperatingSystem"", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); if (temp != null) { temp.GetValue(null); Console.WriteLine(""Is64BitOS: "" + temp.GetValue(null)); } ReproLibrary.Class1.Print(); } } } ``` Repro.csproj: ```csproj <Project Sdk=""Microsoft.NET.Sdk""> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>net461</TargetFramework> </PropertyGroup> <ItemGroup> <ProjectReference Include=""..\ReproLibrary\ReproLibrary.csproj"" /> </ItemGroup> </Project> ``` Now create a class library called ReproLibrary. ReproLibrary.cs `dotnet new classlib` ```csharp using System; using System.Runtime.InteropServices; namespace ReproLibrary { public class Class1 { public static void Print() { Console.WriteLine(RuntimeInformation.OSArchitecture + typeof(RuntimeInformation).AssemblyQualifiedName); var temp = typeof(Environment).GetProperty(""Is64BitOperatingSystem"", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); if (temp != null) { temp.GetValue(null); Console.WriteLine(""Is64BitOS: "" + temp.GetValue(null)); } } } } ``` ReproLibrary.csproj ```csproj <Project Sdk=""Microsoft.NET.Sdk""> <PropertyGroup> <TargetFramework>netstandard2.0</TargetFramework> </PropertyGroup> </Project> ``` ## **Expected Result:** I expect both RuntimeInformation.OSArchitecture to return the same assembly and return the same results. I also expect them both to return x64 as my OS is 64 bit. ## **Actual Results:** ``` X64 System.Runtime.InteropServices.RuntimeInformation, System.Runtime.InteropServices.RuntimeInformation, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a Is64BitOS: True X86 System.Runtime.InteropServices.RuntimeInformation, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Is64BitOS: True ``` There seems to be two issues here. One is that that the mscorlib library is return x86, which it should not. Secondly, referencing netstandard2.0 and net461 brings two different versions of System.Runtime.InteropServices.RuntimeInformation, which have different behavior. This could be because the machine has net471 on it and the associated issues with it, however it is hard to tell if it is installed. cc/ @pranavkm @pakrym " 25707 area-System.Runtime System.Runtime.CompilerServices.Unsafe package needs an updated version for other runtimes As C# 7.2 is now released there is a need for an updated S.R.CS.Unsafe on runtimes other than .NET Core. I couldn't find any way to get an updated nuget package for S.R.CS.Unsafe, can't even build it from source and the last preview version is from September. 25709 area-System.Diagnostics Send notification about HTTP response without content (netfx) On netfx, HttpClient (WebRequests) is not instrumented with DiagnosticSource events. Instead, DiagnosticSource implements the reflection-based hook that injects instrumentation at runtime if the user enabled it. The hook does not properly notify about async responses that have 0-length content. This case is treated specially here: http://referencesource.microsoft.com/#System/net/System/Net/HttpWebResponse.cs,525 It happens because at the hook is called moment, HttpWebRequest does not yet have `_HttpResponse` property assigned (that is used by the hook). However, it has `_CoreResponse` data holding status code and response headers (that is what we expect listeners to be interested in). This changes fires a 'Stop' event (with a new name) and new payload (status and headers). The fix is needed for ApplicationInsights (https://github.com/Microsoft/ApplicationInsights-dotnet-server/issues/739) as it cannot track 0-length responses done with HttpClient on .net fx. Request to document internal API is submitted - TFS 533155. @brahmnes @vancem @zakimaksyutov 25710 area-System.IO Fix tests for path validation changes on Unix Rebase on PR #25688 Fixes #25665 25711 area-Microsoft.CSharp Remove dead code from MS.CSharp's BadOperatorTypesError and related methods * Remove dead paths in `BadOperatorTypesError` `pOperand1` is never null, and neither operand can ever have a null or `ErrorType` type, so remove path for those possibilities. It's worth noting the possible call paths here, and what types they can possibly give to the operands ``` BadOperatorTypesError BindLiftedStandardUnop BindStandardUnaryOperator Recurse (predef) RB.BindUnaryOperation (creates the operands, never with ErrorType) bindNullEqualityComparison BindStandardBinop BindBinaryOperation (creates the operands, never with ErrorType) BadOperatorTypesError (overload) BindIntegerNeg BindIntOp BindEnumUnaOp (predef) BindEnumBinOp (predef) BindIntUnaOp (predef-always binding) BindIntBinOp (predef-always binding) BindStandardUnaryOperator (see above) BindStandardBinop (see above) BindStandardBinopCore BindStandardBinop (see above) ``` * Remove unused parameters from `BadOperatorTypesError` `ek` and `pTypeErr` are never used, so remove them. Merges the overloads. * Change `BadOperatorTypesError` to return rather than throwing exceptions Since it throws in every path, have the error thrown at the call site, making it more clearly an error path. * Remove `UnwrapExpression` The only place `ExprWraps` are produced outside of the `ExpressionTreeRewriter` is in `BindUserBoolOp` which passes them to `bindUDUnop`. There's no path that can bring them to `BadOperatorTypesError` which calls `UnwrapExpression`. * Have `CalculateExprAndUnaryOpKinds` return a value tuple and throw ICE on failure. Rather than have an impossible condition checked for outside of it. (ICE is more appropriate, too). * Have GetBinopKindAndFlags return value tuple and throw ICE on failure. Rather than have an impossible condition checked for outside of it. 25712 area-System.Memory Test failure: System.SpanTests.ReadOnlySpanTests/Overlap(x1: 100, y1: 200, x2: 0, y2: 200, expected: True) Opened on behalf of @Sunny-pu The test `System.SpanTests.ReadOnlySpanTests/Overlap(x1: 100, y1: 200, x2: 0, y2: 200, expected: True)` has failed. System.ArgumentException : Overlapping spans have mismatching alignment. Stack Trace: at System.SpanTests.ReadOnlySpanTests.Overlap(Int32 x1, Int32 y1, Int32 x2, Int32 y2, Boolean expected) in E:\A\_work\1835\s\corefx\src\System.Memory\tests\ReadOnlySpan\Overlaps.cs:line 987 at _$ILCT$.$ILT$ReflectionDynamicInvoke$.InvokeRetVIIIII<System.Int32, System.Int32, System.Int32, System.Int32, System.Boolean>(Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean targetIsThisCall) at System.InvokeUtils.CalliIntrinsics.Call(IntPtr dynamicInvokeHelperMethod, Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean isTargetThisCall) at System.InvokeUtils.CallDynamicInvokeMethod(Object thisPtr, IntPtr methodToCall, Object thisPtrDynamicInvokeMethod, IntPtr dynamicInvokeHelperMethod, IntPtr dynamicInvokeHelperGenericDictionary, Object targetMethodOrDelegate, Object[] parameters, BinderBundle binderBundle, Boolean wrapInTargetInvocationException, Boolean invokeMethodHelperIsThisCall, Boolean methodToCallIsThisCall) in CallDynamicInvokeMethod:line 16707566 Build : Master - 20171205.04 (UWP ILC Tests) Failing configurations: - Windows.10.Amd64.ClientRS3-x86 - Release 25713 area-System.Net Add several more shutdown calls to sockets tests Potentially fixes https://github.com/dotnet/corefx/issues/14673. cc: @wfurt, @davidsh 25715 area-Microsoft.CSharp MS.CSharp Remove some dead paths for impossible errors in FillInArgInfoFromArgList & BindMethodGroupToArguments Like #25711 this has more path following and verification than changes, but like it it knocks out an impossible use of `ErrorType` that could allow for a bigger pay-off in simplification when they're all gone. * Remove `typeErrors` `out` parameter from `CountArguments` Never used. * Remove `ref` qualifier from `BindMethodGroupToArgumentsCore` argument. Never written back. * Remove unreachable error case from `FillInArgInfoFromArgList` `arg.Type` can never be null, so remove branch for that happening. The tributaries of `FillInArgInfoFromArgList`, so to speak are as follows, noting which argument goes on to provide the `arg` local within `FillInArgInfoFromArgList`. ``` FillInArgInfoFromArgList ReorderArgumentsForNamedAndOptional (result.OptionalArguments) BindCall (Creates arguments from ArgumentObjects, which always have type) CreateIndexer BindProperty (from ArgumentObject) BindUDBinop (arg1, arg2) BindUserDefinedBinOp (info) BindStandardBinop (arg1, arg2) BindBinaryOperation (from ArgumentObject) BindUserDefinedBinOp (info) BindStandardBinop (above) BindMethodGroupToArgumentsCore (args) BindMethodGroupToArguments (args) BindWinRTEventAccessor (one from ArgumentObject, one or two with MethodGroupType type) BindCall (above) CreateIndexer (above) bindUDUnop (arg) BindUnaryOperation (from ArgumentObject) BindUserBoolOp (pCall.OptionalArguments.OptionalElement) BindUserDefinedBinOp (above) PopulateSignatureList (pArgument) BindStandardUnaryOperator (pArgument) BindUnaryOperation (above) BindUnaryOperation (predef type) BindStandardUnaryOperator (cast to predef type) PopulateSignatureList (above) ``` * Remove dead path for impossible error from BindMethodGroupToArguments `grp.Name` could never be null. Tracking calls to `BindMethodGroupToArguments` and where `grp.Name` comes from: ``` BindMethodGroupToArguments BindWinRTEventAccessor (always predefined named) BindCall (from payload name) CreateMemberGroupEXPR (string overload, guarantees always non-null name) CreateIndexer CreateMemberGroupEXPR (as above). ``` 25716 area-System.Runtime Exposed RuntimeWrappedException constructor. Fixes #24946 25717 area-System.Security Error to create X509Certificate2 instance Hi I try to create an instance from the class X509Certificate2 insight a container using microsoft/aspnetcore:2.0.3-nanoserver-1709 as base image. That’s the code I use: ``` var buffer = Convert.FromBase64String(certStringInBase64); return new X509Certificate2(buffer, password, X509KeyStorageFlags.MachineKeySet); ``` It works everywhere besides the image I pointed out on top. On nanoserver 1709 I get the following exception: ``` Application startup exception: Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException: Object was not found at Internal.Cryptography.Pal.CertificatePal.FilterPFXStore(Byte[] rawData, SafePasswordHandle password, PfxCertStoreFlags pfxCertStoreFlags) at Internal.Cryptography.Pal.CertificatePal.FromBlobOrFile(Byte[] rawData, String fileName, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags) at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(Byte[] rawData, SecureString password, X509KeyStorageFlags keyStorageFlags) at Sportflash.Extensions.Hosting.Kestrel.Store.Get(SecureString password) at Sportflash.Extensions.Hosting.Kestrel.AppServiceHostBuilder.GetCertificateOptions() at Sportflash.Extensions.Hosting.Kestrel.AppServiceHostBuilder.<>c.<UseKestreDependOnEnvironment>b__2_2(ListenOptions c) at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerOptions.Listen(IPEndPoint endPoint, Action`1 configure) at Sportflash.Extensions.Hosting.Kestrel.AppServiceHostBuilder.<>c__DisplayClass2_0.<UseKestreDependOnEnvironment>b__1(KestrelServerOptions o) at Microsoft.Extensions.Options.OptionsFactory`1.Create(String name) at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) at System.Lazy`1.CreateValue() at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.CreateServiceContext(IOptions`1 options, ILoggerFactory loggerFactory) at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer..ctor(IOptions`1 options, ITransportFactory transportFactory, ILoggerFactory loggerFactory) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProvider provider) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider) at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureServer() at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication() Unhandled Exception: Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException: Object was not found at Internal.Cryptography.Pal.CertificatePal.FilterPFXStore(Byte[] rawData, SafePasswordHandle password, PfxCertStoreFlags pfxCertStoreFlags) at Internal.Cryptography.Pal.CertificatePal.FromBlobOrFile(Byte[] rawData, String fileName, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags) at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(Byte[] rawData, SecureString password, X509KeyStorageFlags keyStorageFlags) at Sportflash.Extensions.Hosting.Kestrel.Store.Get(SecureString password) at Sportflash.Extensions.Hosting.Kestrel.AppServiceHostBuilder.GetCertificateOptions() at Sportflash.Extensions.Hosting.Kestrel.AppServiceHostBuilder.<>c.<UseKestreDependOnEnvironment>b__2_2(ListenOptions c) at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerOptions.Listen(IPEndPoint endPoint, Action`1 configure) at Sportflash.Extensions.Hosting.Kestrel.AppServiceHostBuilder.<>c__DisplayClass2_0.<UseKestreDependOnEnvironment>b__1(KestrelServerOptions o) at Microsoft.Extensions.Options.OptionsFactory`1.Create(String name) at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) at System.Lazy`1.CreateValue() at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.CreateServiceContext(IOptions`1 options, ILoggerFactory loggerFactory) at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer..ctor(IOptions`1 options, ITransportFactory transportFactory, ILoggerFactory loggerFactory) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProvider provider) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider) at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureServer() at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication() at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build() at Sportflash.Extensions.Hosting.Kestrel.AppServiceHostBuilder.Build[TStartup](Int32 port, String[] args) at Sportflash.Data.Router.Program.Main(String[] args) in E:\Build\AGENT01\_work\16\s\Sportflash.Data.Router\Program.cs:line 10 ``` 25719 area-Meta Serverless performance analysis Investigate the performance of Azure Functions 25720 area-Meta Profile Guided Optimizations: PGO tuning PGO tuning of native components in the .NET Core stack 25721 area-Meta Performance scenarions: RWC workloads Bring up Real World Code scenarios for benchmarking 25722 area-Meta Cross-platform performance analysis: Linux/Mac/Windows Cross-platform performance analysis: Linux/Mac/Windows 25723 area-Meta Competitive performance analysis Competitive performance analysis across various managed stacks and environments 25725 area-Meta Performance data publicly available Per PR/Commit publicly available performance data coming out of the performance reporting systems. 25726 area-System.Collections Add tests for DataContractSerializer serializing collection types We need have tests covering DataContractSerializer serializing the following types. Refer https://github.com/dotnet/corefx/blob/master/src/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs on how to add the DCS tests using the common helper method. #20329 - [ ] System.Collections.Generic.LongEnumEqualityComparer`1[[System.Runtime.Serialization.Formatters.Tests.UInt64Enum]] - [ ] System.Collections.Generic.EnumEqualityComparer`1[[System.Runtime.Serialization.Formatters.Tests.UInt32Enum]] - [ ] System.Collections.Generic.SByteEnumEqualityComparer`1[[System.Runtime.Serialization.Formatters.Tests.SByteEnum]] - [ ] System.Collections.Generic.ShortEnumEqualityComparer`1[[System.Runtime.Serialization.Formatters.Tests.Int16Enum]] - [ ] System.Collections.Generic.SortedList`2[[System.Int32],[System.Runtime.Serialization.Formatters.Tests.Point]] - [ ] System.Collections.ObjectModel.ObservableCollection`1[[System.Int32]] // The implementations between core and netfx are completely different. I don't think serialization works here without a custom serialization routine - [ ] System.Collections.ObjectModel.ReadOnlyDictionary`2[[System.Int32],[System.String]] - [ ] System.Collections.ObjectModel.ReadOnlyObservableCollection`1[[System.Int32]] - [ ] System.Collections.Specialized.ListDictionary - [ ] System.Collections.Specialized.StringCollection 25727 area-System.ComponentModel Add tests for DataContractSerializer serializing BindingList types We need have tests covering DataContractSerializer serializing the following type. Refer https://github.com/dotnet/corefx/blob/master/src/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs on how to add the DCS tests using the common helper method. #20329 - [ ] System.ComponentModel.BindingList`1[[System.Runtime.Serialization.Formatters.Tests.Point]] 25728 area-System.Data Add tests for DataContractSerializer serializing SqlTypes types We need have tests covering DataContractSerializer serializing the following types. Refer https://github.com/dotnet/corefx/blob/master/src/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs on how to add the DCS tests using the common helper method. #20329 - [ ] System.Data.SqlTypes.SqlBoolean - [ ] System.Data.SqlTypes.SqlByte - [ ] System.Data.SqlTypes.SqlDateTime - [ ] System.Data.SqlTypes.SqlDouble - [ ] System.Data.SqlTypes.SqlInt16 - [ ] System.Data.SqlTypes.SqlInt32 - [ ] System.Data.SqlTypes.SqlInt64 - [ ] System.Data.SqlTypes.SqlString 25729 area-System.Drawing Add tests for DataContractSerializer serializing System.Drawing types We need have tests covering DataContractSerializer serializing the following types. Refer https://github.com/dotnet/corefx/blob/master/src/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs on how to add the DCS tests using the common helper method. #20329 - [ ] System.Drawing.Point - [ ] System.Drawing.PointF - [ ] System.Drawing.Rectangle - [ ] System.Drawing.RectangleF - [ ] System.Drawing.Size - [ ] System.Drawing.SizeF 25730 area-System.Globalization Add tests for DataContractSerializer serializing System.Globalization types We need have tests covering DataContractSerializer serializing the following types. Refer https://github.com/dotnet/corefx/blob/master/src/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs on how to add the DCS tests using the common helper method. #20329 - [ ] System.Globalization.CompareInfo - [ ] System.Globalization.SortVersion 25731 area-System.Net Add tests for DataContractSerializer serializing System.Net.Cookie types We need have tests covering DataContractSerializer serializing the following types. Refer https://github.com/dotnet/corefx/blob/master/src/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs on how to add the DCS tests using the common helper method. #20329 - [ ] System.Net.Cookie - [ ] System.Net.CookieCollection // I expect issues here as netfx and core are using different types in serialized fields - [ ] System.Net.CookieContainer 25732 area-Serialization Add tests for DataContractSerializer serializing System types We need have tests covering DataContractSerializer serializing the following types. Refer https://github.com/dotnet/corefx/blob/master/src/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs on how to add the DCS tests using the common helper method. #20329 - [x] System.Boolean - [x] System.Byte - [x] System.Char - [x] System.Int16 - [x] System.Int32 - [x] System.Int64 - [ ] System.Lazy`1[[System.Int32]] - [x] System.SByte - [x] System.Single - [x] System.UInt16 - [x] System.UInt32 - [x] System.UInt64 25733 area-System.Security .Net Core cryptography I want to sign a xml file with net core 2 ```c# using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; using System.Security.Cryptography.Xml; using System.Security.Cryptography.Pkcs; using System.Text; using System.Threading.Tasks; RSACryptoServiceProvider rsa = OpenKeyFile(filename, pPassword); RSAParameters rsaParameters = rsa.ExportParameters(true); X509Certificate cert = new X509Certificate(pCerFile); KeyInfoX509Data keyData = new KeyInfoX509Data(cert); string X509SerialNumber = (System.Text.Encoding.ASCII.GetString(cert.GetSerialNumber())).Reverse(); string X509IssuerName = cert.Issuer.RemoveDiacritics(); X509IssuerSerial xserial; ``` The X509IssuerSerial declaration show the following error: The type name 'X509IssuerSerial' could not be found in the namespace 'System.Security.Cryptography.XML'. This type has been forwarded to assembly 'System.Security.Cryptography.Pkcs The documentation shows that I should be in the System.Security.Cryptography.Xml namespace. Is the other way should I use? Thanks Alberto Lopez [EDIT] Add C# syntax highlighting by @karelz 25734 area-System.Security Convert Marvin hashing to use ReadOnlySpan Current managed implementation is using references and Unsafe.Add. This code is virtually unsafe and is problematic when i.e. passed length is invalid. Converting the code to use ReadOnlySpan would mitigate any issues of this kind. Currently it is a caller responsibility to make sure of that. 25736 area-System.Linq Replace S.L.Expression's CanCache with the use of Type.IsCollectible Much more dependable than the conservative approach of only considering mscorlib types collectible. * Use RunAndCollect on dynamic assemblies used for tests. Allows for a path to be followed for collectible types (and they should probably have been collectible anyway). 25738 area-System.Collections Implementing ItemRef API Proposal (C# 7.2 constructs to S.C.I) Contributes to #25189 * Adds `ItemRef()` to `ImmutableArray<V>` and `ImmutableArray<V>.Builder`. * Adds `ItemRef()` to `ImmutableList<V>` and `ImmutableList<V>.Builder`. * Adds `ItemRef()` to `ImmutableSortedSet<V>` and `ImmutableSortedSet<V>.Builder`. * Adds `PeekRef()` to `ImmutableQueue<V>` and `ImmutableStack<V>`. * Adds `ValueRef()` to `ImmutableSortedDictionary<V>` and `ImmutableSortedDictionary<V>.Builder`. 25739 area-System.Reflection System.Reflection.Metadata intermittent failures on RHEL https://mc.dot.net/#/user/krwq/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/e7eb637d18b531e46e64997fe9de55ae1d52521e/workItem/System.Reflection.Metadata.Tests All of the errors look more or less like: ``` System.BadImageFormatException : Invalid COR20 header signature. at System.Reflection.Metadata.MetadataReader.ReadMetadataHeader(BlobReader& memReader, String& versionString) in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/src/System/Reflection/Metadata/MetadataReader.cs:line 185 at System.Reflection.Metadata.MetadataReader..ctor(Byte* metadata, Int32 length, MetadataReaderOptions options, MetadataStringDecoder utf8Decoder) in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/src/System/Reflection/Metadata/MetadataReader.cs:line 97 at System.Reflection.Metadata.Tests.MetadataReaderTests.GetMetadataReader(Byte[] peImage, Int32& metadataStartOffset, Boolean isModule, MetadataReaderOptions options, MetadataStringDecoder decoder) in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs:line 81 at System.Reflection.Metadata.Tests.AssemblyDefinitionTests.ValidateAssemblyNameForAssemblyDefinition() in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/src/System.Reflection.Metadata/tests/Metadata/TypeSystem/AssemblyDefinitionTests.cs:line 84 ``` 25740 area-Serialization Add stable version for SGEN @shmao @zhenlan @mconnew 25741 area-System.Net Making a web request with CachePolicy and Fiddler on causes null-reference exception "This bug occurs in .NET FX (tested .NET Framework 4.5.2 and 4.7). It only occurs when Fiddler is running as well. The reproducer is a simple GET request with the cache policy enabled: ```cs var httpClient = new HttpClient(new WebRequestHandler() { CachePolicy = new RequestCachePolicy(RequestCacheLevel.Default) }); var address = ""http://coastwatch.pfeg.noaa.gov/erddap/wms/jplAmsreSstMon_LonPM180/request?VERSION=1.3.0&SERVICE=WMS&REQUEST=GetCapabilities""; var str = await httpClient.GetStringAsync(new Uri(address)); ``` This request will fail with a `HttpRequestException`, but if you look at the inner exceptions, what's really happening is a `NullReferenceException` in `HttpWebRequest.CheckCacheUpdateOnResponse():` https://github.com/Microsoft/referencesource/blob/7de0d30c7c5ef56ab60fee41fcdb50005d24979a/System/net/System/Net/HttpWebRequest.cs#L4310  It doesn't seem to happen with all URLs. The above URL has an attachment in the response, which I suspect is related. /CC @fragmer" 25742 area-System.Data Reduce blocking calls throughout SqlConnection.OpenAsync() and other async APIs on SqlClient This is a follow up to the discussion at https://github.com/dotnet/corefx/issues/25620#issuecomment-349428958. ## TL;DR the managed SNI implementation in SqlClient contains code that performs the DNS resolution and initiates the socket connection in a blocking manner. Ideally we should replace this with proper async code. ## Details We now know about these cases in the constructor of https://github.com/dotnet/corefx/blob/master/src/System.Data.SqlClient/src/System/Data/SqlClient/SNI/SNITcpHandle.cs and we know that it impacts OpenAsync. But there could be other APIs impacted and other parts of the implementation that use blocking calls. Currently the code in the constructor of `SNITcpHandle` is actually invoking the async versions of the methods (`Dns.GetHostAddressesAsync()` and `Socket.ConnectAsync()`) but then they are blocking on Task.Result. @saurabh500 has proposed that we switch to the sync versions of those APIs in the constructor as part of the fix for #25620 in the short term. However in the long term we should look into refactoring the code out of the constructor (e.g. defer the work to a `EnsureConnectedAsync()` private method) so that I can be made proper async. 25743 area-Meta Adding a preprocessor check for which C library the compiler is using. This is related to this issue: https://github.com/dotnet/core-eng/issues/2204 The problem was related to the prototype/implementation of the ioctl function in the MUSL library used by the Alpine OS. The Alpine OS uses a C library implementation called MUSL. This library declares/implements the ioctl function as ioctl(int, int, ...). However, most Linux distros use the Glibc which declares/implements the ioctl function as ioctl(int, unsigned long, ...). Since a parameter was used to tell the compiler to consider as error the conversions from wider types (unsigned long) to smaller ones (int) the compilation was halting. A preprocessor check was added to check whether the program is being compiled using the Glibc or not. 25744 area-Microsoft.CSharp Remove Microsoft.CSharp's BindBinaryAssignmentFailedNullReference Uncallable as `arguments[0].Type` can never be null (and would have thrown 4 lines previous if it ever was). 25745 area-System.Data Test failure: System.Data.Common.Tests.DbConnectionTests/ProviderFactoryTest Opened on behalf of @Sunny-pu The test `System.Data.Common.Tests.DbConnectionTests/ProviderFactoryTest` has failed. Assert.NotNull() Failure Stack Trace: at System.Data.Common.Tests.DbConnectionTests.ProviderFactoryTest() in E:\A\_work\1434\s\corefx\src\System.Data.Common\tests\System\Data\Common\DbConnectionTests.cs:line 154 at _$ILCT$.$ILT$ReflectionDynamicInvoke$.InvokeRetV(Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean targetIsThisCall) at System.InvokeUtils.CalliIntrinsics.Call(IntPtr dynamicInvokeHelperMethod, Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean isTargetThisCall) at System.InvokeUtils.CallDynamicInvokeMethod(Object thisPtr, IntPtr methodToCall, Object thisPtrDynamicInvokeMethod, IntPtr dynamicInvokeHelperMethod, IntPtr dynamicInvokeHelperGenericDictionary, Object targetMethodOrDelegate, Object[] parameters, BinderBundle binderBundle, Boolean wrapInTargetInvocationException, Boolean invokeMethodHelperIsThisCall, Boolean methodToCallIsThisCall) in CallDynamicInvokeMethod:line 16707566 Build : Master - 20171205.06 (UWP ILC Tests) Failing configurations: - Windows.10.Amd64.ClientRS3-x64 - Release 25746 area-System.Console Support Console.beep on Linux (Fedora/RHEL) @chiddekel commented on [Tue Dec 05 2017](https://github.com/dotnet/core/issues/1130) Run on OS: Fedora 27 Kernel Linux: 4.13.16-302.fc27.x86_64 Step zero: `yum install beep` First, run` sudo modprobe pcspkr` and then beep should work. Additional uncomment the /etc/modprobe.d/beep.conf line at: `# alias platform:pcspkr pcspkr` to `alias platform:pcspkr pcspkr` For automatic load pcspkr module Run application beep e.g - `/usr/bin/beep -f 2000 -l 1000 ` The beep in this case equal to n = 2000 Hz and duration 1000 ms This is tiny, small C source includes, of beep application. https://goo.gl/E3kfPy The portion of this code can be re-write to C# and use in Console.beep implementation for Linux platform. 25748 area-System.Memory Implement Span LastIndexOf extension method and add tests Part of https://github.com/dotnet/corefx/issues/24839 Following IndexOf vectorization from this PR: https://github.com/dotnet/corefx/pull/17143 **Left to do:** LastIndexOfAny APIs Also did a lot of cleaning and code formatting. cc @benaadams, @KrzysztofCwalina, @GrabYourPitchforks, @jkotas, @stephentoub 25749 area-System.Console Handling of SIGINT, SIGQUIT when SIG_IGN When dotnet is started with SIGINT, SIGQUIT set to SIG_IGN it should not change the disposition of those signals. A shell may set these to SIG_IGN to ensure a background process it not killed. See https://unix.stackexchange.com/questions/356408/strange-problem-with-trap-and-sigint When set to SIG_IGN, we should keep it at that value because it also affects child processes. If the disposition is changed, the child process will reset to the SIG_DFL. This means the `Console.CancelKeyPress` will no longer fire. I think this matches with what the shell is trying to achieve. 25750 area-Infrastructure Build fails `ApiCompat error : 0 : Unable to resolve assembly 'Assembly(Name=System.Private.CoreLib` I have tried building corefx `master` branch for some time on Windows. It has yet to succeed for me. I've tried on multiple windows machines. Followed the build instructions for windows. Yet it never works. Tried different commits and lately the one below with Visual Studio 15.5 installed. Still fails. Almost everytime I want to do a contribution I hit these things, spent countless hours building and failing, trying to figure out what is wrong, but fail. It is a bit frustrating 🙄 I even tried a release branch but it still failed. What am I doing wrong? commit: 749194e8d9813d1116520530042c261474341ce8 [init-tools.log](https://github.com/dotnet/corefx/files/1534914/init-tools.log) [msbuild.log](https://github.com/dotnet/corefx/files/1534897/msbuild.log) ``` EXEC : ApiCompat error : 0 : Unable to resolve assembly 'Assembly(Name=System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)' referenced by the implementation assembly 'Ass embly(Name=mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)'. [D:\oss\corefx\src\shims\ApiCompat.proj] EXEC : ApiCompat error : 0 : Unable to resolve assembly 'Assembly(Name=System.Private.Uri, Version=4.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)' referenced by the implementation assembly 'Assembl y(Name=System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)'. [D:\oss\corefx\src\shims\ApiCompat.proj] EXEC : ApiCompat error : 0 : Unable to resolve assembly 'Assembly(Name=System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)' referenced by the implementation assembly 'Ass embly(Name=System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)'. [D:\oss\corefx\src\shims\ApiCompat.proj] D:\oss\corefx\src\shims\ApiCompat.proj(76,5): error : TypesMustExist : Type 'Microsoft.Win32.SafeHandles.CriticalHandleMinusOneIsInvalid' does not exist in the implementation but it does exist in the contract. D:\oss\corefx\src\shims\ApiCompat.proj(76,5): error : TypesMustExist : Type 'Microsoft.Win32.SafeHandles.CriticalHandleZeroOrMinusOneIsInvalid' does not exist in the implementation but it does exist in the con tract. D:\oss\corefx\src\shims\ApiCompat.proj(76,5): error : TypesMustExist : Type 'Microsoft.Win32.SafeHandles.SafeFileHandle' does not exist in the implementation but it does exist in the contract. D:\oss\corefx\src\shims\ApiCompat.proj(76,5): error : TypesMustExist : Type 'Microsoft.Win32.SafeHandles.SafeHandleMinusOneIsInvalid' does not exist in the implementation but it does exist in the contract. D:\oss\corefx\src\shims\ApiCompat.proj(76,5): error : TypesMustExist : Type 'Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid' does not exist in the implementation but it does exist in the contrac t. D:\oss\corefx\src\shims\ApiCompat.proj(76,5): error : TypesMustExist : Type 'Microsoft.Win32.SafeHandles.SafeWaitHandle' does not exist in the implementation but it does exist in the contract. D:\oss\corefx\src\shims\ApiCompat.proj(76,5): error : TypesMustExist : Type 'System.AccessViolationException' does not exist in the implementation but it does exist in the contract. D:\oss\corefx\src\shims\ApiCompat.proj(76,5): error : TypesMustExist : Type 'System.Action' does not exist in the implementation but it does exist in the contract. ``` 25752 area-System.Net Access is denied when calling SystemIPGlobalProperties.GetActiveUdpListeners on UWP I have a UWP application (minimum version set to 16299, Fall Creators Update) that consumes a .NET Standard 2.0 class library. When calling `SystemIPGlobalProperties.GetActiveUdpListeners()`, I get an *Access is denied* `NetworkInformationException`. I have enabled internet (client and server) and intranet capabilities as well as enterprise authentication and system information, all to no avail. Am I doing something wrong? Limitation? Bug? >System.Net.NetworkInformation.NetworkInformationException HResult=0x80004005 Message=Access is denied Source=System.Net.NetworkInformation StackTrace: at System.Net.NetworkInformation.SystemIPGlobalProperties.GetActiveUdpListeners() at SIPSorcery.Sys.Net.FreePort.FindNextAvailableUDPPort(Int32 startPort) at ... 25753 area-System.Console Don't change SIGINT/SIGQUIT handling when they are set to SIG_IGN Implements https://github.com/dotnet/corefx/issues/25749 CC @stephentoub 25755 area-System.IO DirectoryInfo.CreateSubdirectory bug allows creation above itself "`DirectoryInfo.CreateSubdirectory()` throws on absolute paths, or when navigating using ""..\dirname"" above the current location. I think that is by design. However, this invariant breaks if the name after the dots is prefixed with the parent directory name. Repro: ```csharp var info = new DirectoryInfo(@""c:\demo""); info.Create(); info.CreateSubdirectory(@""..\demo2\sub""); ``` Which creates ""c:\demo2\sub"" without errors. I believe this is unintended behavior, caused by the next incorrect check: https://github.com/dotnet/corefx/blob/eb0d4388c339288a589bdd7f5e0c9fcd61da4362/src/System.IO.FileSystem/src/System/IO/DirectoryInfo.cs#L84-L87 " 25756 area-System.Threading Task.WhenAll support for Tuples `Task.WhenAll` should have a (set of) overload(s) to support returning the wrapped Tasks' results in a strongly typed `Tuple`. An oversimplified implementation of this would look something like this ```csharp public static async Task<(T1, T2)> WhenAll<T1, T2>(Task<T1> task1, Task<T2> task2) { return (await task1, await task2); } ``` ... and the usage would look something like this ```csharp var (x, y) = await Task.WhenAll(AsyncMethod1(), AsyncMethod2()); ``` I believe it would be relatively easy to implement but its value is huge as it allows to write simple but very efficient code that executes in parallel. Think about initialization logic when we have to gather information from different parts of the system, doing a bunch of `async` calls and either `await`-ing them one-by-one or collect the `Task`s, throw them in a `Task.WhenAll` and then extract the `Result`s. With `Tuple` being supported on a language level with decomposition, I think this would be a logical addition to the `Task` library. 25757 area-System.Net Cannot load System.Net.Http, Version=4.0.0.0 I'm using VS 2017. I have a WinForms application that targets .NET Framework 4.6.1 and I am publishing as a ClickOnce app. It uses my own Nuget package that targets .NET Standard 1.4. The Nuget package references System.Net.Http. When I install the application on a client computer. System.Net.Http.dll is not installed, even though it is referenced in the WinForms application. App.config references 4.1.1.1. I have tried copying multiple versions of System.Net.Http to the installed directory, but I get the following error: ``` System.IO.FileLoadException: Could not load file or assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) File name: 'System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' === Pre-bind state information === LOG: DisplayName = System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a (Fully-specified) LOG: Appbase = file:///C:/Users/.../AppData/Local/Apps/2.0/P14YD5BC.CHQ/B0M3BHKE.N0L/reso..tion_e8792805a00774ea_0001.0000_1ce3e8cb7fcdab99/ LOG: Initial PrivatePath = NULL Calling assembly : IdentityModel.OidcClient, Version=2.2.0.0, Culture=neutral, PublicKeyToken=null. === LOG: This bind starts in default load context. LOG: Using application configuration file: C:\Users\...\AppData\Local\Apps\2.0\P14YD5BC.CHQ\B0M3BHKE.N0L\reso..tion_e8792805a00774ea_0001.0000_1ce3e8cb7fcdab99\Resolve.ROI.QC.ClientWF.exe.config LOG: Using host configuration file: LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. LOG: Redirect found in application configuration file: 4.0.0.0 redirected to 4.1.1.1. LOG: Post-policy reference: System.Net.Http, Version=4.1.1.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a LOG: Attempting download of new URL file:///C:/Users/.../AppData/Local/Apps/2.0/P14YD5BC.CHQ/B0M3BHKE.N0L/reso..tion_e8792805a00774ea_0001.0000_1ce3e8cb7fcdab99/System.Net.Http.DLL. WRN: Comparing the assembly name resulted in the mismatch: Minor Version ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated. ``` [EDIT] Mark log as code by @karelz 25759 area-System.Memory Consolidate UTF8 inspection / processing APIs to a single assembly This is a tracking issue for our ZenHub Security Epic. 25760 area-System.Linq S.L.Expressions rejects valid conversions "Given an interface `IInterface` and an unsealed class `UnsealedClass` that does not implement it, then the following delegate is valid, and works: ```C# Func<NotSealed[], IInterface[]> f = x => (IInterface[])x; ``` It will fail at runtime if we call `f(new UnsealedClass[0])` but could work if there was a derived class that implemented `IInterface` and we called `f(new Derived[0])`, etc. However the equivalent expression: ```C# Expression<Func<NotSealed[], IInterface[]>> f = x => (IInterface[])x; ``` …fails with `InvalidOperationException`, ""No coercion operator is defined between types 'NotSealed[]' and 'IInterface[]'."" This is the root cause of #25754" 25761 area-System.Data Failing connections after multiple requests Originally filed by @sebastianroesch as https://github.com/aspnet/EntityFrameworkCore/issues/10494 I have an ASP.NET Core Web application using EF Core 2.0. When performing a bunch of requests that retrieve data from the database, EF Core throws an error after approx. 100 requests. The database is an Azure SQL database and firewall settings are correct. Retrieving data works 80-90% of the times. This issue has occurred on MacOS and Linux, we did not see it on Windows yet. It happens both on my development machine (Mac) as well as online (Linux). Since our production services are running in Docker, this creates a problem for us. This is the stack trace of the error: ``` fail: Microsoft.EntityFrameworkCore.Database.Connection[20004] An error occurred using the connection to database 'databasename' on server 'azure-database'. System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 40 - Could not open a connection to SQL Server) at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling) at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) at System.Data.SqlClient.SqlConnection.Open() at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open(Boolean errorsExpected) ClientConnectionId:00000000-0000-0000-0000-000000000000 ``` After a couple of these exceptions, the application crashes with the following error: ``` dotnet(66933,0x700003cf5000) malloc: *** error for object 0x7fd47fac86d0: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug ``` The queries that are being performed before the error occurs look like this: ``` Microsoft.EntityFrameworkCore.Database.Command:Information: Executed DbCommand (27ms) [Parameters=[@___teamId_0='XXX' , @__p_1='X', @__p_2='X'], CommandType='Text', CommandTimeout='30'] SELECT [e.ProjectMembers].[Id], [e.ProjectMembers].[CreatedBy], [e.ProjectMembers].[CreatedOn], [e.ProjectMembers].[DeletedBy], [e.ProjectMembers].[DeletedOn], [e.ProjectMembers].[IsResponsible], [e.ProjectMembers].[ProjectId], [e.ProjectMembers].[ProjectRoleId], [e.ProjectMembers].[TeamId], [e.ProjectMembers].[UpdatedBy], [e.ProjectMembers].[UpdatedOn], [e.ProjectMembers].[UserId] FROM [projects].[ProjectMembers] AS [e.ProjectMembers] INNER JOIN ( SELECT DISTINCT [t1].* FROM ( SELECT [e1].[Id] FROM [projects].[Projects] AS [e1] LEFT JOIN [projects].[ProjectTypes] AS [e.ProjectType1] ON [e1].[ProjectTypeId] = [e.ProjectType1].[Id] LEFT JOIN [projects].[ProjectTypes] AS [e.SalesType1] ON [e1].[SalesTypeId] = [e.SalesType1].[Id] LEFT JOIN [projects].[ProjectStatuses] AS [e.ProjectStatus1] ON [e1].[ProjectStatusId] = [e.ProjectStatus1].[Id] WHERE ([e1].[TeamId] = @___teamId_0) AND [e1].[DeletedOn] IS NULL ORDER BY [e1].[Id] OFFSET @__p_1 ROWS FETCH NEXT @__p_2 ROWS ONLY ) AS [t1] ) AS [t2] ON [e.ProjectMembers].[ProjectId] = [t2].[Id] ORDER BY [t2].[Id] ``` ### Steps to reproduce We use the new Context Pooling like this: ```c# services.AddDbContextPool<TDbContext>( options => options.UseSqlServer(connectionString, sqlOptions => { sqlOptions.EnableRetryOnFailure(maxRetryCount: 5, maxRetryDelay: TimeSpan.FromSeconds(3), errorNumbersToAdd: null); }) .EnableSensitiveDataLogging() ); ``` The connection string looks like this (everything else is default): ``` Data Source=azure-database;Initial Catalog=databasename;Integrated Security=False;User ID=XXX;Password=XXX ``` ### Further technical details EF Core version: 2.0.0 Database Provider: Microsoft.EntityFrameworkCore.SqlServer, Azure SQL Operating system: MacOS IDE: VS Code 1.18.1 25762 area-System.Collections Allow creating a comparer from key selector ### Suggestion Please make another overload of the `Comparer<T>.Create` method that takes a `Func<T, object>` as a property selector, and will generate a comparer for the selected property. ### Motive Currently, if we want to create a comparer for a specific property in an item, we have this option (would love to hear about others): var set = new SortedSet<User>( Comparer<User>.Create((u1, u2) => Comparer<string>.Default.Compare(u1.UserName, u2.UserName))); My suggestion is that instead of having to create another comparer for the property, we should be able to create a comparer for any type by just specifying the property items should be compared by. So referring to the last example, it would look like this: var set = new SortedList<User>(Comparer<User>.Create(u => u.UserName)); ### API Change Expand the [`System.Collections.Generic.Comparer<T>`](https://source.dot.net/#System.Private.CoreLib/src/System/Collections/Generic/Comparer.cs,23592232e4d01ea4) class by adding the following overload of the `Create` method: public static Comparer<T> Create(Func<T, object> propertySelector); Which will build a `Comparison<T>` based on the provided lambda property. 25763 area-System.Net [release/2.0.0] Ensure HttpListener request buffer is aligned as required by the host processor On Windows, the HttpRecieveHttpRequest function requires a buffer with a memory alignment greater than or equal to the required alignment of the HTTP_REQUEST struct. This fix ensures that alignment requirements are respected when allocating buffers in HttpListener RequestContextBase. Since HttpReceiveHttpRequest copies both the HTTP_REQUEST struct and the variable length request body into the buffer, we need to be able to allocate a buffer with variable size and with a set alignment. Since C# does not provide a method for specifying the alignment of byte arrays, I switched the underlying buffer to be unmanaged. This unmanaged buffer is allocated using Marshal.AllocHGlobal, which allocates memory at the maximum alignment required by the host processor. This fix differs from the 2.1.0 fix in how it zeros out allocated memory, as 2.0.0 disables support for Span. Fixes #25289 25764 area-System.Diagnostics Span tag in the xml documentation for System.Diagnostics.DiagnosticSource.4.4.1 "There's a span tag being generated in the System.Diagnostics.DiagnosticSource.xml file `<?xml version=""1.0"" encoding=""utf-8""?><span> <doc> <assembly> <name>System.Diagnostics.DiagnosticSource</name> </assembly>` I was unable to figure out how or where the span tag is getting added." 25765 area-System.IO IsolatedStorage random test failures UnauthorizedAccessException / DirectoryNotFoundException on Win 10 RS4 Insider Preview **repro** ./clean.cmd --all ./build.cmd ./build-tests.cmd **output snippet:** UnauthorizedAccessException ```[Microsoft (R) .NET Core Xml Serialization Generation Utility, Version 1.0.0-preview1] Copyright (C) Microsoft Corporation. All rights reserved. Using D:\dd\corefx\bin\testhost\netcoreapp-Windows_NT-Debug-x64\ as the test runtime folder. Executing in D:\dd\corefx\bin\tests\System.IO.IsolatedStorage.Tests\netcoreapp-Windows_NT-Debug-x64\ Running tests... Start time: 13:32:08.18 xUnit.net console test runner (64-bit .NET Core) Copyright (C) 2014 Outercurve Foundation. Discovering: System.IO.IsolatedStorage.Tests Serialization Code File Name: D:\dd\corefx\bin\tests\Microsoft.XmlSerializer.Generator.Tests\netcoreapp-Windows_NT-Debug-x64\Microsoft.XmlSerializer.Generator.Tests.XmlSerializers.cs. Generated serialization code for assembly D:\dd\corefx\bin\tests\Microsoft.XmlSerializer.Generator.Tests\netcoreapp-Windows_NT-Debug-x64\Microsoft.XmlSerializer.Generator.Tests.dll --> 'D:\dd\corefx\bin\tests\Microsoft.XmlSerializer.Generator.Tests\netcoreapp-Windows_NT-Debug-x64\Microsoft.XmlSerializer.Generator.Tests.XmlSerializers.cs'. Discovered: System.IO.IsolatedStorage.Tests Starting: System.IO.IsolatedStorage.Tests Finished: Microsoft.XmlSerializer.Generator.Tests === TEST EXECUTION SUMMARY === Microsoft.XmlSerializer.Generator.Tests Total: 73, Errors: 0, Failed: 0, Skipped: 0, Time: 1.634s System.IO.IsolatedStorage.ContainsUnknownFilesTests.ContainsUnknownFiles_CleanStore(scope: MachineStoreForDomain) [FAIL] System.UnauthorizedAccessException : Access to the path 'C:\ProgramData\IsolatedStorage\jdnr2up3.r5o\tzo0ywlm.ejr\StrongName.523eyfdtenor3l0btjpf240vsoo5jc3i\StrongName.523eyfdtenor3l0btjpf240vsoo5jc3i\Files\' is denied. Stack Trace: Finished running tests. End time=13:32:09.26, Exit code = 0 D:\dd\corefx\src\System.IO.FileSystem\src\System\IO\Win32FileSystem.cs(157,0): at System.IO.Win32FileSystem.CreateDirectory(String fullPath) D:\dd\corefx\src\System.IO.FileSystem\src\System\IO\Directory.cs(41,0): at System.IO.Directory.CreateDirectory(String path) D:\dd\corefx\src\System.IO.IsolatedStorage\src\System\IO\IsolatedStorage\Helper.Win32.cs(17,0): at System.IO.IsolatedStorage.Helper.CreateDirectory(String path, IsolatedStorageScope scope) D:\dd\corefx\src\System.IO.IsolatedStorage\src\System\IO\IsolatedStorage\IsolatedStorageFile.cs(665,0): at System.IO.IsolatedStorage.IsolatedStorageFile.Initialize(IsolatedStorageScope scope) D:\dd\corefx\src\System.IO.IsolatedStorage\src\System\IO\IsolatedStorage\IsolatedStorageFile.cs(590,0): at System.IO.IsolatedStorage.IsolatedStorageFile.GetStore(IsolatedStorageScope scope) D:\dd\corefx\src\System.IO.IsolatedStorage\src\System\IO\IsolatedStorage\IsolatedStorageFile.cs(584,0): at System.IO.IsolatedStorage.IsolatedStorageFile.GetMachineStoreForDomain() D:\dd\corefx\src\System.IO.IsolatedStorage\tests\System\IO\IsolatedStorage\IsoStorageTest.cs(61,0): at System.IO.IsolatedStorage.IsoStorageTest.GetPresetScope(PresetScopes scope) D:\dd\corefx\src\System.IO.IsolatedStorage\tests\System\IO\IsolatedStorage\ContainsUnknownFilesTests.cs(22,0): at System.IO.IsolatedStorage.ContainsUnknownFilesTests.ContainsUnknownFiles_CleanStore(PresetScopes scope) Finished: System.IO.IsolatedStorage.Tests === TEST EXECUTION SUMMARY === D:\dd\corefx\Tools\tests.targets(484,5): warning : System.IO.IsolatedStorage.Tests Total: 237, Errors: 0, Failed: 1, Skipped: 0, Time: 1.211s [D:\dd\corefx\src\System.IO.IsolatedStorage\tests\System.IO.IsolatedStorage.Tests.csproj] Finished running tests. End time=13:32:10.07, Exit code = 1 ``` DirectoryNotFoundException ``` Discovering: System.IO.IsolatedStorage.Tests Discovered: System.IO.IsolatedStorage.Tests Serialization Code File Name: D:\dd\corefx\bin\tests\Microsoft.XmlSerializer.Generator.Tests\netcoreapp-Windows_NT-Debug-x64\Microsoft.XmlSerializer.Generator.Tests.XmlSerializers.cs. Generated serialization code for assembly D:\dd\corefx\bin\tests\Microsoft.XmlSerializer.Generator.Tests\netcoreapp-Windows_NT-Debug-x64\Microsoft.XmlSerializer.Generator.Tests.dll --> 'D:\dd\corefx\bin\tests\Microsoft.XmlSerializer.Generator.Tests\netcoreapp-Windows_NT-Debug-x64\Microsoft.XmlSerializer.Generator.Tests.XmlSerializers.cs'. Starting: System.IO.IsolatedStorage.Tests System.IO.IsolatedStorage.ContainsUnknownFilesTests.ContainsUnknownFiles_NotOkDirectory(scope: MachineStoreForAssembly) [FAIL] System.IO.DirectoryNotFoundException : Could not find a part of the path 'C:\ProgramData\IsolatedStorage\rd4lgwfs.xdt\f0v0e01q.wwi\StrongName.523eyfdtenor3l0btjpf240vsoo5jc3i\AssemFiles\'. Stack Trace: D:\dd\corefx\src\System.IO.FileSystem\src\System\IO\Win32FileSystem.cs(157,0): at System.IO.Win32FileSystem.CreateDirectory(String fullPath) D:\dd\corefx\src\System.IO.FileSystem\src\System\IO\Directory.cs(41,0): at System.IO.Directory.CreateDirectory(String path) D:\dd\corefx\src\System.IO.IsolatedStorage\src\System\IO\IsolatedStorage\Helper.Win32.cs(17,0): at System.IO.IsolatedStorage.Helper.CreateDirectory(String path, IsolatedStorageScope scope) D:\dd\corefx\src\System.IO.IsolatedStorage\src\System\IO\IsolatedStorage\IsolatedStorageFile.cs(665,0): at System.IO.IsolatedStorage.IsolatedStorageFile.Initialize(IsolatedStorageScope scope) D:\dd\corefx\src\System.IO.IsolatedStorage\src\System\IO\IsolatedStorage\IsolatedStorageFile.cs(590,0): at System.IO.IsolatedStorage.IsolatedStorageFile.GetStore(IsolatedStorageScope scope) D:\dd\corefx\src\System.IO.IsolatedStorage\src\System\IO\IsolatedStorage\IsolatedStorageFile.cs(579,0): at System.IO.IsolatedStorage.IsolatedStorageFile.GetMachineStoreForAssembly() D:\dd\corefx\src\System.IO.IsolatedStorage\tests\System\IO\IsolatedStorage\IsoStorageTest.cs(59,0): at System.IO.IsolatedStorage.IsoStorageTest.GetPresetScope(PresetScopes scope) D:\dd\corefx\src\System.IO.IsolatedStorage\tests\System\IO\IsolatedStorage\ContainsUnknownFilesTests.cs(77,0): at System.IO.IsolatedStorage.ContainsUnknownFilesTests.ContainsUnknownFiles_NotOkDirectory(PresetScopes scope) Finished: Microsoft.XmlSerializer.Generator.Tests === TEST EXECUTION SUMMARY === Microsoft.XmlSerializer.Generator.Tests Total: 73, Errors: 0, Failed: 0, Skipped: 0, Time: 1.339s Finished running tests. End time=13:53:49.03, Exit code = 0 Finished: System.IO.IsolatedStorage.Tests === TEST EXECUTION SUMMARY === D:\dd\corefx\Tools\tests.targets(484,5): warning : System.IO.IsolatedStorage.Tests Total: 237, Errors: 0, Failed: 1, Skipped: 0, Time: 1.306s [D:\dd\corefx\src\System.IO.IsolatedStorage\tests\System.IO.IsolatedStorage.Tests.csproj] ``` 25766 area-Infrastructure MSB3277 warnings when building aspnetcore while referencing newest 2.1 runtime "Scanning through our build logs after we tried to ingest the newest shared runtime, I'm beginning to see warnings from msbuild: `C:\Users\johluo\.dotnet\x64\sdk\2.2.0-preview1-007522\Microsoft.Common.CurrentVersion.targets(2041,5): warning MSB3277: Found conflicts between different versions of ""System.Security.Cryptography.Cng"" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. [C:\gh\tp\TestDeps\TestDeps.csproj]`. A simplified repro is available at https://github.com/JunTaoLuo/PackageConflictWarnings. I've also included the diagnostic build log as build.log in the repro. cc @weshaggard @pranavkm @natemcmaster related: https://github.com/aspnet/Universe/issues/671 `dotnet --info`: ``` .NET Command Line Tools (2.2.0-preview1-007522) Product Information: Version: 2.2.0-preview1-007522 Commit SHA-1 hash: d58fc6120d Runtime Environment: OS Name: Windows OS Version: 10.0.16299 OS Platform: Windows RID: win10-x64 Base Path: C:\Users\johluo\.dotnet\x64\sdk\2.2.0-preview1-007522\ Microsoft .NET Core Shared Framework Host Version : 2.1.0-preview1-25914-0 Build : 352f0c04c28a53a47eaec4fccff002a813e40c60 ```" 25768 area-System.Linq Have S.L.Expressions accept conversions it incorrectly rejects. Extend the conversion checks to allow array-related explicit reference conversions that were rejected by `Expression.Convert` and `Expression.CheckedConvert`. Fixes #25760, and hence fixes #25754 25769 area-Serialization Update Sgen Package Version to 1.1.0 25770 area-System.Memory Change Pin to take an optional integer offset Resolves: https://github.com/dotnet/corefx/issues/25229 ~Depends on similar changes to be made in coreclr first for CI to pass - https://github.com/dotnet/coreclr/pull/15410~ Depends on the following for the CI to pass: https://github.com/dotnet/coreclr/pull/15946 cc @KrzysztofCwalina, @jkotas, @stephentoub, @pakrym, @davidfowl 25771 area-System.Text Regex - Support Possessive Quantifiers Current popular regex engines like `java.util.regex` or `PCRE` support greedy, lazy and possessive quantifiers. The current .NET regex engine does only support the former two. Though possessive quantifiers are syntactic sugar and can be mimicked with atomic grouping today, consider supporting them as they gained popularity over the last years. Abstract: Possessive quantifiers work the same as greedy quantifiers but without backtracking on the input string. That means that the following pattern `D++[A-Z]+` matches the input string `DDDDE` but not `DDDD`. 25773 area-Infrastructure System.Net.Http v4.2.0.0 being copied/loaded from MSBuild tooling "This issue was mentioned in the following comment, but that thread seemed to deal primarily with a different scenario. @karelz requested a separate issue be filed and it doesn't seem that happened. https://github.com/dotnet/corefx/issues/22781#issuecomment-322691420 The issue seems to be that when adding a reference to certain nuget packages, the version of System.Net.Http in the bin directory gets copied from C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Net.Http.dll which is a later version than what is available on nuget. Here is the simplest repro I could come up with: 1. Using VS Enterprise 15.5, create a new console app 'ConsoleApp1' that targets .net 4.6.1 2. Create a new class library 'ClassLibrary1' that targets .net 4.6.1 3. ConsoleApp1 references ClassLibrary1 4. Add nuget package System.Net.Http v4.3.3 to ConsoleApp1 5. Add nuget package System.Net.Http v4.3.3 to ClassLibrary1 6. ClassLibrary1.Class1 needs to instantiate HttpClient and ConsoleApp1.Program needs to instantiate HttpClient and ClassLibrary1.Class1 7. At this point everything builds/runs fine. a. Version of System.Net.Http in both bin directories is v4.1.1.2 dated 9/5/2017. b. If you look at the System.Net.Http reference in the VS properties window of solution explorer, it will show the version as 4.1.1.2. c. In the properties window ClassLibrary1 shows the path {solution_dir}\packages\System.Net.Http.4.3.3\lib\net46\System.Net.Http.dll 8. Add nuget package System.Collections.Immutable v1.4.0 to ClassLibrary1 9. At this point there are problems a. Building will generate the warning ""Found conflicts between different versions of 'System.Net.Http' that could not be resolved"" b. Running the app will generate a run-time exception: ""Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'System.Net.Http, Version=4.2.0.0"" c. Version of System.Net.Http in the ClassLibrary1 bin directory is v4.2.0.0 and dated 12/4/2017 d. The reference properties window in VS for ClassLibrary1 shows the path as C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Net.Http.dll In short, for some reason after adding nuget package for System.Collections.Immutable v1.4.0, the MSBuild version of System.Net.Http seems to get introduced into the project and causes problems. I don't know if System.Collections.Immutable is unique in triggering this scenario. The previous issue/comment suggests that other packages might also trigger this (System.Threading.Tasks.Dataflow) I can work around this issue with the following binding redirect: ```` <runtime> <assemblyBinding xmlns=""urn:schemas-microsoft-com:asm.v1""> <dependentAssembly> <assemblyIdentity name=""System.Net.Http"" publicKeyToken=""b03f5f7f11d50a3a"" culture=""neutral"" /> <bindingRedirect oldVersion=""0.0.0.0-4.2.0.0"" newVersion=""4.1.1.2"" /> </dependentAssembly> </assemblyBinding> </runtime> ```` But it seems incorrect to have to redirect backwards like that." 25774 area-System.Net The type initializer for 'System.Net.Http.CurlHandler' threw an exception "Hi, I'm getting a weird error while running my server under CentOS. It said it is **""Unable to load DLL 'System.Net.Http.Native'""** (see exception below), and it only occurs when I start the server during startup using systemd or manually in Linux Screen, not in regular shell (Bash, PuTTY). Why is this happening? From what I have found on Google, it seems to be an issue with openssl-libs, but how come it is working in the shell? Being quite new to Linux I don't know the difference between the environments. More details below --------- I use the same user in all cases. The systemd .service is minimal, default type, only an After=network.target The server does not use TLS/SSL encryption. CentOS Linux release 7.4.1708 (Core) Dotnet --version 2.0.3 Here is a list of the [dependencies](https://docs.microsoft.com/en-us/dotnet/core/linux-prerequisites?tabs=netcore2x) (according to Yum). I've updated all packages so there are not later version available (in Yum). ``` libunwind.x86_64 2:1.2-2.el7 lttng-ust.x86_64 2.4.1-4.el7) libcurl.x86_64 7.29.0-42.el7_4.1 openssl-libs.x86_64 1:1.0.2k-8.el7 libuuid.x86_64 2.23.2-43.el7_4.2 krb5-libs.x86_64 1.15.1-8.el7 libicu.x86_64 50.1.2-15.el7 zlib.x86_64 1.2.7-17.el7 ``` ``` System.TypeInitializationException: The type initializer for 'System.Net.Http.CurlHandler' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Http' threw an exception. ---> System.TypeInitializationException: The type initializer for 'HttpInitializer' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'System.Net.Http.Native': The specified module or one of its dependencies could not be found. (Exception from HRESULT: 0x8007007E) at Interop.Http.GetSslVersionDescription() at Interop.HttpInitializer..cctor() --- End of inner exception stack trace --- at Interop.Http..cctor() --- End of inner exception stack trace --- at Interop.Http.GetSupportedFeatures() at System.Net.Http.CurlHandler..cctor() --- End of inner exception stack trace --- at System.Net.Http.CurlHandler..ctor() at System.Net.Http.HttpClientHandler..ctor() at Veridict.LiveMap.ServerPlatform.Modules.GtfsRt.GtfsRtModule.Run() at System.Threading.Thread.ThreadMain_ThreadStart() at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) ```" 25776 area-System.Net Linux Dns.GetHostEntry doesn't work on Linux "The Dns.GetHostEntry doesn't work at all on netcore 2.0.0 on Ubuntu. It do work on windows netcore 2.0.0 Helpfully Dns.Resolve works on Linux as expected. System.Net.Dns.GetHostEntry(""192.168.1.21""); //fails with unreachable host System.Net.Dns.Resolve(""192.168.1.21""); // works on the same station on Linux. I can see the same issue closed #15640 but I can reproduce this bug." 25777 area-System.Memory Span: Add BinarySearch(...) extension methods for ReadOnlySpan<T> (and Span<T>) "Implements https://github.com/dotnet/corefx/issues/15818 This is currently an early work-in-progress with the current status: - [x] Basic binary search implemented based on coreclr implementation. - [x] Basic tests - [x] Can we remove the `try/catch` in the implementation? Why is it there? REMOVED, per review comment. - [x] Tests for all overloads. - [x] Add overflow test (Q: Not in OuterLoop currently, since pretty fast, should it be still?) - [x] Compute median in `uint` with single add and shift - [x] Revise API to use `in` on e.g. `TComparer`, `TComparable`. Commented on initial proposal to change this. - [x] Undo use of `in` since it will always pass by `ref` which will not be good for small types. - [x] Fix xml comments, currently quick-copy-paste (Q: Where are the XML docs for `Array.BinarySearch`? couldn't find them, copy from VS F12) - [x] Tests, tests, tests. (Q: `coreclr` has a lot of ""weird"" tests, guidance on tests needed here would be good? Not using these... seem unnecessary) - [x] SKIPPED Performance tests. (Q: again `coreclr` has a lot of ""weird"" tests, guidance on tests needed here would be good? What scenarios? Also see code comments.) - [x] Investigate assembly and do quick benchmark, see comments. - [x] Address review issues. - [x] Finalize and clean up. cc: @karelz a heads up, since I started preliminary work on this. Hopefully after this I can continue with `Sort`. cc: @jkotas if you could review and perhaps answer some questions, thank you." 25778 area-Infrastructure Enable Alpine Linux CI This change enables CI build for Alpine Linux. It only builds the product, but it doesn't run the test yet since there is no Alpine queue support in Helix yet. The Alpine build is automatically enabled for all PRs. 25779 area-System.Numerics Add a BCL tensor API to represent multi-dimensional data for machine learning "# Rationale See https://blogs.msdn.microsoft.com/dotnet/2017/11/15/introducing-tensor-for-multi-dimensional-machine-learning-and-ai-data/ for rationale. The main tagline: The motivation behind introducing Tensor<T> is to make it easy for Machine Learning library vendors like CNTK, Tensorflow, Caffe, Scikit-Learn to port their libraries over to .NET with minimal dependencies in place. # Usage: ### Scenario 1 - convert an Bitmap to Tensor to prepare the data to pass into a machine learning algorithm. Taken from [here](https://github.com/dotnet-architecture/MNISTTensorCNTK/blob/1f9660e4208458d5d70e015bcefe333b3bce4285/Digitz/DigitRecognizer.cs#L35-L59) ```C# /// <summary> /// Converts the image into the expected data for the MNIST model. /// </summary> private Tensor<float> ConvertImageToTensorData(Bitmap image) { int width = _mnistInput.Shape.Dimensions[0]; int height = _mnistInput.Shape.Dimensions[1]; image = ResizeImage(image, new Size(width, height)); Tensor<float> imageData = new DenseTensor<float>(new[] { width, height }, reverseStride: true); // CNTK uses ColumnMajor layout for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { Color color = image.GetPixel(x, y); float pixelValue = (color.R + color.G + color.B) / 3; // Turn to black background and white digit like MNIST model expects imageData[x, y] = (255 - pixelValue); } } return imageData; } ``` ### Scenario 2 - Pass Tensor data into a native library that does math operations. Taken from [here](https://github.com/eerhardt/TensorLinearAlgebra/blob/e3f98eebad6af91a851131164b89c6e02f3e19fd/LinearAlgebra.cs#L12) ```C# /// <summary> /// Solves the system of linear equations AX = B for X, where A, B, and X are general matrices. /// </summary> /// <param name=""a""></param> /// <param name=""b""></param> /// <returns></returns> public static DenseTensor<double> Solve(DenseTensor<double> a, DenseTensor<double> b) { if (a.Rank != 2) throw new ArgumentException(""a must be a square matrix"", nameof(a)); if (a.Dimensions[0] != a.Dimensions[1]) throw new ArgumentException(""a must be a square matrix"", nameof(a)); if (b.Rank != 2) throw new ArgumentException(""b must be a matrix"", nameof(b)); if (a.Dimensions[0] != b.Dimensions[0]) throw new ArgumentException(""The number of rows in b must match the number of rows in a"", nameof(b)); // need to clone the inputs because LAPack will mutate the values var aClone = (DenseTensor<double>)a.Clone(); var bClone = (DenseTensor<double>)b.Clone(); unsafe { Span<int> pivotIntegers = stackalloc int[a.Dimensions[1]]; fixed (double* aPtr = &aClone.Buffer.Span.DangerousGetPinnableReference()) fixed (double* bPtr = &bClone.Buffer.Span.DangerousGetPinnableReference()) fixed (int* ipiv = &pivotIntegers.DangerousGetPinnableReference()) { LAPACKE_dgesv( a.IsReversedStride ? LAPACK_COL_MAJOR : LAPACK_ROW_MAJOR, a.Dimensions[0], b.Dimensions[1], aPtr, a.Dimensions[1], ipiv, bPtr, b.Dimensions[1]); } } return bClone; } [DllImport(""liblapacke.dll"")] static extern unsafe int LAPACKE_dgesv(int matrix_layout, int n, int nrhs, double* a, int lda, int* ipvt, double* bx, int ldb); } ``` # Proposed API ```C# namespace System.Numerics.Tensors { // All interface members will be implemented explicitly unless exposed below public abstract class Tensor<T> : ICollection, ICollection<T>, IEnumerable, IEnumerable<T>, IList, IList<T>, IReadOnlyCollection<T>, IReadOnlyList<T>, IStructuralComparable, IStructuralEquatable { protected Tensor(Array fromArray, bool reverseStride); protected Tensor(int length); protected Tensor(ReadOnlySpan<int> dimensions, bool reverseStride); public ReadOnlySpan<int> Dimensions { get; } public bool IsFixedSize { get; } public bool IsReadOnly { get; } public bool IsReversedStride { get; } public long Length { get; } public int Rank { get; } public ReadOnlySpan<int> Strides { get; } public virtual T this[params int[] indices] { get; set; } public virtual T this[ReadOnlySpan<int> indices] { get; set; } public abstract Tensor<T> Clone(); public virtual Tensor<T> CloneEmpty(); public virtual Tensor<T> CloneEmpty(ReadOnlySpan<int> dimensions); public virtual Tensor<TResult> CloneEmpty<TResult>(); public abstract Tensor<TResult> CloneEmpty<TResult>(ReadOnlySpan<int> dimensions); protected virtual bool Contains(T item); protected virtual void CopyTo(T[] array, int arrayIndex); protected virtual int IndexOf(T item); public virtual void Fill(T value); public string GetArrayString(bool includeWhitespace=true); public Tensor<T> GetDiagonal(); public Tensor<T> GetDiagonal(int offset); public Tensor<T> GetTriangle(); public Tensor<T> GetTriangle(int offset); public Tensor<T> GetUpperTriangle(); public Tensor<T> GetUpperTriangle(int offset); public abstract T GetValue(int index); public abstract void SetValue(int index, T value); public Tensor<T> MatrixMultiply(Tensor<T> right); public abstract Tensor<T> Reshape(ReadOnlySpan<int> dimensions); public Tensor<T> Slice(params Range[] ranges); public virtual Tensor<T> Slice(ReadOnlySpan<Range> ranges); public virtual CompressedSparseTensor<T> ToCompressedSparseTensor(); public virtual DenseTensor<T> ToDenseTensor(); public virtual SparseTensor<T> ToSparseTensor(); public static int Compare(Tensor<T> left, Tensor<T> right); public static bool Equals(Tensor<T> left, Tensor<T> right); public static Tensor<T> operator +(Tensor<T> left, Tensor<T> right); public static Tensor<T> operator +(Tensor<T> tensor, T scalar); public static Tensor<T> operator &(Tensor<T> left, Tensor<T> right); public static Tensor<T> operator &(Tensor<T> tensor, T scalar); public static Tensor<T> operator |(Tensor<T> left, Tensor<T> right); public static Tensor<T> operator |(Tensor<T> tensor, T scalar); public static Tensor<T> operator --(Tensor<T> tensor); public static Tensor<T> operator /(Tensor<T> left, Tensor<T> right); public static Tensor<T> operator /(Tensor<T> tensor, T scalar); public static Tensor<T> operator ^(Tensor<T> left, Tensor<T> right); public static Tensor<T> operator ^(Tensor<T> tensor, T scalar); public static Tensor<T> operator ++(Tensor<T> tensor); public static Tensor<T> operator <<(Tensor<T> tensor, int value); public static Tensor<T> operator %(Tensor<T> left, Tensor<T> right); public static Tensor<T> operator %(Tensor<T> tensor, T scalar); public static Tensor<T> operator *(Tensor<T> left, Tensor<T> right); public static Tensor<T> operator *(Tensor<T> tensor, T scalar); public static Tensor<T> operator >>(Tensor<T> tensor, int value); public static Tensor<T> operator -(Tensor<T> left, Tensor<T> right); public static Tensor<T> operator -(Tensor<T> tensor, T scalar); public static Tensor<T> operator -(Tensor<T> tensor); public static Tensor<T> operator +(Tensor<T> tensor); } public class DenseTensor<T> : Tensor<T> { public DenseTensor(int length); public DenseTensor(Memory<T> memory, ReadOnlySpan<int> dimensions, bool reverseStride=false); public DenseTensor(ReadOnlySpan<int> dimensions, bool reverseStride=false); public Memory<T> Buffer { get; } public override Tensor<T> Clone(); public override Tensor<TResult> CloneEmpty<TResult>(ReadOnlySpan<int> dimensions); protected override void CopyTo(T[] array, int arrayIndex); protected override int IndexOf(T item); public override T GetValue(int index); public override void SetValue(int index, T value); public override Tensor<T> Reshape(ReadOnlySpan<int> dimensions); } public class CompressedSparseTensor<T> : Tensor<T> { public CompressedSparseTensor(Memory<T> values, Memory<int> compressedCounts, Memory<int> indices, int nonZeroCount, ReadOnlySpan<int> dimensions, bool reverseStride=false); public CompressedSparseTensor(ReadOnlySpan<int> dimensions, bool reverseStride=false); public CompressedSparseTensor(ReadOnlySpan<int> dimensions, int capacity, bool reverseStride=false); public int Capacity { get; } public Memory<int> CompressedCounts { get; } public Memory<int> Indices { get; } public int NonZeroCount { get; } public Memory<T> Values { get; } public override T this[ReadOnlySpan<int> indices] { get; set; } public override Tensor<T> Clone(); public override Tensor<TResult> CloneEmpty<TResult>(ReadOnlySpan<int> dimensions); public override T GetValue(int index); public override void SetValue(int index, T value); public override Tensor<T> Reshape(ReadOnlySpan<int> dimensions); public override CompressedSparseTensor<T> ToCompressedSparseTensor(); public override DenseTensor<T> ToDenseTensor(); public override SparseTensor<T> ToSparseTensor(); } public class SparseTensor<T> : Tensor<T> { public SparseTensor(ReadOnlySpan<int> dimensions, bool reverseStride=false, int capacity=0); public int NonZeroCount { get; } public override Tensor<T> Clone(); public override Tensor<TResult> CloneEmpty<TResult>(ReadOnlySpan<int> dimensions); public override T GetValue(int index); public override void SetValue(int index, T value); public override Tensor<T> Reshape(ReadOnlySpan<int> dimensions); public override CompressedSparseTensor<T> ToCompressedSparseTensor(); public override DenseTensor<T> ToDenseTensor(); public override SparseTensor<T> ToSparseTensor(); } public static class ArrayTensorExtensions { public static CompressedSparseTensor<T> ToCompressedSparseTensor<T>(this Array array, bool reverseStride=false); public static CompressedSparseTensor<T> ToCompressedSparseTensor<T>(this T[,,] array, bool reverseStride=false); public static CompressedSparseTensor<T> ToCompressedSparseTensor<T>(this T[,] array, bool reverseStride=false); public static CompressedSparseTensor<T> ToCompressedSparseTensor<T>(this T[] array); public static SparseTensor<T> ToSparseTensor<T>(this Array array, bool reverseStride=false); public static SparseTensor<T> ToSparseTensor<T>(this T[,,] array, bool reverseStride=false); public static SparseTensor<T> ToSparseTensor<T>(this T[,] array, bool reverseStride=false); public static SparseTensor<T> ToSparseTensor<T>(this T[] array); public static DenseTensor<T> ToTensor<T>(this Array array, bool reverseStride=false); public static DenseTensor<T> ToTensor<T>(this T[,,] array, bool reverseStride=false); public static DenseTensor<T> ToTensor<T>(this T[,] array, bool reverseStride=false); public static DenseTensor<T> ToTensor<T>(this T[] array); } public static class Tensor { public static Tensor<T> Add<T>(Tensor<T> left, Tensor<T> right); public static void Add<T>(Tensor<T> left, Tensor<T> right, Tensor<T> result); public static Tensor<T> Add<T>(Tensor<T> tensor, T scalar); public static void Add<T>(Tensor<T> tensor, T scalar, Tensor<T> result); public static Tensor<T> And<T>(Tensor<T> left, Tensor<T> right); public static void And<T>(Tensor<T> left, Tensor<T> right, Tensor<T> result); public static Tensor<T> And<T>(Tensor<T> tensor, T scalar); public static void And<T>(Tensor<T> tensor, T scalar, Tensor<T> result); public static Tensor<T> Contract<T>(Tensor<T> left, Tensor<T> right, int[] leftAxes, int[] rightAxes); public static void Contract<T>(Tensor<T> left, Tensor<T> right, int[] leftAxes, int[] rightAxes, Tensor<T> result); public static Tensor<T> CreateFromDiagonal<T>(Tensor<T> diagonal); public static Tensor<T> CreateFromDiagonal<T>(Tensor<T> diagonal, int offset); public static Tensor<T> CreateIdentity<T>(int size); public static Tensor<T> CreateIdentity<T>(int size, bool columMajor); public static Tensor<T> CreateIdentity<T>(int size, bool columMajor, T oneValue); public static Tensor<T> Decrement<T>(Tensor<T> tensor); public static void Decrement<T>(Tensor<T> tensor, Tensor<T> result); public static Tensor<T> Divide<T>(Tensor<T> left, Tensor<T> right); public static void Divide<T>(Tensor<T> left, Tensor<T> right, Tensor<T> result); public static Tensor<T> Divide<T>(Tensor<T> tensor, T scalar); public static void Divide<T>(Tensor<T> tensor, T scalar, Tensor<T> result); public static Tensor<Boolean> Equals<T>(Tensor<T> left, Tensor<T> right); public static void Equals<T>(Tensor<T> left, Tensor<T> right, Tensor<Boolean> result); public static Tensor<Boolean> GreaterThan<T>(Tensor<T> left, Tensor<T> right); public static void GreaterThan<T>(Tensor<T> left, Tensor<T> right, Tensor<Boolean> result); public static Tensor<Boolean> GreaterThanOrEqual<T>(Tensor<T> left, Tensor<T> right); public static void GreaterThanOrEqual<T>(Tensor<T> left, Tensor<T> right, Tensor<Boolean> result); public static Tensor<T> Increment<T>(Tensor<T> tensor); public static void Increment<T>(Tensor<T> tensor, Tensor<T> result); public static Tensor<T> LeftShift<T>(Tensor<T> tensor, int value); public static void LeftShift<T>(Tensor<T> tensor, int value, Tensor<T> result); public static Tensor<Boolean> LessThan<T>(Tensor<T> left, Tensor<T> right); public static void LessThan<T>(Tensor<T> left, Tensor<T> right, Tensor<Boolean> result); public static Tensor<Boolean> LessThanOrEqual<T>(Tensor<T> left, Tensor<T> right); public static void LessThanOrEqual<T>(Tensor<T> left, Tensor<T> right, Tensor<Boolean> result); public static Tensor<T> Modulo<T>(Tensor<T> left, Tensor<T> right); public static void Modulo<T>(Tensor<T> left, Tensor<T> right, Tensor<T> result); public static Tensor<T> Modulo<T>(Tensor<T> tensor, T scalar); public static void Modulo<T>(Tensor<T> tensor, T scalar, Tensor<T> result); public static Tensor<T> Multiply<T>(Tensor<T> left, Tensor<T> right); public static void Multiply<T>(Tensor<T> left, Tensor<T> right, Tensor<T> result); public static Tensor<T> Multiply<T>(Tensor<T> tensor, T scalar); public static void Multiply<T>(Tensor<T> tensor, T scalar, Tensor<T> result); public static Tensor<Boolean> NotEquals<T>(Tensor<T> left, Tensor<T> right); public static void NotEquals<T>(Tensor<T> left, Tensor<T> right, Tensor<Boolean> result); public static Tensor<T> Or<T>(Tensor<T> left, Tensor<T> right); public static void Or<T>(Tensor<T> left, Tensor<T> right, Tensor<T> result); public static Tensor<T> Or<T>(Tensor<T> tensor, T scalar); public static void Or<T>(Tensor<T> tensor, T scalar, Tensor<T> result); public static Tensor<T> RightShift<T>(Tensor<T> tensor, int value); public static void RightShift<T>(Tensor<T> tensor, int value, Tensor<T> result); public static Tensor<T> Subtract<T>(Tensor<T> left, Tensor<T> right); public static void Subtract<T>(Tensor<T> left, Tensor<T> right, Tensor<T> result); public static Tensor<T> Subtract<T>(Tensor<T> tensor, T scalar); public static void Subtract<T>(Tensor<T> tensor, T scalar, Tensor<T> result); public static Tensor<T> UnaryMinus<T>(Tensor<T> tensor); public static void UnaryMinus<T>(Tensor<T> tensor, Tensor<T> result); public static Tensor<T> UnaryPlus<T>(Tensor<T> tensor); public static void UnaryPlus<T>(Tensor<T> tensor, Tensor<T> result); public static Tensor<T> Xor<T>(Tensor<T> left, Tensor<T> right); public static void Xor<T>(Tensor<T> left, Tensor<T> right, Tensor<T> result); public static Tensor<T> Xor<T>(Tensor<T> tensor, T scalar); public static void Xor<T>(Tensor<T> tensor, T scalar, Tensor<T> result); } } namespace System { struct Range { public Range(int start, int end); public int Start { get; } public int End { get; } } } ``` # Details * A `Range` type is needed in order to support the `Tensor.Slice` method. The proposal is to introduce a `System.Range struct` to the `System.Memory` package. Note that this Range is also necessary for the [new range syntax proposed for C#](https://github.com/dotnet/roslyn/blob/features/range/docs/features/range.md). * Tensor doesn't need a `long` Range type, because all the dimensions are represented by `int`. * It would be very convenient to have unbounded Ranges in both start and end for Tensor, so users can easily say ""I want all rows with these columns"", or ""I want all columns with these rows"", etc. * I haven't found a concrete user scenario for Ranges with ""steps"" (ex. ""I want every other row"" or ""every fourth row""). The current proposal is to not support slicing with steps in v1." 25780 area-System.IO Consolidate common Compression tests and apply fixes - Fix a bug in DeflateStream where we will always read to the end of the input stream even if the Deflater has finished. - Fix a bug in DeflateStream where disposing the Deflater with an in-progress async operation would trigger a failed Debug.Assert. - Move DeflateStream/GZipStream unit and perf tests to Common and abstract them out. This makes them usable for any future streamable compression implementation (e.g. broti), minimizes duplication, and asserts that the behavior is equal among any current and future compression stream implementations. - Increases code coverage for DeflateStream and GZipStream - The test changes of this PR are a precursor to the completion of https://github.com/dotnet/corefx/issues/24826 resolves https://github.com/dotnet/corefx/issues/25647 cc: @ViktorHofer @stephentoub @GrabYourPitchforks @ahsonkhan @krwq 25781 area-System.ComponentModel System.ComponentModel.Composition has internals visible to We are currently testing internals in System.ComponentModel.Composition, we should consider removing those if they don't add much value/bring more interesting code coverage. Also if we can't test them from the public APIs maybe we have some dead code there :) cc: @weshaggard @maryamariyan @danmosemsft 25782 area-System.Net SocketAsyncEventArgs returns null when accessing buffer then throws when trying to set BufferList We have the following code now throwing `SR.net_ambiguousbuffers` after https://github.com/dotnet/corefx/pull/25402 ``` if (_eventArgs.Buffer != null) { _eventArgs.SetBuffer(null, 0, 0); } _eventArgs.BufferList = GetBufferList(buffers); // throws ``` The reason is we do `_eventArgs.SetBuffer(buffer); // buffer is Memory<byte>` earlier, then when checking if `_eventArgs.Buffer` is null it returns null since the `_bufferIsExplicitArray` was set to false when using `Memory<byte>` 25783 area-Infrastructure Alpine.3.6 x64 Debug Build build fails "``` chmod: cannot access '/mnt/j/workspace/dotnet_corefx/master/alpine-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/bin/testhost/netcoreapp-Linux-Debug-x64/dotnet': No such file or directory 12:16:36 /mnt/j/workspace/dotnet_corefx/master/alpine-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/external/runtime/runtime.depproj(73,5): error MSB3073: The command ""chmod +x /mnt/j/workspace/dotnet_corefx/master/alpine-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/bin/testhost/netcoreapp-Linux-Debug-x64/dotnet"" exited with code 1. ``` https://ci3.dot.net/job/dotnet_corefx/job/master/job/alpine-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/14/consoleFull " 25784 area-System.Diagnostics fix [System.Diagnostics.Process]::GetProcesses(computer) for https://github.com/dotnet/corefx/issues/24357 CC @stephentoub @joperezr @SteveL-MSFT Local testing confirmed we get the correct processes for a remote machine with this change, but without multi-machine testing in CI we can't automate testing for this, so I just added a test for the negative case. 25785 area-System.IO Add Brotli Compression to CoreFX # System.IO.Compression.Brotli ## Introduction Brotli is a generic-purpose lossless compression algorithm that compresses data using a combination of a modern variant of the LZ77 algorithm, Huffman coding and 2nd order context modeling, with a compression ratio comparable to the best currently available general-purpose compression methods. It is similar in speed to deflate but offers more dense compression. The specification of the Brotli Compressed Data Format is defined in [RFC 7932](https://www.ietf.org/rfc/rfc7932.txt). Brotli encoding is supported by most web browsers, major web servers, and some CDNs (Content Delivery Networks). ## BrotliStream ### Proposed API The API surface area for BrotliStream is identical to that of DeflateStream but with added `bufferSize` constructors. ```C# public partial class BrotliStream : System.IO.Stream { public BrotliStream(System.IO.Stream stream, System.IO.Compression.CompressionLevel compressionLevel); public BrotliStream(System.IO.Stream stream, System.IO.Compression.CompressionLevel compressionLevel, bool leaveOpen); public BrotliStream(System.IO.Stream stream, System.IO.Compression.CompressionLevel compressionLevel, bool leaveOpen, int bufferSize); public BrotliStream(System.IO.Stream stream, System.IO.Compression.CompressionMode mode); public BrotliStream(System.IO.Stream stream, System.IO.Compression.CompressionMode mode, bool leaveOpen); public BrotliStream(System.IO.Stream stream, System.IO.Compression.CompressionMode mode, bool leaveOpen, int bufferSize); public System.IO.Stream BaseStream { get; } public override bool CanRead { get; } public override bool CanSeek { get; } public override bool CanWrite { get; } public override long Length { get; } public override long Position { get; set; } protected override void Dispose(bool disposing); public override void Flush(); public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState); public override int EndRead(IAsyncResult asyncResult); public override int Read(byte[] array, int offset, int count); public override System.Threading.Tasks.Task<int> ReadAsync(byte[] array, int offset, int count, System.Threading.CancellationToken cancellationToken); public override long Seek(long offset, System.IO.SeekOrigin origin); public override void SetLength(long value); public override IAsyncResult BeginWrite(byte[] array, int offset, int count, AsyncCallback asyncCallback, object asyncState); public override void EndWrite(IAsyncResult asyncResult); public override void Write(byte[] array, int offset, int count); public override System.Threading.Tasks.Task WriteAsync(byte[] array, int offset, int count, System.Threading.CancellationToken cancellationToken); } ``` ### Example Usage The BrotliStream behavior is the same as that of DeflateStream or GZipStream to allow easily converting DeflateStream/GZipStream code to use BrotliStream. ```C# public static Stream Compress_Stream(Stream inputStream) { var outputStream = new MemoryStream(); var compressor = new BrotliStream(outputStream, CompressionMode.Compress, true); inputStream.CopyTo(compressor); compressor.Dispose(); return outputStream; } public static Stream Decompress_Stream(Stream inputStream) { var outputStream = new MemoryStream(); var decompressor = new BrotliStream(inputStream, CompressionMode.Decompress, true); decompressor.CopyTo(outputStream); decompressor.Dispose(); return outputStream; } ``` ## BrotliEncoder & BrotliDecoder ### Proposed API The goal of the streamless implementation is to provide a non-allocating, performant Brotli implementation free from Streams. It contains simple Compress/Decompress operations that return an enum indicating the success of the operation as well as static CompressFully/DecompressFully operations that allow single-pass compression/decompression without the need for a BrotliEncoder/BrotliDecoder instance. ```C# public struct BrotliDecoder : System.IDisposable { public System.Buffers.OperationStatus Decompress(System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesConsumed, out int bytesWritten) { bytesConsumed = default(int); bytesWritten = default(int); throw null; } public static bool DecompressFully(System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesWritten) { bytesWritten = default(int); throw null; } public void Dispose() { } } public struct BrotliEncoder : System.IDisposable { public System.Buffers.OperationStatus Compress(System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesConsumed, out int bytesWritten) { bytesConsumed = default(int); bytesWritten = default(int); throw null; } public static bool CompressData(System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesWritten) { bytesWritten = default(int); throw null; } public static bool CompressData(System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesWritten, int quality, int window) { bytesWritten = default(int); throw null; } public System.Buffers.OperationStatus CompressFinal(System.Span<byte> destination, out int bytesWritten) { bytesWritten = default(int); throw null; } public void Dispose() { } public static int GetMaximumCompressedSize(int inputSize) { throw null; } public void SetQuality(int quality) { } public void SetWindow(int window) { } } ``` ### Design Questions Should we allow setting the Quality/Window via `Set_` functions of make them constructor variables? They must be set before encoding either way. #### BrotliEncoder SetQuality/SetWindows vs constructor overloads: ```C# public struct BrotliEncoder : System.IDisposable { ... public void SetQuality(int quality) { } public void SetWindow(int window) { } } public struct BrotliEncoder : System.IDisposable { public BrotliEncoder() {} public BrotliEncoder(int quality, int window) {} ... } ``` #### Flush vs Finalize Should there be an option for intermediate flushes or only for finalize? The main use case of an intermediate Flush is if you want to get more of the outputted bytes but aren’t yet done supplying input to the compressor. ```C# // Allow Intermediate Flushes public partial struct BrotliEncoder : System.IDisposable { ... public System.Buffers.OperationStatus Compress(System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesConsumed, out int bytesWritten) { bytesConsumed = default(int); bytesWritten = default(int); throw null; } public System.Buffers.OperationStatus CompressFinal(System.Span<byte> destination, out int bytesWritten, bool isFinished = true) { bytesWritten = default(int); throw null; } ... } // Disallow Intermediate Flushes public partial struct BrotliEncoder : System.IDisposable { ... public System.Buffers.OperationStatus Compress(System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesConsumed, out int bytesWritten) { bytesConsumed = default(int); bytesWritten = default(int); throw null; } public System.Buffers.OperationStatus CompressFinal(System.Span<byte> destination, out int bytesWritten) { bytesWritten = default(int); throw null; } ... } ``` #### Allow input to Flush/Finalize? I prefer the simpler Flush/Finalize that don’t take input, but the underlying call allows input if we decide that’s more usable. If we go that route then we could potentially just condense the API down to one function. ```C# // Do not allow input to Finalize/Flush public partial struct BrotliEncoder : System.IDisposable { ... public System.Buffers.OperationStatus Compress(System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesConsumed, out int bytesWritten) { bytesConsumed = default(int); bytesWritten = default(int); throw null; } public System.Buffers.OperationStatus CompressFinal(System.Span<byte> destination, out int bytesWritten) { bytesWritten = default(int); throw null; } ... } // Allow input to Finalize/Flush public partial struct BrotliEncoder : System.IDisposable { ... public System.Buffers.OperationStatus Compress(System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesConsumed, out int bytesWritten) { bytesConsumed = default(int); bytesWritten = default(int); throw null; } public System.Buffers.OperationStatus CompressFinal(System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesConsumed, out int bytesWritten) { bytesConsumed = default(int); bytesWritten = default(int); throw null; } ... } // Allow finalization in the Compress method. public partial struct BrotliEncoder : System.IDisposable { ... public System.Buffers.OperationStatus Compress(System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesConsumed, out int bytesWritten, bool isFinished = false) { bytesConsumed = default(int); bytesWritten = default(int); throw null; } ... } ``` #### Naming ```C# // Static single-pass compress/decompress BrotliEncoder.TryCompress(...) vs BrotliEncoder.TryCompressData(...) vs BrotliEncoder.CompressFully(...) vs BrotliEncoder.CompressSingle vs BrotliEncoder.CompressData // Iterative compress/decompress BrotliEncoderInstance.Compress vs BrotliEncoderInstance.CompressSegment ``` ### Example Usage ```C# public interface IOutput { Span<byte> Buffer { get; }; void Commit(int bytes); void Resize(int minimumSize); } // This code is very naive, but it does illustrate a pipe scenario public static void Compress_WithState(ReadOnlyMemory<byte>[] inputs, IOutput output) { BrotliEncoder encoder; for(int i=0; i<inputs.Length; i++) { var input = inputs[i]; while (!input.IsEmpty) { var buffer = output.Buffer; encoder.Compress(input, buffer, out int bytesConsumed, out int written); output.Commit(written); input = input.Slice(bytesConsumed); } } encoder.Flush(output, out int bytesWritten, isFinished: true); encoder.DIspo } public static void Decompress_WithState(ReadOnlySpan<byte>[] inputs, IOutput output) { BrotliDecoder decoder; for(int i=0; i<inputs.Length; i++) { var input = inputs[i]; while (!decoder.IsFinished() && !input.IsEmpty) { var buffer = output.Buffer; decoder.Decompress(input, buffer, out int bytesConsumed, out int written); output.Commit(written); input = input.Slice(bytesConsumed); } } decoder.Dispose(); } public static void Compress_WithoutState(ReadOnlySpan<byte> input, Span<byte> output) { BrotliEncoder.CompressFully(input, output, out int bytesWritten); } public static void Decompress_WithoutState(ReadOnlySpan<byte> input, Span<byte> output) { BrotliDecoder.DecompressFully(input, output, out int bytesWritten); } ``` ## Implementation The implementation will be based around the c code provided by [Google](https://github.com/google/brotli) that will be inserted into our existing native Compression libraries ([clrcompression (Windows)](https://github.com/dotnet/corefx/tree/master/src/Native/Windows/clrcompression) and [System.IO.Compression.Native (Unix)](https://github.com/dotnet/corefx/tree/master/src/Native/Unix/System.IO.Compression.Native). In CoreFX we'll have a managed wrapper to pinvoke into the native brotli implementation and provide the above API around it, same as we do for zlib. See https://github.com/dotnet/corefxlab/issues/1673 for a discussion on the pros of cons of a fully managed implementation and my justification for using the native approach (at least for now). Performance testing to come later, with the implementation PR. This proposal is an evolution of [the CoreFXLab implementation of Brotli](https://github.com/dotnet/corefxlab/tree/master/src/System.IO.Compression.Brotli). This is a component of https://github.com/dotnet/corefx/issues/24826 PTAL: @joshfree @KrzysztofCwalina @GrabYourPitchforks @ViktorHofer @stephentoub @terrajobst @ahsonkhan @JeremyKuhne 25788 area-System.IO Fix tests for path validation changes on Windows And Unix The Null check was added to GetFullPath function in the coreclr. These tests are in respond to that. Fixes #25665 25789 area-System.Memory Add {RO}Span GetReference and ROMemory TryGetArray to MemoryMarshal Part of: https://github.com/dotnet/corefx/issues/25412 https://github.com/dotnet/corefx/issues/25615 Depends on the PR in coreclr - https://github.com/dotnet/coreclr/pull/15417 cc @jkotas, @stephentoub, @KrzysztofCwalina 25790 area-Infrastructure Fix Alpine Linux dotnet host restore for tests The dependencies.props refer to an old version of dotnet host that predates the first version we have ever had available for Alpine. This change moves the version to a recent one, the same one that MicrosoftNETCoreAppPackageVersion is set to. 25791 area-System.Drawing Don't directly throw Exception System.Drawing Close #25526. Contributes to #23748. cc: @safern 25792 area-System.IO NamedPipeServerStream creates a socket not a fifo on ubuntu "I expected to use NamedPipeServerStream to create a fifo file on linux, but it created a socket Named ""CoreFxPipe_1.fifo"" in /tmp directory. here is test code: ```c# NamedPipeServerStream fifo = new NamedPipeServerStream(""1.fifo"",PipeDirection.InOut); fifo.WaitForConnection(); ``` what is the reason? how to create a fifo on linux? [EDIT] Add C# syntax highlighint by @karelz" 25793 area-System.Net UnixNetworkInterface: when no physical address, use PhysicalAddress.None and ensure index is set Fixes https://github.com/dotnet/corefx/issues/25264 25794 area-Meta Sync Interop.GetCwd with coreclr Sync changes made in https://github.com/dotnet/coreclr/pull/15229 25795 area-Microsoft.CSharp Microsoft.CSharp should support non-trailing named parameters C# now allows them, so so should Microsoft.CSharp. Support directly on `dynamic` would depend on changes from Roslyn, but Roslyn can't offer that support until it will work with the library. Support should match the behaviour of statically-bound C#, except for treating the case of a name that was changed in an override the same as the current dynamic behaviour, since in static C# that depends on the variable type in a way that doesn't follow for dynamic code. 25796 area-Serialization Don't directly throw Exception System.Runtime.Serialization.Json Contributes to #23748. I found one place where generic Exception could reach user. I split tests because netfx throw System.Runtime.CallbackException but it doesn't exist on netcoreapp. Maybe we should add System.Runtime.CallbackException to netcore. Found also one helper method [here](https://github.com/MarcoRossignoli/corefx/blob/362ebe743a3d7cedb14a29a7a9f60d16545d5488/src/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DiagnosticUtility.cs#L78) throws generic Exception, but i didn't found any useful test. cc: @shmao, @zhenlan 25798 area-Infrastructure Fix pre-build cleanup step. "skip ci please This is an official build change only. ""Remove-Item -Recurse"" has a known issue (https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Management/Remove-Item?view=powershell-6). This causes builds to have errors like this trying to run the cleanup: [error]Remove-Item : Cannot remove item E:\A\_work\742\s\corefx: The directory is not empty. This change makes us do the recursive delete ourselves by enumerating the files, sorting them so the longest filenames occur first, and then deleting them." 25800 area-System.Net HttpClient throws unexpected TaskCanceledException when HttpClient is reused "**This is the raw stack trace from the exception that occurs**: ``` FATAL: Unhandled exception (A task was canceled.). DEBUG: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() at System.Net.Http.HttpClient.<FinishSendAsyncUnbuffered>d__59.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at QuarkHttp.QNewHttpClient.<SendNewAsync>d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at QuarkHttp.QHttpClient.<SendAsync>d__1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at DataApi.<GetDataAsync>d__4.MoveNext() in C:\...\DataApi.cs:line 84 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at DataPoller.<RefreshChangesAsync>d__18.MoveNext() in C:\...\DataPoller.cs:line 121 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at DataPoller.<RunPollCycle>d__17.MoveNext() in C:\...\DataPoller.cs:line 98 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadPoolWorkQueue.Dispatch() ``` **The issue**: My problem originates with the `HttpWebRequest` API being depricated and a significantly lower performance version being used in .NET Core 2.0. I use a library (QuarkHttp) that is a tiny wrapper around the `HttpWebRequest` API. When porting this wrapper library to .NET Core, I used a shared `HttpClient` instance to avoid the overhead of creating new connections each time (following @geoffkizer's [comment](https://github.com/dotnet/corefx/issues/18237#issuecomment-294366064) /cc @davidsh). My code looks like this: ```c# static QNewHttpClient() { _defaultHttpClient = CreateHttpClient((false, null)); _proxyHttpClients = new ConcurrentDictionary<(bool, IWebProxy), HttpClient>(); } public static async Task<QHttpWrapNewResponse> SendNewAsync(this QHttpRequest request, bool fetchResponse = true, bool isAllowRedirects = false, int timeout = 100000, IWebProxy proxy = null) { HttpClient httpClientToUse = _defaultHttpClient; if (isAllowRedirects || proxy != null) httpClientToUse = _proxyHttpClients.GetOrAdd((isAllowRedirects, proxy), CreateHttpClient); DateTime startTime = DateTime.Now; HttpRequestMessage requestMessage = CreateHttpRequestMessage(request); HttpCompletionOption completionOption = (fetchResponse ? HttpCompletionOption.ResponseContentRead : HttpCompletionOption.ResponseHeadersRead); HttpResponseMessage responseMessage; try { responseMessage = await httpClientToUse.SendAsync(requestMessage, completionOption, (new CancellationTokenSource(timeout)).Token).ConfigureAwait(false); } catch (Exception ex) when (ex is TaskCanceledException || ex is OperationCanceledException) { Log.Error($""{ex.GetType()} thrown (Time taken: {(DateTime.Now - startTime).TotalSeconds}s).""); Log.Debug($""URL: {request.Url}\tMethod: {request.Method}""); throw; } return new QHttpWrapNewResponse(responseMessage, fetchResponse); } private static HttpClient CreateHttpClient((bool allowRedirects, IWebProxy proxy) properties) { HttpClientHandler clientHandler = new HttpClientHandler { AllowAutoRedirect = properties.allowRedirects, AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip, UseCookies = false }; if (properties.proxy != null) { if (!clientHandler.SupportsProxy) throw new Exception(""Proxy not supported.""); clientHandler.UseProxy = true; clientHandler.Proxy = properties.proxy; } return new HttpClient(clientHandler) { Timeout = TimeSpan.FromMilliseconds(Int32.MaxValue) }; } private static HttpRequestMessage CreateHttpRequestMessage(QHttpRequest request) { HttpRequestMessage requestMessage = new HttpRequestMessage(new HttpMethod(request.Method.Name()), request.Url); requestMessage.Version = request.Version; if (request.Referrer != null) requestMessage.Headers.TryAddWithoutValidation(""referer"", request.Referrer); foreach (string curHeader in request.Headers) { string normalizedHeader = curHeader.ToLower(); if (normalizedHeader != ""content-type"") //requestMessage.Headers.Add(curHeader, request.Headers[curHeader]); if (!requestMessage.Headers.TryAddWithoutValidation(curHeader, request.Headers[curHeader])) throw new Exception(""Header invalid.""); } if (request.Payload != null) { requestMessage.Content = request.Payload; requestMessage.Content.Headers.ContentType = MediaTypeHeaderValue.Parse(request.ContentType); } return requestMessage; } ``` The exception occurs on this line ``` responseMessage = await httpClientToUse.SendAsync(requestMessage, completionOption, (new CancellationTokenSource(timeout)).Token).ConfigureAwait(false); ``` In the exception handler, I measure the time taken myself to ensure that I wasn't missing something obvious. This is the output of that logging: ``` [2017/12/08 16:37:43.742 QuarkHttp.QNewHttpClient] ERROR: System.Threading.Tasks.TaskCanceledException thrown (Time taken: 100.0041412s). [2017/12/08 16:37:43.742 QuarkHttp.QNewHttpClient] DEBUG: URL: https://some.site/url Method: Get ``` One point to note is that this issue occurs across atleast 5 different domains that I know of, but have never seen this issue anywhere in the past. It works as expected on the .NET framework 4.5.x,4.6.x,4.7.x and Mono 4.x.x/5.x.x. However, on .NET Core, the issue occurs very often (many times an hour in my application). **This is why I think this is a framework issue rather than my own error**: In the `SendNewAsync` method, the line `HttpClient httpClientToUse = _defaultHttpClient;` causes the reuse of the default HttpClient. When this line is changed to `HttpClient httpClientToUse = CreateHttpClient((false, null));` (which is used to initialize the default HttpClient in the first place as seen in the constructor), a new HttpClient is used for every request. This makes things slower, but the issue disappears. It only occurs when the same `HttpClient` is reused. I have no code that modifies the `HttpClient` in any way after it is initially created. In my specific application, the proxy and allowRedirects options are never changed, so the `HttpClient` that's used wasn't taken from `_proxyHttpClients` either. I'm not sure how to debug this issue further. I could definitely test things if anyone has ideas. My .NET Core version is 2.0.2, and it runs on Ubuntu 16.04." 25801 area-System.Security Should the Span-based Try* methods be renamed? As part of the (awesome) Span work, many `Try*` methods have been introduced in a bunch of places (e.g https://github.com/dotnet/corefx/blob/master/src/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSA.cs). Historically, the `Try*` pattern has almost always been used [for methods that don't throw under normal circumstances and instead return a boolean indicating whether the operation was successful or not](https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/exceptions-and-performance#try-parse-pattern). Yet, many of these new methods don't respect this pattern and only use the boolean to indicate whether the destination `Span` was large enough (e.g `RSA.TryDecrypt()` will throw an exception if the source data is invalid). Using the `Try*` prefix for methods that actually throw is extremely confusing. Couldn't you remove it and use [`OperationStatus`](https://github.com/dotnet/corefx/blob/master/src/System.Memory/src/System/Buffers/OperationStatus.cs) instead of the boolean? 25802 area-System.IO Re-enable DriveInfo test on Windows Subsystem for Linux Related https://github.com/dotnet/corefx/issues/11570 25803 area-System.IO `dotnet pack` product broken .nupkg with the latest daily build(2.2.0-preview1) _From @yyjdelete on December 7, 2017 1:34_ Test with dotnet sdk `2.2.0-preview1-007736`/7622/7460, Windows 10 x64(17064). And `2.1.1` in VS15.5preview5 works well. # Step: 1. Install the latest daily build of sdk 2. `dotnet new classlib` 3. `dotnet pack` 4. Open the output .nupkg with `NuGet Package Explorer` or some zip manager( and try unpack it), and get an error. 5. Found the `.nuspec` file in the `nupkg` has wrong CRC(but the packed data is right) _Copied from original issue: dotnet/sdk#1801_ 25804 area-System.Runtime Iterating over a string builder by index becomes ~exponentially slow for large builders This is motivated by [this issue ](https://github.com/Microsoft/msbuild/issues/1593) originally opened against MSBuild, which internally in its reuseable string builder factory compares string builders by index. It happens to start from the end, but that doesn't seem to matter. The opener observed this can be enormously slower that creating a string first. Using [this benchmark program](https://gist.github.com/danmosemsft/873f5bd1086d3af1cf5471edca564b91) I get the following results: ``` BenchmarkDotNet=v0.10.11, OS=Windows 10 Redstone 3 [1709, Fall Creators Update] (10.0.16299.98) Processor=Intel Xeon CPU E5-1620 0 3.60GHz, ProcessorCount=8 Frequency=3507174 Hz, Resolution=285.1299 ns, Timer=TSC [Host] : .NET Framework 4.7 (CLR 4.0.30319.42000), 32bit LegacyJIT-v4.7.2600.0 DefaultJob : .NET Framework 4.7 (CLR 4.0.30319.42000), 32bit LegacyJIT-v4.7.2600.0 Method | N | Mean | Error | StdDev | ---------------- |----- |-------------:|------------:|------------:| ToStringFirst | 100 | 2.028 us | 0.0403 us | 0.0465 us | IndexedBackward | 100 | 21.399 us | 0.4123 us | 0.5063 us | IndexedForward | 100 | 23.020 us | 0.4461 us | 0.4581 us | ToStringFirst | 1000 | 43.210 us | 0.5032 us | 0.4202 us | IndexedBackward | 1000 | 323.959 us | 7.3317 us | 6.8581 us | IndexedForward | 1000 | 335.538 us | 6.3072 us | 5.8997 us | ToStringFirst | 5000 | 217.657 us | 4.1058 us | 4.3931 us | IndexedBackward | 5000 | 6,542.491 us | 131.7964 us | 223.8003 us | IndexedForward | 5000 | 6,301.246 us | 102.0129 us | 90.4317 us | ``` 64 bit ``` BenchmarkDotNet=v0.10.11, OS=Windows 10 Redstone 3 [1709, Fall Creators Update] (10.0.16299.98) Processor=Intel Xeon CPU E5-1620 0 3.60GHz, ProcessorCount=8 Frequency=3507174 Hz, Resolution=285.1299 ns, Timer=TSC [Host] : .NET Framework 4.7 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.2600.0 DefaultJob : .NET Framework 4.7 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.2600.0 Method | N | Mean | Error | StdDev | ---------------- |----- |-------------:|------------:|------------:| ToStringFirst | 100 | 1.944 us | 0.0369 us | 0.0410 us | IndexedBackward | 100 | 22.955 us | 0.2145 us | 0.1902 us | IndexedForward | 100 | 22.674 us | 0.2493 us | 0.2332 us | ToStringFirst | 1000 | 40.258 us | 0.4520 us | 0.4007 us | IndexedBackward | 1000 | 325.231 us | 4.6369 us | 4.3374 us | IndexedForward | 1000 | 332.819 us | 8.0014 us | 7.4845 us | ToStringFirst | 5000 | 200.979 us | 1.2610 us | 1.1179 us | IndexedBackward | 5000 | 7,950.240 us | 157.2641 us | 253.9522 us | IndexedForward | 5000 | 8,137.382 us | 161.3316 us | 251.1739 us | ``` Clearly indexing is going to have a lot of overhead such as bounds checking. But I would expect that to be proportional to N, and we see a big jump when N gets large. Related to fragmentation of the SB? Can we do better? 25805 area-Serialization Add DisableWarning parameter when compile the sgen generated code. Disable the warning when compile the sgen generated code. Will disable the warning 219 and 162 by default. The customer can also customize the warning they want to disable by adding the following parameter in their project. ``` <PropertyGroup> <SerializationAssemblyDisabledWarnings>215;313</SerializationAssemblyDisabledWarnings> </PropertyGroup> ``` Fix #25616 @shmao @zhenlan @mconnew 25806 area-Infrastructure Hotfix for the Alpine CI issue The Alpine CI is failing due to an old version of dotnet host package specified in the dependencies.props file. There are no Alpine packages for that version. However, updating that version causes Invariant.Tests tests to fail for an unclear reason. So I am making this change that disables building tests for Alpine in the CI. That means we will still build both native and managed code of corefx. This change is temporary until the Invariant test issue is understood and fixed. 25807 area-System.IO Re-enable additional tests on WSL Related https://github.com/Microsoft/BashOnWindows/issues/1011 and https://github.com/Microsoft/BashOnWindows/issues/308 25808 area-System.Net Implement basic cancellation for the async IO in sslstream. cc @stephentoub @wfurt @karelz @Drawaes @Tratcher Can you help running this commit with the asp.net benchmark runs, to ensure this change doesn't cause perf issues? fixes #25206 25809 area-System.Console Extra newline in Linux on console input I have the following code targeted at .NET Core 2.0 ```c# while (true) { Console.WriteLine(DateTime.Now); // do some work Console.ReadKey(); } ``` When the program is run on Windows, typing `enter` a few times results in output like: ``` 12/9/2017 12:14:15 AM 12/9/2017 12:14:16 AM 12/9/2017 12:14:17 AM ``` However, on Ubuntu, the output is ``` 12/9/17 6:13:55 AM 12/9/17 6:14:07 AM 12/9/17 6:14:08 AM ``` I believe this is because on Windows, typing the enter key on `Console.ReadKey()` does not actually print the `\n` character, whereas on Linux it does. Is this something that can be fixed? 25810 area-System.Net WebClient.DownloadString() method hangs sometimes (Ubuntu) WebClient.DownloadString() method hangs sometimes when called on Ubuntu platform. There is no system (at least I couldn't find it), but there are possibly many parallel HTTP requests called from PLINQ query, and the target sites are rather slow. In couple with the fact that .Core platform doesn't allow to abort threads, it leads to plenty of threads and retained data hanged forever. Well, DownloadStringTaskAsync + Task.Delay somehow save the day, but there can be resource leakage when download task hangs. All HttpWebRequest timeouts (Timeout and ReadWriteTimeout) are explicitly set to 1 minute. Ubuntu 16.10 and 17.10 .NET Core 2.0.0 25811 area-Infrastructure My build is failing on Windows 10 I have been getting build errors for a couple of days. I just updated to ec6014e and it's the same error so I don't suspect the code. The following is an example: C:\Users\russh\Git\dotnet\corefx\src\shims\ApiCompat.proj(76,5): error : TypesMustExist : Type 'System.ComponentModel.Composition.AttributedModelServices' does not exi st in the implementation but it does exist in the contract. The complete output is here: https://pastebin.com/4pjSMYnp The errors seem to start after the following warning: EXEC : ApiCompat warning : 0 : Found 'System.ComponentModel.Composition' with PublicKeyToken 'b77a5c561934e089' instead of 'b03f5f7f11d50a3a'. [C:\Users\russh\Git\dotn et\corefx\src\shims\ApiCompat.proj] Can anyone tell me what I've done wrong? 25813 area-Infrastructure Fix Alpine CI step 2 "I have found that the ""Build tests"" phase needs to be excluded too until we can update the dotnet host package version." 25816 area-System.Net Core doesn't read the server certificate "@hammond-of-texas commented on [Fri Dec 08 2017](https://github.com/dotnet/core/issues/1142) # Issue Title Core doesn't read the server certificate # General In general, a simple request like this will work in .Net: ```c# static void Main(string[] args) { HttpWebRequest request = (HttpWebRequest)WebRequest.Create(""https://www.sbb.ch""); HttpWebResponse response = (HttpWebResponse) request.GetResponse(); X509Certificate cert = request.ServicePoint.Certificate; } ``` The same thing will fail in core 2.0 with a ""System.PlatformNotSupportedException: 'Operation is not supported on this platform.'"" exception. --- @richlander commented on [Sat Dec 09 2017](https://github.com/dotnet/core/issues/1142#issuecomment-350486532) PTAL @davidsh " 25817 area-System.Net Core does't read the server certificate "@hammond-of-texas commented on [Fri Dec 08 2017](https://github.com/dotnet/core/issues/1142) # Issue Title Core doesn't read the server certificate # General In general, a simple request like this will work in .Net: static void Main(string[] args) { HttpWebRequest request = (HttpWebRequest)WebRequest.Create(""https://www.sbb.ch""); HttpWebResponse response = (HttpWebResponse) request.GetResponse(); X509Certificate cert = request.ServicePoint.Certificate; } The same thing will fail in core 2.0 with a ""System.PlatformNotSupportedException: 'Operation is not supported on this platform.'"" exception. --- @richlander commented on [Sat Dec 09 2017](https://github.com/dotnet/core/issues/1142#issuecomment-350486532) PTAL @davidsh " 25818 area-System.Runtime Exception object should have a non-localized version for exception message https://twitter.com/archiecoder/status/939532182107951104 Have the message only in Japanese or Chinese does not help the developer. Having both the localized and non-localized versions would also help analytics service to sort by English message only. 25819 area-Microsoft.CSharp Implement non-trailing named arguments in Microsoft.CSharp Closes #25795 First few commits refactor `CMethodIterator`, `MemberLookup`, `GroupToArgsBinder` and `GroupToArgsBinderResult` to clear some complications before the implementation: * Remove `CMethodIterator._bcanIncludeExtensionsInResults` Always false. * Remove `CMethodIterator._allowBogusAndInaccessible` Always true. * Remove `MemberLookup._results` Never used (legacy of static compiler's extension handling). * Remove paths for `_pContainingTypes` being empty. Never happens. (Would be possible when static compiler was looking for extension methods). * Remove `_bAtEnd` Check on correct use unnecessary in internal class. * Remove unused parameters * Replace private field-only properties with field access. * Getter methods to properties; auto when appropriate. * Remove `_bIsCheckingInstanceMethods` Always true. * Readonly fields where possible. * Rename Hungarian-style names and remove redundant initializers. * `GroupToArgsBinderResult` members to auto properties. * Remove `InconvertibleResult`/`_inconvertibleResults` Set but never accessed. * Match error code numbers to corresponding C# errors. Not clear why these were ever different, but matching them makes the connection clearer. # Now the implementation * Add some initial (not yet passing) tests. * Allow non-trailing arguments (remove prohibition) * Detect misnamed arguments in iterator. * Exclude methods from consideration if non-trailing names don't match. * Correct error for name not found in non-trailing. * Catch CS8328 errors. * Return temporarily removed assertion. * Correctly handle correctly naming the first of several `params` arguments * Add tests based on Roslyn's tests for non-trailing named arguments. * Fix handling when name is changed in an override. Use the name defined on the type of the argument if `UseCompileTimeType` or the type of the object, otherwise. 25820 area-System.Xml XmlDocument and XDocument .Load badly resolves the path "I am porting our server console app from .NET Framework 4.6.1 to .NET Core and after I made it compile, then I got a lot of runtime exceptions of XmlDocument and XDocument not loading. I made a quick repro with this:  ```c# class Program { static void Main(string[] args) { var doc = new XmlDocument(); doc.Load(""test.xml""); var doc2 = XDocument.Load(""test.xml""); } } ``` The problem is, when this file `test.xml` is located at path that contains character `#`. For me it is at `""C:\\dev\\c#\\Test\\ConsoleApp1""` and that produces the above error." 25823 area-System.Reflection Codecoverage corefx\src\System.Reflection.Metadata\src\System\Reflection\Metadata\MetadataReader.cs Add code coverage in reference to https://github.com/dotnet/corefx/issues/931 Completed coverage for InitializeStreamReaders, ReadStreamHeaders, GetMetadataKind, ReadMetadataHeader, and one constructor. 25824 area-Microsoft.CSharp Microsoft.CSharp fails on ones-complement on enums smaller than 32-bit in size in checked context ```C# public enum Int8Enum : byte { A, B, C, D, E } /* … */ dynamic d = Int8Enum.A; checked{ var result = ~d; // Throws OverflowException } ``` I'm afraid I introduced this regression with 184d882d which was meant to remove all of the setting of `CheckedNormal` and `CheckedNormal` (since merged as `Checked`) and leave the false default, but it left the redundant setting of it before then, so it can now be set wrong (it should always be false, but that will set it to true if the initial context is checked). The same regression can cause assignments to have slightly less good (but still reasonable) error messages. 25825 area-Microsoft.CSharp Microsoft.CSharp: Set temporary unchecked context correctly. Fixes #25824 Fix also makes `ConstOutOfRange` and `ConstOutOfRangeChecked` reachable (were made erroneously unreachable by #25824), so contributes to #22470 * Don't optimise out casts in enum unary operations. Fixes #25826 25826 area-Microsoft.CSharp Microsoft.CSharp throws InvalidCast on complement of constant enum value "```C# var cs =CallSite<Func<CallSite, object, object>>.Create( Microsoft.CSharp.RuntimeBinder. Binder.UnaryOperation( CSharpBinderFlags.CheckedContext , ExpressionType.OnesComplement, GetType(), new[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.Constant, null) })); cs.Target(cs, StringComparison.CurrentCulture); ``` or ```C# var cs =CallSite<Func<CallSite, object, object>>.Create( Microsoft.CSharp.RuntimeBinder. Binder.UnaryOperation( CSharpBinderFlags.None , ExpressionType.OnesComplement, GetType(), new[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.Constant, null) })); cs.Target(cs, StringComparison.CurrentCulture); ``` Throws `InvalidCastException` ""Unable to cast object of type 'Microsoft.CSharp.RuntimeBinder.Semantics.EXPRCONSTANT' to type 'Microsoft.CSharp.RuntimeBinder.Semantics.EXPRCAST'."" Same issue exists in NetFX." 25827 area-Microsoft.CSharp Tests for ambiguous interface member errors in Microsoft.CSharp Tests error cases that were not possible as a consequence of #14752 but are now correctly possible due to that issue being fixed. Demonstrates `ERR_AmbigMember` is usable, contributes to #22470 25828 area-System.Security Creation of X509Certificate2 fails on Linux but works on Windows "@secana commented on [Sun Dec 10 2017](https://github.com/dotnet/core/issues/1145) # Creation of X509Certificate2 fails on Linux but works on Windows Creating a X509Certificate2 instance from a byte array works on Windows but fails on Linux with a ""CryptographicException"". # General Tested Systems: Windows 10 Ubuntu 16.04, Ubuntu 17.10 OpenSuse 42 All tested with: **Dotnet Core Version: 2.0.2** Example code: ``` static void Main(string[] args) { var cert = new X509Certificate2(Cert.CertBytes); } ``` On Windows: Valid X509Certificate2 instance is created On Linux: An exception is thrown: ``` {System.Security.Cryptography.CryptographicException: Cannot find the original signer. at Internal.Cryptography.Pal.PkcsFormatReader.TryReadPkcs7(SafePkcs7Handle pkcs7, Boolean single, ICertificatePal& certPal, List`1& certPals) at Internal.Cryptography.Pal.PkcsFormatReader.TryReadPkcs7Der(Byte[] rawData, Boolean single, ICertificatePal& certPal, List`1& certPals) at Internal.Cryptography.Pal.CertificatePal.FromBlob(Byte[] rawData, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags) at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(Byte[] data) at System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(Byte[] rawData) at CertTest.Program.Main(String[] args) in /home/CertTest/Program.cs:line 14} ``` If the certificate is first parsed by BouncyCastle and then converted into a X509Certificate2 it works. Example which works on Linux ``` static void Main(string[] args) { var bouncy = new Org.BouncyCastle.X509.X509CertificateParser(); var bcert = bouncy.ReadCertificate(Cert.CertBytes); var wcert = new System.Security.Cryptography.X509Certificates.X509Certificate2(bcert.GetEncoded()); } ``` " 25829 area-System.Reflection Checksum is calculated before signing in System.Reflection.Metadata.PEBuilder Look here at the code to verify the checksum: https://github.com/dotnet/corefx/blob/45b724f6b6391910edea8a70f3f22a4a7996696d/src/System.Reflection.Metadata/tests/PortableExecutable/PEBuilderTests.cs#L665-L685 Note that there are no binary modifications before calculating the checksum, so the checksum should include everything in the binary except for the checksum blob itself. But now look at the signing code: https://github.com/dotnet/corefx/blob/45b724f6b6391910edea8a70f3f22a4a7996696d/src/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEBuilder.cs#L496-L505 The checksum is calculated before writing the strong name signature, so it's calculated with the zero value. This doesn't look correct to me, and my tests with the CLR signing code seem to indicate that the checksum should include the strong name signature. 25831 area-Infrastructure Ignore placeholder build configurations in build all configurations targets In order to support negative build configurations we need to ignore them when building all configurations in the vertical. Contributes to: https://github.com/dotnet/corefx/issues/24903 I need to explore more scenarios to see if we need more changes in corefx side to support this. Still going through them but this at least will allow us to add the negative configurations for the vertical. cc: @danmosemsft 25832 area-System.Memory Add ReadOnlySpan<T>(Span<T>) constructor "It would be very nice to add the constructor overload `ReadOnlySpan<T>(Span<T>)` to the [list of constructors](https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.server.kestrel.internal.system.readonlyspan-1.-ctor) of `ReadOnlySpan<T>`. Indeed, right now, it's not possible to have a method taking `Span<T>` as input and returning `ReadOnlySpan<T>` as output - the result being a fragment of the input. As a result, the logic end-up relying on ""soft"" immutability as `Span<T>` are returned (but never written to), as opposed to benefit from ""hard"" immutability, where writes would not even be possible." 25833 area-System.Net Abnormal High Memory Usage when using HttpClient "This is a continuation of the following issue: [https://github.com/PowerShell/PowerShell/issues/5609](url) Steps to reproduce ------------------ Server: [https://gist.github.com/markekraus/b16f0991a843d2d2459aa4178dfe55b5#file-express-js](url) ```javascript const express = require('express') const app = express() app.get('/api', function (req, res) { res.send('0') }) app.listen(5001, function () { console.log('Example app listening on port 5001') }) ``` Client: [https://gist.github.com/markekraus/b16f0991a843d2d2459aa4178dfe55b5#file-program-cs](url) ```csharp using System; using System.Diagnostics; using System.IO; using System.Net.Http; namespace MemLeakRepro { class Program { static void Main(string[] args) { if(args.Length != 2) { System.Console.WriteLine(""usage: <Uri> <Count>""); Environment.Exit(1); } DateTime start = DateTime.Now; System.Console.WriteLine(""Start: {0}"", start); Uri uri = new Uri(args[0]); Int32 count; if(!Int32.TryParse(args[1], out count)) { count = 500000; } for (int i = 0; i < count; i++) { HttpClientHandler handler = new HttpClientHandler(); HttpClient client = new HttpClient(handler); HttpResponseMessage response = client.GetAsync(uri).GetAwaiter().GetResult(); StreamReader reader = new StreamReader(response.Content.ReadAsStreamAsync().GetAwaiter().GetResult()); string result = reader.ReadToEnd(); reader.Dispose(); } DateTime end = DateTime.Now; System.Console.WriteLine(""End: {0}"", end); TimeSpan time = end - start; System.Console.WriteLine(""Run: {0}"", time); Process currentProcess = Process.GetCurrentProcess(); double memoryInMB = currentProcess.WorkingSet64 / 1048576; System.Console.WriteLine(""Memory: {0:N2} mb"", memoryInMB); Console.WriteLine(""Press any key to exit...""); Console.ReadKey(); } } } ``` Output ------------------ After 6,000,000 Api calls. ``` Apple:MemLeakRepro air$ dotnet run http://localhost:5001/api 6000000 Start: 12/10/2017 09:23:05 End: 12/11/2017 01:11:15 Run: 15:48:10.0077740 Memory: 491.00 mb Press any key to exit... Apple:MemLeakRepro air$ ```  Environment data ---------------- MacOS Sierra Version 0.12.6 Dotnet SDK 2.0.2 " 25834 area-System.Data SqlClient 4.4.1 not published to NuGet SqlClient 4.4.1 resolves https://github.com/dotnet/corefx/issues/13422. The November Update release notes indicate SqlClient 4.4.1 is released https://github.com/dotnet/core/blob/master/release-notes/2.0/2.0.3.md Howvere the latest version on NuGet appears to be 4.4.0 https://www.nuget.org/packages/System.Data.SqlClient/ Am I misunderstanding? cc @saurabh500 25835 area-System.Net Fixing possible NullReferenceException when using X509Certificate. # Problem When using a `System.Net.Security.LocalCertificateSelectionCallback` that returns a `System.Security.Cryptography.X509Certificates.X509Certificate` created with the default constructor (`new X509Certificate()`) the `System.Net.Security.SslStream` would throw a `NullReferenceException` when calling `AuthenticateAsClient`. ## Cause `System.Net.Security.SecureChannel.EnsurePrivateKey(X509Certificate certificate)` does not handle `X509Certificate` types that have a `IntPtr.Zero` handle which can happen if the `X509Certificate` has been created with the default constructor. The call to `SecureChannel.MakeEx(certificate)` would return `null` which then would throw a `NullPointerException` when trying to compute the `certHash` right after. ## Solution Move the certHash assignment into the `certEx != null` if block and provide a alternative `certHash` assignment for `X509Certificate` types that have a `IntPtr.Zero` handle. ### Notes I have not added any tests for this particular problem as I am not sure on where to exactly put such a test. I would be willing to add a test if someone would be able to give me some guidance on where to start. Also I wasn't sure if little patches like this need to have a ticket/issue attached or not. Apologies if they do. 25836 area-System.Linq Update byref of custom S.L.Expressions convert method in interpreter While conversion operators cannot normally use methods with `ref` parameters, Expressions does allow them if the method in question is explicitly requested. The interpreter however does not write-back the parameter of the call. Correct this. Fixes #18445 25837 area-Meta Strengthen runtime tamper-proofing of managed applications This is a placeholder for work to be performed under the Security Epic. Summary: enable compiler and OS runtime security features to make it more difficult for adversaries to modify managed applications as they're executing. 25839 area-Infrastructure Enable automatic updating of dotnet host version The MicrosoftNETCoreDotNetHostPackageVersion and MicrosoftNETCoreDotNetHostPolicyPackageVersion properties in dependencies.props are not updated automatically. We should enable their updating using the @dotnet-maestro-bot like we do for versions of MicrosoftNETCoreAppPackageVersion and other similar properties. The change will need to wait until the https://github.com/dotnet/core-setup/issues/3510 is fixed though, because the recent dotnet host packages have broken handling of System.Globalization.Invariant property. 25840 area-Infrastructure Reenable Alpine optional CI After fixing the issue with the CI build of tests, I am re-enabling the CI again. Still as optional only, I will update it to automatic one after testing it manually. 25842 area-System.IO Improve GetFiles performance (Unix) Extend the efficiency wins to Unix. Will require some care with UTF8. Cost from @JeremyKuhne Windows part https://github.com/dotnet/corefx/issues/25387 25844 area-System.IO Upgrade our ZLib version for Windows We've missed a few releases of zlib and should update [our version of zlib](https://github.com/dotnet/corefx/tree/master/src/Native/Windows/clrcompression) from [1.2.8 to 1.2.11](https://www.zlib.net/ChangeLog.txt). If possible, we should retain the perf improvements contributed by the Intel folks (cc: @bjjones). @bjjones @ViktorHofer 25846 area-System.Runtime Add StringBuilder.Equals(string) to efficiently compare a StringBuilder with a string. ## Issue There is no efficient way to compare the content of a large StringBuilder with a string. If you iterate with the string builder indexer, you hit [pathological performance](https://github.com/dotnet/corefx/issues/25804) on chunky StringBuilders (the typical case). If instead you create a temporary string from the builder, you have a large string that has to be garbage collected. ## Rationale MSBuild has to compare StringBuilder with String in two hot paths ([one ](https://github.com/Microsoft/msbuild/blob/d075c6f7c09bb2d766b45ac740d867ecf08ff6bb/src/Shared/ReuseableStringBuilder.cs#L86) and [two](https://github.com/Microsoft/msbuild/blob/3986423a4cd2e7a716ab0c0d6ef28485f1844977/src/Shared/OpportunisticIntern.cs#L309)). Right now it does it with indexes. If the string is large, which it can be if it was created by reading a file into an item list, [a customer observed this](https://github.com/Microsoft/msbuild/issues/1593) to be pathologically slow. They can take a change to fall back to making a temporary string for long builders, but that's an extra branch and they have to pick a cut over point. However it would be easy for a StringBuilder to efficiently compare itself with a string, because it just walks its chunks. ## Proposal ```c# public sealed partial class StringBuilder : ... { public bool Equals(System.Text.StringBuilder sb) { throw null; } // already exists public bool Equals(System.String value) { throw null; } // proposed } ``` The implementation would produce a result equivalent to ```c# return String.Equals(this.ToString(), s, StringComparison.Ordinal); ``` but be implemented by walking the chunks and the string together. There are various ways this could be optimzed, but the goal here is to just not be awful. 25847 area-System.Text System.Text.RegularExpressions.Tests.RegexReplaceTests/Replace OutOfMemoryException on two Regex tests on 64 bit Windows "These two regex tests have recently started failing consistently ``` yield return new object[] { ""([a-z]([a-z]([a-z]([a-z]([a-z]([a-z]([a-z]([a-z]([a-z]([a-z]([a-z]([a-z]([a-z]([a-z]([a-z])))))))))))))))"", ""abcdefghiklmnop"", ""$15"", RegexOptions.None, 15, 0, ""p"" }; yield return new object[] { ""([a-z]([a-z]([a-z]([a-z]([a-z]([a-z]([a-z]([a-z]([a-z]([a-z]([a-z]([a-z]([a-z]([a-z]([a-z])))))))))))))))"", ""abcdefghiklmnop"", ""$3"", RegexOptions.None, 15, 0, ""cdefghiklmnop"" }; ``` on 64 bit Windows runs ``` Unhandled Exception of Type System.OutOfMemoryException Message : System.OutOfMemoryException : Exception of type 'System.OutOfMemoryException' was thrown. Stack Trace : at Go18(RegexRunner ) at System.Text.RegularExpressions.RegexRunner.Scan(Regex regex, String text, Int32 textbeg, Int32 textend, Int32 textstart, Int32 prevlen, Boolean quick, TimeSpan timeout) at System.Text.RegularExpressions.Regex.Run(Boolean quick, Int32 prevlen, String input, Int32 beginning, Int32 length, Int32 startat) at System.Text.RegularExpressions.Regex.Match(String input, Int32 startat) at System.Text.RegularExpressions.RegexReplacement.Replace(Regex regex, String input, Int32 count, Int32 startat) at System.Text.RegularExpressions.Regex.Replace(String input, String replacement) at System.Text.RegularExpressions.Tests.RegexReplaceTests.Replace(String pattern, String input, String replacement, RegexOptions options, Int32 count, Int32 start, String expected) ``` Nothing has changed in regex code/tests. It's also odd that the OOM is 64 bit only. @maririos is the repro system ready and working for such a case?" 25848 area-System.Memory Adding Span LastIndexOfAny APIs and tests Fixes https://github.com/dotnet/corefx/issues/24839 Related PR https://github.com/dotnet/corefx/pull/25748 cc @benaadams, @KrzysztofCwalina, @GrabYourPitchforks, @jkotas, @stephentoub 25849 area-System.ComponentModel Porting remaining System.ComponentModel.Composition tests Ported test project has around 1500 tests now. Increases line/branch coverage to 88% and 80% respectively from 73% and 65% Around 80 tests are still disabled on all platforms another 70 tests are only disabled on unix and need troubleshooting (these disabled tests are linked with issue 25498.) cc: @danmosemsft 25850 area-System.Memory Add MemoryExtension APIs to get parity with array APIs "As part of completing the MemoryExtensions feature - https://github.com/dotnet/corefx/issues/24880 - here are the proposed Span extension APIs that should get added to get parity with the available APIs on array. ## Proposed API Additions ```C# public static class MemoryExtensions { // Slice + CopyTo APIs can be used instead, hence we don't need the overloads //public static void Copy<T>(this ReadOnlySpan<T> sourceSpan, Span<T> destinationSpan, int length); //public static void Copy<T>(this ReadOnlySpan<T> sourceSpan, int sourceIndex, Span<T> destinationSpan, int destinationIndex, int length); // Span CopyTo API is already ""constrained"" in that if it throws an exception, the destination remains unchanged. Hence, we don't need this API //public static void ConstrainedCopy<T>(this ReadOnlySpan<T> sourceSpan, int sourceIndex, Span<T> destinationSpan, int destinationIndex, int length); public static bool Exists<T>(this ReadOnlySpan<T> span, Predicate<T> match); public static T Find<T>(this ReadOnlySpan<T> span, Predicate<T> match); public static int FindIndex<T>(this ReadOnlySpan<T> span, Predicate<T> match); // Slice the span before calling the method above, hence we don't need the overloads //public static int FindIndex<T>(this ReadOnlySpan<T> span, int startIndex, Predicate<T> match); //public static int FindIndex<T>(this ReadOnlySpan<T> span, int startIndex, int count, Predicate<T> match); public static T FindLast<T>(this ReadOnlySpan<T> span, Predicate<T> match); public static int FindLastIndex<T>(this ReadOnlySpan<T> span, Predicate<T> match); // Slice the span before calling the method above, hence we don't need the overloads //public static int FindLastIndex<T>(this ReadOnlySpan<T> span, int startIndex, Predicate<T> match); //public static int FindLastIndex<T>(this ReadOnlySpan<T> span, int startIndex, int count, Predicate<T> match); // Requires allocation public static T[] FindAll<T>(this ReadOnlySpan<T> span, Predicate<T> match); // Alternative to avoid allocation public static bool TryFindAll<T>(this ReadOnlySpan<T> span, Predicate<T> match, Span<T> result); public static void Reverse<T>(this Span<T>); // Slice the span before calling the method above, hence we don't need the overload //public static void Reverse<T>(this Span<T>, int index, int length); public static bool TrueForAll<T>(this ReadOnlySpan<T> span, Predicate<T> match); } ``` ## Sample Usage and Rationale The API usage should be almost identical to the Array API usage. Getting API parity with array makes it easier for customers to port their array-based code to Span wherever possible. Example sample usage: ```C# public static void UseTrueForAll() { ReadOnlySpan<string> values1 = new string[] { ""Y2K"", ""A2000"", ""DC2A6"", ""MMXIV"", ""0C3"" }; ReadOnlySpan<string> values2 = new string[] { ""Y2"", ""A2000"", ""DC2A6"", ""MMXIV_0"", ""0C3"" }; Assert.False(values1.TrueForAll(value => { return int.TryParse(value.Substring(value.Length - 1), out int s); })); Assert.True(values2.TrueForAll(value => { return int.TryParse(value.Substring(value.Length - 1), out int s); })); Assert.False(values1.TrueForAll(EndsWithANumber)); Assert.True(values2.TrueForAll(EndsWithANumber)); } private static bool EndsWithANumber(string value) { return int.TryParse(value.Substring(value.Length - 1), out int s); } ``` cc @KrzysztofCwalina, @dotnet/corefxlab-contrib, @stephentoub, @jkotas " 25851 area-System.Data Update comment in S.D.SqlClient about why GC.KeepAlive isn't needed. The comment says it isn't needed because of `OnStateChange`, but this appears outdated. It's still not needed though because the `ReRegisterForFinalize` below it will keep it rooted. Closes #6116 25854 area-System.Net How do I utilize HTTP caching with WinHttpHandler and HttpClient? "I'm using .NET Framework 4.7, but creating issue here because [System.Net.Http.WinHttpHandler](https://www.nuget.org/packages/System.Net.Http.WinHttpHandler/) NuGet package release notes lead to .NET Core repository, and another [issue](https://github.com/dotnet/core/issues/1023) about `WinHttpHandler` was moved from .NET Core repository to CoreFx repository. It is stated in many places accross .NET Framework documentation that WinINET is not suppose to be used in server enviroment, for example [Caching](https://msdn.microsoft.com/en-us/library/windows/desktop/aa383928(v=vs.85).aspx) page on MSDN: > **Note** WinINet does not support server implementations. In addition, it should not be used from a service. For server implementations or services use [Microsoft Windows HTTP Services (WinHTTP)](https://msdn.microsoft.com/en-us/library/windows/desktop/aa384273(v=vs.85).aspx). Moreover, WinINET caching is not always working in IIS. See [HttpClient enable cache on server](https://stackoverflow.com/questions/47715084/httpclient-enable-cache-on-server), [HttpClient not using cache on staging server](https://stackoverflow.com/questions/22375795/httpclient-not-using-cache-on-staging-server), [HttpWebRequest's cache is not working for ASP.NET Application on Windows Server 2012 R2](https://social.technet.microsoft.com/Forums/windows/en-US/1725a82d-7e21-41a3-9c7d-19a6b5819369/httpwebrequests-cache-is-not-working-for-aspnet-application-on-windows-server-2012-r2?forum=winservercore) questions and [IIS Hosted Web API Not Caching Internal HTTP Responses](http://chrisoldwood.blogspot.ru/2015/01/iis-hosted-web-api-not-caching-internal.html) article. So if I need to communicate with other HTTP servers in my server application (Web API or windows service) I need to use WinHTTP. I couldn't find any way to switch from WinINET to WinHTTP except using [`WinHttpHandler`](https://msdn.microsoft.com/en-us/library/system.net.http.winhttphandler(v=vs.105).aspx) class from [System.Net.Http.WinHttpHandler](https://www.nuget.org/packages/System.Net.Http.WinHttpHandler/) NuGet package: ```csharp var client = new HttpClient(new WinHttpHandler()) { BaseAddress = new Uri(""http://myresourceserver.com/"") }; var response = await client.GetAsync(""resource""); var result = await response.Content.ReadAsStringAsync(); ``` Now with this handler `HttpClient` is not using cache by default. I use following command to configure WinHTTP to use Fiddler proxy: `netsh winhttp set proxy 127.0.0.1:8888 ""<-loopback>""` and confirm that cache is not used. With `WinHttpHandler` I can't explicitly specify `CachePolicy` like I can with `WebRequestHandler`. It also seems like `WinHttpHandler` ignores `<requestCaching>` configuration file section and `HttpWebRequest.DefaultCachePolicy` static property. I found no information about caching in WinHTTP in official [documentation](https://msdn.microsoft.com/en-us/library/windows/desktop/aa384273(v=vs.85).aspx). " 25855 area-System.Diagnostics Expose Parent/Child Process Information via System.Diagnostics.Process "## Issue .Net Standard does not seem to provide a means to identify the parent or child processes of a given process. In the Windows world, this information can be obtained or extrapolated using [WMI's Win32_Process management object](https://stackoverflow.com/a/7189381/117424), [performance counters](https://stackoverflow.com/a/2336322/117424) or [P/Invoke](https://stackoverflow.com/a/3346055/117424). However, there doesn't seem to be a cross-platform .Net Standard way to do this. (If there is, please let me know! :-)) ## Rationale The ability to determine which processes are children (or grandchildren or great-grandchildren, etc.) of a process is needed in order to be able to kill a process tree without using platform-specific code. For example, [`Microsoft.DotNet.Tools.Test.Utilities.ProcessExtension`](https://github.com/dotnet/cli/blob/master/test/Microsoft.DotNet.Tools.Tests.Utilities/Extensions/ProcessExtensions.cs) relies on different code paths to handle killing a process tree on Windows and Linux. Both code paths involve invoking one or more command-line processes. If this proposal were implemented, this logic could potentially be replaced with OS-agnostic .Net Standard code that iterates through the process's children, calls [Kill](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.process.kill?view=netstandard-2.0) on each of them, then calls Kill on the parent. No multiple code paths. No need to invoke command-line processes. For completeness, it would be nice to have the ability to navigate both up (parent process) and down (child processes) the process tree. ## Proposal public partial class Process : .... { public int GetParentProcessId() { ... } // returns parent process Id currently associated with this process public Process GetParentProcess() { … } // returns parent process currently associated with this process public Process[] GetChildProcesses(bool includeAllDescendants = false) { ... } // setting the parameter to true results in grandchildren, great-grandchildren, etc., being included in the results; otherwise, only direct children are returned } At first glance, it might seem more appropriate to make the first two methods properties (e.g. `public int ParentProcessId { get { ... }}`). However, a process's parent can change. The API design guidelines suggest preferring a method over a property when ""calling the member twice in succession results in different results."" " 25856 area-Infrastructure DIA SDK missing error message is wrong/misleading "When trying to build CoreFX I ran `.\build.cmd`. I got the following error message: ``` if exist ""%VSINSTALLDIR%DIA SDK"" goto GenVSSolution echo Error: DIA SDK is missing at ""%VSINSTALLDIR%DIA SDK"". ^ This is due to a bug in the Visual Studio installer. It does not install DIA SDK at ""%VSINSTALLDIR%"" but rather ^ at VS install location of previous version. Workaround is to copy DIA SDK folder from VS install location ^ of previous version to ""%VSINSTALLDIR%"" and then resume build. :: DIA SDK not included in Express editions echo Visual Studio Express does not include the DIA SDK. ^ You need Visual Studio 2015 or 2017 (Community is free). echo See: https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/developer-guide.md#prerequisites exit /b 1 ``` The DIA SDK is now correctly installed by the installer. However I forgot to select the correct components when installing VS Community 2017. I am creating a PR to change the error message." 25857 area-System.Runtime Command line tokenization reconciling Using PasteArguments from Environment to avoid code duplication while getting command line. Issue #21267. Command Line tokenization is done all over the place and inconsistently. 25860 area-System.ComponentModel No dump found on fedora.25.amd64.Open:Release-x64 https://mc.dot.net/#/user/maryamariyan/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/12cbeed85897de05d63181974602cd977ea30966/workItem/System.ComponentModel.Composition.Tests/wilogs ``` 2017-12-11 21:09:52,527: INFO: proc(54): run_and_log_output: Output: /home/helixbot/dotnetbuild/work/1014c683-ec6f-487d-993a-1b6b74b767bc/Work/9f535837-9b48-4c90-93de-22f855e4574e/Unzip/RunTests.sh: line 87: 4381 Segmentation fault (core dumped) $RUNTIME_PATH/dotnet xunit.console.netcore.exe System.ComponentModel.Composition.Tests.dll -xml testResults.xml -notrait Benchmark=true -notrait category=nonnetcoreapptests -notrait category=nonlinuxtests -notrait category=OuterLoop -notrait category=failing 2017-12-11 21:09:52,577: INFO: proc(54): run_and_log_output: Output: Trying to find crash dumps for project: System.ComponentModel.Composition.Tests 2017-12-11 21:09:52,577: INFO: proc(54): run_and_log_output: Output: No new dump file was found in /home/helixbot/dotnetbuild/work/1014c683-ec6f-487d-993a-1b6b74b767bc/Work/9f535837-9b48-4c90-93de-22f855e4574e/Unzip 2017-12-11 21:09:52,583: INFO: proc(54): run_and_log_output: Output: ~/dotnetbuild/work/1014c683-ec6f-487d-993a-1b6b74b767bc/Work/9f535837-9b48-4c90-93de-22f855e4574e/Unzip ``` Opening an issue to see whether this is consistent. 25861 area-System.Diagnostics Process BasePriority test failure on WSL "1 Process test consistently fails on WSL on the latest RS4 Insiders Preview build: ```` <test name=""System.Diagnostics.Tests.ProcessTests.TestBasePriorityOnUnix"" type=""System.Diagnostics.Tests.ProcessTests"" method=""TestBasePriorityOnUnix"" time=""0.062201"" result=""Fail""> <traits> <trait name=""category"" value=""requireselevation"" /> </traits> <failure exception-type=""Xunit.Sdk.EqualException""> <message><![CDATA[Assert.Equal() Failure\nExpected: 19\nActual: -19]]></message> <stack-trace><![CDATA[ at System.Diagnostics.Tests.ProcessTests.SetAndCheckBasePriority(ProcessPriorityClass exPriorityClass, Int32 priority) in /home/jfree/dd/corefx/src/System.Diagnostics.Process/tests/ProcessTests.cs:line 45 at System.Diagnostics.Tests.ProcessTests.TestBasePriorityOnUnix() in /home/jfree/dd/corefx/src/System.Diagnostics.Process/tests/ProcessTests.Unix.cs:line 241]]></stack-trace> </failure> </test> ```` " 25863 area-System.IO Investigate improving GetFiles array perf. The APIs that return arrays currently use an enumerable internally. We could potentially write optimized solutions for these that take into account the result will be a flat array (i.e. forgo some of the enumerable overhead). ``` C# namespace System.IO { public static class Directory { public static string[] GetDirectories(string path, string searchPattern, SearchOption searchOption); public static string[] GetFiles(string path, string searchPattern, SearchOption searchOption); public static string[] GetFileSystemEntries(string path, string searchPattern, SearchOption searchOption); } public sealed class DirectoryInfo : FileSystemInfo { public DirectoryInfo[] GetDirectories(string searchPattern, SearchOption searchOption); public FileInfo[] GetFiles(string searchPattern, SearchOption searchOption); public FileSystemInfo[] GetFileSystemInfos(string searchPattern, SearchOption searchOption); } } ``` Mono had some optimizations along these lines. https://github.com/dotnet/designs/pull/24#issuecomment-351102126 25864 area-Infrastructure Fix Alpine CI build last issue By accident, I've put in the stage for executing tests although we cannot do that until we have Alpine queue in Helix working. This change removes that, which should be the last thing preventing the CI from succeeding. 25866 area-System.Diagnostics Fix triple+ quote parsing on Unix 25867 area-System.IO Adding System.IO.Compression.ZipFile to net471 support package cc: @weshaggard @safern @AlexGhiondea These changes will add System.IO.Compression.ZipFile to the support package and will cause a conflict so that the right binding redirect is generated for it. 25868 area-Infrastructure Reenable automatic Alpine leg in CI This change reenables automatic running of Alpine tests on every PR. It also removed two unused variables in the alpine.3.6.groovy file. 25869 area-System.Diagnostics Disable Process BasePriority test on WSL https://github.com/dotnet/corefx/issues/25861 25870 area-System.Security System.Security.Cryptography.Cng netstandard 2.0 version is incorrect see https://github.com/dotnet/corefx/issues/25766 The netstandard 2.0 version is currently 4.3.1.0 but the netcorepp 2.0 version is 4.3.0.0. Given the netstandard2.0 is supported on netcoreapp2.0 the versions need to match. One of two things needs to happen: 1) The NS2.0 ref needs to be frozen to 4.3.0.0 to match what is inbox on netcoreapp2.0 2) We need to ship a newer version of the library that works on netcoreapp2.0 in the nuget package OOB, that has version 4.3.1.0 Given there isn't any new API surface I suggest we go with option (1) in the future if we need to add new API then we can decide to unfreeze it and also update our netcoreapp2.0 implementation to match. cc @bartonjs @ericstj 25873 area-System.IO Add file enumeration extensibility points "We need low-allocating high-performance extensibility points to build solutions for enumerating files. (This is the API review for https://github.com/dotnet/designs/pull/24) ## Rationale and Usage Enumerating files in .NET provides limited configurability. You can specify a simple DOS style pattern and whether or not to look recursively. More complicated filtering requires post filtering all results which can introduce a significant performance drain. Recursive enumeration is also problematic in that there is no way to handle error states such as access issues or cycles created by links. These restrictions have a significant impact on file system intensive applications, a key example being MSBuild. This document proposes a new set of primitive file and directory traversal APIs that are optimized for providing more flexibility while keeping the overhead to a minimum so that enumeration becomes both more powerful as well as more performant. To write a wrapper that gets files with a given set of extensions you would need to write something similar to: ``` C# public static IEnumerable<string> GetFilePathsWithExtensions(string directory, bool recursive, params string[] extensions) { return new DirectoryInfo(directory) .GetFiles(""*"", recursive ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly) .Where(f => extensions.Any(e => f.Name.EndsWith(e, StringComparison.OrdinalIgnoreCase))) .Select(r => r.FullName); } ``` Not complicated to write, but this can do an enormous amount of extra allocations. You have to create full strings and `FileInfo`'s for every single item in the file system. We can cut this down significantly with the extension point: ``` C# public static IEnumerable<string> GetFileFullPathsWithExtension(string directory, bool recursive, params string[] extensions) { return new FileSystemEnumerable<string>( directory, (ref FileSystemEntry entry) => entry.ToFullPath(), new EnumerationOptions() { RecurseSubdirectories = recursive }) { ShouldIncludePredicate = (ref FileSystemEntry entry) => { if (entry.IsDirectory) return false; foreach (string extension in extensions) { if (Path.GetExtension(entry.FileName).EndsWith(extension, StringComparison.OrdinalIgnoreCase)) return true; } return false; } }; } ``` The number of allocation reductions with the above solution is significant. - No `FileInfo` allocations - No fullpath string allocations for paths that don't match - No filename allocations for paths that don't match (as the filename will still be in the native buffer at this point) > Note that while you can write a solution that doesn't allocate a `FileInfo` by using the `string[]` APIs and `GetFullPath()` it would still allocate unneeded strings and introduce costly normalization overhead. ## Proposed API ``` C# namespace System.IO { public static partial class Directory { public static IEnumerable<string> EnumerateDirectories(string path, string searchPattern, EnumerationOptions enumerationOptions); public static IEnumerable<string> EnumerateFiles(string path, string searchPattern, EnumerationOptions enumerationOptions); public static IEnumerable<string> EnumerateFileSystemEntries(string path, string searchPattern, EnumerationOptions enumerationOptions); public static string[] GetDirectories(string path, string searchPattern, EnumerationOptions enumerationOptions); public static string[] GetFiles(string path, string searchPattern, EnumerationOptions enumerationOptions); public static string[] GetFileSystemEntries(string path, string searchPattern, EnumerationOptions enumerationOptions); } public sealed partial class DirectoryInfo { public IEnumerable<DirectoryInfo> EnumerateDirectories(string searchPattern, EnumerationOptions enumerationOptions); public IEnumerable<FileSystemInfo> EnumerateFileSystemInfos(string searchPattern, EnumerationOptions enumerationOptions); public IEnumerable<FileInfo> EnumerateFiles(string searchPattern, EnumerationOptions enumerationOptions); public DirectoryInfo[] GetDirectories(string searchPattern, EnumerationOptions enumerationOptions); public FileInfo[] GetFiles(string searchPattern, EnumerationOptions enumerationOptions); public FileSystemInfo[] GetFileSystemInfos(string searchPattern, EnumerationOptions enumerationOptions); } public enum MatchType { /// <summary> /// Match using '*' and '?' wildcards. /// </summary> Simple, /// <summary> /// Match using DOS style matching semantics. '*', '?', '<', '>', and '""' /// are all considered wildcards. /// </summary> Dos } public enum MatchCasing { /// <summary> /// Match the default casing for the given platform /// </summary> PlatformDefault, /// <summary> /// Match respecting character casing /// </summary> CaseSensitive, /// <summary> /// Match ignoring character casing /// </summary> CaseInsensitive } public class EnumerationOptions { /// <summary> /// Should we recurse into subdirectories while enumerating? /// Default is false. /// </summary> public bool RecurseSubdirectories { get; set; } /// <summary> /// Skip files/directories when access is denied (e.g. AccessDeniedException/SecurityException). /// Default is true. /// </summary> public bool IgnoreInaccessible { get; set; } /// <summary> /// Suggested buffer size, in bytes. Default is 0 (no suggestion). /// </summary> /// <remarks> /// Not all platforms use user allocated buffers, and some require either fixed buffers or a /// buffer that has enough space to return a full result. One scenario where this option is /// useful is with remote share enumeration on Windows. Having a large buffer may result in /// better performance as more results can be batched over the wire (e.g. over a network /// share). A ""large"" buffer, for example, would be 16K. Typical is 4K. /// /// We will not use the suggested buffer size if it has no meaning for the native APIs on the /// current platform or if it would be too small for getting at least a single result. /// </remarks> public int BufferSize { get; set; } /// <summary> /// Skip entries with the given attributes. Default is FileAttributes.Hidden | FileAttributes.System. /// </summary> public FileAttributes AttributesToSkip { get; set; } /// <summary> /// For APIs that allow specifying a match expression this will allow you to specify how /// to interpret the match expression. /// </summary> /// <remarks> /// The default is simple matching where '*' is always 0 or more characters and '?' is a single character. /// </remarks> public MatchType MatchType { get; set; } /// <summary> /// For APIs that allow specifying a match expression this will allow you to specify case matching behavior. /// </summary> /// <remarks> /// Default is to match platform defaults, which are gleaned from the case sensitivity of the temporary folder. /// </remarks> public MatchCasing MatchCasing { get; set; } /// <summary> /// Set to true to return ""."" and "".."" directory entries. Default is false. /// </summary> public bool ReturnSpecialDirectories { get; set; } } } namespace System.IO.Enumeration { public ref struct FileSystemEntry { /// <summary> /// The full path of the directory this entry resides in. /// </summary> public ReadOnlySpan<char> Directory { get; } /// <summary> /// The full path of the root directory used for the enumeration. /// </summary> public ReadOnlySpan<char> RootDirectory { get; } /// <summary> /// The root directory for the enumeration as specified in the constructor. /// </summary> public ReadOnlySpan<char> OriginalRootDirectory { get; } public ReadOnlySpan<char> FileName { get; } public FileAttributes Attributes { get; } public long Length { get; } public DateTimeOffset CreationTimeUtc { get; } public DateTimeOffset LastAccessTimeUtc { get; } public DateTimeOffset LastWriteTimeUtc { get; } public bool IsDirectory { get; } public FileSystemInfo ToFileSystemInfo(); /// <summary> /// Returns the full path for find results, based on the initially provided path. /// </summary> public string ToSpecifiedFullPath(); /// <summary> /// Returns the full path of the find result. /// </summary> public string ToFullPath(); } public abstract class FileSystemEnumerator<TResult> : CriticalFinalizerObject, IEnumerator<TResult> { public FileSystemEnumerator(string directory, EnumerationOptions options = null); /// <summary> /// Return true if the given file system entry should be included in the results. /// </summary> protected virtual bool ShouldIncludeEntry(ref FileSystemEntry entry); /// <summary> /// Return true if the directory entry given should be recursed into. /// </summary> protected virtual bool ShouldRecurseIntoEntry(ref FileSystemEntry entry); /// <summary> /// Generate the result type from the current entry; /// </summary> protected abstract TResult TransformEntry(ref FileSystemEntry entry); /// <summary> /// Called whenever the end of a directory is reached. /// </summary> /// <param name=""directory"">The path of the directory that finished.</param> protected virtual void OnDirectoryFinished(ReadOnlySpan<char> directory); /// <summary> /// Called when a native API returns an error. Return true to continue, or false /// to throw the default exception for the given error. /// </summary> /// <param name=""error"">The native error code.</param> protected virtual bool ContinueOnError(int error); public TResult Current { get; } object IEnumerator.Current { get; } public bool MoveNext(); public void Reset(); public void Dispose(); protected virtual void Dispose(bool disposing); } /// <summary> /// Enumerable that allows utilizing custom filter predicates and tranform delegates. /// </summary> public class FileSystemEnumerable<TResult> : IEnumerable<TResult> { public FileSystemEnumerable(string directory, FindTransform transform, EnumerationOptions options = null) { } public FindPredicate ShouldRecursePredicate { get; set; } public FindPredicate ShouldIncludePredicate { get; set; } public IEnumerator<TResult> GetEnumerator(); IEnumerator GetEnumerator(); /// <summary> /// Delegate for filtering out find results. /// </summary> public delegate bool FindPredicate(ref FileSystemEntry entry); /// <summary> /// Delegate for transforming raw find data into a result. /// </summary> public delegate TResult FindTransform(ref FileSystemEntry entry); } public static class FileSystemName { /// <summary> /// Change unescaped '*' and '?' to '<', '>' and '""' to match Win32 behavior. For compatibility, Windows /// changes some wildcards to provide a closer match to historical DOS 8.3 filename matching. /// </summary> public static string TranslateDosExpression(string expression); /// <summary> /// This matcher uses the Windows wildcards (which includes `*`, `?`, `>`, `<`, and `""`). /// </summary> public static bool MatchesDosExpression(ReadOnlySpan<char> expression, ReadOnlySpan<char> name, bool ignoreCase = true); /// <summary> /// This matcher will only process `*` and `?`. /// </summary> public static bool MatchesSimpleExpression(ReadOnlySpan<char> expression, ReadOnlySpan<char> name, bool ignoreCase = true); } } ``` ## Implementation Notes ### Changes to existing behavior - Match expressions will no longer consider 8.3 filenames - This obscure behavior is costly and gives unexpected results - 8.3 filename generation is not always on, can be disabled - `*.htm` will no longer match `*.html` if 8.3 filenames exist - Option defaults (when calling new APIs) - System & hidden files/directories are skipped by default - Access denied folders are skipped by default (no errors are thrown) - Simple matching is used by default (`*.*` means any file with a period, `foo.*` matches `foo.txt`, not `foo`) ### FileSystemEnumerable - `directory`, and `transform` will throw `ArgumentNullException` if null. - If predicates are not specified, all entries will be accepted ### FileSystemEnumerator - `directory`, and `transform` will throw `ArgumentNullException` if null. - all directory entries will be returned before processing additional directories (e.g. subdirectories) - order of directory entries is not guaranteed - timing of opening subdirectories is not guaranteed ### FileSystemEntry - translation of data that has non-trivial cost will be lazily done (applies specifically to Unix) - properties that require an additional OS call - UTF-8 to UTF-16 conversion - initial property values can potentially be unexpected based on timing of accessing data (i.e. the underlying file could disappear) - property values will **not** change after being accessed - `FileSystemEntry` should **not** be cached - `FileName` will only contain valid data for the duration of filter/transform calls, hence the struct being passed by ref ### Matchers - Matchers will support escaping of supported wildcards and `\` using the `\` character - `\*`, `\\`, `?` (and `\>`, `\<`, `\""` for `MatchesDosExpression`) - Empty `expresion` will match all " 25874 area-System.Xml Remove obsolete attribute from XslTransform Some customers hesitate in using `XslTransform` even when recommended because of the presence of this attribute. Depending on the scenario it could be better to use `XslTransform` instead of `XslCompiledTransform`, however, `XslTransform` was marked as obsolete back in .NET 2.0 which creates the impression that eventually it is going to be pulled out, however this is not really happening. In UWP is even stranger since `XslCompiledTransform` is not available at all and only the *deprecated* one is available. 25875 area-System.IO Add overloads to enumeration APIs that take FindOptions flags This is contingent on https://github.com/dotnet/corefx/issues/25873. If that API proposal is done, we should also expose overloads on the existing APIs that allow you to get at the new options. ## Rationale and Usage Customers have been asking for the ability to tweak enumeration for common scenarios. Our new extensibility proposal (https://github.com/dotnet/corefx/issues/25873) has a new set of `FindOptions` flags that we should support to get: - Recursion - Ability to skip inaccessible files - Ability to specify larger buffers for remote access - No locking optimization for thread-bound enumeration ## Proposed API As proposed in https://github.com/dotnet/corefx/issues/25873, the Flags would be: ``` C# [Flags] public enum FindOptions { None = 0x0, // Enumerate subdirectories Recurse = 0x1, // Skip files/directories when access is denied (e.g. AccessDeniedException/SecurityException) IgnoreInaccessible = 0x2, // Hint to use larger buffers for getting data (notably to help address remote enumeration perf) UseLargeBuffer = 0x4 // Future: Add flags for tracking cycles, etc. } ``` The new API surface area would be: ``` C# public static class Directory { public static IEnumerable<string> EnumerateDirectories(string path, string searchPattern, FindOptions findOptions); public static IEnumerable<string> EnumerateFiles(string path, string searchPattern, FindOptions findOptions); public static IEnumerable<string> EnumerateFileSystemEntries(string path, string searchPattern, FindOptions findOptions); public static string[] GetDirectories(string path, string searchPattern, FindOptions findOptions); public static string[] GetFiles(string path, string searchPattern, FindOptions findOptions); public static string[] GetFileSystemEntries(string path, string searchPattern, FindOptions findOptions); } public sealed class DirectoryInfo : FileSystemInfo { public IEnumerable<DirectoryInfo> EnumerateDirectories(string searchPattern, FindOptions findOptions); public IEnumerable<FileInfo> EnumerateFiles(string searchPattern, FindOptions findOptions); public IEnumerable<FileSystemInfo> EnumerateFileSystemInfos(string searchPattern, FindOptions findOptions); public DirectoryInfo[] GetDirectories(string searchPattern, FindOptions findOptions); public FileInfo[] GetFiles(string searchPattern, FindOptions findOptions); public FileSystemInfo[] GetFileSystemInfos(string searchPattern, FindOptions findOptions); } ``` ## Implementation Notes - Won't check flags to allow light-up scenarios 25876 area-System.IO Platform-dependent FileStream permissions behavior? I might be missing something obvious, but it's strange to me that this throws an IOException on Windows but not on Ubuntu: ``` var willWork = File.Open(myPath, FileMode.Create, FileAccess.ReadWrite, FileShare.Read); var willThrowOnlyOnWin = File.Open(myPath, FileMode.Create, FileAccess.ReadWrite, FileShare.Read); ``` However, this will throw on both: ``` var willWork = File.Open(myPath, FileMode.Create, FileAccess.ReadWrite, **FileShare.None**); var willThrowEverywhere = File.Open(myPath, FileMode.Create, FileAccess.ReadWrite, FileShare.Read); ``` Is this expected? 25877 area-System.IO NamedPipeClient connect throws TimeoutException when appropriate "Fixes #24635 Changing the code to ERROR_SEM_TIMEOUT changes the exception from IOException(""The semaphore timeout period has expired"") to a TimeoutException when the pipe is busy. Another change in behavior: if there was a good cancellationToken (i.e.: CanBeCancelled was true) with a timeout larger than 50ms and the pipe was busy it was failing with the IOException on first try (after waiting 50ms). However it was waiting for the whole user timeout if the token could not be cancelled. This change will make it wait for the full user timeout independently of cancellationToken.CanBeCancelled value." 25878 area-System.Net Test failure: System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test Opened on behalf of @karelz Failed tests: * `GetAsync_SupportedSSLVersion_Succeeds` - 75 failures per run (all executions on Windows/Linux/Mac) * `GetAsync_UnsupportedSSLVersion_Throws` - 22 failures per run (all executions on Linux-only) Affected (4) runs: [20171211.01](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171211.01/workItem/System.Net.Http.Functional.Tests), [20171210.03](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171210.03/workItem/System.Net.Http.Functional.Tests), [20171210.01](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171210.01/workItem/System.Net.Http.Functional.Tests), [20171209.03](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171209.03/workItem/System.Net.Http.Functional.Tests) ### GetAsync_SupportedSSLVersion_Succeeds * [test source code](https://github.com/dotnet/corefx/blob/4bf90198c5e7710ea67b7c1b467e859ec8bb78e5/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.SslProtocols.cs#L133-L161) Windows: ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.WinHttpException : The operation timed out at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() in E:\A\_work\1955\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 464 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test.<GetAsync_SupportedSSLVersion_Succeeds>d__6.MoveNext() in E:\A\_work\1955\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.SslProtocols.cs:line 158 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Threading.Tasks.RendezvousAwaitable`1.GetResult() in E:\A\_work\1955\s\corefx\src\Common\src\System\Threading\Tasks\RendezvousAwaitable.cs:line 62 at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext() in E:\A\_work\1955\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 856 ``` Mac: ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.CurlException : SSL connect error at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() in /Users/buildagent/agent/_work/320/s/corefx/src/System.Net.Http/src/System/Net/Http/HttpClient.cs:line 464 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test.<GetAsync_SupportedSSLVersion_Succeeds>d__6.MoveNext() in /Users/buildagent/agent/_work/320/s/corefx/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.SslProtocols.cs:line 158 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Net.Http.CurlHandler.ThrowIfCURLEError(CURLcode error) in /Users/buildagent/agent/_work/320/s/corefx/src/System.Net.Http/src/System/Net/Http/Unix/CurlHandler.cs:line 663 at System.Net.Http.CurlHandler.MultiAgent.FinishRequest(StrongToWeakReference`1 easyWrapper, CURLcode messageResult) in /Users/buildagent/agent/_work/320/s/corefx/src/System.Net.Http/src/System/Net/Http/Unix/CurlHandler.MultiAgent.cs:line 883 ``` Linux: ``` System.Threading.Tasks.TaskCanceledException : A task was canceled. at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() in /root/corefx-1211504/src/System.Net.Http/src/System/Net/Http/HttpClient.cs:line 464 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test.<GetAsync_SupportedSSLVersion_Succeeds>d__6.MoveNext() in /root/corefx-1211504/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.SslProtocols.cs:line 158 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ``` ### GetAsync_UnsupportedSSLVersion_Throws * [test source code](https://github.com/dotnet/corefx/blob/4bf90198c5e7710ea67b7c1b467e859ec8bb78e5/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.SslProtocols.cs#L169-L194) Linux (only): ``` Assert.Throws() Failure Expected: typeof(System.Net.Http.HttpRequestException) Actual: typeof(System.Threading.Tasks.TaskCanceledException): A task was canceled. at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() in /root/corefx-1210954/src/System.Net.Http/src/System/Net/Http/HttpClient.cs:line 464 --- End of stack trace from previous location where exception was thrown --- ``` 25879 area-System.Net Use generic test handling for remote server failures. cc @karelz @wfurt @davidsh fixes #25878 25880 area-System.Net Test failure: System.Net.Http.Functional.Tests.HttpProtocolTests / GetAsync_ExpectedStatusCodeAndReason_Success ## Type of failures ### The operation has been canceled Failure: [20171208.04](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171208.04/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpProtocolTests~2FGetAsync_ExpectedStatusCodeAndReason_Success(statusLine:%20%5C%22HTTP~2F1.1%20400%20Bad%20Request%5C%22,%20expectedStatusCode:%20400,%20expectedReason:%20%5C%22Bad%20Request%5C%22)) ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.WinHttpException : The operation has been canceled at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() in E:\A\_work\1355\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 464 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpProtocolTests.<>c__DisplayClass1_0.<<GetAsync_ExpectedStatusCodeAndReason_Success>b__0>d.MoveNext() in E:\A\_work\1355\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpProtocolTests.cs:line 47 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.<>c__DisplayClass3_0.<CreateServerAsync>b__0(Task t) in E:\A\_work\1355\s\corefx\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 67 at System.Threading.Tasks.ContinuationTaskFromTask.InnerInvoke() in E:\A\_work\1993\s\src\mscorlib\src\System\Threading\Tasks\TaskContinuation.cs:line 59 at System.Threading.Tasks.Task.<>c.<.cctor>b__278_1(Object obj) in E:\A\_work\1993\s\src\mscorlib\src\System\Threading\Tasks\Task.cs:line 2480 at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) in E:\A\_work\1993\s\src\mscorlib\shared\System\Threading\ExecutionContext.cs:line 151 at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) in E:\A\_work\1993\s\src\mscorlib\src\System\Threading\Tasks\Task.cs:line 2440 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpProtocolTests.<GetAsync_ExpectedStatusCodeAndReason_Success>d__1.MoveNext() in E:\A\_work\1355\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpProtocolTests.cs:line 42 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Threading.Tasks.RendezvousAwaitable`1.GetResult() in E:\A\_work\1355\s\corefx\src\Common\src\System\Threading\Tasks\RendezvousAwaitable.cs:line 62 at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext() in E:\A\_work\1355\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 856 ``` ### The handle is invalid Failure: [20171205.06](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171205.06/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpProtocolTests_Dribble~2FGetAsync_ExpectedStatusCodeAndReason_Success(statusLine:%20%5C%22HTTP~2F1.1%20201%20Created%5C%22,%20expectedStatusCode:%20201,%20expectedReason:%20%5C%22Created%5C%22)) ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.WinHttpException : The handle is invalid at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() in E:\A\_work\2046\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 464 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpProtocolTests.<>c__DisplayClass1_0.<<GetAsync_ExpectedStatusCodeAndReason_Success>b__0>d.MoveNext() in E:\A\_work\2046\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpProtocolTests.cs:line 54 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.<>c__DisplayClass3_0.<CreateServerAsync>b__0(Task t) in E:\A\_work\2046\s\corefx\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 68 at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) in E:\A\_work\1613\s\src\mscorlib\shared\System\Threading\ExecutionContext.cs:line 151 at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) in E:\A\_work\1613\s\src\mscorlib\src\System\Threading\Tasks\Task.cs:line 2440 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpProtocolTests.<GetAsync_ExpectedStatusCodeAndReason_Success>d__1.MoveNext() in E:\A\_work\2046\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpProtocolTests.cs:line 42 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Net.Http.WinHttpException.ThrowExceptionUsingLastError() in E:\A\_work\2046\s\corefx\src\Common\src\System\Net\Http\WinHttpException.cs:line 44 at System.Net.Http.WinHttpHandler.SetRequestHandleRedirectionOptions(SafeWinHttpHandle requestHandle) in E:\A\_work\2046\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 1082 at System.Net.Http.WinHttpHandler.SetRequestHandleOptions(WinHttpRequestState state) in E:\A\_work\2046\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 956 at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext() in E:\A\_work\2046\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 833 ``` ### An existing connection was forcibly closed by the remote host Failure: [20171205.02](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171205.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpProtocolTests_Dribble~2FGetAsync_ExpectedStatusCodeAndReason_Success\(statusLine:%20%5C%22HTTP~2F1.1%20600%20still%20valid%5C%22,%20expectedStatusCode:%20600,%20expectedReason:%20%5C%22sti...) ``` System.IO.IOException : Unable to transfer data on the transport connection: An existing connection was forcibly closed by the remote host. ---- System.Net.Sockets.SocketException : An existing connection was forcibly closed by the remote host at System.Net.Http.Functional.Tests.HttpProtocolTests_Dribble.DribbleStream.<WriteAsync>d__2.MoveNext() in E:\A\_work\436\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpProtocolTests.cs:line 126 --- End of stack trace from previous location where exception was thrown --- at System.IO.StreamWriter.<FlushAsyncInternal>d__70.MoveNext() in E:\A\_work\436\s\corefx\src\System.Runtime.Extensions\src\System\IO\StreamWriter.cs:line 982 --- End of stack trace from previous location where exception was thrown --- at System.IO.StreamWriter.<WriteAsyncInternal>d__55.MoveNext() in E:\A\_work\436\s\corefx\src\System.Runtime.Extensions\src\System\IO\StreamWriter.cs:line 627 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.<ReadWriteAcceptedAsync>d__8.MoveNext() in E:\A\_work\436\s\corefx\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 104 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.<AcceptSocketAsync>d__11.MoveNext() in E:\A\_work\436\s\corefx\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 180 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpProtocolTests.<>c__DisplayClass1_0.<<GetAsync_ExpectedStatusCodeAndReason_Success>b__0>d.MoveNext() in E:\A\_work\436\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpProtocolTests.cs:line 54 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.<>c__DisplayClass3_0.<CreateServerAsync>b__0(Task t) in E:\A\_work\436\s\corefx\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 68 at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) in E:\A\_work\1762\s\src\mscorlib\shared\System\Threading\ExecutionContext.cs:line 151 at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) in E:\A\_work\1762\s\src\mscorlib\src\System\Threading\Tasks\Task.cs:line 2440 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpProtocolTests.<GetAsync_ExpectedStatusCodeAndReason_Success>d__1.MoveNext() in E:\A\_work\436\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpProtocolTests.cs:line 42 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- ``` ## History of failures Day | Build | Queue | FailureMessage -- | -- | -- | -- 10/25 | 20171025.04 | Win7 | The handle is invalid 11/3 | 20171103.07 | Win7 | The handle is invalid 11/3 | 20171103.11 | Win7 | The operation has been canceled 11/4 | 20171104.03 | Win7 | The operation has been canceled 11/6 | 20171106.03 | Win7 | The handle is invalid 11/7 | 20171107.02 | Win8.1 | The operation has been canceled 11/7 | 20171107.02 | Win7 | The handle is invalid 11/7 | 20171107.04 | Win8.1 | The operation has been canceled 11/15 | 20171115.01 | Win7 | An existing connection was forcibly closed by the remote host 11/19 | 20171119.02 | Win8.1 | The operation has been canceled 11/22 | 20171122.02 | Win7 | The handle is invalid 11/24 | 20171124.01 | Win7 | The handle is invalid 11/27 | 20171127.06 | Win7 | The handle is invalid 12/5 | 20171205.02 | Win7 | An existing connection was forcibly closed by the remote host 12/5 | 20171205.05 | Win7 | The handle is invalid 12/5 | 20171205.06 | Win7 | The handle is invalid 12/8 | 20171208.04 | Win8.1 | The operation has been canceled 12/13 | 20171213.01 | Win7 | The handle is invalid - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171213.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpProtocolTests~2FGetAsync_ExpectedStatusCodeAndReason_Success(statusLine:%20%5C%22HTTP~2F1.1%20201%20Created%5C%22,%20expectedStatusCode:%20201,%20expectedReason:%20%5C%22Created%5C%22)) 12/13 | 20171213.06 | Win8.1 | The operation has been canceled - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171213.06/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpProtocolTests~2FGetAsync_ExpectedStatusCodeAndReason_Success\(statusLine:%20%5C%22HTTP~2F1.1%20200%20Sure%20why%20not%3F%5C%22,%20expectedStatusCode:%20200,%20expectedReason:%20%5C%22Sure%20why%20...) 12/13 | 20171213.06 | Win7 | An existing connection was forcibly closed by the remote host - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171213.06/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpProtocolTests_Dribble~2FGetAsync_ExpectedStatusCodeAndReason_Success\(statusLine:%20%5C%22HTTP~2F1.1%20202%20Accepted%5C%22,%20expectedStatusCode:%20202,%20expectedReason:%20%5C%22Accept...) 12/17 | 20171217.02 | Win7 | The operation has been canceled - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171217.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpProtocolTests_Dribble~2FGetAsync_ExpectedStatusCodeAndReason_Success\(statusLine:%20%5C%22HTTP~2F1.1%20600%20still%20valid%5C%22,%20expectedStatusCode:%20600,%20expectedReason:%20%5C%22sti...) 12/29 | 20171229.01 | Win8.1 | The operation has been canceled - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171229.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpProtocolTests~2FGetAsync_ExpectedStatusCodeAndReason_Success(statusLine:%20%5C%22HTTP~2F1.1%20600%20still%20valid%5C%22,%20expectedStatusCode:%20600,%20expectedReason:%20%5C%22still%20valid%5C%22)) 12/31 | 20171231.02 | Win8.1 | The handle is invalid - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171231.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpProtocolTests_Dribble~2FGetAsync_ExpectedStatusCodeAndReason_Success(statusLine:%20%5C%22HTTP~2F1.1%20202%20Accepted%5C%22,%20expectedStatusCode:%20202,%20expectedReason:%20%5C%22Accepted%5C%22)) 1/10 | 20180110.03 | Win7 | The handle is invalid - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180110.03/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpProtocolTests_Dribble~2FGetAsync_ExpectedStatusCodeAndReason_Success(statusLine:%20%5C%22HTTP~2F1.1%20201%20Created%5C%22,%20expectedStatusCode:%20201,%20expectedReason:%20%5C%22Created%5C%22)) 1/11 | 20180111.02 | Win7 | The handle is invalid - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180111.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpProtocolTests_Dribble~2FGetAsync_ExpectedStatusCodeAndReason_Success(statusLine:%20%5C%22HTTP~2F1.1%20500%20Internal%20Server%20Error%5C%22,%20expectedStatusCode:%20500,%20expectedReason:%20%5C%22Inter)) 1/13 | 20180113.03 | Win8.1 | The operation has been canceled - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180113.03/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpProtocolTests~2FGetAsync_ExpectedStatusCodeAndReason_Success(statusLine:%20%5C%22HTTP~2F1.1%20200%20Sure%20why%20not%3F%5C%22,%20expectedStatusCode:%20200,%20expectedReason:%20%5C%22Sure%20why%20not%3F)) 1/15 | 20180115.01 | Win8.1 | The operation has been canceled - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180115.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpProtocolTests~2FGetAsync_ExpectedStatusCodeAndReason_Success(statusLine:%20%5C%22HTTP~2F1.1%20500%20Internal%20Server%20Error%5C%22,%20expectedStatusCode:%20500,%20expectedReason:%20%5C%22Inter)) 1/16 | 20180116.01 | Win7 | The operation has been canceled - only in [catastrophic failure logs](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180116.01/workItem/System.Net.Http.Functional.Tests/wilogs) 1/20 | 20180120.01 | Win7 | An existing connection was forcibly closed by the remote host - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180120.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpProtocolTests_Dribble~2FGetAsync_ExpectedStatusCodeAndReason_Success(statusLine:%20%5C%22HTTP~2F1.1%20500%20Internal%20Server%20Error%5C%22,%20expectedStatusCode:%20500,%20expectedReason:%20%5C%22Inter)) 1/23 | 20180123.01 | Win7 | The handle is invalid - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180123.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpProtocolTests~2FGetAsync_ExpectedStatusCodeAndReason_Success(statusLine:%20%5C%22HTTP~2F1.1%20200%20OK%C2%80%5C%22,%20expectedStatusCode:%20200,%20expectedReason:%20%5C%22OK%3F%5C%22)) 1/23 | 20180123.01 | Win8.1 | The operation has been canceled - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180123.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpProtocolTests~2FGetAsync_ExpectedStatusCodeAndReason_Success(statusLine:%20%5C%22HTTP~2F1.1%20600%20still%20valid%5C%22,%20expectedStatusCode:%20600,%20expectedReason:%20%5C%22still%20valid%5C%22)) 1/23 | 20180123.04 | Win8.1 | The operation has been canceled - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180123.04/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpProtocolTests~2FGetAsync_ExpectedStatusCodeAndReason_Success(statusLine:%20%5C%22HTTP~2F1.1%20200%20Sure%20why%20not%3F%5C%22,%20expectedStatusCode:%20200,%20expectedReason:%20%5C%22Sure%20why%20not%3F)) 1/25 | 20180125.01 | Win7 | An existing connection was forcibly closed by the remote host - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180125.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpProtocolTests_Dribble~2FGetAsync_ExpectedStatusCodeAndReason_Success(statusLine:%20%5C%22HTTP~2F1.1%20201%20Created%5C%22,%20expectedStatusCode:%20201,%20expectedReason:%20%5C%22Created%5C%22)) 2/1 | 20180201.05 | Win7 | The handle is invalid - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180201.05/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpProtocolTests~2FGetAsync_ExpectedStatusCodeAndReason_Success(statusLine:%20%5C%22HTTP~2F1.1%20200%20OK%C2%80%5C%22,%20expectedStatusCode:%20200,%20expectedReason:%20%5C%22OK%3F%5C%22)) 2/1 | 20180201.05 | Win8.1 | The operation has been canceled - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180201.05/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpProtocolTests~2FGetAsync_ExpectedStatusCodeAndReason_Success(statusLine:%20%5C%22HTTP~2F1.1%20200%20O%20K%5C%22,%20expectedStatusCode:%20200,%20expectedReason:%20%5C%22O%20K%5C%22)) 2/6 | 20180206.05 | Win7 | An existing connection was forcibly closed by the remote host - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180206.05/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpProtocolTests_Dribble~2FGetAsync_ExpectedStatusCodeAndReason_Success(statusLine:%20%5C%22HTTP~2F1.1%20201%20Created%5C%22,%20expectedStatusCode:%20201,%20expectedReason:%20%5C%22Created%5C%22)) 2/8 | 20180208.01 | Win7 | 2x The handle is invalid - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180208.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpProtocolTests~2FGetAsync_ExpectedStatusCodeAndReason_Success(statusLine:%20%5C%22HTTP~2F1.1%20200%20O%20K%5C%22,%20expectedStatusCode:%20200,%20expectedReason:%20%5C%22O%20K%5C%22)) and [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180208.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpProtocolTests~2FGetAsync_ExpectedStatusCodeAndReason_Success(statusLine:%20%5C%22HTTP~2F1.1%20600%20still%20valid%5C%22,%20expectedStatusCode:%20600,%20expectedReason:%20%5C%22still%20valid%5C%22)) 2/10 | 20180210.01 | Win7 | An existing connection was forcibly closed by the remote host - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180210.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpProtocolTests_Dribble~2FGetAsync_ExpectedStatusCodeAndReason_Success(statusLine:%20%5C%22HTTP~2F1.1%20200%20O%20K%5C%22,%20expectedStatusCode:%20200,%20expectedReason:%20%5C%22O%20K%5C%22)) 2/10 | 20180210.01 | Win7 | The handle is invalid - only in [catastrophic failure logs](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180210.01/workItem/System.Net.Http.Functional.Tests/wilogs) 2/20 | 20180220.08 | Win7 | The handle is invalid 2/21 | 20180221.01 | Win7 | The handle is invalid 2/25 | 20180225.01 | Win7 | The handle is invalid - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180225.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpProtocolTests_Dribble~2FGetAsync_ExpectedStatusCodeAndReason_Success(statusLine:%20%5C%22HTTP~2F1.1%20200%20O%20K%5C%22,%20expectedStatusCode:%20200,%20expectedReason:%20%5C%22O%20K%5C%22)) 2/28 | 20180228.03 | Win10 | The operation has been canceled 3/1 | 20180301.01 | Win7 | The handle is invalid 3/3 | 20180303.01 | Win10 | 2x The operation has been canceled 3/4 | 20180304.03 | Win10 | The operation has been canceled 3/6 | 20180306.02 | Win10 | The operation has been canceled 3/7 | 20180307.03 | Win7 | The handle is invalid 3/8 | 20180308.01 | Win7 | The handle is invalid 3/10 | 20180310.01 | Win10 | The operation has been canceled 3/10 | 20180310.02 | Win7 | The handle is invalid 3/14 | 20180314.01 | Win7 | The handle is invalid Similar exceptions / errors as in #25896 and #25902 and #25912 25882 area-Infrastructure Make init-tools.sh work against a Windows drive mounted on Linux So far the only issue I've hit is that the 3 files we read in for literal values will end in \r\n, causing the environment variables to end with \r. This fixes that. 25883 area-System.Net Match connect timeout values between curlhandler and winhttphandler. refer discussion https://github.com/dotnet/corefx/pull/25879#discussion_r156539561 25884 area-System.IO .NET does not have async file enumerators This presents a problem when enumerating slow/remote or offline/asleep volumes. Things to consider: - Work being done around extensibility https://github.com/dotnet/designs/blob/master/accepted/file-enumeration.md - Potential `IAsyncEnumerable<T>` https://github.com/dotnet/csharplang/blob/master/proposals/async-streams.md - Lack of low-level OS support (at least on Windows, not sure about Unix) Related issue: #25863 @danmosemsft, @pjanotti 25885 area-System.Runtime Nullable TryParse Please add `TryParse` API that return nullable value for each static `TryParse` function ```C# public struct Int32 { // original public static bool TryParse(string s, out Int32 result); // proposed public static Int32? TryParse(string value) => TryParse(value,out var result) ? result : (decimal?)null; } ``` This should be added to all number struct at least 25887 area-System.Threading Multiple thread pools per appdomain and correspond ThreadpoolTaskScheduler Current thread pool implementation is based on old windows thread pool api(https://msdn.microsoft.com/en-us/library/windows/desktop/ms686766(v=vs.85).aspx). Windows support multiple thread pools per process since Vista. Multiple thread pools per appdomain is useful for advanced scenarios, especially in the TPL scenario. For example, some tasks may take more priority than others. These tasks should be executed as soon as they are queued. Complicated customized TaskScheduler could achieve this goal. But multiple thread pools per appdomain and correspond ThreadpoolTaskScheduler may achieve this goal by few lines, with elegant and robust code. 25888 area-System.Net Linux: Fix NetworkAddressChange NullReferenceException on AddressChange when no Availability subscribers Fixes https://github.com/dotnet/corefx/issues/25081 This also fixes race conditions between availability subscriptions and timer events. CC @stephentoub @davidsh @Const-me 25889 area-Infrastructure Enable autoupdate of dotnet host package version Closes #25839 25890 area-System.Xml When .NET Standard is updated remove pragmas around XslTransform This is related to #25874. For the pragmas around `XslTransform` to be removed we need to update the .NET Standard in CoreFX, to one in which the obsolete attribute was removed. This is issue is to track that when the standard is updated the pragmas get removed. Alternatively we could change xml tests to target netcoreapp instead but in general I prefer to keep the tests with the more general target. 25891 area-System.Data String-based way to specify datatypes on ADO.NET parameters "The ADO.NET API includes two enums which specify database types: DbType for standard types and the provider-specific *DbType (SqlDbType, NpgsqlDbType, and so on). DbType allows for database-independent programming, providing a close list of ""universal"" data types that are expected to be supported in all databases (although some DbType values are clearly SqlServer-specific or at least inspired). On the other hand, using an enum to specify a provider-specific data type seems like a poor API choice, and is not a good fit for databases with open type systems such as PostgreSQL. Here are some issues: * PostgreSQL allows new data types to be defined by extensions, and Npgsql 3.3 will allow external plugins to support those types. However, being an enum, NpgsqlDbType is totally un-extensible - it's a closed list that exists within Npgsql. A string name would allow users to specify PostgreSQL types that are totally unknown to Npgsql, but are supported by plugins. * PostgreSQL supports enum and composite types, where the user can define arbitrary data types. `NpgsqlDbType.Enum` and `NpgsqlDbType.Composite` are not sufficient, and must be combined with another value which specifies *which* enum or composite is meant. A simple way to fix the above is to add a string property to DbParameter, called `DataType` or `ColumnType`. This would allow the user to directly specify the name of the database type needed, without passing through an enum, similar to [how EF Core allows data types to be configured via an attribute or the fluent API](https://docs.microsoft.com/en-us/ef/core/modeling/relational/data-types). It seems to make sense to add this property to DbParameter, without causing any issues to providers which don't support it. First, it makes sense for this to be on DbParameter rather than on individual providers' parameter classes - it would allow cross-database code to set the type name (even if the type names themselves are provider-specific). Providers which don't (yet) support this property would simply ignore it with no negative consequences, while providers that do can use it." 25892 area-System.Net Use consistent test reporting api to record remote server failure in networking tests. One such method was proposed in this PR: #25879 Several opinions on the thread was voiced: 1. What's the motivation of doing this, does this add value or only adds more clutter - @davidsh @wfurt 2. Use xunit apis for the same - proposed by @wfurt 25893 area-System.Memory Investigate optimizations for vectorized Span<byte> {Last}IndexOf{Any} APIs From https://github.com/dotnet/corefx/pull/25848#discussion_r156750679 Consider avoiding the memory alignment checks and only loop byte at a time until we get Vector.Count aligned. The APIs to consider optimizing (for typeof(T) == byte): ```C# public static int IndexOf<T>(this Span<T> span, T value) where T : IEquatable<T> { throw null; } public static int IndexOf<T>(this Span<T> span, ReadOnlySpan<T> value) where T : IEquatable<T> { throw null; } public static int IndexOfAny(this Span<byte> span, byte value0, byte value1) { throw null; } public static int IndexOfAny(this Span<byte> span, byte value0, byte value1, byte value2) { throw null; } public static int IndexOfAny(this Span<byte> span, ReadOnlySpan<byte> values) { throw null; } public static int LastIndexOf<T>(this Span<T> span, T value) where T : IEquatable<T> { throw null; } public static int LastIndexOf<T>(this Span<T> span, ReadOnlySpan<T> value) where T : IEquatable<T> { throw null; } public static int LastIndexOfAny<T>(this Span<T> span, T value0, T value1) where T : IEquatable<T> { throw null; } public static int LastIndexOfAny<T>(this Span<T> span, T value0, T value1, T value2) where T : IEquatable<T> { throw null; } public static int LastIndexOfAny<T>(this Span<T> span, ReadOnlySpan<T> values) where T : IEquatable<T> { throw null; } ``` + the equivalent ReadOnlySpan extension methods See current implementation here: https://github.com/dotnet/corefx/blob/c20881a8ea94a40e1f1f98f79ffdef9f6fc87c44/src/System.Memory/src/System/SpanHelpers.byte.cs#L91 cc @KrzysztofCwalina, @GrabYourPitchforks, @benaadams 25894 area-System.Net Test failure: System.Net.Sockets.Tests.SendReceiveMemoryNativeTask / SendRecvPollSync_TcpListener_Socket ## Type of failures ### Timeout 30000 Failure [20171211.01](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171211.01/workItem/System.Net.Sockets.Tests/analysis/xunit/System.Net.Sockets.Tests.SendReceiveMemoryNativeTask~2FSendRecvPollSync_TcpListener_Socket(listenAt:%20::1,%20pollBeforeOperation:%20False)): ``` System.TimeoutException : WhenAllOrAnyFailed timed out after 30000 at System.Threading.Tasks.TaskTimeoutExtensions.<WhenAllOrAnyFailed>d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Net.Sockets.Tests.SendReceive`1.<SendRecvPollSync_TcpListener_Socket>d__7.MoveNext() in E:\A\_work\1973\s\corefx\src\System.Net.Sockets\tests\FunctionalTests\SendReceive.cs:line 629 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ``` ### Read poll after completion should have succeeded Failure [20171202.01](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171202.01/workItem/System.Net.Sockets.Tests/analysis/xunit/System.Net.Sockets.Tests.SendReceiveMemoryNativeTask~2FSendRecvPollSync_TcpListener_Socket(listenAt:%20127.0.0.1,%20pollBeforeOperation:%20False)): ``` Read poll after completion should have succeeded Expected: True Actual: False at System.Net.Sockets.Tests.SendReceive`1.<>c__DisplayClass7_1.<<SendRecvPollSync_TcpListener_Socket>b__0>d.MoveNext() in E:\A\_work\704\s\corefx\src\System.Net.Sockets\tests\FunctionalTests\SendReceive.cs:line 582 --- End of stack trace from previous location where exception was thrown --- at System.Threading.Tasks.TaskTimeoutExtensions.<WhenAllOrAnyFailed>d__2.MoveNext() in E:\A\_work\704\s\corefx\src\Common\tests\System\Threading\Tasks\TaskTimeoutExtensions.cs:line 49 --- End of stack trace from previous location where exception was thrown --- at System.Net.Sockets.Tests.SendReceive`1.<SendRecvPollSync_TcpListener_Socket>d__7.MoveNext() in E:\A\_work\704\s\corefx\src\System.Net.Sockets\tests\FunctionalTests\SendReceive.cs:line 627 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ``` With earlier variant wrapped in `AggregateException` in failure [20171113.03](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171113.03/workItem/System.Net.Sockets.Tests/analysis/xunit/System.Net.Sockets.Tests.SendReceiveSync~2FSendRecvPollSync_TcpListener_Socket(listenAt:%20127.0.0.1,%20pollBeforeOperation:%20False)): ``` System.AggregateException : One or more errors occurred. (Read poll after completion should have succeeded Expected: True Actual: False) ---- Read poll after completion should have succeeded Expected: True Actual: False at System.Threading.Tasks.Task.WaitAllCore(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken) in E:\A\_work\1531\s\src\mscorlib\src\System\Threading\Tasks\Task.cs:line 4651 at System.Net.Sockets.Tests.SendReceive`1.SendRecvPollSync_TcpListener_Socket(IPAddress listenAt, Boolean pollBeforeOperation) in E:\A\_work\1163\s\corefx\src\System.Net.Sockets\tests\FunctionalTests\SendReceive.cs:line 625 ----- Inner Stack Trace ----- at System.Net.Sockets.Tests.SendReceive`1.<>c__DisplayClass7_1.<<SendRecvPollSync_TcpListener_Socket>b__0>d.MoveNext() in E:\A\_work\1163\s\corefx\src\System.Net.Sockets\tests\FunctionalTests\SendReceive.cs:line 582 ``` ### SocketException: An existing connection was forcibly closed by the remote host Older variant of the test failure in May-July (potentially different bug). Failure [20170706.02](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20170706.02/workItem/System.Net.Sockets.Tests/analysis/xunit/System.Net.Sockets.Tests.SendReceiveSync~2FSendRecvPollSync_TcpListener_Socket(listenAt:%20::1,%20pollBeforeOperation:%20True)): ``` System.AggregateException : One or more errors occurred. (An existing connection was forcibly closed by the remote host) ---- System.Net.Sockets.SocketException : An existing connection was forcibly closed by the remote host at System.ThrowHelper.ThrowAggregateException(List`1 exceptions) at System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken) at System.Net.Sockets.Tests.SendReceive.SendRecvPollSync_TcpListener_Socket(IPAddress listenAt, Boolean pollBeforeOperation) ----- Inner Stack Trace ----- at System.Net.Sockets.Tests.SendReceive.<>c__DisplayClass25_1.<<SendRecvPollSync_TcpListener_Socket>b__0>d.MoveNext() ``` ## History of failures Day | Build | OS | Error message -- | -- | -- | -- 5/1 | 20170501.01 | Win7 | SocketException: An existing connection was forcibly closed by the remote host 5/2 | 20170502.02 | Win7 | Aggregate: Read poll after completion should have succeeded 5/13 | 20170513.01 | Win8.1 | SocketException: An existing connection was forcibly closed by the remote host 5/30 | 20170530.06 | Win7 | SocketException: An existing connection was forcibly closed by the remote host 6/13 | 20170613.02 | Mac | Wait timed out - changed to TimeoutException in https://github.com/dotnet/corefx/commit/779171fea3d9f0b25d4058e281ca05b2b6eec323#diff-5d77ee23eb2ea596e218f9c1ef09d793 on 7/21 6/21 | 20170621.02 | Win8.1 | SocketException: An existing connection was forcibly closed by the remote host 7/6 | 20170706.02 | Win10 | SocketException: An existing connection was forcibly closed by the remote host 7/14 | 20170714.01 | Win7 | Aggregate: Read poll after completion should have succeeded 8/1 | 20170801.03 | Win10 | Aggregate: Read poll after completion should have succeeded 8/6 | 20170806.01 | Win10 | Aggregate: Read poll after completion should have succeeded 8/10 | 20170810.02 | Win10 | Aggregate: Read poll after completion should have succeeded 9/14 | 20170914.01 | Win7 | Aggregate: Read poll after completion should have succeeded 9/26 | 20170926.05 | Win8.1 | Aggregate: Read poll after completion should have succeeded 11/7 | 20171107.01 | Win8.1 | Aggregate: Read poll after completion should have succeeded 11/10 | 20171110.05 | Win7 | Aggregate: Read poll after completion should have succeeded 11/13 | 20171113.03 | Win10 | Aggregate: Read poll after completion should have succeeded 11/25 | 20171125.02 | Win7 | Timeout 30000 11/30 | 20171130.02 | Win10 | Timeout 30000 12/1 | 20171201.03 | Win7 | Timeout 30000 12/1 | 20171201.03 | Win7 | Timeout 30000 12/1 | 20171201.03 | Win7 | Timeout 30000 12/2 | 20171202.01 | Win8.1 | Read poll after completion should have succeeded 12/9 | 20171209.03 | Win10 | Timeout 30000 12/11 | 20171211.01 | Win7 | Timeout 30000 12/13 | 20171213.05 | Win7 | Timeout 30000 - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171213.05/workItem/System.Net.Sockets.Tests/analysis/xunit/System.Net.Sockets.Tests.SendReceiveMemoryArrayTask~2FSendRecvPollSync_TcpListener_Socket(listenAt:%20::1,%20pollBeforeOperation:%20True)) 12/28 | 20171228.01 | Win8.1 | Timeout 30000 - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171228.01/workItem/System.Net.Sockets.Tests/analysis/xunit/System.Net.Sockets.Tests.SendReceiveMemoryArrayTask~2FSendRecvPollSync_TcpListener_Socket(listenAt:%20127.0.0.1,%20pollBeforeOperation:%20True)) 1/4 | 20180104.02 | Win10 | Timeout 30000 - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180104.02/workItem/System.Net.Sockets.Tests/analysis/xunit/System.Net.Sockets.Tests.SendReceiveTask~2FSendRecvPollSync_TcpListener_Socket(listenAt:%20::1,%20pollBeforeOperation:%20False)) 1/13 | 20180113.01 | Win7 | Timeout 30000 - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180113.01/workItem/System.Net.Sockets.Tests/analysis/xunit/System.Net.Sockets.Tests.SendReceiveMemoryArrayTask~2FSendRecvPollSync_TcpListener_Socket(listenAt:%20::1,%20pollBeforeOperation:%20False)) 3/13 | 20180313.03 | Win8.1 | Timeout 30000 3/14 | 20180314.02 | Win7 | Timeout 30000 3/15 | 20180315.01 | Win7 | Timeout 30000 3/17 | 20180317.01 | Win10 | Read poll after completion should have succeeded 3/22 | 20180322.01 | Win8.1 | 3x Timeout 30000 3/22 | 20180322.06 | Win7 | Timeout 30000 3/29 | 20180329.01 | Win10 | 2x Timeout 30000 3/31 | 20180331.03 | Win7 | 2x Timeout 30000 Timeout similar to #25979. Sometimes correlated failures (12/28, 12/13, 1/4). 25895 area-System.Memory Make Span IndexOfAny a generic method with special case for byte Similar to LastIndexOfAny (added here - https://github.com/dotnet/corefx/pull/25848), change the IndexOfAny APIs to be generic. The premise is that there should be little performance degradation for the byte case when we make this change. This needs to be confirmed by comparing performance results before/after. **Change:** ```C# public static int IndexOfAny(this Span<byte> span, byte value0, byte value1) { throw null; } public static int IndexOfAny(this Span<byte> span, byte value0, byte value1, byte value2) { throw null; } public static int IndexOfAny(this Span<byte> span, ReadOnlySpan<byte> values) { throw null; } public static int IndexOfAny(this ReadOnlySpan<byte> span, byte value0, byte value1) { throw null; } public static int IndexOfAny(this ReadOnlySpan<byte> span, byte value0, byte value1, byte value2) { throw null; } public static int IndexOfAny(this ReadOnlySpan<byte> span, ReadOnlySpan<byte> values) { throw null; } ``` To: ```C# public static int IndexOfAny<T>(this Span<T> span, T value0, T value1) where T : IEquatable<T> { throw null; } public static int IndexOfAny<T>(this Span<T> span, T value0, T value1, T value2) where T : IEquatable<T> { throw null; } public static int IndexOfAny<T>(this Span<T> span, ReadOnlySpan<T> values) where T : IEquatable<T> { throw null; } public static int IndexOfAny<T>(this ReadOnlySpan<T> span, T value0, T value1) where T : IEquatable<T> { throw null; } public static int IndexOfAny<T>(this ReadOnlySpan<T> span, T value0, T value1, T value2) where T : IEquatable<T> { throw null; } public static int IndexOfAny<T>(this ReadOnlySpan<T> span, ReadOnlySpan<T> values) where T : IEquatable<T> { throw null; } ``` Example implementation change: ```C# public static int IndexOfAny<T>(this Span<T> span, T value0, T value1) where T : IEquatable<T> { if (typeof(T) == typeof(byte)) return SpanHelpers.IndexOfAny( ref Unsafe.As<T, byte>(ref span.DangerousGetPinnableReference()), Unsafe.As<T, byte>(ref value0), Unsafe.As<T, byte>(ref value1), span.Length); return SpanHelpers.IndexOfAny(ref span.DangerousGetPinnableReference(), value0, value1, span.Length); } ``` Then implement the following to SpanHelpers.T.cs ```C# public static unsafe int IndexOfAny<T>(ref T searchSpace, T value0, T value1, int length) where T : IEquatable<T> ``` Should be relatively easy. cc @karelz cc @KrzysztofCwalina, @GrabYourPitchforks 25896 area-System.Net Test failure: System.Net.Http.Functional.Tests.HttpClientHandler_MaxConnectionsPerServer_Test / GetAsync_MaxLimited_ConcurrentCallsStillSucceed ## Type of failures ### The operation has been canceled Failure [20171208.01](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171208.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_MaxConnectionsPerServer_Test~2FGetAsync_MaxLimited_ConcurrentCallsStillSucceed(maxConnections:%203,%20numRequests:%202,%20secure:%20True)): ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.WinHttpException : The operation has been canceled at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() in E:\A\_work\625\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 464 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpClientHandler_MaxConnectionsPerServer_Test.<GetAsync_MaxLimited_ConcurrentCallsStillSucceed>d__3.MoveNext() in E:\A\_work\625\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.MaxConnectionsPerServer.cs:line 74 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Threading.Tasks.RendezvousAwaitable`1.GetResult() in E:\A\_work\625\s\corefx\src\Common\src\System\Threading\Tasks\RendezvousAwaitable.cs:line 62 at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext() in E:\A\_work\625\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 856 ``` Variant from Linux - failure [20171003.01](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171003.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.ManagedHandler_HttpClientHandler_MaxConnectionsPerServer_Test~2FGetAsync_MaxLimited_ConcurrentCallsStillSucceed(maxConnections:%201,%20numRequests:%205,%20secure:%20False)): ``` System.OperationCanceledException : The operation was canceled. at System.Net.Http.HttpClient.HandleFinishSendAsyncError(Exception e, CancellationTokenSource cts) in /root/corefx-1032002/src/System.Net.Http/src/System/Net/Http/HttpClient.cs:line 506 at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() in /root/corefx-1032002/src/System.Net.Http/src/System/Net/Http/HttpClient.cs:line 464 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.Http.Functional.Tests.HttpClientHandler_MaxConnectionsPerServer_Test.<GetAsync_MaxLimited_ConcurrentCallsStillSucceed>d__3.MoveNext() in /root/corefx-1032002/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.MaxConnectionsPerServer.cs:line 74 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) ``` ### The handle is in the wrong state for the requested operation Failure [20171128.05](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171128.05/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_MaxConnectionsPerServer_Test~2FGetAsync_MaxLimited_ConcurrentCallsStillSucceed(maxConnections:%203,%20numRequests:%202,%20secure:%20False)): ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.WinHttpException : The handle is in the wrong state for the requested operation at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() in E:\A\_work\1790\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 464 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpClientHandler_MaxConnectionsPerServer_Test.<GetAsync_MaxLimited_ConcurrentCallsStillSucceed>d__3.MoveNext() in E:\A\_work\1790\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.MaxConnectionsPerServer.cs:line 74 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Threading.Tasks.RendezvousAwaitable`1.GetResult() in E:\A\_work\1790\s\corefx\src\Common\src\System\Threading\Tasks\RendezvousAwaitable.cs:line 62 at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext() in E:\A\_work\1790\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 856 ``` ### CurlException : SSL connect error Failure [20171022.02](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171022.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_MaxConnectionsPerServer_Test~2FGetAsync_MaxLimited_ConcurrentCallsStillSucceed(maxConnections:%201,%20numRequests:%205,%20secure:%20False)): ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.CurlException : SSL connect error at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in /root/coreclr/src/mscorlib/src/System/Runtime/ExceptionServices/ExceptionServicesCommon.cs:line 130 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in /root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/TaskAwaiter.cs:line 152 at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() in /root/corefx-1079211/src/System.Net.Http/src/System/Net/Http/HttpClient.cs:line 464 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in /root/coreclr/src/mscorlib/src/System/Runtime/ExceptionServices/ExceptionServicesCommon.cs:line 130 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in /root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/TaskAwaiter.cs:line 152 at System.Net.Http.Functional.Tests.HttpClientHandler_MaxConnectionsPerServer_Test.<GetAsync_MaxLimited_ConcurrentCallsStillSucceed>d__3.MoveNext() in /root/corefx-1079211/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.MaxConnectionsPerServer.cs:line 74 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in /root/coreclr/src/mscorlib/src/System/Runtime/ExceptionServices/ExceptionServicesCommon.cs:line 130 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in /root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/TaskAwaiter.cs:line 152 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in /root/coreclr/src/mscorlib/src/System/Runtime/ExceptionServices/ExceptionServicesCommon.cs:line 130 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in /root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/TaskAwaiter.cs:line 152 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in /root/coreclr/src/mscorlib/src/System/Runtime/ExceptionServices/ExceptionServicesCommon.cs:line 130 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) in /root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/TaskAwaiter.cs:line 152 ----- Inner Stack Trace ----- at System.Net.Http.CurlHandler.ThrowIfCURLEError(CURLcode error) in /root/corefx-1079211/src/System.Net.Http/src/System/Net/Http/Unix/CurlHandler.cs:line 652 at System.Net.Http.CurlHandler.MultiAgent.FinishRequest(StrongToWeakReference`1 easyWrapper, CURLcode messageResult) in /root/corefx-1079211/src/System.Net.Http/src/System/Net/Http/Unix/CurlHandler.MultiAgent.cs:line 883 ``` ### A security error occurred Failure [20171213.09](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171213.09/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_MaxConnectionsPerServer_Test~2FGetAsync_MaxLimited_ConcurrentCallsStillSucceed(maxConnections:%203,%20numRequests:%202,%20secure:%20False)): ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.WinHttpException : A security error occurred at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() in E:\A\_work\1973\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 464 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpClientHandler_MaxConnectionsPerServer_Test.<GetAsync_MaxLimited_ConcurrentCallsStillSucceed>d__3.MoveNext() in E:\A\_work\1973\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.MaxConnectionsPerServer.cs:line 74 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Threading.Tasks.RendezvousAwaitable`1.GetResult() in E:\A\_work\1973\s\corefx\src\Common\src\System\Threading\Tasks\RendezvousAwaitable.cs:line 62 at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext() in E:\A\_work\1973\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 856 ``` ### The handle is invalid Failure [20171218.02](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171218.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_MaxConnectionsPerServer_Test~2FGetAsync_MaxLimited_ConcurrentCallsStillSucceed(maxConnections:%203,%20numRequests:%202,%20secure:%20True)): ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.WinHttpException : The handle is invalid at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() in E:\A\_work\798\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 464 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpClientHandler_MaxConnectionsPerServer_Test.<GetAsync_MaxLimited_ConcurrentCallsStillSucceed>d__3.MoveNext() in E:\A\_work\798\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.MaxConnectionsPerServer.cs:line 74 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Net.Http.WinHttpException.ThrowExceptionUsingLastError() in E:\A\_work\798\s\corefx\src\Common\src\System\Net\Http\WinHttpException.cs:line 44 at System.Net.Http.WinHttpHandler.SetRequestHandleRedirectionOptions(SafeWinHttpHandle requestHandle) in E:\A\_work\798\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 1073 at System.Net.Http.WinHttpHandler.SetRequestHandleOptions(WinHttpRequestState state) in E:\A\_work\798\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 956 at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext() in E:\A\_work\798\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 831 ``` ## History of failures Day | Build | OS | Error message -- | -- | -- | -- 9/3 | 20170903.01 | RedHat | The operation has been canceled 9/25 | 20170925.03 | Win7 | The handle is in the wrong state for the requested operation 10/3 | 20171003.01 | Ubuntu | The operation has been canceled 10/5 | 20171005.01 | Win7 | The operation has been canceled 10/9 | 20171009.01 | Win7 | The operation has been canceled 10/11 | 20171011.02 | Win7 | The operation has been canceled 10/16 | 20171016.02 | Win7 | The operation has been canceled 10/18 | 20171018.01 | Fedora | CurlException : SSL connect error 10/18 | 20171018.01 | Win7 | The handle is in the wrong state for the requested operation 10/19 | 20171019.02 | Win7 | The operation has been canceled 10/22 | 20171022.02 | RedHat | CurlException : SSL connect error 11/3 | 20171103.07 | Win7 | The handle is in the wrong state for the requested operation 11/6 | 20171106.02 | Win8.1 | The operation has been canceled 11/7 | 20171107.02 | Win7 | The handle is in the wrong state for the requested operation 11/7 | 20171107.04 | Win8.1 | The operation has been canceled 11/11 | 20171111.01 | Win8.1 | The operation has been canceled 11/28 | 20171128.05 | Win7 | The handle is in the wrong state for the requested operation 11/28 | 20171128.02 | Win7 | The operation has been canceled 12/8 | 20171208.01 | Win7 | The operation has been canceled 12/13 | 20171213.06 | Win8.1 | The operation has been canceled 12/13 | 20171213.09 | Win7 | A security error occurred 12/18 | 20171218.02 | Win7 | The handle is invalid - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171218.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_MaxConnectionsPerServer_Test~2FGetAsync_MaxLimited_ConcurrentCallsStillSucceed(maxConnections:%203,%20numRequests:%202,%20secure:%20True)) 12/19 | 20171219.01 | Win7 | The operation has been canceled - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171219.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_MaxConnectionsPerServer_Test~2FGetAsync_MaxLimited_ConcurrentCallsStillSucceed(maxConnections:%203,%20numRequests:%205,%20secure:%20False)) 12/23 | 20171223.01 | Win8.1 | The operation has been canceled - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171223.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_MaxConnectionsPerServer_Test~2FGetAsync_MaxLimited_ConcurrentCallsStillSucceed(maxConnections:%203,%20numRequests:%205,%20secure:%20False)) 12/23 | 20171223.01 | Win7 | The handle is invalid - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171223.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_MaxConnectionsPerServer_Test~2FGetAsync_MaxLimited_ConcurrentCallsStillSucceed(maxConnections:%203,%20numRequests:%202,%20secure:%20True)) 12/24 | 20171224.02 | Win7 | The handle is invalid - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171224.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_MaxConnectionsPerServer_Test~2FGetAsync_MaxLimited_ConcurrentCallsStillSucceed(maxConnections:%203,%20numRequests:%202,%20secure:%20True)) 12/25 | 20171225.01 | Win8.1 | The operation has been canceled - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171225.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_MaxConnectionsPerServer_Test~2FGetAsync_MaxLimited_ConcurrentCallsStillSucceed(maxConnections:%203,%20numRequests:%205,%20secure:%20False)) 12/29 | 20171229.02 | RedHat73 | CurlException : SSL connect error - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171229.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_MaxConnectionsPerServer_Test~2FGetAsync_MaxLimited_ConcurrentCallsStillSucceed(maxConnections:%201,%20numRequests:%205,%20secure:%20False)) 1/6 | 20180106.01 | Win7 | The handle is in the wrong state for the requested operation - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180106.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_MaxConnectionsPerServer_Test~2FGetAsync_MaxLimited_ConcurrentCallsStillSucceed(maxConnections:%203,%20numRequests:%205,%20secure:%20False)) 1/11 | 20180111.02 | Win7 | The handle is in the wrong state for the requested operation - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180111.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_MaxConnectionsPerServer_Test~2FGetAsync_MaxLimited_ConcurrentCallsStillSucceed(maxConnections:%203,%20numRequests:%205,%20secure:%20False)) 1/11 | 20180111.03 | Win8.1 | The operation has been canceled - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180111.03/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_MaxConnectionsPerServer_Test~2FGetAsync_MaxLimited_ConcurrentCallsStillSucceed(maxConnections:%203,%20numRequests:%202,%20secure:%20True)) 1/23 | 20180123.01 | Win7 | The handle is invalid - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180123.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_MaxConnectionsPerServer_Test~2FGetAsync_MaxLimited_ConcurrentCallsStillSucceed(maxConnections:%203,%20numRequests:%205,%20secure:%20False)) 1/23 | 20180123.04 | Win7 | The handle is in the wrong state for the requested operation - only in [catastrophic failure logs](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180123.04/workItem/System.Net.Http.Functional.Tests/wilogs) 1/29 | 20180129.05 | Win7 | The handle is invalid - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180129.05/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_MaxConnectionsPerServer_Test~2FGetAsync_MaxLimited_ConcurrentCallsStillSucceed(maxConnections:%203,%20numRequests:%202,%20secure:%20True)) 1/31 | 20180131.05 | Win7 | The handle is in the wrong state for the requested operation - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180131.05/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_MaxConnectionsPerServer_Test~2FGetAsync_MaxLimited_ConcurrentCallsStillSucceed(maxConnections:%203,%20numRequests:%202,%20secure:%20False)) 2/1 | 20180201.01 | Win7 | The handle is invalid - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180201.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_MaxConnectionsPerServer_Test~2FGetAsync_MaxLimited_ConcurrentCallsStillSucceed(maxConnections:%203,%20numRequests:%205,%20secure:%20False)) 2/1 | 20180201.05 | Win7 | The operation has been canceled - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180201.05/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_MaxConnectionsPerServer_Test~2FGetAsync_MaxLimited_ConcurrentCallsStillSucceed(maxConnections:%203,%20numRequests:%202,%20secure:%20False)) 2/6 | 20180206.05 | Win7 | The operation has been canceled - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180206.05/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_MaxConnectionsPerServer_Test~2FGetAsync_MaxLimited_ConcurrentCallsStillSucceed(maxConnections:%203,%20numRequests:%202,%20secure:%20False)) 2/10 | 20180210.01 | Win7 | The handle is invalid - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180210.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_MaxConnectionsPerServer_Test~2FGetAsync_MaxLimited_ConcurrentCallsStillSucceed(maxConnections:%203,%20numRequests:%205,%20secure:%20False)) 2/26 | 20180226.02 | Win8.1 | The operation has been canceled - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180226.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_MaxConnectionsPerServer_Test~2FGetAsync_MaxLimited_ConcurrentCallsStillSucceed(maxConnections:%203,%20numRequests:%202,%20secure:%20True)) 3/5 | 20180305.05 | Win7 | The operation has been canceled 3/7 | 20180307.03 | Win7 | The handle is invalid 3/14 | 20180314.05 | Win7 | The operation has been canceled 3/14 | 20180314.05 | Win10 | The operation has been canceled 3/14 | 20180314.05 | Win10 | The operation has been canceled 3/17 | 20180317.03 | Win7 | The handle is invalid 3/18 | 20180318.03 | Win10 | The operation has been canceled 3/19 | 20180319.06 | Win10 | The operation has been canceled 3/22 | 20180322.01 | Fedora26 | CurlException : SSL connect error Similar exceptions / errors as in #25896 and #25902 and #25912 25897 area-System.Xml Remove obsolete attribute from XslTransform Fixes #25874 25898 area-System.Threading CS0433 compiler error: ValueTask<TResult> is defined in both System.Runtime and System.Threading.Tasks.Extensions **Repro steps:** 1. git clone https://github.com/aspnet/Common.git 2. Checkout this commit: https://github.com/aspnet/Common/commit/2c4a50456614ea3b0a21aef00adf13581299cafd 3. build.cmd **Result**: ``` C:\dev\aspnet\Universe\modules\Common\test\Microsoft.Extensions.Internal.Test\ObjectMethodExecutorTest.cs(500,20): error CS0433: The type 'ValueTask<TResult>' exists in both 'System.Threading.Tasks.Extensions, Version=4.1.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' and 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' [C:\dev\aspnet\Universe\modules\Common\test\Microsoft.Extensions.Internal.Test\Microsoft.Extensions.Internal.Test.csproj] C:\dev\aspnet\Universe\modules\Common\test\Microsoft.Extensions.Internal.Test\ObjectMethodExecutorTest.cs(505,20): error CS0433: The type 'ValueTask<TResult>' exists in both 'System.Threading.Tasks.Extensions, Version=4.1.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' and 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' [C:\dev\aspnet\Universe\modules\Common\test\Microsoft.Extensions.Internal.Test\Microsoft.Extensions.Internal.Test.csproj] ``` **Details**: Using System.Threading.Tasks.Extensions/4.5.0-preview1-26008-09 Microsoft.NETCore.App/2.1.0-preview1-26009-01 **Log** [msbuild.binlog.zip](https://github.com/dotnet/corefx/files/1557047/msbuild.binlog.zip) cc @dagood @weshaggard 25899 area-System.IO Expose ZipArchiveEntry.Crc32 and fix crc bug - Exposes ZipArchiveEntry.Crc32 field - Fixes a bug in our CRC calculation - Adds tests for the crc32 field Progression of https://github.com/dotnet/corefx/pull/25204 by @reaction1989 resolves https://github.com/dotnet/corefx/issues/22292, https://github.com/dotnet/corefx/issues/25803 cc: @stephentoub @ViktorHofer @livarcocc 25900 area-System.Data Check if full-text index exists before running WarningsBeforeRowsTest. "WarningBeforeRowsTest uses some ""contains()"" queries for warning checking, but a full-text index is required for contains(). Since the Northwind sample DB doesn't have full-text indexed columns by default, I'm making this test optional." 25901 area-System.IO Compression tests broken "@ianhays, all or most of the compression tests have started failing: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171213.10/workItem/System.IO.Compression.Performance.Tests example -- The test `System.IO.Compression.GzipStreamPerfTests/Decompress_Canterbury(innerIterations: 1, uncompressedFilePath: \""UncompressedTestFiles/TestDocument.doc\"", compressLevel: Fastest)` has failed. System.IO.DirectoryNotFoundException : Could not find a part of the path '/Users/dotnet-bot/dotnetbuild/work/22a01f14-296f-4811-9db4-685fa4c585f9/Work/78a1bc7b-a47f-48b7-8b89-c9a38f2774fb/Unzip/GZTestData/TestDocument.doc.gz'. Stack Trace: at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) in /Users/buildagent/agent/_work/304/s/src/mscorlib/shared/Interop/Unix/Interop.IOErrors.cs:line 23 at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) in /Users/buildagent/agent/_work/304/s/src/mscorlib/shared/Microsoft/Win32/SafeHandles/SafeFileHandle.Unix.cs:line 78 at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) in /Users/buildagent/agent/_work/304/s/src/mscorlib/shared/System/IO/FileStream.cs:line 229 at System.IO.File.InternalReadAllBytes(String path) at System.IO.Compression.CompressionStreamPerfTestBase.Decompress_Canterbury(Int32 innerIterations, String uncompressedFilePath, CompressionLevel compressLevel) in /Users/buildagent/agent/_work/320/s/corefx/src/Common/tests/System/IO/Compression/CompressionStreamPerfTestBase.cs:line 71 Build : Master - 20171213.10 (Core Tests) Failing configurations: - OSX.1013.Amd64-x64 - Release - OSX.1012.Amd64-x64 - Release - fedora.25.amd64-x64 - Release - SLES.12.Amd64-x64 - Release - suse.422.amd64-x64 - Release - Ubuntu.1710.Amd64-x64 - Release - Ubuntu.1704.Amd64-x64 - Release - Ubuntu.1604.Amd64-x64 - Release - Ubuntu.1404.Amd64-x64 - Release - Debian.90.Amd64-x64 - Release - Debian.87.Amd64-x64 - Release" 25902 area-System.Net Test failure: System.Net.Http.Functional.Tests.HttpClientHandlerTest / PostAsync_CallMethod_StreamContent ## Types of failures ### The operation has been canceled Failure [20171209.01](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171209.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandlerTest~2FPostAsync_CallMethod_StreamContent\(remoteServer:%20https:~2F~2Fcorefx-net.cloudapp.net~2FVerifyUpload.ashx,%20content:%20StreamContentWithSyncAsyncCo...): ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.WinHttpException : The operation has been canceled at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() in E:\A\_work\772\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 464 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpClientHandlerTest.<PostAsync_CallMethod_StreamContent>d__80.MoveNext() in E:\A\_work\772\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.cs:line 1463 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Threading.Tasks.RendezvousAwaitable`1.GetResult() in E:\A\_work\772\s\corefx\src\Common\src\System\Threading\Tasks\RendezvousAwaitable.cs:line 62 at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext() in E:\A\_work\772\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 856 ``` ### The handle is in the wrong state for the requested operation Failure [20171106.02](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171106.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandlerTest~2FPostAsync_CallMethod_StreamContent\(remoteServer:%20http:~2F~2Fcorefx-net.cloudapp.net~2FVerifyUpload.ashx,%20content:%20StreamContentWithSyncAsyncCop...): ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.WinHttpException : The handle is in the wrong state for the requested operation at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() in E:\A\_work\1586\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 464 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpClientHandlerTest.<PostAsync_CallMethod_StreamContent>d__79.MoveNext() in E:\A\_work\1586\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.cs:line 1435 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Threading.Tasks.RendezvousAwaitable`1.GetResult() in E:\A\_work\1586\s\corefx\src\Common\src\System\Threading\Tasks\RendezvousAwaitable.cs:line 62 at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext() in E:\A\_work\1586\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 856 ``` ### The handle is invalid Failure [20171025.08](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171025.08/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandlerTest~2FPostAsync_CallMethod_StreamContent\(remoteServer:%20http:~2F~2Fcorefx-net.cloudapp.net~2FVerifyUpload.ashx,%20content:%20StreamContentWithSyncAsyncCop...): ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.WinHttpException : The handle is invalid at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpClientHandlerTest.<PostAsync_CallMethod_StreamContent>d__74.MoveNext() --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Net.Http.WinHttpException.ThrowExceptionUsingLastError() at System.Net.Http.WinHttpHandler.SetRequestHandleRedirectionOptions(SafeWinHttpHandle requestHandle) at System.Net.Http.WinHttpHandler.SetRequestHandleOptions(WinHttpRequestState state) at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext() ``` ### The operation timed out Failure [20180226.01](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180226.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandlerTest~2FPostAsync_CallMethod_StreamContent(remoteServer:%20http:~2F~2Fcorefx-net.cloudapp.net~2FVerifyUpload.ashx,%20content:%20FormUrlEncodedContent%20%7B%20Hea)) ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.WinHttpException : The operation timed out at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) in E:\A\_work\14\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 469 at System.Net.Http.Functional.Tests.HttpClientHandlerTest.PostAsync_CallMethod_StreamContent(Uri remoteServer, HttpContent content, Byte[] expectedData) in E:\A\_work\14\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.cs:line 2099 --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Threading.Tasks.RendezvousAwaitable`1.GetResult() in E:\A\_work\14\s\corefx\src\Common\src\System\Threading\Tasks\RendezvousAwaitable.cs:line 62 at System.Net.Http.WinHttpHandler.StartRequest(WinHttpRequestState state) in E:\A\_work\14\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 856 ``` ### A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond Failure [20180226.01](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180226.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpClientHandlerTest~2FPostAsync_CallMethod_StreamContent(remoteServer:%20https:~2F~2Fcorefx-net.cloudapp.net~2FVerifyUpload.ashx,%20content:%20StreamContentWithSyncAsync)) ``` System.Net.Http.HttpRequestException : A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond ---- System.Net.Sockets.SocketException : A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) in E:\A\_work\14\s\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\ConnectHelper.cs:line 98 at System.Net.Http.HttpConnectionPool.CreateConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) in E:\A\_work\14\s\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnectionPool.cs:line 221 at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync(ValueTask`1 creationTask) in E:\A\_work\14\s\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnectionPool.cs:line 350 at System.Net.Http.HttpConnectionPool.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in E:\A\_work\14\s\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnectionPool.cs:line 189 at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in E:\A\_work\14\s\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\RedirectHandler.cs:line 30 at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) in E:\A\_work\14\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 469 at System.Net.Http.Functional.Tests.HttpClientHandlerTest.PostAsync_CallMethod_StreamContent(Uri remoteServer, HttpContent content, Byte[] expectedData) in E:\A\_work\14\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.cs:line 2099 --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) in E:\A\_work\14\s\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\ConnectHelper.cs:line 78 ``` ## History of failures Day | Build | OS | Error message -- | -- | -- | -- 5/19 | 20170519.01 | Win8.1 | The operation has been canceled 5/19 | 20170519.04 | Win7 | The handle is invalid 5/30 | 20170530.01 | Win10 | The operation has been canceled 6/1 | 20170601.03 | Win10 | The operation has been canceled 6/4 | 20170604.02 | Win7 | The operation has been canceled 6/14 | 20170614.01 | Win7 | The handle is invalid 10/9 | 20171009.03 | Win10 | The operation has been canceled 10/11 | 20171011.02 | Win7 | The handle is invalid 10/13 | 20171013.01 | Win10 | The operation has been canceled 10/17 | 20171017.02 | Win8.1 | The operation has been canceled 10/22 | 20171022.01 | Win8.1 | The operation has been canceled 10/25 | 20171025.08 | Win7 | The handle is invalid 11/5 | 20171105.01 | Win8.1 | The operation has been canceled 11/6 | 20171106.02 | Win7 | The handle is in the wrong state for the requested operation 11/13 | 20171112.01 | Win7 | The handle is in the wrong state for the requested operation 11/14 | 20171114.02 | Win7 | The operation has been canceled 11/16 | 20171116.54 | Win7 | The operation has been canceled 11/21 | 20171121.02 | Win7 | The operation has been canceled 11/27 | 20171127.02 | Win10 | The operation has been canceled 12/9 | 20171209.01 | Win10 | The operation has been canceled 12/18 | 20171218.01 | Win10 | The operation has been canceled - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171218.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandlerTest~2FPostAsync_CallMethod_StreamContent\(remoteServer:%20https:~2F~2Fcorefx-net.cloudapp.net~2FVerifyUpload.ashx,%20content:%20FormUrlEncodedContent%20%7B%20Head...) 12/31 | 20171231.01 | Win8.1 | The operation has been canceled - only in [full logs](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171231.01/workItem/System.Net.Http.Functional.Tests/wilogs) 1/11 | 20180111.01 | Win7 | The operation has been canceled - only in [full logs](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180111.01/workItem/System.Net.Http.Functional.Tests/wilogs) 1/19 | 20180119.02 | Win10 | The operation has been canceled - only in [full logs](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180119.02/workItem/System.Net.Http.Functional.Tests/wilogs) 2/26 | 20180226.01 | Win8.1 | A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180226.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpClientHandlerTest~2FPostAsync_CallMethod_StreamContent(remoteServer:%20https:~2F~2Fcorefx-net.cloudapp.net~2FVerifyUpload.ashx,%20content:%20StreamContentWithSyncAsync)) 2/26 | 20180226.01 | Win8.1 | The operation timed out - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180226.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandlerTest~2FPostAsync_CallMethod_StreamContent(remoteServer:%20http:~2F~2Fcorefx-net.cloudapp.net~2FVerifyUpload.ashx,%20content:%20FormUrlEncodedContent%20%7B%20Hea)) Similar exceptions / errors as in #25896 25904 area-System.Net Test failure: System.Net.Http.Functional.Tests.HttpClientHandlerTest / PostAsync_ReuseRequestContent_Success ## Type of failures ### The operation was canceled Failure [20171128.05](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171128.05/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandlerTest~2FPostAsync_ReuseRequestContent_Success(remoteServer:%20http:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)): ``` System.OperationCanceledException : The operation was canceled. at System.Threading.Tasks.RendezvousAwaitable`1.GetResult() in E:\A\_work\1790\s\corefx\src\Common\src\System\Threading\Tasks\RendezvousAwaitable.cs:line 62 at System.Net.Http.WinHttpResponseStream.<CopyToAsyncCore>d__18.MoveNext() in E:\A\_work\1790\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpResponseStream.cs:line 127 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.NoWriteNoSeekStreamContent.<>c.<SerializeToStreamAsync>b__4_0(Task t, Object s) in E:\A\_work\1790\s\corefx\src\Common\src\System\Net\Http\NoWriteNoSeekStreamContent.cs:line 52 at System.Threading.Tasks.ContinuationTaskFromTask.InnerInvoke() in E:\A\_work\1380\s\src\mscorlib\src\System\Threading\Tasks\TaskContinuation.cs:line 65 at System.Threading.Tasks.Task.<>c.<.cctor>b__278_1(Object obj) in E:\A\_work\1380\s\src\mscorlib\src\System\Threading\Tasks\Task.cs:line 2480 at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) in E:\A\_work\1380\s\src\mscorlib\shared\System\Threading\ExecutionContext.cs:line 151 at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) in E:\A\_work\1380\s\src\mscorlib\src\System\Threading\Tasks\Task.cs:line 2440 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.HttpContent.<LoadIntoBufferAsyncCore>d__49.MoveNext() in E:\A\_work\1790\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpContent.cs:line 407 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() in E:\A\_work\1790\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 464 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpClientHandlerTest.<PostAsync_ReuseRequestContent_Success>d__91.MoveNext() in E:\A\_work\1790\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.cs:line 1747 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ``` Similar error in failure [20171126.02](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171126.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandlerTest~2FPostAsync_ReuseRequestContent_Success(remoteServer:%20https:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)): ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.WinHttpException : The operation has been canceled at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() in E:\A\_work\686\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 464 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpClientHandlerTest.<PostAsync_ReuseRequestContent_Success>d__91.MoveNext() in E:\A\_work\686\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.cs:line 1747 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Threading.Tasks.RendezvousAwaitable`1.GetResult() in E:\A\_work\686\s\corefx\src\Common\src\System\Threading\Tasks\RendezvousAwaitable.cs:line 62 at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext() in E:\A\_work\686\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 858 ``` ### The handle is in the wrong state for the requested operation Failure [20171115.02](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171115.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandlerTest~2FPostAsync_ReuseRequestContent_Success(remoteServer:%20https:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)): ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.WinHttpException : The handle is in the wrong state for the requested operation at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() in E:\A\_work\1790\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 464 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpClientHandlerTest.<PostAsync_ReuseRequestContent_Success>d__91.MoveNext() in E:\A\_work\1790\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.cs:line 1747 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Net.Http.WinHttpException.ThrowExceptionUsingLastError() in E:\A\_work\1790\s\corefx\src\Common\src\System\Net\Http\WinHttpException.cs:line 44 at System.Net.Http.WinHttpHandler.SetRequestHandleOptions(WinHttpRequestState state) in E:\A\_work\1790\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 962 at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext() in E:\A\_work\1790\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 833 ``` Similar error wrapped in `IOException` in failure [20171210.03](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171210.03/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandlerTest~2FPostAsync_ReuseRequestContent_Success(remoteServer:%20http:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)): ``` System.Net.Http.HttpRequestException : Error while copying content to a stream. ---- System.IO.IOException : The write operation failed, see inner exception. -------- System.Net.Http.WinHttpException : The handle is in the wrong state for the requested operation at System.Net.Http.HttpContent.<CopyToAsyncCore>d__45.MoveNext() in E:\A\_work\1324\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpContent.cs:line 340 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.WinHttpHandler.<InternalSendRequestBodyAsync>d__131.MoveNext() in E:\A\_work\1324\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 1356 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext() in E:\A\_work\1324\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 860 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() in E:\A\_work\1324\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 464 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpClientHandlerTest.<PostAsync_ReuseRequestContent_Success>d__91.MoveNext() in E:\A\_work\1324\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.cs:line 1747 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Net.Http.HttpContent.<CopyToAsyncCore>d__45.MoveNext() in E:\A\_work\1324\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpContent.cs:line 336 ----- Inner Stack Trace ----- ``` ### IOException: The handle is invalid Failure [20171202.01](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171202.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandlerTest~2FPostAsync_ReuseRequestContent_Success(remoteServer:%20http:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)): ``` System.Net.Http.HttpRequestException : Error while copying content to a stream. ---- System.IO.IOException : The write operation failed, see inner exception. -------- System.Net.Http.WinHttpException : The handle is invalid at System.Net.Http.HttpContent.<CopyToAsyncCore>d__45.MoveNext() in E:\A\_work\704\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpContent.cs:line 340 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.WinHttpHandler.<InternalSendRequestBodyAsync>d__131.MoveNext() in E:\A\_work\704\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 1359 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext() in E:\A\_work\704\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 863 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() in E:\A\_work\704\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 464 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpClientHandlerTest.<PostAsync_ReuseRequestContent_Success>d__91.MoveNext() in E:\A\_work\704\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.cs:line 1747 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Net.Http.HttpContent.<CopyToAsyncCore>d__45.MoveNext() in E:\A\_work\704\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpContent.cs:line 336 ----- Inner Stack Trace ----- ``` ## History of failures Day | Build | OS | Error message -- | -- | -- | -- 9/3 | 20170903.01 | RedHat | OperationCanceledException : The operation was canceled. 10/8 | 20171008.02 | Win7 | The handle is in the wrong state for the requested operation 10/23 | 20171023.02 | Win7 | OperationCanceledException : The operation was canceled. 11/7 | 20171107.02 | Win7 | The handle is in the wrong state for the requested operation 11/15 | 20171115.02 | Win7 | The handle is in the wrong state for the requested operation 11/26 | 20171126.02 | Win8.1 | WinHttpException: The operation has been canceled 11/28 | 20171128.05 | Win7 | OperationCanceledException: The operation was canceled. 12/2 | 20171202.01 | Win7 | IOException: The handle is invalid 12/10 | 20171210.03 | Win7 | IOException: The handle is in the wrong state for the requested operation 12/19 | 20171219.01 | Win7 | The handle is in the wrong state for the requested operation - only in [catastrophic failure logs](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171219.01/workItem/System.Net.Http.Functional.Tests/wilogs) 1/1 | 20180101.02 | Win8.1 | OperationCanceledException: The operation was canceled. - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180101.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandlerTest~2FPostAsync_ReuseRequestContent_Success(remoteServer:%20https:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)) 1/22 | 20180122.02 | Win7 | WinHttpException: The operation has been canceled - only in [catastrophic failure logs](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180122.02/workItem/System.Net.Http.Functional.Tests/wilogs) 1/23 | 20180123.04 | Win7 | WinHttpException: The handle is in the wrong state for the requested operation - only in [catastrophic failure logs](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180123.04/workItem/System.Net.Http.Functional.Tests/wilogs) 1/24 | 20180124.06 | Win7 | WinHttpException: The operation has been canceled - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180124.06/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandlerTest~2FPostAsync_ReuseRequestContent_Success(remoteServer:%20http:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)) 1/25 | 20180125.01 | Win7 | WinHttpException: The handle is invalid - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180125.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandlerTest~2FPostAsync_ReuseRequestContent_Success(remoteServer:%20http:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)) 25906 area-System.Reflection ReflectionTypeLoadException's ToString() should include inner exceptions As thrown by the runtime, ReflectionTypeLoadException always has its default message, which is: `Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.` The information is only in LoaderExceptions and that can contain many possible messages along the lines of type X could not be loaded due to reason Y. AggregateException is analogous and includes these inner exceptions in its ToString(). Unfortunately RuntimeTypeLoadException does not. This means in console output that records the crash, the information is gone and irretrievable. So I am faced with a test log that just says ``` System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) at System.Reflection.Assembly.GetTypes() at repro.Program.Main() in C:\Users\danmose\source\repos\ConsoleApp32\Program.cs:line 32 ``` If it did the same as AggregateException it would look like ``` System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) at System.Reflection.Assembly.GetTypes() at repro.Program.Main() in C:\Users\danmose\source\repos\ConsoleApp32\Program.cs:line 32 Could not load type 'repro.StructA' from assembly 'ConsoleApp32, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Could not load type 'repro.StructB' from assembly 'ConsoleApp32, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' ``` Which makes it easier to figure out what happened. Note the inner exceptions often do not have callstacks - just messages - if they don't have stacks, the output should not show any. Note also I removed the text `Retrieve the LoaderExceptions property for more information.` which becomes essentially redundant. 25907 area-System.IO Fix GZip perf test location resolves https://github.com/dotnet/corefx/issues/25901 25909 area-System.Linq Fill some test gaps in S.L.Expression's LambdaCompiler Contributes to #11409 25910 area-System.Net Use generic test handling for remote server failures. "cc @karelz @wfurt @davidsh fixes #25878 fixes #25892 When any test with remote server dependency fails, it will output something like this: ``` System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test.GetAsync_UnsupportedSSLVersion_Throws(name: \""SSLv2\"", url: \""https://www.ssllabs.com:10200/\"") [FAIL] System.Net.Test.Common.RemoteServerException : Likely external issue with remote server : https://www.ssllabs.com:10200/ ---- System.Net.Http.HttpRequestException : An error occurred while sending the request. -------- System.Net.Http.WinHttpException : A connection with the server could not be established Stack Trace: E:\corefx\src\Common\tests\System\Net\RemoteServerQuery.cs(65,0): at System.Net.Test.Common.RemoteServerQuery.<ThrowsAsync>d__1`1.MoveNext() --- End of stack trace from previous location where exception was thrown --- E:\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.SslProtocols.cs(220,0): at System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test.<GetAsync_UnsupportedSSLVersion_Throws>d__9.MoveNext() --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- E:\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs(464,0): at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() --- End of stack trace from previous location where exception was thrown --- E:\corefx\src\Common\tests\System\Net\RemoteServerQuery.cs(56,0): at System.Net.Test.Common.RemoteServerQuery.<ThrowsAsync>d__1`1.MoveNext() ----- Inner Stack Trace ----- E:\corefx\src\System.Runtime.Extensions\src\System\Environment.cs(176,0): at System.Environment.get_StackTrace() E:\corefx\src\Common\src\System\Runtime\ExceptionServices\ExceptionStackTrace.cs(23,0): at System.Runtime.ExceptionServices.ExceptionStackTrace.AddCurrentStack(Exception exception) E:\corefx\src\Common\src\System\Net\Http\WinHttpException.cs(56,0): at System.Net.Http.WinHttpException.CreateExceptionUsingError(Int32 error) E:\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpRequestCallback.cs(324,0): at System.Net.Http.WinHttpRequestCallback.OnRequestError(WinHttpRequestState state, WINHTTP_ASYNC_RESULT asyncResult) E:\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpRequestCallback.cs(104,0): at System.Net.Http.WinHttpRequestCallback.RequestCallback(IntPtr handle, WinHttpRequestState state, UInt32 internetStatus, IntPtr statusInformation, UInt32 statusInformationLength) E:\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpRequestCallback.cs(47,0): at System.Net.Http.WinHttpRequestCallback.WinHttpCallback(IntPtr handle, IntPtr context, UInt32 internetStatus, IntPtr statusInformation, UInt32 statusInformationLength) --- End of stack trace from AddCurrentStack --- E:\corefx\src\Common\src\System\Threading\Tasks\RendezvousAwaitable.cs(62,0): at System.Threading.Tasks.RendezvousAwaitable`1.GetResult() E:\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs(856,0): at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext() ```" 25911 area-Meta Confused Versions Why are you using different versions? Which one is major? SDK version? Corefx release version? Where can I find the SDK release version such as (2.1.2 , 2.1.3) ? 25912 area-System.Net Test failure: System.Net.Http.Functional.Tests.HttpClientHandler_ServerCertificates_Test / UseCallback_NotSecureConnection_CallbackNotCalled ## Type of failures ### The handle is in the wrong state for the requested operation Failure [20171210.03](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171210.03/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_ServerCertificates_Test~2FUseCallback_NotSecureConnection_CallbackNotCalled): ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.WinHttpException : The handle is in the wrong state for the requested operation at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() in E:\A\_work\1324\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 464 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpClientHandler_ServerCertificates_Test.<UseCallback_NotSecureConnection_CallbackNotCalled>d__8.MoveNext() in E:\A\_work\1324\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.ServerCertificates.cs:line 119 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Threading.Tasks.RendezvousAwaitable`1.GetResult() in E:\A\_work\1324\s\corefx\src\Common\src\System\Threading\Tasks\RendezvousAwaitable.cs:line 62 at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext() in E:\A\_work\1324\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 856 ``` ### The operation has been canceled Failure [20171126.02](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171126.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_ServerCertificates_Test~2FUseCallback_NotSecureConnection_CallbackNotCalled): ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.WinHttpException : The operation has been canceled at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() in E:\A\_work\686\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 464 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpClientHandler_ServerCertificates_Test.<UseCallback_NotSecureConnection_CallbackNotCalled>d__8.MoveNext() in E:\A\_work\686\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.ServerCertificates.cs:line 119 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Threading.Tasks.RendezvousAwaitable`1.GetResult() in E:\A\_work\686\s\corefx\src\Common\src\System\Threading\Tasks\RendezvousAwaitable.cs:line 62 at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext() in E:\A\_work\686\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 858 ``` ### The handle is invalid Failure [20171128.07](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171128.07/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_ServerCertificates_Test~2FUseCallback_NotSecureConnection_CallbackNotCalled): ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.WinHttpException : The handle is invalid at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() in E:\A\_work\1153\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 464 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpClientHandler_ServerCertificates_Test.<UseCallback_NotSecureConnection_CallbackNotCalled>d__8.MoveNext() in E:\A\_work\1153\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.ServerCertificates.cs:line 119 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Net.Http.WinHttpHandler.InternalReceiveResponseHeadersAsync(WinHttpRequestState state) in E:\A\_work\1153\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 1365 at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext() in E:\A\_work\1153\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 863 ``` ## History of failures Day | Build | OS | Error message -- | -- | -- | -- 5/19 | 20170519.03 | Win10 | The operation has been canceled 8/22 | 20170822.01 | Win7 | The operation has been canceled 8/31 | 20170831.01 | Win10 | The operation has been canceled 9/26 | 20170926.06 | Win7 | The handle is in the wrong state for the requested operation 10/3 | 20171003.01 | Win7 | The handle is in the wrong state for the requested operation 10/4 | 20171004.01 | Win7 | The handle is in the wrong state for the requested operation 10/22 | 20171022.01 | Win8.1 | The operation has been canceled 11/3 | 20171103.07 | Win7 | The handle is in the wrong state for the requested operation 11/3 | 20171103.11 | Win7 | The handle is in the wrong state for the requested operation 11/4 | 20171104.04 | Win7 | The handle is in the wrong state for the requested operation 11/6 | 20171106.02 | Win8.1 | The operation has been canceled 11/9 | 20171109.05 | Win7 | The handle is in the wrong state for the requested operation 11/19 | 20171119.02 | Win8.1 | The operation has been canceled 11/26 | 20171126.02 | Win8.1 | The operation has been canceled 11/28 | 20171128.07 | Win10 | The handle is invalid 12/10 | 20171210.03 | Win7 | The handle is in the wrong state for the requested operation 1/2 | 20180102.02 | Win7 | The handle is in the wrong state for the requested operation<br/>Note: Only in [catastrophic failure logs](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180102.02/workItem/System.Net.Http.Functional.Tests/wilogs) 1/11 | 20180111.01 | Win7 | The handle is in the wrong state for the requested operation - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180111.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_ServerCertificates_Test~2FUseCallback_NotSecureConnection_CallbackNotCalled) 1/11 | 20180111.02 | Win7 | The handle is in the wrong state for the requested operation - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180111.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_ServerCertificates_Test~2FUseCallback_NotSecureConnection_CallbackNotCalled) 1/15 | 20180115.04 | Win7 | The handle is invalid - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180115.04/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_ServerCertificates_Test~2FUseCallback_NotSecureConnection_CallbackNotCalled) 1/22 | 20180122.02 | Win7 | The handle is in the wrong state for the requested operation<br/>Note: Only in [catastrophic failure logs](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180122.02/workItem/System.Net.Http.Functional.Tests/wilogs) 2/6 | 20180206.05 | Win7 | The handle is invalid - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180206.05/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_ServerCertificates_Test~2FUseCallback_NotSecureConnection_CallbackNotCalled) Similar exceptions / errors as in #25896 and #25902 25914 area-System.Net Managed sockets binding regression on linux "@tmds @stephentoub Starting with runtime build 2.1.0-preview1-25915-01, it is now possible to bind multiple times simultaneously to the exact same TCP address on linux without setting any special options. ### SampleApp: ```c# using System; using System.Net; using System.Net.Sockets; namespace DoubleBind { class Program { static void Main(string[] args) { using (var socket1 = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) { socket1.Bind(new IPEndPoint(IPAddress.Loopback, 5000)); using (var socket2 = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) { socket2.Bind(new IPEndPoint(IPAddress.Loopback, 5000)); } } Console.WriteLine(""Success!?""); } } } ``` ### Expected output: ``` DoubleBind$ dotnet run Unhandled Exception: System.Net.Sockets.SocketException: Address already in use at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName) at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.Bind(EndPoint localEP) at DoubleBind.Program.Main(String[] args) in /Users/shalter/source/halter73/DoubleBind/Program.cs:line 17 ``` This is what is seen today on Windows and macOS. ### Actual output: ``` DoubleBind$ dotnet run Success!? ``` This is the behavior on Linux (tested on Ubuntu 16.04.3 LTS) starting with the 2.1.0-preview1-25915-01 build. ### My theory [Here](https://github.com/dotnet/corefx/compare/25f80ade543903293ae08ac091cffd457a7a9ad4...7eba4bf88983ac276348ea1626c81595e1b237c6) are the changes introduced in the 2.1.0-preview1-25915-01 build. But even without looking at that, it stands to reason that #24809 is the likely cause of this change in behavior. Setting the SO_REUSEADDR option by itself should not cause this behavior (this is what we've been doing manually in Kestrel for a couple months now), so maybe SO_REUSEPORT is getting set when it shouldn't be." 25916 area-System.Console Console.ReadLine echoes first few hundred milliseconds of input on Linux/Mac "## Background I am not a console programmer, but was helping someone learn some foundations of programming and fundamental syntax of C# in a _.NET Core_ console application. When demonstrating loops I found that following simple code has an unexpected behavior. On the first pass through the while loop, the input is echoed to *stdout*. ### Example Program var retries = 10; var input = string.Empty; var answer = ""Cod3""; while(retries-- > 0 && input != answer){ input = Console.ReadLine(); } Console.WriteLine(retries > 0 ? ""CONGRATS!"" : ""GAME OVER!""); ### Example Output 1: Values entered at slow pace If I slowly entered the numbers 1 through 10 and hit return after each value, the following will result: 1 1 <-- Echoed to stdout, delayed several hundred milliseconds from the input. 2 3 4 5 6 7 8 9 10 GAME OVER! ### Example Output 2: Values entered at rapid pace If I rapidly entered the numbers 1 through 10 and hit return after each value, the following will result: 1 2 3 4 4 51 <-- Echo 2 <-- Echo 3 <-- Echo 4 <-- Echo 4 <-- Echo 5 <-- Echo 6 7 8 9 GAME OVER! #### Environment **OS**: OS X v10.13.1 **Shell**: _zsh v5.3_, _GNU bash v3.2.57_ **.Net Core**: v2.0.3" 25917 area-System.Diagnostics build -tests fail "when I executed build-tests after executed build command, I got below error: ``` ""C:\Users\peter.chen\Documents\Code\Self\corefx\src\System.Diagnostics.PerformanceCounter\tests\System.Diagnostics.Perf ormanceCounter.Tests.csproj"" (BuildAndTest 目標) (1) -> (CoreCompile 目標) -> CounterCreationDataTests.cs(8,6): error CS1001: Identifier expected [C:\Users\peter.chen\Documents\Code\Self\corefx\s rc\System.Diagnostics.PerformanceCounter\tests\System.Diagnostics.PerformanceCounter.Tests.csproj] CounterCreationDataTests.cs(8,6): error CS1002: ; expected [C:\Users\peter.chen\Documents\Code\Self\corefx\src\System .Diagnostics.PerformanceCounter\tests\System.Diagnostics.PerformanceCounter.Tests.csproj] CounterCreationDataTests.cs(8,14): error CS0116: A namespace cannot directly contain members such as fields or method s [C:\Users\peter.chen\Documents\Code\Self\corefx\src\System.Diagnostics.PerformanceCounter\tests\System.Diagnostics.Pe rformanceCounter.Tests.csproj] CounterCreationDataTests.cs(8,6): error CS1056: Unexpected character '?' [C:\Users\peter.chen\Documents\Code\Self\cor efx\src\System.Diagnostics.PerformanceCounter\tests\System.Diagnostics.PerformanceCounter.Tests.csproj] CounterCreationDataTests.cs(8,28): error CS1022: Type or namespace definition, or end-of-file expected [C:\Users\pete r.chen\Documents\Code\Self\corefx\src\System.Diagnostics.PerformanceCounter\tests\System.Diagnostics.PerformanceCounter .Tests.csproj] ``` Then, I opened `CounterCreationDataTests.cs` in notepad, I found a garbled character at line 8 ``` using�System.ComponentModel; ``` After I removed it and entered a white space, It works fine now. Is this a problem? Thanks." 25918 area-System.ComponentModel Allow RangeAttribute use to request InvariantCulture conversions. Adds a `ParseLimitsInInvariantCulture` that affects the interpretation of the extrema set, and `ConvertValueInInvariantCulture` that affects the interpretation of values. Separate properties allows for e.g. a component assuming a dot-decimal-separator culture defining a property with the attribute (so invariant culture should be used) the use of the property is done in a comma-decimal-separator (so the current culture should be used), or any permutation of the two booleans. Fixes #2648 CC @lajones 25919 area-System.Data Intellisense tooltip for SqlCommand's CommandTimeout doesn't describe units "The Visual Studio tooltip for SqlCommand.CommandTimeout doesn't say whether units are seconds or milliseconds.The tooltip says ""Gets or sets the wait time before terminating the attempt to execute a command and generating an error."" [MSDN](https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.commandtimeout(v=vs.110).aspx) has a bettter description: ""The time in seconds to wait for the command to execute. The default is 30 seconds.""" 25920 area-System.Security Bring SignedCms to CoreFx "With this change there become 4 builds of the Pkcs package: * netstandard * Used by UWP * EnvelopedCms: no * SignedCms: * RSA-PKCS1: yes * RSA-PSS: limited verification, no signature * ECDSA: yes * DSA: no (not defined in netstandard20) * The silent option to signing has no effect * netcoreapp-Windows_NT * Used by .NET Core on Windows * EnvelopedCms: yes (same as .NET Core 1.0 implementaiton) * SignedCms: * RSA-PKCS1: yes * RSA-PSS: limited verification, no signature * ECDSA: yes * DSA: yes (FIPS-186-3) * The silent option to signing is respected * netcoreapp * Used by .NET Core on Linux, macOS * EnvelopedCms: no * SignedCms: * RSA-PKCS1: yes * RSA-PSS: limited verification, no signature * ECDSA: yes * DSA: yes (FIPS-186-3) * The silent option to signing has no effect * netfx * The current state of .NET Framework is * EnvelopedCms: yes * SignedCms: * RSA-PKCS1: yes * RSA-PSS: no * ECDSA: no * DSA: FIPS-186-2 only * The silent option to signing is respected For RSA-PSS, it is supported if all of * the platform supports it * MGF1 is used * the message digest algorithm, PSS digest algorithm, and MGF1 digest algorithm all match * the PSS salt size is the same as the digest size * the standard PSS trailer identifier (1) is used Since there is no API to indicate RSA-PKCS1 or RSA-PSS at signing time, only RSA-PKCS1 signatures can be generated for RSA keys. The SignedCms implementation for .NET Core does the CMS message packing and unpacking directly (via the ASN.1 serializer), using the existing system-based cryptographic primitives where applicable. Several files are split-built netcoreapp vs netstandard to take advantage of netcoreapp Span-based API. Random factoid: The state of the tests (as of creating the PR) has (by itself) 59% line coverage of the ASN.1 serializer, 20% line coverage of the ASN.1 reader, and 42% line coverage of the ASN.1 writer. (Debug.Fail blocks and unhit exceptions are in the ""uncovered"" lines, they were not normalized away) References: * [IETF RFC 5652](https://tools.ietf.org/html/rfc5652#section-5.1) (section 5.1: SignedData) Fixes #14197." 25921 area-Infrastructure Ensure build of netcoreapp vertical of CoreFx can be done without past packages Fixes: https://github.com/dotnet/corefx/issues/23220 I'm not sure if we should only enable the external/netcoreapp/netcoreapp.depproj when BuildAllConfigurations=true? It is easier to review per commit. I also ran UpdateVSConfigurations cc: @weshaggard @danmosemsft 25922 area-System.Drawing Share as much Bitmap code with Windows as possible Slight WIP, let's see what the CI says :D 25923 area-System.IO "Revert ""Adding System.IO.Compression.ZipFile to net471 support package(#25867)""" This reverts commit 0596ee27edd37bd635ded793b7f89dea479cab92. cc: @weshaggard @AlexGhiondea Given that this change didn't force the binding redirect, then we decided it's better to remove it. 25924 area-Infrastructure SupportedFramework apply to all versions of a reference assembly When applying SupportedFramework metadata to a reference assembly in pkgproj it applies to all files in all configurations for the reference assembly project. This causes some invalid validation errors when the reference assembly pins the assembly version for some configurations but not others. It ends up expecting some frameworks to support both versions of the reference assembly instead of just the lower version. 25926 area-System.Runtime "Several x86 intrinsic APIs are ""missing""" "In the process of adding the APIs for #23519 (see https://github.com/dotnet/coreclr/pull/15341), I found several non-scalar x86 intrinsic APIs that are ""missing"". We should determine which of these need to be added and which were explicitly excluded. ``` int _mm_movemask_ps (__m128 a) // movmskps __m128d _mm_loadh_pd (__m128d a, double const* mem_addr) // movhpd __m128d _mm_loadl_pd (__m128d a, double const* mem_addr) // movlpd __m128i _mm_loadl_epi64 (__m128i const* mem_addr) // movq void _mm_stream_si32 (int* mem_addr, int a) // movnti void _mm_stream_si64 (__int64* mem_addr, __int64 a) // movnti __m256i _mm256_permute2f128_si256 (__m256i a, __m256i b, int imm8) // vperm2f128 __m256i _mm256_stream_load_si256 (__m256i const* mem_addr) // vmovntdqa // The following 8 have intrinsics which take an imm8 and emit the same underlying instruction __m128i _mm_sll_epi16 (__m128i a, __m128i count) // psllw __m128i _mm_sll_epi32 (__m128i a, __m128i count) // pslld __m128i _mm_sll_epi64 (__m128i a, __m128i count) // psllq __m128i _mm_sra_epi16 (__m128i a, __m128i count) // psraw __m128i _mm_sra_epi32 (__m128i a, __m128i count) // psrad __m128i _mm_srl_epi16 (__m128i a, __m128i count) // psrlw __m128i _mm_srl_epi32 (__m128i a, __m128i count) // psrld __m128i _mm_srl_epi64 (__m128i a, __m128i count) // psrlq // The following 6 have the corresponding _mm256 forms exposed __m128i _mm_sllv_epi32 (__m128i a, __m128i count) // vpsllvd __m128i _mm_sllv_epi64 (__m128i a, __m128i count) // vpsllvq __m128i _mm_srav_epi32 (__m128i a, __m128i count) // vpsravd __m128i _mm_srlv_epi32 (__m128i a, __m128i count) // vpsrlvd __m128i _mm_srlv_epi64 (__m128i a, __m128i count) // vpsrlvq ```" 25928 area-System.Runtime "Add ""Create"" method to EqualityComparer<> class" _From @ViIvanov on December 14, 2017 20:15_ Now we have a `Create` method in [Comparer<> class](https://github.com/dotnet/coreclr/blob/master/src/mscorlib/src/System/Collections/Generic/Comparer.cs#L21): ```cs public static Comparer<T> Create(Comparison<T> comparison) ``` I think, it will be usable to have an analog in EqualityComparer<>: ```cs public static EqualityComparer<T> Create(Func<T, T, bool> equals, Func<T, int> getHashCode) ``` _Copied from original issue: dotnet/coreclr#15526_ 25929 area-System.Memory Reference Unsafe APIs from CoreLib in System.Memory As part of https://github.com/dotnet/corefx/issues/24090#issuecomment-351041295, referencing the Unsafe APIs from CoreLib for the inbox version of System.Memory. Waiting on new CoreCLR to be picked up that has this change in https://github.com/dotnet/coreclr/pull/15527 cc @jkotas, @KrzysztofCwalina, @joshfree 25930 area-System.Runtime EventArgs type not Serializable MSBuild uses EventArgs base class to derive all build events and messages (see [BuildEventArgs](https://github.com/Microsoft/msbuild/blob/6851538897f5d7b08024a6d8435bc44be5869e53/src/Framework/BuildEventArgs.cs#L30)). As part of our effort to migrate to `netstandard2.0`, we need this type to be marked Serializable in order to maintain compatibility between full framework and Core versions. Ideally this needs to be included in 2.0 servicing in the VS15.6 timeframe. @danmosemsft 25932 area-System.Threading Freeze the assembly version for System.Threading.Tasks.Extensions The APIs in System.Threading.Tasks.Extensions have been put inbox on .NET Core 2.0 and UAp and also type-forwarded into System.Runtime. This means the APIs in the contract can no longer version for the netstandard reference. Any new API's have to be added to the platform specific reference assembly. This also updates the package to include the inbox placeholders for netcoreapp and uap. cc @ericstj @stephentoub 25933 area-System.Runtime Create new label for hardware intrinsics i.e. area-System.Runtime.Intrinsics There is a growing number of issues and PRs in both coreclr and corefx repos which are result of ongoing work in implementation of Intel and Arm hardware instrinsics. It would be very helpful in managing the information flow if that area would have it's own labels to better organize work and information flow. cc: @karelz @jkotas @tannergooding @CarolEidt @fiigii @sdmaclea 25934 area-System.Threading Tests To recognize the ApartmentStateThreadAttribute on Main Function Related PR - https://github.com/dotnet/coreclr/pull/15512 New PR - #26001 25935 area-System.Diagnostics Replace garbled character with white space Resolves #25917 25936 area-Meta Convert uses of the Dangerous APIs to use MemoryMarshal.GetReference Part of: https://github.com/dotnet/corefx/issues/25412 https://github.com/dotnet/corefx/issues/25615 Related to (and depends on): https://github.com/dotnet/coreclr/pull/15532 **Note:** Expecting this failure for now until we have resolved whether we should add `Unsafe.AsRef<T>(in T)` or not. See: https://github.com/dotnet/coreclr/pull/15532#issuecomment-351896709 ```text Cannot use method 'MemoryMarshal.GetReference<char>(ReadOnlySpan<char>)' as a ref or out value because it is a readonly variable ``` Following the staging plan from here: https://github.com/dotnet/corefx/issues/23881#issuecomment-343767740 - [x] Add MemoryExtensions.GetReference/TryGetArray - [ ] Convert all uses of DangerousGetPinnableReference/DangerousTryGetArray in coreclr, corefx, corert, corefxlab, aspnet, ... to MemoryExtensions.GetReference - [ ] Change DangerousGetPinnableReference to whatever we like to make it fit the pinning pattern and remove DangerousTryGetArray. Doing it this way will avoid the need for complex staging or things being on the floor for extensive periods of time. cc @jkotas, @stephentoub, @KrzysztofCwalina, @davidfowl, @pakrym, @joshfree 25937 area-System.Linq Add LookUp(TKey, TElement).Empty() API # Issue Recently we are dealing with a scenario which is to provide an API that returns an `ILookup<TKey, TElement>` instance. The design is, before actually performing queries, the API checks whether the parameters will cause empty result. If so, an empty `ILookup<TKey, TElement>` is returned. Currently we manually create a static field as below: ```csharp static readonly ILookup<int, Something> Empty = Array.Empty<Something>().ToLookup(s => s.ID); ``` However, if there is a built-in API similar to `Enumerable.Empty<T>()` and `Array.Empty<T>()`, it could be helpful. Manual declaration above is no longer needed. # Rational Since we already have `Enumerable.Empty<T>()` and `Array.Empty<T>()`, and `ILookup<TKey, TElement>` instance cannot be modified, it is reasonable that we can have similar static method that serves same purpose. # Proposal Similar to `Enumerable.Empty<T>()` and `Array.Empty<T>()`, the proposed API shall look like following code snippet: ```csharp public ILookup<int, Something> FindSomethings(DateTime from, DateTime to) { if (from <= WhenTheBusinessLaunched && to <= WhenTheBusinessLaunched) return Lookup<int, Something>.Empty(); // Here var result = default(ILookup<int, Something>); // Do something return result; } ``` where the `Empty()` method has syntax below: ```csharp public static ILookup<TKey, TElement> Lookup<TKey, TElement>.Empty(); ``` or can be something like this with new `Lookup` class: ```csharp public static ILookup<TKey, TElement> Lookup.Empty<TKey, TElement>(); ``` Please take a look at the proposal above. Thanks. 25938 area-System.Collections Test failure: System.Collections.Concurrent.Tests.ConcurrentBagTests/BlockingCollection_WrappingCollection_ExpectedElementsTransferred(numThreadsPerConsumerProducer: 4, numItemsPerThread: 100000, producerSp... Opened on behalf of @Sunny-pu The test `System.Collections.Concurrent.Tests.ConcurrentBagTests/BlockingCollection_WrappingCollection_ExpectedElementsTransferred(numThreadsPerConsumerProducer: 4, numItemsPerThread: 100000, producerSp...` has failed. Assert.NotEqual() Failure\r Expected: Not 0\r Actual: 0 Stack Trace: at System.Collections.Concurrent.Tests.ProducerConsumerCollectionTests.<>c__DisplayClass41_0.<BlockingCollection_WrappingCollection_ExpectedElementsTransferred>b__3() in E:\A\_work\1973\s\corefx\src\System.Collections.Concurrent\tests\ProducerConsumerCollectionTests.cs:line 508 at System.Threading.Tasks.Task.InnerInvoke() at System.Threading.Tasks.Task.<>c.<.cctor>b__278_1(Object obj) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) --- End of stack trace from previous location where exception was thrown --- at System.Collections.Concurrent.Tests.ProducerConsumerCollectionTests.WaitAllOrAnyFailed(Task[] tasks) in E:\A\_work\1973\s\corefx\src\System.Collections.Concurrent\tests\ProducerConsumerCollectionTests.cs:line 1016 at System.Collections.Concurrent.Tests.ProducerConsumerCollectionTests.BlockingCollection_WrappingCollection_ExpectedElementsTransferred(Int32 numThreadsPerConsumerProducer, Int32 numItemsPerThread, Int32 producerSpin) in E:\A\_work\1973\s\corefx\src\System.Collections.Concurrent\tests\ProducerConsumerCollectionTests.cs:line 513 Build : Master - 20171215.02 (UWP F5 Tests) Failing configurations: - Windows.10.Arm64-arm - Release Details: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fuwp~2F/build/20171215.02/workItem/System.Collections.Concurrent.Tests/analysis/xunit/System.Collections.Concurrent.Tests.ConcurrentBagTests~2FBlockingCollection_WrappingCollection_ExpectedElementsTransferred(numThreadsPerConsumerProducer:%204,%20numItemsPerThread:%20100000,%20producerSp... 25939 area-System.Collections Test failure: System.Collections.Concurrent.Tests.ConcurrentBagTests/ManyConcurrentAddsTakes_ForceContentionWithToArray(seconds: 1) Opened on behalf of @Sunny-pu The test `System.Collections.Concurrent.Tests.ConcurrentBagTests/ManyConcurrentAddsTakes_ForceContentionWithToArray(seconds: 1)` has failed. System.IndexOutOfRangeException : Index was outside the bounds of the array. Stack Trace: at System.Collections.Concurrent.ConcurrentBag`1.ToArray() in E:\A\_work\1973\s\corefx\src\System.Collections.Concurrent\src\System\Collections\Concurrent\ConcurrentBag.cs:line 346 at System.Collections.Concurrent.Tests.ProducerConsumerCollectionTests.ManyConcurrentAddsTakes_ForceContentionWithToArray(Double seconds) in E:\A\_work\1973\s\corefx\src\System.Collections.Concurrent\tests\ProducerConsumerCollectionTests.cs:line 910 Build : Master - 20171215.02 (UWP F5 Tests) Failing configurations: - Windows.10.Arm64-arm - Release Details: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fuwp~2F/build/20171215.02/workItem/System.Collections.Concurrent.Tests/analysis/xunit/System.Collections.Concurrent.Tests.ConcurrentBagTests~2FManyConcurrentAddsTakes_ForceContentionWithToArray(seconds:%201) 25940 area-System.Runtime Add tests for EventArgs serialization Relates to https://github.com/dotnet/corefx/issues/25930 Requires https://github.com/dotnet/coreclr/pull/15541 25945 area-System.Runtime Implement public partial sort Array API ## Rationale - In [PowerShell repo](https://github.com/PowerShell/PowerShell) we have Sort-Object cmdlet enhanced with `-Top` and `-Bottom` parameters - their implementation is based on partial sorting. - Currently Linq uses [`Array.Sort`](https://github.com/dotnet/corefx/pull/24116) but own internal (not public API) implementation of [PartialQuickSort](https://github.com/stephentoub/corefx/blob/a6aff797a33e606a60ec0c9ca034a161c609620f/src/System.Linq/src/System/Linq/OrderedEnumerable.cs#L592). - It seems this is a very popular scenario for web interface to show sorted result by pages. Users use only top items and rarely go to the following pages. ## Proposed API ## ```c# public abstract partial class Array : System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.IList, System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.ICloneable { public static void SortPartial(array array, int index, int length) { } public static void SortPartial(array keys, array items, int index, int length) { } public static void SortPartial(array array, int index, int length, System.Collections.IComparer comparer) { } public static void SortPartial(array keys, array items, int index, int length, System.Collections.IComparer comparer) { } public static void SortPartial[T](T[] array, int index, int length) { } public static void SortPartial[TKey, TValue](TKey[] keys, TValue[] items, int index, int length) { } public static void SortPartial[T](T[] array, int index, int endIndex, System.Collections.Generic.IComparer[T] comparer) { } public static void SortPartial[TKey, TValue](TKey[] keys, TValue[] items, int index, int length, System.Collections.Generic.IComparer [TKey] comparer) { } } public partial class List<T> : System.Collections.Generic.ICollection<T>, System.Collections.Generic.IEnumerable<T>, System.Collections.Generic.IList<T>, System.Collections.Generic.IReadOnlyCollection<T>, System.Collections.Generic.IReadOnlyList<T>, System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.IList { public void SortPartial(int index, int count, System.Collections.Generic.IComparer<T> comparer) { } } ``` ## Useful links ## https://en.wikipedia.org/wiki/Partial_sorting https://blogs.msdn.microsoft.com/devdev/2006/01/18/efficient-selection-and-partial-sorting-based-on-quicksort/ ## Updates ## 1. Replace `startIndex` and `endIndex` with `index` and `length`. 2. Add class names. 25946 area-System.Reflection Unsafe behaviour of MetadataReaderProvider I spent quite a while debugging some non-deterministic behaviour of the `System.Reflection.Metadata.MetadataReader` class. It would randomly start throwing `BadImageFormatException`. Example: ```c# System.Reflection.MetadataReader GetReader() { System.Reflection.Metadata.MetadataReaderProvider provider = ...; return provider.GetMetadataReader(); } void Test() { var peReader = GetReader(); // provider gets garbage collected // future uses of peReader throw BadImageFormatException } ``` It turns out that the underlying `System.Reflection.Metadata.MetadataReaderProvider` class had been garbage collected, and the unsafe pointers used internally in `System.Reflection.Metadata` became invalid. I think that this API is too unsafe. The error only became apparent under heavy multi-threaded use. My personal suggestion is that `System.Reflection.Metadata` should contain an `object` that can optionally reference the `MetadataReaderProvider`, such that an application that only keeps a reference to the `Metadata` object will not have its internal pointers dangling. [EDIT] Ad C# syntax highlighting by @karelz 25948 area-System.Security Consolidate HashAlgorithmName->HashAlgorithm lookup tables There are a fair number of copies of HashAlgorithmName to HashAlgorithm resolvers. They should be consolidated into one place, and probably just be public API. `HashAlgorithm.Create(HashAlgorithmName algName)`, perhaps? 25949 area-System.Net Intermittent WinHttpException on Azure "I have had an issue running ASP.NET Core 2.0 app in Azure and have had a conversation with the Azure support team. They have, after some investigation, suggested I open the issue here for further help. The scenario is as follows. I have a completely standard, out of the box, ASP.NET Core app that I published to Azure. The only modification I've made to this application is I've added a singleton `HttpClient` to the service container like this: `services.TryAddSingleton<HttpClient>();` I've also modified the About.cshtml.cs file with the following additions: ```c# private readonly HttpClient _client; public AboutModel(HttpClient client) { _client = client; } public string Message { get; set; } public async Task OnGet() { Message = ""Your application description page.""; var responses = new List<HttpResponseMessage>(); responses.Add(await _client.GetAsync(""https://cdn.contentful.com/spaces/qz0n5cdakyl9/entries/?access_token=secretTokenHere"")); responses.Add(await _client.GetAsync(""https://cdn.contentful.com/spaces/qz0n5cdakyl9/entries/?access_token=secretTokenHere&content_type=layout"")); responses.Add(await _client.GetAsync(""https://cdn.contentful.com/spaces/qz0n5cdakyl9/entries/?access_token=secretTokenHere&content_type=lessonCopy"")); if(responses.Any(c => c.IsSuccessStatusCode == false)) { throw new Exception(""Got a !200 code""); } } ``` Basically the about page now makes 3 outgoing http requests. When I run this application under some simulated load (around 3000 req/min) every now and then one of the httprequests fail with an HttpException. ### An error occurred while sending the request.The connection with the server was terminated abnormally > System.Net.Http.HttpRequestException: > at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e) > Inner exception System.Net.Http.WinHttpException handled at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw: > at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e) > at System.Threading.Tasks.RendezvousAwaitable`1.GetResult (System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a) > at System.Net.Http.WinHttpHandler+<StartRequest>d__105.MoveNext (System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a) I've cut out part of the outer exception stack trace as I doubt it's relevant, but let me know if you want to see it. I've skimmed through the source code and from the looks of it the problem arises from somewhere around here https://github.com/dotnet/corefx/blob/master/src/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpHandler.cs#L791 or here: https://github.com/dotnet/corefx/blob/master/src/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpHandler.cs#L824 I should also add that this happens very infrequently (while I was screen sharing with Azure support I ran 6000 requests over about 5 minutes and this happened 4 times) and immediately retrying the exact same requests works fine. Grateful if someone could try to shed some light on this. Many thanks! [EDIT] Add C# syntax highlighting by @karelz" 25950 area-System.IO Mark Write7BitEncodedInt and Read7BitEncodedInt as public 7-bits encoding are useful in many situations. Yet, the method [BinaryWriter.Write7BitEncodedInt(int)](https://msdn.microsoft.com/en-us/library/system.io.binarywriter.write7bitencodedint(v=vs.110).aspx) is `protected` (idem for [BinaryReader.Read7BitEncodedInt](https://msdn.microsoft.com/en-us/library/system.io.binaryreader.read7bitencodedint(v=vs.110).aspx)) are not public. As a result, codebases end-up implementing a variant of `DummyBinaryReader` just access through inheritance the two properties. It would be much nicer if those two methods could be made public directly. 25951 area-Meta Properly obsolete insecure types we no longer want people to use This is a placeholder for future work to be performed under the Security Epic. 25955 area-System.Diagnostics Add Command Line parser comment Add useful comment raised during code review by @AtsushiKan (https://github.com/dotnet/corefx/pull/21339#pullrequestreview-45963854). 25956 area-Infrastructure Update ILLink version. I verified that this causes no assembly trimming diffs. This change also exposes a new ILLink capability. Setting `ILLinkClearInitLocals=true` will cause the linker to clear initlocals flag on all methods. This is off by default and is exposed for perf experiments. 25958 area-System.Memory General code clean up of System.Memory - Use explicit type instead of var where type can't be inferred easily. - Removing unnecessary use of 'unsafe' keyword and generic type specifiers. As an aside, change comment in LinuxNetworkInterface.cs to the right type - OperationalStatus (to avoid confusion with OperationStatus) cc @KrzysztofCwalina, @jkotas, @stephentoub 25960 area-System.Runtime ASP.NET Core 2.0 using System.DirectoryServices.AccountManagement GroupPrincipal GetMembers Throws System.Exception: An operations error occurred. "Repo: https://github.com/benhysell/AspNetCoreGroupPrincipal Manual steps to reproduce: - Create empty ASP.NET Core 2.0 Template, select React/Redux - Add Microsoft.Windows.Compatibility 2.0.0-preview1-25914-04 to the project via NuGet - Replace ```Index``` on ```HomeController.cs``` with the following to trigger a lookup of all users in a group: ```c# public IActionResult Index() { using (var pc = new PrincipalContext(ContextType.Domain, ""YOUR_DOMAIN_HERE"", ""USERNAME"", ""PW"")) { SortedSet<string> ldapResults; using (var gp = GroupPrincipal.FindByIdentity(pc, IdentityType.Name, ""GROUP_TO_LOOKUP"")) { ldapResults = gp == null ? null : new SortedSet<string>(gp.GetMembers(true).Select(u => u.SamAccountName)); } } return View(); } ``` - Start debugging - Throws the following: ``` fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[0] An unhandled exception has occurred while executing the request System.Exception: An operations error occurred. at System.DirectoryServices.Interop.UnsafeNativeMethods.IAds.GetInfoEx(Object vProperties, Int32 lnReserved) at System.DirectoryServices.DirectoryEntry.RefreshCache(String[] propertyNames) at System.DirectoryServices.AccountManagement.RangeRetriever.GetNextChunk() at System.DirectoryServices.AccountManagement.RangeRetriever.MoveNext() at System.DirectoryServices.AccountManagement.ADDNLinkedAttrSet.GetNextEnum() at System.DirectoryServices.AccountManagement.ADDNLinkedAttrSet.MoveNextMemberEnum() at System.DirectoryServices.AccountManagement.ADDNLinkedAttrSet.MoveNext() at System.DirectoryServices.AccountManagement.FindResultEnumerator`1.MoveNext() at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext() at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source, Int32& length) at System.Collections.Generic.SortedSet`1..ctor(IEnumerable`1 collection, IComparer`1 comparer) at System.Collections.Generic.SortedSet`1..ctor(IEnumerable`1 collection) at AspNetCoreGroupPrinicipal.Controllers.HomeController.Index() in C:\jobs\AspNetCoreGroupPrinicipal\AspNetCoreGroupPrinicipal\Controllers\HomeController.cs:line 21 ``` Expected - Users are returned. Environment - Windows 10 dotnet --version 2.1.2 [EDIT] Add C# syntax highlighting by @karelz" 25962 area-System.Diagnostics Process pipes aren't garbage collected "@myrup commented on [Sat Dec 16 2017](https://github.com/dotnet/core/issues/1166) # Process pipes aren't garbage collected # General When using redirection for StandardOutput (and possibly StandardError, StandardInput as well) the pipes aren't garbage collected when the Process reference is collected. The following silly piece of code lives (probably) forever in mono, but crashes in dotnet after 217 iterations on my machine: ```c# public static void Main() { for (int i = 0; i < int.MaxValue; i++) { Process.Start(new ProcessStartInfo { FileName = ""ls"", UseShellExecute = false, RedirectStandardOutput = true }); Console.WriteLine(i); } } ``` Adding a ```.StandardOutput.Close()``` extends lifetime 5 fold, indicating other things are not being collected. ``` .NET Command Line Tools (2.0.2) Product Information: Version: 2.0.2 Commit SHA-1 hash: a04b4bf512 Runtime Environment: OS Name: Mac OS X OS Version: 10.13 OS Platform: Darwin RID: osx.10.12-x64 Base Path: /usr/local/share/dotnet/sdk/2.0.2/ Microsoft .NET Core Shared Framework Host Version : 2.0.0 Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d ``` [EDIT] Add C# syntax highlighting by @karelz" 25963 area-System.Reflection TypeDefinition.IsNested Property Closes #5377. First time PR, so here are some of the questions I wasn't sure of: * Property placement with struct definition for ref/ and src/. * Library version changes. * Need for tests for such a simple API addition. I wrote a few and put in a separate commit for easy reset. I tried reading contributing docs and applying anything relevant, as well as keeping codestyle consistent in the file. 25964 area-System.Memory Remove DangerousTryGetArray and hide DangerousGetPinnableReference Fixes: https://github.com/dotnet/corefx/issues/25412 https://github.com/dotnet/corefx/issues/25615 Also fixes https://github.com/dotnet/corefx/issues/23881 **Depends on the following PR (hence blocked):** https://github.com/dotnet/coreclr/pull/15557 Following the staging plan from here: https://github.com/dotnet/corefx/issues/23881#issuecomment-343767740 - [x] Add MemoryExtensions.GetReference/TryGetArray - [x] Convert all uses of DangerousGetPinnableReference/DangerousTryGetArray in coreclr, corefx, corert, corefxlab, aspnet, ... to MemoryExtensions.GetReference - [x] Change DangerousGetPinnableReference to whatever we like to make it fit the pinning pattern and remove DangerousTryGetArray. Doing it this way will avoid the need for complex staging or things being on the floor for extensive periods of time. cc @jkotas, @stephentoub, @KrzysztofCwalina, @davidfowl 25966 area-Serialization ASP.NET Core 2.0 WriteStartElementAsync in XmlDictionaryWriter "Hello! I`m trying to create a SOAP protocol middleware for ASP.NET Core based on [Microsoft article: Custom ASP.NET Core Middleware Example](https://blogs.msdn.microsoft.com/dotnet/2016/09/19/custom-asp-net-core-middleware-example/). And I ran into a problem of a WSDL generation. --- On the second line I get **`System.NotImplementedException: ""The method or operation is not implemented.""`** ``` await writer.WriteStartElementAsync(""xs"", ""schema"", http://www.w3.org/2001/XMLSchema""); await writer.WriteAttributeStringAsync(null, ""someName"", null,""someValue""); await writer.WriteEndElementAsync(); ``` --- If I use `writer.WriteAttributeString( ""someName"",""someValue"");` , it works fine. I saw [a few issues](https://github.com/dotnet/corefx/issues/18899) about` Async` methods in `XmlDictionaryWriter`, but there is nothing about `WriteAttributeStringAsync` Thanks! - dotnet --info ``` Product Information: Version: 2.1.2 Runtime Environment: OS Name: Windows OS Version: 10.0.16299 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\2.1.2\ Microsoft .NET Core Shared Framework Host Version : 2.0.3 ``` cc: @shmao " 25967 area-System.Runtime long.TryParse return false for negative numbers in ubuntu I have an asp core 1.1.5 app and I'm running it in Ubuntu with docker In Windows (Dev environment) It's OK but in Ubuntu I found that long.TryParse return false for negative inputs. I think its a bug currently I use this code to solve the problem: ```c# public static bool TryParseLong(string input, out long output) { var isNegetive = false; if (input[0] == '-') { input = input.Substring(1); isNegetive = true; } if (long.TryParse(input, out long longValue)) { if (isNegetive) { output = -longValue; } else { output = longValue; } return true; } output = 0; return false; } ``` [EDIT] Add C# syntax highlighting by @karelz 25968 area-System.Reflection [Reflection] typeof vs Type.GetType: return different result of .netfx and .net core "A console app: ``` static void Main(string[] args) { Console.WriteLine(""Type.GetType:"" + Type.GetType(""System.Environment"").GetProperty(""OSVersion"")); Console.WriteLine(""typeof: "" + typeof(System.Environment).GetProperty(""OSVersion"")); } ``` run under netcore: ``` C:\Work\Learn\dotnet\gettype>dotnet run --framework netcoreapp2.0 Type.GetType: typeof: System.OperatingSystem OSVersion ``` The same code under netfx returns: ``` C:\Work\Learn\dotnet\gettype>dotnet run --framework net462 typeof: System.OperatingSystem OSVersion Type.GetType:System.OperatingSystem OSVersion ```" 25970 area-System.Memory SpanHelpers IndexOfAny-methods use sentinel-value Instead of having _valueLength_-times an if-check in the loop, a sentinel value is used and hence only one final checks needs to done. Perf-win depends on the size of _valueLength_, the greater the more win. 25972 area-System.Linq Linq.Expressions.Tests: Assert failure: Thread::IsObjRefValid(&objref) testing against checked coreclr "Coreclr issue: https://github.com/dotnet/coreclr/issues/15537 though only happens for these tests Windows_NT x64 Checked corefx_baseline failure ``` Assert failure(PID 6704 [0x00001a30], Thread: 4120 [0x1018]): Thread::IsObjRefValid(&objref) 19:18:16 19:18:16 CORECLR! OBJECTREF::OBJECTREF + 0x11D (0x00007ffd`63f1505d) 19:18:16 CORECLR! ExceptionNative::GetStackTracesDeepCopy + 0x490 (0x00007ffd`64275a80) 19:18:16 SYSTEM.PRIVATE.CORELIB! <no symbol> + 0x0 (0x00007ffd`6389c6f7) 19:18:16 SYSTEM.PRIVATE.CORELIB! <no symbol> + 0x0 (0x00007ffd`6389c7ac) 19:18:16 <no module>! <no symbol> + 0x0 (0x00007ffd`0596fd2d) 19:18:16 <no module>! <no symbol> + 0x0 (0xffffffff`fffffffe) 19:18:16 <no module>! <no symbol> + 0x0 (0x000000fc`4589b450) 19:18:16 <no module>! <no symbol> + 0x0 (0x00000000`00000001) 19:18:16 CORECLR! GetClrDebugState + 0x23 (0x00007ffd`63e38c8f) 19:18:16 CORECLR! ENABLESTRESSHEAP + 0xE (0x00007ffd`63f188de) 19:18:16 File: d:\j\workspace\x64_checked_w---d7295605\src\vm\object.cpp Line: 2662 19:18:16 Image: D:\j\workspace\x64_checked_w---d7295605\_\fx\bin\testhost\netcoreapp-Windows_NT-Release-x64\dotnet.exe 19:18:16 19:18:16 Finished running tests. End time=19:18:16.96, Exit code = 123456789 19:18:16 D:\j\workspace\x64_checked_w---d7295605\_\fx\Tools\tests.targets(484,5): warning MSB3073: The command ""D:\j\workspace\x64_checked_w---d7295605\_\fx\bin/tests/System.Linq.Expressions.Tests/netcoreapp-Windows_NT-Release-x64//RunTests.cmd D:\j\workspace\x64_checked_w---d7295605\_\fx\bin/testhost/netcoreapp-Windows_NT-Release-x64/"" exited with code 123456789. [D:\j\workspace\x64_checked_w---d7295605\_\fx\src\System.Linq.Expressions\tests\System.Linq.Expressions.Tests.csproj] ```" 25973 area-System.Runtime Array.Sort of primitive array using Comparer.Default 100x slower compared to .NET Framework `Array.Sort(new int[1000000], System.Collections.Comparer.Default)` is ~100x slower on .NET Core vs. NET Framework. See discussion at https://github.com/dotnet/corefx/issues/25968#issuecomment-352402058. 25974 area-System.Numerics "Use ""in"" at Matrix4x4" It might be better to use in keyword at some methods of Matrix4x4 ## Benchmark ``` csharp static Matrix4x4 Add(Matrix4x4 value1, Matrix4x4 value2); static Matrix4x4 InAdd(in Matrix4x4 value1,in Matrix4x4 value2); static Matrix4x4 Multiply(Matrix4x4 value1, Matrix4x4 value2); static Matrix4x4 InMultiply(in Matrix4x4 value1, in Matrix4x4 value2); Matrix4x4 matrix_1; Matrix4x4 matrix_2; Matrix4x4 result; Matrix4x4 CreateRandom(); [GlobalSetup] public void SetUp() { matrix_1 = CreateRandom(); matrix_2 = CreateRandom(); } [Benchmark] public void Add() { result = Add(matrix_1, matrix_2); } [Benchmark] public void InAdd() { result = InAdd(matrix_1, matrix_2); } [Benchmark] public void Multiply() { result = Multiply(matrix_1, matrix_2); } [Benchmark] public void InMultiply() { result = InMultiply(matrix_1, matrix_2); } ``` ``` ini BenchmarkDotNet=v0.10.10, OS=Windows 10 Redstone 3 [1709, Fall Creators Update] (10.0.16299.125) Processor=Intel Core i7-7700K CPU 4.20GHz (Kaby Lake), ProcessorCount=8 .NET Core SDK=2.1.2 [Host] : .NET Core 2.0.3 (Framework 4.6.25815.02), 64bit RyuJIT [AttachedDebugger] DefaultJob : .NET Core 2.0.3 (Framework 4.6.25815.02), 64bit RyuJIT ``` | Method | Mean | Error | StdDev | |------- |---------:|----------:|----------:| | Add | 14.01 ns | 0.1274 ns | 0.1130 ns | | InAdd | 13.11 ns | 0.0094 ns | 0.0088 ns | | Multiply | 30.34 ns | 0.0397 ns | 0.0287 ns | | InMultiply | 29.36 ns | 0.1664 ns | 0.1557 ns | 25975 area-Serialization Don't directly throw Exception System.Private.Xml Contributes to #23748 . ```csharp System.Private.Xml/src/System/Xml/BinaryXml/XmlBinaryReader.cs:3217 --> #if DEBUG System.Private.Xml/src/System/Xml/BinaryXml/XmlBinaryReader.cs:3219 --> #if DEBUG System.Private.Xml/src/System/Xml/Serialization/XmlSerializationWriter.cs:1925 --> comment out ``` cc: @krwq, @pjanotti 25976 area-System.Net disable MulticastInterface_Set_AnyInterface_Succeeds while investigating failures on Fedora 25, Redhat 7.2 and 7.3 (#24114) They are probably caused by environment - packet filter rules as previous failures. 25977 area-System.Net Test failure: System.Net.Http.Functional.Tests.PostScenarioTest / PostUsingContentLengthSemantics_Success ## Type of failures ### The handle is invalid Failure [20171218.01](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171218.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.PostScenarioTest~2FPostUsingContentLengthSemantics_Success(serverUri:%20http:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)): ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.WinHttpException : The handle is invalid at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() in E:\A\_work\888\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 464 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.PostScenarioTest.<PostHelper>d__24.MoveNext() in E:\A\_work\888\s\corefx\src\System.Net.Http\tests\FunctionalTests\PostScenarioTest.cs:line 204 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.PostScenarioTest.<PostUsingContentLengthSemantics_Success>d__13.MoveNext() in E:\A\_work\888\s\corefx\src\System.Net.Http\tests\FunctionalTests\PostScenarioTest.cs:line 79 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Net.Http.WinHttpException.ThrowExceptionUsingLastError() in E:\A\_work\888\s\corefx\src\Common\src\System\Net\Http\WinHttpException.cs:line 44 at System.Net.Http.WinHttpHandler.SetRequestHandleRedirectionOptions(SafeWinHttpHandle requestHandle) in E:\A\_work\888\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 1073 at System.Net.Http.WinHttpHandler.SetRequestHandleOptions(WinHttpRequestState state) in E:\A\_work\888\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 956 at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext() in E:\A\_work\888\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 831 ``` ### A certificate is required to complete client authentication Failure [20171128.01](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171128.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.PostScenarioTest~2FPostUsingContentLengthSemantics_Success(serverUri:%20http:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)): ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.WinHttpException : A certificate is required to complete client authentication at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() in E:\A\_work\798\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 464 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.PostScenarioTest.<PostHelper>d__24.MoveNext() in E:\A\_work\798\s\corefx\src\System.Net.Http\tests\FunctionalTests\PostScenarioTest.cs:line 204 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.PostScenarioTest.<PostUsingContentLengthSemantics_Success>d__13.MoveNext() in E:\A\_work\798\s\corefx\src\System.Net.Http\tests\FunctionalTests\PostScenarioTest.cs:line 79 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Threading.Tasks.RendezvousAwaitable`1.GetResult() in E:\A\_work\798\s\corefx\src\Common\src\System\Threading\Tasks\RendezvousAwaitable.cs:line 62 at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext() in E:\A\_work\798\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 856 ``` ### The operation has been canceled Failure [20171127.02](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171127.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.PostScenarioTest~2FPostUsingContentLengthSemantics_Success(serverUri:%20http:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)): ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.WinHttpException : The operation has been canceled at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() in E:\A\_work\686\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 464 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.PostScenarioTest.<PostHelper>d__24.MoveNext() in E:\A\_work\686\s\corefx\src\System.Net.Http\tests\FunctionalTests\PostScenarioTest.cs:line 204 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.PostScenarioTest.<PostUsingContentLengthSemantics_Success>d__13.MoveNext() in E:\A\_work\686\s\corefx\src\System.Net.Http\tests\FunctionalTests\PostScenarioTest.cs:line 79 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Threading.Tasks.RendezvousAwaitable`1.GetResult() in E:\A\_work\686\s\corefx\src\Common\src\System\Threading\Tasks\RendezvousAwaitable.cs:line 62 at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext() in E:\A\_work\686\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 858 ``` ### IOException: The handle is invalid Failure [20171117.04](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171117.04/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.PostScenarioTest~2FPostUsingContentLengthSemantics_Success(serverUri:%20https:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)): ``` System.Net.Http.HttpRequestException : Error while copying content to a stream. ---- System.IO.IOException : The write operation failed, see inner exception. -------- System.Net.Http.WinHttpException : The handle is invalid at System.Net.Http.HttpContent.<CopyToAsyncCore>d__45.MoveNext() in E:\A\_work\708\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpContent.cs:line 340 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.WinHttpHandler.<InternalSendRequestBodyAsync>d__131.MoveNext() in E:\A\_work\708\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 1359 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext() in E:\A\_work\708\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 863 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() in E:\A\_work\708\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 464 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.PostScenarioTest.<PostHelper>d__24.MoveNext() in E:\A\_work\708\s\corefx\src\System.Net.Http\tests\FunctionalTests\PostScenarioTest.cs:line 204 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.PostScenarioTest.<PostUsingContentLengthSemantics_Success>d__13.MoveNext() in E:\A\_work\708\s\corefx\src\System.Net.Http\tests\FunctionalTests\PostScenarioTest.cs:line 79 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Net.Http.HttpContent.<CopyToAsyncCore>d__45.MoveNext() in E:\A\_work\708\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpContent.cs:line 336 ----- Inner Stack Trace ----- ``` ### A security error occurred Failure [20171030.05](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171030.05/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.PostScenarioTest~2FPostUsingContentLengthSemantics_Success(serverUri:%20https:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)): ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.WinHttpException : A security error occurred at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() in E:\A\_work\1541\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 464 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.PostScenarioTest.<PostHelper>d__24.MoveNext() in E:\A\_work\1541\s\corefx\src\System.Net.Http\tests\FunctionalTests\PostScenarioTest.cs:line 204 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.PostScenarioTest.<PostUsingContentLengthSemantics_Success>d__13.MoveNext() in E:\A\_work\1541\s\corefx\src\System.Net.Http\tests\FunctionalTests\PostScenarioTest.cs:line 79 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Threading.Tasks.RendezvousAwaitable`1.GetResult() in E:\A\_work\1541\s\corefx\src\Common\src\System\Threading\Tasks\RendezvousAwaitable.cs:line 62 at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext() in E:\A\_work\1541\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 856 ``` ### The handle is in the wrong state for the requested operation Failure [20171025.04](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171025.04/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.PostScenarioTest~2FPostUsingContentLengthSemantics_Success(serverUri:%20https:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)): ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.WinHttpException : The handle is in the wrong state for the requested operation at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.Http.Functional.Tests.PostScenarioTest.<PostHelper>d__24.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.Http.Functional.Tests.PostScenarioTest.<PostUsingContentLengthSemantics_Success>d__13.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) ----- Inner Stack Trace ----- at System.Net.Http.WinHttpException.ThrowExceptionUsingLastError() at System.Net.Http.WinHttpHandler.SetRequestHandleClientCertificateOptions(SafeWinHttpHandle requestHandle, Uri requestUri) at System.Net.Http.WinHttpHandler.SetRequestHandleOptions(WinHttpRequestState state) at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext() ``` ## History of failures Day | Build | OS | Details -- | -- | -- | -- 9/25 | 20170925.03 | Win7 | The operation has been canceled 10/4 | 20171004.01 | Win7 | The operation has been canceled 10/25 | 20171025.04 | Win7 | The handle is in the wrong state for the requested operation - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171025.04/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.PostScenarioTest~2FPostUsingContentLengthSemantics_Success(serverUri:%20https:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)) 10/27 | 20171027.03 | Win7 | The handle is invalid 10/31 | 20171030.05 | Win7 | A security error occurred - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171030.05/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.PostScenarioTest~2FPostUsingContentLengthSemantics_Success(serverUri:%20https:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)) 11/17 | 20171117.04 | Win7 | IOException: The handle is invalid - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171117.04/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.PostScenarioTest~2FPostUsingContentLengthSemantics_Success(serverUri:%20https:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)) 11/27 | 20171127.02 | Win7 | The operation has been canceled - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171127.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.PostScenarioTest~2FPostUsingContentLengthSemantics_Success(serverUri:%20http:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)) 11/28 | 20171128.01 | Win7 | A certificate is required to complete client authentication - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171128.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.PostScenarioTest~2FPostUsingContentLengthSemantics_Success(serverUri:%20http:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)) 12/18 | 20171218.01 | Win7 | The handle is invalid - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171218.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.PostScenarioTest~2FPostUsingContentLengthSemantics_Success(serverUri:%20http:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)) 12/22 | 20171222.02 | Win8.1 | The operation has been canceled - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171222.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.PostScenarioTest~2FPostUsingContentLengthSemantics_Success(serverUri:%20http:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)) 1/11 | 20180111.01 | Win7 | The operation has been canceled - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180111.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.PostScenarioTest~2FPostUsingContentLengthSemantics_Success(serverUri:%20http:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)) 1/19 | 20180119.04 | Win7 | The handle is invalid - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180119.04/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.PostScenarioTest~2FPostUsingContentLengthSemantics_Success(serverUri:%20http:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)) 2/6 | 20180206.04 | Win7 | The handle is in the wrong state for the requested operation - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180206.04/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.PostScenarioTest~2FPostUsingContentLengthSemantics_Success(serverUri:%20https:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)) 2/6 | 20180206.05 | Win7 | The operation has been canceled - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180206.05/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.PostScenarioTest~2FPostUsingContentLengthSemantics_Success(serverUri:%20http:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)) 25978 area-System.Diagnostics Throw ArgumentException for non-absolute path in GetVersionInfo For issue https://github.com/dotnet/corefx/issues/281 @jkotas PTAL - is this the right fix? The added test is passing locally. Also CC @morganbr in case there are any related security issues. 25979 area-System.Net Test failure: System.Net.Sockets.Tests.SendFileTest / SendFile_APM ## Type of failures ### WhenAllOrAnyFailed timed out after 30000 Failure [20171213.05](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171213.05/workItem/System.Net.Sockets.Tests/analysis/xunit/System.Net.Sockets.Tests.SendFileTest~2FSendFile_APM(listenAt:%20127.0.0.1,%20sendPreAndPostBuffers:%20False,%20bytesToSend:%20512)): ``` System.TimeoutException : WhenAllOrAnyFailed timed out after 30000 at System.Threading.Tasks.TaskTimeoutExtensions.<WhenAllOrAnyFailed>d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Net.Sockets.Tests.SendFileTest.<SendFile_APM>d__7.MoveNext() in E:\A\_work\1400\s\corefx\src\System.Net.Sockets\tests\FunctionalTests\SendFile.cs:line 234 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ``` ### Neither client nor server task completed within allowed time Before `SendFile_APM` test change in https://github.com/dotnet/corefx/commit/779171fea3d9f0b25d4058e281ca05b2b6eec323#diff-479492e701f07787f80f44f18ef076f8 on 2017/11/21 Failures [20171022.02](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171022.02/workItem/System.Net.Sockets.Tests/analysis/xunit/System.Net.Sockets.Tests.SendFileTest~2FSendFile_APM(listenAt:%20127.0.0.1,%20sendPreAndPostBuffers:%20False,%20bytesToSend:%20512)): ``` Neither client nor server task completed within allowed time Expected: True Actual: False at System.Net.Sockets.Tests.SendFileTest.SendFile_APM(IPAddress listenAt, Boolean sendPreAndPostBuffers, Int32 bytesToSend) in /root/corefx-1079212/src/System.Net.Sockets/tests/FunctionalTests/SendFile.cs:line 233 ``` ## History of failures Day | Build | OS | Error message -- | -- | -- | -- 7/11 | 20170711.04 | OSX10.13 | Neither client nor server task completed within allowed time 9/4 | 20170904.01 | OSX10.12 | Neither client nor server task completed within allowed time 10/22 | 20171022.02 | RedHat69 | Neither client nor server task completed within allowed time - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171022.02/workItem/System.Net.Sockets.Tests/analysis/xunit/System.Net.Sockets.Tests.SendFileTest~2FSendFile_APM(listenAt:%20127.0.0.1,%20sendPreAndPostBuffers:%20False,%20bytesToSend:%20512)) 11/21 | N/A | N/A | Assert changed into TimeoutException in https://github.com/dotnet/corefx/commit/779171fea3d9f0b25d4058e281ca05b2b6eec323#diff-479492e701f07787f80f44f18ef076f8 12/1 | 20171201.03 | Win7 | WhenAllOrAnyFailed timed out after 30000 12/8 | 20171208.01 | Win8.1 | WhenAllOrAnyFailed timed out after 30000 12/10 | 20171210.03 | Win8.1 | WhenAllOrAnyFailed timed out after 30000 12/12 | 20171212.03 | Win10 | WhenAllOrAnyFailed timed out after 30000 12/13 | 20171213.05 | Win7 | WhenAllOrAnyFailed timed out after 30000 - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171213.05/workItem/System.Net.Sockets.Tests/analysis/xunit/System.Net.Sockets.Tests.SendFileTest~2FSendFile_APM(listenAt:%20127.0.0.1,%20sendPreAndPostBuffers:%20False,%20bytesToSend:%20512)) 12/28 | 20171228.01 | Win8.1 | WhenAllOrAnyFailed timed out after 30000 - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171228.01/workItem/System.Net.Sockets.Tests/analysis/xunit/System.Net.Sockets.Tests.SendFileTest~2FSendFile_APM(listenAt:%20127.0.0.1,%20sendPreAndPostBuffers:%20False,%20bytesToSend:%2012345678)) 12/30 | 20171230.02 | Win7 | WhenAllOrAnyFailed timed out after 30000 - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171230.02/workItem/System.Net.Sockets.Tests/analysis/xunit/System.Net.Sockets.Tests.SendFileTest~2FSendFile_APM(listenAt:%20127.0.0.1,%20sendPreAndPostBuffers:%20False,%20bytesToSend:%2012345678)) 1/4 | 20180104.02 | Win10 | WhenAllOrAnyFailed timed out after 30000 - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180104.02/workItem/System.Net.Sockets.Tests/analysis/xunit/System.Net.Sockets.Tests.SendFileTest~2FSendFile_APM(listenAt:%20127.0.0.1,%20sendPreAndPostBuffers:%20False,%20bytesToSend:%2012345678)) 1/23 | 20180123.04 | Win7 | WhenAllOrAnyFailed timed out after 30000 - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180123.04/workItem/System.Net.Sockets.Tests/analysis/xunit/System.Net.Sockets.Tests.SendFileTest~2FSendFile_APM(listenAt:%20127.0.0.1,%20sendPreAndPostBuffers:%20True,%20bytesToSend:%201024)) 3/13 | 20180313.03 | Win8.1 | WhenAllOrAnyFailed timed out after 30000 3/16 | 20180316.01 | Win7 | WhenAllOrAnyFailed timed out after 30000 3/22 | 20180322.01 | Win8.1 | WhenAllOrAnyFailed timed out after 30000 3/22 | 20180322.06 | Win10 | WhenAllOrAnyFailed timed out after 30000 Timeout similar to #25894, started around same time. Sometimes correlated failures (12/28, 12/13). 25980 area-System.Net Test failure: System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test / GetAsync_AllowedSSLVersion_Succeeds ## Type of failures ### The operation has been canceled Failure [20171213.08](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171213.08/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test~2FGetAsync_AllowedSSLVersion_Succeeds(acceptedProtocol:%20Tls12,%20requestOnlyThisProtocol:%20False)): ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.WinHttpException : The operation has been canceled at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() in E:\A\_work\1811\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 464 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test.<>c__DisplayClass4_1.<<GetAsync_AllowedSSLVersion_Succeeds>b__0>d.MoveNext() in E:\A\_work\1811\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.SslProtocols.cs:line 119 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.<>c__DisplayClass3_0.<CreateServerAsync>b__0(Task t) in E:\A\_work\1811\s\corefx\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 67 at System.Threading.Tasks.ContinuationTaskFromTask.InnerInvoke() in E:\A\_work\1993\s\src\mscorlib\src\System\Threading\Tasks\TaskContinuation.cs:line 59 at System.Threading.Tasks.Task.<>c.<.cctor>b__278_1(Object obj) in E:\A\_work\1993\s\src\mscorlib\src\System\Threading\Tasks\Task.cs:line 2480 at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) in E:\A\_work\1993\s\src\mscorlib\shared\System\Threading\ExecutionContext.cs:line 151 at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) in E:\A\_work\1993\s\src\mscorlib\src\System\Threading\Tasks\Task.cs:line 2440 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test.<GetAsync_AllowedSSLVersion_Succeeds>d__4.MoveNext() in E:\A\_work\1811\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.SslProtocols.cs:line 117 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Threading.Tasks.RendezvousAwaitable`1.GetResult() in E:\A\_work\1811\s\corefx\src\Common\src\System\Threading\Tasks\RendezvousAwaitable.cs:line 62 at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext() in E:\A\_work\1811\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 856 ``` ### The handle is invalid Failure [20171120.02](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171120.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test~2FGetAsync_AllowedSSLVersion_Succeeds(acceptedProtocol:%20Tls12,%20requestOnlyThisProtocol:%20False)): ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.WinHttpException : The handle is invalid at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() in E:\A\_work\1456\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 464 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test.<>c__DisplayClass4_1.<<GetAsync_AllowedSSLVersion_Succeeds>b__0>d.MoveNext() in E:\A\_work\1456\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.SslProtocols.cs:line 119 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.<>c__DisplayClass3_0.<CreateServerAsync>b__0(Task t) in E:\A\_work\1456\s\corefx\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 67 at System.Threading.Tasks.ContinuationTaskFromTask.InnerInvoke() in E:\A\_work\1762\s\src\mscorlib\src\System\Threading\Tasks\TaskContinuation.cs:line 59 at System.Threading.Tasks.Task.<>c.<.cctor>b__278_1(Object obj) in E:\A\_work\1762\s\src\mscorlib\src\System\Threading\Tasks\Task.cs:line 2480 at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) in E:\A\_work\1762\s\src\mscorlib\shared\System\Threading\ExecutionContext.cs:line 151 at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) in E:\A\_work\1762\s\src\mscorlib\src\System\Threading\Tasks\Task.cs:line 2440 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test.<GetAsync_AllowedSSLVersion_Succeeds>d__4.MoveNext() in E:\A\_work\1456\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.SslProtocols.cs:line 117 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Net.Http.WinHttpException.ThrowExceptionUsingLastError() in E:\A\_work\1456\s\corefx\src\Common\src\System\Net\Http\WinHttpException.cs:line 44 at System.Net.Http.WinHttpHandler.SetRequestHandleRedirectionOptions(SafeWinHttpHandle requestHandle) in E:\A\_work\1456\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 1073 at System.Net.Http.WinHttpHandler.SetRequestHandleOptions(WinHttpRequestState state) in E:\A\_work\1456\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 956 at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext() in E:\A\_work\1456\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 831 ``` ### The handle is in the wrong state for the requested operation Failure [20171010.01](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171010.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test~2FGetAsync_AllowedSSLVersion_Succeeds(acceptedProtocol:%20Tls,%20requestOnlyThisProtocol:%20False)): ``` ystem.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.WinHttpException : The handle is in the wrong state for the requested operation at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test.<>c__DisplayClass4_1.<<GetAsync_AllowedSSLVersion_Succeeds>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.Test.Common.LoopbackServer.<>c__DisplayClass3_0.<CreateServerAsync>b__0(Task t) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test.<GetAsync_AllowedSSLVersion_Succeeds>d__4.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) ----- Inner Stack Trace ----- at System.Net.Http.WinHttpException.ThrowExceptionUsingLastError() at System.Net.Http.WinHttpHandler.SetRequestHandleOptions(WinHttpRequestState state) at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext() ``` ## History of failures Day | Build | OS | Error message -- | -- | -- | -- 5/2 | 20170502.03 | Win7 | System.ComponentModel.Win32Exception : The credentials supplied to the package were not recognized - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20170502.03/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test~2FGetAsync_AllowedSSLVersion_Succeeds(acceptedProtocol:%20Tls,%20requestOnlyThisProtocol:%20False)) 5/10 | 20170510.01 | Win7 | The handle is invalid 5/11 | 20170511.01 | Win7 | The handle is invalid 9/27 | 20170927.01 | Win7 | System.IO.IOException : Authentication failed because the remote party has closed the transport stream. 9/27 | 20170927.01 | Win7 | The handle is in the wrong state for the requested operation 10/9 | 20171009.04 | Win7 | The operation has been canceled 10/10 | 20171010.01 | Win7 | The handle is in the wrong state for the requested operation - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171010.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test~2FGetAsync_AllowedSSLVersion_Succeeds(acceptedProtocol:%20Tls,%20requestOnlyThisProtocol:%20False)) 10/15 | 20171015.02 | Win7 | The operation has been canceled 11/2 | 20171102.06 | Win8.1 | The operation has been canceled 11/7 | 20171107.02 | Win8.1 | The operation has been canceled 11/16 | 20171116.01 | Win8.1 | The operation has been canceled 11/20 | 20171120.02 | Win7 | The handle is invalid - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171120.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test~2FGetAsync_AllowedSSLVersion_Succeeds(acceptedProtocol:%20Tls12,%20requestOnlyThisProtocol:%20False)) 12/12 | 20171212.03 | Win7 | The operation has been canceled 12/13 | 20171213.08 | Win7 | The operation has been canceled - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171213.08/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test~2FGetAsync_AllowedSSLVersion_Succeeds(acceptedProtocol:%20Tls12,%20requestOnlyThisProtocol:%20False)) 1/4 | 20180104.04 | Win7 | The operation has been canceled - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180104.04/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test~2FGetAsync_AllowedSSLVersion_Succeeds(acceptedProtocol:%20Tls12,%20requestOnlyThisProtocol:%20False)) 1/19 | 20180119.02 | Win7 | The handle is in the wrong state for the requested operation - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180119.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test~2FGetAsync_AllowedSSLVersion_Succeeds(acceptedProtocol:%20Tls,%20requestOnlyThisProtocol:%20False)) 1/19 | 20180119.02 | Win7 | The handle is invalid - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180119.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test~2FGetAsync_AllowedSSLVersion_Succeeds(acceptedProtocol:%20Tls11,%20requestOnlyThisProtocol:%20False)) 1/19 | 20180119.02 | Win7 | System.IO.IOException: Authentication failed because the remote party has closed the transport stream. - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180119.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test~2FGetAsync_AllowedSSLVersion_Succeeds(acceptedProtocol:%20Tls,%20requestOnlyThisProtocol:%20True)) 2/6 | 20180206.04 | Win7 | The operation has been canceled - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180206.04/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test~2FGetAsync_AllowedSSLVersion_Succeeds(acceptedProtocol:%20Tls11,%20requestOnlyThisProtocol:%20True)) 2/26 | 20180226.04 | Win7 | The handle is invalid - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180226.04/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test~2FGetAsync_AllowedSSLVersion_Succeeds(acceptedProtocol:%20Tls11,%20requestOnlyThisProtocol:%20True)) 2/27 | 20180227.02 | Win7 | The operation has been canceled - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180227.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test~2FGetAsync_AllowedSSLVersion_Succeeds(acceptedProtocol:%20Tls,%20requestOnlyThisProtocol:%20False)) Similar exceptions / errors as in #25896 and #25902 and #25912 25981 area-System.Net Test failure: System.Net.Http.Functional.Tests.ResponseStreamTest / GetStreamAsync_ReadToEnd_Success ## Types of failures ### The handle is invalid Failure [20171215.09](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171215.09/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.ResponseStreamTest~2FGetStreamAsync_ReadToEnd_Success(readMode:%202)): ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.WinHttpException : The handle is invalid at System.Net.Http.HttpClient.<FinishSendAsyncUnbuffered>d__59.MoveNext() in E:\A\_work\1212\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 489 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.HttpClient.<FinishGetStreamAsync>d__33.MoveNext() in E:\A\_work\1212\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 252 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.ResponseStreamTest.<GetStreamAsync_ReadToEnd_Success>d__2.MoveNext() in E:\A\_work\1212\s\corefx\src\System.Net.Http\tests\FunctionalTests\ResponseStreamTest.cs:line 43 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Net.Http.WinHttpHandler.InternalReceiveResponseHeadersAsync(WinHttpRequestState state) in E:\A\_work\1212\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 1369 at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext() in E:\A\_work\1212\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 863 ``` ### The operation has been canceled Failure [20171201.01](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171201.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.ResponseStreamTest~2FGetStreamAsync_ReadToEnd_Success(readMode:%204)): ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.WinHttpException : The operation has been canceled at System.Net.Http.HttpClient.<FinishSendAsyncUnbuffered>d__59.MoveNext() in E:\A\_work\327\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 489 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.HttpClient.<FinishGetStreamAsync>d__33.MoveNext() in E:\A\_work\327\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 252 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.ResponseStreamTest.<GetStreamAsync_ReadToEnd_Success>d__2.MoveNext() in E:\A\_work\327\s\corefx\src\System.Net.Http\tests\FunctionalTests\ResponseStreamTest.cs:line 43 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Threading.Tasks.RendezvousAwaitable`1.GetResult() in E:\A\_work\327\s\corefx\src\Common\src\System\Threading\Tasks\RendezvousAwaitable.cs:line 62 at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext() in E:\A\_work\327\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 858 ``` ## History of failures Day | Build | OS | Error message -- | -- | -- | -- 9/27 | 20170927.01 | Win7 | The operation has been canceled 10/10 | 20171010.03 | Win7 | The handle is invalid 11/7 | 20171107.04 | Win8.1 | The operation has been canceled 11/13 | 20171112.01 | Win7 | The operation has been canceled 11/16 | 20171116.54 | Win7 | The operation has been canceled 12/1 | 20171201.01 | Win7 | The operation has been canceled - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171201.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.ResponseStreamTest~2FGetStreamAsync_ReadToEnd_Success(readMode:%204)) 12/12 | 20171212.02 | Win7 | The handle is invalid 12/15 | 20171215.09 | Win7 | The handle is invalid - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171215.09/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.ResponseStreamTest~2FGetStreamAsync_ReadToEnd_Success(readMode:%202)) 2/6 | 20180206.04 | Win7 | The operation has been canceled - only in [catastrophic failure logs](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180206.04/workItem/System.Net.Http.Functional.Tests/wilogs) 2/7 | 20180207.02 | Win7 | The operation has been canceled - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180207.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.ResponseStreamTest~2FGetStreamAsync_ReadToEnd_Success(readMode:%202)) 2/26 | 20180226.02 | Win10 | The operation has been canceled - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180226.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.ResponseStreamTest~2FGetStreamAsync_ReadToEnd_Success(readMode:%201)) 3/1 | 20180301.06 | Win10 | The operation has been canceled 3/6 | 20180306.02 | Win10 | The operation has been canceled 3/8 | 20180308.06 | Win8.1 | The operation has been canceled Similar exceptions / errors as in #25896 and #25902 and #25912 25982 area-System.Security Make GeneralizedTime correctly read down to the tick TimeSpan.From* rounds to the millisecond, but the writer is 10000x as precise, so make the reader be as precise as the writer. For future work around cryptographic timestamps the microseconds and hundred-nanoseconds might be relevant. 25983 area-System.Net Test failure: System.Net.Http.Functional.Tests.HttpClientHandler_DefaultProxyCredentials_Test / ProxyExplicitlyProvided_DefaultCredentials_Ignored ## Types of failures ### The operation has been canceled Failure [20171215.05](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171215.05/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_DefaultProxyCredentials_Test~2FProxyExplicitlyProvided_DefaultCredentials_Ignored): ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.WinHttpException : The operation has been canceled at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() in E:\A\_work\1955\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 464 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.LoopbackGetRequestHttpProxy.<StartAsync>d__2.MoveNext() in E:\A\_work\1955\s\corefx\src\System.Net.Http\tests\FunctionalTests\LoopbackGetRequestHttpProxy.cs:line 100 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpClientHandler_DefaultProxyCredentials_Test.<ProxyExplicitlyProvided_DefaultCredentials_Ignored>d__2.MoveNext() in E:\A\_work\1955\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.DefaultProxyCredentials.cs:line 69 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Threading.Tasks.RendezvousAwaitable`1.GetResult() in E:\A\_work\1955\s\corefx\src\Common\src\System\Threading\Tasks\RendezvousAwaitable.cs:line 62 at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext() in E:\A\_work\1955\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 858 ``` ## History of failures Previously, the test was failing (on .NET Core) on different error: https://github.com/dotnet/corefx/issues/23702#issuecomment-352601673 Day | Build | OS | Error message -- | -- | -- | -- 12/15 | 20171215.05 | Win8.1 | The operation has been canceled - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171215.05/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_DefaultProxyCredentials_Test~2FProxyExplicitlyProvided_DefaultCredentials_Ignored) 12/16 | 20171216.01 | Win8.1 | The operation has been canceled - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171216.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.ManagedHandler_HttpClientHandler_DefaultProxyCredentials_Test~2FProxyExplicitlyProvided_DefaultCredentials_Ignored) (ManagedHandler) 2/9 | 20180209.05 | Win8.1 | The operation has been canceled - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180209.05/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_DefaultProxyCredentials_Test~2FProxyExplicitlyProvided_DefaultCredentials_Ignored) One of the failures is on MangedHandler - most likely a test issue. 25984 area-System.Net Test failure: System.Net.Tests.SyncWebClientTest / OpenWrite_Success ## Type of failures ### CurlException: SSL connect error Build 20171210.01 (Fedora26): ``` System.Net.WebException : An error occurred while sending the request. SSL connect error ---- System.Net.Http.HttpRequestException : An error occurred while sending the request. -------- System.Net.Http.CurlException : SSL connect error at System.Net.HttpWebRequest.GetResponse() in /root/corefx-1210471/src/System.Net.Requests/src/System/Net/HttpWebRequest.cs:line 1014 at System.Net.WebClient.GetWebResponse(WebRequest request) in /root/corefx-1210471/src/System.Net.WebClient/src/System/Net/WebClient.cs:line 249 at System.Net.WebClient.WebClientWriteStream.Dispose(Boolean disposing) in /root/corefx-1210471/src/System.Net.WebClient/src/System/Net/WebClient.cs:line 1977 at System.IO.Stream.Close() in /root/coreclr/src/mscorlib/src/System/IO/Stream.cs:line 240 at System.Net.Tests.WebClientTestBase.<OpenWrite_Success>d__19.MoveNext() in /root/corefx-1210471/src/System.Net.WebClient/tests/WebClientTest.cs:line 631 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Net.Http.HttpClient.<FinishSendAsyncUnbuffered>d__59.MoveNext() in /root/corefx-1210471/src/System.Net.Http/src/System/Net/Http/HttpClient.cs:line 489 --- End of stack trace from previous location where exception was thrown --- at System.Net.HttpWebRequest.<SendRequest>d__194.MoveNext() in /root/corefx-1210471/src/System.Net.Requests/src/System/Net/HttpWebRequest.cs:line 1209 --- End of stack trace from previous location where exception was thrown --- at System.Net.HttpWebRequest.GetResponse() in /root/corefx-1210471/src/System.Net.Requests/src/System/Net/HttpWebRequest.cs:line 1009 ----- Inner Stack Trace ----- at System.Net.Http.CurlHandler.ThrowIfCURLEError(CURLcode error) in /root/corefx-1210471/src/System.Net.Http/src/System/Net/Http/Unix/CurlHandler.cs:line 663 at System.Net.Http.CurlHandler.MultiAgent.FinishRequest(StrongToWeakReference`1 easyWrapper, CURLcode messageResult) in /root/corefx-1210471/src/System.Net.Http/src/System/Net/Http/Unix/CurlHandler.MultiAgent.cs:line 883 ``` ## History of failures Day | Build | OS | Error message -- | -- | -- | -- 9/3 | 20170903.01 | Ubuntu17.04 | System.Net.WebException : The operation has timed out. 10/9 | 20171009.04 | Fedora25 | CurlException: SSL connect error 10/24 | 20171024.02 | Fedora26 | CurlException: SSL connect error 11/3 | 20171103.01 | Fedora26 | CurlException: SSL connect error 11/4 | 20171104.04 | Fedora26 | CurlException: SSL connect error 11/8 | 20171108.02 | Fedora25 | CurlException: SSL connect error 11/16 | 20171116.51 | Fedora26 | CurlException: SSL connect error 12/10 | 20171210.01 | Fedora26 | CurlException: SSL connect error 25985 area-System.Security Enable ECDH cipher suites as preferred cipher for key agreement. cc @bartonjs Do you know of any test servers for TLS that has tools to see which cipher was chosen during handshake for validating this change? @morganbr How did you find this bug, if you used some test app, can you share it? addresses #24648 cc @karelz Should a separate issue be opened for tracking to port this to 2.0? 25986 area-Meta Replace HashHelpers.Combine with HashCode.Combine `System.HashCode` was recently added in order to make high-quality fast hashing easy. We should replace usage of `HashHelpers.Combine`, an internal low-quality hash combiner with `HashCode.Combine`. It should lead to better distribution in dictionaries and the hashing should be nearly as fast. See: https://github.com/dotnet/coreclr/issues/15508 25987 area-Meta Replace HashHelpers.Combine with HashCode.Combine Fixes #25986 All instances of HashHelpers.Combine and NumericsHelpers.CombineHash have been replaced. Copied code has also been replaced as far as grep is concerned. The helpers have been deleted. 25988 area-System.Net NTLM authentication HttpClient in Core "I am trying to use the HttpClient to access a REST service which requires NTLM authentication. However I keep getting a 401 Unauthorized. My code looks like this ```c# private static void Main() { var uri = new Uri(""http://localhost:15001""); var credentialsCache = new CredentialCache { { uri, ""NTLM"", CredentialCache.DefaultNetworkCredentials } }; var handler = new HttpClientHandler { Credentials = credentialsCache }; var httpClient = new HttpClient(handler) { BaseAddress = uri, Timeout = new TimeSpan(0, 0, 10) }; httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(""application/json"")); var response = httpClient.GetAsync(""api/MyMethod"").Result; } ``` My target framework is netcoreapp2.0. If I change to net461, it will work. Not sure what I am doing wrong? [EDIT] Add C# syntax highlighting by @karelz" 25989 area-System.Memory Span: BinarySearch add Array baseline perf tests and remove TODO comments Some leftover work from https://github.com/dotnet/corefx/pull/25777 Added BinarySearch perf tests using `Array.BinarySearch` for comparison as suggested by @ahsonkhan CC: @KrzysztofCwalina From this it can be seen there are significant performance improvements when compare is fast i.e. for `int`, this is due to the improvements in the actual binary search code for Span. Test Name | Metric | Iterations | AVERAGE | STDEV.S | MIN | MAX :--------------------------------------------------------------------------------------------------------- |:-------- |:----------:| ----------:| ----------:| ----------:| --------: ArrayBinarySearch_Int_FirstIndex(size: 1) | Duration | 100 | 1.410 | 0.025 | 1.310 | 1.478 ArrayBinarySearch_Int_FirstIndex(size: 10) | Duration | 100 | 1.780 | 0.042 | 1.681 | 1.889 ArrayBinarySearch_Int_FirstIndex(size: 100) | Duration | 100 | 2.083 | 0.044 | 2.014 | 2.177 ArrayBinarySearch_Int_FirstIndex(size: 1000) | Duration | 100 | 2.627 | 0.244 | 2.424 | 4.606 ArrayBinarySearch_Int_LastIndex(size: 1) | Duration | 100 | 1.361 | 0.039 | 1.308 | 1.491 ArrayBinarySearch_Int_LastIndex(size: 10) | Duration | 100 | 1.983 | 0.051 | 1.901 | 2.115 ArrayBinarySearch_Int_LastIndex(size: 100) | Duration | 100 | 2.730 | 0.061 | 2.586 | 2.857 ArrayBinarySearch_Int_LastIndex(size: 1000) | Duration | 100 | 3.129 | 0.062 | 2.955 | 3.246 ArrayBinarySearch_Int_MiddleIndex(size: 1) | Duration | 100 | 1.372 | 0.042 | 1.320 | 1.530 ArrayBinarySearch_Int_MiddleIndex(size: 10) | Duration | 100 | 1.362 | 0.031 | 1.318 | 1.455 ArrayBinarySearch_Int_MiddleIndex(size: 100) | Duration | 100 | 1.362 | 0.032 | 1.322 | 1.464 ArrayBinarySearch_Int_MiddleIndex(size: 1000) | Duration | 100 | 1.290 | 0.300 | 0.000 | 1.490 ArrayBinarySearch_Int_NotFoundAfter(size: 1) | Duration | 100 | 1.453 | 0.033 | 1.364 | 1.534 ArrayBinarySearch_Int_NotFoundAfter(size: 10) | Duration | 100 | 1.980 | 0.033 | 1.908 | 2.066 ArrayBinarySearch_Int_NotFoundAfter(size: 100) | Duration | 100 | 2.483 | 0.057 | 2.366 | 2.604 ArrayBinarySearch_Int_NotFoundAfter(size: 1000) | Duration | 100 | 3.007 | 0.070 | 2.873 | 3.353 ArrayBinarySearch_Int_NotFoundBefore(size: 1) | Duration | 100 | 1.421 | 0.038 | 1.336 | 1.488 ArrayBinarySearch_Int_NotFoundBefore(size: 10) | Duration | 100 | 1.737 | 0.055 | 1.615 | 2.067 ArrayBinarySearch_Int_NotFoundBefore(size: 100) | Duration | 100 | 2.140 | 0.059 | 2.032 | 2.274 ArrayBinarySearch_Int_NotFoundBefore(size: 1000) | Duration | 100 | 2.558 | 0.058 | 2.450 | 2.722 ArrayBinarySearch_String_FirstIndex(size: 1) | Duration | 100 | 24.152 | 0.279 | 23.505 | 24.870 ArrayBinarySearch_String_FirstIndex(size: 10) | Duration | 100 | 67.717 | 0.636 | 66.251 | 69.698 ArrayBinarySearch_String_FirstIndex(size: 100) | Duration | 79 | 127.637 | 1.291 | 125.175 | 132.090 ArrayBinarySearch_String_FirstIndex(size: 1000) | Duration | 54 | 187.029 | 2.363 | 183.460 | 197.605 ArrayBinarySearch_String_LastIndex(size: 1) | Duration | 100 | 24.109 | 0.260 | 23.394 | 24.659 ArrayBinarySearch_String_LastIndex(size: 10) | Duration | 100 | 90.462 | 0.870 | 88.901 | 95.927 ArrayBinarySearch_String_LastIndex(size: 100) | Duration | 67 | 149.617 | 1.113 | 147.428 | 152.731 ArrayBinarySearch_String_LastIndex(size: 1000) | Duration | 48 | 211.709 | 2.598 | 207.339 | 224.370 ArrayBinarySearch_String_MiddleIndex(size: 1) | Duration | 100 | 24.275 | 0.237 | 23.618 | 24.814 ArrayBinarySearch_String_MiddleIndex(size: 10) | Duration | 100 | 24.101 | 0.253 | 23.468 | 24.974 ArrayBinarySearch_String_MiddleIndex(size: 100) | Duration | 100 | 24.148 | 0.282 | 23.543 | 24.911 ArrayBinarySearch_String_MiddleIndex(size: 1000) | Duration | 100 | 24.288 | 0.355 | 23.565 | 25.233 ArrayBinarySearch_String_NotFoundAfter(size: 1) | Duration | 100 | 24.421 | 0.621 | 23.702 | 29.705 ArrayBinarySearch_String_NotFoundAfter(size: 10) | Duration | 100 | 77.455 | 0.670 | 76.127 | 79.343 ArrayBinarySearch_String_NotFoundAfter(size: 100) | Duration | 80 | 126.242 | 0.947 | 124.447 | 129.343 ArrayBinarySearch_String_NotFoundAfter(size: 1000) | Duration | 61 | 164.339 | 1.101 | 161.890 | 167.152 ArrayBinarySearch_String_NotFoundBefore(size: 1) | Duration | 100 | 12.681 | 0.198 | 12.326 | 13.212 ArrayBinarySearch_String_NotFoundBefore(size: 10) | Duration | 100 | 35.213 | 0.373 | 34.631 | 36.519 ArrayBinarySearch_String_NotFoundBefore(size: 100) | Duration | 100 | 62.672 | 0.991 | 60.915 | 67.299 ArrayBinarySearch_String_NotFoundBefore(size: 1000) | Duration | 100 | 91.516 | 0.746 | 89.792 | 93.891 SpanBinarySearch_Int_FirstIndex(size: 1) | Duration | 100 | 0.301 | 0.005 | 0.294 | 0.318 SpanBinarySearch_Int_FirstIndex(size: 10) | Duration | 100 | 0.674 | 0.023 | 0.623 | 0.744 SpanBinarySearch_Int_FirstIndex(size: 100) | Duration | 100 | 1.046 | 0.046 | 0.984 | 1.152 SpanBinarySearch_Int_FirstIndex(size: 1000) | Duration | 100 | 1.505 | 0.052 | 1.386 | 1.603 SpanBinarySearch_Int_LastIndex(size: 1) | Duration | 100 | 0.304 | 0.009 | 0.294 | 0.334 SpanBinarySearch_Int_LastIndex(size: 10) | Duration | 100 | 0.816 | 0.025 | 0.779 | 0.891 SpanBinarySearch_Int_LastIndex(size: 100) | Duration | 100 | 1.356 | 0.034 | 1.281 | 1.426 SpanBinarySearch_Int_LastIndex(size: 1000) | Duration | 100 | 1.885 | 0.051 | 1.782 | 1.969 SpanBinarySearch_Int_MiddleIndex(size: 1) | Duration | 100 | 0.294 | 0.012 | 0.278 | 0.340 SpanBinarySearch_Int_MiddleIndex(size: 10) | Duration | 100 | 0.302 | 0.005 | 0.295 | 0.329 SpanBinarySearch_Int_MiddleIndex(size: 100) | Duration | 100 | 0.294 | 0.013 | 0.278 | 0.334 SpanBinarySearch_Int_MiddleIndex(size: 1000) | Duration | 100 | 0.297 | 0.016 | 0.278 | 0.385 SpanBinarySearch_Int_NotFoundAfter(size: 1) | Duration | 100 | 0.334 | 0.012 | 0.323 | 0.404 SpanBinarySearch_Int_NotFoundAfter(size: 10) | Duration | 100 | 0.962 | 0.057 | 0.918 | 1.455 SpanBinarySearch_Int_NotFoundAfter(size: 100) | Duration | 100 | 1.383 | 0.031 | 1.326 | 1.477 SpanBinarySearch_Int_NotFoundAfter(size: 1000) | Duration | 100 | 1.908 | 0.049 | 1.817 | 2.076 SpanBinarySearch_Int_NotFoundBefore(size: 1) | Duration | 100 | 0.298 | 0.009 | 0.295 | 0.383 SpanBinarySearch_Int_NotFoundBefore(size: 10) | Duration | 100 | 0.573 | 0.013 | 0.561 | 0.647 SpanBinarySearch_Int_NotFoundBefore(size: 100) | Duration | 100 | 0.920 | 0.016 | 0.864 | 0.968 SpanBinarySearch_Int_NotFoundBefore(size: 1000) | Duration | 100 | 1.265 | 0.034 | 1.197 | 1.339 SpanBinarySearch_String_FirstIndex(size: 1) | Duration | 100 | 24.081 | 0.314 | 23.481 | 24.939 SpanBinarySearch_String_FirstIndex(size: 10) | Duration | 100 | 67.620 | 0.831 | 65.922 | 72.061 SpanBinarySearch_String_FirstIndex(size: 100) | Duration | 78 | 129.594 | 1.312 | 127.684 | 136.034 SpanBinarySearch_String_FirstIndex(size: 1000) | Duration | 55 | 183.044 | 1.672 | 179.561 | 187.654 SpanBinarySearch_String_LastIndex(size: 1) | Duration | 100 | 24.069 | 0.306 | 23.358 | 24.830 SpanBinarySearch_String_LastIndex(size: 10) | Duration | 100 | 88.475 | 0.671 | 87.047 | 90.305 SpanBinarySearch_String_LastIndex(size: 100) | Duration | 67 | 149.397 | 1.759 | 147.435 | 158.016 SpanBinarySearch_String_LastIndex(size: 1000) | Duration | 49 | 204.532 | 1.352 | 201.917 | 207.409 SpanBinarySearch_String_MiddleIndex(size: 1) | Duration | 100 | 24.192 | 0.384 | 23.390 | 25.623 SpanBinarySearch_String_MiddleIndex(size: 10) | Duration | 100 | 24.185 | 0.254 | 23.629 | 24.838 SpanBinarySearch_String_MiddleIndex(size: 100) | Duration | 100 | 24.245 | 0.336 | 23.557 | 25.424 SpanBinarySearch_String_MiddleIndex(size: 1000) | Duration | 100 | 24.136 | 0.288 | 23.532 | 25.513 SpanBinarySearch_String_NotFoundAfter(size: 1) | Duration | 100 | 24.172 | 0.286 | 23.562 | 24.985 SpanBinarySearch_String_NotFoundAfter(size: 10) | Duration | 100 | 76.572 | 0.599 | 75.079 | 78.241 SpanBinarySearch_String_NotFoundAfter(size: 100) | Duration | 82 | 123.173 | 1.227 | 121.331 | 129.054 SpanBinarySearch_String_NotFoundAfter(size: 1000) | Duration | 63 | 160.362 | 1.506 | 157.191 | 165.588 SpanBinarySearch_String_NotFoundBefore(size: 1) | Duration | 100 | 12.283 | 0.190 | 11.854 | 12.727 SpanBinarySearch_String_NotFoundBefore(size: 10) | Duration | 100 | 32.589 | 0.493 | 31.624 | 35.652 SpanBinarySearch_String_NotFoundBefore(size: 100) | Duration | 100 | 64.224 | 0.925 | 62.709 | 66.379 SpanBinarySearch_String_NotFoundBefore(size: 1000) | Duration | 100 | 88.981 | 0.749 | 87.475 | 91.942 25990 area-System.Diagnostics Process info standard input encoding Implement `ProcessStartInfo.StandardInputEncoding` property. Fix #20497 25991 area-Infrastructure Invalid setting csharp_new_line_within_query_expression_clauses in .editorconfig I used .editorconfig from corefx in our project. Noticed that .editorconfig file has one invalid setting that Roslyn doesn't support csharp_new_line_within_query_expression_clauses. But Roslyn does support csharp_new_line_between_query_expression_clauses and it's missing from .editorconfig. Also noticed that at least following settings are missing as well csharp_indent_case_contents_when_block dotnet_style_prefer_inferred_tuple_names dotnet_style_prefer_inferred_anonymous_type_member_names dotnet_style_require_accessibility_modifiers dotnet_style_prefer_auto_properties csharp_style_deconstructed_variable_declaration dotnet_style_prefer_is_null_check_over_reference_equality_method 25993 area-System.Net "Ensure System.Uri normalizes Unicode hosts when ""file://"" scheme is present" "When parsing ""file:"" IRIs containing Unicode, the host and path must be normalized and the results copied over to the canonical IRI string. This fix ensures that always happens. The issue occurs when three things align: • The URI has the scheme ""file"", and is followed two, or by four or more slashes • The URI begins with a symbol that is unreserved for URIs, but is reserved for DNS names. • The URI contains Unicode characters This occurs because of an oversight in the normalization process. The strings that represent the URI are reduced to just the scheme, and are then built up to the canonical version based on the rules associated with that scheme, and on the contents of the remainder of the URI. For example the URI. http://abcd#123 Is reduced to the string http://, and the rules associated with http build the string up to the canonical version, http://abcd. In most cases, the code for file URIs with more than one slash is processed by the same code path that processes DNS IRIs. However, in the case that the authority was not valid for DNS IRIs (such as those beginning with an underscore), the processing would fall through to the code for processing UNC hosts. While UNC hosts are allowed to have Unicode, the code path failed to normalize the Unicode from the URI. This process resulted in an invalid internal state for the URI. The internal string representing the canonical URI would only contain the scheme name, but the integer storing the index of the end of the authority would be set as it was before normalization. Later, a method would try to loop over the internal string until the end of the authority, and would cause an IndexOutOfRange exception. This issue was reported in internal bug 95292." 25994 area-System.IO Tests For GetFullPath(string path,string basePath) Fixes #25535 Implementation PR:- https://github.com/dotnet/coreclr/pull/15579 25996 area-Microsoft.CSharp Remove ErrorType and dependant paths from Microsoft.CSharp * Remove `ErrAppendMethodParentSym`'s `substMethTyParams` parameter Only ever set to null. * Remove `ErrAppendMethodParentSym` Just calls into `ErrAppendParentSym` now, so just use that. * Remove `UserStringBuilder` handling of `ErrorType` `ErrorType` can never reach here. * Remove `MethodOrPropertySymbol.errExpImpl` Only ever set to null. * Don't replace unfixed type parameters with `ErrorType` Just used to test for presence and compare counts. We can do that with the null. They never escape further. * Don't use `ErrorType` as dummy type in `ExprMemberGroup` If left null it will still work as a dummy type for conversions, and still won't be iterated past in the method iterator. * Remove `ErrorType` Now never created. This makes a lot of unreachable paths more obviously unreachable: * Remove `CType.SetErrors()`, `InitFromParent()` & `HasErrors()` `HasErrors` is always false. * Remove path for `CreateBinopForPredefMethodCall` not finding method. Can never happen in running dynamic code. * Remove path for `CreateUnaryOpForPredefMethodCall` not finding method. Can never happen in running dynamic code. * Remove path for `expr.Type == null` in `CantConvert` Can only happen with `ExprList`, and we never try to convert those. Change to returning exception so calls are obviously an exit point. * Remove path in `mustCastCore` for null `dest` `dest` can never be null The paths by which `dest` is set are as follows: ``` mustCastCore GenerateAssignmentConversion (op2.Type) BindAssignment (op2) RuntimeBinder.BindAssigment (creates in CreateArgumentEXPR) BindUDConversionCore (pTypeDestination) BindUDConversionCore (pTypeDestination) bindUserDefinedConversion (typeDst) returns false if this is null bindUserDefinedConversion (as above) BindUDConversionCore (as above) mustCast BindEnumUnaOp (creates type) BindStandardUnaryOperator (from uofs.GetType(), can never be null) BindLiftedEnumArithmeticBinOp (creates type) BindLiftedUDBinop (creates type) BindLiftedUDUnop (creates type) BindNonliftedIncOp (arg.Type) BindIncOp BindStandardUnaryOperator BindStandardUnaryOperator (recurses with cast) BindUnaryOperation (creates in CreateArgumentEXPR) BindNubConversion (nubDst, selected after type check) BindEnumBinOp (creates) BindLiftedStandardBinOp (creates) BindLiftedStandardUnop (selected after type check) BindBoolBitwiseOp (creates) mustCastInUncheckedContext BindEnumUnaOp (selected after type check) BindLiftedEnumArithmeticBinOp (creates) LScalar (already accessed member, so would throw) BindImplicitConversion (returnType, cannot be null) mustCast (overload) bindUserDefinedConversion (above) BindNubConversion (creates) BindLiftedUDUnop (above) bindUserDefinedConversion (creates) BindLiftedUDBinop (creates) BindLiftedIncOp (selected based on this parameter) BindStandardUnaryOperator (above) bindUserDefinedConversion (creates) LiftArgument (within check on type) CreateLocal (creates) BindExplicitConversion (creates) ``` * Remove `Expr.SetError` Only called if another `Expr` has it set, and hence never. * Remove `Expr.IsOK` Always true * Remove `EXPRExtensions.isCONSTANT_OK` Without `IsOK` to check this can just be a type check. * Remove `BindCallFailedOverloadResolution` `BindMethodGroupToArguments` will call `BindToMethod`, which will call `CreateCall` which calls the `ExprCall` constructor, so outside of paths that throw it can never not return an `ExprCall`, so the null check will never succeed. 25997 area-System.Net HttpClient/HttpWebRequest gives error 407 (ProxyAuthenticationRequired) when used with a proxy server that requires authentication "When making a HTTP request with either HttpClient or HttpWebRequest via a proxy server that requires authentication the result is always 407 (ProxyAuthenticationRequired). Compiling the same code with .NET framework does not give an error. Code to reproduce the issue: ```c# var credentials = new NetworkCredential(""username"", ""password""); var proxyURI = new Uri(""http://xxx.xxx.xxx.xxx:80""); WebProxy proxy = new WebProxy(proxyURI, true) { UseDefaultCredentials = false, Credentials = credentials }; HttpWebRequest req = HttpWebRequest.Create(new Uri(""http://bbc.co.uk"")) as HttpWebRequest; req.UseDefaultCredentials = false; req.Proxy = proxy; using (WebResponse response = req.GetResponse()) { using (StreamReader responseStream = new StreamReader(response.GetResponseStream())) { string htmlData = responseStream.ReadToEnd(); } } ``` The same error is given if we make the request via `HttpClient` and `HttpWebRequest`. It also happens if you create a custom proxy server by implementing `IWebProxy`. Verified the bug on Windows 10 using VS2017 using .NET Core 1.0, 1.1 & 2.0. Verified the exact same code works fine on the same environment using .NET Framework 4.6.1. [EDIT] Add C# syntax highlighting by @karelz" 25998 area-Infrastructure Test failures in under `ru` locale, Win10: System.Drawing.Common and other "Machine: ``` OS Name: Майкрософт Windows 10 Pro OS Version: 10.0.16299 N/A Build 16299 OS Manufacturer: Microsoft Corporation OS Configuration: Standalone Workstation OS Build Type: Multiprocessor Free System Type: x64-based PC System Locale: ru;Russian Input Locale: en-us;English (United States) ``` **IsDirectPrintingSupported_ImageFormatSupported_ReturnsExpected(imageFormat: Png)** ``` <test name=""System.Drawing.Printing.Tests.PrinterSettingsTests.IsDirectPrintingSupported_ImageFormatSupported_ReturnsExpected(imageFormat: Png)"" type=""System.Drawing.Printing.Tests.PrinterSettingsTests"" method=""IsDirectPrintingSupported_ImageFormatSupported_ReturnsExpected"" time=""0.0627535"" result=""Fail""> <failure exception-type=""Xunit.Sdk.EqualException""> <message><![CDATA[Assert.Equal() Failure\r\nExpected: True\r\nActual: False]]></message> <stack-trace><![CDATA[ at System.Drawing.Printing.Tests.PrinterSettingsTests.IsDirectPrintingSupported_ImageFormatSupported_ReturnsExpected(ImageFormat imageFormat) in C:\Users\art\dev\corefx\src\System.Drawing.Common\tests\Printing\PrinterSettingsTests.cs:line 399]]></stack-trace> </failure> </test> ``` **PrinterSettingsTests.SupportsColor_ReturnsExpected** ``` <test name=""System.Drawing.Printing.Tests.PrinterSettingsTests.SupportsColor_ReturnsExpected"" type=""System.Drawing.Printing.Tests.PrinterSettingsTests"" method=""SupportsColor_ReturnsExpected"" time=""0.0724562"" result=""Fail""> <failure exception-type=""Xunit.Sdk.EqualException""> <message><![CDATA[Assert.Equal() Failure\r\nExpected: True\r\nActual: False]]></message> <stack-trace><![CDATA[ at System.Drawing.Printing.Tests.PrinterSettingsTests.SupportsColor_ReturnsExpected() in C:\Users\art\dev\corefx\src\System.Drawing.Common\tests\Printing\PrinterSettingsTests.cs:line 439]]></stack-trace> </failure> </test> ``` **ToLogFont_Invoke_ReturnsExpected** ``` <test name=""System.Drawing.Tests.FontTests.ToLogFont_Invoke_ReturnsExpected(fontStyle: Bold, Italic, Strikeout, gdiCharSet: 1, gdiVerticalFont: True, expectedNamePrefix: \"@\", expectedWeight: 700)"" type=""System.Drawing.Tests.FontTests"" method=""ToLogFont_Invoke_ReturnsExpected"" time=""0.0122065"" result=""Fail""> <failure exception-type=""Xunit.Sdk.EqualException""> <message><![CDATA[Assert.Equal() Failure\r\nExpected: 1\r\nActual: 204]]></message> <stack-trace><![CDATA[ at System.Drawing.Tests.FontTests.ToLogFont_Invoke_ReturnsExpected(FontStyle fontStyle, Byte gdiCharSet, Boolean gdiVerticalFont, String expectedNamePrefix, Int32 expectedWeight) in C:\Users\art\dev\corefx\src\System.Drawing.Common\tests\FontTests.cs:line 733]]></stack-trace> </failure> </test> <test name=""System.Drawing.Tests.FontTests.ToLogFont_Invoke_ReturnsExpected(fontStyle: Regular, gdiCharSet: 0, gdiVerticalFont: False, expectedNamePrefix: \"\", expectedWeight: 400)"" type=""System.Drawing.Tests.FontTests"" method=""ToLogFont_Invoke_ReturnsExpected"" time=""0.0014526"" result=""Fail""> <failure exception-type=""Xunit.Sdk.EqualException""> <message><![CDATA[Assert.Equal() Failure\r\nExpected: 0\r\nActual: 204]]></message> <stack-trace><![CDATA[ at System.Drawing.Tests.FontTests.ToLogFont_Invoke_ReturnsExpected(FontStyle fontStyle, Byte gdiCharSet, Boolean gdiVerticalFont, String expectedNamePrefix, Int32 expectedWeight) in C:\Users\art\dev\corefx\src\System.Drawing.Common\tests\FontTests.cs:line 733]]></stack-trace> </failure> </test> <test name=""System.Drawing.Tests.FontTests.ToLogFont_Invoke_ReturnsExpected(fontStyle: Regular, gdiCharSet: 10, gdiVerticalFont: False, expectedNamePrefix: \"\", expectedWeight: 400)"" type=""System.Drawing.Tests.FontTests"" method=""ToLogFont_Invoke_ReturnsExpected"" time=""0.0013763"" result=""Fail""> <failure exception-type=""Xunit.Sdk.EqualException""> <message><![CDATA[Assert.Equal() Failure\r\nExpected: 10\r\nActual: 204]]></message> <stack-trace><![CDATA[ at System.Drawing.Tests.FontTests.ToLogFont_Invoke_ReturnsExpected(FontStyle fontStyle, Byte gdiCharSet, Boolean gdiVerticalFont, String expectedNamePrefix, Int32 expectedWeight) in C:\Users\art\dev\corefx\src\System.Drawing.Common\tests\FontTests.cs:line 733]]></stack-trace> </failure> </test> ``` **ToLogFont_InvokeGraphics_ReturnsExpected** ``` <test name=""System.Drawing.Tests.FontTests.ToLogFont_InvokeGraphics_ReturnsExpected(textRenderingHint: SystemDefault, expectedQuality: 0)"" type=""System.Drawing.Tests.FontTests"" method=""ToLogFont_InvokeGraphics_ReturnsExpected"" time=""0.0028333"" result=""Fail""> <failure exception-type=""Xunit.Sdk.EqualException""> <message><![CDATA[Assert.Equal() Failure\r\nExpected: 1\r\nActual: 204]]></message> <stack-trace><![CDATA[ at System.Drawing.Tests.FontTests.ToLogFont_InvokeGraphics_ReturnsExpected(TextRenderingHint textRenderingHint, Int32 expectedQuality) in C:\Users\art\dev\corefx\src\System.Drawing.Common\tests\FontTests.cs:line 770]]></stack-trace> </failure> </test> <test name=""System.Drawing.Tests.FontTests.ToLogFont_InvokeGraphics_ReturnsExpected(textRenderingHint: AntiAlias, expectedQuality: 3)"" type=""System.Drawing.Tests.FontTests"" method=""ToLogFont_InvokeGraphics_ReturnsExpected"" time=""0.0015959"" result=""Fail""> <failure exception-type=""Xunit.Sdk.EqualException""> <message><![CDATA[Assert.Equal() Failure\r\nExpected: 1\r\nActual: 204]]></message> <stack-trace><![CDATA[ at System.Drawing.Tests.FontTests.ToLogFont_InvokeGraphics_ReturnsExpected(TextRenderingHint textRenderingHint, Int32 expectedQuality) in C:\Users\art\dev\corefx\src\System.Drawing.Common\tests\FontTests.cs:line 770]]></stack-trace> </failure> </test> <test name=""System.Drawing.Tests.FontTests.ToLogFont_InvokeGraphics_ReturnsExpected(textRenderingHint: AntiAliasGridFit, expectedQuality: 3)"" type=""System.Drawing.Tests.FontTests"" method=""ToLogFont_InvokeGraphics_ReturnsExpected"" time=""0.001564"" result=""Fail""> <failure exception-type=""Xunit.Sdk.EqualException""> <message><![CDATA[Assert.Equal() Failure\r\nExpected: 1\r\nActual: 204]]></message> <stack-trace><![CDATA[ at System.Drawing.Tests.FontTests.ToLogFont_InvokeGraphics_ReturnsExpected(TextRenderingHint textRenderingHint, Int32 expectedQuality) in C:\Users\art\dev\corefx\src\System.Drawing.Common\tests\FontTests.cs:line 770]]></stack-trace> </failure> </test> <test name=""System.Drawing.Tests.FontTests.ToLogFont_InvokeGraphics_ReturnsExpected(textRenderingHint: SingleBitPerPixel, expectedQuality: 3)"" type=""System.Drawing.Tests.FontTests"" method=""ToLogFont_InvokeGraphics_ReturnsExpected"" time=""0.0016513"" result=""Fail""> <failure exception-type=""Xunit.Sdk.EqualException""> <message><![CDATA[Assert.Equal() Failure\r\nExpected: 1\r\nActual: 204]]></message> <stack-trace><![CDATA[ at System.Drawing.Tests.FontTests.ToLogFont_InvokeGraphics_ReturnsExpected(TextRenderingHint textRenderingHint, Int32 expectedQuality) in C:\Users\art\dev\corefx\src\System.Drawing.Common\tests\FontTests.cs:line 770]]></stack-trace> </failure> </test> <test name=""System.Drawing.Tests.FontTests.ToLogFont_InvokeGraphics_ReturnsExpected(textRenderingHint: SingleBitPerPixelGridFit, expectedQuality: 3)"" type=""System.Drawing.Tests.FontTests"" method=""ToLogFont_InvokeGraphics_ReturnsExpected"" time=""0.0022802"" result=""Fail""> <failure exception-type=""Xunit.Sdk.EqualException""> <message><![CDATA[Assert.Equal() Failure\r\nExpected: 1\r\nActual: 204]]></message> <stack-trace><![CDATA[ at System.Drawing.Tests.FontTests.ToLogFont_InvokeGraphics_ReturnsExpected(TextRenderingHint textRenderingHint, Int32 expectedQuality) in C:\Users\art\dev\corefx\src\System.Drawing.Common\tests\FontTests.cs:line 770]]></stack-trace> </failure> </test> <test name=""System.Drawing.Tests.FontTests.ToLogFont_InvokeGraphics_ReturnsExpected(textRenderingHint: ClearTypeGridFit, expectedQuality: 5)"" type=""System.Drawing.Tests.FontTests"" method=""ToLogFont_InvokeGraphics_ReturnsExpected"" time=""0.0018962"" result=""Fail""> <failure exception-type=""Xunit.Sdk.EqualException""> <message><![CDATA[Assert.Equal() Failure\r\nExpected: 1\r\nActual: 204]]></message> <stack-trace><![CDATA[ at System.Drawing.Tests.FontTests.ToLogFont_InvokeGraphics_ReturnsExpected(TextRenderingHint textRenderingHint, Int32 expectedQuality) in C:\Users\art\dev\corefx\src\System.Drawing.Common\tests\FontTests.cs:line 770]]></stack-trace> </failure> </test> ``` [testResults.zip](https://github.com/dotnet/corefx/files/1576175/testResults.zip) As per #25857" 25999 area-System.Net enable MulticastInterface_Set_AnyInterface_Succeeds again after infrastructure fixes fixes #24114 Failures were caused by packet filter rules. This changed after some infrastructure changes where machines (redhat clones (without RH6)) no longer reboot during deployment. @dotnet-bot test outerloop linux x64 debug build please 26000 area-System.Net Make ArgumentException to blame correct parameter for invalid input Attempts to set or add an empty string value to a System.Net.Mime.HeaderCollection results in an ArgumentException. This is expected behavior. However, the ArgumentException thrown from HeaderCollection.Set and HeaderCollection.Add in this case indicates that `name` is empty instead of `value`. This PR is to make ArgumentException to blame correct parameter for invalid input. This issue was reported in internal bug 116743. 26001 area-System.Threading Tests For STA/MTA Attribute For Main Method Implementation PR - dotnet/coreclr#15512 Previous PR - #25934 The .NetCore respects the attribute for the main thread and CoInitializes it in the respective mode. These changes test this functionality. 26002 area-System.Memory Change OwnedMemory<T> to IOwnedMemory<T> This would allow many types with existing class hierarchy to work with Memory<T>. For example, SafeBuffer, Utf8String, etc. cc: @stephentoub, @terrajobst, @davidfowl, @ahsonkhan, @joshfree, @jkotas 26003 area-System.Runtime Uniform tuple representation "Right now, tuples/value tuples are implemented as set of types with distinct arity (max to 7 elements). However they could be implemented in more uniform manner: ```csharp public interface ITuple { } public struct Unit : ITuple { public static Unit Default { get; } = new Unit(); } public struct Cons<TValue, TNext> : ITuple where TNext: ITuple { public TValue Value { get; } public TNext Next { get; } public Cons(TValue value, TNext next) { ... } } ```` With this implementation and some helper methods we could represent Tuples of any size: ```csharp Cons<int, Cons<string, Cons<bool, Unit>>> tuple = Tuple.Cons(1, Tuple.Cons(""hello"", Tuple.Cons(true, Unit.Default))); int item1 = tuple.Value; // tuple.Item1 string item2 = tuple.Next.Value; // tuple.Item2 bool item3 = tuple.Next.Next.Value; // tuple.Item3 ``` While this design can work (and potentially can be even as efficient as `ValueTuple<>` thanks to generic nature of this data structure), it's quite clear, that without compiler's help it looks obscure and it's not pleasant to work with. For this reason, the idea here would be to add language level support for tuples or variadic size: ```csharp Unit a = (); // unit type - potentially useful in the future of the language (int, string, bool) tuple = (1, ""hello"", true); // equivalent to Cons<int, Cons<string, Cons<bool, Unit>>> (item1, item2, item3) = tuple; // tuple deconstruction ```" 26005 area-System.Net Fix Set-Cookie header parsing in CookieContainer When server responds with following response headers: Set-Cookie: mobile_view=false; path=/ Set-Cookie: Set-Cookie: language_id=17; path=/; expires=Fri, 26-Feb-2016 11:26:05 GMT CookieParser in .NET stops parsing headers at second, empty, Set-Cookie header. This PR is to make sure that CookieContainer continues parsing until reaching the end of the entire Set-Cookie header. This issue was reported in internal bug 143892. 26006 area-System.Net Ensure System.Uri consistently uses the correct RFC 3986 reserved character set "There is an issue with System.Uri where certain percent encoded characters that should be left as-is are decoded, but only when the URI also contains Unicode or an encoded non-reserved symbol. This issue was heavily reported in .NET Framework, also appears to repro in CoreFx. Increased usage of Unicode has caused a recent rise in the number of reports. Here are the conditions under which the unexpected behavior will occur: - The URI contains the percent encoded form of any of the following reserved characters: :, ', (, ), ! or *. - The URI contains a Unicode or encoded non-reserved character. The incorrect behavior is to decode the reserved characters, but only when both of the above are true. This is the wrong behavior not only because it is inconsistent (depending on the presence of Unicode or encoded non-reserved), but also because it goes against the spec: ``` Percent-encoding a reserved character, or decoding a percent-encoded octet that corresponds to a reserved character, will change how the URI is interpreted by most applications. Thus, characters in the reserved set are protected from normalization and are therefore safe to be used by scheme-specific and producer-specific algorithms for delimiting data subcomponents within a URI. ``` Uri.ToString is the only exception to the repro conditions above. The old ToString behavior was to always decode all characters except ?, #, % and the RFC 2396 reserved set. The new behavior is updates the reserved set to match RFC 3986. The RFC 2396 reserved set is a strict subset of the RFC 3986 set, and so no new characters will be decoded. This change makes ToString safer to use, as it can no longer change the semantics of a URI that uses ':' or the RFC 3986 reserved set. The source of the issue was an update to the URI code to match the following change in the URI spec, where the new version adds a handful of reserved characters: ``` RFC 2396 reserved = "";"" | ""/"" | ""?"" | "":"" | ""@"" | ""&"" | ""="" | ""+"" | ""$"" | "","" RFC 3986/3987 reserved = gen-delims / sub-delims gen-delims = "":"" / ""/"" / ""?"" / ""#"" / ""["" / ""]"" / ""@"" sub-delims = ""!"" / ""$"" / ""&"" / ""'"" / ""("" / "")"" / ""*"" / ""+"" / "","" / "";"" / ""="" ``` When System.Uri was updated to follow RFC 3986, some codepaths missed the update to the new reserved set. Thus the added reserved symbols are not considered reserved in some circumstances. In addition, one function is also missing ':' from the original reserved set. This has been fixed in .Net Framework 4.7.2. This fix updates places where the RFC 2396 set was still being used, and adds tests to ensure this behavior is consistent. It also retains the code used for quirking in .Net Framework, but always enables the new behavior instead of checking an AppContextSwitch. Ref: Internal bug 150266" 26007 area-System.Net Make test asynchronous. Remove task.waitall from test, that may cause sporadic CI test failures. cc @wfurt @karelz 26008 area-System.IO System.IO.Directory.Exists(string path) does not trim trailing whitespace of provided path on Linux "The documentation of `System.IO.Directory.Exists(string path)` [here ](https://docs.microsoft.com/en-us/dotnet/api/system.io.directory.exists?view=netcore-2.0#System_IO_Directory_Exists_System_String_) states that > Trailing spaces are removed from the end of the path parameter before checking whether the directory exists. This is true for Windows, but not for Linux (tested on Ubuntu 17 and WSL) ## Expected ````c# Assert.True(System.IO.Directory.Exists(""./"")); Assert.True(System.IO.Directory.Exists(""./ "")); ```` ## Actual The second assertion fails only on Linux (Ubuntu 17.04 VM in Azure and also WSL) ## Environment ```` > dotnet --info .NET Command Line Tools (2.0.2) Product Information: Version: 2.0.2 Commit SHA-1 hash: a04b4bf512 Runtime Environment: OS Name: ubuntu OS Version: 17.04 OS Platform: Linux RID: linux-x64 Base Path: /usr/share/dotnet/sdk/2.0.2/ Microsoft .NET Core Shared Framework Host Version : 2.0.0 Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d ````" 26009 area-Meta Add license headers. Realised I'd neglected this in a file, and found some others. Any *.cs file found without the usual license header has it added except: 1. Files that note they are auto-generated. 2. Files with a different header (unless it is very close to the usual, in which case adjust for typos and old versions). 3. FxCopBaseline.cs files. Any usual licenses that didn't start on the first line were moved up. 26010 area-System.Runtime Inconsistencies between netfx and netcoreapp in string random hashing "While trying to add tests to check if the randomized string hashing is working fine ([issue 24466](https://github.com/dotnet/corefx/issues/24466)), I noticed that netfx is not using random function for GetHashCode. The randomized string hashing function is working properly in netcoreapp but not in netfx. ```""abc"".GetHashCode()``` should be randomized and be returning a different hashcode in different processes. But apparently instead it is returning the same hash code all the time. Please refer to the tests added in this pr #24779. " 26012 area-Microsoft.CSharp Microsoft.CSharp is missing DynamicMetaObjectProviderDebugView Why isn't `Microsoft.CSharp.RuntimeBinder.DynamicMetaObjectProviderDebugView` available in .NET Core? It's a debug view used by debuggers to show properties of dynamic types. 26013 area-System.Net Add implementation for SetTcpKeepAlive in ServicePoint Hi I am porting my .NetFramework project to .NetStd 2.0. I have long running workloads. I need to set Tcp Keep-Alive messages. This is supported in .NetFramework. Its implementation in corefx is not doing anything after validation. https://github.com/dotnet/corefx/blob/master/src/System.Net.ServicePoint/src/System/Net/ServicePoint.cs#L101 Hence, my HttpClient Api calls don't send tcp keep alive messages. Is there any workaround ? When can we expect full implementation of `SetTcpKeepAlive` ? 26014 area-Infrastructure Provide release notes per package and per version for all packages published on nuget.org "Currently there's the lack of transparency what is going on with corefx packages published on nuget.org. For example, in VS with my solution I open ""Manage NuGet Packages for solution"" and on ""Updates"" tab I can see that there's an update for System.Data.SqlClient. I have 4.4.0 but there's a newer 4.4.2 already. Cool. Of cause I'll install it but I wonder what have changed. There's no link to package page on nuget.org in VS UI btw. So I open nuget.org and search for System.Data.SqlClient. On [package's page](https://www.nuget.org/packages/System.Data.SqlClient) I can see the section ""Release Notes"" with this link - https://go.microsoft.com/fwlink/?LinkID=799421 It targets to https://github.com/dotnet/core/blob/master/release-notes/1.1/1.1.0-preview1.md Mm. Kind of obsolete. Nothing more. " 26015 area-System.Xml XmlSchemaSet.Compile throws XmlSchemaException: Undefined complexType is used as a base for complex type extension "Given a XSD-schema `base.xsd` with an abstract complexType (""abstract-component"") and another XSD-schema which includes the base schema - `main.xsd`. Main schema contains a complexType (""abstract-data-source"") which extends ""abstract-component"" from the base schema. It works fine on .net framework (any version). But on .net core (2.0.3) a try to compile main.xsd throws XmlSchemaException: ""Undefined complexType 'xmlschema-test:abstract-component' is used as a base for complex type extension"" Here's repo with code - https://github.com/evil-shrike/demo-dotnet-xsd-abstracttype-bug `base.xsd`: ```xsd <?xml version=""1.0"" encoding=""utf-8"" ?> <xs:schema xmlns=""xmlschema-test"" targetNamespace=""xmlschema-test"" xmlns:xs=""http://www.w3.org/2001/XMLSchema"" > <xs:complexType name=""abstract-component"" abstract=""true""> <xs:attribute name=""clr-type"" type=""xs:string"" use=""optional"" form=""qualified"" /> </xs:complexType> </xs:schema> ``` `main.xsd`: ```xsd <?xml version=""1.0"" encoding=""utf-8""?> <xs:schema xmlns=""xmlschema-test"" targetNamespace=""xmlschema-test"" xmlns:xs=""http://www.w3.org/2001/XMLSchema"" > <xs:include schemaLocation=""base.xsd""></xs:include> <xs:complexType name=""abstract-data-source""> <xs:complexContent> <xs:extension base=""abstract-component""> <xs:attribute name=""n"" use=""optional"" form=""qualified"" /> </xs:extension> </xs:complexContent> </xs:complexType> </xs:schema> ``` Program.cs: ```c# using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Xml; using System.Xml.Schema; namespace xmlschema_core { class Program { static void Main(string[] args) { if (args.Length == 0) { Console.WriteLine("".exe <schema> [<schema> ...]""); return; } var schemas = new XmlSchemaSet(); var schemaFiles = args; foreach (string schemaFilePath in schemaFiles) { using (var reader = new XmlTextReader(schemaFilePath)) { XmlSchema schema = XmlSchema.Read(reader, null); schemas.Add(schema); } } schemas.Compile(); Console.WriteLine(""success""); } } } ``` to run: work: `dotnet run main.xsd --framework net461` fail: `dotnet run main.xsd --framework netcoreapp2.0` [EDIT] Add syntax highlighting by @karelz" 26016 area-System.Data Enable BeginExecuteNonQuery functions in .NET Core Make public previously private BeginExecuteNonQuery and related functions. Add basic functional tests. 26017 area-System.IO Tests for span overloaded path api Implementation PR - https://github.com/dotnet/coreclr/pull/15608 Fixes https://github.com/dotnet/corefx/issues/25539 26018 area-System.Net HttpStatusCode to implement RFC 6585 Please implement complete list of HTTP status codes. See https://tools.ietf.org/html/rfc6585 for many status codes that are missing in: https://github.com/dotnet/corefx/blob/master/src/System.Net.Primitives/src/System/Net/HttpStatusCode.cs Ignoring the `Unofficial codes` section from this list: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes, we basically should have all status codes covered in HttpStatusCode enum. Ex, Azure DocumentDB server returns 429 (Too Many Requests) for which i have to check integral value of HttpResponseMessage.StatusCode in HttpClient. 26020 area-System.Security Adding certificate chain to local user store on linux doesn't reflect in chain building "Repro code: ```c# using System; using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; namespace certrepro { class Program { static void Main(string[] args) { var cert = new X509Certificate2(""s_rsa_cai1.p12"", ""password"", X509KeyStorageFlags.UserKeySet); X509Store certStore = new X509Store(""My"", StoreLocation.CurrentUser); certStore.Open(OpenFlags.ReadWrite); X509Certificate2Collection certs = new X509Certificate2Collection(); try { certs.Import(""s_rsa_cai1.p12"", ""password"", X509KeyStorageFlags.DefaultKeySet); foreach(X509Certificate2 c in certs) { certStore.Add(c); } X509Chain chain = new X509Chain(); chain.ChainPolicy.VerificationFlags = X509VerificationFlags.AllFlags; chain.ChainPolicy.RevocationFlag = X509RevocationFlag.ExcludeRoot; chain.ChainPolicy.RevocationMode = X509RevocationMode.NoCheck; if (chain.Build(cert)) { Console.WriteLine(""Chain built successfully, count: {0}"", chain.ChainElements.Count); } else { chain.Dispose(); } } finally { foreach(X509Certificate2 c in certs) { certStore.Remove(c); } } } } } ``` Output on Linux: ``` lasekar@ubuntu1704:~/certrepro$ dotnet run Chain built successfully, count: 1 ``` Output on Windows: ``` C:\Users\lasekar\Desktop\certrepro>dotnet run Chain built successfully, count: 2 ``` Using the certificate file: https://github.com/pepone/netstreamtest/blob/master/server/s_rsa_cai1.p12" 26021 area-System.Net Make Socket.BeginConnect() checking for InvalidOperationException more robustly Socket.BeginConnect() was not properly throwing InvalidOperationException consistently when a previous async operation was in progress. This resulted in extra BeginConnect operations starting which then caused random Socket failures and exceptions. This was not a regression from previous releases but an old bug. Without fixing this, multiple BeginConnect's are started incorrectly and random network socket failures will occur. This PR fixs race conditions in BeginConnect logic so that InvalidOperationException's are thrown consistently when multiple operations are detected. Use atomic Interlocked.Exchange operations to protect state fields. BeginConnect will now consistently throw InvalidOperationException when attempting multiple operations. This method is already documented to throw this exception. Also, split the test cases in `public void BeginConnect_EndPoint_ListeningSocket_Throws_InvalidOperation()` from `ArgumentValidationTests.cs` because the check for multiple BeginConnect operations on same endpoint should comes first. (We don't allow this situation). This issue was reported in internal bug 188428. 26022 area-System.Net Allow bidirectional control characters in System.Uri There is an issue in System.Uri that causes Unicode bidirectional control characters to be stripped during the encoding process, in violation of the IRI RFC. This occurs regardless of whether or not the characters occur as literals or as percent encoded UTF-8 octets. There are five affected bidirectional formatting characters (LRN, RLM, LRE, LRO, and RTL). For example, the following source URI contains percent encoded UTF-8 octets representing the Unicode RTL control character U+200F: ``` https://a/bcd/%E2%80%8Fefg/ ``` Like any other encoded Unicode character, we expect the result to remain percent encoded, as shown below: ``` https://a/bcd/%E2%80%8Fefg/ ``` But the actual result is this: ``` https://a/bcd/efg/ ``` This is clearly wrong -- we shouldn't be stripping percent encoded characters just because they have a special meaning when decoded. We see the same behavior when passing in an un-encoded version of the Bidi control character. The problematic Bidi control characters are represented by the code points x200E, x200f, and x202A-x202E. According to the IRI Spec ABNF, these characters fall under the definition of ucschar. Ucschars are considered unreserved in the IRI spec, and thus should be legal to use. Additionally, during the Uri conversion process RFC 3987 Sec. 3.1 should apply, and un-encoded BiDi characters should be percent encoded. After the fix is applied the behavior of System.Uri will match that of WinRT Windows.Foundation.Uri as well as that of common browsers such as Edge and Chrome. The fix also retains the code used for quirking in .Net Framework, but always enables the new behavior instead of checking an AppContextSwitch. This issue was initially reported in .NET Framework, and was tracked by internal bug 130850. 26023 area-System.Runtime Simplify Nullable<T> usage with deconstruction semantics "Recently I upgraded to using C# 7.* and I finally got to do more with tuples. I love the `.Deconstruct` capabilities and how they extend into anything. I have found this to be particularly useful for `Nullable<T>`. I tweeted about it <a href=""https://twitter.com/davidpine7/status/941759704363085825"" target=""_blank"">here</a> and it caught a lot of positive attention from the developer community. In fact, I was inspired to make a pull request as @jaredpar and @VSadov seemed to think it ""should just be added to Nullable"". # Rationale and Usage This feature will simplify the usage of `Nullable<T>` access, as the consumer will have two variables namely `hasValue` and `value` - instead of an instance of the `Nullable<T>` that they would then have to `.` into. ```csharp public void TakeActionOnNullable<T>(Nullable<T> nullable) { // Leveraging the generic nullable deconstruction extension method var (hasValue, value) = nullable; } ``` # Proposed API This is my first PR in coreclr / corefx, is this what you're looking for? ```csharp [EditorBrowsable(EditorBrowsableState.Never)] public static void Deconstruct<T>(this T? nullable, out bool hasValue, out T value) where T : struct { hasValue = nullable.HasValue; value = nullable ?? default; } ``` # Details This extension method is generic and will support all variations of `Nullable<T>`, this means that any `Nullable<T>` can easily be deconstructed. This is obviously an opt-in, no developer will be forced to use this. It is however an option that could be considered a more terse approach. # Pull Request Here is the PR: https://github.com/dotnet/coreclr/pull/15605" 26024 area-System.IO File.GetLastWriteTimeUtc on Ubuntu is precise only up to seconds "### Steps to reproduce: 1. Create a new console app 2. Edit Program.cs to print it's last write time out: ```C# using System; using System.IO; namespace ts_test { class Program { static void Main(string[] args) { var file = Path.Combine(Directory.GetCurrentDirectory(), ""Program.cs""); var t = File.GetLastWriteTimeUtc(file); Console.WriteLine(t.ToString(""o"")); } } } ``` On my Windows machine, here's the output: > 2017-12-22T04:59:47.5871375Z On my Ubuntu VM, here's the output: > 2017-12-22T05:18:38.0000000Z Notice the missing precision after the seconds digits. The filesystem does seem to have a higher precision timestamp associated with the file: ``` >:~/src/ts-test$ ls --full-time Program.cs -rw-rw-r-- 1 prkrishn prkrishn 320 2017-12-22 05:18:38.250041900 +0000 Program.cs ``` ``` dotnet --info .NET Command Line Tools (2.0.2) Product Information: Version: 2.0.2 Commit SHA-1 hash: a04b4bf512 Runtime Environment: OS Name: ubuntu OS Version: 16.04 OS Platform: Linux RID: ubuntu.16.04-x64 Base Path: /usr/share/dotnet/sdk/2.0.2/ Microsoft .NET Core Shared Framework Host Version : 2.0.0 Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d ``` ### Further background: I noticed this when I was writing tests to cover incremental build scenarios in my MSBuild target. MSBuild uses file timestamps to determine if the inputs are consistent with the outputs. Consequently inputs modified within a second of creating the output would be treated as consistent resulting in MSBuild target executions from being skipped. I also some my tests fail on Travis OSX 10.12 but I don't have a machine handy to confirm if this was the cause. " 26025 area-System.Net Mac: 'Cannot access Kerberos ticket' after `dotnet ef database update` Hello After create model in project and set to dbcontext, for creation database give me this error please help me. ``` Cannot access Kerberos ticket. Ensure Kerberos has been initialized with 'kinit'. ErrorCode=InternalError, Exception=Interop+NetSecurityNative+GssApiException: GSSAPI operation failed with error - An unsupported mechanism was requested (unknown mech-code 0 for mech unknown). at System.Net.Security.NegotiateStreamPal.GssInitSecurityContext(SafeGssContextHandle& context, SafeGssCredHandle credential, Boolean isNtlm, SafeGssNameHandle targetName, GssFlags inFlags, Byte[] buffer, Byte[]& outputBuffer, UInt32& outFlags, Int32& isNtlmUsed) at System.Net.Security.NegotiateStreamPal.EstablishSecurityContext(SafeFreeNegoCredentials credential, SafeDeleteContext& context, String targetName, ContextFlagsPal inFlags, SecurityBuffer inputBuffer, SecurityBuffer outputBuffer, ContextFlagsPal&outFlags) at System.Data.SqlClient.SNI.SNIProxy.GenSspiClientContext(SspiClientContextStatus sspiClientContextStatus, Byte[] receivedBuff, Byte[]& sendBuff, Byte[] serverName) at System.Data.SqlClient.SNI.TdsParserStateObjectManaged.GenerateSspiClientContext(Byte[] receivedBuff, UInt32 receivedLength, Byte[]& sendBuff, UInt32& sendLength, Byte[] _sniSpnBuffer) at System.Data.SqlClient.TdsParser.SNISSPIData(Byte[] receivedBuff, UInt32 receivedLength, Byte[]& sendBuff, UInt32& sendLength) ``` [EDIT] Fix exception formatting by @karelz 26026 area-System.Data Application crash because of unhandled exception in DbConnectionPool This line of code is causing application to crash, because of unhandled exception. This exception is thrown in other thread, started by ThreadPool.QueueUserWorkItem and there is no way for user code to handle it. https://github.com/dotnet/corefx/blob/ec22edc155aa13289770c9f49630cc7ab588fca4/src/System.Data.SqlClient/src/System/Data/ProviderBase/DbConnectionPool.cs#L755 26027 area-System.Drawing Consolidate Font code between unix and windows 26028 area-System.Reflection Wrong exception thrown with invalid external table mask In system.reflection.metadata\src\system\reflection\metadata\metadatareader.cs, an invalid External Table Mask should throw a BadImageFormatException but always throws a System.FormatException. 26029 area-System.Reflection Fix bad Exception formatting An invalid External Table Mask should throw a BadImageFormatException but always throws a System.FormatException. Remove a cast to TableMask and the correct exception is thrown. Also included a test. Fixes #26028 26030 area-System.Net Added native support for the HTTP PATCH verb. Added native support for the HTTP PATCH verb. I didn't see any existing tests for the other verbs equivalent methods and properties so no unit tests are included. Closes #17299 26031 area-System.Collections There should be an `ObservableDictionary<TKey, TVal>` in contrast to `ObservableCollection<T>`! Yes we can find many implements on web for example [this](http://blogs.microsoft.co.il/shimmy/2010/12/26/observabledictionarylttkey-tvaluegt-c/) one, but I still think that there should be one reside in .NetFX! 26032 area-System.Net Test failures: Remote servers unreachable ## Types of failures Affected tests: * System.Net.Tests.TaskWebClientTest / [UploadFile_Success](https://github.com/dotnet/corefx/blob/b227000d7d2b3d79224a95278d3e76dc74ff6b0c/src/System.Net.WebClient/tests/WebClientTest.cs#L669) * System.Net.Tests.TaskWebClientTest / [UploadString_Success](https://github.com/dotnet/corefx/blob/b227000d7d2b3d79224a95278d3e76dc74ff6b0c/src/System.Net.WebClient/tests/WebClientTest.cs#L688) * System.Net.Tests.WebClientTest / [RequestHeaders_AddHostHeaderAndSendRequest_ExpectedResult](https://github.com/dotnet/corefx/blob/b227000d7d2b3d79224a95278d3e76dc74ff6b0c/src/System.Net.WebClient/tests/WebClientTest.cs#L411-L415) * System.Net.Tests.SyncWebClientTest / [UploadData_LargeData_Success](https://github.com/dotnet/corefx/blob/b227000d7d2b3d79224a95278d3e76dc74ff6b0c/src/System.Net.WebClient/tests/WebClientTest.cs#L652) * System.Net.Tests.SyncWebClientTest / [OpenWrite_Success](https://github.com/dotnet/corefx/blob/b227000d7d2b3d79224a95278d3e76dc74ff6b0c/src/System.Net.WebClient/tests/WebClientTest.cs#L624) * System.Net.Tests.SyncWebClientTest / [UploadData_Success](https://github.com/dotnet/corefx/blob/b227000d7d2b3d79224a95278d3e76dc74ff6b0c/src/System.Net.WebClient/tests/WebClientTest.cs#L637) ### CurlException: SSL connect error ``` System.Net.WebException : An error occurred while sending the request. SSL connect error ---- System.Net.Http.HttpRequestException : An error occurred while sending the request. -------- System.Net.Http.CurlException : SSL connect error ``` ### CurlException: Couldn't resolve host name Ubuntu17.04: ``` System.Net.WebException : An error occurred while sending the request. Couldn't resolve host name ---- System.Net.Http.HttpRequestException : An error occurred while sending the request. -------- System.Net.Http.CurlException : Couldn't resolve host name ``` ### WinHttpException: The server name or address could not be resolved Windows: ``` System.Net.WebException : An error occurred while sending the request. The server name or address could not be resolved ---- System.Net.Http.HttpRequestException : An error occurred while sending the request. -------- System.Net.Http.WinHttpException : The server name or address could not be resolved ``` ## History of failures Day | Build | OS | Error message | Test -- | -- | -- | -- | -- 6/28 | 20170628.02 | Fedora26 | CurlException: SSL connect error | UploadData_Success 7/8 | 20170708.04 | Fedora26 | CurlException: SSL connect error | UploadData_Success 9/2-9/3 | N/A | various | System.Net.WebException : The operation has timed out. | All tests 9/28 | 20170928.03 | Fedora25 | CurlException: SSL connect error | UploadFile_Success 9/29 | 20170929.02 | Fedora25 | CurlException: SSL connect error | UploadFile_Success 10/9 | 20171009.04 | Fedora25 | CurlException: SSL connect error | OpenWrite_Success 10/17 | 20171017.02 | Fedora26 | CurlException: SSL connect error | UploadFile_Success 10/18 | 20171018.02 | Fedora25 | CurlException: SSL connect error | UploadData_Success 10/19 | 20171019.01 | Ubuntu17.04 | CurlException: Couldn't resolve host name | UploadData_Success 10/19 | 20171019.01 | Ubuntu17.04 | CurlException: Couldn't resolve host name | UploadData_Success 10/19 | 20171019.01 | Ubuntu17.04 | CurlException: Couldn't resolve host name | UploadFile_Success 10/19 | 20171019.01 | Ubuntu17.04 | CurlException: Couldn't resolve host name | UploadFile_Success 10/19 | 20171019.01 | Ubuntu17.04 | CurlException: Couldn't resolve host name | RequestHeaders_AddHostHeaderAndSendRequest_ExpectedResult 10/24 | 20171024.02 | Fedora26 | CurlException: SSL connect error | OpenWrite_Success 10/25 | 20171025.02 | Fedora26 | CurlException: SSL connect error | UploadFile_Success 10/25 | 20171025.05 | Fedora25 | CurlException: SSL connect error | UploadFile_Success 10/28 | 20171028.03 | Fedora26 | CurlException: SSL connect error | UploadString_Success 10/29 | 20171029.01 | Fedora25 | CurlException: SSL connect error | UploadFile_Success 11/3 | 20171103.01 | Fedora26 | CurlException: SSL connect error | OpenWrite_Success 11/3 | 20171103.08 | Fedora26 | CurlException: SSL connect error | UploadData_Success 11/4 | 20171104.04 | Fedora26 | CurlException: SSL connect error | OpenWrite_Success 11/8 | 20171108.02 | Fedora25 | CurlException: SSL connect error | OpenWrite_Success 11/13 | 20171113.01 | Fedora26 | CurlException: SSL connect error | UploadData_Success 11/15 | 20171115.03 | Fedora25 | CurlException: SSL connect error | UploadFile_Success 11/16 | 20171116.51 | Fedora26 | CurlException: SSL connect error | OpenWrite_Success 11/19 | 20171119.01 | Fedora26 | CurlException: SSL connect error | UploadData_Success 11/29 | 20171129.01 | Fedora26 | CurlException: SSL connect error | UploadData_LargeData_Success 12/10 | 20171210.01 | Fedora26 | CurlException: SSL connect error | OpenWrite_Success 12/13 | 20171213.03 | Win7 | WinHttpException: The server name or address could not be resolved | UploadFile_Success 12/13 | 20171213.03 | Win7 | WinHttpException: The server name or address could not be resolved | UploadFile_Success 12/13 | 20171213.03 | Win7 | WinHttpException: The server name or address could not be resolved | RequestHeaders_AddHostHeaderAndSendRequest_ExpectedResult 12/13 | 20171213.03 | Win7 | WinHttpException: The server name or address could not be resolved | UploadString_Success 12/13 | 20171213.03 | Win7 | WinHttpException: The server name or address could not be resolved | UploadString_Success 12/13 | 20171213.03 | Win7 | WinHttpException: The server name or address could not be resolved | UploadFile_Success 12/13 | 20171213.11 | Fedora26 | CurlException: SSL connect error | UploadFile_Success 12/14 | 20171214.03 | Fedora26 | CurlException: SSL connect error | UploadData_Success 12/16 | 20171216.06 | Fedora26 | CurlException: SSL connect error | UploadFile_Success 12/17 | 20171217.02 | Fedora26 | CurlException: SSL connect error | UploadFile_Success 12/28 | 20171228.02 | Fedora26 | CurlException: SSL connect error | UploadData_Success 1/7 | 20180107.01 | Fedora26 | CurlException: SSL connect error | OpenWrite_Success - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180107.01/workItem/System.Net.WebClient.Tests/analysis/xunit/System.Net.Tests.TaskWebClientTest~2FOpenWrite_Success(echoServer:%20https:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)) 1/9 | 20180109.01 | Fedora26 | CurlException: SSL connect error | UploadFile_Success - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180109.01/workItem/System.Net.WebClient.Tests/analysis/xunit/System.Net.Tests.TaskWebClientTest~2FUploadFile_Success(echoServer:%20https:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)) 1/19 | 20180119.06 | Fedora26 | CurlException: SSL connect error | UploadData_LargeData_Success - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180119.06/workItem/System.Net.WebClient.Tests/analysis/xunit/System.Net.Tests.TaskWebClientTest~2FUploadData_LargeData_Success(echoServer:%20https:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)) 1/22 | 20180122.02 | Fedora26 | CurlException: SSL connect error | UploadFile_Success -[link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180122.02/workItem/System.Net.WebClient.Tests/analysis/xunit/System.Net.Tests.TaskWebClientTest~2FUploadFile_Success(echoServer:%20https:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)) 1/28 | 20180128.01 | Fedora26 | CurlException: SSL connect error | UploadFile_Success - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180128.01/workItem/System.Net.WebClient.Tests/analysis/xunit/System.Net.Tests.TaskWebClientTest~2FUploadFile_Success(echoServer:%20https:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)) 1/30 | 20180130.01 | Fedora26 | CurlException: SSL connect error | UploadFile_Success - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180130.01/workItem/System.Net.WebClient.Tests/analysis/xunit/System.Net.Tests.TaskWebClientTest~2FUploadFile_Success(echoServer:%20https:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)) 1/31 | 20180131.01 | Fedora26 | CurlException: SSL connect error | UploadFile_Success - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180131.01/workItem/System.Net.WebClient.Tests/analysis/xunit/System.Net.Tests.TaskWebClientTest~2FUploadFile_Success(echoServer:%20https:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)) 2/2 | 20180202.05 | Fedora26 | CurlException: SSL connect error | UploadFile_Success - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180202.05/workItem/System.Net.WebClient.Tests/analysis/xunit/System.Net.Tests.TaskWebClientTest~2FUploadFile_Success(echoServer:%20https:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)) 3/7 | 20180307.03 | Fedora26 | CurlException: SSL connect error | UploadFile_Success 3/13 | 20180313.03 | Fedora26 | CurlException: SSL connect error | UploadFile_Success 26033 area-System.Collections Dictionary exposes internal type comparer According to @jkotas, Dictionary is not supposed to leak the fact that it is internally using the NonRandomizedComparer as it does below: ``` var dict = new Dictionary<string, int>(); Assert.NotSame(EqualityComparer<string>.Default, dict.Comparer); ``` For more information please take a look at the following PR #24779 26034 area-System.Net TcpListener.Stop hangs if Accept is in progress "Hi, We are experiencing an issue on Linux, building with publish -r linux-x64. It looks like TcpListener.Stop() hangs when we try to orderly shutdown the server. The socket is waiting for an Accept, then other thread does TcpListener.Stop(). The same code works fine on Windows (.NET Core) and also on Linux/Mono. Here the sequence is: * We start the server. * We try to stop it. * It takes forever to finish. * Attaching the debugger (from Visual Studio on Windows, which is awesome :P) we see the process is stopped in TcpListener.Stop and never leaves. Attached a repro case, but the code is super simple: ```c# using System; using System.Net; using System.Net.Sockets; using System.Threading; namespace tcplistenertest { class Program { static void Main(string[] args) { Thread listenerThread = StartBackgroundThread(new ThreadStart(ThreadProc)); while(Console.ReadLine() != string.Empty) { } mListener.Stop(); listenerThread.Join(); } static void ThreadProc() { try { mListener = StartListening(); AcceptLoop(mListener); } catch(Exception e) { Console.WriteLine($""ThreadProc error: {e.Message}""); Console.WriteLine($""Stack trace:{Environment.NewLine}{e.StackTrace}""); } } static Thread StartBackgroundThread(ThreadStart task) { Thread thread = new Thread(task); thread.IsBackground = true; thread.Start(); return thread; } static TcpListener StartListening() { TcpListener result = new TcpListener(IPAddress.Any, PORT); result.Start(); return result; } static void AcceptLoop(TcpListener listener) { // this is the main loop of the Socket based server while (true) { Socket socket = null; try { Console.WriteLine(""Accepting connection...""); socket = AcceptConnection(listener); Console.WriteLine($""Connection accepted from {socket.RemoteEndPoint}""); } catch (SocketException e) { Console.WriteLine($""Socket error accepting connection: {e.Message}""); Console.WriteLine($""Stack trace:{Environment.NewLine}{e.StackTrace}""); break; } catch (Exception e) { Console.WriteLine($""Generic error accepting connection: {e.Message}""); Console.WriteLine($""Stack trace:{Environment.NewLine}{e.StackTrace}""); break; } try { socket.Close(); } catch (Exception e) { Console.WriteLine($""Error closing socket: {e.Message}""); Console.WriteLine($""Stack trace:{Environment.NewLine}{e.StackTrace}""); break; } } Console.WriteLine(""Accept loop thread stopping""); } static Socket AcceptConnection(TcpListener listener) { Socket socket = listener.AcceptSocket(); try { socket.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.Debug, 1); LingerOption optionValue = new LingerOption(true, 3); socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Linger, optionValue); return socket; } catch (Exception) { socket.Close(); throw; } } static TcpListener mListener; const int PORT = 55000; } } ``` [tcplistenertest-1.zip](https://github.com/dotnet/corefx/files/1583509/tcplistenertest-1.zip) Thanks! pablo [EDIT] Add C# syntax highlighting by @karelz" 26035 area-System.Numerics Adding the Acosh, Asinh, Atanh, and Cbrt functions to System.Math and System.MathF This resolves https://github.com/dotnet/corefx/issues/16428 26037 area-System.Memory Remove leftover uses of DangerousGetPinnableReference Part of: https://github.com/dotnet/corefx/issues/25412 https://github.com/dotnet/corefx/issues/25615 Related to: https://github.com/dotnet/corefx/pull/25936 Following the staging plan from here: https://github.com/dotnet/corefx/issues/23881#issuecomment-343767740 - [x] Add MemoryExtensions.GetReference/TryGetArray - [x] Convert all uses of DangerousGetPinnableReference/DangerousTryGetArray in coreclr, corefx, corert, corefxlab, aspnet, ... to MemoryExtensions.GetReference - [ ] Change DangerousGetPinnableReference to whatever we like to make it fit the pinning pattern and remove DangerousTryGetArray. Doing it this way will avoid the need for complex staging or things being on the floor for extensive periods of time. cc @jkotas, @stephentoub, @KrzysztofCwalina 26042 area-System.Net Test failures: System.Net.Http.Functional.Tests.DiagnosticsTest / * ## Types of failures Affected tests: * System.Net.Http.Functional.Tests.DiagnosticsTest: * SendAsync_ExpectedDiagnosticSourceLogging * SendAsync_ExpectedDiagnosticSourceNewAndDeprecatedEventsLogging * SendAsync_ExpectedDiagnosticSourceUrlFilteredActivityLogging * SendAsync_ExpectedDiagnosticStopOnlyActivityLogging * System.Net.Http.Functional.Tests.HttpClientHandler_DefaultProxyCredentials_Test: * ProxySetViaEnvironmentVariable_DefaultProxyCredentialsUsed Test `SendAsync_ExpectedDiagnosticStopOnlyActivityLogging` ``` Exit code was 139 but it should have been 42 Expected: True Actual: False at System.Diagnostics.RemoteExecutorTestBase.RemoteInvokeHandle.Dispose() in /root/corefx-1192569/src/CoreFx.Private.TestUtilities/src/System/Diagnostics/RemoteExecutorTestBase.cs:line 203 at System.Net.Http.Functional.Tests.DiagnosticsTest.SendAsync_ExpectedDiagnosticStopOnlyActivityLogging() in /root/corefx-1192569/src/System.Net.Http/tests/FunctionalTests/DiagnosticsTests.cs:line 583 ``` ## History of failures Day | Build | OS | Test -- | -- | -- | -- 5/31 | 20170531.01 | Ubuntu16.04 | SendAsync_ExpectedDiagnosticSourceLogging 7/8 | 20170708.04 | Suse42.2 | [ManagedHandler] SendAsync_ExpectedDiagnosticSourceNewAndDeprecatedEventsLogging 8/1 | 20170801.01 | Ubuntu17.04 | SendAsync_ExpectedDiagnosticSourceUrlFilteredActivityLogging 8/19 | 20170819.02 | Ubuntu17.04 | [ManagedHandler] SendAsync_ExpectedDiagnosticSourceNewAndDeprecatedEventsLogging 8/22 | 20170822.01 | Centos73 | [ManagedHandler] SendAsync_ExpectedDiagnosticSourceUrlFilteredActivityLogging 8/23 | 20170823.07 | Ubuntu17.04 | [ManagedHandler] SendAsync_ExpectedDiagnosticSourceNewAndDeprecatedEventsLogging 8/27 | 20170827.01 | Centos73 | [ManagedHandler] SendAsync_ExpectedDiagnosticSourceNewAndDeprecatedEventsLogging 9/25 | 20170925.03 | Ubuntu17.04 | [ManagedHandler] SendAsync_ExpectedDiagnosticSourceUrlFilteredActivityLogging 9/26 | 20170926.06 | RedHat72 | [ManagedHandler] SendAsync_ExpectedDiagnosticSourceLogging 9/26 | 20170926.06 | RedHat72 | [ManagedHandler] SendAsync_ExpectedDiagnosticSourceNewAndDeprecatedEventsLogging 10/1 | 20171001.01 | RedHat72 | [ManagedHandler] ProxySetViaEnvironmentVariable_DefaultProxyCredentialsUsed 10/26 | 20171026.01 | Suse42.2 | ProxySetViaEnvironmentVariable_DefaultProxyCredentialsUsed 11/18 | 20171118.03 | Ubuntu17.10 | SendAsync_ExpectedDiagnosticSourceLogging 11/27 | 20171127.01 | Ubuntu16.04 | SendAsync_ExpectedDiagnosticSourceNewAndDeprecatedEventsLogging 12/4 | 20171204.02 | Ubuntu17.04 | SendAsync_ExpectedDiagnosticStopOnlyActivityLogging 12/23 | 20171223.03 | Ubuntu17.04 | SendAsync_ExpectedDiagnosticSourceNewAndDeprecatedEventsLogging 1/12 | 20180112.01| Ubuntu14.04 | SendAsync_ExpectedDiagnosticStopOnlyActivityLogging - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180112.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.DiagnosticsTest~2FSendAsync_ExpectedDiagnosticStopOnlyActivityLogging) 1/19 | 20180119.01 | Suse42.4 | ProxySetViaEnvironmentVariable_DefaultProxyCredentialsUsed - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180119.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_DefaultProxyCredentials_Test~2FProxySetViaEnvironmentVariable_DefaultProxyCredentialsUsed(useProxy:%20False)) 3/31 | 20180331.02 | Ubuntu16.04 | SendAsync_ExpectedDiagnosticSourceLogging 3/31 | 20180331.05 | OpenSuse42.3 | SendAsync_ExpectedDiagnosticSourceLogging Note: Related to: * Some failures in #23209 * ManagedHandler failures in #23771 26043 area-System.Console Unsubscribe from Console.CancelKeyPress hangs after Task.Delay was cancelled "This will happen only if all of these conditions are met: 1) use Task.Delay 2) token source was cancelled inside ConsoleCancelEventHandler; 3) token source was cancelled with CancellationTokenSource.Cancel method; 4) method marked as async and Task.Delay is awaited. Bug is not reproduced if any of these conditions is violated: - **Condition №1 is violated:** Use any other task instead of `Task.Delay` [AsyncTaskCancel.cs](https://github.com/Maxim-Kornilov/CancelKeyPressBug/blob/master/CancelKeyPressBug/TestCases/AsyncTaskCancel.cs#L17) - **Condition №2 is violated:** Cancel outside `ConsoleCancelEventHandler` [AsyncDelayCancelOutsideHandler.cs](https://github.com/Maxim-Kornilov/CancelKeyPressBug/blob/master/CancelKeyPressBug/TestCases/AsyncDelayCancelOutsideHandler.cs#L20) But it hangs inside `ConsoleCancelEventHandler` if I add `GetAwaiter().GetResult()` to `Task.Run(() => tokenSource.Cancel())` - **Condition №3 is violated:** Cancel using `CancelAfter` [AsyncDelayCancelAfter.cs](https://github.com/Maxim-Kornilov/CancelKeyPressBug/blob/master/CancelKeyPressBug/TestCases/AsyncDelayCancelAfter.cs#L20) - **Condition №4 is violated:** Use `GetAwaiter().GetResult()` for `Task.Delay` [SyncDelay.cs](https://github.com/Maxim-Kornilov/CancelKeyPressBug/blob/master/CancelKeyPressBug/TestCases/SyncDelay.cs#L15) This bug is reproduced even if I use `dotnet publish -c release -r win10-x86`. Simple test case or [GitHub repo with all test cases](https://github.com/Maxim-Kornilov/CancelKeyPressBug) ```csharp private static async Task SimpleTestCase() { var tokenSource = new CancellationTokenSource(); ConsoleCancelEventHandler cancelled = (s, e) => { // Conditions #2 and #3 tokenSource.Cancel(); e.Cancel = true; }; Console.CancelKeyPress += cancelled; try { Console.WriteLine(""Press Ctrl+C to continue""); // Conditions #1 and #4 await Task.Delay(TimeSpan.FromHours(1.0), tokenSource.Token); } catch (OperationCanceledException) { Console.WriteLine(""Cancelled""); } Console.CancelKeyPress -= cancelled; } ``` dotnet info ``` Программы командной строки .NET (2.0.2) Product Information: Version: 2.0.2 Commit SHA-1 hash: a04b4bf512 Runtime Environment: OS Name: Windows OS Version: 10.0.16299 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\2.0.2\ Microsoft .NET Core Shared Framework Host Version : 2.0.0 Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d ``` I know that Task.Delay is part of coreclr and Console.CancelKeyPress is part of corefx. I dont't know what causes the issue, but I file it here because the Console.CancelKeyPress is the one that not working as expexted." 26044 area-System.Net Increase code coverage for System.Net.Security Hi, Pursuant to issue #17099, I have added tests for a couple of classes. If you have any questions or comments, please let me know. Thanks, Michael 26045 area-System.Memory Add another constructor to Span using IntPtr Hello, in F# we cannot cast ptr's to void ptr's (the type `nativeptr<unit>` is disallowed due to `unit` isn't an unmanaged type). Therefor it's currently not possible for me to create a Span from stackallocated memory in F# 😢 (Signature of the constructor is funnily `ptr:nativeptr<unit>* length:int -> Span`). Easiest solution short-term would be to add another constructor to the Span class which accepts an `IntPtr`. Long-term I try to solve the issue in F#, for reference see [this](https://github.com/Microsoft/visualfsharp/issues/4166) issue. If there's something wrong with `IntPtr` please tell me, I might miss some reason for not using it🤔 ? 26048 area-System.Net IPEndPoint cannot return the correct value when compare the same value "There are wrong value return when I do the execute this code: ip1==ip2 both ip1 and ip2 are IPEndPoint type,and value both are ""192.168.31.15:55360"",but it doesn't return true. now I used the ToString() method to instead of that" 26049 area-System.Net "Unnecessary ""is""-""cast"" sequence in IPEndPoint.Equals()" Here's the current code: //class IPEndPoint public override bool Equals(object comparand) { if (!(comparand is IPEndPoint)) { return false; } return ((IPEndPoint)comparand)._address.Equals(_address) && ((IPEndPoint)comparand)._port == _port; } `is` is followed by two casts. This can be replaced with single `as`: var other = comparand as IPEndPoint; if (other == null) { return false; } return other._address.Equals(_address) && other._port == _port; 26050 area-System.ComponentModel Don't directly throw Exception System.ComponentModel.TypeConverter Contributes to #23748 cc: @maryamariyan, @safern 26051 area-System.Net Only set Headers.ContentLength if it isn't already correct A (handled) unmanaged COM exception is thrown by Windows.Web.Http.dll when an attempt to set an already-present header is made. This particular line is in the hot path and is almost always invoked on outgoing requests causing these COM exceptions to be thrown all the time. Avoiding downstream exceptions should make things faster and result in fewer pipeline flushes, etc. The unmanaged exception stack trace under Windows 10 build 17063: ``` > KernelBase.dll!RaiseException() Unknown Symbols loaded. combase.dll!SendReport(HRESULT error=0x8000000b, unsigned int cchMax=0, const wchar_t * message=0x00007ff854b2d8e4, unsigned short pSid=0x0000000000000000, void * pExceptionObject=0x0000000000000000, IUnknown *) Line 438 C++ Symbols loaded. combase.dll!RoOriginateError(HRESULT error=0x8000000b, HSTRING__ * message) Line 590 C++ Symbols loaded. Windows.Web.Http.dll!Windows::Foundation::Collections::Internal::HashMap<struct HSTRING__ *,struct HSTRING__ *,struct StringCaseInsensitiveHash,struct StringCaseInsensitiveEquals,struct Windows::Foundation::Collections::Internal::DefaultLifetimeTraits<struct HSTRING__ *>,struct Windows::Foundation::Collections::Internal::DefaultLifetimeTraits<struct HSTRING__ *>,struct Windows::Foundation::Collections::Internal::HashMapOptions<struct HSTRING__ *,struct HSTRING__ *,struct Windows::Foundation::Collections::Internal::DefaultLifetimeTraits<struct HSTRING__ *>,0,1,0> >::Remove(struct HSTRING__ *) Unknown Symbols loaded. Windows.Web.Http.dll!HttpHeaderCollectionBase::Remove(struct HSTRING__ *) Unknown Symbols loaded. Windows.Web.Http.dll!HttpHeaderCollectionBase::TryRemoveHeaderValueInfo(struct HSTRING__ *) Unknown Symbols loaded. Windows.Web.Http.dll!HttpHeaderCollectionBase::SetParsedValue(unsigned short const *,struct IInspectable *) Unknown Symbols loaded. [Managed to Native Transition] Annotated Frame System.Net.Http.dll!System.Net.Http.HttpHandlerToFilter.CreateRequestContentAsync(System.Net.Http.HttpRequestMessage request = {System.Net.Http.HttpRequestMessage}, Windows.Web.Http.Headers.HttpRequestHeaderCollection rtHeaderCollection = {Windows.Web.Http.Headers.HttpRequestHeaderCollection}) Line 390 C# Symbols loaded. System.Net.Http.dll!System.Net.Http.HttpHandlerToFilter.ConvertRequestAsync(System.Net.Http.HttpRequestMessage request = {System.Net.Http.HttpRequestMessage}, System.Net.Http.HttpMethod httpMethod = {System.Net.Http.HttpMethod}, bool skipRequestContentIfPresent = false) Line 333 C# Symbols loaded. System.Net.Http.dll!System.Net.Http.HttpHandlerToFilter.SendAsync(System.Net.Http.HttpRequestMessage request = {System.Net.Http.HttpRequestMessage}, System.Threading.CancellationToken cancel = IsCancellationRequested = false) Line 78 C# Symbols loaded. System.Net.Http.dll!System.Net.Http.HttpClientHandler.SendAsync(System.Net.Http.HttpRequestMessage request = {System.Net.Http.HttpRequestMessage}, System.Threading.CancellationToken cancellationToken = IsCancellationRequested = false) Line 596 C# Symbols loaded. System.Net.Http.dll!System.Net.Http.HttpMessageInvoker.SendAsync(System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) Line 51 C# Symbols loaded. System.Net.Http.dll!System.Net.Http.HttpClient.SendAsync(System.Net.Http.HttpRequestMessage request = {System.Net.Http.HttpRequestMessage}, System.Net.Http.HttpCompletionOption completionOption = ResponseHeadersRead, System.Threading.CancellationToken cancellationToken) Line 433 C# Symbols loaded. System.Net.Requests.dll!System.Net.HttpWebRequest.SendRequest() Line 1222 C# Symbols loaded. System.Net.Requests.dll!System.Net.HttpWebRequest.BeginGetResponse(System.AsyncCallback callback = {System.AsyncCallback}, object state = {System.Net.HttpWebRequest}) Line 1234 C# Symbols loaded. System.Private.CoreLib.dll!System.Threading.Tasks.TaskFactory<System.Net.WebResponse>.FromAsyncImpl(System.Func<System.AsyncCallback, object, System.IAsyncResult> beginMethod, System.Func<System.IAsyncResult, System.Net.WebResponse> endFunction = {System.Func<System.IAsyncResult, System.Net.WebResponse>}, System.Action<System.IAsyncResult> endAction = null, object state, System.Threading.Tasks.TaskCreationOptions creationOptions) Line 810 C# Symbols loaded. System.Net.Requests.dll!System.Net.WebRequest.GetResponseAsync.AnonymousMethod__68_0() Line 548 C# Symbols loaded. System.Private.CoreLib.dll!System.Threading.Tasks.Task<System.Threading.Tasks.Task<System.Net.WebResponse>>.InnerInvoke() Line 611 C# Symbols loaded. System.Private.CoreLib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) Line 145 C# Symbols loaded. System.Private.CoreLib.dll!System.Threading.Tasks.Task.ExecuteWithThreadLocal(ref System.Threading.Tasks.Task currentTaskSlot = Id = 3321, Status = Running, Method = Inspecting the state of an object in the debuggee of type System.Delegate is not supported in this context., Result = Cannot evaluate expression because a native frame is on the top of the call stack.) Line 2449 C# Symbols loaded. System.Private.CoreLib.dll!System.Threading.ThreadPoolWorkQueue.Dispatch() Line 582 C# Symbols loaded. [Native to Managed Transition] Annotated Frame kernel32.dll!00007ff853204354() Unknown No symbols loaded. ntdll.dll!RtlUserThreadStart() Unknown Symbols loaded. ``` I don't have access to the source code for `Windows.Web.Http.dll` so this workaround is the best I can offer. 26052 area-System.Threading Don't directly throw Exception System.Threading.Tasks.Dataflow Contributes to #23748 . cc: @kouvel, @tarekgh 26053 area-System.Reflection Getting a ref return value using PropertyInfo ```c# public class RefAndRefReadonlyTestClass { private int _refField; private readonly int _refReadonlyField; public RefAndRefReadonlyTestClass(int refReadonlyField) { _refReadonlyField = refReadonlyField; } public ref int RefField => ref _refField; public ref readonly int RefReadonlyField => ref _refReadonlyField; public void SetRefField(int value) { _refField = value; } } [Test] public void GetRefReturnProperty() { PropertyInfo property = TestReflectionUtils.GetProperty(typeof(RefAndRefReadonlyTestClass), nameof(RefAndRefReadonlyTestClass.RefField)); RefAndRefReadonlyTestClass c1 = new RefAndRefReadonlyTestClass(123); c1.SetRefField(456); object v = property.GetValue(c1, null); } ``` The code above throws this exception from PropertyInfo.GetValue: `System.NotSupportedException: 'ByRef return value not supported in reflection invocation.'` Can you use a PropertyInfo to get the value of a ref return property? [EDIT] Add C# syntax highlight by @karelz 26054 area-System.Net Potential unexpected null in httpclient This [SO](https://stackoverflow.com/questions/47973590/httpclient-header-getting-nulled-when-using-in-async-methods) question alludes to a potential unexpected header being null. This [line](https://github.com/dotnet/corefx/blob/master/src/System.Net.Http/src/System/Net/Http/Headers/HttpHeaders.cs#L600) does not check for header value being possibly null, leading to the argument null exception. In case the SO thread disappears here is the call stack, not that it is in net 4.6.1 and not core, so I'm 50/50 if this exists here or not. #### Callstack System.ArgumentNullException: Value cannot be null. at System.Threading.Monitor.Enter(Object obj) at System.Net.Http.Headers.HttpHeaders.ParseRawHeaderValues(String name, HeaderStoreItemInfo info, Boolean removeEmptyHeader) at System.Net.Http.Headers.HttpHeaders.AddHeaders(HttpHeaders sourceHeaders) at System.Net.Http.Headers.HttpRequestHeaders.AddHeaders(HttpHeaders sourceHeaders) at System.Net.Http.HttpClient.PrepareRequestMessage(HttpRequestMessage request) at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken) at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpClient.PutAsync(Uri requestUri, HttpContent content, CancellationToken cancellationToken) at Attributes.Controllers.AttributesBaseController.<UpdateAttributes>d__6.MoveNext() in D:\Git\PortalSystem\Attributes\Controllers\AttributesBaseController.cs:line 42 26055 area-System.Text "Tests under ""System.Text.RegularExpressions.Tests"" failed with ""Exit code was 131 but it should have been 42""" failed test: RegexMatchTests.Match_SpecialUnicodeCharacters_Invariant Configuration: oxs10.12_release Detail: https://ci.dot.net/job/dotnet_corefx/job/master/job/osx10.12_release/lastCompletedBuild/testReport/System.Text.RegularExpressions.Tests/RegexMatchTests/Match_SpecialUnicodeCharacters_Invariant/ MESSAGE: Exit code was 131 but it should have been 42\nExpected: True\nActual: False ~~~~~~ STACK TRACE: at System.Diagnostics.RemoteExecutorTestBase.RemoteInvokeHandle.Dispose() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_release/src/CoreFx.Private.TestUtilities/src/System/Diagnostics/RemoteExecutorTestBase.cs:line 186 26056 area-System.ComponentModel Test failure: System.ComponentModel.Composition.CompositionExceptionTests/Message_ShouldFormatCountOfRootCausesUsingTheCurrentCulture Opened on behalf of @Sunny-pu The test `System.ComponentModel.Composition.CompositionExceptionTests/Message_ShouldFormatCountOfRootCausesUsingTheCurrentCulture` has failed. Assert.True() Failure\r Expected: True\r Actual: False Stack Trace: at System.ComponentModel.Composition.CompositionExceptionTests.AssertMessage(CompositionException exception, Int32 rootCauseCount, CultureInfo culture) in E:\A\_work\1452\s\corefx\src\System.ComponentModel.Composition\tests\System\ComponentModel\Composition\CompositionExceptionTests.cs:line 413 at System.ComponentModel.Composition.CompositionExceptionTests.Message_ShouldFormatCountOfRootCausesUsingTheCurrentCulture() in E:\A\_work\1452\s\corefx\src\System.ComponentModel.Composition\tests\System\ComponentModel\Composition\CompositionExceptionTests.cs:line 378 Build : Master - 20171226.01 (UWP F5 Tests) Failing configurations: - Windows.10.Amd64.ClientRS3-x86 - Release ~~~ Details: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fuwp~2F/build/20171226.01/workItem/System.ComponentModel.Composition.Tests/analysis/xunit/System.ComponentModel.Composition.CompositionExceptionTests~2FMessage_ShouldFormatCountOfRootCausesUsingTheCurrentCulture 26058 area-System.Collections Provide ImmutableSortedSetArray<T> an ImmutableSortedSet based on array not on tree "# Rational ImmutableSortedSet<T> is based on an AVL Tree also: * property Item[Int32] has compexity in O(Log(N)) * We can't have an ""equivalent"" ImmutableArray without make a copy In the ImmutableCollections framework, we already have the same type of choice for our data structures. I think to the distinction between ImmutableArray<T> vs ImmutableList<T> (based on tree data structure) With this structure we could have: * property Item[Int32] with O(1) complexity * We can have an property ToImmutable without any copy make (call of the internal ImmutableArray constructor). # Usage Very ofen we want to have the garanty (by type) than the incomming Array T[] is sorted to call safely BinarySearch. Of course we could used the ImmutableSortedSet<T> but this structure isn't efficient when working with indexes. Another use case come when we have to rely on native API (eg Interpolation API) when we want a sorted Array double* in input. With an ImmutableSortedSetArray<double> we can without copy have an double* via a Span-based API or some other magic trick. Could you provide an ImmutableSortedSet based on a Array ? " 26059 area-System.Security Make SignedCms interoperate with openssl cms -verify "https://github.com/dotnet/corefx/commit/075cec7a82fe2cdec403315c3350b88973119abe I have difficulty in making Detached `System.Security.Cryptography.Pkcs.SignedCms.cs` interoperate with [openssl cms](https://www.openssl.org/docs/manmaster/man1/cms.html), the openssl command that I execute is `openssl cms -verify -in signedCusdec.p7s -certfile kepabeanan.crt -noverify -nointern -no_alt_chains -out verifiedCusdec.txt`, it throws following error ``` Error reading S/MIME message 140484988696384:error:0D0680A8:asn1 encoding routines:asn1_check_tlen:wrong tag:crypto/asn1/tasn_dec.c:1112: 140484988696384:error:0D07803A:asn1 encoding routines:asn1_item_embed_d2i:nested asn1 error:crypto/asn1/tasn_dec.c:274:Type=CMS_ContentInfo 140484988696384:error:0D0D106E:asn1 encoding routines:b64_read_asn1:decode error:crypto/asn1/asn_mime.c:143: 140484988696384:error:0D0D40CC:asn1 encoding routines:SMIME_read_ASN1:asn1 sig parse error:crypto/asn1/asn_mime.c:442: ``` Following is my code snippet extracted from [AS2MIMEUtilities.cs](https://github.com/dawud-tan/AS2-ASP-NET-Core-2-Web-API/blob/master/Helpers/AS2Helpers.cs#L140) ```C# ContentInfo contentInfo = new ContentInfo(arMessage); SignedCms signedCms = new SignedCms(contentInfo, true); // <- true detaches the signature CmsSigner cmsSigner = new CmsSigner(cert); signedCms.ComputeSignature(cmsSigner); byte[] signature = signedCms.Encode(); return signature; ``` Following is the signedCusdec.p7s file, generated from the above code ``` Content-Type: multipart/signed; protocol=""application/pkcs7-signature""; micalg=""sha1""; boundary=""_3ace996b6559464b90b8b436572c6bae_"" --_3ace996b6559464b90b8b436572c6bae_ Content-Type: multipart/report; report-type=disposition-notification; boundary=""_94805c60317b4d5baf012c913b6412fc_"" --_94805c60317b4d5baf012c913b6412fc_ Content-Type: text/plain Content-Transfer-Encoding: 7bit The AS2 message has been received. --_94805c60317b4d5baf012c913b6412fc_ Content-Type: message/disposition-notification Content-Transfer-Encoding: 7bit Reporting-UA: ASP.NET Core 2.0 Web API Original-Recipient: rfc822; mendelsontestAS2 Final-Recipient: rfc822; mendelsontestAS2 Original-Message-ID: <github-dawud-tan-RetrofitSmime-26122017175311+0700--4062199134817124179@mycompanyAS2_mendelsontestAS2> Disposition: automatic-action/MDN-sent-automatically; processed Received-Content-MIC: e+hBgnF68v4onExp21tBAg==, md5 --_94805c60317b4d5baf012c913b6412fc_-- --_3ace996b6559464b90b8b436572c6bae_ Content-Type: application/pkcs7-signature; name=""smime.p7s"" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=smime.p7s MIIEcgYJKoZIhvcNAQcCoIIEYzCCBF8CAQExDzANBglghkgBZQMEAgEFADALBgkqhkiG9w0BBwGgggLUMIIC0DCCAjkCBEOO/fMwDQYJKoZIhvcNAQEFBQAwga4xJjAkBgkqhkiG9w0BCQEWF3Jvc2V0dGFuZXRAbWVuZGVsc29uLmRlMQswCQYDVQQGEwJERTEPMA0GA1UECBMGQmVybGluMQ8wDQYDVQQHEwZCZXJsaW4xIjAgBgNVBAoTGW1lbmRlbHNvbi1lLWNvbW1lcmNlIEdtYkgxIjAgBgNVBAsTGW1lbmRlbHNvbi1lLWNvbW1lcmNlIEdtYkgxDTALBgNVBAMTBG1lbmQwHhcNMDUxMjAxMTM0MzE1WhcNMTkwODEwMTM0MzE1WjCBrjEmMCQGCSqGSIb3DQEJARYXcm9zZXR0YW5ldEBtZW5kZWxzb24uZGUxCzAJBgNVBAYTAkRFMQ8wDQYDVQQIEwZCZXJsaW4xDzANBgNVBAcTBkJlcmxpbjEiMCAGA1UEChMZbWVuZGVsc29uLWUtY29tbWVyY2UgR21iSDEiMCAGA1UECxMZbWVuZGVsc29uLWUtY29tbWVyY2UgR21iSDENMAsGA1UEAxMEbWVuZDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA1QYrk0Zb4MsdAbkzFfLp2mZOg6H1ZpWRpyeMm+1ozNiqA/zeDPnzgoAEjmDYhpR3BID1XsvOA+pzixH5YbOQFZ0Z+SNVTMxQ0tDLQYsylKBneynDr11iOCBxu2wdkFhEZ0NJJRdY3sS95iHOKFqvdlPeyblrMnrBYZW9vcN8fUECAwEAATANBgkqhkiG9w0BAQUFAAOBgQCucT5rhqerUTOPyUHf1ia8gCknTM1QyKUAReS3nmIiYuTsBqxvLQ72jEFCgOTGPyUq/IlnB91mrNcXuo11V6eMFNQ5+RDyz600XM8R4MXhnp4jtDQeMrQFk/bbbrt/lUeG/rA/eUgn82iATpALtcwzb1EQNxf++hbo6AqCZrXBVjGCAWIwggFeAgEBMIG3MIGuMSYwJAYJKoZIhvcNAQkBFhdyb3NldHRhbmV0QG1lbmRlbHNvbi5kZTELMAkGA1UEBhMCREUxDzANBgNVBAgTBkJlcmxpbjEPMA0GA1UEBxMGQmVybGluMSIwIAYDVQQKExltZW5kZWxzb24tZS1jb21tZXJjZSBHbWJIMSIwIAYDVQQLExltZW5kZWxzb24tZS1jb21tZXJjZSBHbWJIMQ0wCwYDVQQDEwRtZW5kAgRDjv3zMA0GCWCGSAFlAwQCAQUAMA0GCSqGSIb3DQEBAQUABIGAznTWUclwMZW6PxrRqQd0JSBOv5Ge66Ip46RpYDQpQV/4Jo61+cB16ytqn07YXoz3DWr3MhcbiYz+3rjO3DPrBcLpg546gKgjnezQfDX5TJtSpUdVqjztFNiYwwUT/iDog606AUB8Evfcrnw88aOnNK/So3zNnGjrDUeUZFP1WAk= --_3ace996b6559464b90b8b436572c6bae_-- ```" 26060 area-System.Net Setting HttpWebRequest.ContentLength throws exception with incorrect message https://github.com/dotnet/corefx/blob/master/src/System.Net.Requests/src/System/Net/HttpWebRequest.cs#L239-L259 As you can see, it uses the `net_io_timeout_use_ge_zero` (Timeout can be only be set to 'System.Threading.Timeout.Infinite' or a value >= 0.) message, while it should have its own message. 26061 area-System.Security Hang in x509certificate build chain when using a ```Let's Encrypt``` cert. "In Ubuntu 16.04, dotnet core 2.0.3 Running a webhost console app with a server certificate issued by `Let's Encrypt` Server is listening to https://172.31.46.243:443 (my private IP address) Trying to run: ``` openssl s_client -connect <my-public-dns-name>:443 -msg ``` Output: ``` ubuntu@ip-172-31-46-243:~$ openssl s_client -connect <my-public-dns-name>:443 -msg CONNECTED(00000003) >>> TLS 1.2 [length 0005] 16 03 01 01 2c >>> TLS 1.2 Handshake [length 012c], ClientHello 01 00 01 28 03 03 0d 9b 38 e7 53 ba e2 ba 5b f1 11 23 57 2b 7b 18 e1 4a d7 2e 1c de d2 43 bb e6 2d f5 ab 43 bd fa 00 00 aa c0 30 c0 2c c0 28 c0 24 c0 14 c0 0a 00 a5 00 a3 00 a1 00 9f 00 6b 00 6a 00 69 00 68 00 39 00 38 00 37 00 36 00 88 00 87 00 86 00 85 c0 32 c0 2e c0 2a c0 26 c0 0f c0 05 00 9d 00 3d 00 35 00 84 c0 2f c0 2b c0 27 c0 23 c0 13 c0 88 00 a4 00 a2 00 a0 00 9e 00 67 00 40 00 3f 00 3e 00 33 00 32 00 31 00 30 00 9a 00 99 00 98 00 97 00 45 00 44 00 43 00 42 c0 31 c0 2d c0 29 c0 25 c0 0e c0 04 00 9c 00 3c 00 2f 00 96 00 41 c0 11 c0 07 c0 0c c0 02 00 05 00 04 c0 12 c0 08 00 16 00 13 00 10 00 0d c0 0d c0 03 00 0a 00 ff 01 00 00 55 00 0b 00 04 03 00 01 02 00 0a 00 1c 00 1a 00 17 00 19 00 1c 00 1b 00 18 00 1a 00 16 00 0e 00 0d 00 0b 00 0c 00 09 00 0a 00 23 00 00 00 0d 00 20 00 1e 06 01 06 02 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03 01 03 02 03 03 02 01 02 02 02 03 00 0f 00 01 01 <<< Here it gets stuck for about 2 minutes ``` I ran strace on the server app - during the handshake it tries to connect to 192.35.177.64 on port 80! This IP address belongs to a certificate authority (IdenTrust). The operation gets stuck (EINPROGRESS) because port 80 is not allowed for outbound connections on my server. Output of strace: ``` ubuntu@ip-172-31-46-243:~$ sudo strace -fp 5546 -Tfte trace=network strace: Process 5546 attached with 73 threads [pid 5571] 16:16:53 accept4(196, NULL, NULL, SOCK_CLOEXEC|SOCK_NONBLOCK) = 537 <0.000033> [pid 5571] 16:16:53 setsockopt(537, SOL_TCP, TCP_NODELAY, [1], 4) = 0 <0.000037> [pid 5571] 16:16:53 getpeername(537, {sa_family=AF_INET, sin_port=htons(33460), sin_addr=inet_addr(""<my-public-ip>"")}, [16]) = 0 <0.000034> [pid 5571] 16:16:53 getsockname(537, {sa_family=AF_INET, sin_port=htons(443), sin_addr=inet_addr(""172.31.46.243"")}, [16]) = 0 <0.000033> [pid 5571] 16:16:53 accept4(196, NULL, NULL, SOCK_CLOEXEC|SOCK_NONBLOCK) = -1 EAGAIN (Resource temporarily unavailable) <0.000033> strace: Process 5652 attached [pid 5652] 16:16:53 socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 538 <0.000045> [pid 5652] 16:16:53 connect(538, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr(""172.31.0.2"")}, 16) = 0 <0.000032> [pid 5652] 16:16:53 sendmmsg(538, {{{msg_name(0)=NULL, msg_iov(1)=[{""u\315\1\0\0\1\0\0\0\0\0\0\4apps\tidentrust\3com\0""..., 36}], msg_controllen=0, msg_flags=MSG_DONTROUTE|MSG_CTRUNC|MSG_EOR|MSG_WAITALL|MSG_FIN|MSG_SYN|MSG_NOSIGNAL|MSG_CMSG_CLOEXEC|0x13300010}, 36}, {{msg_name(0)=NULL, msg_iov(1)=[{""\21\215\1\0\0\1\0\0\0\0\0\0\4apps\tidentrust\3com\0""..., 36}], msg_controllen=0, msg_flags=MSG_EOR|MSG_WAITALL|MSG_RST|MSG_ERRQUEUE|MSG_MORE|MSG_CMSG_CLOEXEC|0x13680010}, 36}}, 2, MSG_NOSIGNAL) = 2 <0.000038> [pid 5652] 16:16:53 recvfrom(538, ""u\315\201\200\0\1\0\2\0\0\0\0\4apps\tidentrust\3com\0""..., 2048, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr(""172.31.0.2"")}, [16]) = 83 <0.000033> [pid 5652] 16:16:53 recvfrom(538, ""\21\215\201\200\0\1\0\1\0\1\0\0\4apps\tidentrust\3com\0""..., 65536, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr(""172.31.0.2"")}, [16]) = 115 <0.000039> [pid 5652] 16:16:53 +++ exited with 0 +++ [pid 5627] 16:16:53 socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 538 <0.000041> [pid 5627] 16:16:53 connect(538, {sa_family=AF_INET, sin_port=htons(80), sin_addr=inet_addr(""192.35.177.64"")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000027> strace: Process 5653 attached strace: Process 5654 attached strace: Process 5655 attached [pid 5571] 16:17:15 accept4(196, NULL, NULL, SOCK_CLOEXEC|SOCK_NONBLOCK) = 539 <0.000085> [pid 5571] 16:17:15 setsockopt(539, SOL_TCP, TCP_NODELAY, [1], 4) = 0 <0.000037> [pid 5571] 16:17:15 getpeername(539, {sa_family=AF_INET, sin_port=htons(64433), sin_addr=inet_addr(""52.39.142.198"")}, [16]) = 0 <0.000041> [pid 5571] 16:17:15 getsockname(539, {sa_family=AF_INET, sin_port=htons(443), sin_addr=inet_addr(""172.31.46.243"")}, [16]) = 0 <0.000040> [pid 5571] 16:17:15 accept4(196, NULL, NULL, SOCK_CLOEXEC|SOCK_NONBLOCK) = -1 EAGAIN (Resource temporarily unavailable) <0.000040> strace: Process 5659 attached [pid 5659] 16:17:15 socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 540 <0.000039> [pid 5659] 16:17:15 connect(540, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr(""172.31.0.2"")}, 16) = 0 <0.000021> [pid 5659] 16:17:15 sendmmsg(540, {{{msg_name(0)=NULL, msg_iov(1)=[{""\376\216\1\0\0\1\0\0\0\0\0\0\4apps\tidentrust\3com\0""..., 36}], msg_controllen=0, msg_flags=0}, 36}, {{msg_name(0)=NULL, msg_iov(1)=[{""~\25\1\0\0\1\0\0\0\0\0\0\4apps\tidentrust\3com\0""..., 36}], msg_controllen=0, msg_flags=0}, 36}}, 2, MSG_NOSIGNAL) = 2 <0.000034> [pid 5659] 16:17:15 recvfrom(540, ""\376\216\201\200\0\1\0\2\0\0\0\0\4apps\tidentrust\3com\0""..., 2048, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr(""172.31.0.2"")}, [16]) = 83 <0.000047> [pid 5659] 16:17:15 recvfrom(540, ""~\25\201\200\0\1\0\1\0\1\0\0\4apps\tidentrust\3com\0""..., 65536, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr(""172.31.0.2"")}, [16]) = 115 <0.000023> [pid 5659] 16:17:15 +++ exited with 0 +++ [pid 5632] 16:17:15 socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 540 <0.000029> [pid 5632] 16:17:15 connect(540, {sa_family=AF_INET, sin_port=htons(80), sin_addr=inet_addr(""192.35.177.64"")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000028> strace: Process 5660 attached [pid 5571] 16:17:15 accept4(196, NULL, NULL, SOCK_CLOEXEC|SOCK_NONBLOCK) = 541 <0.000063> [pid 5571] 16:17:15 setsockopt(541, SOL_TCP, TCP_NODELAY, [1], 4) = 0 <0.000037> [pid 5571] 16:17:15 getpeername(541, {sa_family=AF_INET, sin_port=htons(64435), sin_addr=inet_addr(""52.39.142.198"")}, [16]) = 0 <0.000031> [pid 5571] 16:17:15 getsockname(541, {sa_family=AF_INET, sin_port=htons(443), sin_addr=inet_addr(""172.31.46.243"")}, [16]) = 0 <0.000031> [pid 5571] 16:17:15 accept4(196, NULL, NULL, SOCK_CLOEXEC|SOCK_NONBLOCK) = -1 EAGAIN (Resource temporarily unavailable) <0.000039> strace: Process 5661 attached [pid 5661] 16:17:15 socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 542 <0.000057> [pid 5661] 16:17:15 connect(542, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr(""172.31.0.2"")}, 16) = 0 <0.000053> [pid 5661] 16:17:15 sendmmsg(542, {{{msg_name(0)=NULL, msg_iov(1)=[{""M\24\1\0\0\1\0\0\0\0\0\0\4apps\tidentrust\3com\0""..., 36}], msg_controllen=0, msg_flags=0}, 36}, {{msg_name(0)=NULL, msg_iov(1)=[{""\300\36\1\0\0\1\0\0\0\0\0\0\4apps\tidentrust\3com\0""..., 36}], msg_controllen=0, msg_flags=0}, 36}}, 2, MSG_NOSIGNAL) = 2 <0.000042> [pid 5661] 16:17:15 recvfrom(542, ""M\24\201\200\0\1\0\2\0\0\0\0\4apps\tidentrust\3com\0""..., 2048, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr(""172.31.0.2"")}, [16]) = 83 <0.000058> [pid 5661] 16:17:15 recvfrom(542, ""\300\36\201\200\0\1\0\1\0\1\0\0\4apps\tidentrust\3com\0""..., 65536, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr(""172.31.0.2"")}, [16]) = 115 <0.000042> [pid 5661] 16:17:15 +++ exited with 0 +++ [pid 5622] 16:17:15 socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 542 <0.000040> [pid 5622] 16:17:15 connect(542, {sa_family=AF_INET, sin_port=htons(80), sin_addr=inet_addr(""192.35.177.64"")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000047> ``` Also tried to install the CA certificates (Let's Encrypt Authority X3 and DST Root CA X3) in the OS using both .NET API and update-ca-certificates. Doesn't help. (As described here: https://github.com/dotnet/corefx/issues/16879) Opening port 80 (outbound) solves the issue and the handshake completes successfully. Is there a way to do a TLS handshake on Linux without allowing outbound connections on http port 80? " 26062 area-System.Data Updating the Odbc setup instructions Making corrections to the initial commit. Updates document with instructions on how to setup ODBC driver. cc: @safern 26063 area-System.Net port test fixes from master This is port of fixes for flaky networking tests ( #18907 #23533) Original PR: #24615 #24099 26064 area-System.Data DbConnectionPool shouldn't capture AsyncLocals into its Timer Causing those AsyncLocal values to live forever As seen in https://github.com/dotnet/corefx/issues/25477#issuecomment-346866897 For ASP.NET Core can capture logging scope, HttpContext, ConcurrentBag items, Authentication (example https://github.com/dotnet/corefx/issues/25477#issuecomment-346866897); other state etc 26065 area-System.Data Don't capture AsyncLocals into SQL global timers Contributes to https://github.com/dotnet/corefx/issues/26064 26066 area-System.Data Don't capture AsyncLocals into ODBC ConnPool Contributes to #26064 26067 area-System.Net HttpConnectionPools shouldn't capture AsyncLocals into its Timer Causing those AsyncLocal values to live forever For ASP.NET Core can capture logging scope, HttpContext, ConcurrentBag items, Authentication (example https://github.com/dotnet/corefx/issues/25477#issuecomment-346866897) etc 26068 area-System.Net Don't capture AsyncLocals into HttpConnectionPools timer Resolves https://github.com/dotnet/corefx/issues/26067 26069 area-System.Diagnostics Activity shouldn't capture AsyncLocals into its Timer Causing those AsyncLocal values to live forever For ASP.NET Core can capture logging scope, HttpContext, ConcurrentBag items, Authentication (example https://github.com/dotnet/corefx/issues/25477#issuecomment-346866897); other state etc 26071 area-System.Diagnostics Activity shouldn't capture AsyncLocals into its Timer Causing those AsyncLocal values to live forever For ASP.NET Core can capture logging scope, HttpContext, ConcurrentBag items, Authentication (example #25477 (comment)); other state etc Resolves https://github.com/dotnet/corefx/issues/26069 26072 area-System.Net NetworkChange should capture AsyncLocals (but not to its static Timer) Causing those AsyncLocal values to live forever For ASP.NET Core can capture logging scope, HttpContext, ConcurrentBag items, Authentication (example https://github.com/dotnet/corefx/issues/25477#issuecomment-346866897); other state etc 26073 area-System.Net NetworkChange should capture AsyncLocals (but not to Timer) Resolves https://github.com/dotnet/corefx/issues/26072 26074 area-System.Diagnostics EventCounter shouldn't capture AsyncLocals into its Timer Causing those AsyncLocal values to live as long as the EventCounter for no benefit For ASP.NET Core can capture logging scope, HttpContext, ConcurrentBag items, Authentication (example https://github.com/dotnet/corefx/issues/25477#issuecomment-346866897); other state etc 26075 area-System.Diagnostics Don't capture AsyncLocals into EventCounter timer Resolves: https://github.com/dotnet/corefx/issues/26074 26076 area-System.Runtime MemoryCache shouldn't capture AsyncLocals into its Timer Causing those AsyncLocal values to live forever for the default cache and as long as the cache for custom caches For ASP.NET Core can capture logging scope, HttpContext, ConcurrentBag items, Authentication (example https://github.com/dotnet/corefx/issues/25477#issuecomment-346866897); other state etc 26077 area-System.Runtime Don't capture AsyncLocals into MemoryCache timer Resolves https://github.com/dotnet/corefx/issues/26076 26078 area-System.Net ManagedWebSocket.ReceiveAsyncPrivate: Object reference not set to an instance of an object. Running on ASP.NET Core 2.0.3 under IIS. I'm not sure of the exact repo that's causing this but I'm seeing a few hundred of these exceptions and figured I'd report it :).. I can link to the code that calls receive if required.. ``` System.OperationCanceledException: Aborted ---> System.NullReferenceException: Object reference not set to an instance of an object. at System.Net.WebSockets.ManagedWebSocket.<ReceiveAsyncPrivate>d__61.MoveNext() at offset 276 --- End of inner exception stack trace --- at System.Net.WebSockets.ManagedWebSocket.<ReceiveAsyncPrivate>d__61.MoveNext() at offset 1611 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at offset 12 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task task) at offset 68 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task task) at offset 40 ``` ```cs private async Task Receive(WebSocket socket, Action<WebSocketReceiveResult, string> handleMessage) { var buffer = new ArraySegment<byte>(new byte[1024 * 4]); var result = await socket.ReceiveAsync(buffer, CancellationToken.None); //.... } ``` 26079 area-System.Runtime Proposal: add GetEnvironmentVariableAsBool to netstandard @diddledan commented on [Tue Dec 19 2017](https://github.com/dotnet/standard/issues/608) Currently the dotnet cli has a function which is located at: [src/Microsoft.DotNet.Cli.Utils/EnvironmentProvider.cs Line 106](https://github.com/dotnet/cli/blob/fffe3142ad8043743d83885df2166fd2f80dceca/src/Microsoft.DotNet.Cli.Utils/EnvironmentProvider.cs#L106) I think it would be useful to consider this functionality for inclusion into the `System.Environment` namespace. This issue is to raise the idea and garner discussion. I do not believe it would conflict with anything already present, though I've not performed a thorough examination to prove it. --- @danmosemsft commented on [Wed Dec 27 2017](https://github.com/dotnet/standard/issues/608#issuecomment-354183176) @diddledan the right place to propose new API is the corefx repo... 26080 area-System.Net Fix wrong resource string used for Content-Length < 0 exception Fixes #26060 26083 area-System.Xml Changing XPathNodeIterator to implement IEnumerable<XPathNodeNavigator>. Closes #1593. Implemented so there is no breaking change. 26084 area-System.Threading System.Threading.AccessControl won't load from asp.net Core 2.0 (netcoreapp2.0) website "# System.Threading.AccessControl won't load from asp.net Core 2.0 (netcoreapp2.0) website Referencing .net 4.5.1 framework class library from asp.net Core 2.0 (netcoreapp2.0), where class library references System.Threading.AccessControl leads to receives FileNotFound exception. **System.IO.FileNotFoundException** occurred HResult=0x80070002 Message=Could not load file or assembly '**System.Threading.AccessControl**, Version=4.0.2.0, ``` Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. Source=Util StackTrace: at Util.MutexTest..ctor(String name) in C:\temp\projects\DotNetCore20MutexSetAccessControl\Util\MutexTest.cs:line 18 at DotNetCore20MutexSetAccessControl.Controllers.HomeController.Index() in C:\temp\projects\DotNetCore20MutexSetAccessControl\spa\Controllers\HomeController.cs:line 11 at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeActionMethodAsync>d__12.MoveNext() ``` # Repro Problem solution uploaded to [DotNetCore20MutexSetAccessControl](https://github.com/CarlosOnline/DotNetCore20MutexSetAccessControl.git) # Manual Repro dotnet new --install ""Microsoft.AspNetCore.SpaTemplates"" dotnet new aurelia npm intstall add new Utils .Net Framework 4.51 project (version doesn't matter) add class below to Utils .Net Framework 4.51 ```c# using System.Security.AccessControl; using System.Security.Principal; using System.Threading; namespace Util { public class MutexTest { public MutexTest(string name) { var mutexId = $""Global\\{name}""; var mutex = new Mutex(false, mutexId); var allowEveryoneRule = new MutexAccessRule(new SecurityIdentifier(WellKnownSidType.WorldSid, null), MutexRights.FullControl, AccessControlType.Allow); var securitySettings = new MutexSecurity(); securitySettings.AddAccessRule(allowEveryoneRule); mutex.SetAccessControl(securitySettings); } } } ``` add Utils project reference to asp.net core app project update HomeController.cs ```c# using System.Diagnostics; using Microsoft.AspNetCore.Mvc; using Util; namespace DotNetCore20MutexSetAccessControl.Controllers { public class HomeController : Controller { public IActionResult Index() { var mutexTest = new MutexTest(""MyTest""); return View(); } public IActionResult Error() { ViewData[""RequestId""] = Activity.Current?.Id ?? HttpContext.TraceIdentifier; return View(); } } } ``` start debugging [EDIT] Add C# syntax highlighting by @karelz" 26085 area-System.Drawing Windows server 2012/2016 System.Drawing is not supported on this platform On .Net core 2.0, Windows server 2012/2016, when trying to get a thumbnail (Image.GetThumbnail()) I am getting an exception System.Drawing is not supported on this platform. This happens for most of the image types, where this seems to be working on Window 10 Desktop 26086 area-System.Collections Stack<T> optimization of (Try)Peek, (Try)Pop and Push "# Description Enabled RCE on array-access and avoided the explicit check for `_size == 0` --> this is done implicitly in the ""RCE-if"". So some `cmp`s can be saved. By _Pop_ the effect on value types is not so big, than for reference types (two array accesses). This PR is a kind of extension to https://github.com/dotnet/corefx/issues/17318 # Benchmarks ## Notes Code for benchmarks lives [here](https://github.com/gfoidl/Benchmarks/tree/master/corefx/System/Collections/Generic/Stack/source/StackBenchmarks) Due the use of http://benchmarkdotnet.org the benchmarks were done a couple of times, because some crazy results with perf x2 were reported and this seems too strange. The results shown here are the more realistic ones. Individual results are in the linked repo above. The changes from this PR never showed a decrease in perf. ## Peek ``` ini BenchmarkDotNet=v0.10.11, OS=ubuntu 16.04 Processor=Intel Xeon CPU 2.60GHz, ProcessorCount=2 .NET Core SDK=2.1.3 [Host] : .NET Core 2.0.4 (Framework 4.6.0.0), 64bit RyuJIT DefaultJob : .NET Core 2.0.4 (Framework 4.6.0.0), 64bit RyuJIT ``` | Method | Mean | Error | StdDev | Scaled | ScaledSD | |------------- |---------:|----------:|----------:|-------:|---------:| | Peek_Default | 1.974 ns | 0.1229 ns | 0.2020 ns | 1.00 | 0.00 | | Peek_New | 1.600 ns | 0.1231 ns | 0.2023 ns | 0.82 | 0.13 | ## TryPeek ``` ini BenchmarkDotNet=v0.10.11, OS=ubuntu 16.04 Processor=Intel Xeon CPU 2.60GHz, ProcessorCount=2 .NET Core SDK=2.1.3 [Host] : .NET Core 2.0.4 (Framework 4.6.0.0), 64bit RyuJIT DefaultJob : .NET Core 2.0.4 (Framework 4.6.0.0), 64bit RyuJIT ``` | Method | Mean | Error | StdDev | Median | Scaled | ScaledSD | |---------------- |---------:|----------:|----------:|---------:|-------:|---------:| | TryPeek_Default | 5.212 ns | 0.1905 ns | 0.3977 ns | 5.178 ns | 1.00 | 0.00 | | TryPeek_New | 3.982 ns | 0.1716 ns | 0.4640 ns | 3.798 ns | 0.77 | 0.11 | ## Pop ``` ini BenchmarkDotNet=v0.10.11, OS=ubuntu 16.04 Processor=Intel Xeon CPU 2.60GHz, ProcessorCount=2 .NET Core SDK=2.1.3 [Host] : .NET Core 2.0.4 (Framework 4.6.0.0), 64bit RyuJIT DefaultJob : .NET Core 2.0.4 (Framework 4.6.0.0), 64bit RyuJIT ``` | Method | Mean | Error | StdDev | Scaled | ScaledSD | |------------ |----------:|----------:|----------:|-------:|---------:| | Pop_Default | 1.0609 ns | 0.0673 ns | 0.0630 ns | 1.00 | 0.00 | | Pop_New | 0.8681 ns | 0.1036 ns | 0.0918 ns | 0.82 | 0.10 | ## TryPop ``` ini BenchmarkDotNet=v0.10.11, OS=ubuntu 16.04 Processor=Intel Xeon CPU 2.60GHz, ProcessorCount=2 .NET Core SDK=2.1.3 [Host] : .NET Core 2.0.4 (Framework 4.6.0.0), 64bit RyuJIT DefaultJob : .NET Core 2.0.4 (Framework 4.6.0.0), 64bit RyuJIT ``` | Method | Mean | Error | StdDev | Scaled | ScaledSD | |--------------- |---------:|----------:|----------:|-------:|---------:| | TryPop_Default | 3.180 ns | 0.0644 ns | 0.0571 ns | 1.00 | 0.00 | | TryPop_New | 2.736 ns | 0.1200 ns | 0.1123 ns | 0.86 | 0.04 | # Notes ## Push I did some trials for `Push` too, but the results weren't satisfying. Sometimes it was faster, sometimes slower. On Linux it was nearly always slower. So I reverted the change. Changes were done in the commit https://github.com/gfoidl/corefx/commit/012333094dd2b2052eaf6daebaaba2a98f25d2b1 ## Inlining `MethodImplOptions.AggressiveInlining` would give a perf win on the benchmarks, because they are micro-benchmarks. Due to inlining the callsite gets bigger and in real world scenarios the perf might decrease. I ran a benchmark where this happended, unfortunately I can't show the code because it's proprietary. From https://github.com/dotnet/corefx/pull/12094#issuecomment-249834575 > But we shouldn't add AggressiveInlining unless there's a strong performance-motivated scenario for doing so. Getting something to inline isn't a goal in and of itself. On the other side `List.Add` has AggressiveInlining -- cf. https://github.com/dotnet/coreclr/blob/master/src/mscorlib/shared/System/Collections/Generic/List.cs#L225 I would stick to not aggressive inline, but what to do? " 26087 area-System.Collections Queue<T> optimization of (Try)Dequeue "# Description * enabled RCE on array-access * in MoveNext the JIT can produce better code (see https://github.com/dotnet/corefx/pull/25970#discussion_r157375261) By _Dequeue_ the effect on value types is not so big, than for reference types (two array accesses). This PR is a kind of extension to #17318, similar to https://github.com/dotnet/corefx/pull/26086 # Benchmarks ## Notes Code for benchmarks lives [here](https://github.com/gfoidl/Benchmarks/tree/master/corefx/System/Collections/Generic/Queue/source/QueueBenchmarks) Due the use of http://benchmarkdotnet.org the benchmarks were done a couple of times, because some crazy results with perf x2 were reported and this seems too strange. The results shown here are the more realistic ones. Individual results are in the linked repo above. The changes from this PR never showed a decrease in perf. ## Dequeue ``` ini BenchmarkDotNet=v0.10.11, OS=ubuntu 16.04 Processor=Intel Xeon CPU 2.60GHz, ProcessorCount=2 .NET Core SDK=2.1.3 [Host] : .NET Core 2.0.4 (Framework 4.6.0.0), 64bit RyuJIT DefaultJob : .NET Core 2.0.4 (Framework 4.6.0.0), 64bit RyuJIT ``` | Method | Mean | Error | StdDev | Scaled | ScaledSD | |---------------- |----------:|----------:|----------:|-------:|---------:| | Dequeue_Default | 0.9702 ns | 0.1013 ns | 0.1421 ns | 1.00 | 0.00 | | Dequeue_New | 0.8880 ns | 0.1042 ns | 0.1770 ns | 0.93 | 0.22 | ## TryDequeue ``` ini BenchmarkDotNet=v0.10.11, OS=ubuntu 16.04 Processor=Intel Xeon CPU 2.60GHz, ProcessorCount=2 .NET Core SDK=2.1.3 [Host] : .NET Core 2.0.4 (Framework 4.6.0.0), 64bit RyuJIT DefaultJob : .NET Core 2.0.4 (Framework 4.6.0.0), 64bit RyuJIT ``` | Method | Mean | Error | StdDev | Scaled | ScaledSD | |------------------- |---------:|----------:|----------:|-------:|---------:| | TryDequeue_Default | 3.990 ns | 0.1666 ns | 0.2545 ns | 1.00 | 0.00 | | TryDequeue_New | 3.559 ns | 0.1585 ns | 0.2273 ns | 0.90 | 0.08 | # Notes ## Enqueue Didn't find a way to improve perf, besides the effect of better JIT-codegen in _MoveNext_. Remained Untouched. ## (Try)Peek Didn't find a way to improve perf, and ""RCE-if"" does not bring a win, it's getting rather slower, because the code gets bigger. I didn't keep benchmark-records for this case. Remained untouched. " 26089 area-System.IO Compression Dispose_WithUnfinishedWriteAsync Fail `Windows.7.Amd64.Open-Release-x86` https://github.com/dotnet/corefx/pull/26086#issuecomment-354316908 System.IO.Compression.DeflateStreamUnitTests/Dispose_WithUnfinishedWriteAsync [FAIL] ``` System.IO.Compression.DeflateStreamUnitTests/Dispose_WithUnfinishedWriteAsync Assert.Throws() Failure Expected: typeof(System.AggregateException) Actual: (No exception was thrown) at System.IO.Compression.CompressionStreamUnitTestBase.<Dispose_WithUnfinishedWriteAsync>d__5.MoveNext() in D:\j\workspace\windows-TGrou---f8ac6754\src\Common\tests\System\IO\Compression\CompressionStreamUnitTestBase.cs:line 208 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ``` https://github.com/dotnet/corefx/pull/26068#issuecomment-354036924 System.IO.Compression.GzipStreamUnitTests.Dispose_WithUnfinishedWriteAsync [FAIL] ``` 17:19:30 xUnit.net Console Runner (64-bit Desktop .NET 4.0.30319.42000) 17:19:31 Discovering: System.IO.Compression.Tests 17:19:31 Discovered: System.IO.Compression.Tests 17:19:31 Starting: System.IO.Compression.Tests 17:19:34 System.IO.Compression.GzipStreamUnitTests.Dispose_WithUnfinishedWriteAsync [FAIL] 17:19:34 Assert.False() Failure 17:19:34 Expected: False 17:19:34 Actual: True 17:19:34 Stack Trace: 17:19:34 at System.IO.Compression.CompressionStreamUnitTestBase.<Dispose_WithUnfinishedWriteAsync>d__5.MoveNext() 17:19:34 --- End of stack trace from previous location where exception was thrown --- 17:19:34 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 17:19:34 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 17:19:34 --- End of stack trace from previous location where exception was thrown --- 17:19:34 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 17:19:34 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 17:19:34 --- End of stack trace from previous location where exception was thrown --- 17:19:34 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 17:19:34 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 17:19:36 Finished: System.Collections.Concurrent.Tests ``` 26091 area-System.Net [ManagedHandler] Test failure: System.Net.Http.Functional.Tests.ManagedHandler_HttpClientHandler_ServerCertificates_Test / UseCallback_ValidCertificate_ExpectedValuesDuringCallback ## Types of failures ``` System.Net.Http.HttpRequestException : The SSL connection could not be established, see inner exception. ---- Expected None, got RemoteCertificateChainErrors with chain status RevocationStatusUnknown Expected: True Actual: False at System.Net.Http.HttpConnectionHandler.<>c__DisplayClass5_0.<EstablishSslConnection>b__0(Object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) in /root/corefx-1245305/src/System.Net.Http/src/System/Net/Http/Managed/HttpConnectionHandler.cs:line 59 at System.Net.Security.SecureChannel.VerifyRemoteCertificate(RemoteCertValidationCallback remoteCertValidationCallback, ProtocolToken& alertToken) in /root/corefx-1245305/src/System.Net.Security/src/System/Net/Security/SecureChannel.cs:line 1026 at System.Net.Security.SslState.CompleteHandshake(ProtocolToken& alertToken) in /root/corefx-1245305/src/System.Net.Security/src/System/Net/Security/SslState.cs:line 1015 at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest) in /root/corefx-1245305/src/System.Net.Security/src/System/Net/Security/SslState.cs:line 809 at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) in /root/corefx-1245305/src/System.Net.Security/src/System/Net/Security/SslState.cs:line 793 at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest) in /root/corefx-1245305/src/System.Net.Security/src/System/Net/Security/SslState.cs:line 962 at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest) in /root/corefx-1245305/src/System.Net.Security/src/System/Net/Security/SslState.cs:line 865 at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest) in /root/corefx-1245305/src/System.Net.Security/src/System/Net/Security/SslState.cs:line 822 at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) in /root/corefx-1245305/src/System.Net.Security/src/System/Net/Security/SslState.cs:line 793 at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest) in /root/corefx-1245305/src/System.Net.Security/src/System/Net/Security/SslState.cs:line 962 at System.Net.Security.SslState.PartialFrameCallback(AsyncProtocolRequest asyncRequest) in /root/corefx-1245305/src/System.Net.Security/src/System/Net/Security/SslState.cs:line 1096 --- End of stack trace from previous location where exception was thrown --- ``` ## History of failures Date | Build | OS | Details -- | -- | -- | -- 12/17 | 20171217.01 | Centos73 | [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171217.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.ManagedHandler_HttpClientHandler_ServerCertificates_Test~2FUseCallback_ValidCertificate_ExpectedValuesDuringCallback(url:%20https:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx,%20checkRevocation:%20True)) 12/23 | 20171223.01 | Centos73 | [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171223.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.ManagedHandler_HttpClientHandler_ServerCertificates_Test~2FUseCallback_ValidCertificate_ExpectedValuesDuringCallback(url:%20https:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx,%20checkRevocation:%20True)) Similar failure to old one (from 2017/7) on Mac: #21922 26092 area-System.Net [Windows] Test failures: The operation has been cancelled / The handle is invalid / etc. ## Types of failures Affected tests: Test | # | Test type / notes -- | -- | -- MaxResponseContentBufferSize_ThrowsIfTooSmallForContent | 11x | System.Net.Http.Functional.Tests.HttpClientTest / System.Net.Http.Functional.Tests.HttpProtocolTests GetAsync_SupportedSSLVersion_Succeeds | 9x | System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test<br/>Note: also known dependency on SslLabs remote server - #25878) GetAsync_RedirectResponseHasCookie_CookieSentToFinalUri | 7x | System.Net.Http.Functional.Tests.HttpClientHandlerTest PostAsync_EmptyContent_ContentTypeHeaderNotSent | 6x | System.Net.Http.Functional.Tests.PostScenarioTest GetAsync_SetCookieContainer_CookieSent | 6x | System.Net.Http.Functional.Tests.PlatformHandler_HttpCookieProtocolTests GetAsync_TrailingHeaders_Ignored | 5x | System.Net.Http.Functional.Tests.HttpClientHandlerTest PostRewindableContentUsingAuth_NoPreAuthenticate_Success | 5x | System.Net.Http.Functional.Tests.PostScenarioTest ThresholdExceeded_ThrowsException | 5x | System.Net.Http.Functional.Tests.HttpClientHandler_MaxResponseHeadersLength_Test PostAsync_CallMethod_EmptyContent | 4x | System.Net.Http.Functional.Tests.HttpClientHandlerTest PostUsingChunkedEncoding_Success | 4x | System.Net.Http.Functional.Tests.PostScenarioTest System.Net.Http.Functional.Tests.PostScenarioTest PostLongerContentLengths_UsesChunkedSemantics | 4x | System.Net.Http.Functional.Tests.PostScenarioTest PostSyncBlockingContentUsingChunkedEncoding_Success | 3x | System.Net.Http.Functional.Tests.PostScenarioTest GetStreamAsync_ReadZeroBytes_Success | 3x | System.Net.Http.Functional.Tests.ResponseStreamTest NoCallback_ValidCertificate_CallbackNotCalled | 3x | System.Net.Http.WinHttpHandlerFunctional.Tests.ServerCertificateTest PostEmptyContentUsingConflictingSemantics_Success | 3x | System.Net.Http.Functional.Tests.PostScenarioTest GetAsync_SetCookieContainer_CookieSent | 3x | System.Net.Http.Functional.Tests.HttpCookieProtocolTests PostUsingNoSpecifiedSemantics_UsesChunkedSemantics | 2x | System.Net.Http.Functional.Tests.PostScenarioTest GetAsync_Max1_ConcurrentCallsStillSucceed | 1x | System.Net.Http.Functional.Tests.HttpClientHandler_MaxConnectionsPerServer_Test Timeout_SetTo30AndGetResponseFromLoopbackQuickly_Success | 1x | System.Net.Http.Functional.Tests.HttpClientTest GetAsync_UseResponseHeadersReadAndCallLoadIntoBuffer_Success | 1x | System.Net.Http.Functional.Tests.ResponseStreamTest PostEmptyContentUsingChunkedEncoding_Success | 1x | System.Net.Http.Functional.Tests.PostScenarioTest PostRepeatedFlushContentUsingChunkedEncoding_Success | 1x | System.Net.Http.Functional.Tests.PostScenarioTest PostAsync_CallMethod_NullContent | 1x | System.Net.Http.Functional.Tests.HttpClientHandlerTest GetAsync_UnknownRequestVersion_ThrowsOrDegradesTo11 | 1x | System.Net.Http.Functional.Tests.HttpProtocolTests_Dribble HttpClientHandler_Authentication_Succeeds | 1x | System.Net.Http.Functional.Tests.HttpClientHandler_Authentication_Test HttpClientHandler_IncorrectCredentials_Fails | 1x | System.Net.Http.Functional.Tests.HttpClientHandler_Authentication_Test SendAsync_SendSameRequestMultipleTimesDirectlyOnHandler_Success | 1x | System.Net.Http.Functional.Tests.PlatformHandler_HttpClientHandlerTest Similar to bugs: * #25896 - `GetAsync_MaxLimited_ConcurrentCallsStillSucceed ` * #25902 - `PostAsync_CallMethod_StreamContent` * #25912 - `UseCallback_NotSecureConnection_CallbackNotCalled` * #25880 - `GetAsync_ExpectedStatusCodeAndReason_Success` * #25981 - `GetStreamAsync_ReadToEnd_Success` * #25980 - `GetAsync_AllowedSSLVersion_Succeeds` * #25904 - `PostAsync_ReuseRequestContent_Success` * #24275 - `GetAsync_ServerNeedsNonStandardAuthAndSetCredential_StatusCodeUnauthorized ` * #20024 - `ReadAsStreamAsync_ValidServerResponse_Success` * #25983 - `ProxyExplicitlyProvided_DefaultCredentials_Ignored` * #25977 - `PostUsingContentLengthSemantics_Success` * #24276 - `SetDelegate_ConnectionSucceeds ` ### The operation has been canceled ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.WinHttpException : The operation has been canceled ``` ### The handle is in the wrong state for the requested operation ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.WinHttpException : The handle is in the wrong state for the requested operation ``` ### The handle is invalid ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.WinHttpException : The handle is invalid ``` ### IOException: The handle is invalid ``` System.Net.Http.HttpRequestException : Error while copying content to a stream. ---- System.IO.IOException : The write operation failed, see inner exception. -------- System.Net.Http.WinHttpException : The handle is invalid ``` ### The operation timed out ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.WinHttpException : The operation timed out ``` ## History of failures Day | Build | OS | Error message | Test -- | -- | -- | -- | -- 5/9 | 20170509.01 | Win7 | The handle is in the wrong state for the requested operation | PostUsingChunkedEncoding_Success 5/9 | 20170509.01 | Win7 | The handle is invalid | Timeout_SetTo30AndGetResponseFromLoopbackQuickly_Success 5/15 | 20170515.02 | Win10 | The operation has been canceled | GetAsync_UseResponseHeadersReadAndCallLoadIntoBuffer_Success 5/16 | 20170516.02 | Win10 | The operation has been canceled | GetAsync_SupportedSSLVersion_Succeeds 5/21 | 20170521.02 | Win10 | The operation has been canceled | GetAsync_Max1_ConcurrentCallsStillSucceed 5/21 | 20170521.02 | Win7 | The operation has been canceled | GetAsync_TrailingHeaders_Ignored 5/26 | 20170526.01 | Win7 | The handle is invalid | PostLongerContentLengths_UsesChunkedSemantics 5/30 | 20170530.06 | Win10 | The operation has been canceled | PostUsingChunkedEncoding_Success 5/31 | 20170601.01 | Win10 | The operation has been canceled | PostAsync_CallMethod_EmptyContent 6/7 | 20170607.01 | Win7 | The handle is invalid | PostSyncBlockingContentUsingChunkedEncoding_Success 6/12 | 20170612.02 | Win7 | The operation has been canceled | PostAsync_EmptyContent_ContentTypeHeaderNotSent 6/16 | 20170616.01 | Win7 | The handle is invalid | PostAsync_CallMethod_EmptyContent 6/22 | 20170622.03 | Win8.1 | The operation has been canceled | GetStreamAsync_ReadZeroBytes_Success 10/3 | 20171003.01 | Win7 | The operation has been canceled | PostAsync_CallMethod_EmptyContent 10/8 | 20171008.02 | Win7 | The operation has been canceled | NoCallback_ValidCertificate_CallbackNotCalled 10/8 | 20171008.02 | Win8.1 | The operation has been canceled | NoCallback_ValidCertificate_CallbackNotCalled 10/15 | 20171015.02 | Win7 | The operation has been canceled | PostSyncBlockingContentUsingChunkedEncoding_Success 10/19 | 20171019.02 | Win7 | The operation has been canceled | GetAsync_SupportedSSLVersion_Succeeds 10/20 | 20171020.01 | Win8.1 | The operation has been canceled | GetAsync_RedirectResponseHasCookie_CookieSentToFinalUri 10/20 | 20171020.01 | Win8.1 | The operation has been canceled | PostAsync_EmptyContent_ContentTypeHeaderNotSent 10/22 | 20171022.01 | Win7 | The handle is invalid | MaxResponseContentBufferSize_ThrowsIfTooSmallForContent 10/22 | 20171022.02 | Win7 | The handle is invalid | MaxResponseContentBufferSize_ThrowsIfTooSmallForContent 10/23 | 20171023.01 | Win10 | The operation has been canceled | PostUsingNoSpecifiedSemantics_UsesChunkedSemantics 10/25 | 20171025.08 | Win7 | The handle is invalid | PostRewindableContentUsingAuth_NoPreAuthenticate_Success 10/30 | 20171030.01 | Win7 | The handle is invalid | PostRewindableContentUsingAuth_NoPreAuthenticate_Success 10/30 | 20171030.02 | Win7 | The handle is invalid | GetAsync_SupportedSSLVersion_Succeeds 11/3 | 20171103.07 | Win7 | The operation has been canceled | GetStreamAsync_ReadZeroBytes_Success 11/4 | 20171104.04 | Win7 | The operation has been canceled | MaxResponseContentBufferSize_ThrowsIfTooSmallForContent 11/6 | 20171106.01 | Win7 | The handle is invalid | PostRewindableContentUsingAuth_NoPreAuthenticate_Success 11/7 | 20171107.02 | Win7 | The handle is in the wrong state for the requested operation | GetAsync_SupportedSSLVersion_Succeeds 11/8 | 20171108.01 | Win7 | The operation has been canceled | PostEmptyContentUsingConflictingSemantics_Success 11/15 | 20171115.01 | Win7 | The handle is in the wrong state for the requested operation | GetAsync_SupportedSSLVersion_Succeeds 11/15 | 20171115.01 | Win7 | The operation has been canceled | GetAsync_RedirectResponseHasCookie_CookieSentToFinalUri 11/15 | 20171115.02 | Win7 | The handle is invalid | PostAsync_EmptyContent_ContentTypeHeaderNotSent 11/15 | 20171115.03 | Win7 | The handle is invalid | GetAsync_TrailingHeaders_Ignored 11/16 | 20171116.54 | Win7 | The operation has been canceled | PostSyncBlockingContentUsingChunkedEncoding_Success 11/18 | 20171118.04 | Win7 | The handle is invalid | GetStreamAsync_ReadZeroBytes_Success 11/18 | 20171118.04 | Win8.1 | The operation has been canceled | GetAsync_TrailingHeaders_Ignored 11/20 | 20171120.01 | Win10 | The operation has been canceled | PostLongerContentLengths_UsesChunkedSemantics 11/20 | 20171120.01 | Win7 | The handle is invalid | GetAsync_TrailingHeaders_Ignored 11/22 | 20171122.01 | Win10 | The operation has been canceled | PostEmptyContentUsingChunkedEncoding_Success 11/22 | 20171122.01 | Win8.1 | The operation has been canceled | PostAsync_CallMethod_EmptyContent 11/28 | 20171128.07 | Win10 | The operation has been canceled | PostLongerContentLengths_UsesChunkedSemantics 11/29 | 20171129.02 | Win8.1 | The operation has been canceled | PostAsync_EmptyContent_ContentTypeHeaderNotSent 12/8 | 20171208.01 | Win7 | The handle is invalid | PostAsync_EmptyContent_ContentTypeHeaderNotSent 12/13 | 20171213.02 | Win8.1 | The operation has been canceled | MaxResponseContentBufferSize_ThrowsIfTooSmallForContent 12/13 | 20171213.08 | Win7 | IOException: The handle is invalid | PostUsingChunkedEncoding_Success 12/15 | 20171215.05 | Win7 | The handle is in the wrong state for the requested operation | GetAsync_SupportedSSLVersion_Succeeds 12/16 | 20171216.01 | Win7 | The operation has been canceled | GetAsync_RedirectResponseHasCookie_CookieSentToFinalUri 12/16 | 20171216.03 | Win8.1 | The operation has been canceled | MaxResponseContentBufferSize_ThrowsIfTooSmallForContent 12/17 | 20171217.01 | Win7 | The handle is invalid | MaxResponseContentBufferSize_ThrowsIfTooSmallForContent 12/23 | 20171223.02 | Win7 | The handle is invalid | GetAsync_RedirectResponseHasCookie_CookieSentToFinalUri - only in [catastrophic failure log](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171223.02/workItem/System.Net.Http.Functional.Tests/wilogs) 12/31 | 20171231.02 | Win7 | The handle is in the wrong state for the requested operation | GetAsync_SupportedSSLVersion_Succeeds - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171231.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test~2FGetAsync_SupportedSSLVersion_Succeeds(sslProtocols:%20Tls11,%20url:%20%5C%22https:~2F~2Fwww.ssllabs.com:10302~2F%5C%22)) 1/1 | 20180101.01 | Win8.1 | The operation has been canceled | MaxResponseContentBufferSize_ThrowsIfTooSmallForContent - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180101.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpProtocolTests~2FMaxResponseContentBufferSize_ThrowsIfTooSmallForContent(maxSize:%201000,%20contentLength:%201000,%20exceptionExpected:%20False)) 1/2 | 20180102.01 | Win8.1 | The operation has been canceled | MaxResponseContentBufferSize_ThrowsIfTooSmallForContent - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180102.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpProtocolTests~2FMaxResponseContentBufferSize_ThrowsIfTooSmallForContent(maxSize:%202,%20contentLength:%202,%20exceptionExpected:%20False)) 1/6 | 20180106.01 | Win7 | The operation has been canceled | MaxResponseContentBufferSize_ThrowsIfTooSmallForContent - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180106.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpProtocolTests~2FMaxResponseContentBufferSize_ThrowsIfTooSmallForContent(maxSize:%202,%20contentLength:%201,%20exceptionExpected:%20False)) 1/10 | 20180110.03 | Win7 | The operation has been canceled | NoCallback_ValidCertificate_CallbackNotCalled - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180110.03/workItem/System.Net.Http.WinHttpHandler.Functional.Tests/analysis/xunit/System.Net.Http.WinHttpHandlerFunctional.Tests.ServerCertificateTest~2FNoCallback_ValidCertificate_CallbackNotCalled) 1/14 | 20180114.01 | Win7 | The handle is invalid | PostAsync_EmptyContent_ContentTypeHeaderNotSent - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180114.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.PostScenarioTest~2FPostAsync_EmptyContent_ContentTypeHeaderNotSent(serverUri:%20https:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)) 1/14 | 20180114.03 | Win7 | The handle is in the wrong state for the requested operation | PostEmptyContentUsingConflictingSemantics_Success - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180114.03/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.PostScenarioTest~2FPostEmptyContentUsingConflictingSemantics_Success(serverUri:%20https:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)) 1/16 | 20180116.05 | Win7 | The operation has been canceled | GetAsync_RedirectResponseHasCookie_CookieSentToFinalUri - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180116.05/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandlerTest~2FGetAsync_RedirectResponseHasCookie_CookieSentToFinalUri(cookieName:%20%5C%22cookieName1%5C%22,%20cookieValue:%20%5C%22cookieValue1%5C%22)) 1/18 | 20180118.04 | Win7 | The handle is invalid | MaxResponseContentBufferSize_ThrowsIfTooSmallForContent - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180118.04/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpProtocolTests~2FMaxResponseContentBufferSize_ThrowsIfTooSmallForContent(maxSize:%202,%20contentLength:%201,%20exceptionExpected:%20False)) 1/21 | 20180121.01 | Win7 | The handle is invalid | MaxResponseContentBufferSize_ThrowsIfTooSmallForContent - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180121.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpProtocolTests~2FMaxResponseContentBufferSize_ThrowsIfTooSmallForContent(maxSize:%202,%20contentLength:%201,%20exceptionExpected:%20False)) 1/23 | 20180123.01 | Win7 | The handle is invalid | PostRewindableContentUsingAuth_NoPreAuthenticate_Success - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180123.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.PostScenarioTest~2FPostRewindableContentUsingAuth_NoPreAuthenticate_Success(serverUri:%20http:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx%3Fauth=basic&user=user1&password=password1)) 1/23 | 20180123.01 | Win7 | The operation has been canceled | GetAsync_SupportedSSLVersion_Succeeds - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180123.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test~2FGetAsync_SupportedSSLVersion_Succeeds(sslProtocols:%20Tls12,%20url:%20%5C%22https:~2F~2Fwww.ssllabs.com:10303~2F%5C%22)) 1/27 | 20180127.01 | Win7 | The handle is invalid | GetAsync_TrailingHeaders_Ignored - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180127.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandlerTest~2FGetAsync_TrailingHeaders_Ignored(includeTrailerHeader:%20True)) 1/27 | 20180127.04 | Win10 | The handle is invalid | PostRepeatedFlushContentUsingChunkedEncoding_Success - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180127.04/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.PostScenarioTest~2FPostRepeatedFlushContentUsingChunkedEncoding_Success(serverUri:%20http:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)) 1/27 | 20180127.04 | Win7 | The handle is invalid | GetAsync_RedirectResponseHasCookie_CookieSentToFinalUri - only in [catastrophic failure logs](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180127.04/workItem/System.Net.Http.Functional.Tests/wilogs) 1/28 | 20180128.04 | Win10 | The operation has been canceled | PostAsync_CallMethod_NullContent - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180128.04/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandlerTest~2FPostAsync_CallMethod_NullContent(remoteServer:%20http:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)) 1/30 | 20180130.05 | Win7 | The handle is invalid | PostEmptyContentUsingConflictingSemantics_Success - only in [catastrophic failure logs](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180130.05/workItem/System.Net.Http.Functional.Tests/wilogs) 2/1 | 20180201.01 | Win7 | The handle is invalid | PostUsingChunkedEncoding_Success - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180201.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.PostScenarioTest~2FPostUsingChunkedEncoding_Success(serverUri:%20https:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)) 2/1 | 20180201.01 | Win7 | The operation has been canceled | GetAsync_RedirectResponseHasCookie_CookieSentToFinalUri - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180201.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandlerTest~2FGetAsync_RedirectResponseHasCookie_CookieSentToFinalUri(cookieName:%20%5C%22cookieName1%5C%22,%20cookieValue:%20%5C%22cookieValue1%5C%22)) 2/9 | 20180209.05 | Win7 | The handle is invalid | ThresholdExceeded_ThrowsException - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180209.05/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_MaxResponseHeadersLength_Test~2FThresholdExceeded_ThrowsException(responseHeaders:%20%5C%22HTTP~2F1.1%20200%20OK%5C%5Cr%5C%5CnContent-Length:%200%5C%5Cr%5C%5CnCustom-000%5C%22...,%20maxResponseHeadersLe)) 2/9 | 20180209.05 | Win7 | The handle is in the wrong state for the requested operation | GetAsync_UnknownRequestVersion_ThrowsOrDegradesTo11 - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180209.05/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpProtocolTests_Dribble~2FGetAsync_UnknownRequestVersion_ThrowsOrDegradesTo11(majorVersion:%202,%20minorVersion:%201)) 2/13 | 20180213.01 | Win7 | The handle is invalid | ThresholdExceeded_ThrowsException 2/21 | 20180221.01 | Win10 | The operation has been canceled | GetAsync_SetCookieContainer_CookieSent - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180221.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpCookieProtocolTests~2FGetAsync_SetCookieContainer_CookieSent(cookieName:%20%5C%22foo%5C%22,%20cookieValue:%20%5C%22aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%5C%22...,%20useCook)) 2/25 | 20180225.01 | Win10 | The operation has been canceled | PostRewindableContentUsingAuth_NoPreAuthenticate_Success - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180225.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.PostScenarioTest~2FPostRewindableContentUsingAuth_NoPreAuthenticate_Success(serverUri:%20http:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx%3Fauth=basic&user=user1&password=password1)) 2/25 | 20180225.01 | Win7 | The handle is invalid | HttpClientHandler_IncorrectCredentials_Fails - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180225.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_Authentication_Test~2FHttpClientHandler_IncorrectCredentials_Fails(authenticateHeader:%20%5C%22WWW-Authenticate:%20Digest%20realm=%5C%5C%5C%22hello%5C%5C%5C%22,%20nonce=%5C%5C%5C%22%5C%22...)) 2/25 | 20180225.02 | Win10 | The handle is invalid | HttpClientHandler_Authentication_Succeeds - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180225.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_Authentication_Test~2FHttpClientHandler_Authentication_Succeeds(authenticateHeader:%20%5C%22Basic%20something,%20Digest%20something%5C%22,%20result:%20False)) 2/25 | 20180225.02 | Win10 | The operation has been canceled | PostUsingNoSpecifiedSemantics_UsesChunkedSemantics - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180225.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.PostScenarioTest~2FPostUsingNoSpecifiedSemantics_UsesChunkedSemantics(serverUri:%20http:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx)) 2/26 | 20180226.01 | Win8.1 | The operation timed out | PostLongerContentLengths_UsesChunkedSemantics - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180226.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.PostScenarioTest~2FPostLongerContentLengths_UsesChunkedSemantics(contentLength:%2064512)) 2/26 | 20180226.02 | Win10 | The operation has been canceled | GetAsync_SetCookieContainer_CookieSent - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180226.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpCookieProtocolTests~2FGetAsync_SetCookieContainer_CookieSent(cookieName:%20%5C%22.AspNetCore.Session%5C%22,%20cookieValue:%20%5C%22RAExEmXpoCbueP_QYM%5C%22,%20useCookies:%20True)) 2/26 | 20180226.02 | Win10 | The operation has been canceled | GetAsync_SetCookieContainer_CookieSent - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180226.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpCookieProtocolTests~2FGetAsync_SetCookieContainer_CookieSent(cookieName:%20%5C%22foo%5C%22,%20cookieValue:%20%5C%22aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%5C%22...,%20useCook)) 2/26 | 20180226.02 | Win8.1 | The operation has been canceled | GetAsync_SupportedSSLVersion_Succeeds - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180226.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test~2FGetAsync_SupportedSSLVersion_Succeeds(sslProtocols:%20Tls12,%20url:%20%5C%22https:~2F~2Fwww.ssllabs.com:10303~2F%5C%22)) 2/28 | 20180228.07 | Win7 | The handle is invalid | ThresholdExceeded_ThrowsException 3/3 | 20180303.04 | Win10 | The operation has been canceled | GetAsync_SetCookieContainer_CookieSent 3/4 | 20180304.01 | Win10 | The operation has been canceled | GetAsync_SetCookieContainer_CookieSent 3/5 | 20180305.05 | Win7 | The operation has been canceled | ThresholdExceeded_ThrowsException 3/6 | 20180306.02 | Win10 | The operation has been canceled | GetAsync_SetCookieContainer_CookieSent 3/8 | 20180308.09 | Win7 | The handle is invalid | GetAsync_SetCookieContainer_CookieSent 3/11 | 20180311.02 | Win8.1 | The operation has been canceled | GetAsync_SetCookieContainer_CookieSent 3/22 | 20180322.01 | Win10 | The operation has been canceled | GetAsync_SetCookieContainer_CookieSent 3/22 | 20180322.06 | Win7 | The handle is invalid | ThresholdExceeded_ThrowsException 3/22 | 20180322.06 | Win7 | The operation has been canceled | SendAsync_SendSameRequestMultipleTimesDirectlyOnHandler_Success 26093 area-System.Net reenable operation cache Trying to reproduce the issue @stephentoub saw with the operation cache. 26094 area-Infrastructure Change PlatformDetection.GetFrameworkVersion() to use registry key value instead of minor build number We couldn't do this before because PlatformDetection was a common file that was included per project and it was built against each individual test project configuration and RegistryKey is not available in UAP. Now that we moved PlatformDetection to a standalone project we can make this implementation simpler to maintain and to read using the registry key values published every new release in: https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed Also this allows us to automatically return false in non-netfx frameworks by using the nonnetfx file. cc: @danmosemsft @tarekgh 26097 area-System.Reflection Add test for calling Type.GetType via reflection Regression test for https://github.com/dotnet/coreclr/issues/15662 26100 area-System.Memory Make Span IndexOfAny a generic method with special case for byte Hi @ahsonkhan, @karelz Could you take a look a fix? Please take a look performance results below: Test Case - Original: collection size 1 | 10 | 100 | 1000 - Generic: collection size 1 | 10 | 100 | 1000 - IndexOfAny for Two Bytes - Original: 0.0482772 | 0.0767565 | 0.142367 | 0.4517959 - Generic: 0.0511308 | 0.0769461 | 0.1392681 | 0.4358371 | - IndexOfAny for Three Bytes - Original: 0.0502715 | 0.0868734 | 0.1243696 | 0.5373547 - Generic: 0.0495262 | 0.0875778 | 0.1636535 | 0.5687396 | - IndexOfAny for Three Many - Original: 0.2597941 | 0.3481931 | 0.5851725 | 2.8091993 - Generic: 0.2211684 | 0.3649178 | 0.7236067 | 1.6222392 | - IndexOfAny for Three Many not found - Original: 0.29942765 | 0.3844483 | 0.9191699 | 2.8006132 - Generic: 0.3160734 | 0.3848979 | 0.5781648 | 2.8405402 | Performance reports attached for more details. [testResults.zip](https://github.com/dotnet/corefx/files/1593202/testResults.zip) There is a tiny performance degradation for generic solution as expected. However, updated IndexOfAny method for many values has a better performance in case of any search is present (it scans not the whole original span, but only part until it will update the result), in case of not found (worse case) complexity is the same. The same improvement can be done for LastIndexOfAny method, too. Let me know if it's actual, I would be happy to assist. BTW, is a way to format data in a table? 26103 area-System.Drawing Drawing.Common issue on macOS High Sierra "After much trial and error, I believe I installed/configured/referenced the correct packages/references successfully. (The language around packages/references is not well explained in docs on Microsoft's website.) I can build and run a .Net Core CLI app, from Visual Studio for Mac, but it freezes when it tries to access objects from the Drawing.Common package. I can't create a Bitmap or a Colour. Test code, take right from documentation: ```c# using System; using System.IO; using System.Drawing; namespace Test { class MainClass { public static void Main(string[] args) { //Bitmap bm = new Bitmap(32, 32); //Console.WriteLine(""Bitmap: {0}"", bm); Color slateBlue = Color.FromName(""SlateBlue""); byte g = slateBlue.G; byte b = slateBlue.B; byte r = slateBlue.R; byte a = slateBlue.A; string text = String.Format(""Slate Blue has these ARGB values: Alpha:{0}, "" + ""red:{1}, green: {2}, blue {3}"", new object[] { a, r, g, b }); Console.WriteLine(text); Console.WriteLine(""done""); } } } ``` The app freezes at `Color.FromName()`. Overall, this was surprisingly confusing for someone coming from a native macOS/iOS background. I was slowed down a lot because I missed a few small but important details: 1. The packages are pre-release, so they don't appear in Visual Studio package UI unless ""show pre-release"" is checked. Would be great if that was called out better. 2. The previous Drawing package (CoreCompat.System.Drawing) is not marked ""deprecated"", although I had the same problem with both. 3. The dependency between CoreCompat.System.Drawing, runtime.osx.10.10-64.CoreCompat.System.Drawing, and libgdiplus (or mono-libgdiplus) is not well explained anywhere that I could find. 4. The name overloading for ""System.Drawing"" in .Net Core and .Net 4.7 is confusing. (How can two different packages have the same namespace?) First I installed a plain version of `libgdiplus`, then I tried `mono-libgdiplus`, but that had no impact on the freezing problem. I'm wondering if there is an issue with High Sierra or some other macOS problem where trying to access graphic functionality from a CLI tool is the problem. Possibly not linked to AppKit/CoreGraphics? [EDIT] Add C# syntax highlighting by @karelz" 26104 area-System.Memory Utf8Parser/Utf8Formatter: no string overloads Why don't `Utf8Parser` and `Utf8Formatter` have `string` overloads? https://github.com/dotnet/corefx/blob/270be00f569abea3b4b7fb6e0191130e50b17ecf/src/System.Memory/ref/System.Memory.cs#L396-L441 26105 area-System.IO Function not Implemented on FileInfo.MoveTo() when source and destination File System are both exFAT `FileInfo.MoveTo()` produces a `System.IO.IOException` excepetion with the `Function not implemented` method when the source file and destination file are both on an exFAT partition. Repro Program.cs code: ```csharp using System; using System.IO; namespace ExFATRepro { class Program { static void Main(string[] args) { FileInfo file = new FileInfo(args[0]); file.MoveTo(args[1]); } } } ``` Prep: ```bash dd if=/dev/zero of=~/testfs count=40960 mkfs.exfat ~/testfs sudo mkdir /mnt/testfs sudo mount ~/testfs /mnt/testfs echo test > /mnt/testfs/testfile ``` Repro actions: ```bash sudo dotnet run /mnt/testfs/testfile /mnt/testfs/testfile2 ``` Result: ```none Unhandled Exception: System.IO.IOException: Function not implemented at System.IO.UnixFileSystem.MoveFile(String sourceFullPath, String destFullPath) at System.IO.FileInfo.MoveTo(String destFileName) at ExFATRepro.Program.Main(String[] args) in /home/mark/github/ExFATRepro/Program.cs:line 11 ``` Additional testing shows that if the source or destination is on another FS it works. for example, ```bash echo test > /tmp/testfile sudo dotnet run /tmp/testfile /mnt/testfs/testfile2 sudo dotnet run /mnt/testfs/testfile2 /tmp/testfile ``` That works without issue. 26107 area-Infrastructure Add WebAssembly CoreFX build architecture As the [CoreRT](https://github.com/dotnet/corert/issues/4659) and [Mono](http://www.mono-project.com/news/2017/08/09/hello-webassembly/) WebAssembly experiments progress, we'll want to start running CoreFX libraries (starting with System.Console). As a first step, we need to add a new build architecture in the CoreFX repo that can produce architecture-specific packages. This should allow running ```build wasm``` similarly to ```build x86```. To match the CoreRT repo, the build flavor should set ```OSGroup``` to ```WebAssembly``` and ```Platform``` to ```wasm```. In general, settings should match Unix outputs as the WebAssembly platform is pretty similar (but it should be possible to run the build on Windows). For examples, https://github.com/dotnet/corert/commit/da8c27da9644cd658b906cfbd0f6c9997d91c355 added the flavor in CoreRT, https://github.com/dotnet/corert/commit/15ce20d82918bb04009a30e3dbcebce85b1dd80e rounded out native compilation for it, and https://github.com/dotnet/corert/commit/3d25db5b1c010346bbc480a20646c80ea413492f fixed issues in it. 26110 area-System.Globalization Show example to set invariant globalization in xml Based on @dasMulli's comment: https://github.com/dotnet/sdk/issues/1835#issuecomment-354663950 If the 'convenience property' is added in future in SDK, this can be updated. 26112 area-System.Linq Add Enumerable.Repeat overlode Currently Enumerable.Repeat<T> method create an IEnumerable<T> which values are same instance but sometimes I want an IEnumerable<T> with same value but different instance. ``` csharp public static partial class Enumerable { public static IEnumerable<TResult> Repeat<TResult>(Func<TResult> factory, int count); } ``` And for Array.Fill too. ``` csharp public abstract class Array { public static void Fill<T>(T[] array, Func<T> factory); public static void Fill<T>(T[] array, Func<T> factory, int startIndex, int count); } ``` 26113 area-Infrastructure Update BuildTools, CoreClr, CoreSetup, ProjectNTfs, ProjectNTfsTestILC to prerelease-02402-04, preview1-26103-02, preview1-26102-03, beta-26103-00, beta-26103-00, respectively (master) 26114 area-System.Data Removed 2 extra allocations on SqlBulkCopy(string) Calling SqlBulkCopy(string) would call SqlBulkCopy(SqlConnection) and both constructors would create instances of SqlConnection and SqlBulkCopyColumnMappingCollection. Removed call to this(SqlConnection) thus removing two extra object allocations. 26115 area-System.Security Add cert thumprint methods which accept a HashAlgorithmName Fixes #16493. 26116 area-System.Runtime Release/2.0.0 - Add tests for EventArgs serialization (#25940) Relates to https://github.com/dotnet/corefx/issues/25930 * Add tests for EventArgs serialization * Add EventArgs equality check as the type doesn't provide its own check 26117 area-System.Net Test failed: System.Net.Http.Functional.Tests.CancellationTest / GetAsync_ResponseContentRead_CancelUsingTimeoutOrToken_TaskCanceledQuickly ## Types of failures 20171231.01 build: ``` Assert.Throws() Failure Expected: typeof(System.OperationCanceledException) Actual: typeof(System.Net.Http.HttpRequestException): An error occurred while sending the request. at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() in E:\A\_work\1594\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 464 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.CancellationTest.<>c__DisplayClass2_3.<<GetAsync_ResponseContentRead_CancelUsingTimeoutOrToken_TaskCanceledQuickly>b__3>d.MoveNext() in E:\A\_work\1594\s\corefx\src\System.Net.Http\tests\FunctionalTests\CancellationTest.cs:line 85 --- End of stack trace from previous location where exception was thrown --- ``` ## History of failures Day | Build | OS | Details --- | --- | --- | --- 12/8 | 20171208.01 | Win7 | 12/31 | 20171231.01 | Win7 | [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20171231.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.CancellationTest~2FGetAsync_ResponseContentRead_CancelUsingTimeoutOrToken_TaskCanceledQuickly(useTimeout:%20False,%20startResponseBody:%20True)) 26119 area-System.Net Fix Base64Stream encodes the last byte twice and corrupts data "When sending a mail using System.Net.Mail and when an attachment size is (3N-1)*0x4400 + 1 : where N = 1, 2, 3, .... (e.g. 34817, 87041, ...), the last byte of the attachment is duplicated. For example, when an attachment contains ""AAA...Z"" (total 34817 bytes), the sent message's attachment becomes (after decoded from Base64) ""AAA...ZZ"" (total 34818 bytes). We use Base64Stream.EncodeBytes() for our mail attachment. This issue corrupts the data (although it seems benign for a text data, when the attachment is some binary data, duplicating the last byte can make the entire data unusable). To fix the issue, after finished encoding the last byte of a byte array with size (3N-1)*0x4400 + 1, the padding state is set from 2 to 1, and we finished encoding of the last byte (count = 1). The return value should reflect how many bytes we have successfully encoded. Currently we are returning 0 (we set cur = offset, return cur - offset, which is guaranteed 0), which is not correct, because we have encode 1 byte, and we need to increment ""cur"" (current encoded position in buffer). Adding cur++ before return cur – offset will solve the issue. This issue was reported in internal bug 183952 and 215982." 26120 area-Serialization Merge Sgen to Release/2.0.0 The PR is to merge the code for Sgen to 2.0.0 branch. 26121 area-System.Data Improve System.Data.SqlClient Error messages "I would like to improve some error message, why it has never been done ""Who knows"" example: String or binary data would be truncated. Include the column name or parameter name would be helpful right? There's a few others that have been driving us devs nuts for years... Currently I'm targeting Sql Client and I think I have a fix for it, but can't figure out how to test it. The tests in the sln are strange to me, have no idea how to run them. Can't seem to reference the built dll either. Don't they have regular unit tests? I'm look for a way to write a unit test for the change I did and test the new code. Thanks, Eric " 26122 area-System.Diagnostics Test failure: System.Diagnostics.Tests.FileVersionInfoTest / FileVersionInfo_RelativePath_CorrectFilePath The test System.Diagnostics.Tests.FileVersionInfoTest.FileVersionInfo_RelativePath_CorrectFilePath has failed. Configuration: osx10.12_debug Details: https://ci.dot.net/job/dotnet_corefx/job/master/job/centos7.1_debug/4948/testReport/System.Diagnostics.Tests/FileVersionInfoTest/FileVersionInfo_RelativePath_CorrectFilePath/ MESSAGE: ~~~ System.IO.IOException : The process cannot access the file '/mnt/resource/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_centos7.1_debug/bin/tests/System.Diagnostics.FileVersionInfo.Tests/netcoreapp-Linux-Debug-x64/kernelbase.dll' because it is being used by another process. ~~~ ~~~ STACK TRACE: at System.IO.FileStream.Init(FileMode mode, FileShare share) in /root/coreclr/src/mscorlib/shared/System/IO/FileStream.Unix.cs:line 84 at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) in /root/coreclr/src/mscorlib/shared/System/IO/FileStream.cs:line 243 at System.Diagnostics.FileVersionInfo.TryLoadManagedAssemblyMetadata() in /mnt/resource/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_centos7.1_debug/src/System.Diagnostics.FileVersionInfo/src/System/Diagnostics/FileVersionInfo.Unix.cs:line 59 at System.Diagnostics.FileVersionInfo..ctor(String fileName) in /mnt/resource/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_centos7.1_debug/src/System.Diagnostics.FileVersionInfo/src/System/Diagnostics/FileVersionInfo.Unix.cs:line 29 at System.Diagnostics.FileVersionInfo.GetVersionInfo(String fileName) in /mnt/resource/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_centos7.1_debug/src/System.Diagnostics.FileVersionInfo/src/System/Diagnostics/FileVersionInfo.cs:line 280 at System.Diagnostics.Tests.FileVersionInfoTest.FileVersionInfo_RelativePath_CorrectFilePath() in /mnt/resource/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_centos7.1_debug/src/System.Diagnostics.FileVersionInfo/tests/System.Diagnostics.FileVersionInfo.Tests/FileVersionInfoTest.cs:line 112 ~~~ 26123 area-System.Security Test failure: System.Security.Cryptography.Tests.Asn1.SimpleDeserialize/Choice_CycleRoot_Throws Opened on behalf of @Sunny-pu The test `System.Security.Cryptography.Tests.Asn1.SimpleDeserialize/Choice_CycleRoot_Throws` has failed. Assert.Throws() Failure\r Expected: typeof(System.Security.Cryptography.Asn1.AsnSerializationConstraintException)\r Actual: typeof(System.InvalidOperationException): There is no metadata token available for the given member. Stack Trace: at System.Reflection.Runtime.EventInfos.NativeFormat.NativeFormatRuntimeEventInfo.get_MetadataToken() in f:\dd\ndp\fxcore\CoreRT\src\System.Private.Reflection.Core\src\System\Reflection\Runtime\TypeInfos\RuntimeNoMetadataNamedTypeInfo.cs:line 119 at System.Security.Cryptography.Asn1.AsnSerializer.<>c.<PopulateChoiceLookup>b__7_0(FieldInfo fi) in E:\A\_work\668\s\corefx\src\Common\src\System\Security\Cryptography\Asn1V2.Serializer.cs:line 118 at System.Linq.EnumerableSorter$2<System.__Canon,System.Int32>.ComputeKeys(__Canon[] elements, Int32 count) in E:\A\_work\668\s\corefx\src\System.Linq\src\System\Linq\OrderedEnumerable.cs:line 557 at System.Linq.EnumerableSorter$1<System.__Canon>.ComputeMap(__Canon[] elements, Int32 count) in E:\A\_work\668\s\corefx\src\System.Linq\src\System\Linq\OrderedEnumerable.cs:line 498 at System.Linq.OrderedEnumerable$1<System.__Canon>.<GetEnumerator>d__3.MoveNext() in E:\A\_work\668\s\corefx\src\System.Linq\src\System\Linq\OrderedEnumerable.cs:line 24 at System.Security.Cryptography.Asn1.AsnSerializer.PopulateChoiceLookup(Dictionary$2<ValueTuple$2<$TagClass,Int32>,$LinkedList$1<FieldInfo>> lookup, Type typeT, $LinkedList$1<FieldInfo> currentSet) in E:\A\_work\668\s\corefx\src\Common\src\System\Security\Cryptography\Asn1V2.Serializer.cs:line 118 at System.Security.Cryptography.Asn1.AsnSerializer.DeserializeChoice($AsnReader reader, Type typeT) in E:\A\_work\668\s\corefx\src\Common\src\System\Security\Cryptography\Asn1V2.Serializer.cs:line 257 at System.Security.Cryptography.Asn1.AsnSerializer.<>c__DisplayClass19_0.<GetSimpleDeserializer>b__0($AsnReader reader) in E:\A\_work\668\s\corefx\src\Common\src\System\Security\Cryptography\Asn1V2.Serializer.cs:line 780 at System.Security.Cryptography.Tests.Asn1.SimpleDeserialize.<>c__DisplayClass8_0.<Choice_CycleRoot_Throws>b__0() in E:\A\_work\668\s\corefx\src\System.Security.Cryptography.Encoding\tests\Asn1\Serializer\SimpleDeserialize.cs:line 326 Build : Master - 20180103.02 (UWP ILC Tests) Failing configurations: - Windows.10.Amd64.ClientRS3-x64 - Release Details: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Filc~2F/build/20180103.02/workItem/System.Security.Cryptography.Encoding.Tests 26124 area-System.Memory DangerousCreate throws NullReferenceException if obj is null Was using System.Memory (4.5.0-preview1-26025-02) on .NET Core 2.0 (not using the portable span). ```C# byte x = 10; Span<byte>.DangerousCreate(null, ref x, 1); ``` ``` Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. at System.Span`1.DangerousCreate(Object obj, T& objectData, Int32 length) at ConsoleApp41.Program.<Main>d__0.MoveNext() in C:\Users\dfowler\documents\visual studio 2017\Projects\ConsoleApp41\ConsoleApp41\Program.cs:line 21 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at ConsoleApp41.Program.<Main>(String[] args) ``` /cc @ahsonkhan 26125 area-System.Security On Linux, cannot create PFX with private key if has more than single cert in collection Sample code: ```c# var collection = new X509Certificate2Collection(); collection.Add(certificateWithPrivateKey); collection.Add(anotherCertWithoutPrivateKey); var output = collection.Export(X509ContentType.Pkcs12); ``` The `output` is a pfx value that has a _single_ certificate in place, the second one, without the private key. I tracked it down to this piece of code: https://github.com/dotnet/corefx/blob/master/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Unix/ExportProvider.cs#L75 In particular, this loop: https://github.com/dotnet/corefx/blob/d7dd6a4b03a7c3bb03379e03ff9dbd656913cc85/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Unix/ExportProvider.cs#L101-L126 Looking at the code, I think that the code is missing setting of `privateCertHandle` and `privateCertKeyHandle`, which cause it to skip the entry with the private key. [EDIT] Add C# syntax highlighting by @karelz 26126 area-System.Security Configuration - Invalid file paths "To reproduce create a pfx file and add it your machine. Make a note of where you hold it on the file system. For simplicity I just created a Test.pfx within a directory named ""Test"" on my machine's D drive. I inspected the directory permissions and made sure the read access is permitted. I opened a new Project targeting Core 2.0.1 with Visual Studio 2017 running as administrator (full env details at the end) Add a section to your config file (appsetting-{env}.json as follows: `""CertificateConfig"": { ""CertificatePath"":""D:\\Test\\test.pfx"", ""CertificatePassword"":""secret"" }` Create a strongly typed POCO CertificateConfig.cs with a public string property named ""CertificatePath"" with get/set. Another property for the password in the same way. Then in your Startup.cs do the necessary Configuration binding to IOptions as follows: `services.Configure<CertificateConfig>(options => Configuration.GetSection(""CertificateConfig"").Bind(options));` Don't forget to add the `services.AddOptions();` to Startup.cs within `void ConfigureServices(IServiceCollection services)` method. Now create a simple Controller (or a method within a separate service layer etc) and inject the `IOptions<CertificateConfig> config` into the constructor. Now if you did the following: ` X509Certificate2 certificate = new X509Certificate2(config.Value.CertificatePath, config.Value.CertificatePassword);` you should get an exception saying the file path is invalid. How are you meant to store file paths within the JSON config files? If I hard code a string as follows: `string path = @""D:\Test\test.pfx"";` it works flawlessly. The same result is present if you use `File.Open` or try to pass a `FileInfo` object instead of a filepath. I can't use \ as a value within a json config file and \/ would result in an equally invalid file path. I get that Core is meant to be OS agnostic but how can supply a file path in a config which satisfies the separator without using `Path.DirectorySeparatorChar` Any help would be appreciated. ENVIRONMENT ================ Microsoft Visual Studio Community 2017 Version 15.5.2 VisualStudio.15.Release/15.5.2+27130.2010 Microsoft .NET Framework Version 4.6.01038 assemblyref://Microsoft.NETCore.App (2.0)" 26127 area-Microsoft.CSharp Removes few unused variables in Microsoft.CSharp 26128 area-Microsoft.CSharp How to test WinRT types and dynamic? Of the uncovered code in Microsoft.CSharp, quite a bit involves WinRT types, which I don't know anything about. Does anyone know how to go about testing these? (@jamesqo do I remember you having a question about WinRT types and corefx on stackoverflow, or am I was that someone else?) 26129 area-Infrastructure System.IO.Packaging 4.4.0 in .NET Framework depends on .NETStandard.Library "@msmolka commented on [Thu Aug 31 2017](https://github.com/dotnet/core/issues/919) # System.IO.Packaging 4.4.0 in .NET Framework depends on .NETStandard.Library I'm trying to upgrade System.IO.Packaging in my old project .NET Framework 4.6.2 from version 4.3. However it tries to install a lot of useless dependencies already available inside framework, because it depends on .NETStandard.Library 1.6.1+ --- @svick commented on [Thu Aug 31 2017](https://github.com/dotnet/core/issues/919#issuecomment-326272735) Interesting. That package has two variants: one for .Net Standard 1.3 and one for .Net Framework 4.6. But both depend on `NETStandard.Library`. I don't think that's a common pattern and I don't know why does that dependency exist. On the other hand, those ""useless"" packages should not cause any issues. And they're even less visible if you use the new `<PackageReference>` instead of `packages.config`. --- @msmolka commented on [Thu Aug 31 2017](https://github.com/dotnet/core/issues/919#issuecomment-326285744) @svick `<PackageReference>` is not a option. I have old not Core project. I need this reference to use OpenXml nuget package which relies on Packaging one. Also it is problem because I have a lot duplicate dependency errors. --- @svick commented on [Thu Aug 31 2017](https://github.com/dotnet/core/issues/919#issuecomment-326311082) @msmolka > `<PackageReference>` is not a option. I have old not Core project. You can use `<PackageReference>` in .Net Framework projects too. > Also it is problem because I have a lot duplicate dependency errors. What exactly are the errors? --- @msmolka commented on [Thu Aug 31 2017](https://github.com/dotnet/core/issues/919#issuecomment-326331093) @svick are you sure: based on that: [Microsoft Docs](https://docs.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files) > At present, package references are supported in Visual Studio 2017 only, for .NET Core projects, .NET Standard projects, and UWP projects targeting Windows 10 Build 15063 (Creators Update). About the error I cannot reproduce it right now --- @svick commented on [Thu Aug 31 2017](https://github.com/dotnet/core/issues/919#issuecomment-326341432) @msmolka Yes. If I set PackageReference as the ""Default package management format"", then I'm able to use `<PackageReference>` in a brand new .Net Framework project in VS 15.3. I think the docs are out of date, so I opened https://github.com/NuGet/docs.microsoft.com-nuget/issues/443. --- @Petermarcu commented on [Tue Oct 10 2017](https://github.com/dotnet/core/issues/919#issuecomment-335670260) @terrajobst --- @Petermarcu commented on [Fri Oct 13 2017](https://github.com/dotnet/core/issues/919#issuecomment-336547379) I'm going to close this issue for now. Let us know if more follow up is needed. --- @Sc0tTyXL commented on [Tue Oct 31 2017](https://github.com/dotnet/core/issues/919#issuecomment-340780847) We still have an issue where is tries to load .NET Standard in a .NET Framework application. We do not want to be dependent on Standard, could somebody please fix this error? There shouldn't be a dependency! We cannot downgrade because the previous version of the package (https://www.nuget.org/packages/DocumentFormat.OpenXml/) that is dependent on this package has a bug (we ourselves don't use this package). --- @JCPuerto commented on [Tue Dec 19 2017](https://github.com/dotnet/core/issues/919#issuecomment-352805002) Updating to 4.4.0 is causing errors in the Visual Studio Team Services Build: `Error : This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ..\..\packages\NETStandard.Library.2.0.1\build\NETStandard.Library.targets ` Since it's adding some extra lines to the web.config: ``` <Import Project=""..\..\..\packages\NETStandard.Library.2.0.1\build\NETStandard.Library.targets"" Condition=""Exists('..\..\..\packages\NETStandard.Library.2.0.1\build\NETStandard.Library.targets')"" /> <Target Name=""EnsureNuGetPackageBuildImports"" BeforeTargets=""PrepareForBuild""> <PropertyGroup> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> <Error Condition=""!Exists('..\..\..\packages\NETStandard.Library.2.0.1\build\NETStandard.Library.targets')"" Text=""$([System.String]::Format('$(ErrorText)', '..\..\..\packages\NETStandard.Library.2.0.1\build\NETStandard.Library.targets'))"" /> </Target> ``` So please remove that dependency. Thank you! --- @msmolka commented on [Wed Jan 03 2018](https://github.com/dotnet/core/issues/919#issuecomment-355008349) @Petermarcu Could you reopen this issue? My project is using .NET Framework 4.7.1 which is compatible with .NETStandard 2.0, So there is no need to install tens of dependencies, but because of this bug it is painful with deployment. I'm considering this as bug, because no other package has such strange dependency. Even in latest alfa version this dependency exists. And I cannot find reason for that. I've tried <PackageReference> but gave up after 5 hours. I have some incompatible msbuild references, which are not working. And simply don't want to create workarounds for bugs. --- @Petermarcu commented on [Wed Jan 03 2018](https://github.com/dotnet/core/issues/919#issuecomment-355072351) @weshaggard @terrajobst do you have any insight on why this package is ""special""? " 26130 area-System.Threading Mutex name null causes FailFast in chk on Unix This caused a test failure in CoreCLR CI: ``` FailFast: at System.Diagnostics.Debug.Assert(Boolean condition, String message, String detailMessage) in /mnt/j/workspace/dotnet_coreclr/master/jitstress/x64_checked_ubuntu_corefx_baseline_prtest/src/mscorlib/shared/System/Diagnostics/Debug.cs:line 97 at System.Threading.Mutex.CreateMutexCore(Boolean initiallyOwned, String name, Boolean& createdNew) in /mnt/j/workspace/dotnet_coreclr/master/jitstress/x64_checked_ubuntu_corefx_baseline_prtest/src/mscorlib/src/System/Threading/Mutex.cs:line 108 at System.IO.IsolatedStorage.Helper.CreateMutexNotOwned(String pathName) in /mnt/j/workspace/dotnet_coreclr/master/jitstress/x64_checked_ubuntu_corefx_baseline_prtest/_/fx/src/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/Helper.Win32Unix.cs:line 146 at System.IO.IsolatedStorage.Helper.GetRandomDirectory(String rootDirectory, IsolatedStorageScope scope) in /mnt/j/workspace/dotnet_coreclr/master/jitstress/x64_checked_ubuntu_corefx_baseline_prtest/_/fx/src/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/Helper.Win32Unix.cs:line 86 ``` https://github.com/dotnet/coreclr/pull/14181 left a Debug.Assert upstream of the ArgumentException: ```c# private void CreateMutexCore(bool initiallyOwned, string name, out bool createdNew) { Debug.Assert(name == null || name.Length <= Path.MaxPath); uint mutexFlags = initiallyOwned ? Win32Native.CREATE_MUTEX_INITIAL_OWNER : 0; SafeWaitHandle mutexHandle = Win32Native.CreateMutexEx(null, name, mutexFlags, AccessRights); int errorCode = Marshal.GetLastWin32Error(); if (mutexHandle.IsInvalid) { mutexHandle.SetHandleAsInvalid(); #if PLATFORM_UNIX if (errorCode == Interop.Errors.ERROR_FILENAME_EXCED_RANGE) // On Unix, length validation is done by CoreCLR's PAL after converting to utf-8 throw new ArgumentException(SR.Format(SR.Argument_WaitHandleNameTooLong, Interop.Sys.MaxName), nameof(name)); #endif ``` The fix may be to remove the assert (if the resulting error for null is also acceptable). Plus make sure we have for long and null mutex names in both Unix and Windows. 26131 area-System.Memory Productize ReadOnlyBuffer The prototype is at https://github.com/dotnet/corefxlab/blob/master/src/System.Buffers.Primitives/System/Buffers/ReadOnlyBuffer.cs 26135 area-System.Net reenable ssl tests Fixes #23138 @stephentoub @karelz @wfurt @Priya91 26139 area-System.Memory Move Span.DangerousCreate to MemoryMarshal.Create current API: ```c# public struct Span<T> { public static Span<T> DangerousCreate(object obj, ref T objectData, int length); } public struct ReadOnlySpan<T> { public static ReadOnlySpan<T> DangerousCreate(object obj, ref T objectData, int length); } ``` proposed API: ```c# public static class MemoryMarshal { public static Span<T> CreateSpan(object obj, ref T objectData, int length); public static ReadOnlySpan<T> CreateReadOnlySpan(object obj, ref T objectData, int length); } ``` 26141 area-Infrastructure Add default PB_AssetRootUrl for isolated builds "https://github.com/dotnet/corefx/pull/25845 made pipeline.json pass the build defs args like this to map orchestrated build parameters: ``` ""PB_SyncArguments"": ""... /p:DotNetAssetRootUrl=$(PB_AssetRootUrl)"" ``` Without a variable called `PB_AssetRootUrl`, VSTS leaves `$(PB_AssetRootUrl)` alone and it's passed in literally. This makes MSBuild logic for default behavior not work, and CoreCLR symbol downloading fails. " 26142 area-System.Data System.Data.SqlClient needs to update version As part of https://github.com/dotnet/corefx/pull/25142 new API was added to the assembly which mean we need to bump the minor assembly version the PR only updated the patch version from 4.3.0 to 4.3.1 (see comment https://github.com/dotnet/corefx/pull/25142#discussion_r156465074). We should update assembly version to 4.4.0. Given this library currently ships inbox for UAP we need to start shipping a build of this in the nuget package so it can correctly override what is shipped inbox for UAP otherwise folks trying to consume the new APIs and run on UAP will fail to run on the one currently inbox. (see comment https://github.com/dotnet/corefx/pull/25142#discussion_r156465352), see also issue https://github.com/dotnet/corefx/issues/23743 for more details. 26143 area-System.Net Fix WebHeaderCollection mangles well-formed Set-Cookie headers containing expires attribute "System.Net.WebHeaderCollection has an issue parsing the Set-Cookie headers. If the Set-Cookie header contains a cookie with Expires attribute, the WebHeaderCollection parser will incorrectly split the cookie into two invalid cookies. Refactor the common multi-value header parser in WebHeaderCollection to add a specific 'Set-Cookie' parser that understands the 'Expires' attribute. Without fixing this, customers can see incorrect string representations for Set-Cookie headers stored in WebHeaderCollection if they contain an ""Expires"" attribute. This issue was reported in internal bug 467951. Also ported back changes made in this PR: #6952. It's not correct to use the inherited GetValues() method from 'NameValueCollection' for 'WebHeaderCollection' class, because if the header field contains multiple values, this method should take a header name and returns a string array representing the individual values for that headers. Example: (in original comment) Accept: text/plain, text/html GetValues(""Accept"") would return an array of two strings: ""text/plain"" and ""text/html"". If using inherited GetValues() method from 'NameValueCollection', will return one string ""text/plain, text/html""." 26144 area-System.Net ClientWebSocket proxy support System.Net.WebSockets.ClientWebSocket tracking: Allow customers to use a proxy with AMQP+WS and MQTT+WS 26145 area-System.Runtime Build and package System.Runtime.CompilerServices.Unsafe for netcoreapp20 We would have a performance regression in some of the Unsafe.As methods otherwise. It should build and packaged for netcoreapp2.0 that will cover the live netcoreapp as well. See https://github.com/dotnet/corefx/pull/25959/files/0c0e5136caec611a7178470ff8fbcaa754ddc1a8#discussion_r159258597 for full discussion. 26146 area-System.Net ClientWebSocket x509 Support System.Net.WebSockets.ClientWebSocket tracking: This is needed for certificate based authentication for AMQP+WS and MQTT+WS related tracking issue #26144 26150 area-System.Reflection SR.Metadata API to serialize sequence points as well as deserialize While rewriting PDBs (cloning a `MetadataReader` to a `MetadataBuilder`), I need to map old DocumentHandles to new DocumentHandles for each `SequencePoint.Document` in `MethodDebugInformation.GetSequencePoints()`. I need some way to serialize the modified SequncePoints back into a blob. Right now the only implementation of this is internal and part of Roslyn: https://github.com/dotnet/roslyn/blob/c273b6a9f19570a344c274ae89185b3a2b64d93d/src/Compilers/Core/Portable/PEWriter/MetadataWriter.PortablePdb.cs#L610-L687 Rather than forcing everyone to maintain their own implementation of the spec, please provide an API. Since I don't need access to the resulting blob except for the purposes of using it with `AddMethodDebugInformation`, this is the bare minimum I'd need: ```diff namespace System.Reflection.Metadata.Ecma335 { public sealed class MetadataBuilder { public MethodDebugInformationHandle AddMethodDebugInformation( DocumentHandle document, BlobHandle sequencePoints); + public MethodDebugInformationHandle AddMethodDebugInformation( + DocumentHandle document, IEnumerable<SequencePoint> sequencePoints); } } ``` I'd also need the `internal` SequencePoint constructors to become public. Perhaps an API that returns or writes a blob would be more flexible though. In that cause, I'd simply add the blob to the builder myself and pass the resulting handle to `AddMethodDebugInformation` myself. 26151 area-System.Memory Fix rounding edge-case behavior in Uf8Parser.ParseDecimal "Fixed by making the NumberBuffer's capacity match that of its counterpart in the desktop. Decimal only has 28 digits of decimal precision but the rounding algorithm looks ahead up to another 20 digits beyond that for the ""round the 5"" case." 26152 area-System.Security Fixing X509Certificate2Collection.Export on Unix with multiple certs and private key See previous discussion of this bug here: https://github.com/dotnet/corefx/issues/26125 This passes tests on Ubuntu 16.04 machine 26154 area-Serialization Area-Serialization Sprint 129 The issue is for tracking issues to be done in sprint 128 (due by 1/12/2018) 26156 area-System.IO Proposal ZipArchive ctor that accepts byte[] or Memory<byte> "# Rationale Generally, it is inconvenient to create stream from byte array as the code looks like: ```c# var ms = new MemoryStream(); ms.Write(myBytes, 0, myBytes.Length); ``` If we happen to have ziparchive in memory, as byte array, this overhead of first creating memory stream from byte array to satisfy ZipArchive's ctor is significant. # Proposal In addition to the existing ToString overloads in BitConverter: ```c# public ZipArchive(Stream stream) public ZipArchive(Stream stream, ZipArchiveMode mode) public ZipArchive(Stream stream, ZipArchiveMode mode, bool leaveOpen) public ZipArchive(Stream stream, ZipArchiveMode mode, bool leaveOpen, Encoding entryNameEncoding) ``` Please consider: ```c# public ZipArchive(Memory<byte> data) public ZipArchive(Memory<byte> data, ZipArchiveMode mode) public ZipArchive(Memory<byte> data, ZipArchiveMode mode, bool leaveOpen) public ZipArchive(Memory<byte> data, ZipArchiveMode mode, bool leaveOpen,Encoding entryNameEncoding) ``` # Example: ```c# var memory = new Memory<byte>(GetZipByteArrayFromSomewhere()); using(var zip = new ZipArchive(memory, ZipArchiveMode.Read)) { Assert.True(zip.GetEntry(""some/path/inside/zip"").Length > 0); } ``` " 26158 area-System.Collections Adding EnsureCapacity to Dictionary and adding tests Partly addresses: #24445 Adding EnsureCapacity API to Dictionary and Adding Tests. Implementation changes made in a coreclr PR separately here https://github.com/dotnet/coreclr/pull/15729. cc: @benaadams @danmosemsft TODO Next in a separate PR: - Will add EnsureCapacity to SortedSet and HashSet - Will add TrimExcess to Dictionary, SortedSet 26159 area-Infrastructure Building pre-jitted CoreFx bits Hi, When I build the CoreFx repo locally on a Linux machine, the built CoreFx bits contain only IL, unlike the bits [Microsoft distributes](https://download.microsoft.com/download/2/B/2/2B2854E7-7EAE-4FE9-85D2-19ACCD716F18/dotnet-runtime-2.0.4-linux-x64.tar.gz), which seem to be pre-jitted (PE64 flag is on, and ILOnly flag is off). What is the process to build a pre-jitted version of CoreFx? Is that logic part of the build scripts in corefx repo, or it's being run as a post process? I understand that `crossgen` is the tool to be used for per-compiling, but I don't see switches in the build script to enable that. Any pointers would be helpful. Branch used - https://github.com/dotnet/corefx/tree/v2.0.4 Command used for build - `/build.sh -ConfigurationGroup=Release -RuntimeOS=linux -OSGroup=Linux -release` Built binaries picked from - `bin/runtime/netcoreapp-Linux-Release-x64` 26160 area-System.Net Add test for renegotiation scenario in SslStream. Verified the test actually hits the renegotiation code path by running under the debugger. fixes #24407 cc @stephentoub @wfurt @karelz 26161 area-System.Threading Add an empty dependency group for net45 to DataFlow package DataFlow has assets that are netstandard and old PCL and corrisponding dependencies. However when selecting for .NET Framework we can eliminate the dependencies as they aren't necessary as we know they all exist already in framework. Fixes https://github.com/dotnet/corefx/issues/25171 cc @ericstj 26162 area-Infrastructure Minimize nuget package dependencies As .NET Standard support gets added inbox on more platforms, in particular .NET Framework, we should add some logic to your packaging that will minimize the package dependencies when targeting those platforms. In particular any package that is targeting NETStandard.Library (or its closure) before 2.0 should have a empty dependency group for net461 and higher to eliminate the need for that package closure. See https://github.com/dotnet/corefx/pull/26161 and https://github.com/dotnet/buildtools/pull/1847 as two improvements but we should create a more general mechanism. 26164 area-System.Reflection From corefx's perspective, how should an optional DateTime parameter's default value be encoded in IL? "This is a follow-up question from https://github.com/dotnet/roslyn/issues/24004 intended to determine whether there is a bug in the C# compiler or the framework. I'd appreciate an answer from corefx's perspective that I can take back to the discussion in the referenced issue. The following C# program will throw a runtime exception: ```csharp class Program { public void Method(System.DateTime arg = default(System.DateTime)) { } static void Main() { var defaultValue = typeof(Program).GetMethod(""Method"").GetParameters()[0].DefaultValue; } } ``` ``` Unhandled Exception: System.FormatException: Encountered an invalid type for a default value. at System.Reflection.MdConstant.GetValue(MetadataImport scope, Int32 token, RuntimeTypeHandle fieldTypeHandle, Boolean raw) at System.Reflection.RuntimeParameterInfo.GetDefaultValueInternal(Boolean raw) at System.Reflection.RuntimeParameterInfo.GetDefaultValue(Boolean raw) at Program.Main() in ...\Program.cs:line 7 ``` An equivalent program written in VB.NET would work just fine. Unlike the VB.NET compiler, the C# compiler does *not* emit a `[System.Runtime.CompilerServices.DateTimeConstant]` custom attribute on the optional parameter; instead, it assigns a default value equalling `nullref` to the parameter: #### IL produced by the C# compiler: ```ilasm // public void Method(System.DateTime arg = default(System.DateTime)) .method public hidebysig instance void Method([opt] valuetype [mscorlib]System.DateTime arg) cil managed { .param [1] = nullref // ... } ``` #### IL produced by the VB.NET compiler: ```ilasm // Public Shared Sub Method(Optional arg As System.DateTime = Nothing) .method public instance void Method([opt] valuetype [mscorlib]System.DateTime arg) cil managed { .param [1] .custom instance void [mscorlib]System.Runtime.CompilerServices.DateTimeConstantAttribute::.ctor(int64) = ( 01 00 00 00 00 00 00 00 00 00 00 ) // ... } ``` In https://github.com/dotnet/roslyn/issues/24004#issuecomment-354922688, @HaloFour said that the exception appears to be a bug in the BCL's reflection code. So I am left wondering, who is to blame for the runtime exception? * the C# compiler, because it does not emit the `[System.Runtime.CompilerServices.DateTimeConstant]` attribute that the BCL reflection code apparently expects for optional `DateTime` parameters; or * the implementation of `ParameterInfo.DefaultValue` in the BCL, which should allow `.param [n] = nullref` and interpret it as `default(DateTime)`, i. e. a `DateTime` with `.Ticks == 0`?" 26165 area-System.Diagnostics Getting CPU/Memory usage from a .NET Core App "Hi, Right now in our application in .NET 4.x, we get the CPU and Memory usage from the machine using performance counters. But of course this works only on Windows. In .NET Core we are only able to leverage the data from `GC.GetTotalMemory`, but it only return the memory consumed by our app, not by all processes on the machine. What would be the best ""cross-platform"" way to do this using .NET Core? " 26166 area-System.Reflection Fix ReflectionTypeLoadExceptionTests Expected values should be specified before actual values, and use `Assert.Null` instead of `Assert.Equal` for null values. cc: @wtgodbe, @jkotas 26167 area-Serialization Re-apply Changes in #25562 I'm working on merging dev/sgen branch into master branch. Changes made by https://github.com/dotnet/corefx/pull/25562 would get lost. We need to re-apply the changes. 26168 area-System.Net AllowRenegotiation property on SslStream options bag is not implemented. It is not clear why the AllowRenegotiation property was added to the options bag in the ALPN API proposal in the issue #23177 Renegotiation is not a condition or property required for ALPN. It is not clear if this property is intended for the purposes of allowing/disallowing insecure renegotiation. @Tratcher @geoffkizer I remember you mentioning this is required for HTTP/2 support, can you elaborate on the use-case for this property? If not, we should remove this from the API surface area, as it's not supported in implementation currently. 26169 area-Serialization Move XmlSerializer CodeGen from SGen to S.P.Xml The PR is moving the CodeGen code of XmlSerializer from SGen back to System.Private.Xml.dll. 26170 area-System.Net TCPListener.Stop leaks a socket handle "If you use TCPListener.Start and then Stop the listener, the Stop method then creates a new socket. That socket leaks until reclaimed by the GC (or some other mechanism). In many cases this is harmless since it's not eating up a port, but on Linux this can result in ""Too many open files"". https://github.com/dotnet/corefx/blob/6719752de7cee6ee44ba3cd542c36d6785034413/src/System.Net.Sockets/src/System/Net/Sockets/TCPListener.cs#L165 Mono uses corefx's implementation of this class and using TCPListener in a loop will typically exhaust available handles relatively quickly, producing this: ``` Unhandled Exception: System.Net.Sockets.SocketException (0x80004005): Too many open files at System.Net.Sockets.Socket.Accept () [0x00033] in <c2e1018d8475415eae8a3c299d0a3981>:0 at System.Net.Sockets.TcpListener.AcceptSocket () [0x0001e] in <c2e1018d8475415eae8a3c299d0a3981>:0 at Program.Step () [0x000d0] in <5edebf9e82cb4b9695ac71dcde742b80>:0 ``` From my testing on Windows both .NET Framework and .NET Core leak a handle in Stop, but periodically the leaked handles are collected via some mechanism (according to Visual Studio diagnostic tools, this mechanism is not a regular GC). If you look at the handle count for the dotnet process it climbs very rapidly while starting/stopping TCPListeners, then occasionally drops by like 700. So, given that this behavior matches .NET Framework, it's probably not a ""bug"", but it seems wrong to me. Is it intentional and something that has to be kept for compatibility purposes? I'd argue that .Stop should not be allocating a new socket, since in many scenarios the user is never going to use the listener again after they stop it, and that leaked handle will sit around for a while. Here is my test case. I tested it on Windows under .NET Framework and .NET Core 2.0, and on Linux under trunk mono: https://gist.github.com/kg/09f6eeb8082838913a65eb5b19fbb9d6 Mono throwing an exc here is obviously not dotnet's fault, but I wanted to raise the underlying stdlib issue since it seems wrong to me." 26171 area-System.Runtime System.Runtime.Caching tests - style and other minor changes There are a few PR comments to #25169 that would require minor refactoring to the tests. I plan to do it in a separate PR in order to not delay the main bulk of tests to get into the COREFX. - [ ] string de-duplication - [ ] nullable type, etc.. 26172 area-System.Runtime Convert System.Runtime.Caching project to support Unix "This work items is to convert the project to support all platforms and to adjust the code to do the right thing without having all the functionality on all platforms. With the current S.R.Caching.MemoryCache memory management design the main missing external piece to fully support all platforms is #25617. Once this is implemented, the cache will still likely need some ""adjustments"" as the way of deriving ""cache memory pressure"" from ""memory usage"" is likely to be different on Linux (or even different on different versions of Linux). This invites further design decisions whether to let the cache ""translate"" memory readings into memory pressure itself or to delegate this to the user code (or have both the default algorithm and an opportunity to override it)... Until then the plan is to support netstandard but the cache will throw PNSE if the corresponding memory settings are provided on the platforms where we don't have comprehensive memory info yet. " 26173 area-System.Globalization API Propsal: char.GetUnicodeCategory(unicode scalar) ## Rationale and Usage Support getting the Unicode category of 32-bit codepoint. To do that today, have to do the following ```cs UnicodeCategory cat = char.GetUnicodeCategory(char.ConvertFromUtf32(0x1F401), 0) ``` The problem is char.ConvertFromUtf32 always allocate a new string which is not used afterward. We need to have a way to do something like ```C# UnicodeCategory cat = CharUnicodeInfo.GetUnicodeCategory(0x1F401); ``` without allocating any intermediate strings or other objects. ## Proposed API ```C# public static class CharUnicodeInfo { public static UnicodeCategory GetUnicodeCategory(int ch) {} } ``` ## Notes - CharUnicodeInfo class already have the following internal method which does what is proposed here. We'll just need to expose it with the proper name. [`InternalGetUnicodeCategory(int ch)`](https://source.dot.net/#System.Private.CoreLib/shared/System/Globalization/CharUnicodeInfo.cs,196d0be2b1b2b26a) - The proposal is exposing the API from CharUnicodeInfo class and not from Char struct. The reason is Char struct is by convention is the 16-bit char. So exposing the API taking 32-bit codepoint would fit better in CharUnicodeInfo ## Original text written by @ufcpp I'd like Unicode scalar/code point/[rune](https://github.com/dotnet/corefx/issues/24093) version of the `GetUnicodeCategory` method. I have a [UTF8-related library](https://github.com/ufcpp/GraphemeSplitter) and I often write a code like the following: ```cs char.GetUnicodeCategory(char.ConvertFromUtf32(0x1F401), 0) ``` This is inefficient because of string allocation. Futhermore, coreclr has the [`InternalGetUnicodeCategory(int ch)`](https://source.dot.net/#System.Private.CoreLib/shared/System/Globalization/CharUnicodeInfo.cs,196d0be2b1b2b26a) method internally. Please make this public. 26174 area-Meta Provided a CoreFX API Analyzer ### Rationale There are a number of APIs in CoreFX for which special rules may apply, or for which it may be useful to provide additional diagnostics at compile time or during development time. As such, I propose we create a dedicated project (or repository) to contain these CoreFX specific analyzers. ### Example The new Hardware Intrinsic APIs occasionally have special rules. For example, `Vector128<float> System.Runtime.Intrinsics.X86.Sse.Shuffle(Vector128<float>, Vector128<float>, byte)` requires that the third parameter be a constant so that the underlying hardware instruction can be emitted appropriately. The diagnostic that applies to this is very niche, and will only realistically be used by the hardware intrinsic APIs, so doing something like providing a language feature to enforce it is unlikely to happen. However, implementing a diagnostic analyzer that detects the case where a user does not pass a constant and therefore violates the API contract is fairly trivial and greatly improves the development experience when consuming said API. Other analyzers could include common bug fixes made to the repos or suggestions to use the latest APIs that are being added. For example, many of the Desktop framework APIs only took a string. However, CoreCLR added a number of overloads which allow passing single characters instead. Additionally, CoreFX has recently added a number of overloads which take `Span<T>`. Both of these are code-fix analyzers that could be easily suggested to the developer. 26176 area-System.IO Add nanosecond granularity to Unix filesystem time reads Does not attempt to improve granularity of setting values. Right now we use `utime` and we would have to use `utimensat` or at least `utimes`. Does not attempt to read birthtime on linux. Right now we use `stat` and would have to use `statx`. Relates to https://github.com/dotnet/corefx/issues/26024 26178 area-System.Net Debian SSLStream Exception "Hi, I have SSL exception when call AuthenticateAsClient on several web site on Debian 9. Work fine on windows 10. Follow the test case (VS 2017 15.5.2): [TestSSLStream.zip](https://github.com/dotnet/corefx/files/1606593/TestSSLStream.zip) ```c# using System; using System.IO; using System.Net; using System.Net.Security; using System.Net.Sockets; namespace TestSSLStream { class Program { static void Main(string[] args) { Uri uri = new Uri(args[0]); IPHostEntry dns = Dns.Resolve(uri.Host); using (TcpClient client = new TcpClient()) { client.Connect(/*dns.AddressList[0]*/uri.Host, uri.Port); client.ReceiveTimeout = 10000; using (SslStream sslStream = new SslStream(client.GetStream(), false)) { sslStream.AuthenticateAsClient(uri.Host); // Check certificate string expirationDate = sslStream.RemoteCertificate.GetExpirationDateString(); StreamWriter writer = new StreamWriter(sslStream); writer.Write(""GET "" + uri.AbsolutePath + "" HTTP/1.1\r\n""); writer.Write(""Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n""); writer.Write(""Accept-Encoding: gzip, deflate\r\n""); writer.Write(""Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3\r\n""); writer.Write(""User-Agent: Mozilla/5.0 (compatible; TestBot; TEST)\r\n""); writer.Write(""Connection: close\r\n""); writer.Write(""Host: "" + uri.Host + ""\r\n\r\n""); writer.Flush(); StreamReader reader = new StreamReader(sslStream); string response = reader.ReadToEnd(); } } } } } ``` On debian: > dotnet --info > > Microsoft .NET Core Shared Framework Host > > Version : 2.0.4 > Build : 7f262f453d8c8479b9af91d34c013b3aa05bc1ff On debian, Exception when execute: > dotnet TestSSLStream.dll https://korben.info/ > dotnet TestSSLStream.dll https://www.toutvendre.fr work fine with certificate of github: > dotnet TestSSLStream.dll https://github.com All certificate are not managed on debian 9 with ssl stream? [EDIT] Added C# code from the zip file" 26179 area-System.Runtime API Proposal : ARM64 Simd simple ops @eerhardt @CarolEidt @RussKeldorph Target Framework netcoreapp2.1 ```C# namespace System.Runtime.Intrinsics.Arm.Arm64 { /// <summary> /// This class provides access to the Arm64 AdvSIMD intrinsics /// /// Arm64 CPUs indicate support for this feature by setting /// ID_AA64PFR0_EL1.AdvSIMD == 0 or better. /// </summary> public static class Simd { public static bool IsSupported { get { throw null; } } /// <summary> /// Vector abs /// Corresponds to vector forms of ARM64 ABS & FABS /// </summary> public static Vector64<byte> Abs(Vector64<sbyte> value) { throw null; } public static Vector64<ushort> Abs(Vector64<short> value) { throw null; } public static Vector64<uint> Abs(Vector64<int> value) { throw null; } public static Vector64<float> Abs(Vector64<float> value) { throw null; } public static Vector128<byte> Abs(Vector128<sbyte> value) { throw null; } public static Vector128<ushort> Abs(Vector128<short> value) { throw null; } public static Vector128<uint> Abs(Vector128<int> value) { throw null; } public static Vector128<ulong> Abs(Vector128<long> value) { throw null; } public static Vector128<float> Abs(Vector128<float> value) { throw null; } public static Vector128<double> Abs(Vector128<double> value) { throw null; } /// <summary> /// Vector add /// Corresponds to vector forms of ARM64 ADD & FADD /// </summary> public static Vector64<T> Add<T>(Vector64<T> left, Vector64<T> right) where T : struct { throw null; } public static Vector128<T> Add<T>(Vector128<T> left, Vector128<T> right) where T : struct { throw null; } /// <summary> /// Vector and /// Corresponds to vector forms of ARM64 AND /// </summary> public static Vector64<T> And<T>(Vector64<T> left, Vector64<T> right) where T : struct { throw null; } public static Vector128<T> And<T>(Vector128<T> left, Vector128<T> right) where T : struct { throw null; } /// <summary> /// Vector and not /// Corresponds to vector forms of ARM64 BIC /// </summary> public static Vector64<T> AndNot<T>(Vector64<T> left, Vector64<T> right) where T : struct { throw null; } public static Vector128<T> AndNot<T>(Vector128<T> left, Vector128<T> right) where T : struct { throw null; } /// <summary> /// Vector Divide /// Corresponds to vector forms of ARM64 FDIV /// </summary> public static Vector64<float> Divide(Vector64<float> left, Vector64<float> right) { throw null; } public static Vector128<float> Divide(Vector128<float> left, Vector128<float> right) { throw null; } public static Vector128<double> Divide(Vector128<double> left, Vector128<double> right) { throw null; } /// <summary> /// Vector max /// Corresponds to vector forms of ARM64 SMAX, UMAX & FMAX /// </summary> public static Vector64<T> Max<T>(Vector64<T> left, Vector64<T> right) where T : struct { throw null; } public static Vector128<T> Max<T>(Vector128<T> left, Vector128<T> right) where T : struct { throw null; } /// <summary> /// Vector min /// Corresponds to vector forms of ARM64 SMIN, UMIN & FMIN /// </summary> public static Vector64<T> Min<T>(Vector64<T> left, Vector64<T> right) where T : struct { throw null; } public static Vector128<T> Min<T>(Vector128<T> left, Vector128<T> right) where T : struct { throw null; } /// <summary> /// Vector multiply /// /// For each element result[elem] = left[elem] * right[elem] /// /// Corresponds to vector forms of ARM64 MUL & FMUL /// </summary> public static Vector64<byte> Multiply(Vector64<byte> left, Vector64<byte> right) { throw null; } public static Vector64<sbyte> Multiply(Vector64<sbyte> left, Vector64<sbyte> right) { throw null; } public static Vector64<ushort> Multiply(Vector64<ushort> left, Vector64<ushort> right) { throw null; } public static Vector64<short> Multiply(Vector64<short> left, Vector64<short> right) { throw null; } public static Vector64<uint> Multiply(Vector64<uint> left, Vector64<uint> right) { throw null; } public static Vector64<int> Multiply(Vector64<int> left, Vector64<int> right) { throw null; } public static Vector64<float> Multiply(Vector64<float> left, Vector64<float> right) { throw null; } public static Vector128<byte> Multiply(Vector128<byte> left, Vector128<byte> right) { throw null; } public static Vector128<sbyte> Multiply(Vector128<sbyte> left, Vector128<sbyte> right) { throw null; } public static Vector128<ushort> Multiply(Vector128<ushort> left, Vector128<ushort> right) { throw null; } public static Vector128<short> Multiply(Vector128<short> left, Vector128<short> right) { throw null; } public static Vector128<uint> Multiply(Vector128<uint> left, Vector128<uint> right) { throw null; } public static Vector128<int> Multiply(Vector128<int> left, Vector128<int> right) { throw null; } public static Vector128<float> Multiply(Vector128<float> left, Vector128<float> right) { throw null; } public static Vector128<double> Multiply(Vector128<double> left, Vector128<double> right) { throw null; } /// <summary> /// Vector negate /// Corresponds to vector forms of ARM64 NEG & FNEG /// </summary> public static Vector64<sbyte> Negate(Vector64<sbyte> value) { throw null; } public static Vector64<short> Negate(Vector64<short> value) { throw null; } public static Vector64<int> Negate(Vector64<int> value) { throw null; } public static Vector64<float> Negate(Vector64<float> value) { throw null; } public static Vector128<sbyte> Negate(Vector128<sbyte> value) { throw null; } public static Vector128<short> Negate(Vector128<short> value) { throw null; } public static Vector128<int> Negate(Vector128<int> value) { throw null; } public static Vector128<long> Negate(Vector128<long> value) { throw null; } public static Vector128<float> Negate(Vector128<float> value) { throw null; } public static Vector128<double> Negate(Vector128<double> value) { throw null; } /// <summary> /// Vector not /// Corresponds to vector forms of ARM64 NOT /// </summary> public static Vector64<T> Not<T>(Vector64<T> value) where T : struct { throw null; } public static Vector128<T> Not<T>(Vector128<T> value) where T : struct { throw null; } /// <summary> /// Vector or /// Corresponds to vector forms of ARM64 ORR /// </summary> public static Vector64<T> Or<T>(Vector64<T> left, Vector64<T> right) where T : struct { throw null; } public static Vector128<T> Or<T>(Vector128<T> left, Vector128<T> right) where T : struct { throw null; } /// <summary> /// Vector or not /// Corresponds to vector forms of ARM64 ORN /// </summary> public static Vector64<T> OrNot<T>(Vector64<T> left, Vector64<T> right) where T : struct { throw null; } public static Vector128<T> OrNot<T>(Vector128<T> left, Vector128<T> right) where T : struct { throw null; } /// <summary> /// Vector square root /// Corresponds to vector forms of ARM64 FRSQRT /// </summary> public static Vector64<float> Sqrt(Vector64<float> value) { throw null; } public static Vector128<float> Sqrt(Vector128<float> value) { throw null; } public static Vector128<double> Sqrt(Vector128<double> value) { throw null; } /// <summary> /// Vector subtract /// Corresponds to vector forms of ARM64 SUB & FSUB /// </summary> public static Vector64<T> Subtract<T>(Vector64<T> left, Vector64<T> right) where T : struct { throw null; } public static Vector128<T> Subtract<T>(Vector128<T> left, Vector128<T> right) where T : struct { throw null; } /// <summary> /// Vector exclusive or /// Corresponds to vector forms of ARM64 EOR /// </summary> public static Vector64<T> Xor<T>(Vector64<T> left, Vector64<T> right) where T : struct { throw null; } public static Vector128<T> Xor<T>(Vector128<T> left, Vector128<T> right) where T : struct { throw null; } } } ``` 26180 area-System.Runtime API Proposal: Arm64 Simd simple comparison ops @eerhardt @CarolEidt @RussKeldorph Target Framework netcoreapp2.1 ```C# namespace System.Runtime.Intrinsics.Arm.Arm64 { /// <summary> /// This class provides access to the Arm64 AdvSIMD intrinsics /// /// Arm64 CPUs indicate support for this feature by setting /// ID_AA64PFR0_EL1.AdvSIMD == 0 or better. /// </summary> public static class Simd { public static bool IsSupported { get { throw null; } } /// <summary> /// Vector CompareEqualZero /// For each element result[elem] = (left[elem] == 0) ? ~0 : 0 /// Corresponds to vector forms of ARM64 CMEQ & FCMEQ /// </summary> public static Vector64<T> CompareEqualZero<T>(Vector64<T> value) where T : struct { throw null; } public static Vector128<T> CompareEqualZero<T>(Vector128<T> value) where T : struct { throw null; } /// <summary> /// Vector CompareEqual /// For each element result[elem] = (left[elem] == right[elem]) ? ~0 : 0 /// Corresponds to vector forms of ARM64 CMEQ & FCMEQ /// </summary> public static Vector64<T> CompareEqual<T>(Vector64<T> left, Vector64<T> right) where T : struct { throw null; } public static Vector128<T> CompareEqual<T>(Vector128<T> left, Vector128<T> right) where T : struct { throw null; } /// <summary> /// Vector CompareGreaterThanOrEqualZero /// For each element result[elem] = (left[elem] >= 0) ? ~0 : 0 /// Corresponds to vector forms of ARM64 CMGE & FCMGE /// </summary> public static Vector64<T> CompareGreaterThanOrEqualZero<T>(Vector64<T> value) where T : struct { throw null; } public static Vector128<T> CompareGreaterThanOrEqualZero<T>(Vector128<T> value) where T : struct { throw null; } /// <summary> /// Vector CompareGreaterThanOrEqual /// For each element result[elem] = (left[elem] >= right[elem]) ? ~0 : 0 /// Corresponds to vector forms of ARM64 CMGE/CMHS & FCMGE /// </summary> public static Vector64<T> CompareGreaterThanOrEqual<T>(Vector64<T> left, Vector64<T> right) where T : struct { throw null; } public static Vector128<T> CompareGreaterThanOrEqual<T>(Vector128<T> left, Vector128<T> right) where T : struct { throw null; } /// <summary> /// Vector CompareGreaterThanZero /// For each element result[elem] = (left[elem] > 0) ? ~0 : 0 /// Corresponds to vector forms of ARM64 CMGT & FCMGT /// </summary> public static Vector64<T> CompareGreaterThanZero<T>(Vector64<T> value) where T : struct { throw null; } public static Vector128<T> CompareGreaterThanZero<T>(Vector128<T> value) where T : struct { throw null; } /// <summary> /// Vector CompareGreaterThan /// For each element result[elem] = (left[elem] > right[elem]) ? ~0 : 0 /// Corresponds to vector forms of ARM64 CMGT/CMHI & FCMGT /// </summary> public static Vector64<T> CompareGreaterThan<T>(Vector64<T> left, Vector64<T> right) where T : struct { throw null; } public static Vector128<T> CompareGreaterThan<T>(Vector128<T> left, Vector128<T> right) where T : struct { throw null; } /// <summary> /// Vector CompareLessThanZero /// For each element result[elem] = (left[elem] < 0) ? ~0 : 0 /// Corresponds to vector forms of ARM64 CMGT & FCMGT /// </summary> public static Vector64<T> CompareLessThanZero<T>(Vector64<T> value) where T : struct { throw null; } public static Vector128<T> CompareLessThanZero<T>(Vector128<T> value) where T : struct { throw null; } /// <summary> /// Vector CompareLessThanOrEqualZero /// For each element result[elem] = (left[elem] < 0) ? ~0 : 0 /// Corresponds to vector forms of ARM64 CMGT & FCMGT /// </summary> public static Vector64<T> CompareLessThanOrEqualZero<T>(Vector64<T> value) where T : struct { throw null; } public static Vector128<T> CompareLessThanOrEqualZero<T>(Vector128<T> value) where T : struct { throw null; } /// <summary> /// Vector CompareTest /// For each element result[elem] = (left[elem] & right[elem]) ? ~0 : 0 /// Corresponds to vector forms of ARM64 CMTST /// </summary> public static Vector64<T> CompareTest<T>(Vector64<T> left, Vector64<T> right) where T : struct { throw null; } public static Vector128<T> CompareTest<T>(Vector128<T> left, Vector128<T> right) where T : struct { throw null; } 26181 area-System.Runtime API Proposal: Arm64 Simd BitwiseSelect @eerhardt @CarolEidt @RussKeldorph Target Framework netcoreapp2.1 ```C# namespace System.Runtime.Intrinsics.Arm.Arm64 { /// <summary> /// This class provides access to the Arm64 AdvSIMD intrinsics /// /// Arm64 CPUs indicate support for this feature by setting /// ID_AA64PFR0_EL1.AdvSIMD == 0 or better. /// </summary> public static class Simd { public static bool IsSupported { get { throw null; } } /// <summary> /// Vector BitwiseSelect /// For each bit in the vector result[bit] = sel[bit] ? left[bit] : right[bit] /// Corresponds to vector forms of ARM64 BSL (Also BIF & BIT) /// </summary> public static Vector64<T> BitwiseSelect<T>(Vector64<T> sel, Vector64<T> left, Vector64<T> right) where T : struct { throw null; } public static Vector128<T> BitwiseSelect<T>(Vector128<T> sel, Vector128<T> left, Vector128<T> right) where T : struct { throw null; } } } ``` 26182 area-System.Runtime API Proposal : Arm64 Base/Simd LeadingZeroCount et. al. @eerhardt @CarolEidt @RussKeldorph Target Framework netcoreapp2.1 ```C# namespace System.Runtime.Intrinsics.Arm.Arm64 { /// <summary> /// This class provides access to the Arm64 Base intrinsics /// /// These intrinsics are supported by all Arm64 CPUs /// </summary> public static class Base { public static bool IsSupported { get { throw null; } } /// <summary> /// Vector LeadingSignCount /// Corresponds to integer forms of ARM64 CLS /// </summary> public static int LeadingSignCount(int value) { throw null; } public static int LeadingSignCount(long value) { throw null; } /// <summary> /// Vector LeadingZeroCount /// Corresponds to integer forms of ARM64 CLZ /// </summary> public static int LeadingZeroCount(int value) { throw null; } public static int LeadingZeroCount(uint value) { throw null; } public static int LeadingZeroCount(long value) { throw null; } public static int LeadingZeroCount(ulong value) { throw null; } } /// <summary> /// This class provides access to the Arm64 AdvSIMD intrinsics /// /// Arm64 CPUs indicate support for this feature by setting /// ID_AA64PFR0_EL1.AdvSIMD == 0 or better. /// </summary> public static class Simd { public static bool IsSupported { get { throw null; } } /// <summary> /// Vector LeadingSignCount /// Corresponds to vector forms of ARM64 CLS /// </summary> public static Vector64<sbyte> LeadingSignCount(Vector64<sbyte> value) { throw null; } public static Vector64<short> LeadingSignCount(Vector64<short> value) { throw null; } public static Vector64<int> LeadingSignCount(Vector64<int> value) { throw null; } public static Vector128<sbyte> LeadingSignCount(Vector128<sbyte> value) { throw null; } public static Vector128<short> LeadingSignCount(Vector128<short> value) { throw null; } public static Vector128<int> LeadingSignCount(Vector128<int> value) { throw null; } /// <summary> /// Vector LeadingZeroCount /// Corresponds to vector forms of ARM64 CLZ /// </summary> public static Vector64<byte> LeadingZeroCount(Vector64<byte> value) { throw null; } public static Vector64<sbyte> LeadingZeroCount(Vector64<sbyte> value) { throw null; } public static Vector64<ushort> LeadingZeroCount(Vector64<ushort> value) { throw null; } public static Vector64<short> LeadingZeroCount(Vector64<short> value) { throw null; } public static Vector64<uint> LeadingZeroCount(Vector64<uint> value) { throw null; } public static Vector64<int> LeadingZeroCount(Vector64<int> value) { throw null; } public static Vector128<byte> LeadingZeroCount(Vector128<byte> value) { throw null; } public static Vector128<sbyte> LeadingZeroCount(Vector128<sbyte> value) { throw null; } public static Vector128<ushort> LeadingZeroCount(Vector128<ushort> value) { throw null; } public static Vector128<short> LeadingZeroCount(Vector128<short> value) { throw null; } public static Vector128<uint> LeadingZeroCount(Vector128<uint> value) { throw null; } public static Vector128<int> LeadingZeroCount(Vector128<int> value) { throw null; } /// <summary> /// Vector PopCount /// Corresponds to vector forms of ARM64 CNT /// </summary> public static Vector64<byte> PopCount(Vector64<byte> value) { throw null; } public static Vector64<sbyte> PopCount(Vector64<sbyte> value) { throw null; } } } 26183 area-System.Runtime API Proposal: Arm64 Simd Insert and Extract elements @eerhardt @CarolEidt @RussKeldorph Target Framework netcoreapp2.1 ```C# namespace System.Runtime.Intrinsics.Arm.Arm64 { /// <summary> /// This class provides access to the Arm64 AdvSIMD intrinsics /// /// Arm64 CPUs indicate support for this feature by setting /// ID_AA64PFR0_EL1.AdvSIMD == 0 or better. /// </summary> public static class Simd { public static bool IsSupported { get { throw null; } } /// <summary> /// Vector extract item /// /// result = vector[index] /// /// Note: In order to be inlined, index must be a JIT time const expression which can be used to /// populate the literal immediate field. Use of a non constant will result in generation of a switch table /// /// Corresponds to vector forms of ARM64 MOV /// </summary> public static T Extract<T>(Vector64<T> vector, byte index) where T : struct { throw null; } public static T Extract<T>(Vector128<T> vector, byte index) where T : struct { throw null; } /// <summary> /// Vector insert item /// /// result = vector; /// result[index] = data; /// /// Note: In order to be inlined, index must be a JIT time const expression which can be used to /// populate the literal immediate field. Use of a non constant will result in generation of a switch table /// /// Corresponds to vector forms of ARM64 INS /// </summary> public static Vector64<T> Insert<T>(Vector64<T> vector, byte index, T data) where T : struct { throw null; } public static Vector128<T> Insert<T>(Vector128<T> vector, byte index, T data) where T : struct { throw null; } } } ``` Argument order and parameter names should be consistent between X86 and ARM64. They are currently not 26184 area-System.Reflection `ParameterBuilder.SetConstant(null)` should be allowed for value-typed parameters "**TL;DR:** Could `ParameterBuilder.SetConstant` be made less strict so it accepts `nullref` for value-typed parameters, too? (I'm requesting this for https://github.com/castleproject/Core/issues/291 and it is somewhat related to bug report #26164, which confirms that setting an optional value-typed parameter's default value to `nullref` in IL is common practice and not incorrect.) Let's say I need to faithfully reproduce an existing methods' signature using System.Reflection.Emit. Take for example this method: ```csharp public static void Method(SomeStruct arg = default(SomeStruct)) /* where SomeStruct : struct */ { } ``` The C# compiler would emit this as: ```ilasm .method public hidebysig static void Method([opt] valuetype SomeStruct arg) cil managed { .param [1] = nullref // default(SomeStruct) is represented by the null reference // ... } ``` Unfortunately, it is currently impossible to produce the same output with System.Reflection.Emit: ```csharp // preparation: var assembly = AssemblyBuilder.DefineDynamicAssembly(new AssemblyName(""Assembly""), AssemblyBuilderAccess.Run); var module = assembly.DefineDynamicModule(""Module""); var type = module.DefineType(""Type"", TypeAttributes.Public); var method = type.DefineMethod(""Method"", MethodAttributes.Public | MethodAttributes.Static, typeof(void), new[] { typeof(SomeStruct) }); var parameter = method.DefineParameter(1, ParameterAttributes.Optional, ""arg""); // attempting to do the equivalent of IL's `.param [1] = nullref` will throw: parameter.SetConstant(null); // ... ``` ``` Unhandled Exception: System.ArgumentException: Null is not a valid constant value for this type. at System.Reflection.Emit.TypeBuilder.SetConstantValue(ModuleBuilder module, Int32 tk, Type destType, Object value) at ... ``` Calling `parameter.SetConstant(default(SomeStruct))` instead wouldn't work either: ``` Unhandled Exception: System.ArgumentException: SomeStruct is not a supported constant type. at System.Reflection.Emit.TypeBuilder.SetConstantValue(ModuleBuilder module, Int32 tk, Type destType, Object value) at ... ``` So I'm left with no way of faithfully reproducing the shown C# method's signature. The only current workaround is not to call `parameter.SetConstant` at all, but that will result in later reflection reporting a default value of `Missing.Value` instead of `null`. According to ECMA-335, the type of a parameter's default value (supplied via `.param [n] = constant`) does not have to match the parameter's actual type. The runtime doesn't do anything with the constant, it's merely there for e.g. importing compilers to reflect over. Only CLS compliancy rules require that the types match. However, I think it should be possible to emit non-CLS-compliant code with `System.Reflection.Emit`, too. " 26185 area-System.Runtime API Proposal : Simd SetAllVector* from scalar @eerhardt @CarolEidt @RussKeldorph Target Framework netcoreapp2.1 ```C# namespace System.Runtime.Intrinsics.Arm.Arm64 { /// <summary> /// This class provides access to the Arm64 AdvSIMD intrinsics /// /// Arm64 CPUs indicate support for this feature by setting /// ID_AA64PFR0_EL1.AdvSIMD == 0 or better. /// </summary> public static class Simd { public static bool IsSupported { get { throw null; } } /// <summary> /// SetVector* Fill vector elements by replicating element value /// /// Corresponds to vector forms of ARM64 DUP (general), DUP (element 0), FMOV (vector, immediate) /// </summary> public static Vector64<T> SetAllVector64<T>(T value) where T : struct { throw null; } public static Vector128<T> SetAllVector128<T>(T value) where T : struct { throw null; } } } 26186 area-System.Net Tests failed: System.Net.Http.Functional.Tests.ManagedHandler_HttpClientHandler_SslProtocols_Test / GetAsync_*SSLVersion_Succeeds Regression caused by #26135 (@geoffkizer) ## Types of failures Affected tests: * GetAsync_AllowedSSLVersion_Succeeds * GetAsync_SupportedSSLVersion_Succeeds ### GetAsync_AllowedSSLVersion_Succeeds - The client and server cannot communicate, because they do not possess a common algorithm Build [20180105.02](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180105.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.ManagedHandler_HttpClientHandler_SslProtocols_Test~2FGetAsync_AllowedSSLVersion_Succeeds(acceptedProtocol:%20Tls11,%20requestOnlyThisProtocol:%20False)): ``` System.Security.Authentication.AuthenticationException : A call to SSPI failed, see inner exception. ---- System.ComponentModel.Win32Exception : The client and server cannot communicate, because they do not possess a common algorithm at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, ExceptionDispatchInfo exception) in E:\A\_work\640\s\corefx\src\System.Net.Security\src\System\Net\Security\SslState.cs:line 975 at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest) in E:\A\_work\640\s\corefx\src\System.Net.Security\src\System\Net\Security\SslState.cs:line 802 at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) in E:\A\_work\640\s\corefx\src\System.Net.Security\src\System\Net\Security\SslState.cs:line 792 at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest) in E:\A\_work\640\s\corefx\src\System.Net.Security\src\System\Net\Security\SslState.cs:line 961 at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest) in E:\A\_work\640\s\corefx\src\System.Net.Security\src\System\Net\Security\SslState.cs:line 916 at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest) in E:\A\_work\640\s\corefx\src\System.Net.Security\src\System\Net\Security\SslState.cs:line 864 at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest) in E:\A\_work\640\s\corefx\src\System.Net.Security\src\System\Net\Security\SslState.cs:line 673 at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult) in E:\A\_work\640\s\corefx\src\System.Net.Security\src\System\Net\Security\SslState.cs:line 594 at System.Net.Security.SslStream.BeginAuthenticateAsServer(SslServerAuthenticationOptions sslServerAuthenticationOptions, CancellationToken cancellationToken, AsyncCallback asyncCallback, Object asyncState) in E:\A\_work\640\s\corefx\src\System.Net.Security\src\System\Net\Security\SslStream.cs:line 242 at System.Net.Security.SslStream.BeginAuthenticateAsServer(X509Certificate serverCertificate, Boolean clientCertificateRequired, SslProtocols enabledSslProtocols, Boolean checkCertificateRevocation, AsyncCallback asyncCallback, Object asyncState) in E:\A\_work\640\s\corefx\src\System.Net.Security\src\System\Net\Security\SslStream.cs:line 219 at System.Net.Security.SslStream.<>c.<AuthenticateAsServerAsync>b__47_1(X509Certificate arg1, Boolean arg2, SslProtocols arg3, AsyncCallback callback, Object state) in E:\A\_work\640\s\corefx\src\System.Net.Security\src\System\Net\Security\SslStream.cs:line 404 at System.Threading.Tasks.TaskFactory`1.FromAsyncImpl[TArg1,TArg2,TArg3](Func`6 beginMethod, Func`2 endFunction, Action`1 endAction, TArg1 arg1, TArg2 arg2, TArg3 arg3, Object state, TaskCreationOptions creationOptions) in E:\A\_work\1734\s\src\mscorlib\src\System\Threading\Tasks\FutureFactory.cs:line 1218 at System.Net.Security.SslStream.AuthenticateAsServerAsync(X509Certificate serverCertificate, Boolean clientCertificateRequired, SslProtocols enabledSslProtocols, Boolean checkCertificateRevocation) in E:\A\_work\640\s\corefx\src\System.Net.Security\src\System\Net\Security\SslStream.cs:line 405 at System.Net.Test.Common.LoopbackServer.<AcceptSocketAsync>d__11.MoveNext() in E:\A\_work\640\s\corefx\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 164 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test.<>c__DisplayClass4_1.<<GetAsync_AllowedSSLVersion_Succeeds>b__0>d.MoveNext() in E:\A\_work\640\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.SslProtocols.cs:line 115 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.<>c__DisplayClass3_0.<CreateServerAsync>b__0(Task t) in E:\A\_work\640\s\corefx\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 67 at System.Threading.Tasks.ContinuationTaskFromTask.InnerInvoke() in E:\A\_work\1734\s\src\mscorlib\src\System\Threading\Tasks\TaskContinuation.cs:line 59 at System.Threading.Tasks.Task.<>c.<.cctor>b__278_1(Object obj) in E:\A\_work\1734\s\src\mscorlib\src\System\Threading\Tasks\Task.cs:line 2480 at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) in E:\A\_work\1734\s\src\mscorlib\shared\System\Threading\ExecutionContext.cs:line 151 at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) in E:\A\_work\1734\s\src\mscorlib\src\System\Threading\Tasks\Task.cs:line 2440 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test.<GetAsync_AllowedSSLVersion_Succeeds>d__4.MoveNext() in E:\A\_work\640\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.SslProtocols.cs:line 113 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- ``` ### GetAsync_SupportedSSLVersion_Succeeds - The function requested is not supported Build [20180105.02](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180105.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.ManagedHandler_HttpClientHandler_SslProtocols_Test~2FGetAsync_SupportedSSLVersion_Succeeds(sslProtocols:%20Tls11,%20url:%20%5C%22https:~2F~2Fwww.ssllabs.com:10302~2F%5C%22)) ``` System.Net.Http.HttpRequestException : The SSL connection could not be established, see inner exception. ---- System.Security.Authentication.AuthenticationException : A call to SSPI failed, see inner exception. -------- System.ComponentModel.Win32Exception : The function requested is not supported at System.Net.Http.HttpConnectionHandler.<EstablishSslConnection>d__5.MoveNext() in E:\A\_work\640\s\corefx\src\System.Net.Http\src\System\Net\Http\Managed\HttpConnectionHandler.cs:line 82 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.HttpConnectionHandler.<CreateConnection>d__6.MoveNext() in E:\A\_work\640\s\corefx\src\System.Net.Http\src\System\Net\Http\Managed\HttpConnectionHandler.cs:line 136 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.HttpConnectionPool.<WaitForCreatedConnectionAsync>d__15.MoveNext() in E:\A\_work\640\s\corefx\src\System.Net.Http\src\System\Net\Http\Managed\HttpConnectionPool.cs:line 226 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.HttpConnectionHandler.<SendAsyncWithAwaitedConnection>d__4.MoveNext() in E:\A\_work\640\s\corefx\src\System.Net.Http\src\System\Net\Http\Managed\HttpConnectionHandler.cs:line 42 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.CookieHandler.<SendAsync>d__3.MoveNext() in E:\A\_work\640\s\corefx\src\System.Net.Http\src\System\Net\Http\Managed\CookieHandler.cs:line 31 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.AuthenticateAndRedirectHandler.<SendAsync>d__7.MoveNext() in E:\A\_work\640\s\corefx\src\System.Net.Http\src\System\Net\Http\Managed\AuthenticateAndRedirectHandler.cs:line 62 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__62.MoveNext() in E:\A\_work\640\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 488 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.RemoteServerQuery.<Run>d__0`1.MoveNext() in E:\A\_work\640\s\corefx\src\Common\tests\System\Net\RemoteServerQuery.cs:line 44 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test.<GetAsync_SupportedSSLVersion_Succeeds>d__6.MoveNext() in E:\A\_work\640\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.SslProtocols.cs:line 148 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, ExceptionDispatchInfo exception) in E:\A\_work\640\s\corefx\src\System.Net.Security\src\System\Net\Security\SslState.cs:line 975 at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest) in E:\A\_work\640\s\corefx\src\System.Net.Security\src\System\Net\Security\SslState.cs:line 802 at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) in E:\A\_work\640\s\corefx\src\System.Net.Security\src\System\Net\Security\SslState.cs:line 792 at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest) in E:\A\_work\640\s\corefx\src\System.Net.Security\src\System\Net\Security\SslState.cs:line 961 at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest) in E:\A\_work\640\s\corefx\src\System.Net.Security\src\System\Net\Security\SslState.cs:line 916 at System.Net.Security.SslState.PartialFrameCallback(AsyncProtocolRequest asyncRequest) in E:\A\_work\640\s\corefx\src\System.Net.Security\src\System\Net\Security\SslState.cs:line 1096 --- End of stack trace from previous location where exception was thrown --- at System.Net.Security.SslState.InternalEndProcessAuthentication(LazyAsyncResult lazyResult) in E:\A\_work\640\s\corefx\src\System.Net.Security\src\System\Net\Security\SslState.cs:line 735 at System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult result) in E:\A\_work\640\s\corefx\src\System.Net.Security\src\System\Net\Security\SslState.cs:line 708 at System.Net.Security.SslStream.EndAuthenticateAsClient(IAsyncResult asyncResult) in E:\A\_work\640\s\corefx\src\System.Net.Security\src\System\Net\Security\SslStream.cs:line 194 at System.Net.Security.SslStream.<>c.<AuthenticateAsClientAsync>b__44_1(IAsyncResult iar) in E:\A\_work\640\s\corefx\src\System.Net.Security\src\System\Net\Security\SslStream.cs:line 381 at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization) in E:\A\_work\1734\s\src\mscorlib\src\System\Threading\Tasks\FutureFactory.cs:line 533 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.HttpConnectionHandler.<EstablishSslConnection>d__5.MoveNext() in E:\A\_work\640\s\corefx\src\System.Net.Http\src\System\Net\Http\Managed\HttpConnectionHandler.cs:line 68 ----- Inner Stack Trace ----- ``` ### GetAsync_AllowedSSLVersion_Succeeds ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.IO.IOException : The decryption operation failed, see inner exception. -------- Interop+OpenSsl+SslException : Decrypt failed with OpenSSL error - SSL_ERROR_SSL. ------------ System.Security.Cryptography.CryptographicException : Error occurred during a cryptographic operation. at System.Net.Http.HttpConnection.<SendAsync>d__38.MoveNext() in /root/corefx-1266141/src/System.Net.Http/src/System/Net/Http/Managed/HttpConnection.cs:line 438 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.HttpConnectionHandler.<SendAsyncWithAwaitedConnection>d__4.MoveNext() in /root/corefx-1266141/src/System.Net.Http/src/System/Net/Http/Managed/HttpConnectionHandler.cs:line 43 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.CookieHandler.<SendAsync>d__3.MoveNext() in /root/corefx-1266141/src/System.Net.Http/src/System/Net/Http/Managed/CookieHandler.cs:line 31 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.AuthenticateAndRedirectHandler.<SendAsync>d__7.MoveNext() in /root/corefx-1266141/src/System.Net.Http/src/System/Net/Http/Managed/AuthenticateAndRedirectHandler.cs:line 62 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__62.MoveNext() in /root/corefx-1266141/src/System.Net.Http/src/System/Net/Http/HttpClient.cs:line 488 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test.<>c__DisplayClass4_1.<<GetAsync_AllowedSSLVersion_Succeeds>b__0>d.MoveNext() in /root/corefx-1266141/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.SslProtocols.cs:line 115 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.<>c__DisplayClass3_0.<CreateServerAsync>b__0(Task t) in /root/corefx-1266141/src/Common/tests/System/Net/Http/LoopbackServer.cs:line 68 at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) in /root/coreclr/src/mscorlib/shared/System/Threading/ExecutionContext.cs:line 151 at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) in /root/coreclr/src/mscorlib/src/System/Threading/Tasks/Task.cs:line 2440 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test.<GetAsync_AllowedSSLVersion_Succeeds>d__4.MoveNext() in /root/corefx-1266141/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.SslProtocols.cs:line 113 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Net.Security.SslStreamInternal.<ReadAsyncInternal>d__32`1.MoveNext() in /root/corefx-1266141/src/System.Net.Security/src/System/Net/Security/SslStreamInternal.cs:line 285 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.HttpConnection.<FillAsync>d__64.MoveNext() in /root/corefx-1266141/src/System.Net.Http/src/System/Net/Http/Managed/HttpConnection.cs:line 958 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.HttpConnection.<ReadNextLineAsync>d__62.MoveNext() in /root/corefx-1266141/src/System.Net.Http/src/System/Net/Http/Managed/HttpConnection.cs:line 867 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.HttpConnection.<SendAsync>d__38.MoveNext() in /root/corefx-1266141/src/System.Net.Http/src/System/Net/Http/Managed/HttpConnection.cs:line 313 ----- Inner Stack Trace ----- at Interop.OpenSsl.Decrypt(SafeSslHandle context, Byte[] outBuffer, Int32 offset, Int32 count, SslErrorCode& errorCode) in /root/corefx-1266141/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSsl.cs:line 269 at System.Net.Security.SslStreamPal.EncryptDecryptHelper(SafeDeleteContext securityContext, ReadOnlyMemory`1 input, Int32 offset, Int32 size, Boolean encrypt, Byte[]& output, Int32& resultSize) in /root/corefx-1266141/src/System.Net.Security/src/System/Net/Security/SslStreamPal.Unix.cs:line 207 ----- Inner Stack Trace ----- ``` ## History of failures Day | Build | OS | Test name --- | --- | --- | --- 7/6-7/8 | many | Various Linux | 80x failed in each build (similar SSPI errors) - 480 failures 7/6-7/11 | many | Win7 | 4x & 4x failed in each build (same/similar SSPI errors) - 128 failures 7/11 | N/A | All | Tests were disabled in https://github.com/geoffkizer/corefx/commit/9c4af2973699aea35ce5c60c00f7dd14398e7a14#diff-fd4b6c323e531f0e41d566955e6fbffa 1/5 | 20180105.01 | Win7 | 4x GetAsync_AllowedSSLVersion_Succeeds &<br/>4x GetAsync_SupportedSSLVersion_Succeeds<br/>(both Win7-x86 and Win7-amd64) - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180105.01/workItem/System.Net.Http.Functional.Tests) 1/5 | 20180105.02 | Win7 | 4x GetAsync_AllowedSSLVersion_Succeeds &<br/>4x GetAsync_SupportedSSLVersion_Succeeds<br/>(both Win7-x86 and Win7-amd64) - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180105.02/workItem/System.Net.Http.Functional.Tests) 1/5 | 20180105.02 | RedHat73 | GetAsync_AllowedSSLVersion_Succeeds - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180105.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.ManagedHandler_HttpClientHandler_SslProtocols_Test~2FGetAsync_AllowedSSLVersion_Succeeds(acceptedProtocol:%20Tls,%20requestOnlyThisProtocol:%20False)) 26187 area-Infrastructure "Error MSB6006: ""csc.exe"" exited with code 255 on System.IO.IsolatedStorage.csproj" Opened on behalf of @jcagme Warnings: 1 Status Message: failed Build : Master - 20180105.02 (Product Build) Failing configurations: - Windows - netcoreapp-arm64 [Mission Control Build Info](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/build~2Fproduct~2F/build/20180105.02/workItem/Orchestration/analysis/external/Link) 26188 area-System.Runtime [Proposal] An API for providing compiler hints to the JIT/AOT ### Rationale There are a number of optimizations which require complex or in-depth analysis. In many cases, these optimizations are not possible to make. This can be due to time constraints (JIT), due to requiring an assumption to be made (JIT and AOT), or due to some other reason. However, the developer often knows what assumptions are safe to make. This can be due to the way they wrote their algorithm, some check they performed higher in the code, etc. As such, I propose we provide a set attributes and APIs which can help the compiler (JIT or AOT) produce more optimal code. ### Proposed APIs The proposed API here is very simplistic and represents a core use-case for the new Hardware Intrinsics APIs. There are multiple other additions that may be equally useful, but they should likely be reviewed on a case-by-case basis with their own supporting arguments. ```C# namespace System.Runtime.CompilerServices { public static class Assume { public static void Alignment(void* address, byte alignment); } } ``` ### Alternative Class Names `CompilerHints` was the initial suggested name of the type which would hold these APIs. However, there was some concern over whether some of the suggested APIs actually qualified as `Hints`, since they may be required to be correct and may result in failure or incorrect data at runtime. The general feedback (so far) is that these are assumptions not asserts. @CarolEidt gave a good explanation of the difference here: https://github.com/dotnet/corefx/issues/26188#issuecomment-356147405 Other names suggested include: * Unsafe (from https://github.com/dotnet/coreclr/issues/2725) * CompilerConfig, CompilationConfig, CompilerSetting, CompilationSetting (from @4creators) * Assume, Assumptions, UnsafeAssumptions, OptimizationInstructions (from @ltrzesniewski) * UnsafeAssertions (from @benaadams) ### Additional Details All assumptions should be named. That is, there should be no generic `Assume(bool cond)` method exposed now or in the future. These assumptions are meant to convey an explicit optimization to the compiler and should not be left to interpretation. Potentially as an implementation detail, preferably as part of the contract: Any assumption made by these APIs should be verified when compiling with optimizations disabled. ### Example Case 1 In many high-performance algorithms the user will be reading/writing memory in 16 or 32-byte chunks by utilizing the SIMD registers available to the hardware. It is also generally beneficial to such algorithms to ensure that their reads/writes are aligned as it ensures a read/write never crosses a cache or page boundary (which can incur a heavy performance penalty). Additionally, on older hardware (and some architectures) the unaligned read/write instruction (`movups` on x86) is not as fast as the aligned read/write instruction (`movaps` on x86) or the `reg, reg/mem` encoding of the various instruction may require that `mem` be aligned. However, the GC does not currently support arbitrary alignments for objects and it is impossible to guarantee alignment without pinning and then checking the alignment of the memory. As such, users generally write their algorithm such that it does a single unaligned read/write, adjusts the offset so that the new address is aligned, and then operates on the rest of the data using aligned reads/writes. In some scenarios, it may be difficult or impossible to determine that the pinned address is actually aligned (such as if an address is pinned and then passed to some other method to be processed), so the compiler may not emit the most optimal code. As such, providing an `AssumeAlignment(address, alignment)` that tells the compiler to emit code as if the address was aligned would be beneficial. ### Example Case 2 **NOTE:** This is not currently proposed, but represents another annotation that having compiler support for may be useful. In many cases, a user may write a method that is considered [Pure](https://en.wikipedia.org/wiki/Pure_function) (the method does not modify state and always returns the same input for a given output). In simplistic cases, the compiler may perform constant folding or inlining and the actual computation may not be done. However, in more complex cases the compiler may need to do more in-depth analysis which may prevent it from caching the return value or inlining the method. As such, providing a `PureAttribute` (similarly to the `Contract.PureAttribute`, but actually consumed by the compiler) would be useful as it would allow the compiler to cache the return value and optimize away subsequent calls for a given input. ### Existing IL Support for skipping fault checks There are currently three concrete fault checks which the CLI specifies can be skipped using the `no.` prefx. > This prefix indicates that the subsequent instruction need not perform the specified fault check when it is executed. The byte that follows the instruction code indicates which checks can optionally be skipped. This instruction is not verifiable. > > The prefix can be used in the following circumstances: > > 0x01: typecheck (castclass, unbox, ldelema, stelem, stelem). The CLI can optionally skip any type checks normally performed as part of the execution of the subsequent instruction. InvalidCastException can optionally still be thrown if the check would fail. > > 0x02: rangecheck (ldelem.*, ldelema, stelem.*). The CLI can optionally skip any array range checks normally performed as part of the execution of the subsequent instruction. IndexOutOfRangeException can optionally still be thrown if the check would fail. > > 0x04: nullcheck (ldfld, stfld, callvirt, ldvirtftn, ldelem.*, stelem.*, ldelema). The CLI can optionally skip any null-reference checks normally performed as part of the execution of the subsequent instruction. NullReferenceException can optionally still be thrown if the check would fail. > > The byte values can be OR-ed; e.g.; a value of 0x05 indicates that both typecheck and nullcheck can optionally be omitted. Although these are supported by IL, high level compilers may not emit them. It is potentially useful to expose `Assume.IsType`, `Assume.InRange`, and `Assume.NotNull` checks so that all languages (which compile to IL) can benefit from skipping these fault checks (without having to undergo an IL rewriting step). ### Additional Notes There are many other potential hints or attributes which can be useful and for which the class could be extended. Some of these represent assumptions that a higher level compiler (i.e. C#) cannot make (due to not being able to do things like cross-assembly optimizations, or being required to emit certain IL). 26189 area-System.Runtime Tests For new StringBuilder.Equals(ReadOnlySpan<char>) Api Fixes #25846 Implementation PR - https://github.com/dotnet/coreclr/pull/15759 26190 area-System.Reflection Use Popcnt hardware intrinsic in System.Reflection.Metadata BitArithmetic.CountBits. I did some [Benchmark tests](https://gist.github.com/eerhardt/2228f02c4df576e90ebc3aa7306f9f35) on my machine, and got the following results: | Method | Mean | Error | StdDev | |--------------- |----------:|----------:|----------:| | PopCountInt32 | 2.265 ns | 0.0836 ns | 0.0996 ns | | PopCountInt64 | 2.673 ns | 0.0939 ns | 0.2080 ns | | CountBitsInt32 | 27.530 ns | 0.7307 ns | 1.1158 ns | | CountBitsInt64 | 31.071 ns | 0.5751 ns | 0.5098 ns | See https://github.com/dotnet/coreclr/issues/15506#issuecomment-351494808 for this suggestion. /cc @fiigii @tannergooding @benaadams 26192 area-Infrastructure Pass manifest details to PushToBlobFeed This makes CoreFX produce `corefx.xml` rather than `anonymous.xml` and include a few build details. Generally the same changes as https://github.com/dotnet/coreclr/pull/15705. This marks `*Private*` as packages that won't ship to the NuGet gallery. https://github.com/dotnet/core-eng/issues/2335 26193 area-System.Net Add constructors to TcpClient and TcpListener that accept an existing Socket Please consider adding constructors to TcpClient and TcpListener that accept an existing Socket. ## Rationale and usage If https://github.com/dotnet/corefx/issues/14041 is implemented, we will be able to create `Socket` instances that represent existing handles. It will be very convenient if we could create a `TcpListener` or a `TcpClient` wrapping that socket to avoid dealing with raw sockets. ## Proposed API ```c# namespace System.Net.Sockets { partial class TcpListener { public TcpListener(Socket socket) {} } partial class TcpClient { public TcpClient(Socket socket) {} } } ``` ## Alternatives Instances of all three types could be instantiated from socket handles directly instead. 26195 area-System.Runtime API Proposal: Add extension methods to convert from Span<T> and Memory<T> to VectorXXX<T> and in reverse I would like to propose creating extension methods located in static class `VectorExtensions` in `System.Runtime.Intrinsics` namespace and providing efficient support for working with `Span<T>` and `Memory<T>`. Proposal is to implement them as an `Intrinsics` and implement them in RyuJIT using relevant `Load` and `Store` instructions plus efficient setting of `Length` property by general instructions. The reason for putting this propsal is that having written quite a bit of tests for HW intrinsics I have noticed that the easiest way to work on the edge between safe C# code and HW intrinsics with `Vector128<T>`, `Vector256<T>` and in future with other sizes of the `VectorXXX` is to use `Span<T>` and `Memory<T>` as data interchange formats. ```C# namespace System.Runtime.Intrinsics { [Intrinsic] public static class VectorExtensions { // Span<T> extension methods [Intrinsic] public static Span<T> AsSpan<T>(this Vector64<T> vector) => vector.AsSpan(); [Intrinsic] public static Span<T> AsSpan<T>(this Vector128<T> vector) => vector.AsSpan(); [Intrinsic] public static Span<T> AsSpan<T>(this Vector256<T> vector) => vector.AsSpan(); [Intrinsic] public static Vector64<T> AsVector<T>(this Span<T> span) => span.AsVector(); [Intrinsic] public static Vector128<T> AsVector<T>(this Span<T> span) => span.AsVector(); [Intrinsic] public static Vector256<T> AsVector<T>(this Span<T> span) => span.AsVector(); // ReadOnlySpan<T> extension methods [Intrinsic] public static ReadOnlySpan<T> AsReadOnlySpan<T>(this Vector64<T> vector) => vector.AsReadOnlySpan(); [Intrinsic] public static ReadOnlySpan<T> AsReadOnlySpan<T>(this Vector128<T> vector) => vector.AsReadOnlySpan(); [Intrinsic] public static ReadOnlySpan<T> AsReadOnlySpan<T>(this Vector256<T> vector) => vector.AsReadOnlySpan(); [Intrinsic] public static Vector64<T> AsVector<T>(this ReadOnlySpan<T> span) => span.AsVector(); [Intrinsic] public static Vector128<T> AsVector<T>(this ReadOnlySpan<T> span) => span.AsVector(); [Intrinsic] public static Vector256<T> AsVector<T>(this ReadOnlySpan<T> span) => span.AsVector(); // Memory<T> extension methods [Intrinsic] public static Memory<T> AsMemory<T>(this Vector64<T> vector) => vector.AsMemory(); [Intrinsic] public static Memory<T> AsMemory<T>(this Vector128<T> vector) => vector.AsMemory(); [Intrinsic] public static Memory<T> AsMemory<T>(this Vector256<T> vector) => vector.AsMemory(); [Intrinsic] public static Vector64<T> AsVector<T>(this Memory<T> memory) => memory.AsVector(); [Intrinsic] public static Vector128<T> AsVector<T>(this Memory<T> memory) => memory.AsVector(); [Intrinsic] public static Vector256<T> AsVector<T>(this Memory<T> memory) => memory.AsVector(); // ReadOnlyMemory<T> extension methods [Intrinsic] public static ReadOnlyMemory<T> AsReadOnlyMemory<T>(this Vector64<T> vector) => vector.AsReadOnlyMemory(); [Intrinsic] public static ReadOnlyMemory<T> AsReadOnlyMemory<T>(this Vector128<T> vector) => vector.AsReadOnlyMemory(); [Intrinsic] public static ReadOnlyMemory<T> AsReadOnlyMemory<T>(this Vector256<T> vector) => vector.AsReadOnlyMemory(); [Intrinsic] public static Vector64<T> AsVector<T>(this ReadOnlyMemory<T> memory) => memory.AsVector(); [Intrinsic] public static Vector128<T> AsVector<T>(this ReadOnlyMemory<T> memory) => memory.AsVector(); [Intrinsic] public static Vector256<T> AsVector<T>(this ReadOnlyMemory<T> memory) => memory.AsVector(); } ``` 26196 area-System.Collections Follow up on #25738 This condition is still needed for nuget packaging. cc @weshaggard @safern 26198 area-System.Data Fix for SqlConnection failure when having multiple concurrent users In .NET Core 2.0, SqlConnection failed on not many multiple concurrent users during ASP.NET web application load testing. (https://github.com/dotnet/corefx/issues/25620) This fix resolve the issue. 26199 area-System.Net Implement DisableRenegotiation property on SslStream. cc @Tratcher @davidsh @geoffkizer @stephentoub @wfurt @karelz fixes #26168 26200 area-System.Data Fix for SqlConnection failure when having multiple concurrent users In .NET Core 2.0, SqlConnection failed on not many multiple concurrent users during ASP.NET web application load testing. (https://github.com/dotnet/corefx/issues/25620) This fix resolve the issue. 26201 area-System.Net Add application/json to System.Net.Mime.MediaTypeNames.Application "# API Proposal (Added by @karelz based on original issue) Add `application/json` MIME type (based on JSON RFC 4627 - https://www.ietf.org/rfc/rfc4627.txt) ```diff namespace System.Net.Mime { public static class MediaTypeNames { public static class Application { public const string Soap = ""application/soap+xml""; public const string Octet = ""application/octet-stream""; public const string Rtf = ""application/rtf""; public const string Pdf = ""application/pdf""; public const string Zip = ""application/zip""; + public const string Json = ""application/json""; + public const string Xml = ""application/xml"" } } } ``` ## Motivation Common StackOverflow question: https://stackoverflow.com/questions/477816/what-is-the-correct-json-content-type (8.6K upvotes) # Original report The `MediaTypeNames` class contains constants for common mime types. Surprisingly, it doesn't contain the type for JSON, which is both extremely common and frequently confused (https://stackoverflow.com/questions/477816/what-is-the-correct-json-content-type). Would it be worth adding a constant entry for this? " 26202 area-System.Runtime Add regression test for GetHashCode of default handles Regression tests for dotnet/corert#5216. This is a port of these CoreCLR tests: https://github.com/dotnet/coreclr/blob/180a3c80b1d193f4c63b265e21bd29277b81cbcd/tests/src/CoreMangLib/cti/system/runtimemethodhandle/runtimemethodhanldegethashcode.cs https://github.com/dotnet/coreclr/blob/180a3c80b1d193f4c63b265e21bd29277b81cbcd/tests/src/CoreMangLib/cti/system/runtimefieldhandle/runtimefieldhandlegethashcode.cs (It's the first half of both tests, since the second half makes no sense.) 26203 area-Meta Unable to install `System.Threading.Overlapped` and build problem with `Windows.Win32.Registry` "Steps to Reproduce Create new xamarin.forms project Add Xamarin.Mac cocoa project Install SerialPortStreamCore nuget to it. Expected Behavior The nuget should be added successfully to the project Actual Behavior The nuget adds itself successfully to netstandard shared project. But fails to add to Xamarin.Mac. I need this package for Serial port programming. Environment Visual Studio for Mac Community version 7.3.2(build 12) Xamarin.Mac Version: 4.0.0.214 (Visual Studio Community) Operating System: Mac OS X 10.13.2 === Visual Studio Community 2017 for Mac === Version 7.3.2 (build 12) Installation UUID: ff0b8bd1-b591-48e7-8748-666f21ab8827 Runtime: Mono 5.4.1.7 (2017-06/e66d9abbb27) (64-bit) GTK+ 2.24.23 (Raleigh theme) Package version: 504010007 === NuGet === Version: 4.3.1.4445 === .NET Core === Runtime: /usr/local/share/dotnet/dotnet Runtime Versions: 2.0.3 2.0.0 SDK: /usr/local/share/dotnet/sdk/2.0.3/Sdks SDK Versions: 2.0.3 2.0.0 MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/msbuild/15.0/bin/Sdks === Xamarin.Profiler === Version: 1.6.0 Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler === Apple Developer Tools === Xcode 9.2 (13772) Build 9C40b === Xamarin.iOS === Version: 11.6.1.2 (Visual Studio Community) Hash: 6857dfcc Branch: xcode9.2 Build date: 2017-12-04 21:20:41-0500 === Xamarin.Android === Version: 8.1.0.25 (Visual Studio Community) Android SDK: /Users/paramjit/Library/Developer/Xamarin/android-sdk-macosx Supported Android versions: 7.0 (API level 24) 7.1 (API level 25) 8.0 (API level 26) SDK Tools Version: 26.1.1 SDK Platform Tools Version: 27.0.0 SDK Build Tools Version: 27.0.1 Java SDK: /usr java version ""1.8.0_131"" Java(TM) SE Runtime Environment (build 1.8.0_131-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode) Android Designer EPL code available here: https://github.com/xamarin/AndroidDesigner.EPL === Xamarin Inspector === Version: 1.3.2 Hash: 461f09a Branch: 1.3-release Build date: Tue, 03 Oct 2017 18:26:57 GMT Client compatibility: 1 === Xamarin.Mac === Version: 4.0.0.214 (Visual Studio Community) === Build Information === Release ID: 703020012 Git revision: 7d0c9d7ad46b125cf4b7bbf9532c0531b6433ce6 Build date: 2017-12-12 14:03:18-05 Xamarin addins: 6dddaa49fbecb2695fcdcd6b712eb269e288518c Build lane: monodevelop-lion-d15-5 === Operating System === Mac OS X 10.13.2 Darwin 17.3.0 Darwin Kernel Version 17.3.0 Thu Nov 9 18:09:22 PST 2017 root:xnu-4570.31.3~1/RELEASE_X86_64 x86_64 === Enabled user installed addins === MFractor 3.03.00 Internet of Things (IoT) development (Preview) 7.1 Build Logs Package 'System.Threading.Overlapped.4.3.0 : Microsoft.NETCore.Platforms [1.1.0, ), System.Resources.ResourceManager [4.3.0, ), System.Runtime [4.3.0, ), System.Runtime.Handles [4.3.0, )' does not exist in project 'CallTech.MacOS' Could not install package 'System.Threading.Overlapped 4.3.0'. You are trying to install this package into a project that targets 'Xamarin.Mac,Version=v2.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author. Also see at[Original issue](https://github.com/xamarin/xamarin-macios/issues/3138)" 26204 area-System.Diagnostics Dispose of process streams if they are not referenced by the user. Partial fix to #25962 If the process pipes for stdin/stdout/stderr are not touched by the user, dispose of them. 26205 area-Infrastructure Update CoreClr, CoreFx, CoreSetup, ProjectNTfs, ProjectNTfsTestILC to preview1-26108-02, preview1-26108-02, preview1-26107-01, beta-26108-00, beta-26108-00, respectively (master) 26207 area-System.Runtime [Proposal] Add string.Contains overloads to mirror string.IndexOf ones ## Proposed API ```cs bool Contains(string value, int index); bool Contains(string value, int startIndex, int count); bool Contains(string value, StringComparison comparisonType); bool Contains(string value, int index, StringComparison comparisonType); bool Contains(string value, int startIndex, int count, StringComparison comparisonType); ``` ## Rationale - It seems inconsistent that `Contains`, a method that compares strings, does not accept a `StringComparison` argument while many other string-comparing methods do. - Adding the index-based overloads may prevent some string allocations because people can do `str.Contains(other, 3, 10)` instead of `str.Substring(3, 10).Contains(other)`. 26209 area-System.Runtime Deconstruct for DateTime / TimeSpan / DateTimeOffset _From @panost on January 7, 2018 13:42_ For example method https://github.com/dotnet/coreclr/blob/0efe34efa69dea7f9b94ddc8251810e0a264671c/src/mscorlib/shared/System/DateTime.cs#L847 could be made public and renamed to Deconstruct, so we can write var (year,month,day) = DateTime.Now; The same pattern can be applied to DateTimeOffset and TimeSpan _Copied from original issue: dotnet/coreclr#15776_ 26210 area-System.Net XmlReader.Create thrown ArgumentOutOfRangeException on string with diacritics "Hi, I am in the process of migration our Windows game server into Linux. I already ported it to .NET Standard 2.0, but I am having an issue here. When I try to read .xml files that have diacritics in the filename, then it throws on me. This code, ran at linux: ```c# using System; using System.Xml; namespace test { class Program { static void Main(string[] args) { using (XmlReader.Create(""/mnt/c/dev/csharp/manawydan-git/Server/RunUOPro/Data/Interaction/npc/Hledání draka.xml"")) { Console.WriteLine(""hi""); } } } } ``` Throws: ``` Unhandled Exception: System.ArgumentOutOfRangeException: Length cannot be less than zero. Parameter name: length at System.String.Substring(Int32 startIndex, Int32 length) at System.Uri.CreateHostStringHelper(String str, UInt16 idx, UInt16 end, Flags& flags, String& scopeId) at System.Uri.CreateHostString() at System.Uri.EnsureHostString(Boolean allowDnsOptimization) at System.Uri.GetComponentsHelper(UriComponents uriComponents, UriFormat uriFormat) at System.Uri.ToString() at System.Xml.XmlTextReaderImpl..ctor(String uriStr, XmlReaderSettings settings, XmlParserContext context, XmlResolver uriResolver) at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext) at System.Xml.XmlReader.Create(String inputUri) at test.Program.Main(String[] args) in /mnt/c/dev/csharp/manawydan-git/test/Program.cs:line 11 ``` I tried to debug the source of .NET Core and got to Uri.cs:4768 with line: ```_string.CopyTo(_info.Offset.Path, dest, end, _info.Offset.Query - _info.Offset.Path);``` Inside this It throws that exception on string.cs:128 arguments to the CopyTo method are: ``` sourceIndex 5 int destination {char[94]} char[] destinationIndex 8 int count 88 int ``` With them the condition ```destinationIndex > destination.Length - count``` fails because 8 > 94-88 => 8 > 6. My guess is, that Uri badly calculates the length of a string because of those diacritics characters. I will try to remove diacritics from my xml filenames so that our server can start properly, but this is cumbersome at the very least. [EDIT] Add C# syntax highlighting by @karelz" 26211 area-System.Text Could not load file or assembly 'System.Text.Encoding.CodePages, Version=4.1.0.0...' "Hello, I found a strange issue when using CodePagesEncodingProvider of System.Text.Encoding.CodePages assembly. I did not test other encoding but when I try to return a file in aspnet core mvc application in the following encoding CodePagesEncodingProvider.Instance.GetEncoding(866), the application throws an exception: > System.IO.FileNotFoundException: Could not load file or assembly 'System.Text.Encoding.CodePages, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. > > File name: 'System.Text.Encoding.CodePages, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' > at aspnet_codepage_test.Controllers.HomeController.GetFile() > at lambda_method(Closure , Object , Object[] ) > at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters) > at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeActionMethodAsync>d__12.MoveNext() > --- End of stack trace from previous location where exception was thrown --- > at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() > at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) > at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeNextActionFilterAsync>d__10.MoveNext() > --- End of stack trace from previous location where exception was thrown --- > at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() > at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) > at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) > at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeInnerFilterAsync>d__14.MoveNext() > --- End of stack trace from previous location where exception was thrown --- > at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() > at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) > at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.<InvokeNextResourceFilter>d__22.MoveNext() > --- End of stack trace from previous location where exception was thrown --- > at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() > at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context) > at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) > at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.<InvokeFilterPipelineAsync>d__17.MoveNext() > --- End of stack trace from previous location where exception was thrown --- > at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() > at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) > at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.<InvokeAsync>d__15.MoveNext() > --- End of stack trace from previous location where exception was thrown --- > at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() > at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) > at Microsoft.AspNetCore.Builder.RouterMiddleware.<Invoke>d__4.MoveNext() > --- End of stack trace from previous location where exception was thrown --- > at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() > at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) > at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>d__6.MoveNext() > A code is extremely simple: ``` public IActionResult GetFile() { var encoding = CodePagesEncodingProvider.Instance.GetEncoding(866); var bytes = encoding.GetBytes(""Cтрока""); return File(new MemoryStream(bytes), ""text/plain"", ""111.txt""); } ``` As a initial string I use Russian word. The interesting fact is it reproduces only in a production settings, so when I try to run it from a working directory, it works perfectly. Once I publish and run ""dotnet ./project.dll"", it fails. I created a sample application to give it to you, so you can reproduce an issue. I also tried to run this application in a docker container, it has the same result. [aspnet-codepage-test.zip](https://github.com/dotnet/corefx/files/1610082/aspnet-codepage-test.zip) I have the following environment: ubuntu 16.04 dotnet version: 2.0.0 Please find the steps to reproduce below: - unzip an archive - go to an extracted folder - run: dotnet restore - run: dotnet build -c Release - run: dotnet publish -c Release - run: dotnet ./bin/Release/netcoreapp2.0/publish/aspnet-codepage-test.dll - go to a browser and open http://localhost:5000/ - find a menu item ""Get file"" at the top of the page and click it Please let me know if I missed something. Thanks in advance. " 26212 area-System.Net Session OnStart and Session OnEnd I came here from https://github.com/aspnet/Session/issues/20 @Tratcher @davidfowl @muratg If you are not going to implement session onend; why we're setting the sessiontimeout? I read all of above, but not implementing sesion onend is really strange decision. Every application uses session events. Also @Tratcher adviced that we can store data on sql not session. This is also not acceptable... My issue is I need session start event to recognize user from its cookie to auto login. But I cant handle session start atm... 26213 area-System.Net [Desktop] Test failure: System.Net.Security.Tests.SslStreamNetworkStreamTest / SslStream_NetworkStream_Renegotiation_Succeeds Opened on behalf of @Sunny-pu The test `System.Net.Security.Tests.SslStreamNetworkStreamTest/SslStream_NetworkStream_Renegotiation_Succeeds` has failed. Details: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fdesktop~2Fcli~2F/build/20180108.01/workItem/System.Net.Security.Tests/analysis/xunit/System.Net.Security.Tests.SslStreamNetworkStreamTest~2FSslStream_NetworkStream_Renegotiation_Succeeds Assert.Equal() Failure\r Expected: -1\r Actual: 84 Stack Trace: at System.Net.Security.Tests.SslStreamNetworkStreamTest.<SslStream_NetworkStream_Renegotiation_Succeeds>d__1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) Build : Master - 20180108.01 (Full Framework Tests) Failing configurations: - Windows.10.Amd64-x64 - Release - Windows.10.Amd64-x86 - Release 26214 area-Infrastructure "Tests failed with ""Exit code was 131 but it should have been 42""" failed test: System.Data.Tests.DataTableTest.PropertyExceptions System.Data.Tests.DataTableTest.WriteXmlSchema System.Data.Tests.SqlTypes.SqlStringTest.Properties System.Data.Tests.AppDomainsAndFormatInfo.Bug82109 System.Data.Tests.DataSetReadXmlSchemaTest.LocaleOnRootWithoutIsDataSet System.Data.Tests.DataSetTest.WriteXmlSchema System.Data.Tests.DataSetTest.WriteXmlModeSchema1 Configuration: oxs10.12_release Detail: https://ci.dot.net/job/dotnet_corefx/job/master/job/osx10.12_release/3963 MESSAGE: Exit code was 131 but it should have been 42\nExpected: True\nActual: False +++++++++++++++++++ STACK TRACE: at System.Diagnostics.RemoteExecutorTestBase.RemoteInvokeHandle.Dispose() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_release/src/CoreFx.Private.TestUtilities/src/System/Diagnostics/RemoteExecutorTestBase.cs:line 203 26216 area-System.Net High latency (> 450ms) when reading from NetworkStream Scenario: * TcpClient & TcpListener to talk between different processes * High latency (> 450ms) when receiving messages on the _local_ machine We have a protocol that requires that client & server will exchange heartbeats every 300 ms at most. So we set NoDelay on the TCP client, but sometimes when we send a message that is around 100 bytes big, we read it from the stream always in about 450ms +- 10%. We enforced PSH flag by setting `IgnorePushBitOnReceives` under `Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\AFD\Parameters` but it didn't helped. the full configuration of the TCP client: `tcpClient.NoDelay = true;` `tcpClient.ReceiveBufferSize = 32 * 1024;` ` tcpClient.SendBufferSize = 4096;` ` tcpClient.ReceiveTimeout = tcpClient.SendTimeout = 15_000;` Unfortunately we were unable to repo this kind of behavior in an isolated project. We always read into a buffer that is 32Kb in size and the data size can vary wildly. In this case, a server is responding to a write made by the client and the client is seeing the result many hundreds of milliseconds later. To make things really strange, this is on _localhost_, so this should be really speedy. We've found this post: http://smallvoid.com/article/winnt-tcp-push-flag.html Which seems very relevant, in particular: The recv() / WSARecv() calls returns when one of the following events occurs: * Data arrives with the PUSH bit set. * The user recv buffer is full. * 0.5 seconds have elapsed since any data has arrived. However, even after setting the registry value, we are still seeing this behavior. Is it possible that this behavior is related to the size of the buffer we send to the Read() call vs. the amount of data that is actually there? Can anyone suggest any way to investigate this further? We believe that this behavior is also something that we are seeing in production which is causing us serious issues. 26217 area-System.Memory Reenable Span.CopyToLargeSizeTest Fixes https://github.com/dotnet/corefx/issues/25254 Let's see if using memory-mapped files makes this test less punishing. 26218 area-Infrastructure UWP F5 tests broken on ARM eg https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fuwp~2F/build/20180108.02/workItem/Canonicalization.Tests/wilogs ``` 2018-01-08 07:15:25,947: INFO: proc(54): run_and_log_output: Output: C:\dotnetbuild\work\56f3b3d4-ba95-4a90-a2f4-de67da412029\Work\0643d265-c6e2-45c8-9f80-4a0d2f39267b\Unzip>call C:\dotnetbuild\work\56f3b3d4-ba95-4a90-a2f4-de67da412029\Payload\Launcher\WindowsStoreAppLauncher.exe -test appxmanifest.xml Canonicalization.Tests.dll -xml testResults.xml -notrait category=nonuaptests -notrait category=nonwindowstests -notrait category=failing 2018-01-08 07:15:26,040: INFO: proc(54): run_and_log_output: Output: Got manifest file appxmanifest.xml 2018-01-08 07:15:26,165: INFO: proc(54): run_and_log_output: Output: Removing any previous installation... 2018-01-08 07:15:26,181: INFO: proc(54): run_and_log_output: Output: Installing the application... 2018-01-08 07:15:26,963: INFO: proc(54): run_and_log_output: Output: 2018-01-08 07:15:26,963: INFO: proc(54): run_and_log_output: Output: FAILED 0x80073CFF (To install this application you need either a Windows developer license or a sideloading-enabled system. 2018-01-08 07:15:26,963: INFO: proc(54): run_and_log_output: Output: ) ``` @dotnet/dnceng did anything change about the ARM machine setup? They need to have a developer license or sideloading enabled. cc @safern 26219 area-System.Net Linux ClientWebSocket does not change state or CloseStatus on server crash I am using ClientWebSocket to connect to an ASP.Net core server. During development on a windows 10 machine, if I the asp.net server were to close for some reason an exception would be thrown. Along with this execption, the CloseStatus and the State of the connection would both be changed. The exact same code while run under linux is still throwing the same exception, but the State of the connection is renaming open and the CloseStatus is remaining null. There is no current method I can tell to verify that the connection is still valid other than forcibly disposing the connection when this disconnect occurs. 26220 area-System.Runtime API Proposal : Arm64 or Generic Intrinsics Crc32 Target framework netcoreapp 2.1 or later ```csharp namespace System.Runtime.Intrinsics.Arm.Arm64 { public static class Crc32 { public static bool IsSupported { get { throw new NotImplementedException(); } } public static uint Crc32(uint crc, byte data) { throw new NotImplementedException(); } public static uint Crc32(uint crc, ushort data) { throw new NotImplementedException(); } public static uint Crc32(uint crc, uint data) { throw new NotImplementedException(); } public static uint Crc32(uint crc, ulong data) { throw new NotImplementedException(); } public static uint Crc32C(uint crc, byte data) { throw new NotImplementedException(); } public static uint Crc32C(uint crc, ushort data) { throw new NotImplementedException(); } public static uint Crc32C(uint crc, uint data) { throw new NotImplementedException(); } public static uint Crc32C(uint crc, ulong data) { throw new NotImplementedException(); } } } ``` Arm32 supports similar instructions but does not support the 64 bit forms. 26221 area-Meta Update Compat pack preview on Nuget Tracking another preview of the Compat pack. We expect to mark it final with 2.1 release. 26222 area-Serialization No match was found for the specified search criteria and package name 'System.Runtime.Serialization.Primitives' @StingyJack commented on [Tue Jan 02 2018](https://github.com/dotnet/wcf/issues/2469) This was working recently, but now its breaking builds as the package cannot be downloaded. I tried to push a copy to our private nugetserver repo, but it barks about the nuspec being somehow invalid ``` Process information: Process ID: 5016 Process name: w3wp.exe Account name: IIS APPPOOL\ASP.NET v4.0 Exception information: Exception type: InvalidOperationException Exception message: 'System.Runtime.Serialization.Primitives' already has a dependency defined for 'System.Runtime'. at NuGet.Manifest.ValidateDependencySets(IPackageMetadata metadata) at NuGet.Manifest.ReadFrom(Stream stream, IPropertyProvider propertyProvider, Boolean validateSchema) at NuGet.LocalPackage.ReadManifest(Stream manifestStream) at NuGet.ZipPackage.EnsureManifest(Func`1 manifestStreamFactory) at NuGet.ZipPackage..ctor(Stream stream) at NuGet.Server.Publishing.PackageService.CreatePackage(HttpContextBase context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) `` 26223 area-System.Net Equivalent to WebRequestHandler in .net Core In .net Framework we could use the WebRequestHandler, which has a UnsafeAuthenticatedConnectionSharing property. That will allow us to send multiple requests while keeping the connection open and without verifying credentials again. This is a huge performance boost when multiple requests are issued to the same host. Is there similar functionality in .net Core ? 26224 area-Serialization XmlSerializer throws exception when the type belongs to an assembly with no location property set "I have a plugin system where Assemblies are dynamically loaded into a custom AssemblyLoadContext, using the LoadFromStream method. The following exception is thrown if I try to create an XmlSerializer for any type loaded in one of these assemblies. ``` Unhandled Exception: System.ArgumentException: The path is not of a legal form. Parameter name: path at System.IO.Path.GetDirectoryName(String path) at System.Xml.Serialization.TempAssembly.LoadGeneratedAssembly(Type type, String defaultNamespace, XmlSerializerImplementation& contract) at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace) at System.Xml.Serialization.XmlSerializer..ctor(Type type) ``` I can reproduce this issue with the following: ```c# using System; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.Loader; using System.Xml.Serialization; namespace TestSerializer { public class Program { public static void Main() { CustomContext context = new CustomContext(); Type programType = context.GetProgramType(); XmlSerializer xml = new XmlSerializer(programType); xml.Serialize(Console.Out, Activator.CreateInstance(programType)); } } public class CustomContext : AssemblyLoadContext { public Type GetProgramType() { using (Stream s = File.Open(typeof(Program).GetTypeInfo().Assembly.Location, FileMode.Open, FileAccess.Read, FileShare.Read)) return LoadFromStream(s).ExportedTypes.First(t => t.Name == ""Program""); } protected override Assembly Load(AssemblyName assemblyName) => null; } } ``` Running this with using the --fx-version 2.0.0 switch will run correctly, but the other version I have installed, 2.0.3 will fail with the exception above. [EDIT] Add C# syntax highlighting by @karelz" 26228 area-System.Memory Add Span<T>(ref T obj) constructor It is a small annoyance that to use a span/readonly span with a single instance of a value type you have to mark the assembly as unsafe (or call some helper code that does so)... ```csharp void unsafe Foo(ref MyStruct thing) { var myStructSpan = new Span<MyStruct>(Unsafe.AsPointer(ref thing), 1); ref var component = ref myStructSpan.AsBytes().Slice(6, 11).NonPortableCast<byte, OtherStruct>()[0]; // work with component... } ``` It would be nice if I had a constructor that did this for me: ```csharp public unsafe Span(ref T item) { if (SpanHelpers.IsReferenceOrContainsReferences<T>()) ThrowHelper.ThrowArgumentException_InvalidTypeWithPointersNotSupported(typeof(T)); _length = 1; _pinnable = null; _byteOffset = new IntPtr(Unsafe.AsPointer(ref item)); } ``` And same for `ReadOnlySpan<T>` Or is there a better way to do this? 26229 area-System.IO Add Brotli Compression to CoreFX - Adds source, tests, and packaging for Brotli compression and decompression to CoreFX. - Fulfills all requirements of [the Brotli epic](https://github.com/dotnet/corefx/issues/24826) - Adds Brotli native code to clrcompression.dll and System.IO.Compression.Native.so - Brotli is in the System.IO.Compression namespace but in its own System.IO.Compression.Brotli assembly which is set as inbox for the next release I've split up the code into five commits so reviewing the important stuff is easier. [The commit with the source](https://github.com/dotnet/corefx/commit/3a9b5584029f99bbbf4cb9f590171fd0b8749a17) is the most interesting one. resolves #25785 resolves https://github.com/dotnet/corefxlab/issues/1728 resolves https://github.com/dotnet/corefxlab/issues/1677 resolves https://github.com/dotnet/corefx/issues/24826 resolves https://github.com/dotnet/corefxlab/issues/1958 resolves https://github.com/dotnet/corefx/issues/26089 26231 area-System.Runtime Tests for Added Append(Stringbuilder,int,int) and Append(StringBuilder) overlaod apis Fixes https://github.com/dotnet/corefx/issues/4928 Implemenation Pr- https://github.com/dotnet/coreclr/pull/15786 Previous Implementation Pr- dotnet/coreclr#8615 26232 area-System.Memory Add Span SequenceCompareTo extension method Fixes https://github.com/dotnet/corefx/issues/16878 - Added unit and perf tests - Vectorized the `SequenceCompareTo<byte>` implementation - Note: I did not loop unroll `SequenceCompareTo<T>` similar to `SequenceEqual<T>` since I observed no performance improvement (in fact there was some regression for T = int) cc @KrzysztofCwalina, @jkotas, @AtsushiKan, @AronParker, @Bobris 26233 area-System.Net Add PostAsJsonAsync<T>, PutAsJsonAsync<T> and ReadAsJsonAsync<T> to HttpClient These methods were and are available on the .NET framework using the `HttpClientExtensions` class. They make life easy for developers trying to make HTTP calls from their code as they don't have to manually deal with creating objects from the responses or parsing their typed payload into `StringContent` or what not. 26234 area-System.Diagnostics Expand Process.Kill to Optionally Kill a Process Tree ## Issue .Net Standard does not provide a means to kill a process tree (that is, a given process and all of its child/descendant processes). In the Windows world, this can be done by assembling the list of descendant processes to terminate using [WMI's Win32_Process management object](https://stackoverflow.com/a/7189381/117424), [performance counters](https://stackoverflow.com/a/2336322/117424) or [P/Invoke](https://stackoverflow.com/a/3346055/117424), then killing each one, then killing the parent/root process. However, since .Net Standard doesn't provide a way to enumerate child/descendant processes, it's impossible for a user to directly implement this approach in a cross-platform way using only .Net Standard. If the ability to enumerate child processes were added (as #25855 proposes), there'd still be complexities involved with using the child process list to kill a process tree as care is needed to ensure that unrelated processes aren't inadvertently terminated because of process ID reuse. This proposal saves the developer from needing to worry about such complexities and instead provides a simple, one-line way to terminate a process tree. ## Rationale Sometimes, it's necessary to end a process tree. :-) For example, [`Microsoft.DotNet.Tools.Test.Utilities.ProcessExtension`](https://github.com/dotnet/cli/blob/35e661bbb3b2f0943590cb63747ae53a68e6eb5d/test/Microsoft.DotNet.Tools.Tests.Utilities/Extensions/ProcessExtensions.cs#L27) relies on different code paths to handle killing a process tree on Windows and Linux. Both code paths involve invoking one or more command-line processes. If this proposal were implemented, presumably this logic could be replaced with a single-line kill all method call followed possibly by a call to [`WaithForExit(int milliseconds)`](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.process.waitforexit?view=netstandard-2.0#System_Diagnostics_Process_WaitForExit_System_Int32_). No multiple code paths. No need to invoke command-line processes. Another example: A project I'm currently working on uses integration tests that use [`Process`](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.process?view=netstandard-2.0) to call `dotnet run` to start a server process. When the test has completed, it's possible to use Process's `Kill()` to end the parent dotnet process. However, this leaves child processes still running—which causes problems. ## Proposal Extend `Process` as follows: public class Process : .... { public void Kill(bool entireProcessTree = false); // false = existing behavior of Kill() } With this change, `Kill` will behave exactly as it does at current if it is called with no arguments or with `false` as its argument. However, when called with `true` as its argument, in a platform-appropriate way all descendant processes will be killed, followed by the process represented by the current `Process` instance. 26236 area-System.Security [Discussion] Microsoft Security Advisory CVE-2018-0786: Security Feature Bypass in X509 Certificate Validation "# Microsoft Security Advisory CVE-2018-0786 ## Security Feature Bypass in X509 Certificate Validation ### Executive Summary Microsoft is releasing this security advisory to provide information about a vulnerability in the WCF packages for .NET Core 1.0 and 1.1, and 2.0. This advisory also provides guidance on what developers can do to update their applications correctly. Microsoft is aware of a security vulnerability in the public versions of .NET Core where an attacker could present a certificate that is marked invalid for a specific use, but a component uses it for that purpose. This action disregards the Enhanced Key Usage tagging. The security update addresses the vulnerability by ensuring that .NET Core components completely validate certificates. In addition to updating any vulnerable packages and redeploying applications system administrators are advised to update their .NET Core runtimes to versions 1.0.9, 1.1.6 and 2.0.5. Developers are advised to update their .NET Core SDK to version 2.1.4 or 1.1.7. These runtime and SDK versions address [CVE-2018-0764](https://github.com/dotnet/announcements/issues/52). ### Announcement The original announcement can be found at https://github.com/dotnet/announcements/issues/51 ## Affected Software The vulnerability affects any Microsoft .NET Core project if it uses any of affected packages versions listed below | Package name | Package versions | Fixed package versions | .NET Core version | | :-- | :-- | :-- | :-- | | System.ServiceModel.Primitives | 4.4.0 | 4.4.1 | 2.0 | | System.ServiceModel.Http | 4.4.0 | 4.4.1 | 2.0 | | System.ServiceModel.NetTcp | 4.4.0 | 4.4.1 | 2.0 | | System.ServiceModel.Duplex | 4.4.0 | 4.4.1 | 2.0 | | System.ServiceModel.Security | 4.4.0 | 4.4.1 | 2.0 | | System.Private.ServiceModel | 4.4.0 | 4.4.1 | 2.0 | | Package name | Package versions | Fixed package versions | .NET Core version | | :-- | :-- | :-- | :-- | | System.ServiceModel.Primitives | 4.3.0 | 4.3.1 | 1.1 | | System.ServiceModel.Http | 4.3.0 | 4.3.1 | 1.1 | | System.ServiceModel.NetTcp | 4.3.0 | 4.3.1 | 1.1 | | System.ServiceModel.Duplex | 4.3.0 | 4.3.1 | 1.1 | | System.ServiceModel.Security | 4.3.0 | 4.3.1 | 1.1 | | System.Private.ServiceModel | 4.3.0 | 4.3.1 | 1.1 | | Package name | Package versions | Fixed package versions | .NET Core version | | :-- | :-- | :-- | :-- | | System.ServiceModel.Primitives | 4.1.0 | 4.1.1 | 1.0 | | System.ServiceModel.Http | 4.1.0 | 4.1.1 | 1.0 | | System.ServiceModel.NetTcp | 4.1.0 | 4.1.1 | 1.0 | | System.ServiceModel.Duplex | 4.0.1 | 4.0.2 | 1.0 | | System.ServiceModel.Security | 4.0.1 | 4.0.2 | 1.0 | | System.Private.ServiceModel | 4.1.0 | 4.1.1 | 1.0 | This vulnerability also affects any .NET native applications using the following NuGet packages. NuGet Packages | Fixed NuGet Packages -- | -- Microsoft.NETCore.UniversalWindowsPlatform 5.2.* (contains .NET native 1.4.*) | Microsoft.NETCore.UniversalWindowsPlatform 5.2.4 Microsoft.NETCore.UniversalWindowsPlatform 5.3.* (contains .NET native 1.6.*) | Microsoft.NETCore.UniversalWindowsPlatform 5.3.5 Microsoft.NETCore.UniversalWindowsPlatform 5.4.* (contains .NET native 1.7.*) | Microsoft.NETCore.UniversalWindowsPlatform 5.4.2 Microsoft.NETCore.UniversalWindowsPlatform 6.0.* (contains .NET native 2.0.*) | Microsoft.NETCore.UniversalWindowsPlatform 6.0.6 ## Advisory FAQ ### How do I know if I am affected? .NET Core and ASP.NET Core have two types of dependencies: direct and transitive. If your project has a direct or transitive dependency on any of the packages and versions listed above, you are affected. ### NET Core Project formats .NET Core has two different project file formats, depending on what software created the project. 1. `project.json` is the format used in .NET Core 1.0 and Microsoft Visual Studio 2015. 2. `csproj` is the format used in .NET Core 1.1 and Microsoft Visual Studio 2017. You must ensure you follow the correct update instructions for your project type. ### Direct Dependencies Direct dependencies are dependencies where you specifically add a package to your project. For example, if you add the `Microsoft.AspNetCore.Mvc` package to your project then you have taken a direct dependency on` Microsoft.AspNetCore.Mvc`. Direct dependencies are discoverable by reviewing your `project.json` or `csproj` file. ### Transitive Dependencies Transitive dependencies occur when you add a package to your project that in turn relies on another package. For example, the `Microsoft.AspNetCore.Mvc` package depends on the `Microsoft.AspNetCore.Mvc.Core` package (among others). If your project has a direct dependency on `Microsoft.AspNetCore.Mvc` then it also has a transitive dependency on the `Microsoft.AspNetCore.Mvc.Core` package. Transitive dependencies are reviewable in the Visual Studio Solution Explorer window, which supports searching, or by reviewing the `project.lock.json` file contained in the root directory of your project for `project.json` projects or the `project.assets.json` file contained in the obj directory of your project for `csproj` projects. These files are the authoritative list of all packages used by your project, containing both direct and transitive dependencies. ## How do I fix my affected application? You will need to fix both direct dependencies and review and fix any transitive dependencies. The affected packages and versions in the previous “Affected Software” section include each vulnerable package, the vulnerable versions, and the patched versions ### Fixing Direct Dependencies – project.json/VS2015 Open your `project.json` file in your editor. Look for the dependencies section. Below is an example dependencies section: ``` json ""dependencies"": { ""Microsoft.NETCore.App"": { ""version"": ""1.0.1"", ""type"": ""platform"" }, ""Microsoft.AspNetCore.Server.Kestrel"": ""1.0.1"", ""System.ServiceModel.Security "": ""4.0.1"", } ``` This example has three direct dependencies: `Microsoft.NETCore.App`, `Microsoft.AspNetCore.Server.Kestrel` and `System.ServiceModel.Security`. `Microsoft.NetCore.App` is the platform the application targets, you should ignore this. The other packages expose their version to the right of the package name. In our example, our non-platform packages are version 1.0.1. Review your direct dependencies for any instance of the packages and versions listed above. In the example above, there is a direct dependency on the vulnerable package, `System.ServiceModel.Security` version 4.0.1. To update to the fixed package, change the version number to be the appropriate package for your release. In the example, this would be updating `System.ServiceModel.Security` to 4.0.2 After updating the vulnerable package versions, save your `project.json` file. The dependencies section in our example `project.json` would now look as follows: ```json ""dependencies"": { ""Microsoft.NETCore.App"": { ""version"": ""1.0.1"", ""type"": ""platform"" }, ""Microsoft.AspNetCore.Server.Kestrel"": ""1.0.1"", ""System.ServiceModel.Security "": ""4.0.2"", } ``` If you are using Visual Studio and save your updated `project.json` file, Visual Studio will restore the new package version. You can see the restore results by opening the Output Window (Ctrl+Alt+O) and changing the Show output from drop-down list to Package Manager. If you are not using Visual Studio, open a command line and change to your project directory. Execute the `dotnet restore` command to restore your new dependency. After you have addressed all of your direct dependencies, you must also review your transitive dependencies. ### Fixing Direct Dependencies – csproj/VS2017 Open your `projectname.csproj` file in your editor, or right click the project in Visual Studio 2017 and choose `Edit projectname.csproj` from the content menu, where projectname is the name of your project. Look for `PackageReference` nodes. The following shows an example project file: ``` XML <Project Sdk=""Microsoft.NET.Sdk.Web""> <PropertyGroup> <TargetFramework>netcoreapp1.1</TargetFramework> </PropertyGroup> <PropertyGroup> <PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback> </PropertyGroup> <ItemGroup> <PackageReference Include=""System.ServiceModel.Security"" Version=""4.3.0"" /> </ItemGroup> <ItemGroup> <DotNetCliToolReference Include=""Microsoft.VisualStudio.Web.CodeGeneration.Tools"" Version=""1.0.0 "" /> </ItemGroup> </Project> ``` The example has a single direct dependency, as seen by the `PackageReference` element. The name of the package is in the Include attribute, and the package version number is in the Version attribute that is exposed to the right of the package name. The example shows a single package `System.ServiceModel.Security` version 4.3.0. Review your `PackageReference` elements for any instance of the packages and versions listed above. In the example above, there is a direct dependency on the vulnerable package, `System.ServiceModel.Security` version 4.3.0. To update to the fixed package, change the version number to the appropriate package for your release. In the example, this would be updating `System.ServiceModel.Security` to 4.3.1. After updating the vulnerable package version, save your `csproj` file. The example `csproj` would now look as follows: ``` XML <Project Sdk=""Microsoft.NET.Sdk.Web""> <PropertyGroup> <TargetFramework>netcoreapp1.1</TargetFramework> </PropertyGroup> <PropertyGroup> <PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback> </PropertyGroup> <ItemGroup> <PackageReference Include=""System.ServiceModel.Security"" Version=""4.3.1"" /> </ItemGroup> <ItemGroup> <DotNetCliToolReference Include=""Microsoft.VisualStudio.Web.CodeGeneration.Tools"" Version=""1.0.0 "" /> </ItemGroup> </Project> ``` If you are using Visual Studio and save your updated `csproj` file, Visual Studio will restore the new package version. You can see the restore results by opening the Output Window (Ctrl+Alt+O) and changing the Show output from drop-down list to Package Manager. If you are not using Visual Studio open a command line and change to your project directory. Execute the `dotnet restore` command to restore your new dependency. ### After updating your direct dependencies Recompile your application. If after recompilation you see a Dependency conflict warning, you must update your other direct dependencies to the appropriate version. To fix this, edit the version for the expected package to be the version expected by updating your `csproj` or `project.json` in the same way that you used to update the vulnerable package versions. After you have addressed all of your direct dependencies, you must also review your transitive dependencies. ### Reviewing Transitive Dependencies There are two ways to view transitive dependencies. You can either use Visual Studio’s Solution Explorer, or you can review your `project.lock.json` (project.json/VS2015) or `project.assets.json` (csproj/VS2017) file. #### Using Visual Studio Solution Explorer (VS2015) If you want to use Visual Studio 2015, open your project in Visual Studio 2015 and then press Ctrl+; to activate the search in Solution Explorer. Search for each of the vulnerable package names and make a note of the version numbers of any results you find. For example, searching for `Microsoft.AspNetCore.Mvc.Core` in an example project that contains a reference to `Microsoft.AspNetCore.Mvc` shows the following results in Visual Studio 2015.  The search results appear as a tree. In these results, you can see we have found references to `Microsoft.AspNetCore.Mvc`, version 1.0.1, ` vulnerable version. The first entry under the References heading refers to the target framework your application is using. This will be `.NETCoreApp`, `.NETStandard` or `.NET-Framework-vX.Y.Z` (where X.Y.Z is an actual version number) depending on how you configured your application. Under your target framework will be the list of packages you have directly taken a dependency on. In this example, the application takes a dependency on `Microsoft.AspNetCore.Mvc`. `Microsoft.AspNetCore.Mvc` in turn has leaf nodes that list its dependencies and their versions. In this case the `Microsoft.AspNetCore.Mvc` package takes a dependency on a vulnerable version of `Microsoft.AspNetCore.Mvc.Core` and numerous other packages. #### Manually reviewing project.lock.json (project.json/VS2015) Open the `project.lock.json` file in your editor. We suggest you use an editor that understands json and allows you to collapse and expand nodes to review this file; both Visual Studio and Visual Studio Code provide this functionality. If you are using Visual Studio the `project.lock.json` file is “under” the `project.json` file. Click the right pointing triangle, ▷, to the left of the `project.json` file to expand the solution tree to expose the `project.lock.json` file. The following image shows a project with the `project.json` file expanded to show the `project.lock.json` file.  Search the `project.lock.json` file for the vulnerable packages, using the format `packagename/`, using each of the package names from the table above. If you find any vulnerable assembly name in your search examine the line on which they are found, the version number is after the `/` and compare to the vulnerable versions table above. For example a search result that shows `Microsoft.AspNetCore.Mvc.Cors/1.0.1` is a reference to v1.0.1 of `Microsoft.AspNetCore.Mvc.Cors`. If your `project.lock.json` file includes references to any of the package versions shown above then you will need to fix the transitive dependencies. #### Fixing transitive dependencies (project.json/VS2015) If you have not found any reference to any of the vulnerable package versions listed above this means none of your direct dependencies depend on any vulnerable packages or you have already fixed the problem by updating the direct dependencies. If your transitive dependency review found references to any of the vulnerable packages you must add a direct dependency to the updated package to your `project.json` file to override the transitive dependency. Open your `project.json` and find the dependencies section. For example: ``` json ""dependencies"": { ""Microsoft.NETCore.App"": { ""version"": ""1.0.1"", ""type"": ""platform"" }, ""Microsoft.AspNetCore.Server.Kestrel"": ""1.1.0"", ""Microsoft.AspNetCore.Mvc"": ""1.0.0"" } ``` For each of the vulnerable packages your search returned you must add a direct dependency to the updated version by adding it to the `project.json` file. You do this by adding a new line to the dependencies section, referring the fixed version. For example, if your search showed a transitive reference to the vulnerable `System.ServiceModel.Security` version 4.0.1 you would add a reference to the appropriate fixed version, 4.0.2. Edit the `project.json` file as follows: ``` json ""dependencies"": { ""Microsoft.NETCore.App"": { ""version"": ""1.0.1"", ""type"": ""platform"" }, ""System.ServiceModel.Security"": ""4.0.2"", ""Microsoft.AspNetCore.Server.Kestrel"": ""1.1.0"", ""Microsoft.AspNetCore.Mvc"": ""1.0.0"" } ``` After you have added direct dependencies to the fixed packages, save your `project.json` file. If you are using Visual Studio save your updated `project.json` file and Visual Studio will restore the new package versions. You can see the restore results by opening the Output Window (Ctrl+Alt+O) and changing the Show output from drop-down list to Package Manager. If you are not using Visual Studio open a command line and change to your project directory. Execute the `dotnet restore` command to restore your new dependencies. #### Using Visual Studio Solution Explorer (VS2017) If you want to use Solution Explorer, open your project in Visual Studio 2017, and then press Ctrl+; to activate the search in Solution Explorer. Search for each of the vulnerable package names and make a note of the version numbers of any results you find. For example, searching for `Microsoft.AspNetCore.Mvc.Core` in an example project that contains a package that takes a dependency on `Microsoft.AspNetCore.Mvc` shows the following results in Visual Studio 2017.  The search results appear as a tree. In these results, you can see we have found references to `Microsoft.AspNetCore.Mvc.Core` version 1.1.2. Under the Dependencies node will be a NuGet node. Under the NuGet node will be the list of packages you have directly taken a dependency on and their versions. In this example, the application takes a direct dependency on `Microsoft.AspNetCore.Mvc`. `Microsoft.AspNetCore.Mvc` in turn has leaf nodes that list its dependencies and their versions. In the example the `Microsoft.AspNetCore.Mvc` package takes a dependency on a version of `Microsoft.AspNetCore.Mvc.ApiExplorer` which in turn takes a dependency on a vulnerable version of `Microsoft.AspNetCore.Mvc.Core`. #### Manually reviewing project.assets.json (VS2017) Open the `project.assets.json` file from your project’s obj directory in your editor. We suggest you use an editor that understands json and allows you to collapse and expand nodes to review this file; both Visual Studio and Visual Studio Code provide this functionality. Search the `project.assets.json` file for each of the vulnerable packages, using the format `packagename/` using the package name from the table above. If you find the assembly name in your search examine the line on which they are found, the version number is after the `/` and compare to the vulnerable versions table above. For example a search result that shows `Microsoft.AspNetCore.Mvc.Cors/1.1.0` is a reference to v1.1.0 of `Microsoft.AspNetCore.Mvc.Cors`. If your `project.assets.json` file includes references to any of the vulnerable packages shown above then you will need to fix the transitive dependencies. If you have not found any reference to any vulnerable packages this means none of your direct dependencies depend on any vulnerable packages or you have already fixed the problem by updating the direct dependencies. If your transitive dependency review found references to any of the vulnerable packages you must add a direct dependency to the updated package to your `csproj` file to override the transitive dependency. Open your `projectname.csproj` file in your editor, or right click on the project in Visual Studio 2017 and choose Edit `projectname.csproj` from the content menu, where `projectname` is the name of your project. Look for `PackageReference` nodes, for example: ``` xml <Project Sdk=""Microsoft.NET.Sdk.Web""> <PropertyGroup> <TargetFramework>netcoreapp1.1</TargetFramework> </PropertyGroup> <PropertyGroup> <PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback> </PropertyGroup> <ItemGroup> <PackageReference Include=""Microsoft.AspNetCore"" Version=""1.1.1"" /> <PackageReference Include=""Microsoft.AspNetCore.Mvc"" Version=""1.1.3"" /> </ItemGroup> <ItemGroup> <DotNetCliToolReference Include=""Microsoft.VisualStudio.Web.CodeGeneration.Tools"" Version=""1.0.0"" /> </ItemGroup> </Project> ``` For each of the vulnerable packages your search returned you must add a direct dependency to the updated version by adding it to the `csproj` file. You do this by adding a new line to the dependencies section, referring the fixed version. For example, if your search showed a transitive reference to the vulnerable `System.ServiceModel.Security`, version 4.3.0 you would add a reference to the appropriate fixed version,. ``` xml <Project Sdk=""Microsoft.NET.Sdk.Web""> <PropertyGroup> <TargetFramework>netcoreapp1.1</TargetFramework> </PropertyGroup> <PropertyGroup> <PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback> </PropertyGroup> <ItemGroup> <PackageReference Include=""System.ServiceModel.Security"" Version=""4.3.1`"" /> <PackageReference Include=""Microsoft.AspNetCore"" Version=""1.1.1"" /> <PackageReference Include=""Microsoft.AspNetCore.Mvc"" Version=""1.1.3"" /> </ItemGroup> <ItemGroup> <DotNetCliToolReference Include=""Microsoft.VisualStudio.Web.CodeGeneration.Tools"" Version=""1.0.0"" /> </ItemGroup> ``` After you have added the direct dependency reference, save your `csproj` file. If you are using Visual Studio, save your updated `csproj` file and Visual Studio will restore the new package versions. You can see the restore results by opening the Output Window (Ctrl+Alt+O) and changing the Show output from drop-down list to Package Manager. If you are not using Visual Studio, open a command line and change to your project directory. Execute the `dotnet restore` command to restore your new dependencies. ### Rebuilding your application Finally rebuild your application, test as you would do normally and redeploy using your favored deployment mechanism. ### How do I fix my .NET native application? .NET native requires that applications be re-processed by the .NET native compiler to incorporate the fixes and the re-processed version needs to be distributed via the Windows Store. We recommend that you update your .NET UWP apps to use the latest minor version of the `Microsoft.NETCore.UniversalWindowsPlatform` NuGet package so that you can build and verify that your app works as expected when updated. If you are using version 6.0.x, you should update to 6.0.6 and if you’re using 5.2.x, you can update to 5.2.4. Of course, you can update to a higher major version too, but we are distributing security updates for all impacted major versions (currently 5.2.x, 5.3.x, 5.4.x and 6.0.x). Additionally, whether or not you update your NuGet packages, all applications submitted to the store after today will be automatically fixed during submission processing. If you do not update your app in the Store, it will automatically be reprocessed and distributed via an application update in the next few weeks. Users who have automatic app updates enabled will get the fix with no intervention on your or their parts. Because updated apps are distributed through the Windows Store, sideloaded apps will not be automatically updated. We recommend that developers who distribute sideloaded apps update the affected NuGet packages, rebuild their applications and distribute them to their users. Microsoft is committed to keeping UWP applications secure and to supporting developers. If you have feedback on the fix distribution process, please let us know at dotnetnative@microsoft.com. ## Other Information ### Reporting Security Issues If you have found a potential security issue in .NET Core, please email details to secure@microsoft.com. Reports may qualify for the .NET Core Bug Bounty. Details of the .NET Core Bug Bounty including Terms and Conditions are at [https://aka.ms/corebounty](https://aka.ms/corebounty). ### Support You can ask questions about this issue on GitHub in the .NET Core or ASP.NET Core organizations. These are located at https://github.com/dotnet/ and https://github.com/aspnet/. The Announcements repo for each product (https://github.com/dotnet/Announcements and https://github.com/aspnet/Announcements) will contain this bulletin as an issue and will include a link to a discussion issue where you can ask questions. ### What if the update breaks my application? An application can be pinned to a previous version of the runtime by editing the [application.runtime.config](https://github.com/dotnet/cli/blob/ede74b6be1406ba0c086b6d5fc1a5d4eacff1f01/Documentation/specs/runtime-configuration-file.md#appnameruntimeconfigjson) file for that application and editing the framework version and setting `rollForward` to `false`. This should be treated as a temporary measure and the application updated to work with the patched versions of the framework. Note that this file is optional, you may need to create it for each application alongside the executable. ### External Links [CVE-2018-0786](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-0786) ### Revisions V2.0 (Jan 29, 2018): Advisory updated with correct package versions and update instructions. V1.0 (Jan 9, 2018): Advisory published. _Version 2.0_ _Last Updated 2018-01-29_" 26237 area-System.Xml [Discussion] Microsoft Security Advisory CVE-2018-0764: Denial of Service when parsing XML documents # Microsoft Security Advisory CVE-2018-0764 ## Denial of Service when parsing XML documents ### Executive Summary Microsoft is releasing this security advisory to provide information about a vulnerability in the public versions of .NET Core 1.0 and 1.1, and 2.0. This advisory also provides guidance on what developers can do to update their applications correctly. Microsoft is aware of a Denial of Service vulnerability in all public versions of .NET core due to improper processing of XML documents. An attacker who successfully exploited this vulnerability could cause a denial of service against a .NET application. A remote unauthenticated attacker could exploit this vulnerability by issuing specially crafted requests to a .NET Core application. The update addresses the vulnerability by correcting how .NET core handles XML document processing. System administrators are advised to update their .NET Core runtimes to versions 1.0.9, 1.1.6 and 2.0.5. Developers are advised to update their .NET Core SDK to version 2.1.4 or 1.1.7. These runtime and SDK versions will also address [CVE-2018-0786](https://github.com/dotnet/announcements/issues/51). ### Announcement The original announcement can be found at dotnet/announcements#52 ## Affected Software The vulnerability affects any Microsoft .NET Core project if it uses any of affected runtime versions listed below Runtime Version | Fixed runtime version ----------------| ------------------------- 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.7, 1.0.8 | 1.0.9 1.1.0, 1.1.1, 1.1.2, 1.1.4, 1.1.5 | 1.1.6 2.0.0, 2.0.3, 2.0.4 | 2.0.5 ### Advisory FAQ #### How do I know if I am affected? To check the runtimes installed on a computer you must view the contents of the runtime folder. By default these are | Operating System | Location | |---------------------------|-------------------| | Windows | C:\Program Files\dotnet\shared\Microsoft.NETCore.App\ | | macOS | /usr/local/share/dotnet/shared/Microsoft.NETCore.App/ | | Supported Linux platforms | /usr/share/dotnet/shared/Microsoft.NETCore.App/ | Each runtime version is installed in its own directory, where the directory name is the version number. If you do not have a directory for 1.0.9, 1.1.6 or 2.0.2 then any applications targeting .NET Core will be vulnerable. Downloads for all supported platforms can be acquired from https://www.microsoft.com/net/download/ #### How do I fix my affected application? Applications can be fixed by installing the latest runtimes or SDKs. Typically application servers only install a runtime package, developer machines install SDKs. Installers can be downloaded from the [Runtime and SDK download archive](https://github.com/dotnet/core/blob/master/release-notes/download-archive.md). Runtime version 1.1.6 will also install runtime version 1.0.9. If you have built a [self-contained application](https://docs.microsoft.com/en-us/dotnet/core/deploying/#self-contained-deployments-scd) you must install the new runtime and SDK, recompile your application and redeploy. ## Other Information ### Reporting Security Issues If you have found a potential security issue in .NET Core, please email details to secure@microsoft.com. Reports may qualify for the .NET Core Bug Bounty. Details of the .NET Core Bug Bounty including Terms and Conditions are at [https://aka.ms/corebounty](https://aka.ms/corebounty). ### Support You can ask questions about this issue on GitHub in the .NET Core or ASP.NET Core organizations. These are located at https://github.com/dotnet/ and https://github.com/aspnet/. The Announcements repo for each product (https://github.com/dotnet/Announcements and https://github.com/aspnet/Announcements) will contain this bulletin as an issue and will include a link to a discussion issue where you can ask questions. ### What if the update breaks my application? An application can be pinned to a previous version of the runtime by editing the [application.runtime.config](https://github.com/dotnet/cli/blob/ede74b6be1406ba0c086b6d5fc1a5d4eacff1f01/Documentation/specs/runtime-configuration-file.md#appnameruntimeconfigjson) file for that application and editing the framework version and setting `rollForward` to `false`. This should be treated as a temporary measure and the application updated to work with the patched versions of the framework. Note that this file is optional, you may need to create it for each application alongside the executable. ### External Links [CVE-2018-0764](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-0764) ### Revisions V1.0 (Jan 9, 2018): Advisory published. _Version 1.0_ _Last Updated 2018-01-09_ 26238 area-Microsoft.CSharp Dynamic binders fails to properly assign values to by-ref properties or indexers @VladimirReshetnikov commented on [Tue Mar 14 2017](https://github.com/dotnet/roslyn/issues/17858) **Version Used**: Microsoft Visual Studio Community 2017 Version 15.0.26228.4 D15RTWSVC Microsoft .NET Framework Version 4.6.01586 **Steps to Reproduce**: Compile and run: ``` class C { static void Main() { var c = new C(); dynamic index = 1; c[index] = 1; } private static int x; public ref int this[int index] => ref x; } ``` **Expected Behavior**: Indexer assignment is performed successfully. If it is not feasible for some reason, then the compiler should give a compile-time error in cases like this, rather than allowing program to fail at runtime. **Actual Behavior**: ``` Unhandled Exception: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Property or indexer 'C.this[int]' cannot be assigned to -- it is read only at CallSite.Target(Closure , CallSite , C , Object , Int32 ) at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at C.Main() ``` --- @gafter commented on [Tue Mar 14 2017](https://github.com/dotnet/roslyn/issues/17858#issuecomment-286612566) @VSadov What is the appropriate repo for filing bugs against the dynamic runtime? --- @VSadov commented on [Wed Mar 15 2017](https://github.com/dotnet/roslyn/issues/17858#issuecomment-286797927) C# Binder lives in CoreFX. However, this repro should probably be a compile error - we statically know it in not going to work. --- @jcouv commented on [Wed Dec 27 2017](https://github.com/dotnet/roslyn/issues/17858#issuecomment-354157315) @VSadov Can you triage relative to your other assigned issues? --- @VSadov commented on [Thu Jan 04 2018](https://github.com/dotnet/roslyn/issues/17858#issuecomment-355445446) After thinking about this, it might be possible to fix the binder/expressions to understand such assignments. Ref assignments are tricky and will require special APIs, but **regular** assignments are just assignments and should be completely representable in existing trees. Most likely it only needs that factories allow ref members as assignment targets, and make ET compiler do indirect assignments. --- @VSadov commented on [Mon Jan 08 2018](https://github.com/dotnet/roslyn/issues/17858#issuecomment-356186876) We should fix this in the dynamic binder. This should be moved to CoreFx 26239 area-System.Collections Adding TrimExcess API to Dictionary and providing tests Issue is: #24445 Implementation changes are made in a coreclr PR separately here dotnet/coreclr#15793. For this PR, please only review [commit 33cb937](https://github.com/dotnet/corefx/pull/26239/commits/33cb9371790213056316413713a25f07663d1bc2) the other commits belong to PR #26158 and have already been reviewed. those commits should disappear from this PR once PR #26158 gets merged. cc: @danmosemsft @benaadams TODO Next in a separate PR: - Will add EnsureCapacity to SortedSet - Will add TrimExcess to SortedSet 26242 area-System.IO Add support for decompresing data in ReadOnlySpan<byte> with Deflate algorithm `System.IO.Compression` contains the `DeflateStream` class, that can decompress data from a stream. In case we have compressed data already loaded in a `ReadOnlySpan<byte>`, using `DeflateStream` might be little inefficient - we have to create a `MemoryStream` and this operation allocates a new array. function Decompress(ReadOnlySpan<byte> block) { using(var stream = new MemoryStream(block.ToArray())) { using(var deflateStream = new DeflateStream(stream, CompressionMode.Decompress)) { Data = ... read from deflateStream } } } It would be great, if the Deflate algorithm is exposed in the way that supports processing data from `ReadOnlySpan<byte>` 26243 area-System.Reflection Add support for Arm64 PE files to System.Reflection.Metadata - PE header DWORD is 0xAA64 - Arm64 PE files are 64 bit PE 26244 area-System.Data Performance issue fix for manged sni This is a fix for the issue: #24480 -- .NET Core performance issue on Linux. This fix was merged to master branch: https://github.com/dotnet/corefx/pull/25621 26246 area-System.Runtime AssemblyLoadContext.Default.Unloading not triggered when using Windows Containers "@benjaminpetit commented on [Thu Jan 04 2018](https://github.com/dotnet/dotnet-docker/issues/354) In order to shutdown properly, our app needs to be notified. Using the Linux container we rely on `AssemblyLoadContext.Default.Unloading`, and works fine. But it seems that this event is not triggered and our app is killed almost instantaneously. Program.cs ``` csharp using System; using System.Runtime.Loader; using System.Threading; namespace ConsoleApp2 { class Program { private static ManualResetEvent resetEvent = new ManualResetEvent(false); static void Main(string[] args) { Console.WriteLine(""Hello world""); AssemblyLoadContext.Default.Unloading += context => { Console.WriteLine(""AssemblyLoadContext.Default.Unloading fired""); resetEvent.Set(); }; resetEvent.WaitOne(); Console.WriteLine(""Goodbye""); } } } ``` Dockerfile: ``` Dockerfile FROM microsoft/dotnet:runtime WORKDIR /app COPY publish/* ./ ENTRYPOINT [""dotnet"", ""ConsoleApp2.dll""] ``` ## Steps to reproduce the issue 1. Start the container 2. Stop it with `docker stop xxx` ## Expected behavior `AssemblyLoadContext.Default.Unloading` should be called before stopping. ## Actual behavior `AssemblyLoadContext.Default.Unloading` is not be called ## Additional information (e.g. issue happens only occasionally) Works fine using Linux containers ## Output of `docker version` ``` Client: Version: 17.09.0-ce API version: 1.32 Go version: go1.8.3 Git commit: afdb6d4 Built: Tue Sep 26 22:40:09 2017 OS/Arch: windows/amd64 Server: Version: 17.09.0-ce API version: 1.32 (minimum version 1.24) Go version: go1.8.3 Git commit: afdb6d4 Built: Tue Sep 26 22:50:27 2017 OS/Arch: windows/amd64 Experimental: true ``` ## Output of `docker info` ``` Containers: 35 Running: 0 Paused: 0 Stopped: 35 Images: 123 Server Version: 17.09.0-ce Storage Driver: windowsfilter Windows: Logging Driver: json-file Plugins: Volume: local Network: ics l2bridge l2tunnel nat null overlay transparent Log: awslogs etwlogs fluentd json-file logentries splunk syslog Swarm: inactive Default Isolation: hyperv Kernel Version: 10.0 16299 (16299.15.amd64fre.rs3_release.170928-1534) Operating System: Windows 10 Enterprise OSType: windows Architecture: x86_64 CPUs: 12 Total Memory: 63.91GiB Name: bpetit-devbox ID: JTJR:4R47:HTCC:RW4Y:PBS5:HYLT:DDBT:7IDJ:6CIN:7LZB:MMRK:HZPH Docker Root Dir: C:\ProgramData\Docker Debug Mode (client): false Debug Mode (server): true File Descriptors: -1 Goroutines: 31 System Time: 2018-01-04T16:06:40.9929602-08:00 EventsListeners: 0 Registry: https://index.docker.io/v1/ Experimental: true Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false ``` " 26247 area-System.Data Fix for SqlConnection failure when having multiple concurrent users This is a fix for issue https://github.com/dotnet/corefx/issues/25620 In .NET Core 2.0, SqlConnection failed on not many multiple concurrent users during ASP.NET web application load testing. 26248 area-System.Net NetworkInterface.Description is not useful on Linux "I see that, in #8297, the decision was been made for this property to just return the name of the interface, on Linux. E.g. ""eth0"", whereas on Windows it returns a useful description of the make and model of the interface card. It was also mentioned in that same issue, that the description could be improved in the future. Is there any possibility now of improving it to make it work more like the Windows version? I'm writing a data transfer tool, which logs information about the environment it runs in. A meaningful description of the network adapter would be very useful. Or, if there's no possibility of improving it, could the [documentation](https://docs.microsoft.com/en-us/dotnet/api/system.net.networkinformation.networkinterface.description?view=netframework-4.7.1#System_Net_NetworkInformation_NetworkInterface_Description) please be changed to reflect the different behavior on Linux? Right now the documentation says ""human-readable text that typically describes the interface vendor, type (for example, Ethernet), brand, and model"", which is definitely not the case on Linux at present. " 26250 area-System.Net Add System.Net.WebSocket.Protocol netstandard package. fixes #21537 cc @karelz @stephentoub @wfurt cc @weshaggard @ericstj Can you please take a look at the packaging changes for oob assembly.. Short summary: -------------------- Split the ```ManagedWebSocket``` class into 3 files: ```ManagedWebSocket.netstandard.cs``` and ```ManagedWebSocket.netcoreapp.cs```. I tried to put the common code in ```ManagedWebSocket.Common.cs```. Refactoring out common parts seemed like a backward effort, where all the Span/Memory enhancements may have to be abandoned. So I prioritized enhancements over common code, where the change was tricky to make. Needless to say, the ```*.netcoreapp.cs``` file contains Span/Memory stuff, and the ```*.netstandard.cs``` contains ArraySegment/byte[] stuff. Testing: ----------------- I was not able to get a successful test with ```WebSocket.ReceiveAsync```, it fails in ReceiveAsync, because the response from the server is not in the right format. So the code fails with ```ProtocolError``` in ```ReceiveAsync```. The behavior is same with and without this refactoring. Hence didn't include ```ReceiveAsync``` in the ```WebSocketProtocol_CreateFromConnectedStream_Succeeds``` outerloop test. 26251 area-System.Runtime SIMD Numeric Arrays Operations I suggest to add some SIMD operations to Array class, such as: ``` int[] a = {1, 2, 3, 4, 5, 6, 7, 8}; int[] b = {1, 2, 3, 4, 5, 6, 7, 8}; var c = a + b ; ``` C# should contain {2, 4, 6, 8, 10, 12, 14, 16} If a and b have different lengths, C# can raise exception, or conceder missed elements in the shortest array to be zeroes. If we want to do so, we can use Vector4 to calculate the result: var Result1 = new Vector4(1, 2, 3, 4) + new Vector4(1, 2, 3, 4); var Result2 = new Vector4(5, 6, 7, 8) + new Vector4(5, 6, 7, 8); Then add the elements from the two results to the array. This will be verbose and ugly long code to write! It's better to write this in a low level SIMD directly without the need for Vector4. Likewise, you can provide these operations for numeric arrays: ``` c = a - b ; c = a * b ; c = a / b ; ``` Also, b can a scalar value that operates on all array elements: ``` c = a + 1 ; c = a - 1 ; c = a * 2 ; c = a / 3 ; ``` Maybe it's better to add a class Named Simd to the System.Numerics namespace, that performs these operations on numeric arrays. ``` c = Simd.Add (a, b) c = Simd.Add (a, 1) ``` The same for Simd.Subtract , Simd.Multiply, Simd.Divide, Simd.Pow, Simd.Aggregate, etc. Add as many common array tasks as you can, that can be use the SIMD feature. Edit: Is there a plan to use Span< T > with Vectors? It can be faster than copying array elements to the Vector. Also, the static Vector calss can use it to do operations on two arrays in slices. Ecah method in the Vector class can have another overload with two T[] params instead of Vector< T > param and returns T[] or Memory< T >. If Vector< T > can make use of Span slices (by adding a new constuctor that accepts Span< T >), it will be easy and fast to repeat the same operations on the array slices. 26252 area-System.Data Add SqlCommand Begin and EndExecuteXmlReader functions This PR follows a request in #17126 to finish exposing the BeginExecuteXmlReader and EndExecuteXmlReader functionality. These functions have been made public, and an overload has been added for BeginExecuteXmlReader. Tests for these changes have been added based off of the similar PR #26016 as recommended in the original issue. 26254 area-Infrastructure Not getting dumplings for F5 run crashes eg this is an AV, which cannot be diagnosed without a dump. https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fuwp~2F/build/20180110.02/workItem/System.Diagnostics.Process.Tests/wilogs ``` 2018-01-10 05:40:43,410: INFO: proc(54): run_and_log_output: Output: ================================================================================== 2018-01-10 05:40:43,410: INFO: proc(54): run_and_log_output: Output: Removing the application... 2018-01-10 05:40:45,144: INFO: proc(54): run_and_log_output: Output: 2018-01-10 05:40:45,144: INFO: proc(54): run_and_log_output: Output: SUCCESS 2018-01-10 05:40:45,144: INFO: proc(54): run_and_log_output: Output: ExitCode -1073741819 2018-01-10 05:40:45,160: INFO: proc(54): run_and_log_output: Output: 2018-01-10 05:40:45,160: INFO: proc(54): run_and_log_output: Output: C:\dotnetbuild\work\c073e107-458e-4bfb-8b32-780cbf2848b6\Work\3b795126-790c-4dce-8391-c44ea2a8c54a\Unzip>move C:\Users\DotNetTestRunner\Documents\TestResults\System.Diagnostics.Process.Tests.dll.xml .\testResults.xml 2018-01-10 05:40:45,160: INFO: proc(54): run_and_log_output: Output: The system cannot find the file specified. 2018-01-10 05:40:45,160: INFO: proc(54): run_and_log_output: Output: Finished running tests. End time= 5:40:45.16, Exit code = 1 2018-01-10 05:40:45,160: INFO: proc(58): run_and_log_output: Exit Code: 1 2018-01-10 05:40:45,176: ERROR: scriptrunner(91): _main: Error: No exception thrown, but XUnit results not created ``` 26256 area-System.Memory Some System.Memory tests need disabling for UAPAOT Seems to be related to overlap. https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Filc~2F/build/20180110.02/workItem/System.Memory.Tests eg ``` System.PlatformNotSupportedException : Operation is not supported on this platform. Stack Trace : at System.SpanTests.ReadOnlySpanTests.Overlap(Int32 x1, Int32 y1, Int32 x2, Int32 y2, Boolean expected) in E:\A\_work\815\s\corefx\src\System.Memory\tests\ReadOnlySpan\Overlaps.cs:line 989 ``` @ahsonkhan 26257 area-System.Runtime GetEnumerator() Fails on Some Interop w/netcoreapp2.0 Hey-- I'm working on porting a tool that interacts with the DIA SDK to the netcoreapp2.0 framework (https://github.com/Microsoft/binskim), and ran into an interesting exception/problem. IDiaEnumTables's System._ComObject representation exposes a GetEnumerator() function, which I assume probably winds up wrapping HRESULT get__NewEnum() (https://docs.microsoft.com/en-us/visualstudio/debugger/debug-interface-access/idiaenumtables-get-newenum) internally. However, calling that function in a netcoreapp2.0 version of our tool throws an exception about missing the CustomMarshallers library: ``` System.IO.FileNotFoundException occurred HResult=0x80070002 Message=Could not load file or assembly 'CustomMarshalers, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. Source=<Cannot evaluate the exception source> StackTrace: at System.StubHelpers.StubHelpers.CreateCustomMarshalerHelper(IntPtr pMD, Int32 paramToken, IntPtr hndManagedType) at Dia2Lib.IDiaEnumTables.GetEnumerator() at Microsoft.CodeAnalysis.BinaryParsers.ProgramDatabase.Pdb.CreateDiaTable[T]() in ...\binskim\src\BinaryParsers\ProgramDatabase\Pdb.cs:line 234 ``` This works if the main executable is using .NET 4.6.1--however I'm not able to find any documentation on how the interop services handle creating enumerators that suggests this isn't supported in netcoreapp2.0. ---- This appears to be happening for a number of other DIA SDK enumeration objects. Other functionality on the objects (e.x. .Count, .Item(index), etc.) all seem to work as expected--it's just the GetEnumerator() function that isn't working. Let me know if you need anything else--I can see about creating a minimal test case or similar if it's necessary/helpful. Thanks, Everett Maus [edited by @danmosemsft for formatting] 26258 area-System.Runtime System.Runtime.Caching.Tests.TimedExpirationAsync test failed in PR ``` Unhandled Exception of Type Xunit.Sdk.NotNullException Message : Assert.NotNull() Failure Stack Trace : at MonoTests.System.Runtime.Caching.MemoryCacheTestExpires11.<TimedExpirationAsync>d__0.MoveNext() in D:\j\workspace\windows-TGrou---db113413\src\System.Runtime.Caching\tests\System.Runtime.Caching\MemoryCacheTest.cs:line 1170 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ``` 26259 area-System.Net Fix System.Net.NetworkInformation.NetworkChange deadlock User code can subscribe to the NetworkAvailabilityChanged event. If a Network Address changed event get triggered while the user code is unsubscribing from the NetworkAvailabilityChanged event, there will be a deadlock. The deadlock can happen because two threads are holding two different locks for AddressChangeListener and AvailabilityChangeListener, and they are waiting for each other to release its lock first. The fix is using a global lock to replace two locks, so that we don’t allow operations on AddressChangeListener and AvailabilityChangeListener happen at the same time. Without fixing this, users can frequently see the deadlock when they put their computer to sleep, re-awaken it, then call the code that unsubscribes from NetworkAvailabilityChanged event. This deadlock is only specific to Windows implementation. For Unix implementations (Linux & OSX), their current implementation is to use a global lock object to protect both NetworkAddressChangedEventHandler & NetworkAvailabilityChangedEventHandler. This issue was reported in internal bug 162830. 26261 area-System.Runtime Assert type load behavior changes between Core and Desktop with serialization attributes Relates to https://github.com/dotnet/standard/issues/300 Had to add another project which only builds against netstandard as we are building S.R.Serialization.Formatters.Tests also against netfx to work around this bug. This is only a temporary test case and should be changed after we build against net472 which probably includes the serialization fix (see comments in code). cc @MichalStrehovsky 26263 area-System.Runtime ValueTuple's xml file is not valid xml Version Used: ValueTuple version 4.4.0 Steps to Reproduce: Have any project with target framework 4.6.2 at the most. Install the ValueTuple nuget package into the project. Build the project and find System.ValueTuple.xml near the output file. Open System.ValueTuple.xml with any XML viewer (i.e. Chrome). Expected Behavior: System.ValueTuple.xml should open normally. Actual Behavior: Opening the file fails with the following error: error on line 1241 at column 95: Opening and ending tag mismatch: p line 0 and th 26265 area-System.Memory System.Memory.Performance.Tests cause fireball in outerloop PR runs https://mc.dot.net/#/user/Priya91/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/59424952ec2d8fc2beebdd9fd460803259f5c9dd/workItem/System.Memory.Performance.Tests 26266 area-System.Numerics Move S.N.Vector APIs to corelib and expose them from System.Runtime Depends on https://github.com/dotnet/coreclr/pull/15821 going through first. Setting up the ground work for: https://github.com/dotnet/corefx/issues/25182#issuecomment-343614677 cc @jkotas, @KrzysztofCwalina, @safern, @ViktorHofer, @eerhardt 26267 area-Meta "EF ""_Result"" post-fiz anti pattern" "Hi! Sorry for the bother, but in the file: referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityModelSchemaGenerator.cs there is this line: string name = CreateModelName(functionImportName + **""_Result""**, session.UsedGlobalModelTypeNames); Why is it hard-coded an anti pattern for a class name post-fix? Can´t this be a configurable property? Thanks for your attention." 26268 area-System.Diagnostics Start a process as a different user on Unix "**Background:** Starting processes as different users is one of the most fundamental needed to do several useful things - especially so for automation, script execution and privilege de-escalation in services and sandboxing. This is even more so true on Linux, where you can achieve a lot with just running commands as various users, and where the overall boot process follows the fork, impersonate and exec pattern. **How it works on Windows:** The System.Diagnostics.Process.StartInfo instance member of type System.Diagnostics.ProcessStartInfo takes a username, domain and password for the target process's credentials. The credentials are then used to impersonate as the user (Windows itself implements this through [credential providers](https://msdn.microsoft.com/en-us/library/windows/desktop/mt158211(v=vs.85).aspx)) and create a new process (Windows succeeds it after local authority checks) in that context. **Problems with current workaround in Linux:** We can currently workaround this by launching another broker process (with set-uid and set-gid bits set) as root and then let it impersonate and exec the target executable into itself. This requires extreme care to implement safely, especially when you want password less authentication because you are already root or satisfy other constraints (see man 2/3 set(e)uid/set(e)gid), and will potentially redo what the ""su"" command does. Using su itself comes with nuances on how to pass the password string and wait for the process status and defeats the purpose of the language (C#). Another way is to do a set(e)uid/set(e)gid before the fork() and exec() in Process.Start(). Doing this before the fork() comes with it's own nuances - you cannot use the libc call exposed by Mono.Unix directly (at least always) since it propagates it to all threads, potentially disrupting their I/O. You have to instead do a syscall() and undo it very reliably, and hope that threads don't switch in the meanwhile due to TPL, etc.. Overall there is no clean and reliable solution in Linux that's at par with Windows. **Proposal for Linux:** We need a similar mechanism in Linux, and it can work with the same API conventions as Windows for an explicit username-password based process invocation. However, the full credential specification (see man 7 [credential](https://linux.die.net/man/7/credentials)) of a Linux process has more/different identities than an NT process token. At the minimum, we need to support the groupname (gid) of the new process along with the username (uid). So we'll need a ProcessStartInfo.GroupName that defaults to the current group, a ProcessStartInfo.UserName that defaults to the current user. **Implementation outline in Linux:** The presence or default of ProcessStartInfo.Password affects the behaviour: If it is default (null), then we should try to invoke through a normal set(e)uid() + set(e)guid() and fail if we don't have permission appropriately. This works only for the superuser/same target credential as calling process. If it is present, then we should do an equivalent of Windows - authenticate with various PAM modules and then launch the process. The ""su"" program explicitly does this. The su process also takes care of various checks, order of impersonation, sanitizing the environment as per command line options, whether to invoke a new shell and create a terminal/logon session, etc.. See su.c and su-common.c in https://www.kernel.org/pub/linux/utils/util-linux/v2.31/ for source. Finally, we can either do a fork(), set(e)gid(), set(e)uid() and exec*() in the managed process for the no password case or have a dotnet in-box broker for PAM authentication. Related: https://github.com/dotnet/corefx/issues/3187" 26269 area-System.Net "HttpResponseHeaders.Contains(""Content-Range"") throws InvalidOperationException" "The [Content-Range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) HTTP header is classified as a response header and yet the type method `HttpResponseHeaders.Conatains(String name)` throws a `System.InvalidOperationException` when invoking with the string ""Content-Range'. Other header strings such as `""Accept-Ranges""` work as expected, so it only fails to recoginse `Content-Range` as a valid resopnse header. The exception message is: > System.InvalidOperationException : Misused header name. Make sure request headers are used with HttpRequestMessage, response headers with HttpResponseMessage, and content headers with HttpContent objects." 26270 area-System.Data Add delegate flag to fix permissions when querying linked SQL Servers Fixes permissions when querying linked SQL Servers, see https://github.com/dotnet/corefx/issues/21824. This sets the `Delegate` flag when requesting a kerberos ticket for querying using `SqlClient`, so SQL Server can forward queries to linked servers with the correct authentication information. 26271 area-System.Xml XmlWriter.WriteStartElement "_From @Looooooka on January 11, 2018 11:48_ Using writer.WriteStartElement(""prefix:elementname""); used to work. one didn't have to use the overload writer.WriteStartElement(""localname"", ""ns""); now it throws an exception. A bunch of plugins and libraries that could be ported simply by including the cs file are not incompatible because of this minor change. In my case xml plugins for log4net formatter I think simply using the same behavior as before could fix a lot of unnecessary rewrites. No need to be that strict with overloads _Copied from original issue: dotnet/coreclr#15826_" 26272 area-System.Runtime Static Simd Class to Apply SIMD operations on Arrays, Tuples, Points, Sizes And Rectangles Edit: Point, Size and Rectangle structures ar commenly used in image processing calculations, so it can be faster if SIMD operations aplied to them directly. This can be done by extention methods, or by implementing some interface, or as I suggested in #26251#26251, SIMD Numeric Arrays Operations , by using static methods of a SIMD Class, Where each method is overloaded to deal with numeric arrays, Point, Size and Rectangle structures. Tuples, Vectors, Points, Sizes And Rectangles are related. It will be conferrable to make converting between them easier, by adding suitable constructors, deconstructions, To[Type] methods, and implicit/explicit conversion operators to each type. - Vectors to Tuples, and suitable Tuples to corresponding Vectors. - Vector2 to PointF and SizeF and vise versa. Point and Size also can be converted to Vector2. - Vector4 to RectangleF and vise versa. Rectangle to Vector4. - Point, PointF, Size, SizeF, Rectangle and RectangleF to Tuples, and suitable Tuples to these types. Vectors should also have a literal notation. The ToString method give us the <1 , 2 , 3, 4> format. I think it is suitable to write: var v = <1, 2, 3, 4>; that means: var v = new Vector4(1, 2, 3, 4); 26273 area-System.Security System.Security.Cryptography.ProtectedData failed to protect empty data "```c# static void Main(string[] args) { byte[] data = new byte[0]; data = ProtectedData.Protect(data, optionalEntropy: null, scope: DataProtectionScope.CurrentUser); } ``` I use packate""System.Security.Cryptography.ProtectedData"" Version=""4.4.0"" This piece of code working fine with netframework, but throw exception with netcoreapp2.0 HResult in Exception is 87 message ""The parameter is incorrect"" [EDIT] Add C# syntax highlighting by @karelz" 26274 area-System.Memory Add XunitShowProgress to help debug the hang in S.M perf tests Cannot reproduce the performance test failures locally, and hence trying to run in CI with XunitShowProgress enabled to see where the hang is happening. https://github.com/dotnet/corefx/issues/26265#issuecomment-357021258 26275 area-Serialization Area-Serialization Sprint 130 The issue is for tracking issues to be done in sprint 130 (due by 2/2/2018) 26276 area-System.IO Port Google Brotli C sources 26277 area-Infrastructure Unable to build @weitzhandler commented on [Wed Jan 10 2018](https://github.com/dotnet/buildtools/issues/1858) Hi, I followed the instructions in [this](https://github.com/dotnet/corefx/wiki/Build-and-run-tests) article. After `sync`ing, running the `build` command fails with the following errors: ``` ... Microsoft.Private.CoreFx.NETCoreApp -> D:\Users\Shimmy\Source\Repos\corefx\bin/packages/Debug/specs/Microsoft.Private.CoreFx.NETCoreApp.nuspec Verifying closure of Microsoft.Private.CoreFx.NETCoreApp reference assemblies Verifying no duplicate types in Microsoft.Private.CoreFx.NETCoreApp reference assemblies D:\Users\Shimmy\Source\Repos\corefx\Tools\Packaging.targets(1068,5): error : Files D:\Users\Shimmy\Source\Repos\corefx\bin\AnyOS.AnyCPU.Debug\mscorlib\netcoreapp\mscorlib.dll and D:\Users\Shimmy\Source\Repo s\corefx\bin\obj\shims\netcoreapp\facades\mscorlib.dll have the same TargetPath runtime.win-x64.Microsoft.Private.CoreFx.NETCoreApp/runtimes/win-x64/lib/netcoreapp2.1/mscorlib.dll. [D:\Users\Shimmy\Source\R epos\corefx\pkg\Microsoft.Private.CoreFx.NETCoreApp\Microsoft.Private.CoreFx.NETCoreApp.pkgproj] D:\Users\Shimmy\Source\Repos\corefx\Tools\Packaging.targets(1068,5): error : Files D:\Users\Shimmy\Source\Repos\corefx\bin\obj\shims\netcoreapp\facades\System.dll and D:\Users\Shimmy\Source\Repos\corefx\bin \AnyOS.AnyCPU.Debug\System\netcoreapp\System.dll have the same TargetPath runtime.win-x64.Microsoft.Private.CoreFx.NETCoreApp/runtimes/win-x64/lib/netcoreapp2.1/System.dll. [D:\Users\Shimmy\Source\Repos\cor efx\pkg\Microsoft.Private.CoreFx.NETCoreApp\Microsoft.Private.CoreFx.NETCoreApp.pkgproj] Build FAILED. D:\Users\Shimmy\Source\Repos\corefx\Tools\Packaging.targets(1068,5): error : Files D:\Users\Shimmy\Source\Repos\corefx\bin\AnyOS.AnyCPU.Debug\mscorlib\netcoreapp\mscorlib.dll and D:\Users\Shimmy\Source\Repo s\corefx\bin\obj\shims\netcoreapp\facades\mscorlib.dll have the same TargetPath runtime.win-x64.Microsoft.Private.CoreFx.NETCoreApp/runtimes/win-x64/lib/netcoreapp2.1/mscorlib.dll. [D:\Users\Shimmy\Source\R epos\corefx\pkg\Microsoft.Private.CoreFx.NETCoreApp\Microsoft.Private.CoreFx.NETCoreApp.pkgproj] D:\Users\Shimmy\Source\Repos\corefx\Tools\Packaging.targets(1068,5): error : Files D:\Users\Shimmy\Source\Repos\corefx\bin\obj\shims\netcoreapp\facades\System.dll and D:\Users\Shimmy\Source\Repos\corefx\bin \AnyOS.AnyCPU.Debug\System\netcoreapp\System.dll have the same TargetPath runtime.win-x64.Microsoft.Private.CoreFx.NETCoreApp/runtimes/win-x64/lib/netcoreapp2.1/System.dll. [D:\Users\Shimmy\Source\Repos\cor efx\pkg\Microsoft.Private.CoreFx.NETCoreApp\Microsoft.Private.CoreFx.NETCoreApp.pkgproj] 0 Warning(s) 2 Error(s) Time Elapsed 00:01:11.43 Command execution failed with exit code 1. ``` [EDIT] Reformatted logs based on later reply by @karelz 26278 area-System.Net System.Net.Http.WinHttpResponseStream leading to crash in SafeWinHttpHandle.ReleaseHandle We are reporting daily crashes after moving our application from .Net 4.6 to .Net Core 2.0. When the crash occurs all 64 Cores are spiked at 100% CPU. Example Call Stack: #1: SafeWinHttpHandle.ReleaseHandle() ``` 00 coreclr!EEPolicy::HandleFatalError 01 coreclr!ProcessCLRException 02 ntdll!RtlpExecuteHandlerForException 03 ntdll!RtlDispatchException 04 ntdll!KiUserExceptionDispatch 05 crypt32!ReleaseContextElement 06 crypt32!CertFreeCertificateContext 07 winhttp!WEBIO_REQUEST::{dtor} 08 winhttp!WEBIO_REQUEST::`scalar deleting destructor' 09 winhttp!HTTP_BASE_OBJECT::Dereference 0a winhttp!HTTP_USER_REQUEST::_SafeDetachSysReq 0b winhttp!HTTP_USER_REQUEST::Shutdown 0c winhttp!HTTP_REQUEST_HANDLE_OBJECT::SafeShutdownUsrReq 0d winhttp!_InternetCloseHandle 0e winhttp!WinHttpCloseHandle Child SP IP Call Site 00000109e165da28 00007ffaf35a4f86 [InlinedCallFrame: 00000109e165da28] Interop+WinHttp.WinHttpCloseHandle(IntPtr) 00000109e165da28 00007ffa943ab463 [InlinedCallFrame: 00000109e165da28] Interop+WinHttp.WinHttpCloseHandle(IntPtr) 00000109e165dab0 00007ffaf1bb6b08 Interop+WinHttp+SafeWinHttpHandle.ReleaseHandle() [E:\A\_work\774\s\corefx\src\Common\src\Interop\Windows\winhttp\Interop.SafeWinHttpHandle.cs @ 59] 00000109e165dcd0 00007ffaf3482d33 [GCFrame: 00000109e165dcd0] 00000109e165dd08 00007ffaf3482d33 [GCFrame: 00000109e165dd08] 00000109e165de58 00007ffaf3482d33 [HelperMethodFrame_1OBJ: 00000109e165de58] System.Runtime.InteropServices.SafeHandle.InternalDispose() 00000109e165dfc0 00007ffaf1bd1ca7 System.Net.Http.WinHttpResponseStream.Dispose(Boolean) [E:\A\_work\774\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpResponseStream.cs @ 282] 00000109e165e000 00007ffaf2e1a72a System.IO.Stream.Close() [E:\A\_work\308\s\src\mscorlib\src\System\IO\Stream.cs @ 263] 00000109e165e030 00007ffaf1bc97d0 System.Net.Http.NoWriteNoSeekStreamContent+c.b__4_0(System.Threading.Tasks.Task, System.Object) [E:\A\_work\774\s\corefx\src\Common\src\System\Net\Http\NoWriteNoSeekStreamContent.cs @ 51] 00000109e165e070 00007ffaf2d871ce System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) [E:\A\_work\308\s\src\mscorlib\shared\System\Threading\ExecutionContext.cs @ 145] 00000109e165e0e0 00007ffaf2e143d6 System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef) [E:\A\_work\308\s\src\mscorlib\src\System\Threading\Tasks\Task.cs @ 2454] 00000109e165e180 00007ffaf2f78446 System.Threading.Tasks.ThreadPoolTaskScheduler.TryExecuteTaskInline(System.Threading.Tasks.Task, Boolean) [E:\A\_work\308\s\src\mscorlib\src\System\Threading\Tasks\ThreadPoolTaskScheduler.cs @ 76] 00000109e165e1d0 00007ffaf2e439b3 System.Threading.Tasks.TaskScheduler.TryRunInline(System.Threading.Tasks.Task, Boolean) [E:\A\_work\308\s\src\mscorlib\src\System\Threading\Tasks\TaskScheduler.cs @ 210] 00000109e165e230 00007ffaf2e800df System.Threading.Tasks.TaskContinuation.InlineIfPossibleOrElseQueue(System.Threading.Tasks.Task, Boolean) [E:\A\_work\308\s\src\mscorlib\src\System\Threading\Tasks\TaskContinuation.cs @ 256] 00000109e165e280 00007ffaf2e155af System.Threading.Tasks.Task.RunContinuations(System.Object) [E:\A\_work\308\s\src\mscorlib\src\System\Threading\Tasks\Task.cs @ 3263] 00000109e165e370 00007ffaf2e81705 System.Threading.Tasks.Task`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib]].TrySetResult(System.Threading.Tasks.VoidTaskResult) [E:\A\_work\308\s\src\mscorlib\src\System\Threading\Tasks\future.cs @ 425] 00000109e165e3b0 00007ffaf2e5dc89 System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib]].SetExistingTaskResult(System.Threading.Tasks.VoidTaskResult) [E:\A\_work\308\s\src\mscorlib\src\System\Runtime\CompilerServices\AsyncMethodBuilder.cs @ 605] 00000109e165e3f0 00007ffaf2e5dc1c System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib]].SetResult(System.Threading.Tasks.Task`1) [E:\A\_work\308\s\src\mscorlib\src\System\Runtime\CompilerServices\AsyncMethodBuilder.cs @ 646] 00000109e165e420 00007ffaf1bd2532 System.Net.Http.WinHttpResponseStream+d__18.MoveNext() [E:\A\_work\774\s\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpResponseStream.cs @ 163] 00000109e165e4e0 00007ffaf2d871ce System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) [E:\A\_work\308\s\src\mscorlib\shared\System\Threading\ExecutionContext.cs @ 145] 00000109e165e550 00007ffaf2d871ce System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) [E:\A\_work\308\s\src\mscorlib\shared\System\Threading\ExecutionContext.cs @ 145] 00000109e165e5c0 00007ffaf2e143d6 System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef) [E:\A\_work\308\s\src\mscorlib\src\System\Threading\Tasks\Task.cs @ 2454] 00000109e165e660 00007ffaf2e537f9 System.Threading.ThreadPoolWorkQueue.Dispatch() [E:\A\_work\308\s\src\mscorlib\src\System\Threading\ThreadPool.cs @ 582] ``` #2: SafeWinHttpHandle.ReleaseHandle() ``` Child SP IP Call Site 000000bb26d9c590 00007ffd81220c8a [FaultingExceptionFrame: 000000bb26d9c590] 000000bb26d9ca90 00007ffd6754e6c6 System.Net.Http.WinHttpRequestCallback.RequestCallback(IntPtr, System.Net.Http.WinHttpRequestState, UInt32, IntPtr, UInt32) 000000bb26d9ea70 00007ffd68903190 [FaultingExceptionFrame: 000000bb26d9ea70] 000000bb26d9ef70 00007ffd6754e57e System.Net.Http.WinHttpRequestCallback.RequestCallback(IntPtr, System.Net.Http.WinHttpRequestState, UInt32, IntPtr, UInt32) 000000bb26d9efe0 00007ffd6754e4a7 System.Net.Http.WinHttpRequestCallback.WinHttpCallback(IntPtr, IntPtr, UInt32, IntPtr, UInt32) 000000bb26d9f030 00007ffd099b1332 DomainBoundILStubClass.IL_STUB_ReversePInvoke(Int64, Int64, Int32, Int64, Int32) 000000bb26d9f2c8 00007ffd68a02e4a [InlinedCallFrame: 000000bb26d9f2c8] Interop+WinHttp.WinHttpCloseHandle(IntPtr) 000000bb26d9f2c8 00007ffd099b34c3 [InlinedCallFrame: 000000bb26d9f2c8] Interop+WinHttp.WinHttpCloseHandle(IntPtr) 000000bb26d9f350 00007ffd67536b08 Interop+WinHttp+SafeWinHttpHandle.ReleaseHandle() 000000bb26d9f4a0 00007ffd68a02d33 [GCFrame: 000000bb26d9f4a0] 000000bb26d9f618 00007ffd68a02d33 [GCFrame: 000000bb26d9f618] 000000bb26d9f6b8 00007ffd68a02d33 [HelperMethodFrame_1OBJ: 000000bb26d9f6b8] System.Runtime.InteropServices.SafeHandle.InternalFinalize() 000000bb26d9f7c0 00007ffd68359b16 System.Runtime.InteropServices.SafeHandle.Finalize() 000000bb26d9fbf0 00007ffd68a02ca6 [DebuggerU2MCatchHandlerFrame: 000000bb26d9fbf0] ``` #3: WinHttpHandler.HandleAsyncException () ``` Exception object: 000000f740eb92f8 Exception type: System.NullReferenceException Message: Object reference not set to an instance of an object. InnerException: <none> StackTrace (generated): System.Net.Http.WinHttpHandler.HandleAsyncException(System.Net.Http.WinHttpRequestState, System.Exception) System_Net_Http!System.Net.Http.WinHttpHandler+<StartRequest>d__105.MoveNext()+ System_Private_CoreLib!System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()System_Private_CoreLib!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) System_Private_CoreLib!System.Threading.ThreadPoolWorkQueue.Dispatch() ``` #4 ``` Thread Id: 1273 OS Id: 5be0 Locks: 0 Thread is Alive Last Exception: (System.ExecutionEngineException) (null) 0000000cbaf6deb8 0000000000000000 InlinedCallFrame 0000000cbaf6deb8 0000000000000000 InlinedCallFrame 0000000cbaf6de90 00007ffbd2ac41b3 DomainBoundILStubClass.IL_STUB_PInvoke(IntPtr) 0000000cbaf6df40 00007ffc31906768 Interop+WinHttp+SafeWinHttpHandle.ReleaseHandle() 0000000cbaf6e160 0000000000000000 GCFrame 0000000cbaf6e198 0000000000000000 GCFrame 0000000cbaf6e2e8 0000000000000000 HelperMethodFrame_1OBJ 0000000cbaf6e450 00007ffc31921767 System.Net.Http.WinHttpResponseStream.Dispose(Boolean) 0000000cbaf6e490 00007ffc2dcd009a System.IO.Stream.Close() 0000000cbaf6e4c0 00007ffc31919310 System.Net.Http.NoWriteNoSeekStreamContent+<>c.<SerializeToStreamAsync>b__4_0(System.Threading.Tasks.Task, System.Object) 0000000cbaf6e500 00007ffc2dc3b3be System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) 0000000cbaf6e570 00007ffc2dcc9d46 System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef) 0000000cbaf6e610 00007ffc2de2c466 System.Threading.Tasks.ThreadPoolTaskScheduler.TryExecuteTaskInline(System.Threading.Tasks.Task, Boolean) 0000000cbaf6e660 00007ffc2dcf7213 System.Threading.Tasks.TaskScheduler.TryRunInline(System.Threading.Tasks.Task, Boolean) 0000000cbaf6e6c0 00007ffc2dd33a5f System.Threading.Tasks.TaskContinuation.InlineIfPossibleOrElseQueue(System.Threading.Tasks.Task, Boolean) 0000000cbaf6e710 00007ffc2dccaf1f System.Threading.Tasks.Task.RunContinuations(System.Object) 0000000cbaf6e800 00007ffc2dd35085 System.Threading.Tasks.Task`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib]].TrySetResult(System.Threading.Tasks.VoidTaskResult) 0000000cbaf6e840 00007ffc2dd114f9 System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib]].SetExistingTaskResult(System.Threading.Tasks.VoidTaskResult) 0000000cbaf6e880 00007ffc2dd1148c System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib]].SetResult(System.Threading.Tasks.Task`1<System.Threading.Tasks.VoidTaskResult>) 0000000cbaf6e8b0 00007ffc31921fc6 System.Net.Http.WinHttpResponseStream+<CopyToAsyncCore>d__18.MoveNext() 0000000cbaf6e970 00007ffc2dc3b3be System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) 0000000cbaf6e9e0 00007ffc2dc3b3be System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) 0000000cbaf6ea50 00007ffc2dcc9d46 System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef) 0000000cbaf6eaf0 00007ffc2dd07069 System.Threading.ThreadPoolWorkQueue.Dispatch() ``` Some Notes on the usage of `HttpClient`: * Shared instance of `HttpClientHandler` as `static readonly HttpMessageHandler` * Most often invoked methods: * `public object Invoke(string method, Type returnType = null, object parameters = null)` * `public async Task<object> InvokeAsync(string method, Type returnType = null, object parameters = null, CancellationToken cancellationToken = default (CancellationToken))` * The core functionality is implemented by `async Task<object> GetResponseAsync ` * Instantiates new instance of `HttpClient` on every call as new `HttpClient(webServerInvoker.Handler, false)` where `webServerInvoker.Handler` is the shared static instance. * Awaits for `PostAsync` result, a timed `CancellationToken` is provided . * Always disposes `HttpClient` instance at the end of the call. * Note that synchronous public object Invoke enforces its own timeout while waiting for InvokeAsync Task result. It cancels the CancellationTokenSource if the timeout is hit, in turn cancelling any pending HttpClient operation and immediately disposing of HttpClient instance. * The timeout is provided by the caller. It ranges from 30 seconds to 5 minutes. [EDIT] Formatting changes by @karelz 26281 area-Infrastructure Update servicemodel dependencies to latest stable version cc: @weshaggard @danmosemsft @zhenlan 26284 area-System.Memory Add ToEnumerable extension to Memory<T>T Provides an extension method to get an IEnumerable<T> from a Memory<T> to aid use of Memory<T> in existing APIs. - Uses iterator syntax to produce a type that implements both IEnumerable<T> and IEnumerator<T> so we don't have to allocate double when using it as an IEnumerator. - Adds some *very* basic tests for ToEnumerable to ensure correctness. resolves https://github.com/dotnet/corefx/issues/24854 cc: @stephentoub @KrzysztofCwalina 26285 area-Serialization Re-apply Changes in #25562 on if/else fix. Fix #26167 @shmao @zhenlan @mconnew 26288 area-System.Net WebSocketProtocol_CreateFromConnectedStream_Succeeds fails at ReceiveAsync This issue tracks to fix the test. 26289 area-System.Memory Remove use of Unsafe in UTF-8 formatters, plus performance improvements Fixes https://github.com/dotnet/corefx/issues/25648. My first attempt to switch the implementations from unsafe code to safe buffer-based code was a bit naive and resulted in considerable performance degradation (double-digit percentage loss of throughput across many APIs). I've spent time reworking the implementations to to work around the performance loss, and in many cases the new implementations are faster than the originals. For reviewers: I recommend looking at each commit in isolation, as each commit deals with a very specific formatter. It'll also be easier to see which helper routines in `FormatterHelpers` correlate with which implementations. This also allows individual commits to be backed out without affecting the rest of the PR if reviewers deem a particular commit as unwanted. 26290 area-Meta OS builds matrix in README.md The matrix is getting out of date. It should be scrubbed and updated to match the current state of the world and our builds. 26291 area-System.Diagnostics Use SIGCHLD to trigger Process waitpid check Fixes https://github.com/dotnet/corefx/issues/25962 @stephentoub @danmosemsft I have started on this by implementing the changes to the native code. I've moved the signal handling code that is shared between console and process into its own file signal.cpp. There is a separate `SystemNative_InitializeSignalHandling` that spins up the signal handling thread and registers signal handlers. The `Process` class will also call this. signal.cpp calls back into console.cpp via `UninitializeConsole` and `ReinitializeConsole`. `HandleSignalForReinitialize` and `TransferSignalToHandlerLoop` are merged into a single `SignalHandler` since both need to handle SIGCHLD. The TODO in `SignalHandlerLoop` describes the to-be-implemented behavior in managed code. 26292 area-System.Runtime [Recursive resource lookup bug] on runtime 2.0.4 with NLog.Web.AspNetCore "According to #23608, this bug should be already fixed, but when I publish a win10-x64 exe program, I get this exception. Reproduce: 1. add `<PropertyGroup><RuntimeIdentifier>win10-x64</RuntimeIdentifier></PropertyGroup>` to .csproj 2. nuget install `NLog.Web.AspNetCore 4.5.0-rc2` 3. WebHostBuilder `UseNLog().ConfigureLogging(c => c.ConfigureNLog(""nlog.config""))` 4. cmd `dotnet publish -r win10-x64` or VS publish 5. execute `netcoreapp2.0\win10-x64\publish\test.exe` Exception: ``` Assert Failure Expression: [Recursive resource lookup bug] Description: Infinite recursion during resource lookup within System.Private.CoreLib. This may be a bug in System.Private.CoreLib, or potentially in certain extensibility points such as assembly resolve events or CultureInfo names. Resource name: ArgumentNull_Generic Stack Trace: at System.SR.InternalGetResourceString(String key) at System.SR.GetResourceString(String resourceKey, String defaultString) at System.ArgumentNullException..ctor(String paramName) at System.Runtime.Loader.AssemblyLoadContext.GetLoadContext(Assembly assembly) at System.Reflection.Assembly.LoadFromResolveHandler(Object sender, ResolveEventArgs args) at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName) at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks, IntPtr ptrLoadContextBinder) at System.Reflection.RuntimeAssembly.InternalGetSatelliteAssembly(String name, CultureInfo culture, Version version, Boolean throwOnFileNotFound, StackCrawlMark& stackMark) at System.Resources.ManifestBasedResourceGroveler.GetSatelliteAssembly(CultureInfo lookForCulture, StackCrawlMark& stackMark) at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark) at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark) at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) at System.Resources.ResourceManager.GetString(String name, CultureInfo culture) at System.SR.InternalGetResourceString(String key) at System.SR.GetResourceString(String resourceKey, String defaultString) at System.ArgumentNullException..ctor(String paramName) at System.Runtime.Loader.AssemblyLoadContext.GetLoadContext(Assembly assembly) at System.Reflection.Assembly.LoadFromResolveHandler(Object sender, ResolveEventArgs args) at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName) at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks, IntPtr ptrLoadContextBinder) at System.Reflection.RuntimeAssembly.InternalGetSatelliteAssembly(String name, CultureInfo culture, Version version, Boolean throwOnFileNotFound, StackCrawlMark& stackMark) at System.Resources.ManifestBasedResourceGroveler.GetSatelliteAssembly(CultureInfo lookForCulture, StackCrawlMark& stackMark) at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark) at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark) at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) at System.Resources.ResourceManager.GetString(String name, CultureInfo culture) at System.SR.InternalGetResourceString(String key) at System.SR.GetResourceString(String resourceKey, String defaultString) at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingEvent(AssemblyName assemblyName) at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingResolvingEvent(IntPtr gchManagedAssemblyLoadContext, AssemblyName assemblyName) at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks, IntPtr ptrLoadContextBinder) at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, IntPtr ptrLoadContextBinder) at System.Reflection.Assembly.Load(AssemblyName assemblyRef) at NLog.Extensions.Logging.ConfigureExtensions.ConfigureHiddenAssemblies() at NLog.Extensions.Logging.ConfigureExtensions.AddNLog(ILoggingBuilder factory, NLogProviderOptions options) at NLog.Web.AspNetExtensions.ConfigureNLog(ILoggingBuilder builder, String configFileName) at test.Program.<>c.<BuildWebHost>b__1_0(ILoggingBuilder c) in E:\dev\testBug\Program.cs:line 27 at Microsoft.Extensions.DependencyInjection.LoggingServiceCollectionExtensions.AddLogging(IServiceCollection services, Action`1 configure) at Microsoft.AspNetCore.Hosting.WebHostBuilderExtensions.<>c__DisplayClass6_0.<ConfigureLogging>b__0(IServiceCollection collection) at Microsoft.AspNetCore.Hosting.WebHostBuilder.BuildCommonServices(AggregateException& hostingStartupErrors) at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build() at test.Program.BuildWebHost(String[] args) in E:\dev\testBug\Program.cs:line 28 at test.Program.Main(String[] args) in E:\dev\testBug\Program.cs:line 20 ```" 26293 area-System.Runtime String.IndexOf gives different behavior on windows vs linux with ascii "@jmazar commented on [Thu Jan 11 2018](https://github.com/dotnet/core/issues/1213) I am using .net core sdk 2.0.0 (I also tried on 2.1.2 with the same result) on Windows 10 and Ubuntu 17.10. Here is a quick gist of my reproduction https://gist.github.com/jmazar/b0cdad1ee122afa64518953b22ae8136 ```c# string a = ""8=FIX.4.29=17135=A""; int pos = 0; int tagend = a.IndexOf(""="", pos); Console.WriteLine(""tagend "" + tagend); int tag = Convert.ToInt32(a.Substring(pos, tagend - pos)); pos = tagend + 1; int fieldvalend = a.IndexOf(""\u0001"", pos); Console.WriteLine(""fieldvalend ""+ fieldvalend); pos = fieldvalend + 1; Console.WriteLine(""pos "" + pos); ``` On windows the fieldvalend prints out 9 (which is correct) but on linux it prints out 2 (which is incorrect). Is there something I am doing incorrectly or is there some setting I could try setting? Thank you! [EDIT] Include the gist inline by @karelz" 26294 area-System.Diagnostics cant start safari by ProcessStartInfo under macos 10.13.2 "_From @bodhichina on January 12, 2018 13:50_ i try run below code under macos 10.13.2, looks nothing happend. can you help to check what's wrong ``` var info=new ProcessStartInfo() { FileName = ""/Applications/Safari.app/Contents/MacOS/safari"", CreateNoWindow = false, UseShellExecute = false }; var process=new Process(){ StartInfo = info}; process.Start(); ``` _Copied from original issue: dotnet/coreclr#15839_" 26295 area-System.Memory Span: Provide ToString Forked from https://github.com/dotnet/corefx/issues/14376 Work item here is to implement ToString on Span/ReadOnlySpan and have it print out a string similar to what a collection would print out (which is just the object tostring - type + address) cc: @KrzysztofCwalina @jkotas @ahsonkhan to continue the discussion on ToString here. 26297 area-System.Data SqlDataReader.HasRows high cpu utilization There appears to be a heavy performance cost of adding SqlDataReader.HasRows while using ExecuteReader 60% CPU ```c# using ( var reader = command.ExecuteReader() ) { while (reader.HasRows == true) { while ( reader.Read() == true ) { // do something } } } ``` vs. 0% ```c# using ( var reader = command.ExecuteReader() ) { while ( reader.Read() == true ) { // do something } } ``` [EDIT] Add C# syntax highlighting by @karelz 26298 area-System.Data Corrected DataTable deserialization to use invariant culture for schema properties This PR addresses issue #25575. The issue boils down to the XML schema DataTable creates internally to describe the DataTable's own schema during serialization/deserialization. The code that handles the deserialization uses type conversion methods that depend on the current culture, which is incorrect because the XML schema itself specifies a specific culture (or, more accurately, a specific interpretation of characters used to represent negative numbers). I have added unit tests as well, specifically targeting interference between the current culture and the DataTable's schema while serializing. For symmetry, I verify that serialization also ignores the current culture, though the bug in issue #25575 is specific to deserialization. @ViktorHofer @danmosemsft @saurabh500 You are the commenters on the issue, as a starting point for code review. :-) 26300 area-System.Net *NO MERGE* Investigating issue #23769 Investigating #23769 26302 area-System.Data GetColumnSchema not supported Originally filed as https://github.com/aspnet/EntityFrameworkCore/issues/10686 by @dominicrooijackers Moved here since this is either an issue with ADO.NET or possibly with the way the third-party EntityFrameworkExtras uses ADO.NET, but is not an issue with EF Core itself. Overnight out .NET core 1.1.0 application broke on our development server. The application still works fine while running it from visual studio 2015 The error that I'm getting is An unhandled exception occurred while processing the request. NotSupportedException: Specified method is not supported. System.Data.Common.DbDataReaderExtensions.GetColumnSchema(DbDataReader reader) Stacktrace as follows: > System.Data.Common.DbDataReaderExtensions.GetColumnSchema(DbDataReader reader) EntityFrameworkExtras.EFCore.DatabaseExtensions.GetModelFromQuery<T>(DatabaseFacade databaseFacade, string sql, Object[] parameters) in DatabaseExtensions.cs EntityFrameworkExtras.EFCore.DatabaseExtensions.ExecuteStoredProcedure<T>(DatabaseFacade database, object storedProcedure) in DatabaseExtensions.cs DocumentPortal.Components.FolderViewComponent+<>c__DisplayClass3_0.<GetFolderContentAsync>b__0() in FolderViewComponent.cs System.Threading.Tasks.Task.InnerInvoke() System.Threading.Tasks.Task.Execute() System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) System.Runtime.CompilerServices.TaskAwaiter.GetResult() DocumentPortal.Components.FolderViewComponent+<InvokeAsync>d__2.MoveNext() in FolderViewComponent.cs System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) Microsoft.AspNetCore.Mvc.ViewComponents.DefaultViewComponentInvoker+<InvokeAsyncCore>d__6.MoveNext() System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) Microsoft.AspNetCore.Mvc.ViewComponents.DefaultViewComponentInvoker+<InvokeAsync>d__5.MoveNext() System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) Microsoft.AspNetCore.Mvc.ViewComponents.DefaultViewComponentHelper+<InvokeCoreAsync>d__12.MoveNext() > The following code is causing the error ```c# IEnumerable<string> actualNames = dr.GetColumnSchema().Select(o => o.ColumnName); ``` ### Further technical details EF Core version: 1.1.0 Database Provider: Microsoft.EntityFrameworkCore.SqlServer Operating system: Server 2012R2 IDE: Visual Studio 2015 No application updates have been made anytime recently, so I strongly believe it has something to do with the server environment. 26304 area-Serialization Put the code to get serializerPath into try/catch to catch any exception. #26224 @shmao @mconnew @zhenlan 26305 area-Infrastructure Update UAP TFM on master branch to be vNext As we get ready to ship .NET Core 2.1, we need to make sure that we rev up the version of UAP vnext on our master branch since we shouldn't ship OOB packages that have a uap asset with the old TFM. Because we haven't done this yet, we are currently seeing problems trying to consume OOB packages in UWP like the one described here #25024 about System.Memory package. Once that is fixed, we should be able to consume packages like System.Memory again. @joshfree I suppose we don't know yet what will the next UAP TFM be, but is it safe to just use 10.0.RS3+1 for now? (16299 + 1 = 10.0.16300). cc: @weshaggard 26306 area-System.Data SqlConnection timeout test is ported The connection timeout unit test that had been merged to release/2.0.0 branch is to be ported to master branch. 26307 area-System.Net [ManagedHandler] Digest parsing can read beyond the string Digest parsing of keys and values is parsing a string from server (untrusted source) and can run beyond the end of the string: https://github.com/dotnet/corefx/blob/58b5c181d3d47a3c2f75b602bb5153da9528a401/src/System.Net.Http/src/System/Net/Http/Managed/AuthenticationHelper.Digest.cs#L285-L293 If `quotedValue` is `true`: https://github.com/dotnet/corefx/blob/58b5c181d3d47a3c2f75b602bb5153da9528a401/src/System.Net.Http/src/System/Net/Http/Managed/AuthenticationHelper.Digest.cs#L329-L343 We should probably switch the parsing to `ReadOnlySpan<char>` (string has implicit conversion: https://github.com/dotnet/corefx/blob/master/src/System.Runtime/ref/System.Runtime.cs#L2322). 26308 area-Infrastructure Create an official ARM64 build for AOT UAP This is required to build ARM64 packages for ProjectN. /cc: @weshaggard 26309 area-System.IO NamedPipeServerStream RunAsClient changes other thread's euid When calling NamedPipeServerStream RunAsClient on Unix, it calls `Interop.Sys.SetEUid(peerID)`, which calls the POSIX command `seteuid`. According to the man pages for [setreuid](http://man7.org/linux/man-pages/man2/setreuid.2.html) and [nptl](http://man7.org/linux/man-pages/man7/nptl.7.html), whenever `seteuid` is called, it changes the user for all threads in the process in order to be POSIX compliant. > NPTL and process credential changes At the Linux kernel level, credentials (user and group IDs) are a per-thread attribute. However, POSIX requires that all of the POSIX threads in a process have the same credentials. To accommodate this requirement, the NPTL implementation wraps all of the system calls that change process credentials with functions that, in addition to invoking the underlying system call, arrange for all other threads in the process to also change their credentials. > Wrapper functions employing this technique are provided for setgid(2), setuid(2), setegid(2), seteuid(2), setregid(2), setreuid(2), setresgid(2), setresuid(2), and setgroups(2). I have a repro of this issue here: https://github.com/eerhardt/NamedPipeRunAsClient/ @ianhays @stephentoub 26310 area-System.IO .NET Core is missing suitable APIs for dealing with filesystems that contain symbolic links Ref: https://github.com/aspnet/Home/issues/2774 for discovery point .NET Core is missing suitable APIs for dealing with filesystems that contain symbolic links FileInfo does not resolve symbolic links, leading to subtle bugs. There's no API that gives information about the link target. There's other problems with the existing APIs causing them to have trouble when you call Directory.EnumerateFileSystemEntries involving having to do not one but two stat calls for each node. Might as well resolve them all at once. Proposed API surface: // These are deliberately set to the *nix constant values where possible. public enum FileTypes { Missing = 0, Fifo = 0010000, CharacterDevice = 0020000, Directory = 0040000, BlockDevice = 0060000, File = 010000, SymbolicLink = 0120000, Socket = 0140000, SymbolicLinkMissingTarget = 0200000, SymbolicLinkLoop = 0400000, ReparsePoint = 01000000, // ReparsePoint attribute set but not a symbolic link } public struct FileNode { public string Path { get; private set; } public string FileName { get => System.IO.Path.GetFileName(Path); } public DateTime LastAccessTime { get; private set; } public DateTime LastAccessTimeUTC { get; private set; } public DateTime LastWriteTime { get; private set; } public DateTime LastWriteTimeUTC { get; private set; } public DateTime LastChangeTime { get; private set; } public DateTime LastChangeTimeUTC { get; private set; } public FileAttributes Attributes { get; private set; } public FileTypes FileNodeType { get; private set; } public string SymbolicLinkTargetPath { get; private set; } public bool Exists { get => FileNodeType != 0 } FileNode(string path, bool resolvesymboliclink) { /* The general idea of this API is it doesn't throw; just gives the appropriate information You could probably put Cer.Success on it. */ Path = path; bool statpermissiondenied; if (resolvesymboliclink) { /* This code path would call CreateFile with only FILE_READ_ATTRIBUTES and then call GetFileInformationByHandle; on AccessDenied or PermissionDenied fall through below */ /* on unix this would be a stat() call */ } /* This code path would call FindFirstFileEx to get the file information by name from the node attribute */ if (resolvesymboliclink && FileNodeType == FileTypes.SymbolicLink) FileNodeType = 0; } /* Deserialization constructor */ FileNode(string path, FileTypes fileNodeType, FileAttributes Attributes, DateTime lastAccessTimeUTC, DateTime lastChangeTimeUTC, DateTime lastWriteTimeUTC, string symbolicLinkTargetPath); } public partial class File { public static void CreateSymbolicLink(string path, string targetPath, bool targetisdirectory = false); } public partial class Directory { // This one exists only code readability // The idea is the programmer would normally only pass the third parameter if it was indirection from another layer of indirection, and otherwise would call File.CreateSymbolicLink to create a symbolic link to a file and Directory.CreateSymbolicLink to create a symbolic link to a directory public static void CreateSymbolicLink(string path, string targetPath, bool targetisdirectory = true); => File.CreateSymbolicLink(path, targetPath, targetisdirectory); } 26312 area-Infrastructure Add arm64 build for uapaot This add a build and adds win10-arm64 to the list of supported UWP rids Fixes https://github.com/dotnet/corefx/issues/26308. 26313 area-System.Memory [API Proposal] Allow easier access to binary representation of blittable types Occasionally advanced developers may have a need to view the binary representation of a blittable value type. For instance, the UTF-8 parsers and formatters have the need to treat a GUID as a sequence of binary data so that it can be efficiently inspected and converted to wire format. This currently involves using pointers and reinterpreting casts, or it involves the use of `Unsafe.As<,>`, or it involves creating a temporary `Span<byte>` so that the value can be copied directly into that buffer for future inspection. The framework currently lacks a copyless, type-safe API for performing this operation. ## Proposal Add a new single method to the existing `MemoryMarshal` class. ```csharp public static class MemoryMarshal { public static Span<byte> Blit<T>(ref T value) where T : struct; } ``` This is very similar to the existing `BinaryPrimitives.WriteMachineEndianness<T>(Span<byte> buffer, ref T value)` method. The key difference is that the existing `WriteMachineEndianness` method copies the contents of a blittable struct to an existing `Span<byte>`, whereas the new method being proposed is a zero-copy API that simply presents a binary data view over an existing blittable struct. Alternatively, if this method does not belong on the `MemoryMarshal` class, the `BinaryPrimitives` class could be a useful home for it. I *do not* believe this method belongs on the `Unsafe` class. Even though the method itself is implemented in terms of unsafe code, it's intended to be presented as a type-safe facade since it fails if the requested type is not blittable. (This method could be used to circumvent visibility, just like other methods on `BinaryPrimitives`, but it can't be used to stomp on arbitrary object references.) A sample implementation of this function is provided at the reference below. https://github.com/GrabYourPitchforks/corefx/blob/e30a8cca02b26b7116fc85f7d4e47bcfab1fe514/src/System.Memory/src/System/Buffers/Text/Utf8Formatter/FormattingHelpers.cs#L32-L55 26314 area-Infrastructure Mirror changes from dotnet/coreclr This PR contains mirrored changes from dotnet/coreclr **Please REBASE this PR when merging** 26317 area-System.Linq It has same test cases in `SkipWhileTests.cs` When I was reading `SkipWhileTests.cs`, I was confused by this part: https://github.com/dotnet/corefx/blob/58b5c181d3d47a3c2f75b602bb5153da9528a401/src/System.Linq/tests/SkipWhileTests.cs#L91-L125 `PredicateManyFalseOnSecond` and `PredicateManyFalseOnSecondInex` is completely the same. `PredicateTrueOnSecondFalseOnFirstAndOthers` and `PredicateTrueOnSecondFalseOnFirstAndOthersIndex` is the same, too. I think `predicate` of the Index test case should be: `(e, i) => i % 2 == 0`, and `expected` should be changed. Any Idea? Thank you. 26318 area-System.Linq Fix SkipWhile tests that are accidentally duplicates Fixes #26317 26319 area-System.Linq Linq.Expressions.LambdaExpression and Linq.Expressions.BlockExpression "Greetings; Currently, `Linq.Expressions.BlockExpression` allows a set of local variables represented by `Linq.Expressions.ParameterExpression` to be provided to it. This allows for the following ""pseudo""-code: ```c# var paramExpr = Expression.Parameter(typeof(object), ""dummy""); var block = Expression.Block(new[] { paramExpr }, Expression.Call(paramExpr, typeof(object).GetMethod(""GetHashCode"", BindingFlags.Public | BindingFlags.Instance))); var lambda = Expression.Lambda<Func<object, int>(block, paramExpr); var fn = lambda.Compile(); Console.WriteLine(""{0}"", fn(new object())); ``` This code basically tries to call `object.GetHashCode()`. It however makes a critical mistake: `paramExpr` is declared as both a local variable to the block, and an argument to the compiled lambda. It will trigger an NPE. `paramExpr` being declared as a variable within `block` is effectively shadowing the value of the argument, producing the same result as if it was assigned back to `null` - except that in this case, it's a local uninitialized variable, and Linq.Expressions is perfectly fine with that, as it should, since there's no optimization pass here. The correct code would read: ```c# var paramExpr = Expression.Parameter(typeof(object), ""dummy""); var block = Expression.Block(Expression.Call(paramExpr, typeof(object).GetMethod(""GetHashCode"", BindingFlags.Public | BindingFlags.Instance))); /// ... Or just get rid of the block entirely, obviously - I'm leaving it here for the sake of clarity var lambda = Expression.Lambda<Func<object, int>(block, paramExpr); var fn = lambda.Compile(); Console.WriteLine(""{0}"", fn(new object())); ``` Should `Expressions.Block` forbid usage of variable expressions that were created through `Expression.Parameter` as local variables, or is it outside the scope of what `Linq.Expressions` should do? This issue had me scratch my hair for a couple weeks when dealing with it in much more complex code. It seems to me that the difference between variables and parameters in expressions is just related to `Expression.Variable` and `Expression.Parameter`: semantically, I guess they are handled identically PS: sorry about the poor title, not really sure how to name this one" 26320 area-System.Memory Span and ReadOnlySpan methods are missing the PureAttribute I'm very excited that `Span` is introduced in the lovely .NET framework! However I get a lot of R# warnings when using it, since none of the pure `Span` nor `ReadOnlySpan` methods have the `PureAttribute`. Is this 'pure' attribute obsolete? 26321 area-System.Reflection Codecoverage corefx\src\System.Reflection.Metadata\src\System\Reflection\Metadata\MetadataReader.cs Completes code coverage for the constructors and everything the constructors call, except lines 777 and 778. These are only reachable with some sort of corruption that I can't simulate. This includes everything from pull request #26029. Fixes #26028 26322 area-System.Net remove preauth handling for digest We're not handling this correctly today. Ideally we should have an auth token cache here, and use this to pre-generate the auth request headers for Uris in a protection domain that we've already authenticated to -- whether basic or digest. I will file a separate issue on this. For now, just remove the current logic so that our behavior is at least correct, if not ideal. 26323 area-System.Net [ManagedHandler] Cache and reuse auth credentials "Per RFC 7235, section 2.2: ""If a prior request has been authorized, the user agent MAY reuse the same credentials for all other requests within that protection space..."" The rules are slightly different for basic vs digest, and proxy vs regular auth, but the basic issue is the same. The managed handler isn't doing this today, which will cause additional round trips to reauthenticate subsequent requests. This may be more important for proxy auth, since currently we are forcing every proxied request to reauthenticate." 26325 area-System.Net [ManagedHandler] Reduce code duplication between regular auth and proxy auth Code in HttpProxyConnectionHandler.SendWithProxyAsync largely duplicates code in AuthenticateAndRedirectHandler.SendAsync. Would be nice to consolidate here where we can. 26326 area-System.Net [ManagedHandler] Consider adding support for LF line termination when parsing response header "Per RFC: https://tools.ietf.org/html/rfc7230#section-3.5 ""Although the line terminator for the start-line and header fields is the sequence CRLF, a recipient MAY recognize a single LF as a line terminator and ignore any preceding CR."" " 26327 area-System.Net HttpListener on Unix. Windows authentication. Hello. Are there plans to implement Windows authentication in HttpListener on Unix? It is necessary to migrate my project on Linux. 26329 area-System.Net IPAddress: Use BinaryPrimitives.ReverseEndianness Went ahead and grabbed this follow-up from #26303. 26331 area-System.Net [ManagedHandler] Add equivalent of ServicePoint.ConnectionLeaseTimeout This is necessary to support DNS based routing with TTLs. See #11224 for more details. 26334 area-System.Net Test failed: System.Net.Sockets.Tests.UnixDomainSocketTest / ConcurrentSendReceiveAsync ## Types of failures Failure [20180113.03](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180113.03/workItem/System.Net.Sockets.Tests/analysis/xunit/System.Net.Sockets.Tests.UnixDomainSocketTest~2FConcurrentSendReceiveAsync): ``` System.TimeoutException : WhenAllOrAnyFailed timed out after 10000 at System.Threading.Tasks.TaskTimeoutExtensions.<WhenAllOrAnyFailed>d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Net.Sockets.Tests.UnixDomainSocketTest.<ConcurrentSendReceiveAsync>d__10.MoveNext() in /root/corefx-1286629/src/System.Net.Sockets/tests/FunctionalTests/UnixDomainSocketTest.netcoreapp.cs:line 335 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ``` ## History of failures Day | Build | OS | Details --- | --- | --- | --- 11/25 | 20171125.01 | RedHat69 | 1/13 | 20180113.03 | Ubuntu14.04 | [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180113.03/workItem/System.Net.Sockets.Tests/analysis/xunit/System.Net.Sockets.Tests.UnixDomainSocketTest~2FConcurrentSendReceiveAsync) 3/7 | 20180307.01 | RedHat73 | 3/26 | 20180326.03 | Debian90 | 26335 area-System.Net The HttpClient.SendAsync throws WebException instead of wrapping it with HttpRequestException The 4.6.1 framework version did not do this. When moving to .NET Standard 2.0 + .NET Framework 4.7.1, the same exception is no longer wrapped into an HttpRequestException (while the docs still state that it should). This breaks robustness wrappers and retry mechanisms built around the HttpClient.SendAsync. Consider the following stacktrace (processed with the [AsyncFriendlyStackTrace](https://github.com/aelij/AsyncFriendlyStackTrace)) ``` System.Net.WebException: The request was aborted: The request was canceled. System.Net.ConnectStream.BeginRead(Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state) System.IO.Stream.<>c.<BeginEndReadAsync>b__43_0(Stream stream, ReadWriteParameters args, AsyncCallback callback, Object state) System.Threading.Tasks.TaskFactory`1.FromAsyncTrim[TInstance,TArgs](TInstance thisRef, TArgs args, Func`5 beginMethod, Func`3 endMethod) System.IO.Stream.BeginEndReadAsync(Byte[] buffer, Int32 offset, Int32 count) System.IO.Stream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) async System.IO.Stream.CopyToAsyncInternal(?) async System.Net.Http.HttpContent.LoadIntoBufferAsyncCore(?) async System.Net.Http.HttpClient.FinishSendAsyncBuffered(?) async System.Net.Http.HttpClient.SendAsync(?) ``` 26336 area-System.IO StreamWriter.WriteLine looks to be writing on LF as opposed to CRLF @diamondes3 commented on [Thu Jan 11 2018](https://github.com/dotnet/core/issues/1211) Core 2.1.2 When using a StreamWriter and issuing a WriteLine, the output data is being appended with a LF only. I don't know for certain, but I'm pretty sure, that is used to append CRLF. This doesn't seem to affect anything that I have noticed, except, when opening a file in NotePad, the data is one long line. Excel can open the file and properly figure out the columns. NotePad++ can figure it out. Other .net programs can figure it out. I have a VB program that also outputs data via a StreamWriter.Writeline and it's putting out CRLF. I understand, that Core is a different animal than VB, but I put this in here for comparison purposes. 26337 area-System.Diagnostics Flag `CreateNoWindow` does not work on linux "@maroallegro commented on [Wed Jan 10 2018](https://github.com/dotnet/core/issues/1206) Used framework: .NET Core 2.0 Running below code on Windows opens new console window with program.dll running. When running below code on linux new console window is not opening. Seems like flag `CreateNoWindow = false` does not work. var process = new Process { StartInfo = new ProcessStartInfo { FileName = ""dotnet"", Arguments = ""program.dll"", UseShellExecute = true, RedirectStandardOutput = false, RedirectStandardError = false, CreateNoWindow = false } }; process.Start(); Is it a bug? How to open program.dll in new console window on Linux using .NET Core 2.0? --- @wfurt commented on [Wed Jan 10 2018](https://github.com/dotnet/core/issues/1206#issuecomment-356673961) How exactly do you execute this? I don't see new window when executed from simple app running in xterm. Conceptually .NET Core does not have GUI functions - like opening window. It is possible that the windows is created by your desktop manager or something else. If you still think it is bug please provide full repro app and instructions how to run it. --- @Petermarcu commented on [Wed Jan 10 2018](https://github.com/dotnet/core/issues/1206#issuecomment-356700112) Isn't that what the issue is? On Windows, when you set ""CreateNoWindow"" to true is when you'd expect no new window. I think @maroallegro is wanting to create a new window so setting it to false. And it works that way on Windows. --- @maroallegro commented on [Wed Jan 10 2018](https://github.com/dotnet/core/issues/1206#issuecomment-356712214) @wfurt > How exactly do you execute this? On linux `dotnet <scriptName.dll> ` > I don't see new window when executed from simple app running in xterm. And that is the problem :) Because that script opens new console window when runned on Windows System only. > If you still think it is bug I don't know, I just see the difference how program acts on Linux and Windows. I would like to open new window functionality on both systems. On linux I managed to open new console by running new instance of xterm but it seems as workaround for me if we have flag `CreateNoWindow = false`. @Petermarcu exactly as you said, > @maroallegro is wanting to create a new window so setting it to false. And it works that way on Windows. but on linux does not. " 26338 area-System.Numerics BigInteger based random testing of Decimal (part 2) This is a continuation of #24053 and contains new tests for https://github.com/dotnet/corert/pull/4997 26340 area-System.Diagnostics Process.Start not working properly in Mac @viswa18 commented on [Mon Dec 18 2017](https://github.com/dotnet/core/issues/1171) # Process.Start not working properly in Mac I have simple C++ command line application , which is running from .net core 2.0. I have set pinfo.CreateNoWindow = true; and pinfo.WindowStyle = Hidden; When running the application in mac, it opens the application icon in dock and close it. But it does not show any icon in windows and Linux. Can anyone help me to overcome this. I do not want the icon in dock. If it is a issue in .net core, when it will be fixed? Thanks in advance. 26341 area-System.Net add proxy configuration based on environment variables on Unix "I mostly focused on testing curl and making sure we do the same. I test combination ov variables and check what takes precedence. Also note that this is only configuration. I start looking at implementing HTTPS support but it is not part of this PR. As far as the exception list everything seems to work same for ""normal"" names. For IDNS getting something like http://名がドメイン.com/ I sometimes get GetProxy Called for http://名がドメイン.com/ or GetProxy Called for http://xn--v8jxj3d1dzdz08w.com/ Note that second is raw format for first one. I'm not sure if we have thoughts on this but my next step is to verify compatibility with curl. We still may want to detect that and use decoded string. For now I keep environmental configuration attached also for windows. In next step I plan to ""reuse"" code from winhttp and get proper implementation. Last unknown part as authentication. One can specify http_poxy=http://foo:bar@1.1.1.1 and curl will set Proxy-Authorization header automatically. The current structure seems to assume all proxies do share same credentials but they don't need to on Unix. Also I plan to progress on processing .netrc and get credentials from there if there is entry matching proxy destination. As far as HTTPS support: Doing HTTPS via HTTP (and CONNECT) is not supported and we have issue for that. Also http via HTTPS url does not work and handler throws exception. I plan to look at it while working on HTTPS support. " 26344 area-System.Net Test failure: System.Net.Security.Tests.ServerAsyncAuthenticateTest / ServerAsyncAuthenticate_MismatchProtocols_Fails The test: System.Net.Security.Tests.ServerAsyncAuthenticateTest.ServerAsyncAuthenticate_MismatchProtocols_Fails has failed. Assert.Throws() Failure\n Expected: typeof(System.Security.Authentication.AuthenticationException)\n Actual: typeof(System.NullReferenceException): Object reference not set to an instance of an object. ~~~ STACK TRACE: at System.Net.Security.SafeDeleteSslContext.Dispose(Boolean disposing) in /mnt/j/workspace/dotnet_corefx/master/ubuntu16.10_debug/src/Common/src/System/Net/Security/Unix/SafeDeleteSslContext.cs:line 65 at System.Net.Security.SecureChannel.Close() in /mnt/j/workspace/dotnet_corefx/master/ubuntu16.10_debug/src/System.Net.Security/src/System/Net/Security/SecureChannel.cs:line 182 at System.Net.Security.SslState.Close() in /mnt/j/workspace/dotnet_corefx/master/ubuntu16.10_debug/src/System.Net.Security/src/System/Net/Security/SslState.cs:line 473 at System.Net.Security.SslStream.Dispose(Boolean disposing) in /mnt/j/workspace/dotnet_corefx/master/ubuntu16.10_debug/src/System.Net.Security/src/System/Net/Security/SslStream.cs:line 661 at System.IO.Stream.Close() in /root/coreclr/src/mscorlib/src/System/IO/Stream.cs:line 239 at System.Net.Security.Tests.ServerAsyncAuthenticateTest.<ServerAsyncSslHelper>d__11.MoveNext() in /mnt/j/workspace/dotnet_corefx/master/ubuntu16.10_debug/src/System.Net.Security/tests/FunctionalTests/ServerAsyncAuthenticateTest.cs:line 185 --- End of stack trace from previous location where exception was thrown --- ~~~ Details: https://ci.dot.net/job/dotnet_corefx/job/master/job/ubuntu16.10_debug/4517/testReport/System.Net.Security.Tests/ServerAsyncAuthenticateTest/ServerAsyncAuthenticate_MismatchProtocols_Fails_serverProtocol__Tls__clientProtocol__Tls11__expectedException__typeof_System_Security_Authentication_AuthenticationException__/ 26346 area-System.Text [Missing] CssEncode. Options? Hi All, May Be I am missing something. But I was using the Microsoft.Security.Application.Encoder.CssEncode for CSS encoding but it is not available in System.Text.Encodings.Web. Are we going to add or it is not required. What is the best alternative? cc @stephentoub @jkotas Thanks a lot in advance, Brij 26348 area-System.Data DbConnectionPool.TryGetConnection is blocking call As discovered here: https://github.com/benaadams/Ben.BlockingDetector/issues/4 Dapper exposes a `QueryAsync` method, which uses this code to async open a db connection: await ((DbConnection) cnn).OpenAsync(cancel).ConfigureAwait(false) That in turn calls through to [TryGetConnection](https://github.com/dotnet/corefx/blob/d75610efce77c2f2562c4f35de901ea38b6d43b7/src/System.Data.SqlClient/src/System/Data/ProviderBase/DbConnectionPool.cs#L1074-L1107) which is a blocking call. @benaadams has a suggestion to use something like `SemphoreSlim.WaitAsync` for the async path, would that be possible? 26349 area-System.IO Test failed: System.IO.FileSystem.Tests / TimesIncludeMillisecondPart ``` Assert.All() Failure: 9 out of 9 items in the collection did not pass. [8]: Xunit.Sdk.NotEqualException: Assert.NotEqual() Failure Expected: Not 0 Actual: 0 at Xunit.Assert.NotEqual[T](T expected, T actual, IEqualityComparer`1 comparer) at System.IO.Tests.BaseGetSetTimes`1.<>c__DisplayClass8_0.<TimesIncludeMillisecondPart>b__0(TimeFunction function) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.IO.FileSystem/tests/Base/BaseGetSetTimes.cs:line 86 at Xunit.Assert.All[T](IEnumerable`1 collection, Action`1 action) ``` 26351 area-System.Drawing Fix PrintDocument tests on my machine 26352 area-System.Numerics Add Tau to System.Math class This is an enhancement/feature request. The System.Math class currently has values for `PI`, and `[Theory]` for π, π/2, π/4, [etc](https://github.com/dotnet/corefx/blob/master/src/System.Runtime.Extensions/tests/System/Math.cs), but there are a few other useful circle constants that can be useful to have that are missing. Namely: * Tau, which is 2π, or about `6.28318530718`. In radians, all the way around the circle. * ~~[Pau](https://xkcd.com/1292/), which is 1.5π, or about `4.71238898038`. In radians, 3/4 of the way around the circle.~~ Honestly I don't care about this one anymore, it's pretty niche and isn't likely to be added. Let's focus on Tau. The names don't matter too much, though they're simple to list and remember. Also, values such as π/2 should be given a variable. I would like to be able to call `Math.TAU`, ~~`Math.PAU`~~, `Math.PI`, `Math.HALFPI`, etc, or similar names, from within my program. Obviously I could just create my own helper class for this, but it would be better if it was implemented in .NET and C#, available for all users of .NET and C#. 26354 area-System.Runtime Support System.Runtime.Caching on Linux The only significant difference with Windows is that an attempt to set PhysicalMemoryLimitPercentage config parameter will result in PNSE on Linux as we don't support a notion of memory pressure on Linux yet. 26355 area-System.Net HttpClient: Inconsistent header behavior with IDNA host names If you specify a RequestUri with a non-ascii host name, we correctly encode this using IDNA rules (including Host header, if not explicitly specified). However, header handling doesn't seem to abide by IDNA rules. If you set the Host header to a non-ascii host name, this succeeds but then on send, you will either get an exception (Managed Handler) or a corrupted host name with non-ascii chars replaced by '?' (WinHttpHandler). I didn't try CurlHandler. Similarly, if you set the Referer header to a Uri with a non-ascii host name, this will succeed but then throw or corrupt on send as above. We should either (a) fail these when setting the header value or (b) properly encode this using IDNA. Option (b) seems preferable. On the response message, the Location header does not decode IDNA host names. This may be reasonable, since the undecoded host name is valid and equivalent. However, it seems nicer to decode this, and shouldn't be expensive, since it's easy to detect a IDNA-encoded host name. I think that covers all the cases where we expose host names or Uris in headers, but I might have missed something... 26356 area-System.IO Test failure: System.IO.Compression.Tests.ZipFileTest_ConvenienceMethods/CreateEntryFromFileExtension(withCompressionLevel: False) Opened on behalf of @Sunny-pu The test `System.IO.Compression.Tests.ZipFileTest_ConvenienceMethods/CreateEntryFromFileExtension(withCompressionLevel: False)` has failed. System.IO.InvalidDataException : End of Central Directory record could not be found. Stack Trace: at System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory() in E:\A\_work\1664\s\corefx\src\System.IO.Compression\src\System\IO\Compression\ZipArchive.cs:line 536 at System.IO.Compression.ZipArchive.Init(Stream stream, ZipArchiveMode mode, Boolean leaveOpen) in E:\A\_work\1664\s\corefx\src\System.IO.Compression\src\System\IO\Compression\ZipArchive.cs:line 492 at System.IO.Compression.ZipArchive..ctor(Stream stream, ZipArchiveMode mode, Boolean leaveOpen, Encoding entryNameEncoding) in E:\A\_work\1664\s\corefx\src\System.IO.Compression\src\System\IO\Compression\ZipArchive.cs:line 126 at System.IO.Compression.ZipFile.Open(String archiveFileName, ZipArchiveMode mode, Encoding entryNameEncoding) in E:\A\_work\1664\s\corefx\src\System.IO.Compression.ZipFile\src\System\IO\Compression\ZipFile.cs:line 206 at System.IO.Compression.Tests.ZipFileTest_ConvenienceMethods.<CreateEntryFromFileExtension>d__6.MoveNext() in E:\A\_work\1664\s\corefx\src\System.IO.Compression.ZipFile\tests\ZipFileConvenienceMethods.cs:line 112 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- Build : Master - 20180116.01 (UWP F5 Tests) Failing configurations: - Windows.10.Arm64-arm - Release Details: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fuwp~2F/build/20180116.01/workItem/System.IO.Compression.ZipFile.Tests/analysis/xunit/System.IO.Compression.Tests.ZipFileTest_ConvenienceMethods~2FCreateEntryFromFileExtension(withCompressionLevel:%20False) 26357 area-System.Memory Add MemoryPool APIs This API is an abstraction and a singleton implementation of a pool providing OwnedMemory<T> instances. The pool is used by (and required by) Pipelines, but is a very general purpose type. The default implementation of the pool (```MemoryPool<T>.Default```) is using ArrayPool<T> to provide actual memory buffers. Pipelines use an internal slab allocator implementation. There are other prototype implementations in corefxlab, e.g. [```NativeMemoryPool<T>```](https://github.com/dotnet/corefxlab/blob/master/src/System.Buffers.Experimental/System/Buffers/Native/NativeMemoryPool.cs); a pool based on native memory. MemoryPool<T> would go into System.Memory.dll and System.Buffers namespace ```c# public abstract class MemoryPool<T> : IDisposable { public static MemoryPool<T> Default { get; } public abstract OwnedMemory<T> Rent(int minBufferSize=AnySize); public const int AnySize = int.MinValue; public abstract int MaxBufferSize { get; } protected MemoryPool(); public void Dispose(); protected abstract void Dispose(bool disposing); ~MemoryPool(); } ``` The pooled instances are returned to the pool when they are disposed: ```c# using(OwnedMemory<byte> om = MemoryPool<byte>.Default.Rent()){ Memory<byte> memory = om.Memory; Span<byte> span = memory.Span; ... } // this is where the om is returned to the pool ``` cc: @davidfowl, @pakrym, @joshfree, @ahsonkhan 26358 area-System.Net Test failed: System.Net.NetworkInformation.Tests.UnixPingUtilityTests / PacketSizeIsRespected ## Types of failures ``` System.Exception : Ping output was <PING6(64=40+8+16 bytes) ::1 --> ::1 > ---- System.ArgumentOutOfRangeException : Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: startIndex at System.Net.NetworkInformation.Tests.UnixPingUtilityTests.<PacketSizeIsRespected>d__1.MoveNext() in /Users/buildagent/agent/_work/79/s/corefx/src/System.Net.Ping/tests/FunctionalTests/UnixPingUtilityTests.cs:line 68 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.String.LastIndexOf(String value, Int32 startIndex, Int32 count, StringComparison comparisonType) in /Users/buildagent/agent/_work/128/s/src/mscorlib/shared/System/String.Searching.cs:line 528 at System.Net.NetworkInformation.Tests.UnixPingUtilityTests.ParseReturnedPacketSize(String pingOutput) in /Users/buildagent/agent/_work/79/s/corefx/src/System.Net.Ping/tests/FunctionalTests/UnixPingUtilityTests.cs:line 76 at System.Net.NetworkInformation.Tests.UnixPingUtilityTests.<PacketSizeIsRespected>d__1.MoveNext() in /Users/buildagent/agent/_work/79/s/corefx/src/System.Net.Ping/tests/FunctionalTests/UnixPingUtilityTests.cs:line 47 ``` OR 1/7 (4ab83941f6592e6ea9dfee3d87dcdda9e3990eaa): ``` System.Exception : Ping output was <PING6(64=40+8+16 bytes) ::1 --> ::1 24 bytes from ::1, icmp_seq=0 hlim=64> ---- System.ArgumentOutOfRangeException : Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: startIndex ``` OR 12/16 (87216ce10f7b0f5fd51ccdd911896ff3f4e39ccb) ``` System.Exception : Ping output was <> ---- System.ArgumentOutOfRangeException : Length cannot be less than zero. Parameter name: length ``` ## History of failures Day | Build | OS | Details --- | --- | --- | --- 11/2 | 20171102.08 | OSX10.12 | 12/16 | 87216ce10f7b0f5fd51ccdd911896ff3f4e39ccb | OSX10.12 | 1/7 | 4ab83941f6592e6ea9dfee3d87dcdda9e3990eaa | OSX10.12 | 1/8 | bdd03289d9873cc371e79e7129e528135cdbc2e0 | OSX10.12 | 1/10 | 159249cc136fa994f3262b88a0c289a15a385948 | OSX10.12 | 1/12 | 48a3de14fde5ad5769d0b3fa55b47ca73b7973e3 | OSX10.12 | 1/13 | 1d452515af631807f2edccec256b82c03a060df2 | OSX10.12 | 26359 area-System.IO Colon character in file/directory on NFS share causing exception "@PFAR commented on [Mon Jan 15 2018](https://github.com/dotnet/core/issues/1220) # Colon character in file/directory on NFS share causing exception Some characters are illegal on Windows file system but are perfectly fine on third party file systems. Windows Explorer and CMD prompt have no problems with directory called ""Foo:bar"", but .NET Core (and .NET 4) generates System.NotSupportedException: The given path's format is not supported. # General Create a share to a Linux machine or NAS device (tested with Synology NAS and NFS, on Windows Server install Client for NFS) Map that share to x:\ In the share create a folder Test. Inside the folder Test create a folder 'Foo:bar', note that this is easiest done natively on the device, either web interface, putty or FTP. Create a .NET Core console app. var info = new DirectoryInfo(""x:\test"") var dirs = info.GetDirectories(); //dirs contains now one entry of ""Foo:bar"" var name = dirs[0].Name // <== already wrong, name is reported as ""bar"" dirs = dirs[0].GetDirectories(); // <== NotSupportedException In code there is likely a check whether the colon is used anywhere else besides for drive letter and generates an exception. Better approach would be that creating new folders and files keeps this check, but for existing entries it should just work just like in File Explorer and CMD prompt, where you can browse inside the directory without any issues. --- @PFAR commented on [Mon Jan 15 2018](https://github.com/dotnet/core/issues/1220#issuecomment-357677624) Just to let you know, when using SMB shares the Synology exposes such folder names as something with an entirely different name (like ""FP8AMI~K""), so this can only be tested properly on a Windows Server with Client for NFS " 26360 area-System.Threading NETFX x86rel Thread tests timeout in PR https://github.com/dotnet/corefx/pull/26353 NETFX x86 Release Build leg https://ci3.dot.net/job/dotnet_corefx/job/master/job/windows-TGroup_netfx+CGroup_Release+AGroup_x86+TestOuter_false_prtest/7047/console ``` 07:16:12 === TEST EXECUTION SUMMARY === 07:16:12 System.Threading.Thread.Tests Total: 35, Errors: 0, Failed: 0, Skipped: 1, Time: 2.387s 07:16:12 Finished running tests. End time= 7:16:12.65, Exit code = 0 08:56:25 Cancelling nested steps due to timeout 08:56:25 Sending interrupt signal to process 08:56:35 After 10s process did not stop ``` 26361 area-Infrastructure uap build hitting ApiCompat issues Official builds are hitting the following apicompat errors below. There are 2 issues that need to be understood: 1. Why is the build passing instead of failing because of the compat errors 2. The compat errors look to be a bug in the ApiCompat tool or configuration of it, so that needs to be understood. ``` 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.IO.FileAttributes' is a 'class' in the implementation but is a 'struct' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TResult>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TResult>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TResult>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TResult>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TResult>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TResult>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.IO.FileAttributes' is a 'class' in the implementation but is a 'struct' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.IO.HandleInheritability' is a 'class' in the implementation but is a 'struct' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TResult>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TResult>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TResult>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TResult>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TResult>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TResult>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.IO.HandleInheritability' is a 'class' in the implementation but is a 'struct' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.IO.FileAttributes' is a 'class' in the implementation but is a 'struct' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TResult>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TResult>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TResult>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TResult>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TResult>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TResult>' is a 'class' in the implementation but is a 'delegate' in the contract. 2018-01-16T18:30:14.2265070Z E:\A\_work\1688\s\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.IO.HandleInheritability' is a 'class' in the implementation but is a 'struct' in the contract. ``` 26362 area-Infrastructure Problem with build on android "I have this output when building CoreFX for aarch64... `CMake Error at /usr/share/cmake-3.5/Modules/CMakeTestCCompiler.cmake:61 (message): The C compiler ""/usr/bin/clang-3.9"" is not able to compile a simple test program. It fails with the following output: Change Dir: ~/git/corefx/bin/obj/Linux.arm64.Debug/native/CMakeFiles/CMakeTmp Run Build Command:""/usr/bin/make"" ""cmTC_f7c9e/fast"" /usr/bin/make -f CMakeFiles/cmTC_f7c9e.dir/build.make CMakeFiles/cmTC_f7c9e.dir/build make[1]: Entering directory ~/git/corefx/bin/obj/Linux.arm64.Debug/native/CMakeFiles/CMakeTmp Building C object CMakeFiles/cmTC_f7c9e.dir/testCCompiler.c.o /usr/bin/clang-3.9 -isystem ~/git/corefx/cross/android-rootfs/toolchain/arm64/sysroot/usr/include -target aarch64-linux-gnu --sysroot=~/git/corefx/cross/android-rootfs/toolchain/arm64/sysroot -o CMakeFiles/cmTC_f7c9e.dir/testCCompiler.c.o -c ~/git/corefx/bin/obj/Linux.arm64.Debug/native/CMakeFiles/CMakeTmp/testCCompiler.c Linking C executable cmTC_f7c9e /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_f7c9e.dir/link.txt --verbose=1 /usr/bin/clang-3.9 -target aarch64-linux-gnu -B ~/git/corefx/cross/android-rootfs/toolchain/arm64/sysroot/usr/lib/gcc/aarch64-linux-gnu -L~/git/corefx/cross/android-rootfs/toolchain/arm64/sysroot/lib/aarch64-linux-gnu --sysroot=~/git/corefx/cross/android-rootfs/toolchain/arm64/sysroot CMakeFiles/cmTC_f7c9e.dir/testCCompiler.c.o -o cmTC_f7c9e -rdynamic /usr/bin/aarch64-linux-gnu-ld: cannot find crt1.o: No such file or directory /usr/bin/aarch64-linux-gnu-ld: cannot find crti.o: No such file or directory /usr/bin/aarch64-linux-gnu-ld: cannot find crtbegin.o: No such file or directory /usr/bin/aarch64-linux-gnu-ld: cannot find -lgcc /usr/bin/aarch64-linux-gnu-ld: cannot find -lgcc_s /usr/bin/aarch64-linux-gnu-ld: cannot find -lgcc /usr/bin/aarch64-linux-gnu-ld: cannot find -lgcc_s /usr/bin/aarch64-linux-gnu-ld: cannot find crtend.o: No such file or directory /usr/bin/aarch64-linux-gnu-ld: cannot find crtn.o: No such file or directory clang: error: linker command failed with exit code 1 (use -v to see invocation) CMakeFiles/cmTC_f7c9e.dir/build.make:97: recipe for target cmTC_f7c9e failed make[1]: *** [cmTC_f7c9e] Error 1 make[1]: Leaving directory ~/git/corefx/bin/obj/Linux.arm64.Debug/native/CMakeFiles/CMakeTmp Makefile:126: recipe for target cmTC_f7c9e/fast failed make: *** [cmTC_f7c9e/fast] Error 2 CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:2 (project) -- Configuring incomplete, errors occurred! See also ""~/git/corefx/bin/obj/Linux.arm64.Debug/native/CMakeFiles/CMakeOutput.log"". See also ""~/git/corefx/bin/obj/Linux.arm64.Debug/native/CMakeFiles/CMakeError.log"". Failed to generate native component build project! Command execution failed with exit code 1. ` Any suggestions would very helpful. Thanks." 26363 area-System.Net Issue w/ long domain names? After upgrading to 2.0, getting an error on HttpWebRequest I was told our certificate is using wildcards: *.name1.name2.name3.com request url(get_json): https://e1171.name1.name2.name3.com/oauth2/.wel l-known/openid-configuration An error occurred while sending the request. A security error occurred 26364 area-System.Text "Regular expressions scalability issues due to lock on ""s_livecode""." "Static Regex methods takes global lock on ""s_livecode"" inside LookupCachedAndUpdate. This cause scalability issues. We understand that this problem could be addressed on App side, but imho it would be much better to make Regex cache per processor instead of global (similar to what @stephentoub did for Timer lock), so it will be more forgiving for bad coding practice. We would also participate back port to Desktop framework if this ever get fixed." 26368 area-System.Memory Move Span.NonPortableCast to MemoryMarshal and rename to Cast From https://github.com/dotnet/corefx/issues/26139#issuecomment-358090527: Move and rename NonPortableCast to MemoryMarshal.Cast **Current API:** ```C# namespace System { public static partial class MemoryExtensions { public static ReadOnlySpan<TTo> NonPortableCast<TFrom, TTo>(this ReadOnlySpan<TFrom> source) where TFrom : struct where TTo : struct { throw null; } public static Span<TTo> NonPortableCast<TFrom, TTo>(this Span<TFrom> source) where TFrom : struct where TTo : struct { throw null; } } } ``` **Proposed API:** ```C# namespace System.Runtime.InteropServices { public static partial class MemoryMarshal { public static bool TryCast<TFrom, TTo>(ReadOnlySpan<TFrom> source, out ReadOnlySpan<TTo> output) where TFrom : struct where TTo : struct { throw null; } public static bool TryCast<TFrom, TTo>(Span<TFrom> source, out Span<TTo> output) where TFrom : struct where TTo : struct { throw null; } } } ``` **Edit:** Removed `this` **Edit** by @ianhays: Changed `Cast` to `TryCast` per discussion cc @jkotas, @KrzysztofCwalina 26370 area-Microsoft.CSharp Remove some dead branches from Microsoft.CSharp * Don't report constrained in `AdjustMemberObject`. Never gets set, and constrained isn't meaningful when not producing IL directly. * Remove `FieldSymbol.isAssigned` Set but never used. CS0169 is meaningless in dynamic code. * Remove `objectIsLvalue(pOptionalObject)` from check field is lvalue. This test will always pass, so the second part is all that is required. * Move lvalue-detection into `ExprField` ctor * Remove `objectIsLvalue(pOptionalObject)` from check property is lvalue. This test will always pass, so the second part is all that is required. * Move lvalue-detection into `ExprProperty` ctor * Make `objectIsLvalue` a debug-only assertion. Now only used in assertions, so make it an assertion method. * Remove dead branches from `TryReportLvalueFailure` Since we can now see that we can't enter the branch for properties, nor escape the branch for fields, we can see that `pObject` will never be set and `isNested` never true. Remove branches for those conditions. Includes removal of `ERR_ReturnNotLValue`, contributes to #22470 * Remove path for `isNested` from `ReportReadOnlyError` Never true. Includes removal of `ERR_AssgReadonlyStatic2` and `ERR_AssgReadonly2`, contributes to #22470 * Inline `ReportReadOnlyError` and `TryReportLvalueFailure` These are now very small, and `CheckLvalue`'s logic is clearer with all errors happening within the same switch 26372 area-System.Security Make AsnWriter IDisposable "Without this change the AsnWriter class always sends the last ""rented"" array to the garbage collector. Since arrays from the array pool are expected to be gen-2 highly reused objects this has unfortunate consequences for both the induced trickle allocation and Gen2 pressure. Now it's IDisposable, and the Dispose implementation will return the rented array." 26373 area-System.Net HttpWebRequest create many connections in windows "Steps to reproduce ------------------ 1. run http service in localhost with port 80 2. run the following code with TargetFramework=netcoreapp2.0 3. view network connection stat(in windows, `netstat -n`) ```csharp using System; namespace httpwebrequesttest { using System.Net; class Program { static void Main(string[] args) { for(int i = 0;i<1000;i++) { var client = WebRequest.CreateHttp(""http://localhost:80""); using(var res = client.GetResponse()) { } Console.WriteLine($""{i}""); } Console.WriteLine($""press enter then exit""); Console.ReadLine(); } } } ``` Expected behavior ----------------- there is only one socket directed to localhost:80 like this(state is ""ESTABLISHED"" or ""TIME_WAIT""): ``` TCP [::1]:63063 [::1]:80 ESTABLISHED ``` Actual behavior --------------- there are one thousand ""TIME_WAIT"" or ""ESTABLISHED"" connections Environment data ----------------- here is my `dotnet info` output ``` .NET コマンド ライン ツール (2.1.2) Product Information: Version: 2.1.2 Commit SHA-1 hash: 5695315371 Runtime Environment: OS Name: Windows OS Version: 6.3.9600 OS Platform: Windows RID: win81-x64 Base Path: C:\Program Files\dotnet\sdk\2.1.2\ Microsoft .NET Core Shared Framework Host Version : 2.0.3 Build : a9190d4a75f4a982ae4b4fa8d1a24526566c69df ``` Notes ----------------- when TargetFramework=net461, It does not create many connections. And when run in linux, It does not create many connections." 26374 area-System.Net Remove unsafe in parsing string in Digest auth. fixes #26307 cc @stephentoub @karelz 26375 area-System.Net Add digest authentication functional tests. 26376 area-System.Diagnostics Fix Microsoft.Diagnostics.Tracing.EventSource.Redist Mirroring We used to mirror some files from this library to some shared folder from coreclr repo. Now we got the mirroring working for the whole corelib shared folder to corefx. So, this change is getting rid of the shared redundant files in this library and use only the mirrored shared folder. 26377 area-System.Threading CancellationToken.Register should take an Action<CancellationToken, object> delegate _From @AArnott on May 12, 2017 15:36_ I have to allocate a new delegate and closure in my `CancellationToken.Register` calls because I need an object *and* the `CancellationToken` itself: ```csharp this.CancellationRegistration = cancellationToken.Register( state => ((TaskCompletionSource<Releaser>)state).TrySetCanceled(cancellationToken), this.TaskSource); ``` Yet it would seemingly be a simple thing for the invoker of my delegate to *also* provide a copy of the `CancellationToken` itself when calling my delegate so that I can avoid the cost of the closure and then reuse the delegate for all invocations: ```csharp public CancellationTokenRegistration Register( Action<CancellationToken, object> callback, object state); ``` _Copied from original issue: dotnet/coreclr#11548_ 26378 area-System.Threading Interlocked.CompareExchange missing for uint, ulong and (if possible) general structs. _From @redknightlois on May 18, 2017 19:47_ I recently needed to use ```Interlocked.CompareExchange``` inside a function with the following form: ```csharp [MethodImpl(MethodImplOptions.AggressiveInlining)] private bool TryClaimSlot(ref uint entryKey, int key) { var entryKeyValue = entryKey; //zero keys are claimed via hash if (entryKeyValue == 0 & key != 0) { entryKeyValue = Interlocked.CompareExchange(ref entryKey, key, 0); if (entryKeyValue == 0) { // claimed a new slot this.allocatedSlotCount.Increment(); return true; } } return key == entryKeyValue; } ``` problem is that it can´t be done because the ```Interlocked.CompareExchange<T>``` requires it to be a class. Also if anyone knows a workaround for it, I would appreciate it. _Copied from original issue: dotnet/coreclr#11723_ 26381 area-System.Memory Add MemoryExtensions Reverse API to get parity with array Fixes https://github.com/dotnet/corefx/issues/25850 Implementation is similar to Array.Reverse: https://github.com/dotnet/coreclr/blob/master/src/mscorlib/src/System/Array.cs#L1565-L1587 cc @jkotas, @KrzysztofCwalina, @dotnet/corefxlab-contrib, @AtsushiKan 26382 area-System.Data SqlConnectionTimeout test failing breaking CI https://mc.dot.net/#/user/dotnet-maestro-bot/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/5130e06922a1491ff02ed162fd53459ec3d2ba5e/workItem/System.Data.SqlClient.Tests @geleems it is failing on Win10 and Win8.1 in CI jobs since https://github.com/dotnet/corefx/pull/26306 ``` Assert.True() Failure Expected: True Actual: False Stack Trace : at System.Data.SqlClient.Tests.SqlConnectionBasicTests.ConnectionTimeoutTestWithThread() in D:\j\workspace\windows-TGrou---74aa877a\src\System.Data.SqlClient\tests\FunctionalTests\SqlConnectionBasicTests.cs:line 110 ``` 26383 area-System.IO Remove old stat struct "Depends on ingesting https://github.com/dotnet/coreclr/pull/15872 Remove ""2"" suffix from stat struct and private function. Retain ""2"" suffix for public functions since CoreCLR calls that. @jkotas I do not plan to do 4th and 5th commits to get rid of this ""2"" suffix as it does not seem very important. I imagine we can continue this scheme (@JeremyKuhne has some similar edits to do) and do a ""suffix cleanup"" pass later. LMK if you would rather I continue with the commits." 26384 area-System.IO Disable Millisec test for all Unix Relates to https://github.com/dotnet/corefx/issues/26349 CI was green even though it failed on OSX on CI. I disabled for OSX, now I see on the official build machines, it fails for Linux as well. Disabling for all Unix until I have time to try some logging. 26385 area-Meta Performance improvement for Meltdown and Spectre, libuv https://github.com/libuv/libuv/issues/1710 26388 area-System.IO Addition of async method variants or argument option for opening/creating with System.IO.File and System.IO.FileInfo shorthands When using System.IO with File and/or FileInfo for actions like opening, creating, writing and deleting you do not have the option to properly open FileStreams for use with async methods. (Mainly concerning here with task based and async await but it is not limited to) A very common issue with async await and files is that files are opened through methods like File.OpenWrite or new FileInfo(x).Open() and the FileStream result is then used with Async operations like WriteAsync or ReadAsync. When doing this you will incur a big performance hit as the stream is not configured to be used like that. The proper way to use FileStreams with async await is to open the FileStream through the constructor with argument isAsync to true. However as File and FileInfo are more directly approached and provide easier shorthands for common actions the mistake is made often. Besides the performance hit this also creates a big misconception that async await with file IO is actually not good. If an async variant could be added like File.OpenAsync, or have and variant with an added an argument like File.Open(bool isAsync), that will configure the FileStream with isAsync to true it would ensure that it is not cause issues when using it asynchronously. (The OpenAsync variant would create a more natural usage with async await, at lower levels it is busy with handles and such.) At least the following in System.IO.File and System.IO.FileInfo open a stream that is only to be used in synchronous programming and cause performance issues when accidentally used with async await. - Create - CreateText - Open - OpenRead - OpenText - OpenWrite Also wondering if the methods like Copy, Move and others should have Async versions as they perform at least for WinRT async operations and if they should be added as well to DirectoryInfo and FileSystemInfo. 26391 area-Microsoft.CSharp Refactor and tests for MS.CSharp's GetBestAccessibleType() * Rearrange `GetBestAccessibleType` to avoid repeated tests & recursion. Keep all code for `AggregateType` in the first branch for `AggregateType`, etc. * Use `ContextForMemberLookup` instead of `BindingContext` for best accessible The `BindingContext` is only used for this property, which it hits repeatedly, so just pass it in instead. * Don't use intermediate variables for `out` parameters. If just going to assign it to something anyway. * Return type directly from `GetBestAccessibleType()` The type passed in can never be `ParameterModifierType` or `PointerType` so the case where false is returned can never be hit. Change to returning the accessible type directly, and remove branches for false returns. * Add tests for getting best accessible type. 26394 area-System.IO Need a point to expose platform specific IO information There is a need to get platform specific information regarding files. Some data can be abstracted cross plat relatively easily, but other info cannot. One possibility is to add interfaces to FileSystemInfo, etc in only the specific platform implementations that expose platform level details that are already internally available. Something like the following: ``` C# namespace System.IO.Unix { public interface IUnixFileSystemInfo { public FileStatus { get; } } public struct FileStatus { public FileStatusFlags Flags; public FileTypes Mode; public uint Uid; public uint Gid; public long Size; public long ATime; public long MTime; public long CTime; public long BirthTime; public long Dev; public long Ino; } [Flags] public enum FileStatusFlags { None = 0, HasBirthTime = 1, } [Flags] public enum FileTypes { S_IFMT = 0xF000; S_IFIFO = 0x1000; S_IFCHR = 0x2000; S_IFDIR = 0x4000; S_IFREG = 0x8000; S_IFLNK = 0xA000; S_IFSOCK = 0xC000; } } namespace System.IO.Windows { public interface IWindowsFileSystemInfo { public uint GetReparsePointType(); } } ``` @weshaggard What are the implications of implementing interfaces that we don't expose in the ref assembly? (e.g. FileSystemInfo would not derive from IWindowsFileSystemInfo in the ref assembly) Would it be better to add a method to FSI? Something like `T TryGetInterface<T>()`? 26395 area-System.IO Expose PipeOptions.CurrentUserOnly and add implementation when flag is passed This is the implementation for PipeOptions.CurrentUserOnly. - Server side (Windows): if the flag is on, remove the flag from options variable, and add all the current user as the owner and the only user with rights to access the pipe through ACL attributes. This handles the user's elevation as well. - Client side (windows and unix): if flag is on, remove it, set bool variable to true and then when trying to connect to the server, if the variable is true and the connection was successful, validate that the server we connected was created by the same user with the same elevation level by comparing the Sids. If this is not the case, set State as closed and throw. Relates to: https://github.com/dotnet/corefx/issues/25427 26396 area-System.IO Avoiding Extra allocation in RemoveRelativeSegments(Path.combineNoChecks(basePath, path)) RemoveRelativeSegments(Path.combineNoChecks(basePath, path)) is going to cause an allocation but RemoveRelativeSegments() can be modified to take the both paths and do it in a single pass without extra allocation. It may be helpful for scenarios with heavy usage of Relative Paths. cc @pjanotti @JeremyKuhne 26397 area-System.Security macOS cannot create PFX with a mix of HasPrivateKey and !HasPrivateKey certs #26125, but for macOS. (Different fix, and the macOS existing failure is holding up a Linux fix) ```c# var collection = new X509Certificate2Collection(); collection.Add(certificateWithPrivateKey); collection.Add(anotherCertWithoutPrivateKey); var output = collection.Export(X509ContentType.Pkcs12); ``` See also #26152. 26398 area-Meta Move marvin hashing into shared partition to gain access to it in S.P.CoreLib Prep work 26399 area-System.Net No local repro for #23768, re-enabling test ~~Not to be committed as it is, just to check CI run.~~ Initial tests passed, now trying test in Outerloop. 26400 area-System.Runtime TimeZoneInfo Now functionality @TimCurwick commented on [Fri Sep 15 2017](https://github.com/dotnet/coreclr/issues/14019) TimeZoneInfo objects should have functionality to provide the current time in the time zone defined in the object. This would be similar to the DateTime and DateTimeOffset Now and UTCNow static properties, though of course not static. For consistency, this could be a property named Now. Something like: `public readonly DateTime Now { get { return ConvertTime( DateTime.UtcNow, this); } }` 26401 area-System.Runtime "Convert.ToBase64String is using ""\r\n"" line breaks, even on Unix" "@stephentoub commented on [Fri Oct 06 2017](https://github.com/dotnet/coreclr/issues/14357) When Base64FormattingOptions.InsertLineBreaks is used, it's using ""\r\n"" regardless of platform. Presumably that's not the desired behavior... https://github.com/dotnet/coreclr/blob/da8b7181dbe362fbfe64c7ef72ff3a4a7db68f24/src/mscorlib/shared/System/Convert.cs#L2522-L2523 https://github.com/dotnet/coreclr/blob/da8b7181dbe362fbfe64c7ef72ff3a4a7db68f24/src/mscorlib/shared/System/Convert.cs#L2540-L2541 https://github.com/dotnet/coreclr/blob/da8b7181dbe362fbfe64c7ef72ff3a4a7db68f24/src/mscorlib/shared/System/Convert.cs#L2581 --- @poizan42 commented on [Fri Oct 06 2017](https://github.com/dotnet/coreclr/issues/14357#issuecomment-334759316) FWIW I would be quite surprised if the behaviour of ToBase64String depended on the platform considering that the consumer is likely not to be the same as the producer. Should probably just always be \n. --- @stephentoub commented on [Fri Oct 06 2017](https://github.com/dotnet/coreclr/issues/14357#issuecomment-334759597) > Should probably just always be \n. That would be a breaking change and behavioral difference from the .NET Framework. --- @poizan42 commented on [Fri Oct 06 2017](https://github.com/dotnet/coreclr/issues/14357#issuecomment-334763497) Hmm yeah that's a problem. What about adding a new value to Base64FormattingOptions to control the newline behaviour? " 26402 area-System.Runtime APIs return incorrect runtime version "Runtime: .NET Core 2.0.3 OS: Windows, Linux We would like to log the .NET Core runtime version when our app starts. The following APIs, which are all documented as returning the runtime version, seem to return a version that doesn't match the runtime, cli, or sdk versions: ```csharp System.Environment.Version System.Runtime.InteropServices.RuntimeEnvironment.GetSystemVersion() System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription() ``` Those members return the following results, respectively: ``` 4.0.30319.42000 v4.0.30319 .NET Core 4.6.0.0 ``` I would expect ""2.0.3"" to be there instead. The values returned don't relate to anything useful. " 26403 area-System.Net add ability to enable managed handler via runtime config "add ability to enable managed handler via Switch.System.Net.Http.DefaultUseManagedHttp appContext setting Testing: - create simple app using http handler/client. -set all_proxy on Linux and make request. - verify that the variable is used. - add to proxy-test.runtimeconfig.json { ""runtimeOptions"": { ""configProperties"": { ""Switch.System.Net.Http. DefaultHttpClientHandlerToManagedHandler"": true }, } - run test again. verify that all_proxy variable is ignored. That means managed handler is in use (as it does not yet support it) I also did some testing with adding debug messages and UseManagedHandler() returns true is set to true, and new block is skipped is missing or set to false. " 26404 area-Infrastructure preserve spaces in arguments when passing among scripts on Unix "partial fix for #23360 replace $* with ""$@"" to properly preserve spaces in shell arguments With $*, passing ""aa bb"" will be transformed to ""aa"" ""bb"" on Next level. ""$@"" will preserve arguments with spaces as they were passed in. (like the ""-showprogress -parallel none"") To fully fix the issue we will also need to update msbuild.sh it self. I've been using this for quite a while in my local build trees. The open question is if anything in CI infrastructure depends on existing (broken) behavior. There was one earlier failed attempt because it did uncovered unbalanced quotes in some other scripts. " 26405 area-System.Net Basic proxy auth does not work Steps to reproduce: 1. `export http_proxy=http://furt:foo@10.121.122.110:3128` 2. wire simple app using http handler and fetch a page. 3. verify that connection will get redirected to proxy. 3. `export COMPlus_UseManagedHttpClientHandler=true` 4. run the test again. 5. The connection is redirected to proxy but the proxy fails with 407 error. Tested on: Linux & Mac (Windows not attempted) It seems like the code is trying to add Proxy-Authorization header and send it again but it never makes to the wire. (see attached packet capture) I found this while working on #26341. I did not test Digest-Auth. Also note that curl will send Proxy-Authorization in first request if proxy auth is set. This may be design decision but it may be worth of verification. It would be unpleasant if we need to double every request. (needs more testing with fetching various documents via same proxy server) 26406 area-System.Security SignedCms extensibility to support external private keys This is an issue to document: https://github.com/dotnet/designs/issues/11#issuecomment-336327669 The core issue is that there's no way to use anything other than an X509Certificate2 to provide the signatures needed within the SignedCms types. There are cases where the private key is not accessible via a CSP where the signing must be handled by a provided function. A concrete example is wanting to use SignedCms with certificates in Azure Key Vault. There is no way to do this with SignedCms today, so I have to rely on BouncyCastle for this. It is very painful/complicated to use the BouncyCastle API’s compared to doing the same thing with the built-in logic should it have the right extensibility points. A starting proposal from the linked discussion suggests `CmsSigner` taking an `AsymetricSignatureFormatter`. I believe that could ultimately meet the needs here. An easy implementation to meet the Key Vault example could use the `RSAPKCS1SignatureFormatter` formatter and use a custom RSA-derived type in its `SetKey(AsymmetricAlgorithm)` method. The hard part will be the .NET Framework implementation, which uses the `CryptMsg*` API's. EDIT by @krwq: API proposal: ```diff namespace System.Security.Cryptography.Pkcs { public sealed partial class CmsSigner { + public CmsSigner(SubjectIdentifierType signerIdentifierType, System.Security.Cryptography.X509Certificates.X509Certificate2 certificate, System.Security.Cryptography.AsymmetricAlgorithm privateKey) => throw null; + public System.Security.Cryptography.AsymmetricAlgorithm PrivateKey { get => throw null; set => throw null; } } } ``` 26407 area-System.Linq LINQ.Expressions Power operator and BigInteger or Complex or custom _From @DjArt on May 26, 2017 8:58_ Building expression with two BigInteger or Complex variables will fail, because it's call Math.Pow method. How about add new operator op_Power for overloading and call it when we use Power in LINQ? _Copied from original issue: dotnet/coreclr#11931_ 26408 area-System.Threading Awaiting multiple Tasks with different results _From @Meir017 commented on Aug 28, 2017_ I know it's possible to create a class with this feature - https://stackoverflow.com/questions/17197699/awaiting-multiple-tasks-with-different-results#answer-40938652 It would be nice to have this in the class `Task` _Copied from original issue: dotnet/coreclr#13632_ 26409 area-System.Data removed active issue tag on unit tests Removed `ActiveIssue` tag on those unit tests since they were resolved. 26411 area-System.Linq Support op_Exponent and op_Exponentiation in S.L.Expressions As discussed in https://github.com/dotnet/corefx/issues/26407#issuecomment-358619986 VB uses `op_Exponent` for exponentiation and F# uses `op_Exponentiation` for the same thing (the inconsistency is unfortunate). Ideally S.L.Expressions should look for these operators in `Expression.Power`, much as it looks for the operators directly supported by C# in such methods as `Expression.Multiply`, etc. 26412 area-System.Runtime Make System.HashCode available as standalone nuget package The new `System.HashCode` type seems to be distributed as part of the core runtime (Based on this [Comment](https://github.com/dotnet/corefx/issues/14354#issuecomment-358447233) by @morganbr in #14354). > The implementation is in System.Private.CoreLib.dll, so it would come as part of the runtime package. The contract is System.Runtime.dll. `System.HashCode` could could benefit a wider audience, if it is distributed as standalone (.netstandard based) package. Every .NET developer on every platform sooner or later faces the problem to implement `GetHashCode` and doing so is fraught with pitfalls (there are more than 350 comments in total in this repro alone discussing a good hash code algorithm and a good API to expose it). Therefore an official standalone package with a good general purpose algorithm and a well designed API would be much appreciated. (I would even suggest to make `System.HashCode` part of .netstandard, but that's another topic). 26413 area-System.Linq Support op_Exponent and op_Exponentiation in S.L.Expressions Provides better support within `Expression.Power` for VB and F# which produce these operators. Fixes #26411 26414 area-Microsoft.CSharp Refactor MS.CSharp's CType In particular, replacing getter methods with properties, members that lookup their own type with virtual members, and having more state init-only. * Remove name from `CType`. Only used in `TypeParameterType`, and there can be done by delegating to symbol. * Make `CType.Get/SetTypeKind` init-only property. * Have singleton `CType`s control their own singleton instances. * Initial `AggregateType` state as init-only properties * `TypeParameterType` state to init-only property. All other getter methods to properties. * `ArrayType` state as auto-properties. Other getter method as property. * `PointerType` state to init-only auto-properties. * `ParameterModifierType` state to init-only auto properties * `NullableType` state to init-only auto properties. * Remove `TypeFactory` No state or returning of derived types to benefit from factory pattern. * Don't use names in `TypeTable` lookups. The names are created to reflect properties of the type, but just use the values of those properties directly. * Don't branch on result of `TryGet` within `TypeTable` In case of failure out parameter is guaranteed to be null, so no need to branch just to return null. * Replace `getAggregate()` calls with `OwningAggregate` where feasible. Avoid cast, or move cast closer to where it is deemed safe. Greater type-safety. * `CType.IsRefType()` to virtual property. * `IsNonNubValType()` and `IsValType()` to virtual properties * `IsStaticClass()` to virtual member. Note that while in source code an array, parameter modifier or pointer can be of a static type due to an error in the source, these types can never be static in dynamic code. * Remove arguments to `CheckForStaticClass` that are always the same. * `isPredefined` and `getPredefType` to virtual properties. * `isPredefType()` to virtual instead of type-testing. * `isUnsafe` to virtual instead of type-testing. * Several Aggregate-only methods to virtual properties. * Move `IsCollectionType` to only derived type that uses it. Optimise to skip tests it can't pass. * Make `AssociatedSystemType` virtual instead of testing types. Only memoise in `AggregateType` as it's not as expensive elsewhere. * Make `GetBaseOrParameterOrElementType` virtual property. * `IsWindowsRuntimeType` to property. * Remove `underlyingType()` All uses can be safely replaced with `UnderlyingEnumType` and name clashes with `UnderlyingType` property elsewhere. * Remove more uses of `getAggregate()` One is within a branch for a test that is only true for `AggregateType`s. Another goes from an enum to the underlying before using `Type.GetTypeCode()` on the system type, but `Type.GetTypeCode()` will behave the same on the enum type anyway. * `IsUnsigned` to virtual property. * `fundType()` to virtual property * `constValKind` to virtual property. * `AggregateType.GetIfacesAll` to property. * `AggregateType.GetBaseClass` to property * Remove `CheckConstraintsFlags.NoDupErrors` Checked for, but never set. * Merge `AggregateType.fConstraintsChecked` and `fConstraintError` into single `bool?` * Don't recheck constraints if exception not necessary. Akin to the removed `NoDupErrors` but where that prevented repeated messages in a static compilation, with dynamic code we can depend on the cached value from previous operations. * Change field names to not use Hungarian notation. * Short-circuit on constraints checking. The non–short-circuiting behaviour is a legacy of the times the static compiler would want to emit multiple error messages. The dynamic compiler will already short-circuit for error-emitting cases as the exception will cut the operation short, but it should also short-circuit for non–error-emitting cases too. 26415 area-System.Net Added missing status code 429 Too Many Requests This enumeration is missing HTTP status code 429 Too Many Requests - this is used by many rate-limited services to indicate that the current allocation has been exceeded. For example the British government's companies registry service does this: https://developer.companieshouse.gov.uk/api/docs/index/gettingStarted/rateLimiting.html .NET should be able to handle and create responses with this status code. 26416 area-System.Numerics Vector3 direction and Plane distance "SIMD-Enabled types are poorly documented, so I need to ask about two things: 1. Vectors are defined by only one point . Does this mean that its direction is from the origin point to that point? 2. The Plane structure is defined by a Vector3 normal to it and a distance. If normal vector starts from the origin to a point on the plane surface, why do we need a distance? What does it mean? Or if the point of the vector is not on the plane surface, what does it mean? Maybe I miss something, but as I said, documents doesn't help. So, what do you really mean with this implementation? 3. I suggest adding a constructor to the Plane Structure, that has one parameter ""normal"" of type Vector3. It can get the distance frome: d = normal.Length. This is usefull when we know the intersection point of the normal vector with the plane. And please, make the documantaion more detailed. Thanks." 26417 area-Microsoft.CSharp "Remove test for ""wrong nested this"" in Microsoft.CSharp" Since we have dynamically found a member by examining a type or the type of an object, it can never not be nor be derived from the type the member was found on, unlike in the static binding when where lookup can include outer classes, (with CS0038 resulting if the member found isn't static). Remove the test, which involves removing `ERR_WrongNestedThis`, contributing to #22470 26418 area-System.Runtime Implementation of IStructuralEquatable.GetHashCode in Array class should sample from head and tail The implementation makes a strong assumption that only the last 8 elements of the array are relevant for computing a hashcode. We consciously put our maximal entropy bytes at the *beginning* of the array because that's how numbers and strings work. (Think lexicographical sorting and a bookshelf) 26420 area-Infrastructure Removing uapvNext assets where there shouldn't be cc: @ericstj @weshaggard There are OOB packages that have uap vnext assets which already ship inbox, so by removing them we are now able to change the API surface using the netstandard asset if needed after a UAP release. 26421 area-System.Net *NO MERGE* Dirty forced repro for #23769 ** NO MERGE ** just intended to see potential impact of the same cause identified on the bug #23769. 26423 area-System.Drawing System.Drawing.Common.Tests Failure "I am using Windows 10 x64 and VS 2017. *testResults.xml*: ``` <test name=""System.Drawing.Tests.SystemFontsTests.SystemFont_Get_ReturnsExpected_WindowsNames(getFont: Func`1 { Method = System.Drawing.Font <SystemFonts_WindowsNames_TestData>b__2_0(), Target = <>c { } }, systemFontName: \"CaptionFont\", windowsFontName: \"Segoe UI\")"" type=""System.Drawing.Tests.SystemFontsTests"" method=""SystemFont_Get_ReturnsExpected_WindowsNames"" time=""0.0048151"" result=""Fail""> <traits> <trait name=""category"" value=""nonlinuxtests"" /> <trait name=""category"" value=""nonosxtests"" /> <trait name=""category"" value=""nonfreebsdtests"" /> <trait name=""category"" value=""nonnetbsdtests"" /> </traits> <failure exception-type=""Xunit.Sdk.EqualException""> <message><![CDATA[Assert.Equal() Failure\r\n ↓ (pos 0)\r\nExpected: Segoe UI\r\nActual: Yu Gothic UI\r\n ↑ (pos 0)]]></message> <stack-trace><![CDATA[ at System.Drawing.Tests.SystemFontsTests.SystemFont_Get_ReturnsExpected_WindowsNames(Func`1 getFont, String systemFontName, String windowsFontName) in C:\Users\plato\source\repos\corefx\src\System.Drawing.Common\tests\SystemFontsTests.cs:line 74]]></stack-trace> </failure> </test> <test name=""System.Drawing.Tests.SystemFontsTests.SystemFont_Get_ReturnsExpected_WindowsNames(getFont: Func`1 { Method = System.Drawing.Font <SystemFonts_WindowsNames_TestData>b__2_1(), Target = <>c { } }, systemFontName: \"IconTitleFont\", windowsFontName: \"Segoe UI\")"" type=""System.Drawing.Tests.SystemFontsTests"" method=""SystemFont_Get_ReturnsExpected_WindowsNames"" time=""0.0012577"" result=""Fail""> <traits> <trait name=""category"" value=""nonlinuxtests"" /> <trait name=""category"" value=""nonosxtests"" /> <trait name=""category"" value=""nonfreebsdtests"" /> <trait name=""category"" value=""nonnetbsdtests"" /> </traits> <failure exception-type=""Xunit.Sdk.EqualException""> <message><![CDATA[Assert.Equal() Failure\r\n ↓ (pos 0)\r\nExpected: Segoe UI\r\nActual: Yu Gothic UI\r\n ↑ (pos 0)]]></message> <stack-trace><![CDATA[ at System.Drawing.Tests.SystemFontsTests.SystemFont_Get_ReturnsExpected_WindowsNames(Func`1 getFont, String systemFontName, String windowsFontName) in C:\Users\plato\source\repos\corefx\src\System.Drawing.Common\tests\SystemFontsTests.cs:line 74]]></stack-trace> </failure> </test> <test name=""System.Drawing.Tests.SystemFontsTests.SystemFont_Get_ReturnsExpected_WindowsNames(getFont: Func`1 { Method = System.Drawing.Font <SystemFonts_WindowsNames_TestData>b__2_2(), Target = <>c { } }, systemFontName: \"MenuFont\", windowsFontName: \"Segoe UI\")"" type=""System.Drawing.Tests.SystemFontsTests"" method=""SystemFont_Get_ReturnsExpected_WindowsNames"" time=""0.0015534"" result=""Fail""> <traits> <trait name=""category"" value=""nonlinuxtests"" /> <trait name=""category"" value=""nonosxtests"" /> <trait name=""category"" value=""nonfreebsdtests"" /> <trait name=""category"" value=""nonnetbsdtests"" /> </traits> <failure exception-type=""Xunit.Sdk.EqualException""> <message><![CDATA[Assert.Equal() Failure\r\n ↓ (pos 0)\r\nExpected: Segoe UI\r\nActual: Yu Gothic UI\r\n ↑ (pos 0)]]></message> <stack-trace><![CDATA[ at System.Drawing.Tests.SystemFontsTests.SystemFont_Get_ReturnsExpected_WindowsNames(Func`1 getFont, String systemFontName, String windowsFontName) in C:\Users\plato\source\repos\corefx\src\System.Drawing.Common\tests\SystemFontsTests.cs:line 74]]></stack-trace> </failure> </test> <test name=""System.Drawing.Tests.SystemFontsTests.SystemFont_Get_ReturnsExpected_WindowsNames(getFont: Func`1 { Method = System.Drawing.Font <SystemFonts_WindowsNames_TestData>b__2_3(), Target = <>c { } }, systemFontName: \"MessageBoxFont\", windowsFontName: \"Segoe UI\")"" type=""System.Drawing.Tests.SystemFontsTests"" method=""SystemFont_Get_ReturnsExpected_WindowsNames"" time=""0.0016577"" result=""Fail""> <traits> <trait name=""category"" value=""nonlinuxtests"" /> <trait name=""category"" value=""nonosxtests"" /> <trait name=""category"" value=""nonfreebsdtests"" /> <trait name=""category"" value=""nonnetbsdtests"" /> </traits> <failure exception-type=""Xunit.Sdk.EqualException""> <message><![CDATA[Assert.Equal() Failure\r\n ↓ (pos 0)\r\nExpected: Segoe UI\r\nActual: Yu Gothic UI\r\n ↑ (pos 0)]]></message> <stack-trace><![CDATA[ at System.Drawing.Tests.SystemFontsTests.SystemFont_Get_ReturnsExpected_WindowsNames(Func`1 getFont, String systemFontName, String windowsFontName) in C:\Users\plato\source\repos\corefx\src\System.Drawing.Common\tests\SystemFontsTests.cs:line 74]]></stack-trace> </failure> </test> <test name=""System.Drawing.Tests.SystemFontsTests.SystemFont_Get_ReturnsExpected_WindowsNames(getFont: Func`1 { Method = System.Drawing.Font <SystemFonts_WindowsNames_TestData>b__2_4(), Target = <>c { } }, systemFontName: \"SmallCaptionFont\", windowsFontName: \"Segoe UI\")"" type=""System.Drawing.Tests.SystemFontsTests"" method=""SystemFont_Get_ReturnsExpected_WindowsNames"" time=""0.0011537"" result=""Fail""> <traits> <trait name=""category"" value=""nonlinuxtests"" /> <trait name=""category"" value=""nonosxtests"" /> <trait name=""category"" value=""nonfreebsdtests"" /> <trait name=""category"" value=""nonnetbsdtests"" /> </traits> <failure exception-type=""Xunit.Sdk.EqualException""> <message><![CDATA[Assert.Equal() Failure\r\n ↓ (pos 0)\r\nExpected: Segoe UI\r\nActual: Yu Gothic UI\r\n ↑ (pos 0)]]></message> <stack-trace><![CDATA[ at System.Drawing.Tests.SystemFontsTests.SystemFont_Get_ReturnsExpected_WindowsNames(Func`1 getFont, String systemFontName, String windowsFontName) in C:\Users\plato\source\repos\corefx\src\System.Drawing.Common\tests\SystemFontsTests.cs:line 74]]></stack-trace> </failure> </test> <test name=""System.Drawing.Tests.SystemFontsTests.SystemFont_Get_ReturnsExpected_WindowsNames(getFont: Func`1 { Method = System.Drawing.Font <SystemFonts_WindowsNames_TestData>b__2_5(), Target = <>c { } }, systemFontName: \"StatusFont\", windowsFontName: \"Segoe UI\")"" type=""System.Drawing.Tests.SystemFontsTests"" method=""SystemFont_Get_ReturnsExpected_WindowsNames"" time=""0.0009904"" result=""Fail""> <traits> <trait name=""category"" value=""nonlinuxtests"" /> <trait name=""category"" value=""nonosxtests"" /> <trait name=""category"" value=""nonfreebsdtests"" /> <trait name=""category"" value=""nonnetbsdtests"" /> </traits> <failure exception-type=""Xunit.Sdk.EqualException""> <message><![CDATA[Assert.Equal() Failure\r\n ↓ (pos 0)\r\nExpected: Segoe UI\r\nActual: Yu Gothic UI\r\n ↑ (pos 0)]]></message> <stack-trace><![CDATA[ at System.Drawing.Tests.SystemFontsTests.SystemFont_Get_ReturnsExpected_WindowsNames(Func`1 getFont, String systemFontName, String windowsFontName) in C:\Users\plato\source\repos\corefx\src\System.Drawing.Common\tests\SystemFontsTests.cs:line 74]]></stack-trace> </failure> </test> ```" 26424 area-System.Xml XsltCompiler.Tests Failure "I am using Windows 10 x64 and VS 2017. *testResults.xml* snippet: ``` <test name=""System.Xml.Tests.XsltcTestFile.Var1(param0: \"@*.txt\", param1: \"fft19.dll\", param2: \"no\", param3: \"fft19\", param4: \"fft19.pdb\", param5: \"no\", param6: \"fft19.txt\")"" type=""System.Xml.Tests.XsltcTestFile"" method=""Var1"" time=""0.1938606"" result=""Fail""> <traits> <trait name=""category"" value=""XsltcExeRequired"" /> </traits> <failure exception-type=""OLEDB.Test.ModuleCore.CTestFailedException""> <message><![CDATA[OLEDB.Test.ModuleCore.CTestFailedException : Output was not as expected.]]></message> <stack-trace><![CDATA[ at System.Xml.Tests.XsltcTestCaseBase.CompareOutput(Stream expectedStream, Stream actualStream, Int32 count) in C:\Users\plato\source\repos\corefx\src\System.Private.Xml\tests\Xslt\XsltCompiler\CommonScenarios\XsltcTestCaseBase.cs:line 102 at System.Xml.Tests.XsltcTestCaseBase.VerifyTest(String cmdLine, String asmName, Boolean asmCreated, String typeName, String pdbName, Boolean pdbCreated, String baselineFile, Boolean runAssemblyVerification, Boolean loadFromFile) in C:\Users\plato\source\repos\corefx\src\System.Private.Xml\tests\Xslt\XsltCompiler\CommonScenarios\XsltcTestCaseBase.cs:line 186 at System.Xml.Tests.XsltcTestCaseBase.VerifyTest(String cmdLine, String asmName, Boolean asmCreated, String typeName, String pdbName, Boolean pdbCreated, String baselineFile, Boolean loadFromFile) in C:\Users\plato\source\repos\corefx\src\System.Private.Xml\tests\Xslt\XsltCompiler\CommonScenarios\XsltcTestCaseBase.cs:line 145 at System.Xml.Tests.XsltcTestFile.Var1(Object param0, Object param1, Object param2, Object param3, Object param4, Object param5, Object param6) in C:\Users\plato\source\repos\corefx\src\System.Private.Xml\tests\Xslt\XsltCompiler\CommonScenarios\XsltcTestFile.cs:line 74]]></stack-trace> </failure> </test> ``` *testResults.xml* snippet: ``` <test name=""System.Xml.Tests.XsltcTestSettings.Var1(param0: \"/SETTİNGS:SCRİPT+ sft14.xsl\", param1: \"sft14.dll\", param2: \"no\", param3: \"sft14\", param4: \"sft14.pdb\", param5: \"no\", param6: \"sft14.txt\")"" type=""System.Xml.Tests.XsltcTestSettings"" method=""Var1"" time=""0.1789098"" result=""Fail""> <traits> <trait name=""category"" value=""XsltcExeRequired"" /> </traits> <failure exception-type=""OLEDB.Test.ModuleCore.CTestFailedException""> <message><![CDATA[OLEDB.Test.ModuleCore.CTestFailedException : Output was not as expected.]]></message> <stack-trace><![CDATA[ at System.Xml.Tests.XsltcTestCaseBase.CompareOutput(Stream expectedStream, Stream actualStream, Int32 count) in C:\Users\plato\source\repos\corefx\src\System.Private.Xml\tests\Xslt\XsltCompiler\CommonScenarios\XsltcTestCaseBase.cs:line 102 at System.Xml.Tests.XsltcTestCaseBase.VerifyTest(String cmdLine, String asmName, Boolean asmCreated, String typeName, String pdbName, Boolean pdbCreated, String baselineFile, Boolean runAssemblyVerification, Boolean loadFromFile) in C:\Users\plato\source\repos\corefx\src\System.Private.Xml\tests\Xslt\XsltCompiler\CommonScenarios\XsltcTestCaseBase.cs:line 186 at System.Xml.Tests.XsltcTestCaseBase.VerifyTest(String cmdLine, String asmName, Boolean asmCreated, String typeName, String pdbName, Boolean pdbCreated, String baselineFile, Boolean loadFromFile) in C:\Users\plato\source\repos\corefx\src\System.Private.Xml\tests\Xslt\XsltCompiler\CommonScenarios\XsltcTestCaseBase.cs:line 145 at System.Xml.Tests.XsltcTestSettings.Var1(Object param0, Object param1, Object param2, Object param3, Object param4, Object param5, Object param6) in C:\Users\plato\source\repos\corefx\src\System.Private.Xml\tests\Xslt\XsltCompiler\CommonScenarios\XsltcTestSettings.cs:line 67]]></stack-trace> </failure> </test> ``` *testResults.xml* snippet: ``` <test name=""System.Xml.Tests.XsltcTestBasicFunctionality.Var2(param0: \"bft15a.xsl bft15b.xsl\", param1: \"bft15.txt\")"" type=""System.Xml.Tests.XsltcTestBasicFunctionality"" method=""Var2"" time=""0.2665357"" result=""Fail""> <traits> <trait name=""category"" value=""XsltcExeRequired"" /> </traits> <failure exception-type=""OLEDB.Test.ModuleCore.CTestFailedException""> <message><![CDATA[OLEDB.Test.ModuleCore.CTestFailedException : Output was not as expected.]]></message> <stack-trace><![CDATA[ at System.Xml.Tests.XsltcTestCaseBase.CompareOutput(Stream expectedStream, Stream actualStream, Int32 count) in C:\Users\plato\source\repos\corefx\src\System.Private.Xml\tests\Xslt\XsltCompiler\CommonScenarios\XsltcTestCaseBase.cs:line 102 at System.Xml.Tests.XsltcTestCaseBase.VerifyTest(String cmdLine, String asmName, Boolean asmCreated, String typeName, String pdbName, Boolean pdbCreated, String baselineFile, Boolean runAssemblyVerification, Boolean loadFromFile) in C:\Users\plato\source\repos\corefx\src\System.Private.Xml\tests\Xslt\XsltCompiler\CommonScenarios\XsltcTestCaseBase.cs:line 186 at System.Xml.Tests.XsltcTestCaseBase.VerifyTest(String cmdLine, String asmName, Boolean asmCreated, String typeName, String pdbName, Boolean pdbCreated, String baselineFile, Boolean loadFromFile) in C:\Users\plato\source\repos\corefx\src\System.Private.Xml\tests\Xslt\XsltCompiler\CommonScenarios\XsltcTestCaseBase.cs:line 145 at System.Xml.Tests.XsltcTestCaseBase.VerifyTest(String cmdLine, String asmName, Boolean asmCreated, String typeName, String baselineFile, Boolean loadFromFile) in C:\Users\plato\source\repos\corefx\src\System.Private.Xml\tests\Xslt\XsltCompiler\CommonScenarios\XsltcTestCaseBase.cs:line 140 at System.Xml.Tests.XsltcTestCaseBase.VerifyTest(String cmdLine, String baselineFile, Boolean loadFromFile) in C:\Users\plato\source\repos\corefx\src\System.Private.Xml\tests\Xslt\XsltCompiler\CommonScenarios\XsltcTestCaseBase.cs:line 135 at System.Xml.Tests.XsltcTestBasicFunctionality.Var2(Object param0, Object param1) in C:\Users\plato\source\repos\corefx\src\System.Private.Xml\tests\Xslt\XsltCompiler\CommonScenarios\XsltcTestBasicFunctionality.cs:line 43]]></stack-trace> </failure> </test> ```" 26425 area-Infrastructure SegFault in Alpine 3.6 CoreFX build @dotnet-mc-bot commented on [Wed Jan 17 2018](https://github.com/dotnet/core-eng/issues/2423) Build : Master - 20180117.01 (Product Build) Failing configurations: - Alpine3.6 - x64 [Mission Control Build Info](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/build~2Fproduct~2F/build/20180117.01/workItem/Orchestration/analysis/external/Link) Intermittent issue, opening this to track it as well as ping Jan V about it. 26426 area-System.Net Not Stripping Auth in HttpClientHandler redirects by default "In net 461 if a basic auth header is included using httpclient/httprequestmessage `req.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue(""Basic"", base64EncodedString);` And the response of the request is redirect (say 302) then the client will automatically redirect by default but will strip the auth header from the request to the new location. IN dotnet 2.0 on windows redirect is still automatic but the auth header is not stripped. This is bad beause 1) the redirect may be a different host who shouldn't have the credentials. 2) the redirect might already have auth in the queryparams (sas token) and reject a valid request because there are now two types of auth. This is the case when querying some visualstudio.com api;s. You can repo this with dotnet 2 by creating a console app that queries something that will redirect and then watching the fiddler traces. Switching from netcoreapp2.0 to net461 will change the behavior. ``` dotnet --version 2.1.2 ``` Here's a gist that you can use to repo this. https://gist.github.com/paulgmiller/403904c387f7e282d611ec86abd2cb1a Have another internal thread with visualstudio.com examples. " 26427 area-System.Memory Add string slicing extension methods. https://github.com/dotnet/corefx/issues/24072 26428 area-System.Net Test: ignore specific WinHttpException on old Windows versions The root cause issue was already fixed in Windows but old versions still hit this issue. This change makes the intermittently failing test to ignore the known issue on these old Windows versions. Fixes #7812 (just so GH closes the issue at merge time, the actual issue was fixed in Windows). 26429 area-System.Net Use ManagedWebSocket implementation everywhere except uap. fixes #9503 cc @karelz @davidsh @wfurt @stephentoub 26430 area-System.Globalization Expose CharUnicodeInfo.GetUnicodeCategory(int) This change depends on the coreclr change https://github.com/dotnet/coreclr/pull/15911 26431 area-System.Diagnostics Support Process.Start as a different user on Unix. The most common use case is to de-escalate privileges from a privileged process to a normal process. Part of #26268 @safern and @tarekgh - I'm not sure who owns the RemoteExecution stuff, but could you guys give it a look? /cc @arunjvs 26432 area-System.Runtime Adding the `Vector64<T>` type to the S.R.Intrinsics assembly FYI. @sdmaclea, @eerhardt 26433 area-System.Runtime Add Sse2.MoveMask that takes Vector128<byte> Today we have overloads for Avx2.MoveMask for both sbyte and byte vectors. * `Avx2.MoveMask(Vector256<sbyte> value)` * `Avx2.MoveMask(Vector256<byte> value)` but for Sse2, we only have overloads for sbyte. * `Sse2.MoveMask(Vector128<sbyte> value)` We should add an Sse2.MoveMask overload that takes a `Vector128<byte>` as well. /cc @fiigii @tannergooding @CarolEidt 26434 area-System.Net HttpClient redirection for POST is different between Windows and Unix "The redirection issue was initially reported in #22707 but it was closed as duplicate #9228, however, the redirection issue was never addressed. The discussion below refers to the test [AllowAutoRedirect_True_ValidateNewMethodUsedOnRedirection](https://github.com/dotnet/corefx/blob/dbfa1ebe3f41090c525990d4887bd64574b5124b/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.cs#L575). On Unix, when `UseManagedHandler` is false, the test is failing consistently with the `(statusCode = 300, oldMethod = ""POST"", newMethod = ""GET"")` which is expected per curl documentation, since the original method won't be changed in this case: > [When following a Location:, the 3xx response code that redirected it also dictates which request method it will use in the subsequent request: For 301, 302 and 303 responses libcurl will switch method to GET unless CURLOPT_POSTREDIR instructs libcurl otherwise. All other 3xx codes will make libcurl send the same method again.](https://curl.haxx.se/libcurl/c/CURLOPT_FOLLOWLOCATION.html) Do we want to match the redirection behavior expected in the test case on Unix? If yes, it seems that we will have to handle the redirection, at least for POST. " 26435 area-System.Net Fix bug with SslStream Read behavior. Recent refactoring of Sslstream methods from apm to task introduced a bug with Read behavior. In full framework and previous code, we never returned -1 from SslStream.Read. If there was a renegotiation request from server, we just looped until we read 0 or some decrypted bytes. With the current refactoring, SslStream.Read returns -1 in case of renegotiation. Fixing the code to match old behavior, but because of this there's no good way to test for renegotiation as now Read will only return 0 or the decrypted bytes count. Although under the debugger we can see that the renegotiation codepath is hit. The negative test with AllowRenegotiation=false, should terminate the ssl connection, when the client receives a renegotiation request from server. This test works as expected, throwing IOException in Read, and is already part of the test project. This can be sufficient to prove that the renegotiation codepath is exercised, along with these positive tests, hitting the same server with similar request parameters. fixes #26213 cc @stephentoub @karelz @wfurt @Drawaes 26436 area-System.Runtime Regression test for AM/PMDesignator handling Regression test for https://github.com/dotnet/coreclr/issues/15896 This PR will fail until corefx pulls coreclr which has this merged: https://github.com/dotnet/coreclr/pull/15904 (https://github.com/dotnet/coreclr/commit/734a8d7612237b4fab066957318345b5b7b157fe) cc: @wstaelens 26439 area-Infrastructure Add missing RIDs for all supported OSes This adds all of the RIDs that were identified as missing in #23699. This covers all of the OSes listed in https://github.com/dotnet/core/blob/master/release-notes/2.0/2.0-supported-os.md In addition to there being versions missing for existing RIDs, there was no RID defined for SUSE Enterprise Linux at all, so I added that as well, mirroring the `opensuse` section. @weshaggard I wasn't sure what the correct branch for this should be, so I went ahead and based it against master. Let me know if it should be something else, and I'll fix it up. 26441 area-System.Net Update Official HttpStatusCode We should update current [HttpStatusCode](https://github.com/dotnet/corefx/blob/bffef76f6af208e2042a2f27bc081ee908bb390b/src/System.Net.Primitives/src/System/Net/HttpStatusCode.cs) to include more official status codes defined in recent RFCs. ## Proposed API ```diff public enum HttpStatusCode { // Informational 1xx Continue = 100, SwitchingProtocols = 101, + Processing = 102, + EarlyHints = 103, // Successful 2xx OK = 200, Created = 201, Accepted = 202, NonAuthoritativeInformation = 203, NoContent = 204, ResetContent = 205, PartialContent = 206, + MultiStatus = 207, + AlreadyReported = 208, + IMUsed = 226, // Redirection 3xx MultipleChoices = 300, Ambiguous = 300, MovedPermanently = 301, Moved = 301, Found = 302, Redirect = 302, SeeOther = 303, RedirectMethod = 303, NotModified = 304, UseProxy = 305, Unused = 306, TemporaryRedirect = 307, RedirectKeepVerb = 307, + PermanentRedirect = 308, // Client Error 4xx BadRequest = 400, Unauthorized = 401, PaymentRequired = 402, Forbidden = 403, NotFound = 404, MethodNotAllowed = 405, NotAcceptable = 406, ProxyAuthenticationRequired = 407, RequestTimeout = 408, Conflict = 409, Gone = 410, LengthRequired = 411, PreconditionFailed = 412, RequestEntityTooLarge = 413, RequestUriTooLong = 414, UnsupportedMediaType = 415, RequestedRangeNotSatisfiable = 416, ExpectationFailed = 417, + ImATeapot = 418, + MisdirectedRequest = 421, + UnprocessableEntity = 422, + Locked = 423, + FailedDependency = 424, UpgradeRequired = 426, + PreconditionRequired = 428, + TooManyRequests = 429, + RequestHeaderFieldsTooLarge = 431, + UnavailableForLegalReasons = 451, // Server Error 5xx InternalServerError = 500, NotImplemented = 501, BadGateway = 502, ServiceUnavailable = 503, GatewayTimeout = 504, HttpVersionNotSupported = 505, + VariantAlsoNegotiates = 506, + InsufficientStorage = 507, + LoopDetected = 508, + NotExtended = 510, + NetworkAuthenticationRequired = 511, } ``` ## Details Values added from WinRT: Windows.Web.Http.HttpStatusCode: ``` AlreadyReported FailedDependency IMUsed InsufficientStorage Locked LoopDetected MultiStatus NetworkAuthenticationRequired None (not sure what's this, not added) NotExtended PermanentRedirect PreconditionRequired Processing RequestHeaderFieldsTooLarge TooManyRequests UnprocessableEntity VariantAlsoNegotiates ``` RFC 2324: ``` ImATeapot ``` RFC 7450: ``` MisdirectedRequest ``` RFC 7725: ``` UnavailableForLegalReasons ``` RFC 8297: ``` EarlyHints ``` Related issue: #4382 /cc: @davidsh @karelz 26443 area-System.Net Test failed: System.Net.Sockets.Tests.SocketOptionNameTest / MulticastInterface_Set_IPv6_AnyInterface_Succeeds ## Types of failure ``` Waiting for received data timed out Expected: True Actual: False at System.Net.Sockets.Tests.SocketOptionNameTest.<MulticastInterface_Set_IPv6_Helper>d__12.MoveNext() in /root/corefx-1299519/src/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs:line 208 at System.Net.Sockets.Tests.SocketOptionNameTest.<MulticastInterface_Set_IPv6_AnyInterface_Succeeds>d__10.MoveNext() in /root/corefx-1299519/src/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs:line 163 --- End of stack trace from previous location where exception was thrown --- ``` ## History of failures Day | Build | OS | Details --- | --- | --- | --- 1/18 | 20180118.04 | RedHat69 | [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180118.04/workItem/System.Net.Sockets.Tests/analysis/xunit/System.Net.Sockets.Tests.SocketOptionNameTest~2FMulticastInterface_Set_IPv6_AnyInterface_Succeeds) 1/19 | 20180119.01 | RedHat69 | [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180119.01/workItem/System.Net.Sockets.Tests/analysis/xunit/System.Net.Sockets.Tests.SocketOptionNameTest~2FMulticastInterface_Set_IPv6_AnyInterface_Succeeds) 1/19 | 20180119.02 | RedHat69 | [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180119.02/workItem/System.Net.Sockets.Tests/analysis/xunit/System.Net.Sockets.Tests.SocketOptionNameTest~2FMulticastInterface_Set_IPv6_AnyInterface_Succeeds) 1/19 | 20180119.04 | RedHat69 | [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180119.04/workItem/System.Net.Sockets.Tests/analysis/xunit/System.Net.Sockets.Tests.SocketOptionNameTest~2FMulticastInterface_Set_IPv6_AnyInterface_Succeeds) 1/19 | 20180119.06 | RedHat69 | [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180119.06/workItem/System.Net.Sockets.Tests/analysis/xunit/System.Net.Sockets.Tests.SocketOptionNameTest~2FMulticastInterface_Set_IPv6_AnyInterface_Succeeds) 1/20 | 20180120.01 | RedHat69 | [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180120.01/workItem/System.Net.Sockets.Tests/analysis/xunit/System.Net.Sockets.Tests.SocketOptionNameTest~2FMulticastInterface_Set_IPv6_AnyInterface_Succeeds) 1/20 | 20180120.02 | RedHat69 | [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180120.02/workItem/System.Net.Sockets.Tests/analysis/xunit/System.Net.Sockets.Tests.SocketOptionNameTest~2FMulticastInterface_Set_IPv6_AnyInterface_Succeeds) 1/21 | 20180121.01 | RedHat69 | [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180121.01/workItem/System.Net.Sockets.Tests/analysis/xunit/System.Net.Sockets.Tests.SocketOptionNameTest~2FMulticastInterface_Set_IPv6_AnyInterface_Succeeds) 1/21 | 20180121.02 | RedHat69 | [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180121.02/workItem/System.Net.Sockets.Tests/analysis/xunit/System.Net.Sockets.Tests.SocketOptionNameTest~2FMulticastInterface_Set_IPv6_AnyInterface_Succeeds) 1/22 | 20180122.01 | RedHat69 | [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180122.01/workItem/System.Net.Sockets.Tests/analysis/xunit/System.Net.Sockets.Tests.SocketOptionNameTest~2FMulticastInterface_Set_IPv6_AnyInterface_Succeeds) 1/22 | 20180122.02 | RedHat69 | [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180122.02/workItem/System.Net.Sockets.Tests/analysis/xunit/System.Net.Sockets.Tests.SocketOptionNameTest~2FMulticastInterface_Set_IPv6_AnyInterface_Succeeds) 26446 area-System.Net HttpClient with mutual TLS on macOS High Sierra - does not support client authentication (Libcurl/LibreSSL problems) "I have the following error in my netstandard2 class library: ``` The handler does not support client authentication certificates with this combination of libcurl (7.54.0) and its SSL backend (""LibreSSL/2.0.20"") ``` I installed the newest version of Curl with OpenSSL through Homebrew and: `which curl` gives `/usr/local/bin/`, and `curl --version` gives `curl 7.57.0 (x86_64-apple-darwin17.2.0) libcurl/7.57.0 OpenSSL/1.0.2n zlib/1.2.11`. This does not change the version of Curl being run through my class library. I have now been reading and testing the possible solutions in #9728, #24232 and ended up with #19718 stating that custom certificate handling will be fixed in netcore 2.1. Do I have to wait till this fix propagates into netstandard? Is my problem just related to me not being able to change the version of libcurl being executed, or do I have a dead end? Pardon if the solution is obvious, I have tried for almost a day with outdated and more recent answers of the related posts. " 26447 area-System.Collections Adding a null value to ConcurrentDictionary using System.Collections.IDictionary interface causes exception "According to the code in [ConcurrentDictionary](https://github.com/dotnet/corefx/blame/master/src/System.Collections.Concurrent/src/System/Collections/Concurrent/ConcurrentDictionary.cs#L1580) it is not possible to add a null value to ConcurrentDictionary using System.Collections.IDictionary interface. Is this type checking for a value really required? Examples: ```c# var key = ""key""; string value = null; { // using ConcurrentDictionary<TKey, TValue> class ConcurrentDictionary<string, string> d = new ConcurrentDictionary<string, string>(); d[key] = value; // OK } { // using IDictionary<TKey, TValue> interface IDictionary<string, string> d = new ConcurrentDictionary<string, string>(); d[key] = value; // OK } { // using IDictionary interface IDictionary d = new ConcurrentDictionary<string, string>(); d[key] = value; // ArgumentException - The value was of an incorrect type for this dictionary. } ```" 26448 area-System.Collections set null value with indexer for concurrent dictionary Fix #26447 26449 area-System.Memory Span<T> GetHashCode Currenty `Span<T>` throws an exception when calling `GetHashCode`. Why not just returning the `Length` of the `Span`, or fully implementing it with `RuntimeHelpers.GetHashCode(_pinnable)` and `_byteOffset.ToInt64()`? The comment clarifies that `GetHashCode` is not implemented because `Span` cannot be boxed, but I'm using it unboxed in several classes that implement `IEqualityComparer<T>`, and now I have to workaround this exception. Thanks for the insight, Peter 26451 area-System.Runtime Unsafe API for comparing byrefs as pointers S.R.CS.Unsafe should provide operations that allow comparing byrefs. These operations in combination with C# support for ref locals reassigments (Roslyn feature in progress - https://github.com/dotnet/csharplang/blob/master/proposals/ref-local-reassignment.md) will allow significantly more efficient unsafe implementations of low-level algorithms. For example, Span Reverse prototype done by @GrabYourPitchforks showed up to 30% performance improvements (https://github.com/dotnet/corefx/pull/26381#issuecomment-358852586). Proposed API: ``` public static class Unsafe { // Returns true when left is pointing to lower memory address than right public static bool IsBelow<T>(ref T left, ref T right); // Returns true when left is pointing to higher memory address than right public static bool IsAbove<T>(ref T left, ref T right); } ``` 26452 area-System.Net NRE/Segfault in System.Net.Sockets tests on CI https://mc.dot.net/#/user/danmosemsft/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/42e1badb4aca967a9bf44bb116a532ba73907fff/workItem/System.Net.Sockets.Tests/wilogs ``` 2018-01-19 07:13:06,552: INFO: proc(54): run_and_log_output: Output: Starting: System.Net.Sockets.Tests 2018-01-19 07:13:06,961: INFO: proc(54): run_and_log_output: Output: 2018-01-19 07:13:06,964: INFO: proc(54): run_and_log_output: Output: Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. 2018-01-19 07:13:06,965: INFO: proc(54): run_and_log_output: Output: at System.Net.Sockets.SocketAsyncContext.AcceptOperation.InvokeCallback() in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/src/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncContext.Unix.cs:line 543 2018-01-19 07:13:06,966: INFO: proc(54): run_and_log_output: Output: at System.Net.Sockets.SocketAsyncContext.OperationQueue`1.ProcessQueue(SocketAsyncContext context) in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/src/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncContext.Unix.cs:line 947 2018-01-19 07:13:06,966: INFO: proc(54): run_and_log_output: Output: at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) in /root/coreclr/src/mscorlib/shared/System/Threading/ExecutionContext.cs:line 151 2018-01-19 07:13:06,966: INFO: proc(54): run_and_log_output: Output: at System.Threading.ThreadPoolWorkQueue.Dispatch() in /root/coreclr/src/mscorlib/src/System/Threading/ThreadPool.cs:line 588 2018-01-19 07:13:10,427: INFO: proc(54): run_and_log_output: Output: /home/helixbot/dotnetbuild/work/5c4cfc68-2fd2-4829-b24a-3fd5bb05d287/Work/114dfc4a-d702-4db3-ae87-97330e05be36/Unzip/RunTests.sh: line 87: 85261 Aborted (core dumped) $RUNTIME_PATH/dotnet xunit.console.netcore.exe System.Net.Sockets.Tests.dll -xml testResults.xml -notrait Benchmark=true -notrait category=nonnetcoreapptests -notrait category=nonlinuxtests -notrait category=OuterLoop -notrait category=failing 2018-01-19 07:13:54,754: INFO: proc(54): run_and_log_output: Output: processing dump file /home/helixbot/dotnetbuild/work/5c4cfc68-2fd2-4829-b24a-3fd5bb05d287/Work/114dfc4a-d702-4db3-ae87-97330e05be36/Unzip/core.85261 ``` https://dumpling.azurewebsites.net/api/dumplings/archived/a7435cfa4bbacb58ae78a2d15df620474bb8126f ## History of failure Day | Build | OS | Details -- | -- | -- | -- 1/9 | 20180109.02 | Fedora25 | [logs](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180109.02/workItem/System.Net.Sockets.Tests/wilogs) 1/13 | 20180113.01 | Fedora26 | [logs](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180113.01/workItem/System.Net.Sockets.Tests/wilogs) 1/19 | PR | RedHat73 | [logs](https://mc.dot.net/#/user/danmosemsft/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/42e1badb4aca967a9bf44bb116a532ba73907fff/workItem/System.Net.Sockets.Tests/wilogs) and [dump](https://dumpling.azurewebsites.net/api/dumplings/archived/a7435cfa4bbacb58ae78a2d15df620474bb8126f) 1/22 | 20180122.02 | Suse42.2 | [logs](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180122.02/workItem/System.Net.Sockets.Tests/wilogs) 26453 area-System.Net Managed HttpConnection pooling for redirection In the case of redirection for GET and PUT the connections are not being pooled. For HEAD there is a race condition that causes error if the connection is actually reused. The intermittent failures on [AllowAutoRedirect_True_ValidateNewMethodUsedOnRedirection](https://github.com/dotnet/corefx/issues/23769) happen for HEAD requests in the following way: * In this test the HttpConnection used to serve HEAD requests are returned to the pool during the execution of SendAsync. Connections for GET and POST are not returned to the respective [HttpConnectionPool](https://github.com/dotnet/corefx/blob/67d240ed07342544cd5c09d1765952fe8c9d9036/src/System.Net.Http/src/System/Net/Http/Managed/HttpConnection.cs#L381). * When a connection goes back to the pool it triggers a [read ahead task on the connection object](https://github.com/dotnet/corefx/blob/67d240ed07342544cd5c09d1765952fe8c9d9036/src/System.Net.Http/src/System/Net/Http/Managed/HttpConnection.cs#L1145). * Later the pool is checked via [GetConnectionAsync](https://github.com/dotnet/corefx/blob/67d240ed07342544cd5c09d1765952fe8c9d9036/src/System.Net.Http/src/System/Net/Http/Managed/HttpConnectionPool.cs#L66) if the read ahead task has not yet completed then the connection is re-used, see [IsUsable()](https://github.com/dotnet/corefx/blob/67d240ed07342544cd5c09d1765952fe8c9d9036/src/System.Net.Http/src/System/Net/Http/Managed/HttpConnectionPool.cs#L508). * Reusing the connection triggers a call to [FillAsync](https://github.com/dotnet/corefx/blob/67d240ed07342544cd5c09d1765952fe8c9d9036/src/System.Net.Http/src/System/Net/Http/Managed/HttpConnection.cs#L908) that tries to get data from the completed [read async task](https://github.com/dotnet/corefx/blob/67d240ed07342544cd5c09d1765952fe8c9d9036/src/System.Net.Http/src/System/Net/Http/Managed/HttpConnection.cs#L941) but it returns zero and triggers an [IOException](https://github.com/dotnet/corefx/blob/67d240ed07342544cd5c09d1765952fe8c9d9036/src/System.Net.Http/src/System/Net/Http/Managed/HttpConnection.cs#L962). Reliable way to force the error described above can be found in #26421 26454 area-System.Net DownloadProgressChangedEventArgs.TotalBytesToReceive does not use the Content Length header ProgressPercentage is always zero and TotalBytesToReceive is -1 during the download. The variable contentLength is never assigned to _progress.TotalBytesToReceive in WebClient's DownloadBitsAsync method. 26455 area-System.Net Fix HTTP Status line parsing to be more tolerant of white space "HTTP status line has a optional status description field, i.e., ""HTTP/1.1 200 OK"", ""OK"" is the StatusDescription. From RFC 7230: 3.1.2. Status Line > The first line of a response message is the status-line, consisting of the protocol version, a space (SP), the status code, another space, a possibly empty textual phrase describing the status code, and ending with CRLF. So a valid HTTP status line without status description should like this: ""HTTP/1.1 200 "" (contains a space at the end, which ASCII value is 0x20). However, Fiddler will trim out the white space at the end, which violate the RFC. Here is the evidence: This is the address used for testing: `http://coastwatch.pfeg.noaa.gov/erddap/wms/jplAmsreSstMon_LonPM180/request?VERSION=1.3.0&SERVICE=WMS&REQUEST=GetCapabilities` Without Fiddler: (notice the space after status code 200)  With Fiddler and do loopback packet capture:  This will cause `NullRefernceException` on .NET Framework under some conditions. (#25741 ) For now, .NET Core doesn't has the same issue, but we should notice this behavior. Since we cannot change how Fiddler works, we need to make our code more robust on dealing with this situation. /cc: @geoffkizer @karelz " 26456 area-Infrastructure .dll in Microsoft.NET.Build.Extensions\net461 targets .NET Framework 4.6.1 _From @jairbubbles on September 27, 2017 10:4_ I just noticed that most .dll in `C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\` directory target .NET Framework 4.7 which does not seem right. Here is a dotPeek screenshot:  _Copied from original issue: dotnet/sdk#1611_ 26457 area-Infrastructure CoreFx assemblies lack the TargetFrameworkAttribute I notice this when looking at https://github.com/dotnet/corefx/issues/26456. It appears to still be the case. Filing here, though the right fix may be in buildtools. 26458 area-System.Numerics Add multi-parameter overloads for Math.Max and Math.Min It would be logical if `Math.Max` and `Math.Min` had overloads for three, four and more parameters. I don't see why don't we have them already. They would be very easy to implement and backwards compatible. ## Rationale When you need a method to take three non-negative `int`s you have to do one of the following: * something like `Math.Min(Math.Min(a,b),c) < 0`, which is really ugly and unreadable * take `uint`s and cast them (which often results in double-casting because you have an `int`, you cast it to `uint` to pass it to the method and it casts it back to `int` again) * check for every parameter separately, which is not very elegant * define your own `Min` method – this is the best solution but because you can't extend static classes, you'll end up with something awkward like `MathExtensions.Min(a,b,c)` But if we had the overloads, we could simply do `Math.Min(a,b,c)` ## Proposed API I'll use a kind of pseudo-code. In actual implementation the `number` would have to be replaced by `int`, `long`, `float`, `double`, ... ```c# public static class Math { public static number Max(number a, number b, number c); public static number Max(number a, number b, number c, number d); public static number Max(params number[] list); public static number Min(number a, number b, number c); public static number Min(number a, number b, number c, number d); public static number Min(params number[] list); } ``` Moved from dotnet/csharplang#1263. 26459 area-System.Net Consider making Expect: 100-continue the default behavior Expect: 100-continue is almost always the right thing to do -- it enables sending stream-only data in the presence of auth or redirects etc. We should strongly consider making this the default behavior. 26460 area-System.Net Support https proxy It is currently not implemented: https://github.com/dotnet/corefx/blob/b265a0f0066dbce3cf4845c25444fe85266c81d0/src/System.Net.Http/src/System/Net/Http/Managed/HttpProxyConnectionHandler.cs#L57-L60 26462 area-System.Net WebClient progress monitoring uses ContentLength header This avoids divide by zero situations and fixes progress monitoring for WebClient's binary async methods. Fixes #26454 26463 area-System.Net Enable ClientAndServer_OneOrBothUseDefault_Ok test Protected against error in old versions of Windows and updated assert to include the case when hash algorithm can be Sha1. Fixes #7812 (actual fix done on Windows, just re-enabling affected tests with proper guard) 26464 area-System.Net Improve IRI tests for unknown schemes and unicode/reserved characters This adds a test for a regression we recently saw in .NET Framework. It also makes minor improvements to other IRI tests. The change removes two TODO comments that were not correct. They were based off of the reserved character set from RFC 2396 rather than the more up to date RFC 3986. Normalization definitely shouldn't produce the same result for escaped and unescaped URIs when those URIs contain reserved chars. 26465 area-System.Memory Add a Span.TryCast extension method Split from https://github.com/dotnet/corefx/issues/26368 ```C# namespace System { public static partial class MemoryExtensions { public static bool TryCast<TFrom, TTo>(this ReadOnlySpan<TFrom> source, out ReadOnlySpan<TTo> output) where TFrom : struct where TTo : struct; public static bool TryCast<TFrom, TTo>(this Span<TFrom> source, out Span<TTo> output) where TFrom : struct where TTo : struct; } } ``` We should add some TryCast extension methods that behave similar to the [NonPortableCast](https://github.com/dotnet/corefx/issues/26368) functions but that include checking beforehand to make sure the operation will be succeed with a usable Span result. To do this, they will need a structure somewhat like this: ``` if (Platform detect intel) { // do NonPortableCast // return true; } else { // check the alignment manually. if ( we're already aligned) { // do NonPortableCast return true; } else { //do nothing return false; } } ``` 26466 area-System.Net Consolidate configuration for enabling ManagedHandler This is part of #23166 and primarily opened to address remaining concerns from #26403: - existing COMPlus_UseManagedHttpClientHandler is not compliant and shall use DOTNET_ prefix - configuration via AppContext should take precedence over environmental variable. Existing code would enable ManagedHandler if either one method is set to enable. This possibly also opens option to retire environmental configurtion as it seems redundant to runtime configuration. We can also updated tests as the context may be easier to manipulate 26467 area-System.Memory Consume Span moves - [Move Span.DangerousCreate to MemoryMarshal.CreateSpan](https://github.com/dotnet/corefx/issues/26139) - [Move ReadOnlySpan.DangerousCreate to MemoryMarshal.CreateReadOnlySpan](https://github.com/dotnet/corefx/issues/26139) - [Move Span.NonPortableCast to MemoryMarshal.Cast](https://github.com/dotnet/corefx/issues/26368) - [Move ReadOnlySpan.NonPortableCast to MemoryMarshal.Cast](https://github.com/dotnet/corefx/issues/26368) - [Add ToString override to Span and ReadOnlySpan](https://github.com/dotnet/corefx/issues/26295) - [Add ToEnumerable function to MemoryMarshal that takes a Memory](https://github.com/dotnet/corefx/issues/24854) - Since the above require adding a fast-span specific API (the new Create functions), I had to add netcoreapp and uap configurations to the test build so we only run the Create tests against the fast-span. Depends on https://github.com/dotnet/coreclr/pull/15941 resolves #26368 resolves #24854 resolves #26295 resolves #26139 26468 area-System.Net HttpConnectionPools.RemoveStalePools race condition Fix it properly: https://github.com/dotnet/corefx/blob/91a83313344bd96127dbc2c50723a930f93c33c5/src/System.Net.Http/src/System/Net/Http/Managed/HttpConnectionPools.cs#L127-L135 26470 area-System.Memory Add tests for implicit conversion from null arrays to empty Memory<T> Currently waiting for corresponding change to get merged into coreclr. 26472 area-System.Runtime Binary Serializing a DataTable with a DataColumn fails with SerializationException "Using older and the latest versions of .NET SDK (2.1.4) / .NET Core 2.0.5, the following code: ```cs using System; using System.Data; using System.IO; using System.Runtime.Serialization.Formatters.Binary; namespace MyBinarySerializer { class Program { static void Main(string[] args) { DataTable dt = new DataTable(""MyTable""); DataColumn dc = new DataColumn(""dc"", typeof(Int32)); dt.Columns.Add(dc); dt.RemotingFormat = SerializationFormat.Binary; using (FileStream fs = new FileStream(""MyTable.bin"", FileMode.Create)) { BinaryFormatter bf = new BinaryFormatter(); bf.Serialize(fs, dt); } } } } ``` results in the following exception: ``` Error Message: System.Runtime.Serialization.SerializationException : Type 'System.RuntimeType' in Assembly 'System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' is not marked as serializable. Stack Trace: at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriterobjectWriter, SerializationBinder binder) at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Write(WriteObjectInfo objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo) at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, BinaryFormatterWriter serWriter, Boolean fCheck) at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Boolean check) at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph) ``` I tried a few other types in the DataColumn to no avail. The code works under .NET Framework. It works when the DataTable is empty. It also works if I set `dt.RemotingFormat = SerializationFormat.Xml;` I've looked at #23213 and https://docs.microsoft.com/en-us/dotnet/standard/serialization/binary-serialization, which doesn't list System.Data.DataColumn, but what's the point of serializing DataTable without DataColumn? Any suggestions?" 26473 area-System.IO Delete FileSystem abstraction 26474 area-Infrastructure Update advanced-inner-loop-testing.md (empty PR for discussion) @ViktorHofer I have found it easier to - Not bother copying files out of 9.9.9.9. Create program.cs in place. - First time only: `for /f %i in ('dir /s /b System*dll') do @echo /r:%i >> out.rsp` - `corerun \git\corefx\Tools\csc.dll program.cs @out.rsp` - `devenv /debugexe corerun.exe program.exe` - First time only: manually set the debug engine to .NET Core (program, args, and working directory are set for you). VS will prompt you to save the .sln to persist these settings. - set breakpoints, F5 etc. All .NET Core symbols are loaded, and sources are resolved, debug happily, edit sources, build whatever folder with `msbuild` as normal, this updates 9.9.9.9 folder, hit F5 again, .etc It seems to me this is an improvement to the inner loop without a unit test. It's the quickest way I know to debug a .NET Core program with CoreFX sources/binaries. Shall I update this document as above? 26475 area-System.Diagnostics Sync PerformanceCounterLib "Closes #25403 I tried to understand where is the problem and after tests: * at the end of RegisterCategory() CloseAllLibraries() clear PerformanceCounterLib instances but if at the same time we call PerformanceCounterLib.GetXXXX() the new reloaded CategoryTable sometimets doesn't contains new counter as if all modification to registry are not yet published to all threads (by design read guide note https://msdn.microsoft.com/en-us/library/cs38wsc4(v=vs.110).aspx ""If the list has not been refreshed, the attempt to use the category will fail""). So i added a ""retry"" strategy to wait new counter publication IsPublished() to mitigate the issue. * In DeleteCategory() the call PerformanceCounterLib.CloseAllLibraries() is redundant because is called in PerformanceCounterLib.UnregisterCategory(). * On CloseAllLibraries() i add lock because concurrent GetPerformanceCounterLib() raise NullReferenceException() on s_libraryTable * Add lock to protect _customCategoryTable, also on CloseTables() because raise NullReferenceException() on FindCustomCategory() (the other table are re-loaded from registry) * Add more ""coarse"" lock on GetPerformanceCounterLib() for two reason, possible multiple instancing of PerformanceCounterLib and race with CloseAllLibraries() on s_libraryTable My idea is that this namespace wasn't built to handle special ""concurrent"" scenarios where Create()/Delete()/GetXXXX() are used heavily at same time, and it make sense, usually i ""install a counter"" and after i use it, so concurrent modification are rare. Parallel unit testing is borderline. Maybe if we want to have a fully concurrent api we've to change more code and have more ""coarse"" locks also to protect concurrent registry access, or we can only sync internal structure of PerformanceCounterLib and keep attribute. I think that today [assembly: CollectionBehavior(DisableTestParallelization = true)] is necessary with this implementation to mitigate the issue. After these changes sometimes(after heavy loaded minutes with 64 parallel thread in loop Exists/Delete/Create/GetCounter/ReadValue) i get corrupted registry error like(no more null reference for race): The Counter layout for the Category specified is invalid, a counter of the type: AverageCount64, AverageTimer32, CounterMultiTimer, CounterMultiTimerInverse, CounterMultiTimer100Ns, CounterMultiTimer100NsInverse, RawFraction, or SampleFraction has to be immediately followed by any of the base counter types: AverageBase, CounterMultiBase, RawBase or SampleBase. Cannot load Counter Name data because an invalid index '' was read from the registry. This is WIP code for discussion(tests/debug code). cc: @joperezr @danmosemsft @adiaaida" 26476 area-System.Net NetworkInterface.GetAllNetworkInterfaces() throws NetworkInformationException on WSL First it relates to #11217 Running on Ubuntu WSL (Windows Subsystem for Linux): ``` # lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.3 LTS Release: 16.04 Codename: xenial ``` With dotnet (installed via apt-get install dotnet-sdk-2.1.4): ``` # dotnet --version 2.1.4 ``` When I run ```NetworkInterface.GetAllNetworkInterfaces();``` it throws this: ``` System.Net.NetworkInformation.NetworkInformationException (0x80004005): An error was encountered while querying information from the operating system. ---> System.AggregateException: One or more errors occurred. (Could not find a part of the path '/proc/sys/net/ipv4/conf/eth0/forwarding'.) (Could not find a part of the path '/proc/sys/net/ipv4/conf/eth1/forwarding'.) (Could not find a part of the path '/proc/sys/net/ipv4/conf/eth2/forwarding'.) (Could not find a part of the path '/proc/sys/net/ipv4/conf/lo/forwarding'.) (Could not find a part of the path '/proc/sys/net/ipv4/conf/eth0/forwarding'.) (Could not find a part of the path '/proc/sys/net/ipv4/conf/eth0/forwarding'.) (Could not find a part of the path '/proc/sys/net/ipv4/conf/eth1/forwarding'.) (Could not find a part of the path '/proc/sys/net/ipv4/conf/eth1/forwarding'.) (Could not find a part of the path '/proc/sys/net/ipv4/conf/eth2/forwarding'.) (Could not find a part of the path '/proc/sys/net/ipv4/conf/eth2/forwarding'.) (Could not find a part of the path '/proc/sys/net/ipv4/conf/lo/forwarding'.) (Could not find a part of the path '/proc/sys/net/ipv4/conf/lo/forwarding'.) ---> System.IO.DirectoryNotFoundException: Could not find a part of the path '/proc/sys/net/ipv4/conf/eth0/forwarding'. at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks) at System.IO.File.InternalReadAllText(String path, Encoding encoding) at System.IO.File.ReadAllText(String path) at System.Net.NetworkInformation.StringParsingHelpers.ParseRawIntFile(String filePath) at System.Net.NetworkInformation.LinuxIPv4InterfaceProperties.GetIsForwardingEnabled() at System.Net.NetworkInformation.LinuxIPv4InterfaceProperties..ctor(LinuxNetworkInterface linuxNetworkInterface) at System.Net.NetworkInformation.LinuxIPInterfaceProperties..ctor(LinuxNetworkInterface lni) at System.Net.NetworkInformation.LinuxNetworkInterface..ctor(String name) at System.Net.NetworkInformation.LinuxNetworkInterface.GetOrCreate(Dictionary`2 interfaces, String name) at System.Net.NetworkInformation.LinuxNetworkInterface.<>c__DisplayClass5_0.<GetLinuxNetworkInterfaces>b__2(String name, LinkLayerAddressInfo* llAddr) --- End of inner exception stack trace --- ---> (Inner Exception #0) System.IO.DirectoryNotFoundException: Could not find a part of the path '/proc/sys/net/ipv4/conf/eth0/forwarding'. at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks) at System.IO.File.InternalReadAllText(String path, Encoding encoding) at System.IO.File.ReadAllText(String path) at System.Net.NetworkInformation.StringParsingHelpers.ParseRawIntFile(String filePath) at System.Net.NetworkInformation.LinuxIPv4InterfaceProperties.GetIsForwardingEnabled() at System.Net.NetworkInformation.LinuxIPv4InterfaceProperties..ctor(LinuxNetworkInterface linuxNetworkInterface) at System.Net.NetworkInformation.LinuxIPInterfaceProperties..ctor(LinuxNetworkInterface lni) at System.Net.NetworkInformation.LinuxNetworkInterface..ctor(String name) at System.Net.NetworkInformation.LinuxNetworkInterface.GetOrCreate(Dictionary`2 interfaces, String name) at System.Net.NetworkInformation.LinuxNetworkInterface.<>c__DisplayClass5_0.<GetLinuxNetworkInterfaces>b__2(String name, LinkLayerAddressInfo* llAddr)<--- ---> (Inner Exception #1) System.IO.DirectoryNotFoundException: Could not find a part of the path '/proc/sys/net/ipv4/conf/eth1/forwarding'. at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks) at System.IO.File.InternalReadAllText(String path, Encoding encoding) at System.IO.File.ReadAllText(String path) at System.Net.NetworkInformation.StringParsingHelpers.ParseRawIntFile(String filePath) at System.Net.NetworkInformation.LinuxIPv4InterfaceProperties.GetIsForwardingEnabled() at System.Net.NetworkInformation.LinuxIPv4InterfaceProperties..ctor(LinuxNetworkInterface linuxNetworkInterface) at System.Net.NetworkInformation.LinuxIPInterfaceProperties..ctor(LinuxNetworkInterface lni) at System.Net.NetworkInformation.LinuxNetworkInterface..ctor(String name) at System.Net.NetworkInformation.LinuxNetworkInterface.GetOrCreate(Dictionary`2 interfaces, String name) at System.Net.NetworkInformation.LinuxNetworkInterface.<>c__DisplayClass5_0.<GetLinuxNetworkInterfaces>b__2(String name, LinkLayerAddressInfo* llAddr)<--- ---> (Inner Exception #2) System.IO.DirectoryNotFoundException: Could not find a part of the path '/proc/sys/net/ipv4/conf/eth2/forwarding'. at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks) at System.IO.File.InternalReadAllText(String path, Encoding encoding) at System.IO.File.ReadAllText(String path) at System.Net.NetworkInformation.StringParsingHelpers.ParseRawIntFile(String filePath) at System.Net.NetworkInformation.LinuxIPv4InterfaceProperties.GetIsForwardingEnabled() at System.Net.NetworkInformation.LinuxIPv4InterfaceProperties..ctor(LinuxNetworkInterface linuxNetworkInterface) at System.Net.NetworkInformation.LinuxIPInterfaceProperties..ctor(LinuxNetworkInterface lni) at System.Net.NetworkInformation.LinuxNetworkInterface..ctor(String name) at System.Net.NetworkInformation.LinuxNetworkInterface.GetOrCreate(Dictionary`2 interfaces, String name) at System.Net.NetworkInformation.LinuxNetworkInterface.<>c__DisplayClass5_0.<GetLinuxNetworkInterfaces>b__2(String name, LinkLayerAddressInfo* llAddr)<--- ---> (Inner Exception #3) System.IO.DirectoryNotFoundException: Could not find a part of the path '/proc/sys/net/ipv4/conf/lo/forwarding'. at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks) at System.IO.File.InternalReadAllText(String path, Encoding encoding) at System.IO.File.ReadAllText(String path) at System.Net.NetworkInformation.StringParsingHelpers.ParseRawIntFile(String filePath) at System.Net.NetworkInformation.LinuxIPv4InterfaceProperties.GetIsForwardingEnabled() at System.Net.NetworkInformation.LinuxIPv4InterfaceProperties..ctor(LinuxNetworkInterface linuxNetworkInterface) at System.Net.NetworkInformation.LinuxIPInterfaceProperties..ctor(LinuxNetworkInterface lni) at System.Net.NetworkInformation.LinuxNetworkInterface..ctor(String name) at System.Net.NetworkInformation.LinuxNetworkInterface.GetOrCreate(Dictionary`2 interfaces, String name) at System.Net.NetworkInformation.LinuxNetworkInterface.<>c__DisplayClass5_0.<GetLinuxNetworkInterfaces>b__2(String name, LinkLayerAddressInfo* llAddr)<--- ---> (Inner Exception #4) System.IO.DirectoryNotFoundException: Could not find a part of the path '/proc/sys/net/ipv4/conf/eth0/forwarding'. at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks) at System.IO.File.InternalReadAllText(String path, Encoding encoding) at System.IO.File.ReadAllText(String path) at System.Net.NetworkInformation.StringParsingHelpers.ParseRawIntFile(String filePath) at System.Net.NetworkInformation.LinuxIPv4InterfaceProperties.GetIsForwardingEnabled() at System.Net.NetworkInformation.LinuxIPv4InterfaceProperties..ctor(LinuxNetworkInterface linuxNetworkInterface) at System.Net.NetworkInformation.LinuxIPInterfaceProperties..ctor(LinuxNetworkInterface lni) at System.Net.NetworkInformation.LinuxNetworkInterface..ctor(String name) at System.Net.NetworkInformation.LinuxNetworkInterface.GetOrCreate(Dictionary`2 interfaces, String name) at System.Net.NetworkInformation.LinuxNetworkInterface.<>c__DisplayClass5_0.<GetLinuxNetworkInterfaces>b__0(String name, IpAddressInfo* ipAddr, IpAddressInfo* maskAddr)<--- ---> (Inner Exception #5) System.IO.DirectoryNotFoundException: Could not find a part of the path '/proc/sys/net/ipv4/conf/eth0/forwarding'. at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks) at System.IO.File.InternalReadAllText(String path, Encoding encoding) at System.IO.File.ReadAllText(String path) at System.Net.NetworkInformation.StringParsingHelpers.ParseRawIntFile(String filePath) at System.Net.NetworkInformation.LinuxIPv4InterfaceProperties.GetIsForwardingEnabled() at System.Net.NetworkInformation.LinuxIPv4InterfaceProperties..ctor(LinuxNetworkInterface linuxNetworkInterface) at System.Net.NetworkInformation.LinuxIPInterfaceProperties..ctor(LinuxNetworkInterface lni) at System.Net.NetworkInformation.LinuxNetworkInterface..ctor(String name) at System.Net.NetworkInformation.LinuxNetworkInterface.GetOrCreate(Dictionary`2 interfaces, String name) at System.Net.NetworkInformation.LinuxNetworkInterface.<>c__DisplayClass5_0.<GetLinuxNetworkInterfaces>b__1(String name, IpAddressInfo* ipAddr, UInt32* scopeId)<--- ---> (Inner Exception #6) System.IO.DirectoryNotFoundException: Could not find a part of the path '/proc/sys/net/ipv4/conf/eth1/forwarding'. at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks) at System.IO.File.InternalReadAllText(String path, Encoding encoding) at System.IO.File.ReadAllText(String path) at System.Net.NetworkInformation.StringParsingHelpers.ParseRawIntFile(String filePath) at System.Net.NetworkInformation.LinuxIPv4InterfaceProperties.GetIsForwardingEnabled() at System.Net.NetworkInformation.LinuxIPv4InterfaceProperties..ctor(LinuxNetworkInterface linuxNetworkInterface) at System.Net.NetworkInformation.LinuxIPInterfaceProperties..ctor(LinuxNetworkInterface lni) at System.Net.NetworkInformation.LinuxNetworkInterface..ctor(String name) at System.Net.NetworkInformation.LinuxNetworkInterface.GetOrCreate(Dictionary`2 interfaces, String name) at System.Net.NetworkInformation.LinuxNetworkInterface.<>c__DisplayClass5_0.<GetLinuxNetworkInterfaces>b__0(String name, IpAddressInfo* ipAddr, IpAddressInfo* maskAddr)<--- ---> (Inner Exception #7) System.IO.DirectoryNotFoundException: Could not find a part of the path '/proc/sys/net/ipv4/conf/eth1/forwarding'. at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks) at System.IO.File.InternalReadAllText(String path, Encoding encoding) at System.IO.File.ReadAllText(String path) at System.Net.NetworkInformation.StringParsingHelpers.ParseRawIntFile(String filePath) at System.Net.NetworkInformation.LinuxIPv4InterfaceProperties.GetIsForwardingEnabled() at System.Net.NetworkInformation.LinuxIPv4InterfaceProperties..ctor(LinuxNetworkInterface linuxNetworkInterface) at System.Net.NetworkInformation.LinuxIPInterfaceProperties..ctor(LinuxNetworkInterface lni) at System.Net.NetworkInformation.LinuxNetworkInterface..ctor(String name) at System.Net.NetworkInformation.LinuxNetworkInterface.GetOrCreate(Dictionary`2 interfaces, String name) at System.Net.NetworkInformation.LinuxNetworkInterface.<>c__DisplayClass5_0.<GetLinuxNetworkInterfaces>b__1(String name, IpAddressInfo* ipAddr, UInt32* scopeId)<--- ---> (Inner Exception #8) System.IO.DirectoryNotFoundException: Could not find a part of the path '/proc/sys/net/ipv4/conf/eth2/forwarding'. at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks) at System.IO.File.InternalReadAllText(String path, Encoding encoding) at System.IO.File.ReadAllText(String path) at System.Net.NetworkInformation.StringParsingHelpers.ParseRawIntFile(String filePath) at System.Net.NetworkInformation.LinuxIPv4InterfaceProperties.GetIsForwardingEnabled() at System.Net.NetworkInformation.LinuxIPv4InterfaceProperties..ctor(LinuxNetworkInterface linuxNetworkInterface) at System.Net.NetworkInformation.LinuxIPInterfaceProperties..ctor(LinuxNetworkInterface lni) at System.Net.NetworkInformation.LinuxNetworkInterface..ctor(String name) at System.Net.NetworkInformation.LinuxNetworkInterface.GetOrCreate(Dictionary`2 interfaces, String name) at System.Net.NetworkInformation.LinuxNetworkInterface.<>c__DisplayClass5_0.<GetLinuxNetworkInterfaces>b__0(String name, IpAddressInfo* ipAddr, IpAddressInfo* maskAddr)<--- ---> (Inner Exception #9) System.IO.DirectoryNotFoundException: Could not find a part of the path '/proc/sys/net/ipv4/conf/eth2/forwarding'. at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks) at System.IO.File.InternalReadAllText(String path, Encoding encoding) at System.IO.File.ReadAllText(String path) at System.Net.NetworkInformation.StringParsingHelpers.ParseRawIntFile(String filePath) at System.Net.NetworkInformation.LinuxIPv4InterfaceProperties.GetIsForwardingEnabled() at System.Net.NetworkInformation.LinuxIPv4InterfaceProperties..ctor(LinuxNetworkInterface linuxNetworkInterface) at System.Net.NetworkInformation.LinuxIPInterfaceProperties..ctor(LinuxNetworkInterface lni) at System.Net.NetworkInformation.LinuxNetworkInterface..ctor(String name) at System.Net.NetworkInformation.LinuxNetworkInterface.GetOrCreate(Dictionary`2 interfaces, String name) at System.Net.NetworkInformation.LinuxNetworkInterface.<>c__DisplayClass5_0.<GetLinuxNetworkInterfaces>b__1(String name, IpAddressInfo* ipAddr, UInt32* scopeId)<--- ---> (Inner Exception #10) System.IO.DirectoryNotFoundException: Could not find a part of the path '/proc/sys/net/ipv4/conf/lo/forwarding'. at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks) at System.IO.File.InternalReadAllText(String path, Encoding encoding) at System.IO.File.ReadAllText(String path) at System.Net.NetworkInformation.StringParsingHelpers.ParseRawIntFile(String filePath) at System.Net.NetworkInformation.LinuxIPv4InterfaceProperties.GetIsForwardingEnabled() at System.Net.NetworkInformation.LinuxIPv4InterfaceProperties..ctor(LinuxNetworkInterface linuxNetworkInterface) at System.Net.NetworkInformation.LinuxIPInterfaceProperties..ctor(LinuxNetworkInterface lni) at System.Net.NetworkInformation.LinuxNetworkInterface..ctor(String name) at System.Net.NetworkInformation.LinuxNetworkInterface.GetOrCreate(Dictionary`2 interfaces, String name) at System.Net.NetworkInformation.LinuxNetworkInterface.<>c__DisplayClass5_0.<GetLinuxNetworkInterfaces>b__0(String name, IpAddressInfo* ipAddr, IpAddressInfo* maskAddr)<--- ---> (Inner Exception #11) System.IO.DirectoryNotFoundException: Could not find a part of the path '/proc/sys/net/ipv4/conf/lo/forwarding'. at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks) at System.IO.File.InternalReadAllText(String path, Encoding encoding) at System.IO.File.ReadAllText(String path) at System.Net.NetworkInformation.StringParsingHelpers.ParseRawIntFile(String filePath) at System.Net.NetworkInformation.LinuxIPv4InterfaceProperties.GetIsForwardingEnabled() at System.Net.NetworkInformation.LinuxIPv4InterfaceProperties..ctor(LinuxNetworkInterface linuxNetworkInterface) at System.Net.NetworkInformation.LinuxIPInterfaceProperties..ctor(LinuxNetworkInterface lni) at System.Net.NetworkInformation.LinuxNetworkInterface..ctor(String name) at System.Net.NetworkInformation.LinuxNetworkInterface.GetOrCreate(Dictionary`2 interfaces, String name) at System.Net.NetworkInformation.LinuxNetworkInterface.<>c__DisplayClass5_0.<GetLinuxNetworkInterfaces>b__1(String name, IpAddressInfo* ipAddr, UInt32* scopeId)<--- at System.Net.NetworkInformation.LinuxNetworkInterface.GetLinuxNetworkInterfaces() at System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces() at Server.Network.Listener.Bind(IPEndPoint ipep) in /mnt/c/dev/csharp/manawydan-git/Server/RunUOPro/Core/Network/Listener.cs:line 87 ``` 26477 area-System.Net Proposal: HttpRequestException w/ Status Code Proposed solution to #9227, #24253 and any related issues: Linking in https://github.com/SteamRE/SteamKit/issues/517 as well. I've had the following issue in various codebases: 1. Some HTTP-based code expects a 200-series response. 2. The HTTP-based code uses `HttpResponseMessage.EnsureSuccessStatusCode()` 3. The calling code catches the exception and wants to do something based on the status code. 4. The calling code does not have access to the original HTTP response status code, or any headers, etc. In the old .NET HTTP APIs, this was straightforward because `WebException` includes the status code and the response object, where available. Adding `StatusCode` to `HttpRequestException` has been rejected in the above-linked issues due to it being of little use in most cases. Would it be possible instead to create a subclass of `HttpRequestException`, and have `EnsureSuccessStatusCode()` throw that instead? Something resembling the following ought to do the trick: ``` public class HttpResponseException : HttpRequestException { public HttpResponseException() { ... } public HttpResponseException(string message, Exception innerException) { ... } public HttpResponseException(string message, int statusCode) { ... } public HttpResponseException(string message, int statusCode, Exception innerException) { ... } public int StatusCode { get; } } ``` This would achieve the following: 1. `HttpRequestException` does not have a majority-useless field. 1. Code that catches `HttpRequestException` would continue to function as-is. 1. Networking errors, unreachable servers etc. will continue to throw `HttpRequestException`. 1. New code can opt in to catching `HttpResponseException`, and will then have access to the original HTTP Status Code. Optionally, for consideration, the exception could also include the whole `HttpResponseMessage` object in line with good old `WebException`. 26479 area-System.Globalization TimeZoneInfo lookup stops being case insensitive after calling GetSystemTimeZones Succeeds: ``` TimeZoneInfo.FindSystemTimeZoneById(TimeZoneInfo.Local.Id.ToLowerInvariant()); ``` Fails: ``` TimeZoneInfo.GetSystemTimeZones(); TimeZoneInfo.FindSystemTimeZoneById(TimeZoneInfo.Local.Id.ToLowerInvariant()); ``` 26481 area-System.Threading [API] Add AsyncMethodBuilder.Start<TStateMachine> for Task likes **API** ```csharp public static class AsyncMethodBuilder { [DebuggerStepThrough] public static void Start<TStateMachine>(ref TStateMachine stateMachine) where TStateMachine : IAsyncStateMachine } ``` **Scenario**: implementing the [`Start` method of `AsyncMethodBuilder`](https://github.com/dotnet/roslyn/blob/master/docs/features/task-types.md#builder-type) either must box the statemachine or use `AsyncTaskMethodBuilder` which carries an additional `Task<TResult>` field. **With api** ```csharp public void Start<TStateMachine>(ref TStateMachine stateMachine) where TStateMachine : IAsyncStateMachine => AsyncMethodBuilder.Start(ref stateMachine); // provides correct EC semantics ``` **Without api** *Invalid approach* Boxing the statemachine via EC.Run is invalid; ```csharp public void Start<TStateMachine>(ref TStateMachine stateMachine) where TStateMachine : IAsyncStateMachine { ExecutionContext.Run(ExecutionContext.Capture(), // capture current context (s) => ((TStateMachine)s).MoveNext(), stateMachine); // struct stateMachine is boxed. Invalid } ``` *Option 1* So either an Async**Task**MethodBuilder needs to be instantiated and used to correctly implement an AsyncMethodBuilder (which seems an odd appropriation for a non-Task type): ```csharp public void Start<TStateMachine>(ref TStateMachine stateMachine) where TStateMachine : IAsyncStateMachine { AsyncTaskMethodBuilder b; // create empty AsyncTaskMethodBuilder to access method b.Start(ref stateMachine); } ``` *Option 2* Or the statemachine needs to be pre-boxed and then assigned back; which is ugly and error prone: ```csharp public void Start<TStateMachine>(ref TStateMachine stateMachine) where TStateMachine : IAsyncStateMachine { IAsyncStateMachine sm = stateMachine; // box ExecutionContext.Run(ExecutionContext.Capture(), // capture current context (s) => ((IAsyncStateMachine)s).MoveNext(), sm); stateMachine = (TStateMachine)(object)sm; // unbox } ``` **Alternative apis** Manual capture and Run with a `ref TState` ```csharp namespace System.Threading { delegate void ContextRefCallback<TState>(ref TState state); public partial class ExecutionContext { static void Run<TState>(ExecutionContext executionContext, ContextRefCallback<TState> callback, ref TState state); } } ``` Or the following which require more bolierplate by the implementer to get right and `OnValueChanged` can't be triggered for AsyncLocals (as that api is not exposed); which would also be more work to get right again. Allow ExecutionContext to be directly set (using Captured context) - where `null => Default` ```csharp public partial class ExecutionContext { static void SetExecutionContext(ExecutionContext executionContext); } ``` Or expose the Thread ExecutionContext setter to match the getter - where `Default == null` ```csharp public partial class Thread { ExecutionContext ExecutionContext { get; set; } } ``` /cc @stephentoub 26482 area-System.Collections ObservableCollection<T> range capabilities "Fixes #10752. Introduces the following methods into the `System.Collections.ObjectModel.ObservableCollection<T>`: ```c# /// <summary> /// Adds the elements of the specified collection /// to the end of the <see cref=""ObservableCollection{T}""/>. /// </summary> /// <param name=""collection""> /// The collection whose elements should be added /// to the end of the <see cref=""ObservableCollection{T}""/>. /// The collection itself cannot be null, but it can contain elements that are null, /// if type T is a reference type. /// </param> public void AddRange(IEnumerable<T> collection); /// <summary> /// Inserts the elements of a collection into the <see cref=""ObservableCollection{T}""/> /// at the specified index. /// </summary> /// <exception cref=""ArgumentNullException""><paramref name=""collection""/> is null.</exception> /// <exception cref=""ArgumentOutOfRangeException""> /// <paramref name=""index""/> is not in the collection range. /// </exception> /// <param name=""index""> /// The zero-based index at which the new elements should be inserted. /// </param> /// <param name=""collection"">The collection whose elements should be inserted into the List<T>. /// The collection itself cannot be null, but it can contain elements that are null, /// if type T is a reference type.</param> public void InsertRange(int index, IEnumerable<T> collection); /// <summary> /// Removes the first occurence of each item in the specified collection /// from the <see cref=""ObservableCollection{T}"". /// </summary> /// <exception cref=""ArgumentNullException""><paramref name=""collection""/> is null.</exception> /// <param name=""collection"">The items to remove.</param> public void RemoveRange(int index, int count); /// <summary> /// Removes a range of elements from the <see cref=""ObservableCollection{T}""/>>. /// </summary> /// <param name=""index""> /// The zero-based starting index of the range of elements to remove. /// </param> /// <param name=""count"">The number of elements to remove.</param> /// <exception cref=""ArgumentOutOfRangeException""> /// The specified range is exceeding the collection. /// </exception> public void RemoveRange(IEnumerable<T> collection); /// <summary> /// Iterates over the collection and removes all items that satisfy the specified match. /// </summary> /// <exception cref=""ArgumentNullException""><paramref name=""match""/> is null.</exception> /// <param name=""match""></param> /// <returns>Returns the number of elements that where </returns> public int RemoveAll(Predicate<T> match); /// <summary> /// Iterates over the specified range within the collection /// and removes all items that satisfy the specified match. /// </summary> /// <remarks>The complexity is O(n).</remarks> /// <param name=""index"">The index of where to start performing the search.</param> /// <param name=""count"">The number of items to iterate on.</param> /// <param name=""match""></param> /// <returns>Returns the number of elements that where </returns> /// <exception cref=""ArgumentOutOfRangeException""> /// <paramref name=""index""/> is out of range. /// </exception> /// <exception cref=""ArgumentOutOfRangeException""> /// <paramref name=""count""/> is out of range. /// </exception> /// <exception cref=""ArgumentNullException""><paramref name=""match""/> is null.</exception> public int RemoveAll(int index, int count, Predicate<T> match) /// <summary> /// Clears the current collection and replaces it with the specified collection, /// using the default <see cref=""EqualityComparer{T}""/>. /// </summary> /// <param name=""newItems"">The items to fill the collection with, after clearing it.</param> /// <exception cref=""ArgumentNullException""><paramref name=""newItems""/> is null.</exception> public void ReplaceRange(IEnumerable<T> collection); /// <summary> /// Clears the current collection and replaces it with the specified collection. /// </summary> /// <param name=""newItems"">The items to fill the collection with, after clearing it.</param> /// <param name=""comparer"">An <see cref=""IEqualityComparer{T}""/> to be used /// to check whether an item in the same location already existed before, /// which in case it would not be added to the collection, /// and no event will be raised for it.</param> /// <exception cref=""ArgumentNullException""><paramref name=""newItems""/> is null.</exception> /// <exception cref=""ArgumentNullException""><paramref name=""comparer""/> is null.</exception> public void ReplaceRange(IEnumerable<T> collection, IEqualityComparer<T> comparer); /// <summary> /// Removes the specified range and inserts the specified collection, /// ignoring equal items (using <see cref=""EqualityComparer{T}.Default""/>). /// </summary> /// <param name=""index"">The index of where to start the replacement.</param> /// <param name=""count"">The number of items to be replaced.</param> /// <param name=""collection"">The collection to insert in that location.</param> /// <exception cref=""ArgumentOutOfRangeException""> /// <paramref name=""index""/> is out of range.</exception> /// <exception cref=""ArgumentOutOfRangeException""><paramref name=""count""/> is out of range. /// </exception> /// <exception cref=""ArgumentNullException""> /// <paramref name=""collection""/> is null. /// </exception> public void ReplaceRange(int index, int count, IEnumerable<T> collection) /// <summary> /// Removes the specified range and inserts the specified collection, ignoring equal items. /// </summary> /// <param name=""index"">The index of where to start the replacement.</param> /// <param name=""count"">The number of items to be replaced.</param> /// <param name=""collection"">The collection to insert in that location.</param> /// <param name=""comparer"">The comparer to use when checking for equal items.</param> /// <exception cref=""ArgumentOutOfRangeException""> /// <paramref name=""index""/> is out of range. /// </exception> /// <exception cref=""ArgumentOutOfRangeException""> /// <paramref name=""count""/> is out of range. /// </exception> /// <exception cref=""ArgumentNullException""><paramref name=""collection""/> is null.</exception> /// <exception cref=""ArgumentNullException""><paramref name=""comparer""/> is null.</exception> public void ReplaceRange(int index, int count, IEnumerable<T> collection, IEqualityComparer<T> comparer) ```" 26483 area-System.Text Regex throws IndexOutOfRange while parsing string. Found while writing https://github.com/dotnet/roslyn/pull/23984 (a usable regex parser for use in IDE scenarios) Regex pattern is: ```(?<-``` Index out of range happens here: ``` System.Text.RegularExpressions.RegexParser.ScanGroupOpen() Unknown System.Text.RegularExpressions.RegexParser.ScanRegex() Unknown System.Text.RegularExpressions.RegexParser.Parse(re, op) Unknown System.Text.RegularExpressions.Regex.Regex(pattern, options, matchTimeout, useCache) Unknown System.Text.RegularExpressions.Regex.Regex(pattern, options) Unknown > Microsoft.CodeAnalysis.CSharp.UnitTests.RegularExpressions.CSharpRegexParserTests.TryParseTree(stringText, options, conversionFailureOk) Line 111 C# ``` I believe this is due to: https://github.com/dotnet/corefx/blob/353bdc62ccb5c56148bf0e31814f1fd4f84a7fd9/src/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexParser.cs#L807-L810 After moving right, a character on the right is blindly consumed, even though we're at the end of the string. Like other parts of the code, there needs to be a ```CharsRight() > 0``` check. -- Note: https://github.com/dotnet/roslyn/pull/23984 comes with several thousands of regex tests that could be adoped by corefx to help ensure that parsing either succeeds, or throws an ArgumentException as per the regex constructor documentation https://docs.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.regex.-ctor?view=netframework-4.7.1#System_Text_RegularExpressions_Regex__ctor_System_String_ 26484 area-System.Text Regex throws out of memory while constructing (not matching) simple regex string. Found while writing dotnet/roslyn#23984 (a usable regex parser for use in IDE scenarios) Regex pattern is: ```a{2147483647,}``` Exception happens here: ``` System.Text.RegularExpressions.RegexFCD.Prefix(tree) Unknown System.Text.RegularExpressions.RegexWriter.RegexCodeFromRegexTree(tree) Unknown System.Text.RegularExpressions.Regex.Regex(pattern, options, matchTimeout, useCache) Unknown System.Text.RegularExpressions.Regex.Regex(pattern, options) Unknown > Microsoft.CodeAnalysis.CSharp.UnitTests.RegularExpressions.CSharpRegexParserTests.TryParseTree(stringText, options, conversionFailureOk) Line 111 C# Microsoft.CodeAnalysis.CSharp.UnitTests.RegularExpressions.CSharpRegexParserTests.Test(stringText, expected, options, runSubTreeTests, name) Line 34 C# Microsoft.CodeAnalysis.CSharp.UnitTests.RegularExpressions.CSharpRegexParserTests.TestLargeOpenRangeNumericQuantifier1() Line 1651 C# ``` It looks like this is due to: https://github.com/dotnet/corefx/blob/353bdc62ccb5c56148bf0e31814f1fd4f84a7fd9/src/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexFCD.cs#L89-L93 Where a string gets padded with the actual number of matches asked for. THis is problematic on a few levels. First, it means that the .net regex library cannot be used to actually tell if a pattern is legal or not. i.e. if you just want to know if ```a{2147483647,}``` is a legal pattern, then your code will crash because there's not enough memory to ask the question. Second, it's not possible to actually perform these matches. These types of matches could be done without actually encoding them as a full string, but rather as an interpreted node of some sort. -- Note: https://github.com/dotnet/roslyn/pull/23984 comes with several thousands of regex tests that could be adoped by corefx to help ensure that parsing either succeeds, or throws an ArgumentException as per the regex constructor documentation https://docs.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.regex.-ctor?view=netframework-4.7.1#System_Text_RegularExpressions_Regex__ctor_System_String_ 26485 area-System.Text Regex null-refs while processing pattern. Found while writing dotnet/roslyn#23984 (a usable regex parser for use in IDE scenarios) Regex pattern is: ```(?(?S))``` Exception happens here: ``` System.Text.RegularExpressions.RegexWriter.RegexCodeFromRegexTree(tree) Unknown System.Text.RegularExpressions.Regex.Regex(pattern, options, matchTimeout, useCache) Unknown System.Text.RegularExpressions.Regex.Regex(pattern, options) Unknown ``` -- Note: https://github.com/dotnet/roslyn/pull/23984 comes with several thousands of regex tests that could be adoped by corefx to help ensure that parsing either succeeds, or throws an ArgumentException as per the regex constructor documentation https://docs.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.regex.-ctor?view=netframework-4.7.1#System_Text_RegularExpressions_Regex__ctor_System_String_ 26486 area-Meta The `System.Json.JsonObject.Save(System.IO.Stream)` method produces invalid json. "The ""json"" this method writes to the stream puts a comma between keys and values, and does not separate the next key from the previous value with a comma. E.g. when you expect the output `{""foo"":""bar"",""baz"":""frop""}`, you will actually get something like `{""foo"",""bar""""baz"",""frop""}`. This bug has existed since the `JsonObject` class was invented in 2008, see [here](https://github.com/mono/mono/commit/66ecab0058cbf5c8aaa1c9ca89da52752d465eb4#diff-6a07ba1015d9ca7fc1b5b5a10859b17eR162). Perhaps the best fix would be to remove the override of `JsonValue.Save(Stream)` in `JsonObject` entirely; clearly nobody is using it (or this bug would have been noticed before), and the base implementation on `JsonValue` actually does the right thing." 26488 area-Infrastructure osx.10.13-x64 is not in the runtime.json "It cause restore on High Sierra failed, even when the package is considered ""any"". https://github.com/dotnet/corefx/blob/master/pkg/Microsoft.NETCore.Platforms/runtime.json#L1018 relate: https://github.com/dotnet/cli/issues/8436 " 26489 area-Microsoft.CSharp Refactor Microsoft.CSharp's SubstContext * Remove `SubstTypeFlags.NoRefOutDifference` Looked for, but never set. * Remove `SubstTypeFlags.DenormClass` Looked for, but never set. * Remove `SubstTypeFlags.Norm*` Looked for, but never set. * Remove `_stvcClass` No longer used. * Move init into ctor and make fields readonly * Remove unused ctors * Remove counts from `SubsContext` Just get them from the arrays. * `FNop()` method to `IsNop` property * Rename context's arrays Non-Hungarian based. * Remove `SubstTypeFlags` Only two values in use, so use boolean. * Remove `denormMeth` argument to `SubstEqualTypeArrays` Always true * Remove most uses of context in `ErrAppendType` Instead of setting to null, just use null. 26490 area-System.Net [ManagedHandler] Consider removing ManagedHandler.Supports* properties These properties don't seem useful. They are always true. These make more sense on HttpClientHandler, which depends on external platform code and thus may not be able to support these in all scenarios. Specific properties: SupportsAutomaticDecompression SupportsProxy SupportsRedirectConfiguration 26491 area-Microsoft.CSharp Remove orphaned methods from Microsoft.CSharp Remove some methods that are unused due to their call sites being removed by other dead-code removal. The sort of completely-dead code that would be identified in #17905 if the reports for that were run again. The first couple of commits here make use of methods that aren't being used, but were using them makes an improvement, and a further refactoring that doing that suggested, the last is just simple removal of methods that are never called. * Switch on `MethodSymbol.MethKind` instead of repeated tests. And make it a property. * Make `isConversionOperator` an assertion and remove `isExplicit` `isExplicit` is only used to assert the symbol is a conversion, so make the method itself an assertion property. * Use binary `MethWithType` ctor Rather than the nullary, only to set properties. * Make `UdConvInfo` a readonly struct * Remove orphaned methods. 26492 area-System.Net HttpClient: remove HttpVersionInternal This class seems to just duplicate the public HttpVersion. https://github.com/dotnet/corefx/blob/050288e637d5c43be5c208d9eeeed690b597c64f/src/System.Net.Primitives/src/System/Net/HttpVersion.cs#L7 https://github.com/dotnet/corefx/blob/050288e637d5c43be5c208d9eeeed690b597c64f/src/Common/src/System/Net/HttpVersionInternal.cs#L9 26493 area-System.Net [ManagedHandler] Which Windows proxy settings should be default? "As mentioned in #24574, there are actually two different ways to configure proxy settings on Windows: ""wininet style"" and ""winhttp style"". For the ""default"" proxy in the managed handler, it's not clear which of these settings to use. WinHttpHandler uses ""wininet style"" today, but there are scenarios where this is probably not the right choice (see linked issue above). cc @davidsh @wfurt" 26494 area-System.Net Support HttpWebRequest.GetSystemWebProxy() properly Today, on .net core, the IWebProxy returned from HttpWebRequest.GetSystemWebProxy() is a fake web proxy, a sentinel value which is checked for and handled specially in the existing WinHttpHandler/CurlHandler. See: https://github.com/dotnet/corefx/blob/6abde68de9611895fa8697fb7fc17105e906081e/src/System.Net.Requests/src/System/Net/SystemWebProxy.cs#L21 Now that we are adding real system proxy support for the managed handler, we should expose this via HttpWebRequest.GetSystemWebProxy(). This means updating the code in WinHttpHandler/CurlHandler so that the real proxy is appropriately handled. Related: It's slightly weird that we expose this only via HttpWebRequest. Ideally this would be factored separately from HttpWebRequest, e.g. something like SystemProxy.GetDefault in an assembly that both HttpWebRequest and HttpClient depend on. 26495 area-System.Net [ManagedHandler] Add request retry logic on IO failures We should support request retry logic for scenarios when sending a request fails due to server connection timeout or other issues. See my comments on #26453 for more details. 26496 area-System.Collections LargeArrayBuilder<T> optimization of Add and AddRange # Description Enabled range check elimination on array-access, and split the uncommon path to a separate non-inlining method, to make the hot path compacter. This PR is a kind of extension to #17318 # Benchmarks ## Add Code for benchmark is [here](https://github.com/gfoidl/Benchmarks/blob/master/corefx/System/Collections/Generic/LargeArrayBuilder/source/LargeArrayBuilderBenchmarks/Benchmarks/AddBenchmarks.cs) and in the parent directory (two levels up). ``` ini BenchmarkDotNet=v0.10.12, OS=ubuntu 16.04 Intel Xeon CPU 2.60GHz, 1 CPU, 4 logical cores and 2 physical cores .NET Core SDK=2.1.4 [Host] : .NET Core 2.0.5 (Framework 4.6.0.0), 64bit RyuJIT DefaultJob : .NET Core 2.0.5 (Framework 4.6.0.0), 64bit RyuJIT ``` | Method | Mean | Error | StdDev | Scaled | ScaledSD | |-------- |---------:|---------:|---------:|-------:|---------:| | Default | 432.3 us | 8.485 us | 19.67 us | 1.00 | 0.00 | | New1 | 390.7 us | 7.880 us | 19.77 us | 0.91 | 0.06 | ## AddRange Code for benchmark is [here](https://github.com/gfoidl/Benchmarks/blob/master/corefx/System/Collections/Generic/LargeArrayBuilder/source/LargeArrayBuilderBenchmarks/Benchmarks/AddRangeBenchmarks.cs) and in the parent directory (two levels up). ``` ini BenchmarkDotNet=v0.10.12, OS=ubuntu 16.04 Intel Xeon CPU 2.60GHz, 1 CPU, 4 logical cores and 2 physical cores .NET Core SDK=2.1.4 [Host] : .NET Core 2.0.5 (Framework 4.6.0.0), 64bit RyuJIT DefaultJob : .NET Core 2.0.5 (Framework 4.6.0.0), 64bit RyuJIT ``` | Method | Mean | Error | StdDev | Scaled | ScaledSD | |-------- |---------:|---------:|---------:|-------:|---------:| | Default | 973.0 us | 19.21 us | 21.36 us | 1.00 | 0.00 | | New1 | 842.1 us | 13.26 us | 12.41 us | 0.87 | 0.02 | | New2 | 900.3 us | 16.75 us | 15.67 us | 0.93 | 0.03 | Note: `New1` is used in this PR. `New2` was a try, that didn't satisfy but for the record it is in the results. 26497 area-System.Numerics Plane.D gives a negative distance for the Z = 10 Plane?! "If this is not a bug, at least it is a good example showing why I keep asking the implementers about their conventions and why not putting them in the documentation: ``` var P = Plane.CreateFromVertices( new Vector3(0, 0, 10), new Vector3(6, 0, 10), new Vector3(3, 4, 10)); Console.WriteLine(P.D); ``` D is -10. Why? This is the Z = 10 plane, so where the negative sign came from? Documents says: > The distance of the plane along its normal from the origin This should give a positive distance ! Above all, distance should be an absolute value, because the normal vector holds the direction. EDIT: In this example, the normal vectors for the planes P1 and P2 are identical, although the two planes are parallel and in oposite directions of the Z axis. ``` var P1 = Plane.CreateFromVertices( new Vector3(0, 0, 10), new Vector3(6, 0, 10), new Vector3(3, 4, 10)); Console.WriteLine(P1.Normal.ToString()); // <0, 0, 1> var P2 = Plane.CreateFromVertices( new Vector3(0, 0, -10), new Vector3(6, 0, -10), new Vector3(3, 4, -10)); Console.WriteLine(P2.Normal.ToString()); // <0, 0, 1> ``` This indicates that the origin is not always the start point of the vector, which is strang and confusing! What is the rule used here if this is not a bug? It is always a good thing to state the basic conventions in documents. At least we can report bugs when we know they are bugs!! EDIT: D shounldn't be refered to as ""the distance in documentation"". Distance is a scaler value that is always positive. Abs(D) is the distance! If the normal vector (a, b, c) is normalized, then the plane equation is: ax + by + cz + D = 0 By the way, this equation is mentioned in DirectX documents. It is important to put this equation in the documents of the Plane constructor. Now it is clear why D has a sign, and why the field is called D not Distance. It is a coefficient not just the absolute distance. May be things be less confusing if you added a Distance property besides the D field. This equation give meaning to some plane methods like Plane.DotCoordinate which can be used to determine if a point belongs to the plane (if it returns 0). The problem with this method is that plane must have a normalized normal vector to give the desired result, but the plane can be constructed with a vector that is not normalized! Maybe Plane.Normal should always return the normalized normal vector. another problem of cource is that it may not return 0 because single. I think adding such notes to documentation would make programmers life happier. Programmers don't care about math. They want a method to determine if a point is on the plane surface or not, to detect a collision or something. Maybe it's better to add a Plane.ContainsPoint method and make sure to avoid the single round problem. Maybe something like this: ``` public bool ContainsPoint(Vector3 point) { var n = this.Normal; if( n.Length != 1) n = Vector3.Normalize(n); return Math.Round(Vector3.Dot(point, n) + this.D) == 0; } ``` " 26499 area-System.Numerics Issue #24343 Vector Ctor using Span Fixes #24343. Depends on dotnet/coreclr#16733 for successful compilation. Kindly see my comments in the issue #24343. Raising this PR based on my understanding... @KrzysztofCwalina @terrajobst @karelz @jkotas @mellinoe @ahsonkhan @benaadams @stephentoub Appreciate reviews and feedback. Thanks, Mandar 26501 area-System.Text Regex fails to accept pattern that it probably should. "Found while writing dotnet/roslyn#23984 (a usable regex parser for use in IDE scenarios) The pattern in question is: ```(cat)(\c[*)(dog)``` According to .net regex rules ```\c[``` is supposed to match ""the ASCII control character that is specified by X or x, where X or x is the letter of the control character."" So, in this case it should match the ```[``` control character (equivalent to ```\u001b```). But, instead, the .net regex parser fails on this. The reason for this is that it does a prepass where it attempts to find all the captures (```CountCaptures()```). But during that prepass escape handling is different from the normal parse: https://github.com/dotnet/corefx/blob/353bdc62ccb5c56148bf0e31814f1fd4f84a7fd9/src/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexParser.cs#L1644-L1649 As you can see, when it sees an escape ```\```, it just skips the next character and the proceeds to scanning normally. This means it only skips the ```\c``` and goes back to its normal loop. This makes it think that ```[``` is the start of a character class, which then causes it to fail since that character class is unterminated. The appropriate fix would likely be to not just do ```MoveRight()``` here, but instead use ```ScanBackslash()``` the same way the code does ScanCharClass immediately below: https://github.com/dotnet/corefx/blob/353bdc62ccb5c56148bf0e31814f1fd4f84a7fd9/src/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexParser.cs#L1659-L1661" 26502 area-Meta Fix various issues with System.Json.JsonValue.Save "The `JsonObject` class overrides `JsonValue.Save(Stream)`, but was implemented incorrectly: it would produce output resembling `{""key1"",""value1""""key2"",""value2""}`, instead of the more reasonable `{""key1"": ""value1"", ""key2"": ""value2""}`. Because `JsonValue` already contains code that can properly serialize a `JsonObject`, the override now simply calls the base method. In addition, it turns out that the `JsonValue.Save(Stream)` method was also implemented incorrectly. This method would invoke `JsonValue.Save(TetxtWriter)`, but the `StreamWriter` it created was never flushed or disposed, so output could go missing. In addition, it would encode json as utf-8, but would include a BOM, while none of the methods that override `JsonValue.Save(Stream)` would write a BOM. Both these issues have been resolved. The tests have also been modified to test for the new and correct behavior. Fixes #26486" 26503 area-System.Net Feature to work-around HttpClient violating IDisposable Pattern Could some type of a HttpClient Pool be implemented? That way when we have several requests to a root path, we get one reusable HttpClient Context. And we aren't tempted to change the initialized Url. Which causes issues that are difficult to track down. ``` // Notice that IDisposable is not implemented here! public interface HttpClientHandle { HttpRequestHeaders DefaultRequestHeaders { get; } Uri BaseAddress { get; set; } // ... // All the other public property and method prototypes from peeking at HttpClient } public static class HttpClientPool { public static ConditionalWeakTable<Uri, HttpClientHander> _httpClientsPool; static HttpClientPool() { _httpClientsPool = new ConditionalWeakTable<Uri, HttpClientHander>(); SetupGlobalPoolFinalizer(); } public static HttpClientHandle GetHttpClientHandle(Uri baseUrl) { HttpClientHander httpClient = _httpClientsPool.GetOrCreateValue(baseUrl); httpClient.ResetDisposelTimeout(); httpClient.BaseAddress = baseUrl; return httpClient; } private static void SetupGlobalPoolFinalizer() { AppDomain.CurrentDomain.ProcessExit += (sender, eventArgs) => { FinalizeGlobalPool(); }; } private static void FinalizeGlobalPool() { foreach (var client in _httpClientsPool) client.Value.PerformDispose(); _httpClientsPool.Clear(); } } internal class HttpClientHander : HttpClient, HttpClientHandle, IDisposable { private DateTime _delayFinalization = DateTime.MinValue; private bool _isDisposed = false; void IDisposable.Dispose() { } protected override void Dispose(bool disposing) { if (_isDisposed) base.Dispose(disposing); } internal void PerformDispose() { _isDisposed = true; GC.SuppressFinalize(this); base.Dispose(); } internal void ResetDisposelTimeout() { _delayFinalization = DateTime.MinValue; } protected bool ShouldDelayDisposal() { if (_delayFinalization == DateTime.MinValue) _delayFinalization = DateTime.UtcNow; return DateTime.UtcNow.Subtract(_delayFinalization) < base.Timeout; } ~HttpClientHander() { if (ShouldDelayDisposal()) GC.ReRegisterForFinalize(this); } } ``` Declaring that the code example shown here is under the dotnet/corefx license - MIT. And it is desired that this code, or any changed versions thereof, be contributed to dotnet/corefx if it is found useful. 26506 area-System.Net MediaTypeHeaderValue doesn't allow empty string Empty string is not allowed in `MediaTypeHeaderValue`, is there any particular reason to forbid setting empty string in Content-Type header? Azure Storage allows empty string in Content-Type, we don't want to forbid this on client side. 26508 area-Infrastructure Passing additional CMake arguments to Native build `build-native.sh` has options `cmakeargs` for passing additional arguments to CMake. But if I want add `-D_FORTIFY_SOURCE=2` option to `CXXFLAGS` it will be applied to `corefx/src/Native/Unix/configure.cmake` (which cause errors on test programs compilation). If I add this option to `corefx/src/Native/Unix/CMakeLists.txt` it will applied to source code only (as expected). Is there other way to pass this and others options to build without patching source code? If not is it possible to change `cmakeargs` behavior or add some other logic? This behavior is the same for CoreCLR too. cc @BruceForstall @jkotas cc @chunseoklee 26511 area-System.Net Several small ManagedHandler fixes (1) Don't check for HTTP 2.0 on response, since we should never see this (2) Remove IP parsing logic and just let ConnectAsync handle this (3) Fix proxy auth retry handling (4) Fix IDNA host name handling in proxy case (5) Various test additions/fixes @stephentoub @Priya91 @wfurt @davidsh 26513 area-System.Runtime Register memory ranges that might cause access violation and throw manged exception "## Rational When using memory mapped files, there is the need to handle the standard set of I/O issues, however, the CoreCLR currently expose not such way to do so. In the Full .Net Framework, there is `HandleProcessCorruptedStateExceptions`, which provide some answer to that. However, that require to modify all call sites and is a bit of throwing the baby with the bath waters. The Core CLR should be able to handle such scenarios cleanly and easily. Example problem usage: ``` var mmf = MemoryMappedFile.CreateFromFile(""file-with-bad-sectory.dat""); var accessor = mmf.CreateViewAccessor(); accessor.ReadByte(positionOfBadSectory); ``` This code will error with an `SEHException` on Windows, killing the entire process. As it currently stands, there is no good way to protect against this at all. ### Proposed solution Provide a way to register memory ranges with the execution engine that will not be subject to the same behavior. When an access violation occurs, the CLR will first check if the memory range of the error occurred in one of these ranges, and if so, will translate the error into a normal manage exception, subject to all the usual rules of such exceptions. In particular, this will not be a process killer. This is similar to how a memory access on the first 64KB of the address space is translated to a managed `NullReferenceException`. ### Proposed API ``` namespace System.Runtime { public static class MemoryAccessViolationBehavior { public static IDisposable ThrowOnInvalidMemoryAccessInRange(IntPtr start, long length, object errorState); } } ``` Sample usage: ``` using(MemoryAccessViolationBehavior.ThrowOnInvalidMemoryAccessInRange(start, len)) { // in here we an access violation to in [start ... start + len] will throw } ``` #### The exception thrown The exception thrown in this case will be a new one: ``` namespace System.Runtime { public class InvalidMemoryAccessException : Exception { // the marker object that was used on the ThrowOnInvalidMemoryAccessInRange call public object ErrorState { get;set; } // the memory range that caused the error public IntPtr MemoryLocation { get; set; } // the native error code that caused this issue, SEH code or the si_errno public int NativeErrorCode { get; set; } // standard exception impl } } ``` #### Semantics * This must be thread safe and thread agnostic. Multiple threads may use a range concurrently and expect to be able to enter and exit it at the same time. * Another use case if long running memory range that is mapped once and then used for a long duration. This is common for larger sections (a mmap on a 100GB file, for example, that may live for as long as the application itself) * It is fine to have overlapping ranges, if the error happens in _any_ range that matches a registered one, the exception will be thrown instead of killing the process. The ErrorState object used can be any of the registered objects for the range. * The reasoning for the `ErrorState` is that it would make it much easier for users to be able to track down the error if they could tag the range with some meaningful value, such as the file name, for example. #### Implementation details * Internally each range should have ref count, and removed when there are no more interested parties to it. * A question occurs about what to do when the range neither held nor disposed, such as in this case: `MemoryAccessViolationBehavior.ThrowOnInvalidMemoryAccessInRange(start, len)`. In this case, there are two options. First, we can have the return object implement a finalizer, which will clear the range protection. Alternatively, we can threat this as intentional sign from the user that they never want to clear the protection of this range. I'm inclined to the first option, because assuming that the user intentionally ignored the disposable is probably a bad idea. * This proposal is intentionally not tied to the `MemoryMappedFile` API, because it should be useful for other types of memory. Either calling directly to the native API (`mmap` / `CreateViewOfFile`) or using other types of shared memory (`shm_open`, etc). #### Potential issues with this proposal A user may register a range, then free it and then it is used for some other purpose, which can raise memory access errors, these errors would then be erroneously reported as exception instead of crashing the process. Given that this is an explicit (and very low level) API, I don't think that this can happen by accident, and the error is explicit enough that it should be obvious what happened, especially given the optional state. #### Other considerations This behavior should ideally apply for managed code and native code alike. Calling a method such as `memcpy` on a range of `mmap` memory can trigger the error as easily as if it was accessed directly. That said, what about the behavior when this occurs during GC, for example? That would be a clear error, and I'm not sure what the behavior of that should be. Note that this is in contrast to how `NullReferencException` works right now, consider: ``` [DllImport(""msvcrt.dll"", EntryPoint = ""memcmp"")] public static extern int Compare(byte* b1, byte* b2, long count); static void Main(string[] args) { byte* f = (byte*)0; try { *f = 1; } catch (NullReferenceException) { Console.WriteLine(""NRE""); } Compare(f, f, 1); } ``` The managed code accessing the invalid null pointer will get a `NullReferenceExecption` while native code will raise an `AccessViolationException` in the debugger and kill the process otherwise. I don't know if this behavior can be applied to native code as well in the same manner (gut feeling is probably not), but even just in managed code, that would be sufficient." 26517 area-System.Net Socket.ConnectAsync could optimize better for IP addresses ConnectHelper.ConnectAsync is doing IPAddress.TryParse to determine if the hostname is an IP Address. Ideally it shouldn't need to do this; it should just pass the DnsEndPoint to Socket.ConnectAsync and let that determine if it's an IP address or a DNS name. Unfortunately, the current Socket.ConnectAsync code doesn't optimize for IP addresses in DnsEndPoint, so the current code in ConnectHelper will perform better for IP addresses. We should fix Socket.ConnectAsync to optimize better for IP addresses and then switch ManagedHandler to use this directly. Note, the current code will end up trying to parse the hostname as an IPAddress twice, since Socket.ConnectAsync will need to do this eventually. This is probably cheap, so shouldn't matter much in practice. EDIT stephentoub 4/23/2018: SocketsHttpHandler is now always using DnsEndPoint, due to https://github.com/dotnet/corefx/issues/29285. 26518 area-System.Memory Rename Pin offset to byteOffset and clean up Retain test - Leftover test clean up from https://github.com/dotnet/corefx/pull/25770#discussion_r162998101 - Renaming offset to byteOffset: https://github.com/dotnet/corefx/issues/25229#issuecomment-359541147 cc @AtsushiKan, @jkotas, @KrzysztofCwalina 26519 area-System.Diagnostics Process.Modules does not include the main (entry) DLL on Linux "When running on Windows `System.Diagnostics.Process.Modules` includes the main ""executable"" DLL itself, as expected. When running on Linux it doesn't. Repro, including output on Windows and Linux: [CoreProcessModulesTest.zip](https://github.com/dotnet/corefx/files/1653536/CoreProcessModulesTest.zip) (tested on Windows 7 x64 and Ubuntu 14.04 x64, dotnet SDK 2.1.4). This happens both for the current process and another process. This was already mentioned in https://github.com/dotnet/corefx/issues/25652 amongst other things, but it's not really clear to me what that issue is primarily about, so I wanted to raise a separate one for this bug with repro code. " 26520 area-System.Runtime System.Runtime.CompilerServices.Unsafe.dll can't be loaded by Xamarin.Mac Xamarin.Mac can't load System.Runtime.CompilerServices.Unsafe.dll which used within Microsoft.Extensions.Primitives. The issue is: System.Runtime.CompilerServices.Unsafe isn't supported in current version Xamarin.Mac v4.x.x.x (and probably, Mono v4.5 and later), which supports netstandard2.0. So lot of packages, which require this library as dependency or sub-dependency are not-runnable at those platforms (but still compilable) Microsoft.Extensions.Primitives used within lot of base libraries e.g Microsoft.Extensions.Options, Microsoft.Extensions.Caching.Abstractions, Microsoft.Extensions.Configuration.Abstractions etc. They are used at least within Microsoft.EntityFrameworkCore So, Microsoft.EntityFrameworkCore unusable with Xamarin.Mac Example project with issue appearing available here: [example project](https://github.com/lsvhome/RuntimeBugAppearance). This project is compilable, but it crashes at runtime. More details described [here](https://github.com/aspnet/Common/pull/308) [Rejected bugfix #1](https://github.com/aspnet/Common/pull/308) [Rejected bugfix #2](https://github.com/aspnet/Common/pull/309) [Linked issue](https://github.com/aspnet/Home/issues/2790) ----- below you may see piece of output of application which uses package [Microsoft.EntityFrameworkCore.Sqlite](https://www.nuget.org/packages/Microsoft.EntityFrameworkCore.Sqlite) ... Loaded assembly: /Users/testuser/Projects/exampleapplication/exampleapplication.Mac/bin/Debug/exampleapplication.app/Contents/MonoBundle/Microsoft.Extensions.Primitives.dll [External] Could not find `System.Runtime.CompilerServices.Unsafe` referenced by assembly `Microsoft.Extensions.Primitives, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60`. Could not find `System.Runtime.CompilerServices.Unsafe` referenced by assembly `Microsoft.Extensions.Caching.Abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60`. Could not find `System.Runtime.CompilerServices.Unsafe` referenced by assembly `Microsoft.EntityFrameworkCore, Version=2.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60`. Could not find `System.Runtime.CompilerServices.Unsafe` referenced by assembly `exampleapplication, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null`. 26523 area-System.Threading [API] Timer.UnsafeCreate Suggested in https://github.com/dotnet/corefx/pull/26071#issuecomment-358820050 ```csharp namespace System.Threading { partial class Timer { static Timer UnsafeCreate(TimerCallback callback, object state, TimeSpan dueTime, TimeSpan period); } } ``` Creates a timer that doesn't capture AsyncLocal state (for lazy init for global timers from partially unrelated code) Related fixes https://github.com/dotnet/corefx/pull/26065, https://github.com/dotnet/corefx/pull/26066, https://github.com/dotnet/corefx/pull/26071, https://github.com/dotnet/corefx/pull/26077, https://github.com/dotnet/corefx/pull/26068 26525 area-System.Net Enable HttpProtocolTests test cases on .NET Core Removed test data which will fail on .NET Framework, .NET Core and ManagedHandler. Enabled all test data which will pass on .NET Core and ManagedHandler. Closes: #26455 Contributes: #24713 26527 area-System.Runtime API Proposal : Arm64 Load, store & cast ```C# namespace System.Runtime.Intrinsics.Arm.Arm64 { public static class Simd { /// <summary> /// Vector load /// /// Corresponds to vector form of ARM64 LDR /// </summary> public static unsafe Vector64<T> LoadVector64<T >(void* address) where T : struct { throw null; } public static unsafe Vector128<T> LoadVector128<T>(void* address) where T : struct { throw null; } /// <summary> /// Vector static cast /// /// Change base element type w/o conversion. /// /// Corresponds to vector form of ARM64 MOV /// </summary> public static Vector64<U> StaticCast<T, U>(Vector64<T> value) where T : struct where U : struct { throw null; } public static Vector128<U> StaticCast<T, U>(Vector128<T> value) where T : struct where U : struct { throw null; } /// <summary> /// Vector store /// /// Corresponds to vector form of ARM64 STR /// </summary> public static unsafe void Store<T>(void* address, Vector64<T> source) where T : struct { throw null; } public static unsafe void Store<T>(void* address, Vector128<T> source) where T : struct { throw null; } } } 26528 area-System.Memory Add 'split' support for ReadOnlySpan<char> similar to string Split off from https://github.com/dotnet/corefx/issues/21395#issuecomment-359342832 _From @Joe4evr on January 21, 2018 23:16_ > Can I throw in another suggestion? I'd really like to see some ability to split a `ReadOnlySpan<char>`. Obviously, you can't return a collection of `Span`s directly, but isn't that what `Memory<T>` is for? ```cs // equivalent to the overloads of 'String.Split()' public static IReadOnlyList<ReadOnlyMemory<char>> Split(this ReadOnlySpan<char> span, char[] seperator); public static IReadOnlyList<ReadOnlyMemory<char>> Split(this ReadOnlySpan<char> span, char[] seperator, int count); public static IReadOnlyList<ReadOnlyMemory<char>> Split(this ReadOnlySpan<char> span, char[] seperator, int count, StringSplitOptions options); public static IReadOnlyList<ReadOnlyMemory<char>> Split(this ReadOnlySpan<char> span, char[] seperator, StringSplitOptions options); public static IReadOnlyList<ReadOnlyMemory<char>> Split(this ReadOnlySpan<char> span, string[] seperator, int count, StringSplitOptions options); public static IReadOnlyList<ReadOnlyMemory<char>> Split(this ReadOnlySpan<char> span, string[] seperator, StringSplitOptions options); ``` > The reason for choosing `IReadOnlyList<T>` is to make the resulting collection indexable, just like `string[]`. It would be nice if the implementation is `ImmutableArray<T>`, but I'm not sure if that's a concern for distribution and such. --- _From @ahsonkhan on January 22, 2018 01:36_ > @Joe4evr, out of curiosity, do you have a scenario atm where these APIs would be useful? If so, can you please show the code sample? > I would replace the char[] overloads with ReadOnlySpan\<char\>. However, I am not sure about adding the split APIs, in general, given they have to allocate. Is there a way to avoid allocating? Also, given these are string-like APIs for span, it is strange to have an overload that takes a string[]. Maybe all these would fit better on ReadOnlyMemory instead, especially given the return type. --- _From @Joe4evr on January 22, 2018 08:35_ > My scenario is taking a relatively big string of user input and then parsing that to populate a more complex object. So rather than take the whole string at once, I'd like to parse it in pieces at a time. It'd be pretty nice if this can be facilitated by the `Span`/`Memory<T>` APIs so that this code won't have to allocate an extra 30-40 tiny strings whenever it runs. > Admittedly, I only started on this particular case earlier today, mostly to experiment and find out how much I could get out of the Span APIs at this time. > Maybe it was a bit naive of me to expect a collection like I did, but I'd at least like to see some API to deal with this scenario a little easier, because I'll probably not be the only one looking to split a span up into smaller chunks like this. --- _From @stephentoub on January 22, 2018 08:41_ > Splitting support would be good, but I don't think it would look like the proposed methods; as @ahsonkhan points out, that would result in a lot of allocation (including needing to copy the whole input string to the heap, since you can't store the span into a returned interface implementation). > I would instead expect a design more like an iterator implemented as a ref struct, e.g. ```C# public ref struct CharSpanSplitter { public CharSpanSplitter(ReadOnlySpan<char> value, char separator, StringSplitOptions options); public bool TryMoveNext(out ReadOnlySpan<char> result); } ``` cc @KrzysztofCwalina, @stephentoub, @Joe4evr 26532 area-System.Runtime MemoryCache needs a way to handle physical memory pressure on Linux We need to design a way to allow MemoryCache to handle physical memory pressure. This could be something similar to what we do on Windows (just with a different lookup table to translate the memory % usage to the actual pressure - for this we will likely need #25617 to be implemented first). Or this could be some additional extensibility point to allow user code to communicate memory pressure back to cache. 26534 area-Microsoft.CSharp Remove skeletal caching from ExprVisitorBase in Microsoft.CSharp Methods exist to build caching layer out of, but without actually implementing it. Any such cache would almost never have a cache hit, so remove it. 26535 area-System.Net ServicePoint retrieved via FindServicePoint does not contain server certificate A typical way to obtain the server certificate after making a request via `HttpClient` is to use `ServicePointManager.FindServicePoint` with the URI and grab the `Certificate` property off of that. This works fine in .NET 4.5, as evidenced by this fragment from a [workbook]:  However, in a .NET Core application, this doesn't work:  You can also see the attached project in [certificate-test.zip](https://github.com/dotnet/corefx/files/1654414/certificate-test.zip). It contains a sample you can download and `dotnet run`. ## `dotnet --info` output: ``` .NET Command Line Tools (2.1.4) Product Information: Version: 2.1.4 Commit SHA-1 hash: 5e8add2190 Runtime Environment: OS Name: Windows OS Version: 10.0.16299 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\2.1.4\ Microsoft .NET Core Shared Framework Host Version : 2.0.5 Build : 17373eb129b3b05aa18ece963f8795d65ef8ea54 ``` [workbook]: https://github.com/Microsoft/workbooks 26536 area-System.Runtime Consider disabling timers in MemoryCache when they are not needed There are cases when MemoryCache doesn't have both cache size limit and physical memory limit. In this case it would be beneficial to never start the timer that invokes the code to enforce those limits. 26537 area-System.Runtime MemoryCache.GetLastSize() returns percentage of the limit instead of the absolute size Unfortunately this is the same on desktop .NET MemoryCache. We should fix it because even if someone can derive the approximate cache size from the returned percentage (which is approximate by itself) this won't work if there is no cache size limit set... 26538 area-System.Runtime Properly use SizeRef in MemoryCache once it is exposed in CoreClr Once https://github.com/dotnet/coreclr/issues/14561 is fixed MemoryCache should start using it. 26539 area-System.Net Test failure: System.Net.Http.Functional.Tests.SchSendAuxRecordHttpTest / HttpClient_ClientUsesAuxRecord_Ok ## Type of failures ``` System.TimeoutException : Task timed out after 15000 at System.Threading.Tasks.TaskTimeoutExtensions.<TimeoutAfter>d__0.MoveNext() at System.Net.Http.Functional.Tests.SchSendAuxRecordHttpTest.<HttpClient_ClientUsesAuxRecord_Ok>d__2.MoveNext() in E:\A\_work\2359\s\corefx\src\System.Net.Http\tests\FunctionalTests\SchSendAuxRecordHttpTest.cs:line 80 --- End of stack trace from previous location where exception was thrown --- ``` ## History of failures Day | Build | OS | Details -- | -- | -- | -- 1/3 | 20180103.03 | Win7 | 1/20 | 20180120.02 | Win7 | [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180120.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.SchSendAuxRecordHttpTest~2FHttpClient_ClientUsesAuxRecord_Ok) 1/20 | 20180120.02 | Win7 | [ManagedHandler] [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180120.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.ManagedHandler_SchSendAuxRecordHttpTest~2FHttpClient_ClientUsesAuxRecord_Ok) 1/28 | 20180128.04 | Win7 | [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180128.04/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.ManagedHandler_SchSendAuxRecordHttpTest~2FHttpClient_ClientUsesAuxRecord_Ok) 3/23 | 20180323.03 | Win10 | PlatformHandler 3/23 | 20180323.03 | Win10 | SocketsHttpHandler 26540 area-System.Net HTTP Status Description is parsed incorrectly on Windows ".NET Core will trims out space characters when parsing HTTP status description on Windows. This is not correct. Quote https://github.com/dotnet/corefx/pull/26525#issuecomment-359627454 Based on the ABNF in section 3.1.2 of [the RFC](https://tools.ietf.org/html/rfc7230): ``` status-line = HTTP-version SP status-code SP reason-phrase CRLF reason-phrase = *( HTAB / SP / VCHAR / obs-text ) ``` The reason phrase (status description) can consist entirely of spaces (SP). We should keep the spaces as part of the status description. ```c# System.Net.Http.Functional.Tests.HttpProtocolTests_Dribble.GetAsync_ExpectedStatusCodeAndReason_Success(statusLine: \""HTTP/1.1 200 Something\"", expectedStatusCode: 200, expectedReason: \"" Something\"") [FAIL] Assert.Equal() Failure ↓ (pos 0) Expected: Something Actual: Something ↑ (pos 0) Stack Trace: D:\corefx\src\System.Net.Http\tests\FunctionalTests\HttpProtocolTests.cs(65,0): at System.Net.Http.Functional.Tests.HttpProtocolTests.<>c__DisplayClass3_0.<<GetAsyncSuccessHelper>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- D:\corefx\src\Common\tests\System\Net\Http\LoopbackServer.cs(67,0): at System.Net.Test.Common.LoopbackServer.<>c__DisplayClass3_0.<CreateServerAsync>b__0(Task t) E:\A\_work\1275\s\src\mscorlib\shared\System\Threading\ExecutionContext.cs(151,0): at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) E:\A\_work\1275\s\src\mscorlib\src\System\Threading\Tasks\Task.cs(2440,0): at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) --- End of stack trace from previous location where exception was thrown --- D:\corefx\src\System.Net.Http\tests\FunctionalTests\HttpProtocolTests.cs(50,0): at System.Net.Http.Functional.Tests.HttpProtocolTests.<GetAsyncSuccessHelper>d__3.MoveNext() D:\corefx\src\System.Net.Http\tests\FunctionalTests\HttpProtocolTests.cs(34,0): at System.Net.Http.Functional.Tests.HttpProtocolTests.<GetAsync_ExpectedStatusCodeAndReason_Success>d__1.MoveNext() --- End of stack trace from previous location where exception was thrown --- ``` Managed Handler doesn't has this issue." 26541 area-System.Security # Issue while signing the TPM protected keys. "* Summary I can able to create the TPM protected key by passing the provider while creating the key below is the piece of code. CngKey.Create(CngAlgorithm.ECDsaP256, _keyName, new CngKeyCreationParameters { KeyCreationOptions = CngKeyCreationOptions.MachineKey,Provider = new CngProvider(""Microsoft Platform Crypto Provider"") }); I can able to create the TPM protected key and open the key as well. The problem is while signing the key. Since the algorithm group is set to RSA instead of ECDSA. This algorithm group is set based on the provider at this point it is setting the wrong algorithm group internally. * Reference Source Browser https://github.com/Microsoft/referencesource/blob/master/System.Core/System/Security/Cryptography/CngKey.cs # Solution: If the algorithm group is set to appropriate group then the signing won't be a problem. Please update ASAP " 26542 area-System.Net Behavior difference when parsing invalid HTTP status line on Windows "From RFC 7230: 3.1.2. Status Line > The first line of a response message is the status-line, consisting of the protocol version, a space (SP), the status code, another space, a possibly empty textual phrase describing the status code, and ending with CRLF. ``` status-line = HTTP-version SP status-code SP reason-phrase CRLF ``` For invalid HTTP status line (ignore the optional reason-phrase part), like `""HTTP/1.1\t200 OK""`, `""HTTP/1.1 200\tOK""`, or `""HTTP/1.1 200\t""`: both on .NET Framework and Managed Handler will throw `HttpRequestException`. On .NET Framework: ```c# System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.WebException : The server committed a protocol violation. Section=ResponseStatusLine ``` On .NET Core ManagedHandler: ```c# System.Net.Http.HttpRequestException : The server returned an invalid or unrecognized response. ``` However, those invalid values will be parsed fine without throwing any Exception on .NET Core Windows. We need to fix this behavior difference." 26543 area-System.Text Fix OOM in regex for large regex quantifier "Fix #26484 As an optimization, the regex engine tries to establish a definite prefix that matches must have, if it can. For example ""a{5,10}bcd"" indicates all matches must begin with ""aaaaa"". If there is such a prefix, the engine can use Boyer-Moore to skip more quickly to the next plausible match. It is optional though (as far as I can tell). As implemented the code constructs a string with the prefix. So if the quantifier is very large, it will run out of memory. This could be avoided with a larger change, but I'm making a minimal change to not make prefix strings larger than 10^6 characters, an arbitrarily large number that can still be formed into a string." 26544 area-System.Xml UTF32Encoding and XmlTransformation when ByteOrderMark is set to false still contains the mark on .NET Core 2 "I've been updating Cake to be .NET Standard 2.0 and run on `netcoreapp2.0` here: https://github.com/cake-build/cake/pull/1812 There was a battery of XML tests that were full framework only that I enabled for `netstandard2.0` because they now exist on that footprint. There's one problem test that works still on `net46`/`net461` but not on `netcoreapp2.0` ```csharp [Fact] public void Should_Transform_Xml_String_And_Xsl_String_To_Result_String_With_Utf32Xml_Declaration() { // Given var xml = Resources.XmlTransformation_Xml; var xsl = Resources.XmlTransformation_Xsl; var settings = new XmlTransformationSettings { Encoding = new UTF32Encoding(false, false, true) }; // When var result = string.Concat(XmlTransformation.Transform(xsl, xml, settings).Take(39)); // Then Assert.Equal(""<?xml version=\""1.0\"" encoding=\""utf-32\""?>"", result); } ``` I can't tell if it's just an issue with `UTF32Encoding` (I don't believe so) or something else in the XML Transform." 26546 area-System.Data SqlBulkCopy.WriteToServer(table) fails with DBNull strings, and empty strings on varchar(max) columns "I have hit two issues with strings in SqlBulkCopy.WriteToServer(DataTable) in .Net Core and found that the code functions properly on .Net. This is running against Azure SQL. Here is a cut-down example, first the DB setup, then C# fragment, then the results: ``` CREATE TABLE TestVarchar100 ( Str varchar(100) NULL ) CREATE TABLE TestVarcharMax ( Str varchar(max) NULL ) ``` ``` static void Test(SqlConnection connection, string tableName, object strValue) { string printableStrValue = (strValue is DBNull) ? ""DBNull"" : $""\""{strValue}\""""; try { using (SqlBulkCopy bulkCopier = new SqlBulkCopy(connection)) { var table = new DataTable(tableName); table.Columns.Add(new DataColumn(""Str"", Type.GetType(""System.String""))); var row = table.NewRow(); row[""Str""] = strValue; table.Rows.Add(row); bulkCopier.BatchSize = 100; bulkCopier.DestinationTableName = tableName; bulkCopier.BulkCopyTimeout = 120; bulkCopier.WriteToServer(table); Console.WriteLine($""Setting {tableName}.Str = {printableStrValue} succeeded""); } } catch (Exception ex) { Console.WriteLine($""Setting {tableName}.Str = {printableStrValue} FAILED: {ex.Message}""); } } static void TestAll(string connectionString) { using (SqlConnection connection = new SqlConnection(connectionString)) { connection.Open(); Test(connection, ""TestVarchar100"", ""foo""); Test(connection, ""TestVarchar100"", """"); Test(connection, ""TestVarchar100"", DBNull.Value); Test(connection, ""TestVarcharMax"", ""foo""); Test(connection, ""TestVarcharMax"", """"); Test(connection, ""TestVarcharMax"", DBNull.Value); } } static void Main(string[] args) { Console.WriteLine($""Version: {Environment.Version.ToString()}""); TestAll(ConfigurationManager.ConnectionStrings[""TestVarcharDB""].ConnectionString); } ``` Running against .NET gives: ``` Version: 4.0.30319.42000 Setting TestVarchar100.Str = ""foo"" succeeded Setting TestVarchar100.Str = """" succeeded Setting TestVarchar100.Str = DBNull succeeded Setting TestVarcharMax.Str = ""foo"" succeeded Setting TestVarcharMax.Str = """" succeeded Setting TestVarcharMax.Str = DBNull succeeded ``` Running against .Net Core (on a Mac) gives: ``` Version: 4.0.30319.42000 Setting TestVarchar100.Str = ""foo"" succeeded Setting TestVarchar100.Str = """" succeeded Setting TestVarchar100.Str = DBNull FAILED: Specified cast is not valid. Setting TestVarcharMax.Str = ""foo"" FAILED: Bulk load data was expected but not sent. The batch will be terminated. Setting TestVarcharMax.Str = """" FAILED: The service has encountered an error processing your request. Please try again. Error code 4804. Setting TestVarcharMax.Str = DBNull FAILED: Unable to read data from the transport connection: Connection reset by peer. ``` However, when I first started debugging the issue against my real code (which attempted to insert rows with some varchar(max) columns set to DBNull), I was getting error 4815: ``` The service has encountered an error processing your request. Please try again. Error code 4815. ``` [Please let me know the correct repo to report this if this isn't it.] " 26547 area-System.Net Disable 307 LargePayload again Test failed with managed handler again, disabling before further investigation. 26556 area-System.Net Handling WinHttpException / Replacing it "I encountered this exception recently from a `WebSocket` instance: ```c# System.AggregateException: One or more errors occurred. (The connection with the server was terminated abnormally) ---> System.Net.Http.WinHttpException: The connection with the server was terminated abnormally at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() at System.Net.WebSockets.WinHttpWebSocket.<ReceiveAsync>d__27.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at X.<ReceiveStringAsync>d__29.MoveNext() in C:\X.cs:line 228 --- End of inner exception stack trace --- at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification) at X.<Run>d__25.MoveNext() in C:\X.cs:line 83 ---> (Inner Exception #0) System.Net.Http.WinHttpException (0x80072EFF): The connection with the server was terminated abnormally at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() at System.Net.WebSockets.WinHttpWebSocket.<ReceiveAsync>d__27.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at X.<ReceiveStringAsync>d__29.MoveNext() in C:\X.cs:line 228<--- ``` A `WebSocket` was closed incorrectly by the server and an `AggregateException` was thrown, which wrapped a `WinHttpException`. `WinHttpException` inherits from `Win32Exception`. I'm hesitant to handle either of these in the fear that it may not work on other platforms. I could possibly parse the exception message for ""The connection with the server was terminated abnormally"", but that is ugly and susceptible to framework changes. Could this `WinHttpException` be replaced with a platform agnostic version that can be handled easily?" 26560 area-System.Memory String-like Span extension methods - Trim / IsWhiteSpace Part of the APIs proposed in https://github.com/dotnet/corefx/issues/21395 - Trim, TrimStart, TrimEnd with overloads - IsWhiteSpace - ~Vectorized implementations are 3-5x faster than the naiive non-vectorized implementation for span.Length > 100. The overhead breaks even at about span.Length == 16 and results in a small performance hit for very small spans.~ **Edit:** Reverting the vectorization `Trim(ReadOnlySpan<char> trimChars)`  `Trim(char trimChar)`  `Trim()` (specialized for Latin1 characters)  `IsWhiteSpace` (specialized for Latin1 characters)  cc @jkotas, @stephentoub, @AtsushiKan, @benaadams, @dotnet/corefxlab-contrib, @tarekgh 26561 area-System.IO Directory.CreateDirectory throwing wrong exception Hi, When trying to create a new directory (or file) from my ASP.NET Core app to a location I do not necessarily have access to, I get a `FileNotFoundException` with the following message: Could not find file 'D:\Users\Shimmy\Documents\Visual Studio 2017\Projects\MyProject\Api\FilesVault\1afb42e2-f160-4f6d-9eab-a82ca3cbf076'. Here's my code: if (!Directory.Exists(path)) { try { Directory.CreateDirectory(path); } catch (FileNotFoundException) {//breakpoint - debugger breaks here //No documentation of FileNotFoundException to be thrown from that method. } } In addition, the following message pops up in the Windows 10 notification center:  I understand I don't have proper access to that folder, I'm just here to wonder out why it's `FileNotFoundException` rather than one of the documented types. 26563 area-System.Memory Add MemoryPool apis Fixes https://github.com/dotnet/corefx/issues/26357 26564 area-System.Runtime API Proposal : ARM64 Crypto HW Intrinsics ```C# namespace System.Runtime.Intrinsics.Arm.Arm64 { public static class Aes { public static bool IsSupported { get { throw null; } } // <summary> /// Performs AES single round decryption /// vaesdq_u8 (uint8x16_t data, uint8x16_t key) ///</summary> public static Vector128<byte> Decrypt(Vector128<byte> value, Vector128<byte> roundKey) { throw null; } // <summary> /// Performs AES single round encryption /// vaeseq_u8 (uint8x16_t data, uint8x16_t key) ///</summary> public static Vector128<byte> Encrypt(Vector128<byte> value, Vector128<byte> roundKey) { throw null; } // <summary> /// Performs AES Mix Columns /// vaesmcq_u8 (uint8x16_t data) ///</summary> public static Vector128<byte> MixColumns(Vector128<byte> value) { throw null; } // <summary> /// Performs AES inverse mix columns /// vaesimcq_u8 (uint8x16_t data) ///</summary> public static Vector128<byte> InverseMixColumns(Vector128<byte> value) { throw null; } } public static class Sha1 { public static bool IsSupported { get { throw null; } } // <summary> /// Performs SHA1 hash update choose form. /// vsha1cq_u32 (uint32x4_t hash_abcd, uint32_t hash_e, uint32x4_t wk) ///</summary> public static Vector128<uint> HashChoose(Vector128<uint> hash_abcd, uint hash_e, Vector128<uint>wk) { throw null; } // <summary> /// Performs SHA1 hash update majority form. /// vsha1mq_u32 (uint32x4_t hash_abcd, uint32_t hash_e, uint32x4_t wk) ///</summary> public static Vector128<uint> HashMajority(Vector128<uint> hash_abcd, uint hash_e, Vector128<uint>wk) { throw null; } // <summary> /// Performs SHA1 hash update parity form. /// vsha1pq_u32 (uint32x4_t hash_abcd, uint32_t hash_e, uint32x4_t wk) ///</summary> public static Vector128<uint> HashParity(Vector128<uint> hash_abcd, uint hash_e, Vector128<uint>wk) { throw null; } // <summary> /// Performs SHA1 fixed rotate /// vsha1h_u32 (uint32_t hash_e) ///</summary> public static uint FixedRotate(uint hash_e) { throw null; } // <summary> /// Performs SHA1 schedule update 0 /// vsha1su0q_u32 (uint32x4_t w0_3, uint32x4_t w4_7, uint32x4_t w8_11) ///</summary> public static Vector128<uint> SchedulePart1(Vector128<uint> w0_3, Vector128<uint> w4_7, Vector128<uint> w8_11) { throw null; } // <summary> /// Performs SHA1 schedule update 1 /// vsha1su1q_u32 (uint32x4_t tw0_3, uint32x4_t w12_15) ///</summary> public static Vector128<uint> SchedulePart2(Vector128<uint> tw0_3, Vector128<uint> w12_15) { throw null; } } public static class Sha256 { public static bool IsSupported { get { throw null; } } // <summary> /// Performs SHA256 hash update (part 1). /// vsha256hq_u32 (uint32x4_t hash_abcd, uint32x4_t hash_efgh, uint32x4_t wk) ///</summary> public static Vector128<uint> HashLower(Vector128<uint> hash_abcd, Vector128<uint> hash_efgh, Vector128<uint> wk) { throw null; } // <summary> /// Performs SHA256 hash update (part 2). /// vsha256h2q_u32 (uint32x4_t hash_efgh, uint32x4_t hash_abcd, uint32x4_t wk) ///</summary> public static Vector128<uint> HashUpper(Vector128<uint> hash_efgh, Vector128<uint> hash_abcd, Vector128<uint> wk) { throw null; } // <summary> /// Performs SHA256 schedule update 0 /// vsha256su0q_u32 (uint32x4_t w0_3, uint32x4_t w4_7) ///</summary> public static Vector128<uint> SchedulePart1(Vector128<uint> w0_3, Vector128<uint> w4_7) { throw null; } // <summary> /// Performs SHA256 schedule update 1 /// vsha256su1q_u32 (uint32x4_t tw0_3, uint32x4_t w8_11, uint32x4_t w12_15) ///</summary> public static Vector128<uint> SchedulePart2(Vector128<uint> tw0_3, Vector128<uint> w8_11, Vector128<uint> w12_15) { throw null; } } } ``` 26565 area-Microsoft.CSharp Avoid cast of Microsoft.CSharp's binder types. Bind casts from `DynamicMetaObjectBinder` (base of all the C# binders) to `ICSharpBinder` (implemented by all C# binders), but adding `ReturnType` to `ICSharpBinder` allows that type to be used throughout. Since `ReturnType` is virtual anyway there's no extra cost on the call, and the type safety can now be statically confirmed rather than just asserted. 26566 area-System.IO [Regression] Tests failed: System.IO.Compression.Brotli.Performance.Tests - 20min timeout on Windows System.IO.Compression.Brotli.Performance.Tests test suite started failing with 'fire' on Windows platforms in build 20180120.01. Looking at a few logs it seems that xunit doesn't print anything after initial output and infra kills it after 20 min: ``` Discovering: System.IO.Compression.Brotli.Performance.Tests Discovered: System.IO.Compression.Brotli.Performance.Tests Starting: System.IO.Compression.Brotli.Performance.Tests ``` Note Ubuntu17.04 'fire' failures are across all tests (the image went EOL), please ignore it. The platform should be removed from our test run matrix on 1/25. ## History of failures Day | Build | Failures -- | -- | -- 1/20 | [20180120.01](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180120.01/workItem/System.IO.Compression.Brotli.Performance.Tests) | 4x (Win10-x86 & Win10.Core-x86 & Win7-x86 & Win8.1-x86) 1/20 | [20180120.02](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180120.02/workItem/System.IO.Compression.Brotli.Performance.Tests) | 4x (Win10-x86 & Win10.Core-x86 & Win7-x86 & Win8.1-x86) 1/21 | [20180121.01](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180121.01/workItem/System.IO.Compression.Brotli.Performance.Tests) | 4x (Win10-x86 & Win10.Core-x86 & Win7-x86 & Win8.1-x86) 1/21 | [20180121.02](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180121.02/workItem/System.IO.Compression.Brotli.Performance.Tests) | 3x (Win10-x86 & Win10.Core-x86 & Win7-x86) 1/22 | [20180122.01](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180122.01/workItem/System.IO.Compression.Brotli.Performance.Tests) | 4x (Win10-x86 & Win10.Core-x86 & Win7-x86 & Win8.1-x86) 1/22 | [20180122.02](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180122.02/workItem/System.IO.Compression.Brotli.Performance.Tests) | 4x (Win10-x86 & Win10.Core-x86 & Win7-x86 & Win8.1-x64) 1/23 | [20180123.01](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180123.01/workItem/System.IO.Compression.Brotli.Performance.Tests) | 3x (Win10.Core-x86 & Win7-x86 & Win8.1-x64) 1/23 | [20180123.04](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180123.04/workItem/System.IO.Compression.Brotli.Performance.Tests) | 4x (Win10-x86 & Win10.Core-x86 & Win7-x86 & Win8.1-x64) 1/24 | [20180124.02](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180124.02/workItem/System.IO.Compression.Brotli.Performance.Tests) | 5x (Win10-x86 & Win10.Core-x86 & Win7-x64 & Win7-x86 & Win8.1-x86) 1/24 | [20180124.06](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180124.06/workItem/System.IO.Compression.Brotli.Performance.Tests) | 1x (Win8.1-x64) - note: -x86 runs didn't execute in this build 1/25 | [20180125.01](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180125.01/workItem/System.IO.Compression.Brotli.Performance.Tests) | 3x (Win10-x86 & Win10.Core-x86 & Win7-x86) 1/25 | [20180125.06](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180125.06/workItem/System.IO.Compression.Brotli.Performance.Tests) | 5x (Win10-x86 & Win10.Core-x86 & Win7-x64 & Win7-x86 & Win8.1-x86) 1/25 | [20180125.08](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180125.08/workItem/System.IO.Compression.Brotli.Performance.Tests) | 5x (Win10-x86 & Win10.Core-x86 & Win7-x64 & Win7-x86 & Win8.1-x86) 1/26 | [20180126.03](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180126.03/workItem/System.IO.Compression.Brotli.Performance.Tests) | 5x (Win10-x86 & Win10.Core-x86 & Win7-x64 & Win7-x86 & Win8.1-x86) 1/27 | [20180127.01](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180127.01/workItem/System.IO.Compression.Brotli.Performance.Tests) | 5x (Win10-x86 & Win10.Core-x86 & Win7-x64 & Win7-x86 & Win8.1-x86) 1/27 | [20180127.04](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180127.04/workItem/System.IO.Compression.Brotli.Performance.Tests) | 5x (Win10-x86 & Win10.Core-x86 & Win7-x86 & Win8.1-x64 & Win8.1-x86) 1/28 | [20180128.01](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180128.01/workItem/System.IO.Compression.Brotli.Performance.Tests) | 5x (Win10-x86 & Win10.Core-x86 & Win7-x86 & Win8.1-x64 & Win8.1-x86) 1/28 | [20180128.04](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180128.04/workItem/System.IO.Compression.Brotli.Performance.Tests) | 5x (Win10-x86 & Win10.Core-x86 & Win7-x86 & Win8.1-x64 & Win8.1-x86) 1/29 | [20180129.01](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180129.01/workItem/System.IO.Compression.Brotli.Performance.Tests) | 5x (Win10-x86 & Win10.Core-x86 & Win7-x64 & Win7-x86 & Win8.1-x86) 1/29 | [20180129.05](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180129.05/workItem/System.IO.Compression.Brotli.Performance.Tests) | 1x (Win8.1-x64) - note: -x86 runs didn't execute in this build 1/30 | [20180130.01](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180130.01/workItem/System.IO.Compression.Brotli.Performance.Tests) | 5x (Win10-x86 & Win10.Core-x86 & Win7-x64 & Win7-x86 & Win8.1-x86) 1/30 | [20180130.05](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180130.05/workItem/System.IO.Compression.Brotli.Performance.Tests) | 5x (Win10-x86 & Win10.Core-x86 & Win7-x86 & Win8.1-x64 & Win8.1-x86) 26567 area-System.Net ManagedHandler and SslClientAuthenticationOptions Currently the ManagedHandler's API is derived from the existing HttpClientHandler API, and thus has these properties related to SSL: - ClientCertificates - ServerCertificateCustomValidationCallback - CheckCertificateRevocationList - SslProtocols But there are additional configurable features related to SSL that are supported by SslStream, e.g. - LocalCertificateSelectionCallback - ApplicationProtocols - TargetHost - CertificateRevocationCheckMode (instead of just a bool) - EncryptionPolicy and likely more to come. As part of making ManagedHandler public, we should consider replacing all of the existing properties with one property for SslClientAuthenticationOptions. That'll give the ManagedHandler all of these properties, while also making it easy for it to pass it through to SslStream, and it'll avoid the need to add additional properties to the handler API as additional properties are exposed on SslClientAuthenticationOptions; we'd simply need to update the implementation. In doing this, we could then also look at updating ClientWebSocketOptions to take an SslClientAuthenticationOptions, such that it could just pass this through to ManagedHandler and implicitly pick up the implementation of all such options. 26568 area-Infrastructure Cross-Compiling: missing sources.list.jessie for ARM For building a cross-compilation `rootfs` `./cross/build-rootfs.sh` will copy a `source.list` to the `/etc/apt/sources.list` file on the generated `rootfs` If you try to invoke `./cross/build-rootfs.sh` with the `ARM` architecture for a `jessie` style distribution (like for example the Raspbian OS which is a `jessie`-like `Debian`.) like shown below the build-script cannot find the sources.list file to copy and the `apt-get install` command will fail because of missing package references. ``` ./cross/build-rootfs.sh arm jessie ``` **Solution:** copy the `./cross/arm/sources.list.jessie` file from the https://github.com/dotnet/coreclr.git repository. Applies to: `git checkout tags/v2.0.5` 26569 area-Infrastructure Cross-compilation for ARM fails OS: Ubuntu Xenial 16.04.3 LTS x64 `git checkout tags/v2.0.5` Cross-compiling for ARM using the following command-line: ``` sh ./build.sh -release -os=Linux -buildArch=arm ``` The command fails during native compilation of `System.Security.Cryptography.Native` with the following error: ``` [ 67%] Building CXX object System.Security.Cryptography.Native/CMakeFiles/objlib.dir/openssl.cpp.o In file included from /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/openssl.cpp:8: /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:344:1: error: use of undeclared identifier 'CRYPTO_add_lock' FOR_ALL_OPENSSL_FUNCTIONS ^ /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:83:24: note: expanded from macro 'FOR_ALL_OPENSSL_FUNCTIONS' PER_FUNCTION_BLOCK(CRYPTO_add_lock, true) \ ^ /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:344:1: error: use of undeclared identifier 'CRYPTO_num_locks' /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:84:24: note: expanded from macro 'FOR_ALL_OPENSSL_FUNCTIONS' PER_FUNCTION_BLOCK(CRYPTO_num_locks, true) \ ^ /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:344:1: error: use of undeclared identifier 'CRYPTO_set_locking_callback' /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:85:24: note: expanded from macro 'FOR_ALL_OPENSSL_FUNCTIONS' PER_FUNCTION_BLOCK(CRYPTO_set_locking_callback, true) \ ^ /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:344:1: error: use of undeclared identifier 'd2i_ASN1_type_bytes' /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:88:24: note: expanded from macro 'FOR_ALL_OPENSSL_FUNCTIONS' PER_FUNCTION_BLOCK(d2i_ASN1_type_bytes, true) \ ^ /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:344:1: error: use of undeclared identifier 'ERR_load_crypto_strings' /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:149:24: note: expanded from macro 'FOR_ALL_OPENSSL_FUNCTIONS' PER_FUNCTION_BLOCK(ERR_load_crypto_strings, true) \ ^ /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:344:1: error: use of undeclared identifier 'EVP_CIPHER_CTX_cleanup' /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:160:24: note: expanded from macro 'FOR_ALL_OPENSSL_FUNCTIONS' PER_FUNCTION_BLOCK(EVP_CIPHER_CTX_cleanup, true) \ ^ /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:344:1: error: use of undeclared identifier 'EVP_CIPHER_CTX_init'; did you mean 'EVP_CIPHER_CTX_nid'? /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:162:24: note: expanded from macro 'FOR_ALL_OPENSSL_FUNCTIONS' PER_FUNCTION_BLOCK(EVP_CIPHER_CTX_init, true) \ ^ /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/../../cross/rootfs/arm/usr/include/openssl/evp.h:437:5: note: 'EVP_CIPHER_CTX_nid' declared here int EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx); ^ In file included from /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/openssl.cpp:8: /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:344:1: error: use of undeclared identifier 'EVP_MD_CTX_create'; did you mean 'EVP_MD_CTX_free'? FOR_ALL_OPENSSL_FUNCTIONS ^ /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:177:24: note: expanded from macro 'FOR_ALL_OPENSSL_FUNCTIONS' PER_FUNCTION_BLOCK(EVP_MD_CTX_create, true) \ ^ /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/../../cross/rootfs/arm/usr/include/openssl/evp.h:499:6: note: 'EVP_MD_CTX_free' declared here void EVP_MD_CTX_free(EVP_MD_CTX *ctx); ^ In file included from /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/openssl.cpp:8: /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:344:1: error: use of undeclared identifier 'EVP_MD_CTX_destroy' FOR_ALL_OPENSSL_FUNCTIONS ^ /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:178:24: note: expanded from macro 'FOR_ALL_OPENSSL_FUNCTIONS' PER_FUNCTION_BLOCK(EVP_MD_CTX_destroy, true) \ ^ /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:344:1: error: use of undeclared identifier 'HMAC_CTX_cleanup' /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:196:24: note: expanded from macro 'FOR_ALL_OPENSSL_FUNCTIONS' PER_FUNCTION_BLOCK(HMAC_CTX_cleanup, true) \ ^ /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:344:1: error: use of undeclared identifier 'HMAC_CTX_init'; did you mean 'HMAC_CTX_new'? /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:197:24: note: expanded from macro 'FOR_ALL_OPENSSL_FUNCTIONS' PER_FUNCTION_BLOCK(HMAC_CTX_init, true) \ ^ /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/../../cross/rootfs/arm/usr/include/openssl/hmac.h:24:11: note: 'HMAC_CTX_new' declared here HMAC_CTX *HMAC_CTX_new(void); ^ In file included from /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/openssl.cpp:8: /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:344:1: error: use of undeclared identifier 'OPENSSL_add_all_algorithms_conf' FOR_ALL_OPENSSL_FUNCTIONS ^ /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:216:24: note: expanded from macro 'FOR_ALL_OPENSSL_FUNCTIONS' PER_FUNCTION_BLOCK(OPENSSL_add_all_algorithms_conf, true) \ ^ /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:344:1: error: use of undeclared identifier 'SSL_library_init'; did you mean 'SSL_in_init'? /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:273:24: note: expanded from macro 'FOR_ALL_OPENSSL_FUNCTIONS' PER_FUNCTION_BLOCK(SSL_library_init, true) \ ^ /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/../../cross/rootfs/arm/usr/include/openssl/ssl.h:937:5: note: 'SSL_in_init' declared here int SSL_in_init(SSL *s); ^ In file included from /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/openssl.cpp:8: /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:344:1: error: use of undeclared identifier 'SSL_load_error_strings'; did you mean 'ERR_lib_error_string'? FOR_ALL_OPENSSL_FUNCTIONS ^ /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:274:24: note: expanded from macro 'FOR_ALL_OPENSSL_FUNCTIONS' PER_FUNCTION_BLOCK(SSL_load_error_strings, true) \ ^ /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/../../cross/rootfs/arm/usr/include/openssl/err.h:226:13: note: 'ERR_lib_error_string' declared here const char *ERR_lib_error_string(unsigned long e); ^ In file included from /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/openssl.cpp:8: /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:344:1: error: use of undeclared identifier 'SSL_state'; did you mean 'SSL_write'? FOR_ALL_OPENSSL_FUNCTIONS ^ /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:282:24: note: expanded from macro 'FOR_ALL_OPENSSL_FUNCTIONS' PER_FUNCTION_BLOCK(SSL_state, true) \ ^ /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/../../cross/rootfs/arm/usr/include/openssl/ssl.h:1596:12: note: 'SSL_write' declared here __owur int SSL_write(SSL *ssl, const void *buf, int num); ^ In file included from /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/openssl.cpp:8: /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:344:1: error: use of undeclared identifier 'SSLv3_method' FOR_ALL_OPENSSL_FUNCTIONS ^ /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:284:24: note: expanded from macro 'FOR_ALL_OPENSSL_FUNCTIONS' PER_FUNCTION_BLOCK(SSLv3_method, false) \ ^ /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:344:1: error: 'TLSv1_1_method' is deprecated [-Werror,-Wdeprecated-declarations] /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:286:24: note: expanded from macro 'FOR_ALL_OPENSSL_FUNCTIONS' PER_FUNCTION_BLOCK(TLSv1_1_method, true) \ ^ /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/../../cross/rootfs/arm/usr/include/openssl/ssl.h:1630:45: note: 'TLSv1_1_method' has been explicitly marked deprecated here DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_1_method(void)) /* TLSv1.1 */ ^ In file included from /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/openssl.cpp:8: /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:344:1: error: 'TLSv1_2_method' is deprecated [-Werror,-Wdeprecated-declarations] FOR_ALL_OPENSSL_FUNCTIONS ^ /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:287:24: note: expanded from macro 'FOR_ALL_OPENSSL_FUNCTIONS' PER_FUNCTION_BLOCK(TLSv1_2_method, true) \ ^ /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/../../cross/rootfs/arm/usr/include/openssl/ssl.h:1636:45: note: 'TLSv1_2_method' has been explicitly marked deprecated here DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_2_method(void)) /* TLSv1.2 */ ^ In file included from /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/openssl.cpp:8: /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:344:1: error: 'TLSv1_method' is deprecated [-Werror,-Wdeprecated-declarations] FOR_ALL_OPENSSL_FUNCTIONS ^ /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.h:288:24: note: expanded from macro 'FOR_ALL_OPENSSL_FUNCTIONS' PER_FUNCTION_BLOCK(TLSv1_method, true) \ ^ /home/fredrik/Documents/Source/GitHub/dotnet-corefx/src/Native/../../cross/rootfs/arm/usr/include/openssl/ssl.h:1624:45: note: 'TLSv1_method' has been explicitly marked deprecated here DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_method(void)) /* TLSv1.0 */ ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated. System.Security.Cryptography.Native/CMakeFiles/objlib.dir/build.make:62: recipe for target 'System.Security.Cryptography.Native/CMakeFiles/objlib.dir/openssl.cpp.o' failed make[2]: *** [System.Security.Cryptography.Native/CMakeFiles/objlib.dir/openssl.cpp.o] Error 1 CMakeFiles/Makefile2:346: recipe for target 'System.Security.Cryptography.Native/CMakeFiles/objlib.dir/all' failed make[1]: *** [System.Security.Cryptography.Native/CMakeFiles/objlib.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: *** [all] Error 2 Failed to build corefx native components. Command execution failed with exit code 1. ``` Installed all dependencies as described in [UNIX instructions - Prerequisites (native build)](https://github.com/dotnet/corefx/blob/master/Documentation/building/unix-instructions.md#user-content-linux): ``` bash sudo apt install --yes install git clang-3.9 cmake make libc6-dev libssl-dev libkrb5-dev libcurl4-openssl-dev zlib1g-dev install libunwind8 libicu55 curl ``` Successfully built a `rootfs` file system using the instruction described in [Cross Compilation for ARM on Linux](https://github.com/dotnet/corefx/blob/master/Documentation/building/cross-building.md) and the fix described in #26568 to create a `rootfs` for ARM / `jessie`. 26570 area-System.Threading Fix some Channel issues These issues caught during the code review of the Channel code. 26572 area-System.Net SslStream.Read hangs (race condition on dispose?) My process sometimes seems to hang, and I was able to capture a stack trace, it ends with: ``` System.Private.CoreLib.dll!System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() Unknown Non-user code. Skipped loading symbols. System.Net.Security.dll!System.Net.Security.SslState.CheckThrow(bool authSuccessCheck, bool shutdownCheck) Unknown Non-user code. Skipped loading symbols. System.Net.Security.dll!System.Net.Security.SslState.SecureStream.get() Unknown Non-user code. Skipped loading symbols. System.Net.Security.dll!System.Net.Security.SslStream.Read(byte[] buffer, int offset, int count) Unknown Non-user code. Skipped loading symbols. ``` Now, the specific scenario here is that I'm trying to dispose a connection, so I called the `SslStream.Dispose` from another thread, but it seems like it either didn't take or it might have corrupted some state. The `SslStream` is wrapping a `NetworkStream`, and that one is safe to close while it is running, I'm _guessing_ that `SslStream` isn't? 26573 area-System.Net Enable some HttpProtocolTests test cases and skip them on .NET Core Windows run WinHttpHandler behaves differently from .NET Framework and ManagedHandler in some rare response parsing cases. Consider theses two parsing differences on 1. optional status description field 2. `HTAB` in status line, we don't want to make product change and regress 2.0. But some test cases needed to be skipped for WinHttpHandler. Closes: #26540 Closes: #26542 **EDIT**: CurlHandler also behaves differently. Disable test cases on it as well. 26574 area-System.Runtime [Arm64] SIMD HW Intrinsic API scope and high level design Most of the intrinsics with clear and exact match to X86 have been proposed and have open issues. This is intended as a draft design/scoping exercise for the SIMD class to help ease further API reviews. **Naming conventions** + Intrinsic names will roughly follow instruction descriptions in ARMv8 ARM tables from section C3 A64 Instruction Set Overview + Drop adjectives ~~Floating~~, ~~Signed~~, ~~unsigned~~. These will be handled by type system + Use `*Add`, `*Subtract` postfix for accumulating forms + Use modifiers w/o abbreviation `Absolute`, `Halving`, `Numeric`, `Extend`, `Polynomial`, `Saturating`. `Rounding`, `Doubling`, `High`, `Long`, `Wide`, `Narrow`, `Upper`, `Lower` `RoundEven`, `RoundZero`, `RoundPos`, `RoundNeg`, `RoundAway` + For example `SQDMULH` `Signed saturating doubling multiply returning high half` would naturally become `SaturatingDoublingMultiplyHigh`. and would be the proposed intrinsic name **Argument conventions** + Binary operators will take `left` and `right` arguments + Unary operators will take a `value` argument + Instruction which insert into high half, will take a source operand which is the `target` register to be inserted into. This will typically be the first argument. The Method name will typically have a suffix `Upper` + Instruction with adding or subtracting accumulators will take a source operand which is the `acc` register. This will be the left operand in the add/subtract. + Argument order will typically be in left to right order following ARM assembly conventions. Exception can and will occur. Especially when copying a X86 C# API. **Lowering/Containment** + Whenever an intrinsic can easily be expressed through containment without loss it should be dropped + If there are intermediate truncation/rounding/overflow issues, this rejects containment as identical results can not be guaranteed. + By element forms will typically be exposed through containment. **Scope/state of instructions/intrinsics** Outline follows `ARMv8 ARM reference Manual C3. A64 Instruction Set Overview` with focus on SIMD If intrinsic design looks straight forward, no comments are shown. Outline is exhaustive to allow for discussion. - [ ] Load/Store scalar SIMD - [x] Load/Store scalar SIMD #26527 - [ ] Load/Store scalar SIMD register pair Recommendation: `ValueTuple<Vector64<A>, Vector64<B>> LoadVector64Pair<A,B>(void * address)` `void Store<A,B>(void * address, ValueTuple<Vector64<A>, Vector64<B>>)` - [ ] Load/Store scalar SIMD register Non-temporal pair Recommendation: `ValueTuple<Vector64<A>, Vector64<B>> LoadVector64NonTemporalPair<A,B>(void * address)` `void StoreNonTemporal<A,B>(void * address, ValueTuple<Vector64<A>, Vector64<B>>)` - [ ] Load/Store Vector - [ ] Load/Store structures (multiple structures) Recommendation: `Vector64<A> LoadVector64<A>(void * address, Vector64<A> target)` `ValueTuple<Vector64<A>, ... > LoadVector64Tuple<A,B,C,D>(void * address, ValueTuple<...> target)` `void Store<A>(void * address, Vector64<A> target)` `void Store<A,B,C,D>(void * address, ValueTuple<Vector...> target)` - [ ] Load/Store structures (single structures) Recommendation: `Vector64<A> LoadVector64<A>(void * address, Vector64<A> target, byte index)` `ValueTuple<Vector64<A>, ... > LoadVector64Tuple<A,B,C,D>(void * address, ValueTuple<...> target, byte index)` `void Store<A>(void * address, Vector64<A> target, byte index)` `void Store<A,B,C,D>(void * address, ValueTuple<Vector...> target, byte index)` - [ ] Load single structure and replicate Recommendation: `Vector64<A> LoadAllVector64<A>(void * address)` `ValueTuple<Vector64<A>, ... Vector64<D>> LoadAllVector64Tuple<A,B,C,D>(void * address)` - [ ] Floating-point conversion - [ ] convert to floating-point Recommendation: `Vector64<float> ConvertToVector64Single(Vector64<int> a)` `Vector128<doulble> ConvertToVector128Double(Vector128<ulong> a)` - [x] SIMD move - [ ] SIMD arithmetic - [x] Partial see #26179 for basic ops - [ ] Rest mostly simple application of naming conventions above - [ ] SIMD compare - [ ] SIMD widening and narrowing arithmetic - [ ] SIMD unary arithmetic Use `ReverseElementBits` for `REV` Use `ReverseElementBytes` for `REV16`, `REV32`, `REV64` (separate names would make implementation slightly simpler.) - [ ] SIMD by element arithmetic Whenever possible treat the element as the base type & contain the `Extract` element intrinsic - [ ] SIMD permute - [ ] SIMD immediate Handle these when feasible by containment/lowering - [ ] SIMD shift (immediate) - [ ] SIMD floating-point and integer conversion `ConvertTo*` i.e. `ConvertToSingleRoundNearest` - [ ] SIMD reduce (across vector lanes) Use `*Across` per ARM convention ~~(or `Horizontal*` per X86 convention.)~~ - [ ] SIMD pairwise arithmetic `*Pairwise` - [ ] SIMD table lookup 26575 area-System.Data System.Data.DataSetExtensions has MSFT key in .NET Core and ECMA in Desktop, causing identities to be different This type is causing to have different assembly identities in between .NET Core and NETFX, since we're stating in the OOB package that in NETFX the implementation is inbox, this breaks that support for when trying to use this type since it lives in System.Data for NETFX. cc: @weshaggard @danmosemsft 26576 area-System.Data Add netfx placeholder configuration to System.Data.DataSetExtensions Contributes to: https://github.com/dotnet/corefx/issues/24903 Fixes: https://github.com/dotnet/corefx/issues/26575 26577 area-Infrastructure Update runtime.json to include missing RIDs This brings the runtime.json changes introduced in #26439 to the release/2.0.0 branch as requested. It looks like the overall shape of the file has diverged a bit between master and release/2.0.0, so the diff is showing the file as completely changed. As far as I can tell this doesn't remove any RIDs, just adding them and rearranging the ones that are already in the file. cc: @joshfree @ianhays 26578 area-Serialization Port #26304 into 2.0 branch #26304 This change need be ported into 2.0 because the serialization will break once try to serialize a type belong to an assembly without location info e.g. Assemblies are dynamically loaded into a custom AssemblyLoadContext, using the LoadFromStream method. 26579 area-System.Collections Respect IReadOnlyList<T> in the BCL The following condition appears in many variations plenty of times throughout the BCL, especially in LINQ, (From [`ElementAt`](https://github.com/dotnet/corefx/blob/master/src/System.Linq/src/System/Linq/ElementAt.cs#L28-L31)): ```c# if (source is IList<TSource> list) { return list[index]; } ``` But there is also `IReadOnlyList<T>` which provides the same thing and is not considered because it doesn't overlap with `IList<T>`, and the fact that random access is provided by it is neglected in the BCL. Why is that? Similar to `ICollection<T>` and `IReadOnlyCollection<T>`, see #23578. 26580 area-System.Runtime [Arm64] HW Intrinsics API 26581 area-System.Runtime API Proposal : API More SIMD HW Intrinsics ```C# namespace System.Runtime.Intrinsics.Arm.Arm64 { public static class Simd { public static bool IsSupported { get { throw null; } } /// <summary> /// Vector CompareGreaterThanOrEqual /// For each element result[elem] = (|left[elem]| >= |right[elem]|) ? ~0 : 0 /// Corresponds to vector forms of ARM64 FACGE /// </summary> public static Vector64<float> AbsoluteCompareGreaterThanOrEqual(Vector64<float> left, Vector64<float> right) { throw null; } public static Vector128<float> AbsoluteCompareGreaterThanOrEqual(Vector128<float> left, Vector128<float> right) { throw null; } public static Vector128<double> AbsoluteCompareGreaterThanOrEqual(Vector128<double> left, Vector128<double> right) { throw null; } /// <summary> /// Vector CompareGreaterThan /// /// For each element result[elem] = (|left[elem]| > |right[elem]|) ? ~0 : 0 /// /// Corresponds to vector forms of ARM64 FACGT /// </summary> public static Vector64<float> AbsoluteCompareGreaterThan(Vector64<float> left, Vector64<float> right) { throw null; } public static Vector128<float> AbsoluteCompareGreaterThan(Vector128<float> left, Vector128<float> right) { throw null; } public static Vector128<double> AbsoluteCompareGreaterThan(Vector128<double> left, Vector128<double> right) { throw null; } /// <summary> /// Vector absolute difference /// Corresponds to vector forms of ARM64 SABD, UABD & FABD /// </summary> public static Vector64<byte> AbsoluteDifference(Vector64<byte> left, Vector64<byte> right) { throw null; } public static Vector64<byte> AbsoluteDifference(Vector64<sbyte> left, Vector64<sbyte> right) { throw null; } public static Vector64<ushort> AbsoluteDifference(Vector64<ushort> left, Vector64<ushort> right) { throw null; } public static Vector64<ushort> AbsoluteDifference(Vector64<short> left, Vector64<short> right) { throw null; } public static Vector64<uint> AbsoluteDifference(Vector64<uint> left, Vector64<uint> right) { throw null; } public static Vector64<uint> AbsoluteDifference(Vector64<int> left, Vector64<int> right) { throw null; } public static Vector64<float> AbsoluteDifference(Vector64<float> left, Vector64<float> right) { throw null; } public static Vector128<byte> AbsoluteDifference(Vector128<byte> left, Vector128<byte> right) { throw null; } public static Vector128<byte> AbsoluteDifference(Vector128<sbyte> left, Vector128<sbyte> right) { throw null; } public static Vector128<ushort> AbsoluteDifference(Vector128<ushort> left, Vector128<ushort> right) { throw null; } public static Vector128<ushort> AbsoluteDifference(Vector128<short> left, Vector128<short> right) { throw null; } public static Vector128<uint> AbsoluteDifference(Vector128<uint> left, Vector128<uint> right) { throw null; } public static Vector128<uint> AbsoluteDifference(Vector128<int> left, Vector128<int> right) { throw null; } public static Vector128<float> AbsoluteDifference(Vector128<float> left, Vector128<float> right) { throw null; } public static Vector128<double> AbsoluteDifference(Vector128<double> left, Vector128<double> right) { throw null; } /// TBD Addhn, Addhn2 /// <summary> /// Vector absolute difference add /// /// For each element result[elem] = acc[elem] + | left[elem] - right[elem] | /// /// Corresponds to vector forms of ARM64 SABA, UABA /// </summary> public static Vector64<byte> AbsoluteDifferenceAdd(Vector64<byte> acc, Vector64<byte> left, Vector64<byte> right) { throw null; } public static Vector64<byte> AbsoluteDifferenceAdd(Vector64<sbyte> acc, Vector64<sbyte> left, Vector64<sbyte> right) { throw null; } public static Vector64<ushort> AbsoluteDifferenceAdd(Vector64<ushort> acc, Vector64<ushort> left, Vector64<ushort> right) { throw null; } public static Vector64<ushort> AbsoluteDifferenceAdd(Vector64<short> acc, Vector64<short> left, Vector64<short> right) { throw null; } public static Vector64<uint> AbsoluteDifferenceAdd(Vector64<uint> acc, Vector64<uint> left, Vector64<uint> right) { throw null; } public static Vector64<uint> AbsoluteDifferenceAdd(Vector64<int> acc, Vector64<int> left, Vector64<int> right) { throw null; } public static Vector128<byte> AbsoluteDifferenceAdd(Vector128<byte> acc, Vector128<byte> left, Vector128<byte> right) { throw null; } public static Vector128<byte> AbsoluteDifferenceAdd(Vector128<sbyte> acc, Vector128<sbyte> left, Vector128<sbyte> right) { throw null; } public static Vector128<ushort> AbsoluteDifferenceAdd(Vector128<ushort> acc, Vector128<ushort> left, Vector128<ushort> right) { throw null; } public static Vector128<ushort> AbsoluteDifferenceAdd(Vector128<short> acc, Vector128<short> left, Vector128<short> right) { throw null; } public static Vector128<uint> AbsoluteDifferenceAdd(Vector128<uint> acc, Vector128<uint> left, Vector128<uint> right) { throw null; } public static Vector128<uint> AbsoluteDifferenceAdd(Vector128<int> acc, Vector128<int> left, Vector128<int> right) { throw null; } /// <summary> /// Vector add pairwise /// For each byte result[byte] = 2*byte < result.Length ? (left[2*byte] + left[2*byte + 1]) : (right[2*byte - result.Length] + right[2*byte + 1 - result.Length]) /// Corresponds to vector forms of ARM64 ADDP & FADDP /// </summary> public static Vector64<T> AddPairwise<T>(Vector64<T> left, Vector64<T> right) where T : struct { throw null; } public static Vector128<T> AddPairwise<T>(Vector128<T> left, Vector128<T> right) where T : struct { throw null; } /// <summary> /// Vector add across vector elements /// Corresponds to vector forms of ARM64 ADDV /// </summary> public static byte AddAcross(Vector64<byte> value) { throw null; } public static sbyte AddAcross(Vector64<sbyte> value) { throw null; } public static ushort AddAcross(Vector64<ushort> value) { throw null; } public static short AddAcross(Vector64<short> value) { throw null; } public static uint AddAcross(Vector64<uint> value) { throw null; } public static int AddAcross(Vector64<int> value) { throw null; } public static byte AddAcross(Vector128<byte> value) { throw null; } public static sbyte AddAcross(Vector128<sbyte> value) { throw null; } public static ushort AddAcross(Vector128<ushort> value) { throw null; } public static short AddAcross(Vector128<short> value) { throw null; } public static uint AddAcross(Vector128<uint> value) { throw null; } public static int AddAcross(Vector128<int> value) { throw null; } /// <summary> /// Vector extract from pair of vectors /// For each byte result[byte] = byte + index < result.Length ? left[byte + index] : right[byte + index - result.Length] /// /// Note: index must be a JIT time const expression which can be used to populate the literal immediate field /// /// Corresponds to vector forms of ARM64 EXT /// </summary> public static Vector64<T> Extract<T>(Vector64<T> left, Vector64<T> right, byte index) where T : struct { throw null; } public static Vector128<T> Extract<T>(Vector128<T> left, Vector128<T> right, byte index) where T : struct { throw null; } /// <summary> /// Vector max numeric /// Corresponds to vector forms of ARM64 FMAXNM /// </summary> public static Vector64<float> MaxNumeric(Vector64<float> left, Vector64<float> right) { throw null; } public static Vector128<float> MaxNumeric(Vector128<float> left, Vector128<float> right) { throw null; } public static Vector128<double> MaxNumeric(Vector128<double> left, Vector128<double> right) { throw null; } /// <summary> /// Vector max numeric pairwise /// /// For each element result[elem] = 2*elem < result.Length ? max(left[2*elem], left[2*byte + 1]) : max(right[2*byte - result.Length], right[2*byte + 1 - result.Length]) /// /// Corresponds to vector forms of ARM64 FMAXNMP /// </summary> public static Vector64<float> MaxNumericPairwise(Vector64<float> left, Vector64<float> right) { throw null; } public static Vector128<float> MaxNumericPairwise(Vector128<float> left, Vector128<float> right) { throw null; } public static Vector128<double> MaxNumericPairwise(Vector128<double> left, Vector128<double> right) { throw null; } /// <summary> /// Vector max numeric across /// /// result = max(value[0], ... , value[length -1]) /// /// Corresponds to vector forms of ARM64 FMAXNMV /// </summary> public static float MaxNumericAcross(Vector64<float> value) { throw null; } public static float MaxNumericAcross(Vector128<float> value) { throw null; } public static double MaxNumericAcross(Vector128<double> value) { throw null; } /// <summary> /// Vector max pairwise /// /// For each element result[elem] = 2*elem < result.Length ? max(left[2*elem], left[2*byte + 1]) : max(right[2*byte - result.Length], right[2*byte + 1 - result.Length]) /// /// Corresponds to vector forms of ARM64 SMAXP, UMAXP & FMAXP /// </summary> public static Vector64<byte> MaxPairwise(Vector64<byte> left, Vector64<byte> right) { throw null; } public static Vector64<sbyte> MaxPairwise(Vector64<sbyte> left, Vector64<sbyte> right) { throw null; } public static Vector64<ushort> MaxPairwise(Vector64<ushort> left, Vector64<ushort> right) { throw null; } public static Vector64<short> MaxPairwise(Vector64<short> left, Vector64<short> right) { throw null; } public static Vector64<uint> MaxPairwise(Vector64<uint> left, Vector64<uint> right) { throw null; } public static Vector64<int> MaxPairwise(Vector64<int> left, Vector64<int> right) { throw null; } public static Vector64<float> MaxPairwise(Vector64<float> left, Vector64<float> right) { throw null; } public static Vector128<byte> MaxPairwise(Vector128<byte> left, Vector128<byte> right) { throw null; } public static Vector128<sbyte> MaxPairwise(Vector128<sbyte> left, Vector128<sbyte> right) { throw null; } public static Vector128<ushort> MaxPairwise(Vector128<ushort> left, Vector128<ushort> right) { throw null; } public static Vector128<short> MaxPairwise(Vector128<short> left, Vector128<short> right) { throw null; } public static Vector128<uint> MaxPairwise(Vector128<uint> left, Vector128<uint> right) { throw null; } public static Vector128<int> MaxPairwise(Vector128<int> left, Vector128<int> right) { throw null; } public static Vector128<float> MaxPairwise(Vector128<float> left, Vector128<float> right) { throw null; } public static Vector128<double> MaxPairwise(Vector128<double> left, Vector128<double> right) { throw null; } /// <summary> /// Vector max across /// /// result = max(value[0], ... , value[length -1]) /// /// Corresponds to vector forms of ARM64 SMAXP, UMAXP & FMAXP /// </summary> public static byte MaxAcross(Vector64<byte> value) { throw null; } public static sbyte MaxAcross(Vector64<sbyte> value) { throw null; } public static ushort MaxAcross(Vector64<ushort> value) { throw null; } public static short MaxAcross(Vector64<short> value) { throw null; } public static uint MaxAcross(Vector64<uint> value) { throw null; } public static int MaxAcross(Vector64<int> value) { throw null; } public static float MaxAcross(Vector64<float> value) { throw null; } public static byte MaxAcross(Vector128<byte> value) { throw null; } public static sbyte MaxAcross(Vector128<sbyte> value) { throw null; } public static ushort MaxAcross(Vector128<ushort> value) { throw null; } public static short MaxAcross(Vector128<short> value) { throw null; } public static uint MaxAcross(Vector128<uint> value) { throw null; } public static int MaxAcross(Vector128<int> value) { throw null; } public static ulong MaxAcross(Vector128<ulong> value) { throw null; } public static long MaxAcross(Vector128<long> value) { throw null; } public static float MaxAcross(Vector128<float> value) { throw null; } public static double MaxAcross(Vector128<double> value) { throw null; } /// <summary> /// Vector min numeric /// Corresponds to vector forms of ARM64 FMINNM /// </summary> public static Vector64<float> MinNumeric(Vector64<float> left, Vector64<float> right) { throw null; } public static Vector128<float> MinNumeric(Vector128<float> left, Vector128<float> right) { throw null; } public static Vector128<double> MinNumeric(Vector128<double> left, Vector128<double> right) { throw null; } /// <summary> /// Vector min numeric pairwise /// /// For each element result[elem] = 2*elem < result.Length ? min(left[2*elem], left[2*byte + 1]) : min(right[2*byte - result.Length], right[2*byte + 1 - result.Length]) /// /// Corresponds to vector forms of ARM64 FMINNMP /// </summary> public static Vector64<float> MaxNumericPairwise(Vector64<float> left, Vector64<float> right) { throw null; } public static Vector128<float> MaxNumericPairwise(Vector128<float> left, Vector128<float> right) { throw null; } public static Vector128<double> MaxNumericPairwise(Vector128<double> left, Vector128<double> right) { throw null; } /// <summary> /// Vector min numeric across /// /// result = min(value[0], ... , value[length -1]) /// /// Corresponds to vector forms of ARM64 FMINNMV /// </summary> public static float MaxNumericAcross(Vector64<float> value) { throw null; } public static float MaxNumericAcross(Vector128<float> value) { throw null; } public static double MaxNumericAcross(Vector128<double> value) { throw null; } /// <summary> /// Vector min pairwise /// /// For each element result[elem] = 2*elem < result.Length ? min(left[2*elem], left[2*byte + 1]) : min(right[2*byte - result.Length], right[2*byte + 1 - result.Length]) /// /// Corresponds to vector forms of ARM64 SMAXP, UMAXP & FMAXP /// </summary> public static Vector64<byte> MinPairwise(Vector64<byte> left, Vector64<byte> right) { throw null; } public static Vector64<sbyte> MinPairwise(Vector64<sbyte> left, Vector64<sbyte> right) { throw null; } public static Vector64<ushort> MinPairwise(Vector64<ushort> left, Vector64<ushort> right) { throw null; } public static Vector64<short> MinPairwise(Vector64<short> left, Vector64<short> right) { throw null; } public static Vector64<uint> MinPairwise(Vector64<uint> left, Vector64<uint> right) { throw null; } public static Vector64<int> MinPairwise(Vector64<int> left, Vector64<int> right) { throw null; } public static Vector64<float> MinPairwise(Vector64<float> left, Vector64<float> right) { throw null; } public static Vector128<byte> MinPairwise(Vector128<byte> left, Vector128<byte> right) { throw null; } public static Vector128<sbyte> MinPairwise(Vector128<sbyte> left, Vector128<sbyte> right) { throw null; } public static Vector128<ushort> MinPairwise(Vector128<ushort> left, Vector128<ushort> right) { throw null; } public static Vector128<short> MinPairwise(Vector128<short> left, Vector128<short> right) { throw null; } public static Vector128<uint> MinPairwise(Vector128<uint> left, Vector128<uint> right) { throw null; } public static Vector128<int> MinPairwise(Vector128<int> left, Vector128<int> right) { throw null; } public static Vector128<float> MinPairwise(Vector128<float> left, Vector128<float> right) { throw null; } public static Vector128<double> MinPairwise(Vector128<double> left, Vector128<double> right) { throw null; } /// <summary> /// Vector min across /// /// result = max(value[0], ... , value[length -1]) /// /// Corresponds to vector forms of ARM64 SMAXP, UMAXP & FMAXP /// </summary> public static byte MinAcross(Vector64<byte> value) { throw null; } public static sbyte MinAcross(Vector64<sbyte> value) { throw null; } public static ushort MinAcross(Vector64<ushort> value) { throw null; } public static short MinAcross(Vector64<short> value) { throw null; } public static uint MinAcross(Vector64<uint> value) { throw null; } public static int MinAcross(Vector64<int> value) { throw null; } public static float MinAcross(Vector64<float> value) { throw null; } public static byte MinAcross(Vector128<byte> value) { throw null; } public static sbyte MinAcross(Vector128<sbyte> value) { throw null; } public static ushort MinAcross(Vector128<ushort> value) { throw null; } public static short MinAcross(Vector128<short> value) { throw null; } public static uint MinAcross(Vector128<uint> value) { throw null; } public static int MinAcross(Vector128<int> value) { throw null; } public static float MinAcross(Vector128<float> value) { throw null; } public static double MinAcross(Vector128<double> value) { throw null; } /// <summary> /// Vector multiply by element /// /// For each element result[elem] = left[elem] * right /// /// Right can contain Extract element /// /// Corresponds to vector forms of ARM64 FMUL /// </summary> public static Vector64<byte> Multiply(Vector64<byte> left, byte right) { throw null; } public static Vector64<sbyte> Multiply(Vector64<sbyte> left, sbyte right) { throw null; } public static Vector64<ushort> Multiply(Vector64<ushort> left, ushort right) { throw null; } public static Vector64<short> Multiply(Vector64<short> left, short right) { throw null; } public static Vector64<uint> Multiply(Vector64<uint> left, uint right) { throw null; } public static Vector64<int> Multiply(Vector64<int> left, int right) { throw null; } public static Vector64<float> Multiply(Vector64<float> left, float right) { throw null; } public static Vector128<byte> Multiply(Vector128<byte> left, byte right) { throw null; } public static Vector128<sbyte> Multiply(Vector128<sbyte> left, sbyte right) { throw null; } public static Vector128<ushort> Multiply(Vector128<ushort> left, ushort right) { throw null; } public static Vector128<short> Multiply(Vector128<short> left, short right) { throw null; } public static Vector128<uint> Multiply(Vector128<uint> left, uint right) { throw null; } public static Vector128<int> Multiply(Vector128<int> left, int right) { throw null; } public static Vector128<float> Multiply(Vector128<float> left, float right) { throw null; } public static Vector128<double> Multiply(Vector128<double> left, double right) { throw null; } /// <summary> /// Vector multiply add /// /// For each element result[elem] = acc[elem] + left[elem] * right[elem] /// /// Corresponds to vector forms of ARM64 MLA & FMLA /// </summary> public static Vector64<byte> MultiplyAdd(Vector64<byte> acc, Vector64<byte> left, Vector64<byte> right) { throw null; } public static Vector64<sbyte> MultiplyAdd(Vector64<sbyte> acc, Vector64<sbyte> left, Vector64<sbyte> right) { throw null; } public static Vector64<ushort> MultiplyAdd(Vector64<ushort> acc, Vector64<ushort> left, Vector64<ushort> right) { throw null; } public static Vector64<short> MultiplyAdd(Vector64<short> acc, Vector64<short> left, Vector64<short> right) { throw null; } public static Vector64<uint> MultiplyAdd(Vector64<uint> acc, Vector64<uint> left, Vector64<uint> right) { throw null; } public static Vector64<int> MultiplyAdd(Vector64<int> acc, Vector64<int> left, Vector64<int> right) { throw null; } public static Vector64<float> MultiplyAdd(Vector64<float> acc, Vector64<float> left, Vector64<float> right) { throw null; } public static Vector128<byte> MultiplyAdd(Vector128<byte> acc, Vector128<byte> left, Vector128<byte> right) { throw null; } public static Vector128<sbyte> MultiplyAdd(Vector128<sbyte> acc, Vector128<sbyte> left, Vector128<sbyte> right) { throw null; } public static Vector128<ushort> MultiplyAdd(Vector128<ushort> acc, Vector128<ushort> left, Vector128<ushort> right) { throw null; } public static Vector128<short> MultiplyAdd(Vector128<short> acc, Vector128<short> left, Vector128<short> right) { throw null; } public static Vector128<uint> MultiplyAdd(Vector128<uint> acc, Vector128<uint> left, Vector128<uint> right) { throw null; } public static Vector128<int> MultiplyAdd(Vector128<int> acc, Vector128<int> left, Vector128<int> right) { throw null; } public static Vector128<float> MultiplyAdd(Vector128<float> acc, Vector128<float> left, Vector128<float> right) { throw null; } public static Vector128<double> MultiplyAdd(Vector128<double> acc, Vector128<double> left, Vector128<double> right) { throw null; } /// <summary> /// Vector multiply add by element /// /// For each element result[elem] = acc[elem] + left[elem] * right /// /// Corresponds to vector forms of ARM64 MLA & FMLA /// </summary> public static Vector64<byte> MultiplyAdd(Vector64<byte> acc, Vector64<byte> left, byte right) { throw null; } public static Vector64<sbyte> MultiplyAdd(Vector64<sbyte> acc, Vector64<sbyte> left, sbyte right) { throw null; } public static Vector64<ushort> MultiplyAdd(Vector64<ushort> acc, Vector64<ushort> left, ushort right) { throw null; } public static Vector64<short> MultiplyAdd(Vector64<short> acc, Vector64<short> left, short right) { throw null; } public static Vector64<uint> MultiplyAdd(Vector64<uint> acc, Vector64<uint> left, uint right) { throw null; } public static Vector64<int> MultiplyAdd(Vector64<int> acc, Vector64<int> left, int right) { throw null; } public static Vector64<float> MultiplyAdd(Vector64<float> acc, Vector64<float> left, float right) { throw null; } public static Vector128<byte> MultiplyAdd(Vector128<byte> acc, Vector128<byte> left, byte right) { throw null; } public static Vector128<sbyte> MultiplyAdd(Vector128<sbyte> acc, Vector128<sbyte> left, sbyte right) { throw null; } public static Vector128<ushort> MultiplyAdd(Vector128<ushort> acc, Vector128<ushort> left, ushort right) { throw null; } public static Vector128<short> MultiplyAdd(Vector128<short> acc, Vector128<short> left, short right) { throw null; } public static Vector128<uint> MultiplyAdd(Vector128<uint> acc, Vector128<uint> left, uint right) { throw null; } public static Vector128<int> MultiplyAdd(Vector128<int> acc, Vector128<int> left, int right) { throw null; } public static Vector128<float> MultiplyAdd(Vector128<float> acc, Vector128<float> left, float right) { throw null; } public static Vector128<double> MultiplyAdd(Vector128<double> acc, Vector128<double> left, double right) { throw null; } /// <summary> /// Vector multiply extend /// /// For each element result[elem] = left[elem] * right[elem] /// Handle extend special cases zero and infinite. FMULX /// /// Corresponds to vector forms of ARM64 FMULX /// </summary> public static Vector64<float> MultiplyExtend(Vector64<float> left, Vector64<float> right) { throw null; } public static Vector128<float> MultiplyExtend(Vector128<float> left, Vector128<float> right) { throw null; } public static Vector128<double> MultiplyExtend(Vector128<double> left, Vector128<double> right) { throw null; } /// <summary> /// Vector multiply extend by element /// /// For each element result[elem] = left[elem] * right /// Handle extend special cases zero and infinite. FMULX /// /// Corresponds to vector forms of ARM64 FMULX /// </summary> public static Vector64<float> MultiplyExtend(Vector64<float> left, float right) { throw null; } public static Vector128<float> MultiplyExtend(Vector128<float> left, float right) { throw null; } public static Vector128<double> MultiplyExtend(Vector128<double> left, double right) { throw null; } /// <summary> /// Vector multiply subtract /// /// For each element result[elem] = acc[elem] - left[elem] * right[elem] /// /// Corresponds to vector forms of ARM64 MLS & FMLS /// </summary> public static Vector64<byte> MultiplySubtract(Vector64<byte> acc, Vector64<byte> left, Vector64<byte> right) { throw null; } public static Vector64<sbyte> MultiplySubtract(Vector64<sbyte> acc, Vector64<sbyte> left, Vector64<sbyte> right) { throw null; } public static Vector64<ushort> MultiplySubtract(Vector64<ushort> acc, Vector64<ushort> left, Vector64<ushort> right) { throw null; } public static Vector64<short> MultiplySubtract(Vector64<short> acc, Vector64<short> left, Vector64<short> right) { throw null; } public static Vector64<uint> MultiplySubtract(Vector64<uint> acc, Vector64<uint> left, Vector64<uint> right) { throw null; } public static Vector64<int> MultiplySubtract(Vector64<int> acc, Vector64<int> left, Vector64<int> right) { throw null; } public static Vector64<float> MultiplySubtract(Vector64<float> acc, Vector64<float> left, Vector64<float> right) { throw null; } public static Vector128<byte> MultiplySubtract(Vector128<byte> acc, Vector128<byte> left, Vector128<byte> right) { throw null; } public static Vector128<sbyte> MultiplySubtract(Vector128<sbyte> acc, Vector128<sbyte> left, Vector128<sbyte> right) { throw null; } public static Vector128<ushort> MultiplySubtract(Vector128<ushort> acc, Vector128<ushort> left, Vector128<ushort> right) { throw null; } public static Vector128<short> MultiplySubtract(Vector128<short> acc, Vector128<short> left, Vector128<short> right) { throw null; } public static Vector128<uint> MultiplySubtract(Vector128<uint> acc, Vector128<uint> left, Vector128<uint> right) { throw null; } public static Vector128<int> MultiplySubtract(Vector128<int> acc, Vector128<int> left, Vector128<int> right) { throw null; } public static Vector128<float> MultiplySubtract(Vector128<float> acc, Vector128<float> left, Vector128<float> right) { throw null; } public static Vector128<double> MultiplySubtract(Vector128<double> acc, Vector128<double> left, Vector128<double> right) { throw null; } /// <summary> /// Vector multiply subtract by element /// /// For each element result[elem] = acc[elem] - left[elem] * right /// /// Corresponds to vector forms of ARM64 MLS & FMLS /// </summary> public static Vector64<byte> MultiplySubtract(Vector64<byte> acc, Vector64<byte> left, byte right) { throw null; } public static Vector64<sbyte> MultiplySubtract(Vector64<sbyte> acc, Vector64<sbyte> left, sbyte right) { throw null; } public static Vector64<ushort> MultiplySubtract(Vector64<ushort> acc, Vector64<ushort> left, ushort right) { throw null; } public static Vector64<short> MultiplySubtract(Vector64<short> acc, Vector64<short> left, short right) { throw null; } public static Vector64<uint> MultiplySubtract(Vector64<uint> acc, Vector64<uint> left, uint right) { throw null; } public static Vector64<int> MultiplySubtract(Vector64<int> acc, Vector64<int> left, int right) { throw null; } public static Vector64<float> MultiplySubtract(Vector64<float> acc, Vector64<float> left, float right) { throw null; } public static Vector128<byte> MultiplySubtract(Vector128<byte> acc, Vector128<byte> left, byte right) { throw null; } public static Vector128<sbyte> MultiplySubtract(Vector128<sbyte> acc, Vector128<sbyte> left, sbyte right) { throw null; } public static Vector128<ushort> MultiplySubtract(Vector128<ushort> acc, Vector128<ushort> left, ushort right) { throw null; } public static Vector128<short> MultiplySubtract(Vector128<short> acc, Vector128<short> left, short right) { throw null; } public static Vector128<uint> MultiplySubtract(Vector128<uint> acc, Vector128<uint> left, uint right) { throw null; } public static Vector128<int> MultiplySubtract(Vector128<int> acc, Vector128<int> left, int right) { throw null; } public static Vector128<float> MultiplySubtract(Vector128<float> acc, Vector128<float> left, float right) { throw null; } public static Vector128<double> MultiplySubtract(Vector128<double> acc, Vector128<double> left, double right) { throw null; } /// <summary> /// Vector polynomial multiply /// Corresponds to vector forms of ARM64 PMUL /// </summary> public static Vector64<byte> PolynomialMultiply(Vector64<byte> left, Vector64<byte> right) { throw null; } public static Vector64<sbyte> PolynomialMultiply(Vector64<sbyte> left, Vector64<sbyte> right) { throw null; } public static Vector128<byte> PolynomialMultiply(Vector128<byte> left, Vector128<byte> right) { throw null; } public static Vector128<sbyte> PolynomialMultiply(Vector128<sbyte> left, Vector128<sbyte> right) { throw null; } /// Vector reciprocal estimate /// /// See FRECPE docs /// /// Corresponds to vector forms of ARM64 FRECPE /// </summary> public static Vector64<float> ReciprocalEstimate(Vector64<float> value) { throw null; } public static Vector128<float> ReciprocalEstimate(Vector128<float> value) { throw null; } public static Vector128<double> ReciprocalEstimate(Vector128<double> value) { throw null; } /// <summary> /// Vector reciprocal step /// /// See FRECPS docs /// /// Corresponds to vector forms of ARM64 FRECPS /// </summary> public static Vector64<float> ReciprocalStep(Vector64<float> left, Vector64<float> right, byte index) { throw null; } public static Vector128<float> ReciprocalStep(Vector128<float> left, Vector128<float> right, byte index) { throw null; } public static Vector128<double> ReciprocalStep(Vector128<double> left, Vector128<double> right, byte index) { throw null; } /// <summary> /// Vector reciprocal exponent /// /// See FRECPX docs /// /// Corresponds to vector forms of ARM64 FRECPX /// </summary> public static Vector64<float> ReciprocalExponent(Vector64<float> value) { throw null; } public static Vector128<float> ReciprocalExponent(Vector128<float> value) { throw null; } public static Vector128<double> ReciprocalExponent(Vector128<double> value) { throw null; } /// <summary> /// Vector reciprocal square root estimate /// /// See FRSQRTE docs /// /// Corresponds to vector forms of ARM64 FRSQRTE /// </summary> public static Vector64<float> ReciprocalSquareRootEstimate(Vector64<float> value) { throw null; } public static Vector128<float> ReciprocalSquareRootEstimate(Vector128<float> value) { throw null; } public static Vector128<double> ReciprocalSquareRootEstimate(Vector128<double> value) { throw null; } /// <summary> /// Vector reciprocal square root step /// /// See FRSQRTS docs /// /// Corresponds to vector forms of ARM64 FRSQRTS /// </summary> public static Vector64<float> ReciprocalSquareRootEstimate(Vector64<float> left, Vector64<float> right, byte index) { throw null; } public static Vector128<float> ReciprocalSquareRootEstimate(Vector128<float> left, Vector128<float> right, byte index) { throw null; } public static Vector128<double> ReciprocalSquareRootEstimate(Vector128<double> left, Vector128<double> right, byte index) { throw null; } /// <summary> /// Vector reverse byte bits /// Corresponds to vector forms of ARM64 RBIT /// </summary> public static Vector64<byte> ReverseElementBits(Vector64<byte> value) { throw null; } public static Vector64<sbyte> ReverseElementBits(Vector64<sbyte> value) { throw null; } public static Vector128<byte> ReverseElementBits(Vector128<byte> value) { throw null; } public static Vector128<sbyte> ReverseElementBits(Vector128<sbyte> value) { throw null; } /// <summary> /// Vector reverse element bytes /// Corresponds to vector forms of ARM64 REV16, REV32, REV64 /// </summary> public static Vector64<ushort> ReverseElementBytes(Vector64<ushort> value) { throw null; } public static Vector64<short> ReverseElementBytes(Vector64<short> value) { throw null; } public static Vector64<uint> ReverseElementBytes(Vector64<uint> value) { throw null; } public static Vector64<int> ReverseElementBytes(Vector64<int> value) { throw null; } public static Vector64<float> ReverseElementBytes(Vector64<float> value) { throw null; } public static Vector128<ushort> ReverseElementBytes(Vector128<ushort> value) { throw null; } public static Vector128<short> ReverseElementBytes(Vector128<short> value) { throw null; } public static Vector128<uint> ReverseElementBytes(Vector128<uint> value) { throw null; } public static Vector128<int> ReverseElementBytes(Vector128<int> value) { throw null; } public static Vector128<ulong> ReverseElementBytes(Vector128<ulong> value) { throw null; } public static Vector128<long> ReverseElementBytes(Vector128<long> value) { throw null; } public static Vector128<float> ReverseElementBytes(Vector128<float> value) { throw null; } public static Vector128<double> ReverseElementBytes(Vector128<double> value) { throw null; } } } ``` 26583 area-System.Security Port ECDiffieHellman to .NET Core This brings the ECDiffieHellman class as-is from .NET Framework (last edited for net462) to System.Security.Cryptography.Algorithms, and the ECDiffieHellmanCng class as-is to System.Security.Cryptography.Cng, and adds ECDiffieHellmanOpenSsl to System.Security.Cryptography.OpenSsl. A fair amount of this change is factoring out ECDSA code to general ECC code for each of the platforms. Since there isn't obvious value in having public ECDiffieHellmanPublicKey derived types, ECDiffieHellmanOpenSslPublicKey is not public. Fixes #8158. Edit: Apparently ECDH was last edited in net47. So we have that version. (It's when ImportParameters was added, I remembered DeriveKeyFromHmac being the last thing added) 26584 area-System.Memory Add AsString() extension method to ReadOnlySpan<char> "## Rationale We have the ability to create a string from a ReadOnlySpan\<char\> in .NET Core (https://github.com/dotnet/corefx/blob/master/src/System.Runtime/ref/System.Runtime.cs#L2215). ```C# public String(System.ReadOnlySpan<char> value) { } ``` However, someone using the portable System.Memory does not have the ability to convert a ReadOnlySpan\<char\> into a string. We can resolve that by providing an extension method on ReadOnlySpan\<char\>. **Note:** This will clearly result in an allocation. ## API Proposal **Alternative:** Change the behaviour of existing ToString method ```C# namespace System { public readonly ref partial struct ReadOnlySpan<T> { // For char, it would do the equivalent of new string(char*,int) or new string(ReadOnlySpan<char>), // and for other Ts, we could either just output ""System.Span<T>[Length]"" or some concatenation of // ToString of each element. public override string ToString() { throw null; } } } ``` **Original:** ```C# namespace System { public static partial class MemoryExtensions { // Alternative: something like CopyToString, // possibly with additional args to control the amount to copy? public static string AsString(this ReadOnlySpan<char> source); } } ``` ## Notes The .NET Core implementation of this would just call the string constructor in corelib under the covers. There is probably a way to get to the underlying string from the Pinnable\<char\> internal field for the portable span. Otherwise, we could copy the string data. Something like: ```C# public static unsafe string AsString(this System.ReadOnlySpan<char> source) { string result = new string(' ', source.Length); fixed (char* dest = result, src = &MemoryMarshal.GetReference(source)) { for (int i = 0; i < source.Length; i++) { *(dest + i) = *(src + i); } } return result; } ``` This could be useful, if you need to, let's say combine the Directory property on FindData with a filename string to generate a full path (from https://github.com/dotnet/corefx/issues/25873). ## Sample Usage ```C# string directory = FindData<T>.Directory; ReadOnlySpan<char> fileNameSpan = FindData<T>.FileName; string fullPath = directory + fileNameSpan.AsString(); Assert.Equal(""Hello"", ""Hello"".AsReadOnlySpan().AsString()); ``` cc @KrzysztofCwalina, @jkotas, @stephentoub, @JeremyKuhne, @dotnet/corefxlab-contrib " 26585 area-System.Net clean up request and response version handling in managed handler For request version: treat < 1.0 as an error, and > 1.1 should degrade to 1.1. For response version: 1.x should return version as received; anything else should be treated as a bad response. Add tests. @stephentoub @davidsh @Priya91 @wfurt 26586 area-System.Runtime Test failure: MonoTests.System.Runtime.Caching.MemoryCacheTest / TestCacheSliding ## History of failures Day | Build | OS | Details -- | -- | -- | -- 1/14 | 1373384c81e62be7b9f7e75f2ba62ffabea2d269 | Win10 | Actual null 1/16 | a55fcd0822253d51c4be1bd6a24c7398476adb79 | Win10 | Actual null 1/29 | 20180129.05 | Win8.1 | Actual 42 - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180129.05/workItem/System.Runtime.Caching.Tests/analysis/xunit/MonoTests.System.Runtime.Caching.MemoryCacheTest~2FTestCacheSliding) 2/1 | 654d82c699b3d0a8d2740d79f066e32cf4bccfc1 | Win10 | Actual null 2/7 | 20180207.02 | Win7 | Actual: 42 - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180207.02/workItem/System.Runtime.Caching.Tests/analysis/xunit/MonoTests.System.Runtime.Caching.MemoryCacheTest~2FTestCacheSliding) 2/9 | 20180209.03 | Win7 | Actual: 42 - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180209.03/workItem/System.Runtime.Caching.Tests/analysis/xunit/MonoTests.System.Runtime.Caching.MemoryCacheTest~2FTestCacheSliding) # Original report Test: MonoTests.System.Runtime.Caching.MemoryCacheTest.TestCacheSliding (from (empty)) has failed. ``` Assert.NotEqual() Failure Expected: Not null Actual: null at MonoTests.System.Runtime.Caching.MemoryCacheTest.TestCacheSliding() in D:\j\workspace\outerloop_net---7a39cc82\src\System.Runtime.Caching\tests\System.Runtime.Caching\MemoryCacheTest.cs:line 1053 ``` Details: https://ci.dot.net/job/dotnet_corefx/job/master/job/outerloop_netcoreapp_windows_nt_release/285/testReport/MonoTests.System.Runtime.Caching/MemoryCacheTest/TestCacheSliding/ 26587 area-System.Threading Fix Completing BlockedWriters in BoundedChannel implementation In BoundedChannel class we have the internal field _blockedWriters which is a queue of waiting writers (a queue of TaskCompletionSource<T> objects). if the TCS objects are created without the option TaskCreationOptions.RunContinuationsAsynchronously, then during the BoundedChannel Completion operation ```TryComplete (Exception error)``` we need to mark all items inside _blockedWriters queue as failed. If we do that while holding the lock, that can cause a problem as TCS task can continue synchronously while we are holding the lock which can result in deadlock. In the same time, it is not safe to do this operation outside the lock either because the operation on _blockedWriters should be atomic. We need to come up with a safe way to mark the _blockedWriters items as Failed in the completion process without causing any deadlocks. 26588 area-System.Net [New test] CI failed: System.Net.WebSockets.WebSocketProtocol.Tests / WebSocketProtocol_CreateFromConnectedStream_Succeeds The test failed in CI: ``` Assert.True() Failure Expected: True Actual: False at System.Net.WebSockets.Tests.WebSocketProtocolTests.<WebSocketProtocol_CreateFromConnectedStream_Succeeds>d__2.MoveNext() in D:\j\workspace\windows-TGrou---3ae484c8\src\System.Net.WebSockets.WebSocketProtocol\tests\WebSocketProtocolTests.cs:line 69 --- End of stack trace from previous location where exception was thrown --- ``` ## History of failures Day | Build | OS | Details -- | -- | -- | -- 1/18 | 425dd3680cfc5b808a9b41b8d71c5a6a9c03a304 | Win10 | 16x failed 1/18 | 1956b2aa67f3f19be9a1d184215033637c8ab33c | Win10 | 2x failed 1/19 | 14f6df36f792307e6873c37dc201c98c03674504 | Win10 | 2x failed @Priya91 is it something you would expect? Any chance the data I have is invalid? 26589 area-System.Net DO NOT MERGE -- Httpversion test Testing behavior of various HttpClient implementations 26590 area-System.Net DO NOT MERGE -- test line ending behavior 26591 area-System.Security Fix IO error handling for adding certs to X509Store on Linux If a directory was readonly then UnauthorizedAccessException was being thrown and not handled by opportunistic caching, so caching now won't fail on that exception. Other tests being run after mv ~/.dotnet{,-sav} chmod u-w ~ showed that the exception model wasn't very tight, so now all rogue exceptions from X509Store.Add will be wrapped in CryptographicException. This better matches Windows and macOS where a CryptographicException is raised to interpret a failed NTSTATUS/HRESULT/OSStatus. Fixes #23549. 26592 area-Serialization Fix load assembly without location issue2 Port the change #26304 into 2.0 Fix #26578 @zhenlan @mconnew 26593 area-System.Net [ManagedHandler] use system proxy configuration on macOS "MacOS has system proxy configuration similar to Windows. To have better integration with OS it may be handy to use this instead of relying on environment variables. <img width=""652"" alt=""proxy"" src=""https://user-images.githubusercontent.com/14356188/35417602-00a506e4-01e3-11e8-8424-f87d96bca222.png""> One different caveat is that the proxy is specific to interfaces we we would need to find active interface first ``` #networksetup -listnetworkserviceorder #networksetup -getwebproxy Wi-FI Enabled: No Server: Port: 0 Authenticated Proxy Enabled: 0 ```" 26594 area-System.Data SqlDataReader.ReadAsync blocks same thread to execute synchronous code "Customer reported an issue for `SqlDataReader.ReadAsync()` method actually runs synchronously, and it blocks the calling thread until data is fed from SQL Server. Here is the detail description of the issue from the customer: > I want to be able to write asynchronous code in C# which can reliably yield a Task upon anything that, in synchronous code, would block. All of my setup code and the initialization of the `SqlCommand` is fairly small and does not have a performance hit if I run it on a UI thread in winforms. However, because `ReadAsync()` does not actually always run asynchronously, depending on the query, even though I have `await MyFunctionWhichCallsReadAsync();`, the effect is that the UI thread is blocked causing a bad experience for the user. It is misleading that ReadAsync() is named ""***Async***"" when it will block the caller. This prevents a caller which would start multiple asynchronous operation and wait for them concurrently from doing so. E.g., if I do the following, no concurrency will happen even though it should: ``` var readTask = reader.ReadAsync(); var backgroundThingTask = DoSomethingElseConcurrentlyAsync(); var readResult = await readTask; await backgroundThingTask; ``` >This is because `reader.ReadAsync()` will block without returning a Task until it actually receives data from SQL Server. Repro code: https://github.com/binki/connect3139210" 26595 area-System.Data Fixed ReadAsync blocking issue This fix is for the issue https://github.com/dotnet/corefx/issues/26594 *** Customer reported an issue for SqlDataReader.ReadAsync() method actually runs synchronously, and it blocks the calling thread until data is fed from SQL Server. 26596 area-System.Net Make sure HttpListenerContext will not deallocate twice Under certain stress conditions, HttpListener.EndGetContext (GetContextAsync) will throw NullReferenceException as it tries to deallocate an internal HttpListenerContext object twice while processing authentication. This fix ensures that the code will not deallocate twice. I have verified that the issue will repro on .NET Core 2.0, but I didn't ported the .NET Framework stress test, because the test may regress networking CI runs. It is ignored on .NET Framework test run as well `[Ignore] // TODO: Failed with System.TimeoutException when running on dev machine.` This issue was reported in internal bug 200343. 26598 area-System.Memory System.Memory source cleanup and fix byteOffset check in tests ~Part of the APIs proposed in https://github.com/dotnet/corefx/issues/~ - ~Remove~ - ~PadLeft, PadRight, and overloads~ - Removing unused using directives, leftover from https://github.com/dotnet/corefx/pull/26289#discussion_r162714294 - Fixing the byteOffset checks in Pin - related to https://github.com/dotnet/corefx/pull/26563#discussion_r163891173 / https://github.com/dotnet/corefxlab/pull/2071 ~**Question:** If, on calling Remove, the entire source gets removed, i.e. there is nothing to copy into the destination, should we clear out the destination? Currently, I only clear as much as the source.Length (or the entire destination if source.Length is larger).~ cc @jkotas, @stephentoub, @AtsushiKan, @dotnet/corefxlab-contrib, @tarekgh 26599 area-System.Net [ManagedHandler] digest authentication fails in some cases "I have proxy setup with Squid proxy server requiring Digest authentication. When used with curl handler, everything works OK but request fails when managed handler is in use. This is record of HTTP exchange: ``` GET http://mytest.com/ HTTP/1.1 Host: mytest.com User-Agent: curl/7.57.0 Accept: */* Proxy-Connection: Keep-Alive HTTP/1.1 407 Proxy Authentication Required Server: squid/3.5.27 Mime-Version: 1.0 Date: Fri, 26 Jan 2018 06:03:20 GMT Content-Type: text/html;charset=utf-8 Content-Length: 3429 X-Squid-Error: ERR_CACHE_ACCESS_DENIED 0 Vary: Accept-Language Content-Language: en Proxy-Authenticate: Digest realm=""NetCore"", nonce=""qMRqWgAAAAAQMjIABgAAAFwEiEwAAAAA"", qop=""auth"", stale=false X-Cache: MISS from toweinfu-w10 Via: 1.1 toweinfu-w10 (squid/3.5.27) Connection: keep-alive <!DOCTYPE html PUBLIC ""-//W3C//DTD HTML 4.01//EN"" ""http://www.w3.org/TR/html4/strict.dtd""> <html><head> <meta http-equiv=""Content-Type"" content=""text/html; charset=utf-8""> <title>ERROR: Cache Access Denied</title> </head><body id=ERR_CACHE_ACCESS_DENIED> <div id=""titles""> <h1>ERROR</h1> <h2>Cache Access Denied.</h2> </div> <hr> <p>Generated Fri, 26 Jan 2018 06:03:20 GMT by toweinfu-w10 (squid/3.5.27)</p> <!-- ERR_CACHE_ACCESS_DENIED --> </div> </body></html> GET http://mytest.com/ HTTP/1.1 Host: mytest.com Proxy-Authorization: Digest username=""furt"",realm=""NetCore"",nonce=""qMRqWgAAAAAQMjIABgAAAFwEiEwAAAAA"",uri=""/"",cnonce=""07beed7cf1df3e11138208bec0e497c5"",nc=00000001,response=""9a70059841ad1b1497ac2ad911d14041"",qop=""auth"" User-Agent: curl/7.57.0 Accept: */* Proxy-Connection: Keep-Alive HTTP/1.1 200 OK Date: Fri, 26 Jan 2018 06:03:20 GMT Server: Apache Content-Length: 271 Content-Type: text/html; charset=UTF-8 X-Cache: MISS from toweinfu-w10 Via: 1.1 toweinfu-w10 (squid/3.5.27) Connection: keep-alive <html> <head> <meta name=""robots"" content=""noarchive"" /> <meta name=""googlebot"" content=""nosnippet"" /> </head> <body> <div align=center> <h3>Error. Page cannot be displayed. Please contact your service provider for more details. (9)</h3> </div> </body> </html> ``` note that the response from server does not have opaque field. rfc7616 3.3. states: ""The value of the header field can include parameters from the following list:"" There does not seems to be requirement that opaque is mandatory. RFC states that client SHOULD return the value. I guess ""if present"" is implied. Followinf diff seems to fix it and managed handler can authenticate: ```c# index 3f0b911689..a0ba50c8a7 100644 --- a/src/System.Net.Http/src/System/Net/Http/Managed/AuthenticationHelper.Digest.cs +++ b/src/System.Net.Http/src/System/Net/Http/Managed/AuthenticationHelper.Digest.cs @@ -98,7 +98,7 @@ namespace System.Net.Http string opaque; if (!digestResponse.Parameters.TryGetValue(Opaque, out opaque)) { - return null; + //return null; } string realm = digestResponse.Parameters.ContainsKey(Realm) ? digestResponse.Parameters[Realm] : string.Empty; @@ -189,7 +189,8 @@ namespace System.Net.Http sb.AppendKeyValue(Algorithm, algorithm, includeQuotes: false); // Add opaque - sb.AppendKeyValue(Opaque, opaque); + if (opaque != null) + sb.AppendKeyValue(Opaque, opaque); // Add qop sb.AppendKeyValue(Qop, qop, includeQuotes: false); ```" 26600 area-System.ComponentModel PropertyDescriptor - MemberDescriptor.Attributes returns base attribute instead of ancestor's attribute "prop.Description returns ""A"" instead of ""B"" ```c# static void Main(string[] args) { var prop = (DescriptionAttribute)TypeDescriptor.GetProperties(typeof(B))[""Value""].Attributes[typeof(DescriptionAttribute)]; Assert.Equal(""B"", prop.Description); } class A { [Description(""A"")] public virtual int Value { get; set; } } class B : A { [Description(""B"")] public override int Value { get; set; } } ``` [EDIT] Add C# syntax highlighing & change code formatting by @karelz" 26603 area-System.Memory Memory<T> and large memory mapped files I'm currently experimenting with ````OwnedMemory<T>```` and ````Memory<T>```` in an existing project that I'm trying to improve, and I ran into an issue with ````OwnedMemory<T>```` and ````Memory<T>```` being limited to ````int.MaxValue````. # Scenario I have a relatively big (> 2GB) data file that I want to fully map in memory (i.e. a database). My API exposes methods that returns subsets of this big memory mapped file, e.g. ````csharp public ReadOnlyMemory<byte> GetBytes(int something) { // … return mainMemory.Slice(start, length).AsReadOnly(); } ```` Wrapping the ````MemoryMappedFile```` and associated ````MemoryMappedViewAccessor```` into an ````OwnedMemory<byte>```` seemed to be a good idea, since most of the tricky logic would then be handled by the framework. # Problem The memory block that I want to wrap is bigger than 2GB and cannot currently be represented by a single Memory<T> instance. Since Memory<T> can only work with ````T[]````, ````string````, or ````OwnedMemory<T>````, it seems that having to give up on the straightfoward ````OwnedMemory<T>```` implementation also means that I have to give up on using ````Memory<T>```` at all. (In this specific case, ````Span<T>```` being limited to 2GB, would not be a problem, because the sliced memory blocks that my API would return would always be much smaller than that.) # Possible solutions with the currently proposed API - Not using ````Memory<T>```` at all and implementing a much simplified version of ````OwnedMemory<T>````/````Memory<T>```` that would fit my use case - Keeping many overlapping instances of ````OwnedMemory<T>```` around and use the one that best fits the current case # Question Would it be possible to improve the framework in order to be able of easily working with such large memory blocks? (Maybe implementing something like a ````BigMemory<T>```` ?) 26604 area-System.Memory Investigate ways to optimize Span.Fill and Span.Clear for small buffers We need to reduce the overhead of calling Span and ReadOnlySpan Fill and improve its performance for small buffers so that it can be used in common scenarios. **See additional context:** https://github.com/dotnet/corefx/pull/26598#discussion_r164158124 https://github.com/dotnet/corefx/pull/26289#discussion_r162713305 **Edit:** As part of this change, investigate and remove the TODOs: https://github.com/dotnet/corefx/blob/79d708b2faf8a75089b1873fbb101b0a957c1fbd/src/System.Memory/src/System/SpanHelpers.Clear.cs#L69 https://github.com/dotnet/corefx/blob/79d708b2faf8a75089b1873fbb101b0a957c1fbd/src/System.Memory/src/System/SpanHelpers.Clear.cs#L105 https://github.com/dotnet/coreclr/blob/22f1bc00d018a49f9550ee3b564f5f7737960b0d/src/mscorlib/shared/System/Span.NonGeneric.cs#L707 cc @dotnet/corefxlab-contrib, @jkotas, @stephentoub 26606 area-System.Net HttpListener sends malformed WWW-Authenticate mutual auth header "Hope this is the right place to file this, not clear to me if .NET Framework issues are in scope for this repo. In the [RFC](https://tools.ietf.org/html/rfc4559) for SPNEGO in HTTP, section 5 shows the expected exchange. In the final 200 response from the server, the server sets a WWW-Authenticate header to `Negoitate base64(gssapi-data)`. HttpListener sets this header to only `base64(gssapi-data)`. For other Windows .NET clients, this seems to be accepted, but things that have a stricter interpretation of the spec, such as the [requests-kerberos](https://github.com/requests/requests-kerberos) Python library, it doesn't fly. I'm pretty deeply confused about this because generally speaking, my understanding is that mutual auth and Negotiate in general is more or less http.sys's responsibility. With stuff hosted in IIS, I see the header being set with the appropriate `Negotiate` prefix. I threw together a very simple .NET Core app using HttpSysListener, and it also sets the header correctly. I even hacked some C sample code for the HTTP Server API to enable Negotiate and send 401s as necessary, and it also sets the header correctly. The only thing that doesn't is HttpListener. I have not had much luck digging through the source to figure out where this might be going wrong. In my actual app, I even tried re-writing the header myself in some Owin middleware, but the actual response on the wire was still wrong. To repro... * Get a pair of Windows machines joined to the same domain, or with a trust in between them. * Machine A must be reachable by FQDN, that and the machine account must have the `HTTP/fqdn` SPN attached in AD. Unless you explicitly assign the HTTP SPN to something, it's implicit in the HOST SPN, and you get that by default when the machine is joined to the domain, so you probably don't need to do anything here. * On machine A, install .NET 4.7.1. The error is definitely there in 4.7.1, have not tested earlier frameworks. * On machine A, make sure incoming TCP/9002 (or whatever port you want to use) is open in the firewall. * On machine A, use `psexec -i -s cmd` to get a shell as SYSTEM. This is a quick and dirty way to act with the computer's credentials, avoid the need to register the prefix with netsh. * Build the code below and run it in that SYSTEM shell on A. * On B, as a domain user, hit the test path on machine A form something that will do Negotiate. You must use the name, not IP and have connectivity to a DC so that Kerberos works. This PowerShell one-liner will do the trick: ``` (Invoke-WebRequest http://machinea.example.com:9002/test -UseDefaultCredentials -UseBasicParsing).RawContent ``` * Observe headers that look something like this. Note the lack of Negotiate prefix in the WWW-Authenticate header. ``` HTTP/1.1 200 OK Content-Length: 11 Date: Fri, 26 Jan 2018 20:53:23 GMT Server: Microsoft-HTTPAPI/2.0 WWW-Authenticate: oYG3MIG0oAMKAQChCwYJKoZIgvcSAQICooG <more base64 snipped> Hello world ``` Sample code: ```csharp using System; using System.Net; using System.Text; namespace HttpListenerTest { class Program { static void Main() { try { var responseString = ""Hello world""; var buffer = Encoding.UTF8.GetBytes(responseString); var listener = new HttpListener {AuthenticationSchemes = AuthenticationSchemes.Negotiate}; var prefix = ""http://+:9002/test/""; listener.Prefixes.Add(prefix); listener.Start(); Console.WriteLine($""Listening on {prefix}...""); while (true) { var context = listener.GetContext(); var request = context.Request; Console.WriteLine($""Hit from {request.RemoteEndPoint.Address}...""); var response = context.Response; response.ContentLength64 = buffer.Length; var output = response.OutputStream; output.Write(buffer, 0, buffer.Length); output.Close(); } } catch (Exception e) { Console.WriteLine(e); } } } } ```" 26607 area-System.Data Consolidate the SqlClient and Odbc connection pool code at one location The code for SqlClient and Odbc have duplicated the connection pool code. This code should be consolidated in the Common folder and a single code base should exist for Connection Pool, the same way .Net framework uses it. This reduces maintenance cost and code duplication as observed in PR https://github.com/dotnet/corefx/pull/26065 26609 area-System.Memory Add more tests for Span.CopyTo Since `Span<T>.CopyTo` has different implementations for fast span and slow span, it's worthwhile to add some extra unit tests exercising the complex logic of `Memmove`. I've tested this against the coreclr PR https://github.com/dotnet/coreclr/pull/15947 to make sure we didn't accidentally break the _CopyTo_ routine. /cc @ahsonkhan @jkotas 26610 area-Serialization Add SerializerVersionMatch when load pregenerated XmlSerializer Add [IsSerializerVersionMatch](http://referencesource.microsoft.com/#System.Xml/System/Xml/Serialization/Compilation.cs,199) check in SGEN to check if the serializer's parent assembly id is the same as the data assembly id. 26611 area-System.Memory System.Memory project should consume shared sources for Span See https://github.com/dotnet/corefx/issues/25188 for context. We should make a similar change here with `Span` so that we don't have two different implementations between coreclr and corefx. n.b. The mirroring is already taking place, but the System.Memory project doesn't reference the shared sources for `Span`. 26614 area-System.Net GetResponseCallback() does not translate WebException into HttpResponseMessage in GetResponseCallback() **Issue** RE: [HttpClientHandler.Net46.cs GetResponseCallback()](https://github.com/dotnet/corefx/blob/c20c3172cfa8cd926c6acac435b9a72c77d655fe/src/System.Net.Http/src/System/Net/Http/HttpClientHandler.Net46.cs#L1001): For unsuccessful http requests (for example: '404' Not Found) `HttpClientHandler.Net46` implementation behaves differently than other implementations of `HttpClientHandler`. While `HttpResponseMessage` result is expected from `await HttpClientHandler.SendAsync`, the caller receives **platform-specific** `WebException`. **Proposed solution** ``` WebResponse webResponse; try { // Try getting response. webResponse = state.webRequest.EndGetResponse(ar); } catch (WebException webException) { // Intercept WebException. // Use webException.Response value (when available) to create HttpResponseMessage. webResponse = webException.Response; if (webResponse == null) { throw; } } state.tcs.TrySetResult(CreateResponseMessage((HttpWebResponse)webResponse, state.requestMessage)); ``` 26617 area-System.Net System.Net.WebSocket ReceiveAsync reads wrongly when buffer is smaller than whole message I am using websockets sending 1046 bytes using SendAsync, while the receiving is using buffer of 1024 which is 22 byte less than the whole message. I suppose I can do a loop where first round reads 1024 byte with WebSocketReceiveResult.EndOfMessage is false, then receive 22 byte with WebSocketReceiveResult.EndOfMessage is true. but that's not what actually happens, what happens is that the first round is correct, the second round it receives 22 byte but the WebSocketReceiveResult.EndOfMessage is false and the loop continues endlessly reading 22 bytes (all zeros). using bytes count to break the loop instead of WebSocketReceiveResult.EndOfMessage flag doesn't help as the socket keeps 22 byte of zeros forever so next messages won't succeed. The only way to solve it was to send bytes less or equal to the receiving buffer size! ```CSharp do { var segment = new ArraySegment<byte>(receiveBuffer); result = await _webSocket.ReceiveAsync(segment, cts.Token); await memoryStream.WriteAsync(receiveBuffer, 0, result.Count); } while (!result.EndOfMessage) ``` Testing environment - Local machine connection - Windows 10 x64 - Visual studio 2017 - .Net Standard 2 # 26618 area-System.IO Directory.Move and Directory.Delete ignore the trailing space "```csharp Directory.Move(@""T:\Temp\aaa"", @""T:\Temp\aaa ""); ``` Throws an exception: ``` Unhandled Exception: System.IO.IOException: Source and destination path must be different. at System.IO.Directory.Move(String sourceDirName, String destDirName) at ConsoleApp3.Program.Main(String[] args) in T:\Temp\ConsoleApp3\ConsoleApp3\Program.cs:line 12 ``` Also, if I manually create `""T:\Temp\aaa ""` (with space), I can't rename it with `Directory.Move` or delete with `Directory.Delete`. It ignores the space, tries to find `""T:\Temp\aaa""` (without space) and throws `System.IO.DirectoryNotFoundException`. It seems that the core reason lies in `Path.GetFullPath`: ```csharp Path.GetFullPath(@""T:\Temp\aaa "") // returns ""T:\Temp\aaa"" (without space) ``` I'm not sure if we could ever fix `Path.GetFullPath` in a backwards-compatible way, but could we at least do something with `Directory.Move` and `Directory.Delete`? ```console $ dotnet --info .NET Command Line Tools (2.1.2) Product Information: Version: 2.1.2 Commit SHA-1 hash: 5695315371 Runtime Environment: OS Name: Windows OS Version: 10.0.16299 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\2.1.2\ Microsoft .NET Core Shared Framework Host Version : 2.0.3 Build : a9190d4a75f4a982ae4b4fa8d1a24526566c69df ```" 26619 area-Microsoft.CSharp Regression in Microsoft.CSharp on accessing accessor or operator methods directly. "The following code behaves differently on netfx and corefx: ```C# dynamic d = ""abc""; d.op_Equality("""", """"); // 1 d.get_Length(); // 2 char e = d.get_Chars(2); // 3 ``` In netfx the behaviour of each line is: 1. Error with message ""'string.operator ==(string, string)': cannot explicitly call operator or accessor"". 2. Error with message ""'string.Length.get': cannot explicitly call operator or accessor"". 3. `e` is set to `'c'`. On corefx the behaviour is: 1. Error with message ""Non-invocable member 'string.operator ==(string, string)'"". 2. Error with message ""No overload for method 'get_Length' takes 0 arguments"". 3. Error with message ""'string.this[int].get': cannot explicitly call operator"". Points 1 and 2 are clearly wrong for corefx. Point 3 is probably more correct, but a breaking change. The regression was introduced at https://github.com/dotnet/corefx/pull/22457/files?diff=unified#diff-b7c43337cce88996675cf54e12ea04d3R206 which was supposed to invert the condition on an `if` but only went half-way, moving the branch but not actually changing the condition." 26620 area-Microsoft.CSharp Fix regression in Microsoft.CSharp on accessing accessors or operators Correct incorrectly inverted `if` test so accessor methods are allowed iff they are on parametrised properties. Fixes #26619 26621 area-System.Reflection Possibly incorrect branch distance calculation "Type: System.Reflection.Metadata.Ecma335.ControlFlowBuilder (in https://github.com/dotnet/corefx/blob/master/src/System.Reflection.Metadata/src/System/Reflection/Metadata/Ecma335/Encoding/ControlFlowBuilder.cs) ``` internal bool IsShortBranchDistance(ImmutableArray<int>.Builder labels, out int distance) { const int shortBranchSize = 2; const int longBranchSize = 5; int labelTargetOffset = labels[Label.Id - 1]; if (labelTargetOffset < 0) { Throw.InvalidOperation_LabelNotMarked(Label.Id); } //POSSIBLE ISSUE SPOT!!! distance = labelTargetOffset - (ILOffset + shortBranchSize); if (unchecked((sbyte)distance) == distance) { return true; } distance = labelTargetOffset - (ILOffset + longBranchSize); return false; } ``` Do I understand correctly, this doesn't follow really written instruction (leave / leave.s) and presume a compiler uses only short instruction for short jump? What happens if the compiler uses ""expensive"" long instruction even for short jumps? -------------- Consider this compiler: ``` StandaloneSignatureHandle MainGenerator(InstructionEncoder gen) { BlobBuilder builder = new BlobBuilder(); LocalVariablesEncoder encoder = new BlobEncoder(builder).LocalVariableSignature(2); BuildSignature(encoder.AddVariable().Type(), typeof(int)); BuildSignature(encoder.AddVariable().Type(), typeof(Exception)); StandaloneSignatureHandle localVariablesSignature = _tablesAndHeaps.AddStandaloneSignature(_tablesAndHeaps.GetOrAddBlob(builder)); LabelHandle tryStart = gen.DefineLabel(); LabelHandle tryEnd = gen.DefineLabel(); LabelHandle catchStart = gen.DefineLabel(); LabelHandle catchEnd = gen.DefineLabel(); gen.ControlFlowBuilder.AddCatchRegion(tryStart, tryEnd, catchStart, catchEnd, GetTypeReference(typeof(Exception))); gen.OpCode(ILOpCode.Ldc_i4_0); gen.StoreLocal(0); gen.MarkLabel(tryStart); gen.LoadLocal(0); gen.LoadLocal(0); gen.OpCode(ILOpCode.Div); gen.StoreLocal(0); gen.Branch(ILOpCode.Leave, catchEnd); gen.MarkLabel(tryEnd); gen.MarkLabel(catchStart); gen.StoreLocal(1); gen.Branch(ILOpCode.Leave, catchEnd); gen.MarkLabel(catchEnd); gen.OpCode(ILOpCode.Ret); return localVariablesSignature; } ``` Which generates this IL sequence: 0x0000 Ldc_i4_0 0x0001 Stloc_0 0x0002 Ldloc_0 0x0003 Ldloc_0 0x0004 Div 0x0005 Stloc_0 0x0006 Leave 09 (shouldn't be 6?) 0x000b Stloc_1 0x000c Leave 03 (shouldn't be 0?) 0x0011 Ret ----------------------- I found out, such compiled code makes error during viewing in ILSpy (what is minor issue) but it also breaks loading the output assembly in AppDomain. " 26622 area-System.Runtime Unsafe slower than unsafe "I was playing with the Unsafe Nuget package (that if I'm not mistaking is part of CoreFx) and sincerely I expected to have performance characteristics in pair with unsafe but trying to convert a bool to byte shows that is slower a lot slower! This is my test code: ```cs static void TestSpeed() { byte j = 0; bool b = false; Stopwatch sw1 = new Stopwatch(); Stopwatch sw2 = new Stopwatch(); for (int n = 0; n < 5; n++) { sw1.Start(); for (int i = 100 * 1000 * 1000; i > 0; i--) unsafe { j = *(byte*)(&b); } sw1.Stop(); sw2.Start(); for (int i = 100 * 1000 * 1000; i > 0; i--) j = Unsafe.As<bool, byte>(ref b); sw2.Stop(); Console.WriteLine(""sw1: "" + sw1.ElapsedMilliseconds + "" sw2:"" + sw2.ElapsedMilliseconds + "", +"" + 100 * (sw2.ElapsedMilliseconds - sw1.ElapsedMilliseconds) / sw1.ElapsedMilliseconds + ""% relative to sw1"" ); } } ``` These are my results: > sw1: 279 sw2:643, +130% relative to sw1 >sw1: 544 sw2:1165, +114% relative to sw1 >sw1: 751 sw2:1589, +111% relative to sw1 >sw1: 956 sw2:1997, +108% relative to sw1 >sw1: 1158 sw2:2412, +108% relative to sw1 " 26623 area-System.Data Canceling SQL Server query with while loop hangs forever "See StackOverflow post (https://stackoverflow.com/questions/48461567/canceling-query-with-while-loop-hangs-forever?noredirect=1#comment83955305_48461567) here for a full description of the issue. Essentially, the issue is that for a certain query I am finding that calling `CancellationTokenSource.Cancel()` hangs indefinitely instead of canceling the query. The same query cancels instantly in SQL Server Management Studio. Here is code the reproduces the issue: ``` void Main() { var cancellationTokenSource = new CancellationTokenSource(); var blocked = RunSqlAsync(cancellationTokenSource.Token); Console.WriteLine(blocked.Wait(TimeSpan.FromSeconds(1))); // false (blocked in SQL as expected) cancellationTokenSource.Cancel(); // hangs forever?! Console.WriteLine(""Finished calling Cancel()""); blocked.Wait(); } public async Task RunSqlAsync(CancellationToken cancellationToken) { var connectionString = new SqlConnectionStringBuilder { DataSource = @"".\sqlexpress"", IntegratedSecurity = true, Pooling = false }.ConnectionString; using (var connection = new SqlConnection(connectionString)) { await connection.OpenAsync().ConfigureAwait(false); using (var command = connection.CreateCommand()) { command.CommandText = @"" WHILE 1 = 1 BEGIN DECLARE @x INT = 1 END ""; command.CommandTimeout = 0; Console.WriteLine(""Running query""); await command.ExecuteNonQueryAsync(cancellationToken).ConfigureAwait(false); } } } ```" 26625 area-System.Net make opaque parameter optional for digest auth fixes #26599 26627 area-System.Net "Allow setting ""restricted"" headers using ClientWebSocket" "`ClientWebSocket` uses `ClientWebSocketOptions`, which has a `SetRequestHeader(string headerName, string headerValue)` method that allows you to set custom headers for the initial web socket request. The problem is that this calls into `WebHeaderCollection.Set(string name, string value)`: https://github.com/dotnet/corefx/blob/f8c403f7b05daf4b7f07d4b45ac7ee7f2372abfb/src/System.Net.WebSockets.Client/src/System/Net/WebSockets/ClientWebSocketOptions.cs#L34-L40 Which performs validation on ""restricted"" headers: https://github.com/dotnet/corefx/blob/f8c403f7b05daf4b7f07d4b45ac7ee7f2372abfb/src/System.Net.WebHeaderCollection/src/System/Net/WebHeaderCollection.cs#L134-L154 This results in the following exception when trying to set the `User-Agent` header and other ""restricted"" headers: > System.ArgumentException: The 'User-Agent' header must be modified using the appropriate property or method. The problem is that there's no `appropriate property or method` in sight, and because `ClientWebSocketOptions` doesn't expose the internal `WebHeaderCollection`, there's no way to bypass the validation. How can we set custom ""restricted"" headers for `ClientWebSocket` connections?" 26628 area-System.Reflection StackOverflow in error handling under low memory conditions Dump for this issue is here: https://drive.google.com/a/ayende.com/file/d/1f5HYZX3Q4-obubl6C1y4xKxcP5mCTMTV/view?usp=drive_web We are testing our software under low memory conditions and we are seeing some crashes in this regard. Related: https://github.com/dotnet/coreclr/issues/16004 We are testing what happens when we run out of room to allocate, and how we can survive that, and we started seeing `StackOverflowException`. We are now careful to not create any new threads while under this situation, so we investigated further. I believe that the dump indicates an infinite recursion issue with the way errors are handled. Note, we are using embedded PDBs, and that might be related. In the attached stack trace (and the dump), you can see: * 24 `DecodeEmbeddedPortablePdbDebugDirectoryData` * 19 `ReadEmbeddedPortablePdbDebugDirectoryData` * 11 `TryOpenEmbeddedPortablePdb` I'm _guessing_ that this is called by the runtime as part of handling exceptions to get the proper stack trace. Taking this line area as suspect: https://github.com/dotnet/corefx/blob/d5dc42495de7fa663642dd31765d2671c1758576/src/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEReader.EmbeddedPortablePdb.cs#L86-L93 We are under memory pressure, so the allocation fails, but this is the part that read the exception information, so the CLR call into this again, repeating the cycle until we get the stack overflow exception. The stack trace itself is short because we can't allocate too much stack space because we are constrained on memory. ``` 0:048> !dumpstack PDB symbol for clr.dll not loaded OS Thread Id: 0x36d0 (48) Current frame: coreclr + 0x23b4f Child-SP RetAddr Caller, Callee 00000076a1ff3000 00007ffaff3b49bc coreclr + 0x249bc, calling coreclr!MetaDataGetDispenser + 0x73c80 00000076a1ff3130 00007ffaff3b49bc coreclr + 0x249bc, calling coreclr!MetaDataGetDispenser + 0x73c80 00000076a1ff3190 00007ffb61f87775 KERNELBASE!FlushViewOfFile + 0x25, calling ntdll!NtFlushVirtualMemory 00000076a1ff31a0 00007ffaff3e6235 coreclr + 0x56235, calling coreclr!MetaDataGetDispenser + 0x70cc0 00000076a1ff31c8 00007ffaff3b487b coreclr + 0x2487b, calling coreclr!MetaDataGetDispenser + 0x71430 00000076a1ff31e8 00007ffaff3b4a7a coreclr + 0x24a7a, calling coreclr!MetaDataGetDispenser + 0x71430 00000076a1ff3240 00007ffafeeb7d36 (MethodDesc 00007ffafe9dc080 + 0x36 System.Runtime.InteropServices.SafeBuffer.ReleasePointer()), calling 00007ffaff3b47f0 (stub for System.Runtime.InteropServices.SafeHandle.DangerousRelease()) 00000076a1ff3280 00007ffb33acbfec (MethodDesc 00007ffaa07fcd28 + 0x15c System.IO.MemoryMappedFiles.MemoryMappedView.Flush(UIntPtr)) 00000076a1ff32d0 00007ffb33acbb1c (MethodDesc 00007ffaa07fcce8 + 0x2c System.IO.MemoryMappedFiles.MemoryMappedView.Dispose(Boolean)) 00000076a1ff3300 00007ffb33acc1fd (MethodDesc 00007ffaa07fd760 + 0xbd System.IO.MemoryMappedFiles.MemoryMappedViewAccessor.Dispose(Boolean)) 00000076a1ff3310 00007ffaff4a2c5a coreclr!MetaDataGetDispenser + 0x5117a, calling coreclr + 0x72bbc 00000076a1ff3340 00007ffb33acc194 (MethodDesc 00007ffaa07fd760 + 0x54 System.IO.MemoryMappedFiles.MemoryMappedViewAccessor.Dispose(Boolean)), calling (MethodDesc 00007ffaa07fd760 + 0x87 System.IO.MemoryMappedFiles.MemoryMappedViewAccessor.Dispose(Boolean)) 00000076a1ff3350 00007ffafedbee39 (MethodDesc 00007ffafe971f80 + 0x79 System.Threading.Interlocked.Exchange[[System.__Canon, System.Private.CoreLib]](System.__Canon ByRef, System.__Canon)), calling 00007ffaff4a2c30 (stub for System.Threading.Interlocked._Exchange(TypedReference, TypedReference)) 00000076a1ff3380 00007ffafefa06fa (MethodDesc 00007ffafe9ef2b8 + 0x1a System.IO.UnmanagedMemoryAccessor.Dispose()) 00000076a1ff33b0 00007ffb211df1ac (MethodDesc 00007ffaa07fd9c0 + 0x6c System.Reflection.Internal.MemoryMappedFileBlock+DisposableData.Release()) 00000076a1ff33e0 00007ffb211df098 (MethodDesc 00007ffaa07fd888 + 0x18 System.Reflection.Internal.MemoryMappedFileBlock.Dispose()) 00000076a1ff3400 00007ffaff46870d coreclr!MetaDataGetDispenser + 0x16c2d 00000076a1ff3410 00007ffb211aace8 (MethodDesc 00007ffaa07bdea8 + 0xf8 System.Reflection.PortableExecutable.PEReader.ReadEmbeddedPortablePdbDebugDirectoryData(System.Reflection.PortableExecutable.DebugDirectoryEntry)) 00000076a1ff3460 00007ffaff3e4a04 coreclr + 0x54a04 00000076a1ff34c0 00007ffaff514e07 coreclr!MetaDataGetDispenser + 0xc3327, calling coreclr + 0x5492c 00000076a1ff35c0 00007ffaff468046 coreclr!MetaDataGetDispenser + 0x16566, calling coreclr!MetaDataGetDispenser + 0x70cc0 00000076a1ff3650 00007ffb64d8819f ntdll!RtlLookupFunctionEntry + 0xdf, calling ntdll!RtlpxLookupFunctionTable 00000076a1ff36b0 00007ffaff412f40 coreclr + 0x82f40, calling coreclr + 0x832a0 00000076a1ff3780 00007ffaff3e586c coreclr + 0x5586c, calling coreclr + 0x54aa0 00000076a1ff3858 00007ffb211aac8b (MethodDesc 00007ffaa07bdea8 + 0x9b System.Reflection.PortableExecutable.PEReader.ReadEmbeddedPortablePdbDebugDirectoryData(System.Reflection.PortableExecutable.DebugDirectoryEntry)), calling (MethodDesc 00007ffaa07bdec8 + 0 System.Reflection.PortableExecutable.PEReader.DecodeEmbeddedPortablePdbDebugDirectoryData(System.Reflection.Internal.AbstractMemoryBlock)) 00000076a1ff39d0 00007ffaff3ca9fe coreclr + 0x3a9fe 00000076a1ff3a00 00007ffaff4690fd coreclr!MetaDataGetDispenser + 0x1761d, calling coreclr + 0x29a50 00000076a1ff3a60 00007ffaff3a0bd9 coreclr + 0x10bd9, calling coreclr + 0x10eec 00000076a1ff3ab0 00007ffb211aac8b (MethodDesc 00007ffaa07bdea8 + 0x9b System.Reflection.PortableExecutable.PEReader.ReadEmbeddedPortablePdbDebugDirectoryData(System.Reflection.PortableExecutable.DebugDirectoryEntry)), calling (MethodDesc 00007ffaa07bdec8 + 0 System.Reflection.PortableExecutable.PEReader.DecodeEmbeddedPortablePdbDebugDirectoryData(System.Reflection.Internal.AbstractMemoryBlock)) 00000076a1ff3b90 00007ffaff3bb752 coreclr + 0x2b752, calling coreclr!MetaDataGetDispenser + 0x2ac30 00000076a1ff3c70 00007ffb211aac8b (MethodDesc 00007ffaa07bdea8 + 0x9b System.Reflection.PortableExecutable.PEReader.ReadEmbeddedPortablePdbDebugDirectoryData(System.Reflection.PortableExecutable.DebugDirectoryEntry)), calling (MethodDesc 00007ffaa07bdec8 + 0 System.Reflection.PortableExecutable.PEReader.DecodeEmbeddedPortablePdbDebugDirectoryData(System.Reflection.Internal.AbstractMemoryBlock)) 00000076a1ff3e90 00007ffaff3b618e coreclr + 0x2618e, calling coreclr!MetaDataGetDispenser + 0x73c80 00000076a1ff3f80 00007ffb211aa518 (MethodDesc 00007ffaa07bde68 + 0x1c8 System.Reflection.PortableExecutable.PEReader.TryOpenAssociatedPortablePdb(System.String, System.Func`2<System.String,System.IO.Stream>, System.Reflection.Metadata.MetadataReaderProvider ByRef, System.String ByRef)), calling (MethodDesc 00007ffaa07bde98 + 0 System.Reflection.PortableExecutable.PEReader.TryOpenEmbeddedPortablePdb(System.Reflection.PortableExecutable.DebugDirectoryEntry, Boolean ByRef, System.Reflection.Metadata.MetadataReaderProvider ByRef, System.Exception ByRef)) 00000076a1ff4030 00007ffb64d95ed4 ntdll!RtlFreeHeap + 0x204, calling ntdll!RtlpHpStackLoggingEnabled 00000076a1ff4060 00007ffaff3bb752 coreclr + 0x2b752, calling coreclr!MetaDataGetDispenser + 0x2ac30 00000076a1ff4140 00007ffb211aaafc (MethodDesc 00007ffaa07bde98 + 0x3c System.Reflection.PortableExecutable.PEReader.TryOpenEmbeddedPortablePdb(System.Reflection.PortableExecutable.DebugDirectoryEntry, Boolean ByRef, System.Reflection.Metadata.MetadataReaderProvider ByRef, System.Exception ByRef)), calling (MethodDesc 00007ffaa07bdea8 + 0 System.Reflection.PortableExecutable.PEReader.ReadEmbeddedPortablePdbDebugDirectoryData(System.Reflection.PortableExecutable.DebugDirectoryEntry)) 00000076a1ff4360 00007ffaff3b618e coreclr + 0x2618e, calling coreclr!MetaDataGetDispenser + 0x73c80 00000076a1ff4450 00007ffb211aa518 (MethodDesc 00007ffaa07bde68 + 0x1c8 System.Reflection.PortableExecutable.PEReader.TryOpenAssociatedPortablePdb(System.String, System.Func`2<System.String,System.IO.Stream>, System.Reflection.Metadata.MetadataReaderProvider ByRef, System.String ByRef)), calling (MethodDesc 00007ffaa07bde98 + 0 System.Reflection.PortableExecutable.PEReader.TryOpenEmbeddedPortablePdb(System.Reflection.PortableExecutable.DebugDirectoryEntry, Boolean ByRef, System.Reflection.Metadata.MetadataReaderProvider ByRef, System.Exception ByRef)) 00000076a1ff4500 00007ffb64d95ed4 ntdll!RtlFreeHeap + 0x204, calling ntdll!RtlpHpStackLoggingEnabled 00000076a1ff4720 00007ffb211aac8b (MethodDesc 00007ffaa07bdea8 + 0x9b System.Reflection.PortableExecutable.PEReader.ReadEmbeddedPortablePdbDebugDirectoryData(System.Reflection.PortableExecutable.DebugDirectoryEntry)), calling (MethodDesc 00007ffaa07bdec8 + 0 System.Reflection.PortableExecutable.PEReader.DecodeEmbeddedPortablePdbDebugDirectoryData(System.Reflection.Internal.AbstractMemoryBlock)) 00000076a1ff4770 00007ffaff3e43a1 coreclr + 0x543a1, calling coreclr + 0x55528 00000076a1ff4870 00007ffb211aac8b (MethodDesc 00007ffaa07bdea8 + 0x9b System.Reflection.PortableExecutable.PEReader.ReadEmbeddedPortablePdbDebugDirectoryData(System.Reflection.PortableExecutable.DebugDirectoryEntry)), calling (MethodDesc 00007ffaa07bdec8 + 0 System.Reflection.PortableExecutable.PEReader.DecodeEmbeddedPortablePdbDebugDirectoryData(System.Reflection.Internal.AbstractMemoryBlock)) 00000076a1ff48a0 00007ffb64e223ad ntdll!RtlpExecuteHandlerForUnwind + 0xd 00000076a1ff48d0 00007ffb64d8780d ntdll!RtlUnwindEx + 0x47d, calling ntdll!RtlpExecuteHandlerForUnwind 00000076a1ff4930 00007ffb211aac8b (MethodDesc 00007ffaa07bdea8 + 0x9b System.Reflection.PortableExecutable.PEReader.ReadEmbeddedPortablePdbDebugDirectoryData(System.Reflection.PortableExecutable.DebugDirectoryEntry)), calling (MethodDesc 00007ffaa07bdec8 + 0 System.Reflection.PortableExecutable.PEReader.DecodeEmbeddedPortablePdbDebugDirectoryData(System.Reflection.Internal.AbstractMemoryBlock)) 00000076a1ff4998 00007ffb211aac8b (MethodDesc 00007ffaa07bdea8 + 0x9b System.Reflection.PortableExecutable.PEReader.ReadEmbeddedPortablePdbDebugDirectoryData(System.Reflection.PortableExecutable.DebugDirectoryEntry)), calling (MethodDesc 00007ffaa07bdec8 + 0 System.Reflection.PortableExecutable.PEReader.DecodeEmbeddedPortablePdbDebugDirectoryData(System.Reflection.Internal.AbstractMemoryBlock)) 00000076a1ff4a80 00007ffb64d95ed4 ntdll!RtlFreeHeap + 0x204, calling ntdll!RtlpHpStackLoggingEnabled 00000076a1ff4ab0 00007ffaff3bb752 coreclr + 0x2b752, calling coreclr!MetaDataGetDispenser + 0x2ac30 00000076a1ff4b90 00007ffb211aac8b (MethodDesc 00007ffaa07bdea8 + 0x9b System.Reflection.PortableExecutable.PEReader.ReadEmbeddedPortablePdbDebugDirectoryData(System.Reflection.PortableExecutable.DebugDirectoryEntry)), calling (MethodDesc 00007ffaa07bdec8 + 0 System.Reflection.PortableExecutable.PEReader.DecodeEmbeddedPortablePdbDebugDirectoryData(System.Reflection.Internal.AbstractMemoryBlock)) 00000076a1ff4db0 00007ffaff3b618e coreclr + 0x2618e, calling coreclr!MetaDataGetDispenser + 0x73c80 00000076a1ff4ea0 00007ffb211aa518 (MethodDesc 00007ffaa07bde68 + 0x1c8 System.Reflection.PortableExecutable.PEReader.TryOpenAssociatedPortablePdb(System.String, System.Func`2<System.String,System.IO.Stream>, System.Reflection.Metadata.MetadataReaderProvider ByRef, System.String ByRef)), calling (MethodDesc 00007ffaa07bde98 + 0 System.Reflection.PortableExecutable.PEReader.TryOpenEmbeddedPortablePdb(System.Reflection.PortableExecutable.DebugDirectoryEntry, Boolean ByRef, System.Reflection.Metadata.MetadataReaderProvider ByRef, System.Exception ByRef)) 00000076a1ff4f50 00007ffb64d95ed4 ntdll!RtlFreeHeap + 0x204, calling ntdll!RtlpHpStackLoggingEnabled 00000076a1ff4fb0 00007ffaff4b566c coreclr!MetaDataGetDispenser + 0x63b8c, calling KERNEL32!RtlUnwindExStub 00000076a1ff5050 00007ffaff4c35d3 coreclr!MetaDataGetDispenser + 0x71af3 00000076a1ff50e0 00007ffb211aaafc (MethodDesc 00007ffaa07bde98 + 0x3c System.Reflection.PortableExecutable.PEReader.TryOpenEmbeddedPortablePdb(System.Reflection.PortableExecutable.DebugDirectoryEntry, Boolean ByRef, System.Reflection.Metadata.MetadataReaderProvider ByRef, System.Exception ByRef)), calling (MethodDesc 00007ffaa07bdea8 + 0 System.Reflection.PortableExecutable.PEReader.ReadEmbeddedPortablePdbDebugDirectoryData(System.Reflection.PortableExecutable.DebugDirectoryEntry)) 00000076a1ff5480 00007ffb64de0aa0 ntdll!RtlSetLastWin32Error + 0x40, calling ntdll!_security_check_cookie 00000076a1ff54d0 00007ffaff3e4438 coreclr + 0x54438, calling coreclr!MetaDataGetDispenser + 0x63b4c 00000076a1ff55c0 00007ffb211aaafc (MethodDesc 00007ffaa07bde98 + 0x3c System.Reflection.PortableExecutable.PEReader.TryOpenEmbeddedPortablePdb(System.Reflection.PortableExecutable.DebugDirectoryEntry, Boolean ByRef, System.Reflection.Metadata.MetadataReaderProvider ByRef, System.Exception ByRef)), calling (MethodDesc 00007ffaa07bdea8 + 0 System.Reflection.PortableExecutable.PEReader.ReadEmbeddedPortablePdbDebugDirectoryData(System.Reflection.PortableExecutable.DebugDirectoryEntry)) 00000076a1ff55e0 00007ffb211aaafc (MethodDesc 00007ffaa07bde98 + 0x3c System.Reflection.PortableExecutable.PEReader.TryOpenEmbeddedPortablePdb(System.Reflection.PortableExecutable.DebugDirectoryEntry, Boolean ByRef, System.Reflection.Metadata.MetadataReaderProvider ByRef, System.Exception ByRef)), calling (MethodDesc 00007ffaa07bdea8 + 0 System.Reflection.PortableExecutable.PEReader.ReadEmbeddedPortablePdbDebugDirectoryData(System.Reflection.PortableExecutable.DebugDirectoryEntry)) 00000076a1ff5600 00007ffb64e2232d ntdll!RtlpExecuteHandlerForException + 0xd 00000076a1ff5630 00007ffb64d86c26 ntdll!RtlDispatchException + 0x5c6, calling ntdll!RtlpExecuteHandlerForException 00000076a1ff56e8 00007ffb211aaafc (MethodDesc 00007ffaa07bde98 + 0x3c System.Reflection.PortableExecutable.PEReader.TryOpenEmbeddedPortablePdb(System.Reflection.PortableExecutable.DebugDirectoryEntry, Boolean ByRef, System.Reflection.Metadata.MetadataReaderProvider ByRef, System.Exception ByRef)), calling (MethodDesc 00007ffaa07bdea8 + 0 System.Reflection.PortableExecutable.PEReader.ReadEmbeddedPortablePdbDebugDirectoryData(System.Reflection.PortableExecutable.DebugDirectoryEntry)) 00000076a1ff5740 00007ffaff3b618e coreclr + 0x2618e, calling coreclr!MetaDataGetDispenser + 0x73c80 00000076a1ff5830 00007ffb211aa518 (MethodDesc 00007ffaa07bde68 + 0x1c8 System.Reflection.PortableExecutable.PEReader.TryOpenAssociatedPortablePdb(System.String, System.Func`2<System.String,System.IO.Stream>, System.Reflection.Metadata.MetadataReaderProvider ByRef, System.String ByRef)), calling (MethodDesc 00007ffaa07bde98 + 0 System.Reflection.PortableExecutable.PEReader.TryOpenEmbeddedPortablePdb(System.Reflection.PortableExecutable.DebugDirectoryEntry, Boolean ByRef, System.Reflection.Metadata.MetadataReaderProvider ByRef, System.Exception ByRef)) 00000076a1ff58e0 00007ffb64d95ed4 ntdll!RtlFreeHeap + 0x204, calling ntdll!RtlpHpStackLoggingEnabled 00000076a1ff5910 00007ffaff3bb752 coreclr + 0x2b752, calling coreclr!MetaDataGetDispenser + 0x2ac30 00000076a1ff59e0 00007ffaff4c35d3 coreclr!MetaDataGetDispenser + 0x71af3 00000076a1ff59f0 00007ffaff3c43a9 coreclr + 0x343a9, calling coreclr!MetaDataGetDispenser + 0x1dcc8 00000076a1ff5a60 00007ffaff3c357c coreclr + 0x3357c 00000076a1ff5d30 00007ffb64e2125e ntdll!KiUserExceptionDispatch + 0x2e, calling ntdll!RtlDispatchException 00000076a1ff6450 00007ffb61f52918 KERNELBASE!RaiseException + 0x68 ====> Exception Code e0434352 cxr@00000076a1ff5d40 exr@00000076a1ff6230 00000076a1ff5d40 00007ffaff3b1298 coreclr + 0x21298, calling coreclr + 0x3c7bc 00000076a1ff5d60 00007ffb64de0aa0 ntdll!RtlSetLastWin32Error + 0x40, calling ntdll!_security_check_cookie 00000076a1ff5e30 00007ffb61f52918 KERNELBASE!RaiseException + 0x68, calling ntdll!RtlRaiseException 00000076a1ff5f30 00007ffaff44e970 coreclr!coreclr_execute_assembly + 0x1080, calling coreclr!coreclr_execute_assembly + 0x1808 00000076a1ff6030 00007ffaff44e970 coreclr!coreclr_execute_assembly + 0x1080, calling coreclr!coreclr_execute_assembly + 0x1808 00000076a1ff6238 00007ffb61f52918 KERNELBASE!RaiseException + 0x68, calling ntdll!RtlRaiseException 00000076a1ff62c8 00007ffb61f52918 KERNELBASE!RaiseException + 0x68, calling ntdll!RtlRaiseException 00000076a1ff62d0 00007ffafee9fa3a (MethodDesc 00007ffafe9d8a80 + 0x3a System.IO.UnmanagedMemoryStream.ReadByte()) 00000076a1ff6360 00007ffafee44eb9 (MethodDesc 00007ffafe9cd160 + 0x89 System.IO.BinaryReader.FillBuffer(Int32)) 00000076a1ff63a0 00007ffafee9f3b5 (MethodDesc 00007ffafe9d8a40 + 0x15 System.IO.UnmanagedMemoryStream.get_Position()) 00000076a1ff63e0 00007ffaff6b1e89 coreclr!GetCLRRuntimeHost + 0x12a939, calling coreclr!MetaDataGetDispenser + 0x70cc0 00000076a1ff6410 00007ffaff4027a0 coreclr + 0x727a0, calling coreclr + 0x728cc 00000076a1ff6440 00007ffb61f52918 KERNELBASE!RaiseException + 0x68, calling ntdll!RtlRaiseException 00000076a1ff6478 00007ffb61f52918 KERNELBASE!RaiseException + 0x68, calling ntdll!RtlRaiseException 00000076a1ff64c0 00007ffafee6d468 (MethodDesc 00007ffafe9d2428 + 0x88 System.Collections.Generic.Dictionary`2[[System.__Canon, System.Private.CoreLib],[System.Resources.ResourceLocator, System.Private.CoreLib]].Initialize(Int32)), calling coreclr!MetaDataGetDispenser + 0x70c50 00000076a1ff64f0 00007ffaff3df672 coreclr + 0x4f672, calling coreclr!MetaDataGetDispenser + 0x70cc0 00000076a1ff6520 00007ffaff3df5fd coreclr + 0x4f5fd, calling KERNEL32!RaiseExceptionStub 00000076a1ff6620 00007ffaff4ac21f coreclr!MetaDataGetDispenser + 0x5a73f, calling coreclr + 0x4f3b8 00000076a1ff6660 00007ffafedb337e (MethodDesc 00007ffafe9b86f8 + 0x3fe System.Resources.ResourceManager.GetString(System.String, System.Globalization.CultureInfo)) 00000076a1ff66d0 00007ffafedb321d (MethodDesc 00007ffafe9b86f8 + 0x29d System.Resources.ResourceManager.GetString(System.String, System.Globalization.CultureInfo)), calling (MethodDesc 00007ffafe9b86f8 + 0x3d0 System.Resources.ResourceManager.GetString(System.String, System.Globalization.CultureInfo)) 00000076a1ff6710 00007ffb211aaf98 (MethodDesc 00007ffaa07bdec8 + 0x1d8 System.Reflection.PortableExecutable.PEReader.DecodeEmbeddedPortablePdbDebugDirectoryData(System.Reflection.Internal.AbstractMemoryBlock)), calling System_Reflection_Metadata!Equals + 0x15 [E:\A\_work\1439\s\corefx\src\System.Reflection.Metadata\src\System\Reflection\Metadata\TypeSystem\Handles.TypeSystem.cs:1414] 00000076a1ff67a8 00007ffaff4ac16e coreclr!MetaDataGetDispenser + 0x5a68e, calling coreclr!MetaDataGetDispenser + 0x71430 00000076a1ff67d0 00007ffb211aaf98 (MethodDesc 00007ffaa07bdec8 + 0x1d8 System.Reflection.PortableExecutable.PEReader.DecodeEmbeddedPortablePdbDebugDirectoryData(System.Reflection.Internal.AbstractMemoryBlock)), calling System_Reflection_Metadata!Equals + 0x15 [E:\A\_work\1439\s\corefx\src\System.Reflection.Metadata\src\System\Reflection\Metadata\TypeSystem\Handles.TypeSystem.cs:1414] 00000076a1ff6830 00007ffaff3e4a04 coreclr + 0x54a04 00000076a1ff6890 00007ffaff3e5cb4 coreclr + 0x55cb4, calling coreclr + 0x5492c 00000076a1ff68e0 00007ffb211aae20 (MethodDesc 00007ffaa07bdec8 + 0x60 System.Reflection.PortableExecutable.PEReader.DecodeEmbeddedPortablePdbDebugDirectoryData(System.Reflection.Internal.AbstractMemoryBlock)), calling 00007ffaa0578ec0 00000076a1ff6900 00007ffaff3e5f26 coreclr + 0x55f26, calling coreclr!MetaDataGetDispenser + 0x70cc0 00000076a1ff6930 00007ffaff3e446c coreclr + 0x5446c, calling coreclr + 0x55c24 00000076a1ff69b0 00007ffaff4c7db9 coreclr!MetaDataGetDispenser + 0x762d9, calling coreclr!MetaDataGetDispenser + 0x762ec 00000076a1ff6a30 00007ffb211aae20 (MethodDesc 00007ffaa07bdec8 + 0x60 System.Reflection.PortableExecutable.PEReader.DecodeEmbeddedPortablePdbDebugDirectoryData(System.Reflection.Internal.AbstractMemoryBlock)), calling 00007ffaa0578ec0 00000076a1ff6a60 00007ffb64e223ad ntdll!RtlpExecuteHandlerForUnwind + 0xd 00000076a1ff6a90 00007ffb64d8780d ntdll!RtlUnwindEx + 0x47d, calling ntdll!RtlpExecuteHandlerForUnwind 00000076a1ff6af0 00007ffb211aae20 (MethodDesc 00007ffaa07bdec8 + 0x60 System.Reflection.PortableExecutable.PEReader.DecodeEmbeddedPortablePdbDebugDirectoryData(System.Reflection.Internal.AbstractMemoryBlock)), calling 00007ffaa0578ec0 00000076a1ff6b58 00007ffb211aae20 (MethodDesc 00007ffaa07bdec8 + 0x60 System.Reflection.PortableExecutable.PEReader.DecodeEmbeddedPortablePdbDebugDirectoryData(System.Reflection.Internal.AbstractMemoryBlock)), calling 00007ffaa0578ec0 00000076a1ff6c70 00007ffb64dcad17 ntdll!RtlpIsDosDeviceName_Ustr + 0x17, calling ntdll!RtlDetermineDosPathNameType_Ustr 00000076a1ff6d50 00007ffb211aac8b (MethodDesc 00007ffaa07bdea8 + 0x9b System.Reflection.PortableExecutable.PEReader.ReadEmbeddedPortablePdbDebugDirectoryData(System.Reflection.PortableExecutable.DebugDirectoryEntry)), calling (MethodDesc 00007ffaa07bdec8 + 0 System.Reflection.PortableExecutable.PEReader.DecodeEmbeddedPortablePdbDebugDirectoryData(System.Reflection.Internal.AbstractMemoryBlock)) 00000076a1ff7060 00007ffb211aac8b (MethodDesc 00007ffaa07bdea8 + 0x9b System.Reflection.PortableExecutable.PEReader.ReadEmbeddedPortablePdbDebugDirectoryData(System.Reflection.PortableExecutable.DebugDirectoryEntry)), calling (MethodDesc 00007ffaa07bdec8 + 0 System.Reflection.PortableExecutable.PEReader.DecodeEmbeddedPortablePdbDebugDirectoryData(System.Reflection.Internal.AbstractMemoryBlock)) 00000076a1ff7170 00007ffaff4b566c coreclr!MetaDataGetDispenser + 0x63b8c, calling KERNEL32!RtlUnwindExStub 00000076a1ff72a0 00007ffb211aae20 (MethodDesc 00007ffaa07bdec8 + 0x60 System.Reflection.PortableExecutable.PEReader.DecodeEmbeddedPortablePdbDebugDirectoryData(System.Reflection.Internal.AbstractMemoryBlock)), calling 00007ffaa0578ec0 00000076a1ff7640 00007ffb64de0aa0 ntdll!RtlSetLastWin32Error + 0x40, calling ntdll!_security_check_cookie 00000076a1ff7690 00007ffaff3e4438 coreclr + 0x54438, calling coreclr!MetaDataGetDispenser + 0x63b4c 00000076a1ff7780 00007ffb211aae20 (MethodDesc 00007ffaa07bdec8 + 0x60 System.Reflection.PortableExecutable.PEReader.DecodeEmbeddedPortablePdbDebugDirectoryData(System.Reflection.Internal.AbstractMemoryBlock)), calling 00007ffaa0578ec0 00000076a1ff77a0 00007ffb211aae20 (MethodDesc 00007ffaa07bdec8 + 0x60 System.Reflection.PortableExecutable.PEReader.DecodeEmbeddedPortablePdbDebugDirectoryData(System.Reflection.Internal.AbstractMemoryBlock)), calling 00007ffaa0578ec0 00000076a1ff77c0 00007ffb64e2232d ntdll!RtlpExecuteHandlerForException + 0xd 00000076a1ff77f0 00007ffb64d86c26 ntdll!RtlDispatchException + 0x5c6, calling ntdll!RtlpExecuteHandlerForException 00000076a1ff78a8 00007ffb211aae20 (MethodDesc 00007ffaa07bdec8 + 0x60 System.Reflection.PortableExecutable.PEReader.DecodeEmbeddedPortablePdbDebugDirectoryData(System.Reflection.Internal.AbstractMemoryBlock)), calling 00007ffaa0578ec0 00000076a1ff79f0 00007ffb211aac8b (MethodDesc 00007ffaa07bdea8 + 0x9b System.Reflection.PortableExecutable.PEReader.ReadEmbeddedPortablePdbDebugDirectoryData(System.Reflection.PortableExecutable.DebugDirectoryEntry)), calling (MethodDesc 00007ffaa07bdec8 + 0 System.Reflection.PortableExecutable.PEReader.DecodeEmbeddedPortablePdbDebugDirectoryData(System.Reflection.Internal.AbstractMemoryBlock)) 00000076a1ff7ad0 00007ffb64dcad17 ntdll!RtlpIsDosDeviceName_Ustr + 0x17, calling ntdll!RtlDetermineDosPathNameType_Ustr 00000076a1ff7c20 00007ffb64dca0a3 ntdll!RtlpDosPathNameToRelativeNtPathName + 0x2e3, calling ntdll!_security_check_cookie 00000076a1ff7e90 00007ffaff4045a7 coreclr + 0x745a7, calling coreclr!MetaDataGetDispenser + 0x70cc0 00000076a1ff7ef0 00007ffb64e2125e ntdll!KiUserExceptionDispatch + 0x2e, calling ntdll!RtlDispatchException 00000076a1ff8610 00007ffb61f52918 KERNELBASE!RaiseException + 0x68 ====> Exception Code e0434352 cxr@00000076a1ff7f00 exr@00000076a1ff83f0 00000076a1ff7f10 00007ffb64de0aa0 ntdll!RtlSetLastWin32Error + 0x40, calling ntdll!_security_check_cookie 00000076a1ff7fc0 00007ffaff4c35d3 coreclr!MetaDataGetDispenser + 0x71af3 00000076a1ff7ff0 00007ffb61f52918 KERNELBASE!RaiseException + 0x68, calling ntdll!RtlRaiseException 00000076a1ff80b0 00007ffaff6cf720 coreclr!GetCLRRuntimeHost + 0x1481d0, calling coreclr + 0x95588 00000076a1ff80e0 00007ffaff6cefba coreclr!GetCLRRuntimeHost + 0x147a6a, calling coreclr!GetCLRRuntimeHost + 0x12d024 00000076a1ff81b0 00007ffaff6cf720 coreclr!GetCLRRuntimeHost + 0x1481d0, calling coreclr + 0x95588 00000076a1ff81e0 00007ffaff6cefba coreclr!GetCLRRuntimeHost + 0x147a6a, calling coreclr!GetCLRRuntimeHost + 0x12d024 00000076a1ff82f0 00007ffaff6b8d15 coreclr!GetCLRRuntimeHost + 0x1317c5, calling coreclr!GetCLRRuntimeHost + 0x146f38 00000076a1ff8300 00007ffb61f3ba56 KERNELBASE!BaseSetLastNTError + 0x16, calling ntdll!RtlSetLastWin32Error 00000076a1ff8330 00007ffaff6cfe32 coreclr!GetCLRRuntimeHost + 0x1488e2, calling coreclr!GetCLRRuntimeHost + 0x12e870 00000076a1ff8380 00007ffaff6b5d9e coreclr!GetCLRRuntimeHost + 0x12e84e, calling coreclr!GetCLRRuntimeHost + 0x14869c 00000076a1ff83f8 00007ffb61f52918 KERNELBASE!RaiseException + 0x68, calling ntdll!RtlRaiseException 00000076a1ff8488 00007ffb61f52918 KERNELBASE!RaiseException + 0x68, calling ntdll!RtlRaiseException 00000076a1ff84b0 00007ffaff6b3e47 coreclr!GetCLRRuntimeHost + 0x12c8f7, calling coreclr + 0x95588 00000076a1ff8580 00007ffaff597a92 coreclr!GetCLRRuntimeHost + 0x10542, calling coreclr!MetaDataGetDispenser + 0x73c80 00000076a1ff8590 00007ffaff402963 coreclr + 0x72963 00000076a1ff85a0 00007ffaff6b1e89 coreclr!GetCLRRuntimeHost + 0x12a939, calling coreclr!MetaDataGetDispenser + 0x70cc0 00000076a1ff85d0 00007ffaff4027a0 coreclr + 0x727a0, calling coreclr + 0x728cc 00000076a1ff8600 00007ffb61f52918 KERNELBASE!RaiseException + 0x68, calling ntdll!RtlRaiseException 00000076a1ff8638 00007ffb61f52918 KERNELBASE!RaiseException + 0x68, calling ntdll!RtlRaiseException 00000076a1ff86b0 00007ffaff3df672 coreclr + 0x4f672, calling coreclr!MetaDataGetDispenser + 0x70cc0 00000076a1ff86e0 00007ffaff3df5fd coreclr + 0x4f5fd, calling KERNEL32!RaiseExceptionStub 00000076a1ff87e0 00007ffaff5bdaa1 coreclr!GetCLRRuntimeHost + 0x36551, calling coreclr + 0x4f3b8 00000076a1ff8830 00007ffaff401b5c coreclr + 0x71b5c, calling coreclr!GetCLRRuntimeHost + 0x364e0 00000076a1ff8880 00007ffafeeb7cf1 (MethodDesc 00007ffafe9dc070 + 0x51 System.Runtime.InteropServices.SafeBuffer.AcquirePointer(Byte* ByRef)), calling 00007ffaff3b49f0 (stub for System.Runtime.InteropServices.SafeHandle.DangerousAddRef(Boolean ByRef)) 00000076a1ff88d8 00007ffaff3eb2bd coreclr + 0x5b2bd, calling coreclr!MetaDataGetDispenser + 0x71430 00000076a1ff8930 00007ffb211aae20 (MethodDesc 00007ffaa07bdec8 + 0x60 System.Reflection.PortableExecutable.PEReader.DecodeEmbeddedPortablePdbDebugDirectoryData(System.Reflection.Internal.AbstractMemoryBlock)), calling 00007ffaa0578ec0 00000076a1ff89c8 00007ffaff4018c7 coreclr + 0x718c7, calling coreclr!MetaDataGetDispenser + 0x71430 00000076a1ff8a10 00007ffb211aae20 (MethodDesc 00007ffaa07bdec8 + 0x60 System.Reflection.PortableExecutable.PEReader.DecodeEmbeddedPortablePdbDebugDirectoryData(System.Reflection.Internal.AbstractMemoryBlock)), calling 00007ffaa0578ec0 00000076a1ff8a20 00007ffb2118f232 (MethodDesc 00007ffaa07be2b8 + 0x42 System.Reflection.Internal.MemoryBlockProvider.GetMemoryBlock(Int32, Int32)) 00000076a1ff8a40 00007ffb211ab2b4 (MethodDesc 00007ffaa07fb5f0 + 0x64 System.Reflection.Metadata.PathUtilities.CombinePathWithRelativePath(System.String, System.String)), calling (MethodDesc 00007ffafe9a7638 + 0 System.String.Concat(System.String, System.String, System.String)) 00000076a1ff8aa0 00007ffb211aac8b (MethodDesc 00007ffaa07bdea8 + 0x9b System.Reflection.PortableExecutable.PEReader.ReadEmbeddedPortablePdbDebugDirectoryData(System.Reflection.PortableExecutable.DebugDirectoryEntry)), calling (MethodDesc 00007ffaa07bdec8 + 0 System.Reflection.PortableExecutable.PEReader.DecodeEmbeddedPortablePdbDebugDirectoryData(System.Reflection.Internal.AbstractMemoryBlock)) 00000076a1ff8b10 00007ffb211aaafc (MethodDesc 00007ffaa07bde98 + 0x3c System.Reflection.PortableExecutable.PEReader.TryOpenEmbeddedPortablePdb(System.Reflection.PortableExecutable.DebugDirectoryEntry, Boolean ByRef, System.Reflection.Metadata.MetadataReaderProvider ByRef, System.Exception ByRef)), calling (MethodDesc 00007ffaa07bdea8 + 0 System.Reflection.PortableExecutable.PEReader.ReadEmbeddedPortablePdbDebugDirectoryData(System.Reflection.PortableExecutable.DebugDirectoryEntry)) 00000076a1ff8b80 00007ffb211aa518 (MethodDesc 00007ffaa07bde68 + 0x1c8 System.Reflection.PortableExecutable.PEReader.TryOpenAssociatedPortablePdb(System.String, System.Func`2<System.String,System.IO.Stream>, System.Reflection.Metadata.MetadataReaderProvider ByRef, System.String ByRef)), calling (MethodDesc 00007ffaa07bde98 + 0 System.Reflection.PortableExecutable.PEReader.TryOpenEmbeddedPortablePdb(System.Reflection.PortableExecutable.DebugDirectoryEntry, Boolean ByRef, System.Reflection.Metadata.MetadataReaderProvider ByRef, System.Exception ByRef)) 00000076a1ff8ba0 00007ffb5127ba52 (MethodDesc 00007ffa9fb5f030 + 0x32 System.IO.File.OpenRead(System.String)), calling (MethodDesc 00007ffafe9d25d0 + 0 System.IO.FileStream..ctor(System.String, System.IO.FileMode, System.IO.FileAccess, System.IO.FileShare)) 00000076a1ff8c70 00007ffb25645e3b (MethodDesc 00007ffaa07b2e18 + 0x7b System.Diagnostics.StackTraceSymbols.TryOpenReaderFromAssemblyFile(System.String, IntPtr, Int32)) 00000076a1ff8ce0 00007ffb25645c79 (MethodDesc 00007ffaa07b2de8 + 0xa9 System.Diagnostics.StackTraceSymbols.TryGetReader(System.String, IntPtr, Int32, IntPtr, Int32)), calling (MethodDesc 00007ffaa07b2e18 + 0 System.Diagnostics.StackTraceSymbols.TryOpenReaderFromAssemblyFile(System.String, IntPtr, Int32)) 00000076a1ff8d40 00007ffb25645915 (MethodDesc 00007ffaa07b2dd8 + 0x65 System.Diagnostics.StackTraceSymbols.GetSourceLineInfo(System.String, IntPtr, Int32, IntPtr, Int32, Int32, Int32, System.String ByRef, Int32 ByRef, Int32 ByRef)), calling (MethodDesc 00007ffaa07b2de8 + 0 System.Diagnostics.StackTraceSymbols.TryGetReader(System.String, IntPtr, Int32, IntPtr, Int32)) 00000076a1ff8ed0 00007ffafee4368a (MethodDesc 00007ffafe9ccf10 + 0x2ba System.Diagnostics.StackFrameHelper.InitializeSourceInfo(Int32, Boolean, System.Exception)) 00000076a1ff8fa0 00007ffafee0078a (MethodDesc 00007ffafe9c32d0 + 0x5a System.Diagnostics.StackTrace.CaptureStackTrace(Int32, Boolean, System.Threading.Thread, System.Exception)), calling (MethodDesc 00007ffafe9ccf10 + 0 System.Diagnostics.StackFrameHelper.InitializeSourceInfo(Int32, Boolean, System.Exception)) 00000076a1ff8fb0 00007ffafeddc7d8 (MethodDesc 00007ffafe9be990 + 0xa8 System.Text.StringBuilder.ToString()), calling (MethodDesc 00007ffafe9a7ea8 + 0 System.Buffer.Memmove(Byte*, Byte*, UInt64)) 00000076a1ff9010 00007ffafee0058c (MethodDesc 00007ffafe9c3258 + 0x2c System.Diagnostics.StackTrace..ctor(System.Exception, Boolean)), calling (MethodDesc 00007ffafe9c32d0 + 0 System.Diagnostics.StackTrace.CaptureStackTrace(Int32, Boolean, System.Threading.Thread, System.Exception)) 00000076a1ff9040 00007ffafed82fe5 (MethodDesc 00007ffafe9a7590 + 0x55 System.String.FillStringChecked(System.String, Int32, System.String)), calling (MethodDesc 00007ffafe9a7ea8 + 0 System.Buffer.Memmove(Byte*, Byte*, UInt64)) 00000076a1ff9050 00007ffafedb04b4 (MethodDesc 00007ffafe9b8130 + 0x64 System.Environment.GetStackTrace(System.Exception, Boolean)), calling (MethodDesc 00007ffafe9c3258 + 0 System.Diagnostics.StackTrace..ctor(System.Exception, Boolean)) 00000076a1ff9080 00007ffafed83797 (MethodDesc 00007ffafe9a7638 + 0xd7 System.String.Concat(System.String, System.String, System.String)), calling (MethodDesc 00007ffafe9a7590 + 0 System.String.FillStringChecked(System.String, Int32, System.String)) 00000076a1ff90a0 00007ffafedb41ff (MethodDesc 00007ffafe9b88c8 + 0x3f System.Exception.GetStackTrace(Boolean)), calling (MethodDesc 00007ffafe9b8130 + 0 System.Environment.GetStackTrace(System.Exception, Boolean)) 00000076a1ff90d0 00007ffafedb449e (MethodDesc 00007ffafe9b8910 + 0x12e System.Exception.ToString(Boolean, Boolean)), calling (MethodDesc 00007ffafe9b88c8 + 0 System.Exception.GetStackTrace(Boolean)) 00000076a1ff90f0 00007ffafedb40bf (MethodDesc 00007ffafe9b8850 + 0x2f System.Exception.GetClassName()), calling coreclr!MetaDataGetDispenser + 0x70c50 00000076a1ff9120 00007ffafedb4428 (MethodDesc 00007ffafe9b8910 + 0xb8 System.Exception.ToString(Boolean, Boolean)), calling (MethodDesc 00007ffafe9b8910 + 0 System.Exception.ToString(Boolean, Boolean)) 00000076a1ff9170 00007ffafee431a2 (MethodDesc 00007ffafe9cce88 + 0x22 System.AggregateException.ToString()), calling (MethodDesc 00007ffafe9b8910 + 0 System.Exception.ToString(Boolean, Boolean)) 00000076a1ff91d0 00007ffafedde80d (MethodDesc 00007ffafe9bee48 + 0x5ed System.Text.StringBuilder.AppendFormatHelper(System.IFormatProvider, System.String, System.ParamsArray)) 00000076a1ff9270 00007ffafed83e79 (MethodDesc 00007ffafe9a7720 + 0x69 System.String.FormatHelper(System.IFormatProvider, System.String, System.ParamsArray)), calling (MethodDesc 00007ffafe9bee48 + 0 System.Text.StringBuilder.AppendFormatHelper(System.IFormatProvider, System.String, System.ParamsArray)) 00000076a1ff92d0 00007ffafed83aae (MethodDesc 00007ffafe9a7668 + 0x5e System.String.Format(System.String, System.Object)), calling (MethodDesc 00007ffafe9a7720 + 0 System.String.FormatHelper(System.IFormatProvider, System.String, System.ParamsArray)) 00000076a1ff9330 00007ffaa1b0ffff (MethodDesc 00007ffa9fdb0830 + 0x4f Raven.Server.Documents.Replication.ReplicationRunStatsBase.AddError(System.Exception)), calling (MethodDesc 00007ffafe9a7668 + 0 System.String.Format(System.String, System.Object)) 00000076a1ff9370 00007ffaa1b0ff8a (MethodDesc 00007ffa9fdb0c88 + 0x3a Raven.Server.Documents.Replication.IncomingReplicationStatsScope.AddError(System.Exception)), calling 00007ffa9fcbef10 (stub for Raven.Server.Documents.Replication.ReplicationRunStatsBase.AddError(System.Exception)) 00000076a1ff93a0 00007ffaa05dcf35 (MethodDesc 00007ffa9fdb0338 + 0x905 Raven.Server.Documents.Replication.IncomingReplicationHandler.HandleSingleReplicationBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Sparrow.Json.BlittableJsonReaderObject, Sparrow.Json.BlittableJsonTextWriter)), calling 00007ffa9fcbeff0 (stub for Raven.Server.Documents.Replication.IncomingReplicationStatsScope.AddError(System.Exception)) 00000076a1ff93f0 00007ffaff3e4a04 coreclr + 0x54a04 00000076a1ff9450 00007ffaff3e5cb4 coreclr + 0x55cb4, calling coreclr + 0x5492c 00000076a1ff94a0 00007ffaa05dc946 (MethodDesc 00007ffa9fdb0338 + 0x316 Raven.Server.Documents.Replication.IncomingReplicationHandler.HandleSingleReplicationBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Sparrow.Json.BlittableJsonReaderObject, Sparrow.Json.BlittableJsonTextWriter)), calling (MethodDesc 00007ffa9fdb0348 + 0 Raven.Server.Documents.Replication.IncomingReplicationHandler.HandleReceivedDocumentsAndAttachmentsBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Sparrow.Json.BlittableJsonReaderObject, Int64, Raven.Server.Documents.Replication.IncomingReplicationStatsScope)) 00000076a1ff94c0 00007ffaff3e5f26 coreclr + 0x55f26, calling coreclr!MetaDataGetDispenser + 0x70cc0 00000076a1ff94f0 00007ffaff3e446c coreclr + 0x5446c, calling coreclr + 0x55c24 00000076a1ff9578 00007ffaa05dc946 (MethodDesc 00007ffa9fdb0338 + 0x316 Raven.Server.Documents.Replication.IncomingReplicationHandler.HandleSingleReplicationBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Sparrow.Json.BlittableJsonReaderObject, Sparrow.Json.BlittableJsonTextWriter)), calling (MethodDesc 00007ffa9fdb0348 + 0 Raven.Server.Documents.Replication.IncomingReplicationHandler.HandleReceivedDocumentsAndAttachmentsBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Sparrow.Json.BlittableJsonReaderObject, Int64, Raven.Server.Documents.Replication.IncomingReplicationStatsScope)) 00000076a1ff95f0 00007ffaa05dc946 (MethodDesc 00007ffa9fdb0338 + 0x316 Raven.Server.Documents.Replication.IncomingReplicationHandler.HandleSingleReplicationBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Sparrow.Json.BlittableJsonReaderObject, Sparrow.Json.BlittableJsonTextWriter)), calling (MethodDesc 00007ffa9fdb0348 + 0 Raven.Server.Documents.Replication.IncomingReplicationHandler.HandleReceivedDocumentsAndAttachmentsBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Sparrow.Json.BlittableJsonReaderObject, Int64, Raven.Server.Documents.Replication.IncomingReplicationStatsScope)) 00000076a1ff9620 00007ffb64e223ad ntdll!RtlpExecuteHandlerForUnwind + 0xd 00000076a1ff9650 00007ffb64d8780d ntdll!RtlUnwindEx + 0x47d, calling ntdll!RtlpExecuteHandlerForUnwind 00000076a1ff96b0 00007ffaa05dc946 (MethodDesc 00007ffa9fdb0338 + 0x316 Raven.Server.Documents.Replication.IncomingReplicationHandler.HandleSingleReplicationBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Sparrow.Json.BlittableJsonReaderObject, Sparrow.Json.BlittableJsonTextWriter)), calling (MethodDesc 00007ffa9fdb0348 + 0 Raven.Server.Documents.Replication.IncomingReplicationHandler.HandleReceivedDocumentsAndAttachmentsBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Sparrow.Json.BlittableJsonReaderObject, Int64, Raven.Server.Documents.Replication.IncomingReplicationStatsScope)) 00000076a1ff9710 00007ffaff412f40 coreclr + 0x82f40, calling coreclr + 0x832a0 00000076a1ff9718 00007ffaa05dc946 (MethodDesc 00007ffa9fdb0338 + 0x316 Raven.Server.Documents.Replication.IncomingReplicationHandler.HandleSingleReplicationBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Sparrow.Json.BlittableJsonReaderObject, Sparrow.Json.BlittableJsonTextWriter)), calling (MethodDesc 00007ffa9fdb0348 + 0 Raven.Server.Documents.Replication.IncomingReplicationHandler.HandleReceivedDocumentsAndAttachmentsBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Sparrow.Json.BlittableJsonReaderObject, Int64, Raven.Server.Documents.Replication.IncomingReplicationStatsScope)) 00000076a1ff9910 00007ffaa05da994 (MethodDesc 00007ffa9fdb0328 + 0x2a4 Raven.Server.Documents.Replication.IncomingReplicationHandler.ReceiveReplicationBatches()), calling (MethodDesc 00007ffa9fdb0338 + 0 Raven.Server.Documents.Replication.IncomingReplicationHandler.HandleSingleReplicationBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Sparrow.Json.BlittableJsonReaderObject, Sparrow.Json.BlittableJsonTextWriter)) 00000076a1ff9ac0 00007ffb4fc7bc14 clrjit!Compiler::fgInsertInlineeBlocks + 0x504 [e:\a\_work\1791\s\src\jit\flowgraph.cpp:22449], calling clrjit!GenTree::CopyFrom [e:\a\_work\1791\s\src\jit\compiler.hpp:1393] 00000076a1ff9b10 00007ffaa05e1d73 (MethodDesc 00007ffa9fdb0398 + 0x683 Raven.Server.Documents.Replication.IncomingReplicationHandler.ReceiveSingleDocumentsBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Int32, Int32, Int64, Raven.Server.Documents.Replication.IncomingReplicationStatsScope)), calling (MethodDesc 00007ffafe9cdc58 + 0 System.Threading.Tasks.Task.Wait(Int32)) 00000076a1ff9b80 00007ffaff3e3869 coreclr + 0x53869 00000076a1ff9be0 00007ffaff412f40 coreclr + 0x82f40, calling coreclr + 0x832a0 00000076a1ff9c20 00007ffaa05da994 (MethodDesc 00007ffa9fdb0328 + 0x2a4 Raven.Server.Documents.Replication.IncomingReplicationHandler.ReceiveReplicationBatches()), calling (MethodDesc 00007ffa9fdb0338 + 0 Raven.Server.Documents.Replication.IncomingReplicationHandler.HandleSingleReplicationBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Sparrow.Json.BlittableJsonReaderObject, Sparrow.Json.BlittableJsonTextWriter)) 00000076a1ff9d30 00007ffaff4b566c coreclr!MetaDataGetDispenser + 0x63b8c, calling KERNEL32!RtlUnwindExStub 00000076a1ff9e60 00007ffaa05dc946 (MethodDesc 00007ffa9fdb0338 + 0x316 Raven.Server.Documents.Replication.IncomingReplicationHandler.HandleSingleReplicationBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Sparrow.Json.BlittableJsonReaderObject, Sparrow.Json.BlittableJsonTextWriter)), calling (MethodDesc 00007ffa9fdb0348 + 0 Raven.Server.Documents.Replication.IncomingReplicationHandler.HandleReceivedDocumentsAndAttachmentsBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Sparrow.Json.BlittableJsonReaderObject, Int64, Raven.Server.Documents.Replication.IncomingReplicationStatsScope)) 00000076a1ffa200 00007ffb64de0aa0 ntdll!RtlSetLastWin32Error + 0x40, calling ntdll!_security_check_cookie 00000076a1ffa250 00007ffaff3e4438 coreclr + 0x54438, calling coreclr!MetaDataGetDispenser + 0x63b4c 00000076a1ffa330 00007ffaa05dc946 (MethodDesc 00007ffa9fdb0338 + 0x316 Raven.Server.Documents.Replication.IncomingReplicationHandler.HandleSingleReplicationBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Sparrow.Json.BlittableJsonReaderObject, Sparrow.Json.BlittableJsonTextWriter)), calling (MethodDesc 00007ffa9fdb0348 + 0 Raven.Server.Documents.Replication.IncomingReplicationHandler.HandleReceivedDocumentsAndAttachmentsBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Sparrow.Json.BlittableJsonReaderObject, Int64, Raven.Server.Documents.Replication.IncomingReplicationStatsScope)) 00000076a1ffa360 00007ffaa05dc946 (MethodDesc 00007ffa9fdb0338 + 0x316 Raven.Server.Documents.Replication.IncomingReplicationHandler.HandleSingleReplicationBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Sparrow.Json.BlittableJsonReaderObject, Sparrow.Json.BlittableJsonTextWriter)), calling (MethodDesc 00007ffa9fdb0348 + 0 Raven.Server.Documents.Replication.IncomingReplicationHandler.HandleReceivedDocumentsAndAttachmentsBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Sparrow.Json.BlittableJsonReaderObject, Int64, Raven.Server.Documents.Replication.IncomingReplicationStatsScope)) 00000076a1ffa380 00007ffb64e2232d ntdll!RtlpExecuteHandlerForException + 0xd 00000076a1ffa3b0 00007ffb64d86c26 ntdll!RtlDispatchException + 0x5c6, calling ntdll!RtlpExecuteHandlerForException 00000076a1ffa468 00007ffaa05dc946 (MethodDesc 00007ffa9fdb0338 + 0x316 Raven.Server.Documents.Replication.IncomingReplicationHandler.HandleSingleReplicationBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Sparrow.Json.BlittableJsonReaderObject, Sparrow.Json.BlittableJsonTextWriter)), calling (MethodDesc 00007ffa9fdb0348 + 0 Raven.Server.Documents.Replication.IncomingReplicationHandler.HandleReceivedDocumentsAndAttachmentsBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Sparrow.Json.BlittableJsonReaderObject, Int64, Raven.Server.Documents.Replication.IncomingReplicationStatsScope)) 00000076a1ffa488 00007ffaa05e1d73 (MethodDesc 00007ffa9fdb0398 + 0x683 Raven.Server.Documents.Replication.IncomingReplicationHandler.ReceiveSingleDocumentsBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Int32, Int32, Int64, Raven.Server.Documents.Replication.IncomingReplicationStatsScope)), calling (MethodDesc 00007ffafe9cdc58 + 0 System.Threading.Tasks.Task.Wait(Int32)) 00000076a1ffa510 00007ffaff3e3869 coreclr + 0x53869 00000076a1ffa570 00007ffaff412f40 coreclr + 0x82f40, calling coreclr + 0x832a0 00000076a1ffa5b0 00007ffaa05da994 (MethodDesc 00007ffa9fdb0328 + 0x2a4 Raven.Server.Documents.Replication.IncomingReplicationHandler.ReceiveReplicationBatches()), calling (MethodDesc 00007ffa9fdb0338 + 0 Raven.Server.Documents.Replication.IncomingReplicationHandler.HandleSingleReplicationBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Sparrow.Json.BlittableJsonReaderObject, Sparrow.Json.BlittableJsonTextWriter)) 00000076a1ffa8a0 00007ffb4fcc7407 clrjit!GenTree::CopyFrom + 0x43 [e:\a\_work\1791\s\src\jit\compiler.hpp:1404], calling clrjit!memcpy [f:\dd\vctools\crt\vcruntime\src\string\amd64\memcpy.asm:101] 00000076a1ffa920 00007ffb4fc7bc14 clrjit!Compiler::fgInsertInlineeBlocks + 0x504 [e:\a\_work\1791\s\src\jit\flowgraph.cpp:22449], calling clrjit!GenTree::CopyFrom [e:\a\_work\1791\s\src\jit\compiler.hpp:1393] 00000076a1ffa970 00007ffaa05e1d73 (MethodDesc 00007ffa9fdb0398 + 0x683 Raven.Server.Documents.Replication.IncomingReplicationHandler.ReceiveSingleDocumentsBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Int32, Int32, Int64, Raven.Server.Documents.Replication.IncomingReplicationStatsScope)), calling (MethodDesc 00007ffafe9cdc58 + 0 System.Threading.Tasks.Task.Wait(Int32)) 00000076a1ffaab0 00007ffb64e2125e ntdll!KiUserExceptionDispatch + 0x2e, calling ntdll!RtlDispatchException 00000076a1ffb1c0 00007ffb61f52918 KERNELBASE!RaiseException + 0x68 ====> Exception Code e0434352 cxr@00000076a1ffaac0 exr@00000076a1ffafb0 00000076a1ffabb0 00007ffb61f52918 KERNELBASE!RaiseException + 0x68, calling ntdll!RtlRaiseException 00000076a1ffaed0 00007ffb64de0aa0 ntdll!RtlSetLastWin32Error + 0x40, calling ntdll!_security_check_cookie 00000076a1ffaee0 00007ffaff411808 coreclr + 0x81808, calling coreclr + 0x81914 00000076a1ffafb8 00007ffb61f52918 KERNELBASE!RaiseException + 0x68, calling ntdll!RtlRaiseException 00000076a1ffb048 00007ffb61f52918 KERNELBASE!RaiseException + 0x68, calling ntdll!RtlRaiseException 00000076a1ffb150 00007ffaff6b1e89 coreclr!GetCLRRuntimeHost + 0x12a939, calling coreclr!MetaDataGetDispenser + 0x70cc0 00000076a1ffb180 00007ffaff4027a0 coreclr + 0x727a0, calling coreclr + 0x728cc 00000076a1ffb1b0 00007ffb61f52918 KERNELBASE!RaiseException + 0x68, calling ntdll!RtlRaiseException 00000076a1ffb1e8 00007ffb61f52918 KERNELBASE!RaiseException + 0x68, calling ntdll!RtlRaiseException 00000076a1ffb260 00007ffaff3df672 coreclr + 0x4f672, calling coreclr!MetaDataGetDispenser + 0x70cc0 00000076a1ffb290 00007ffaff3df5fd coreclr + 0x4f5fd, calling KERNEL32!RaiseExceptionStub 00000076a1ffb390 00007ffaff6032a1 coreclr!GetCLRRuntimeHost + 0x7bd51, calling coreclr + 0x4f3b8 00000076a1ffb3a0 00007ffb64de0aa0 ntdll!RtlSetLastWin32Error + 0x40, calling ntdll!_security_check_cookie 00000076a1ffb3b0 00007ffaff411808 coreclr + 0x81808, calling coreclr + 0x81914 00000076a1ffb420 00007ffaa05e2151 (MethodDesc 00007ffa9fdb0398 + 0xa61 Raven.Server.Documents.Replication.IncomingReplicationHandler.ReceiveSingleDocumentsBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Int32, Int32, Int64, Raven.Server.Documents.Replication.IncomingReplicationStatsScope)), calling coreclr!GetCLRRuntimeHost + 0x7bcb0 00000076a1ffb4b8 00007ffaff603254 coreclr!GetCLRRuntimeHost + 0x7bd04, calling coreclr!MetaDataGetDispenser + 0x71430 00000076a1ffb4e0 00007ffaa05e2151 (MethodDesc 00007ffa9fdb0398 + 0xa61 Raven.Server.Documents.Replication.IncomingReplicationHandler.ReceiveSingleDocumentsBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Int32, Int32, Int64, Raven.Server.Documents.Replication.IncomingReplicationStatsScope)), calling coreclr!GetCLRRuntimeHost + 0x7bcb0 00000076a1ffb530 00007ffaff3e4a04 coreclr + 0x54a04 00000076a1ffb590 00007ffaff3e5cb4 coreclr + 0x55cb4, calling coreclr + 0x5492c 00000076a1ffb5e0 00007ffaa05e1d73 (MethodDesc 00007ffa9fdb0398 + 0x683 Raven.Server.Documents.Replication.IncomingReplicationHandler.ReceiveSingleDocumentsBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Int32, Int32, Int64, Raven.Server.Documents.Replication.IncomingReplicationStatsScope)), calling (MethodDesc 00007ffafe9cdc58 + 0 System.Threading.Tasks.Task.Wait(Int32)) 00000076a1ffb600 00007ffaff3e5f26 coreclr + 0x55f26, calling coreclr!MetaDataGetDispenser + 0x70cc0 00000076a1ffb630 00007ffaff3e446c coreclr + 0x5446c, calling coreclr + 0x55c24 00000076a1ffb6b0 00007ffaff4c7db9 coreclr!MetaDataGetDispenser + 0x762d9, calling coreclr!MetaDataGetDispenser + 0x762ec 00000076a1ffb6b8 00007ffaa05e1d73 (MethodDesc 00007ffa9fdb0398 + 0x683 Raven.Server.Documents.Replication.IncomingReplicationHandler.ReceiveSingleDocumentsBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Int32, Int32, Int64, Raven.Server.Documents.Replication.IncomingReplicationStatsScope)), calling (MethodDesc 00007ffafe9cdc58 + 0 System.Threading.Tasks.Task.Wait(Int32)) 00000076a1ffb730 00007ffaa05e1d73 (MethodDesc 00007ffa9fdb0398 + 0x683 Raven.Server.Documents.Replication.IncomingReplicationHandler.ReceiveSingleDocumentsBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Int32, Int32, Int64, Raven.Server.Documents.Replication.IncomingReplicationStatsScope)), calling (MethodDesc 00007ffafe9cdc58 + 0 System.Threading.Tasks.Task.Wait(Int32)) 00000076a1ffb760 00007ffb64e223ad ntdll!RtlpExecuteHandlerForUnwind + 0xd 00000076a1ffb790 00007ffb64d8780d ntdll!RtlUnwindEx + 0x47d, calling ntdll!RtlpExecuteHandlerForUnwind 00000076a1ffb7f0 00007ffaa05e1d73 (MethodDesc 00007ffa9fdb0398 + 0x683 Raven.Server.Documents.Replication.IncomingReplicationHandler.ReceiveSingleDocumentsBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Int32, Int32, Int64, Raven.Server.Documents.Replication.IncomingReplicationStatsScope)), calling (MethodDesc 00007ffafe9cdc58 + 0 System.Threading.Tasks.Task.Wait(Int32)) 00000076a1ffb858 00007ffaa05e1d73 (MethodDesc 00007ffa9fdb0398 + 0x683 Raven.Server.Documents.Replication.IncomingReplicationHandler.ReceiveSingleDocumentsBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Int32, Int32, Int64, Raven.Server.Documents.Replication.IncomingReplicationStatsScope)), calling (MethodDesc 00007ffafe9cdc58 + 0 System.Threading.Tasks.Task.Wait(Int32)) 00000076a1ffba50 00007ffaa05e16b6 (MethodDesc 00007ffa9fdb0348 + 0x216 Raven.Server.Documents.Replication.IncomingReplicationHandler.HandleReceivedDocumentsAndAttachmentsBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Sparrow.Json.BlittableJsonReaderObject, Int64, Raven.Server.Documents.Replication.IncomingReplicationStatsScope)), calling (MethodDesc 00007ffa9fdb0398 + 0 Raven.Server.Documents.Replication.IncomingReplicationHandler.ReceiveSingleDocumentsBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Int32, Int32, Int64, Raven.Server.Documents.Replication.IncomingReplicationStatsScope)) 00000076a1ffbb00 00007ffaa03a44e3 (MethodDesc 00007ffa9fc87208 + 0x293 Sparrow.Json.Parsing.ObjectJsonParser.Read()), calling (MethodDesc 00007ffaa033b408 + 0 System.Collections.Generic.Queue`1[[System.ValueTuple`2[[System.__Canon, System.Private.CoreLib],[System.__Canon, System.Private.CoreLib]], System.Private.CoreLib]].get_Count()) 00000076a1ffbb40 00007ffaff6b46dc coreclr!GetCLRRuntimeHost + 0x12d18c, calling coreclr!MetaDataGetDispenser + 0x76010 00000076a1ffbc00 00007ffaff6ceee1 coreclr!GetCLRRuntimeHost + 0x147991, calling coreclr!GetCLRRuntimeHost + 0x12caa4 00000076a1ffbc40 00007ffaff3e8c64 coreclr + 0x58c64, calling coreclr!MetaDataGetDispenser + 0x70cc0 00000076a1ffbc70 00007ffaff410236 coreclr + 0x80236, calling coreclr!MetaDataGetDispenser + 0x73c80 00000076a1ffbd60 00007ffaa05e16b6 (MethodDesc 00007ffa9fdb0348 + 0x216 Raven.Server.Documents.Replication.IncomingReplicationHandler.HandleReceivedDocumentsAndAttachmentsBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Sparrow.Json.BlittableJsonReaderObject, Int64, Raven.Server.Documents.Replication.IncomingReplicationStatsScope)), calling (MethodDesc 00007ffa9fdb0398 + 0 Raven.Server.Documents.Replication.IncomingReplicationHandler.ReceiveSingleDocumentsBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Int32, Int32, Int64, Raven.Server.Documents.Replication.IncomingReplicationStatsScope)) 00000076a1ffbe70 00007ffaff4b566c coreclr!MetaDataGetDispenser + 0x63b8c, calling KERNEL32!RtlUnwindExStub 00000076a1ffbfa0 00007ffaa05e1d73 (MethodDesc 00007ffa9fdb0398 + 0x683 Raven.Server.Documents.Replication.IncomingReplicationHandler.ReceiveSingleDocumentsBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Int32, Int32, Int64, Raven.Server.Documents.Replication.IncomingReplicationStatsScope)), calling (MethodDesc 00007ffafe9cdc58 + 0 System.Threading.Tasks.Task.Wait(Int32)) 00000076a1ffc340 00007ffb64de0aa0 ntdll!RtlSetLastWin32Error + 0x40, calling ntdll!_security_check_cookie 00000076a1ffc350 00007ffaff411808 coreclr + 0x81808, calling coreclr + 0x81914 00000076a1ffc390 00007ffaff3e4438 coreclr + 0x54438, calling coreclr!MetaDataGetDispenser + 0x63b4c 00000076a1ffc470 00007ffaa05e1d73 (MethodDesc 00007ffa9fdb0398 + 0x683 Raven.Server.Documents.Replication.IncomingReplicationHandler.ReceiveSingleDocumentsBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Int32, Int32, Int64, Raven.Server.Documents.Replication.IncomingReplicationStatsScope)), calling (MethodDesc 00007ffafe9cdc58 + 0 System.Threading.Tasks.Task.Wait(Int32)) 00000076a1ffc4a0 00007ffaa05e1d73 (MethodDesc 00007ffa9fdb0398 + 0x683 Raven.Server.Documents.Replication.IncomingReplicationHandler.ReceiveSingleDocumentsBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Int32, Int32, Int64, Raven.Server.Documents.Replication.IncomingReplicationStatsScope)), calling (MethodDesc 00007ffafe9cdc58 + 0 System.Threading.Tasks.Task.Wait(Int32)) 00000076a1ffc4c0 00007ffb64e2232d ntdll!RtlpExecuteHandlerForException + 0xd 00000076a1ffc4f0 00007ffb64d86c26 ntdll!RtlDispatchException + 0x5c6, calling ntdll!RtlpExecuteHandlerForException 00000076a1ffc5a8 00007ffaa05e1d73 (MethodDesc 00007ffa9fdb0398 + 0x683 Raven.Server.Documents.Replication.IncomingReplicationHandler.ReceiveSingleDocumentsBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Int32, Int32, Int64, Raven.Server.Documents.Replication.IncomingReplicationStatsScope)), calling (MethodDesc 00007ffafe9cdc58 + 0 System.Threading.Tasks.Task.Wait(Int32)) 00000076a1ffc600 00007ffaff410236 coreclr + 0x80236, calling coreclr!MetaDataGetDispenser + 0x73c80 00000076a1ffc6f0 00007ffaa05e16b6 (MethodDesc 00007ffa9fdb0348 + 0x216 Raven.Server.Documents.Replication.IncomingReplicationHandler.HandleReceivedDocumentsAndAttachmentsBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Sparrow.Json.BlittableJsonReaderObject, Int64, Raven.Server.Documents.Replication.IncomingReplicationStatsScope)), calling (MethodDesc 00007ffa9fdb0398 + 0 Raven.Server.Documents.Replication.IncomingReplicationHandler.ReceiveSingleDocumentsBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Int32, Int32, Int64, Raven.Server.Documents.Replication.IncomingReplicationStatsScope)) 00000076a1ffc8b0 00007ffb4fb91c1a (MethodDesc 00007ffa9faf4100 + 0xaa System.Collections.Generic.HashSet`1[[System.__Canon, System.Private.CoreLib]].AddIfNotPresent(System.__Canon)) 00000076a1ffc8e0 00007ffaa03a63cf (MethodDesc 00007ffa9fc4e190 + 0xcf Sparrow.Collections.FastStack`1[[System.__Canon, System.Private.CoreLib]].Pop()), calling coreclr!MetaDataGetDispenser + 0x70da0 00000076a1ffc930 00007ffb4fb909eb (MethodDesc 00007ffa9faf4058 + 0xb System.Collections.Generic.HashSet`1[[System.__Canon, System.Private.CoreLib]].Add(System.__Canon)), calling (MethodDesc 00007ffa9faf4100 + 0 System.Collections.Generic.HashSet`1[[System.__Canon, System.Private.CoreLib]].AddIfNotPresent(System.__Canon)) 00000076a1ffc960 00007ffaa03a44e3 (MethodDesc 00007ffa9fc87208 + 0x293 Sparrow.Json.Parsing.ObjectJsonParser.Read()), calling (MethodDesc 00007ffaa033b408 + 0 System.Collections.Generic.Queue`1[[System.ValueTuple`2[[System.__Canon, System.Private.CoreLib],[System.__Canon, System.Private.CoreLib]], System.Private.CoreLib]].get_Count()) 00000076a1ffc9a0 00007ffaff6b46dc coreclr!GetCLRRuntimeHost + 0x12d18c, calling coreclr!MetaDataGetDispenser + 0x76010 00000076a1ffc9f0 00007ffaff6b419d coreclr!GetCLRRuntimeHost + 0x12cc4d, calling coreclr!GetCLRRuntimeHost + 0x12d024 00000076a1ffca60 00007ffaff6ceee1 coreclr!GetCLRRuntimeHost + 0x147991, calling coreclr!GetCLRRuntimeHost + 0x12caa4 00000076a1ffcaa0 00007ffaff3e8c64 coreclr + 0x58c64, calling coreclr!MetaDataGetDispenser + 0x70cc0 00000076a1ffcb70 00007ffaff6b8d15 coreclr!GetCLRRuntimeHost + 0x1317c5, calling coreclr!GetCLRRuntimeHost + 0x146f38 00000076a1ffcbb0 00007ffaff6cfe32 coreclr!GetCLRRuntimeHost + 0x1488e2, calling coreclr!GetCLRRuntimeHost + 0x12e870 00000076a1ffcbf0 00007ffb64e2125e ntdll!KiUserExceptionDispatch + 0x2e, calling ntdll!RtlDispatchException 00000076a1ffd310 00007ffb61f52918 KERNELBASE!RaiseException + 0x68 ====> Exception Code e0434352 cxr@00000076a1ffcc00 exr@00000076a1ffd0f0 00000076a1ffcc80 00007ffaff3b7d4f coreclr + 0x27d4f 00000076a1ffccf0 00007ffb61f52918 KERNELBASE!RaiseException + 0x68, calling ntdll!RtlRaiseException 00000076a1ffcdc0 00007ffaff3b882f coreclr + 0x2882f, calling coreclr + 0x279c4 00000076a1ffcec0 00007ffaff3b882f coreclr + 0x2882f, calling coreclr + 0x279c4 00000076a1ffcfe0 00007ffa9fca2138 (MethodDesc 00007ffa9fc80478 + 0x38 Sparrow.Json.UnmanagedWriteBuffer.WriteByte(Byte)), calling (MethodDesc 00007ffa9fc80428 + 0 Sparrow.Json.UnmanagedWriteBuffer.ThrowOnDisposed()) 00000076a1ffd050 00007ffaff3ba10f coreclr + 0x2a10f, calling coreclr!MetaDataGetDispenser + 0x73c80 00000076a1ffd0a0 00007ffaff3a2a43 coreclr + 0x12a43, calling coreclr!MetaDataGetDispenser + 0x1a760 00000076a1ffd0f8 00007ffb61f52918 KERNELBASE!RaiseException + 0x68, calling ntdll!RtlRaiseException 00000076a1ffd188 00007ffb61f52918 KERNELBASE!RaiseException + 0x68, calling ntdll!RtlRaiseException 00000076a1ffd230 00007ffafefdfa97 (MethodDesc 00007ffafe9f9430 + 0x117 System.Text.DecoderNLS.GetChars(Byte[], Int32, Int32, Char[], Int32, Boolean)) 00000076a1ffd290 00007ffaff402963 coreclr + 0x72963 00000076a1ffd2a0 00007ffaff6b1e89 coreclr!GetCLRRuntimeHost + 0x12a939, calling coreclr!MetaDataGetDispenser + 0x70cc0 00000076a1ffd2d0 00007ffaff4027a0 coreclr + 0x727a0, calling coreclr + 0x728cc 00000076a1ffd300 00007ffb61f52918 KERNELBASE!RaiseException + 0x68, calling ntdll!RtlRaiseException 00000076a1ffd338 00007ffb61f52918 KERNELBASE!RaiseException + 0x68, calling ntdll!RtlRaiseException 00000076a1ffd380 00007ffaff4690fd coreclr!MetaDataGetDispenser + 0x1761d, calling coreclr + 0x29a50 00000076a1ffd3b0 00007ffaff3df672 coreclr + 0x4f672, calling coreclr!MetaDataGetDispenser + 0x70cc0 00000076a1ffd3e0 00007ffaff3df5fd coreclr + 0x4f5fd, calling KERNEL32!RaiseExceptionStub 00000076a1ffd4e0 00007ffaff4ac21f coreclr!MetaDataGetDispenser + 0x5a73f, calling coreclr + 0x4f3b8 00000076a1ffd5d0 00007ffaff23c4c4 (MethodDesc 00007ffafe9cdac0 System.Threading.Tasks.Task.ThrowIfExceptional(Boolean)), calling coreclr!MetaDataGetDispenser + 0x5a630 00000076a1ffd668 00007ffaff4ac16e coreclr!MetaDataGetDispenser + 0x5a68e, calling coreclr!MetaDataGetDispenser + 0x71430 00000076a1ffd690 00007ffaff23c4c4 (MethodDesc 00007ffafe9cdac0 System.Threading.Tasks.Task.ThrowIfExceptional(Boolean)), calling coreclr!MetaDataGetDispenser + 0x5a630 00000076a1ffd6d0 00007ffafee4a4a7 (MethodDesc 00007ffafe9cdc68 + 0xa7 System.Threading.Tasks.Task.Wait(Int32, System.Threading.CancellationToken)), calling (MethodDesc 00007ffafe9cdac0 + 0 System.Threading.Tasks.Task.ThrowIfExceptional(Boolean)) 00000076a1ffd700 00007ffafee4a3ed (MethodDesc 00007ffafe9cdc58 + 0xd System.Threading.Tasks.Task.Wait(Int32)), calling (MethodDesc 00007ffafe9cdc68 + 0 System.Threading.Tasks.Task.Wait(Int32, System.Threading.CancellationToken)) 00000076a1ffd730 00007ffaa05e1d73 (MethodDesc 00007ffa9fdb0398 + 0x683 Raven.Server.Documents.Replication.IncomingReplicationHandler.ReceiveSingleDocumentsBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Int32, Int32, Int64, Raven.Server.Documents.Replication.IncomingReplicationStatsScope)), calling (MethodDesc 00007ffafe9cdc58 + 0 System.Threading.Tasks.Task.Wait(Int32)) 00000076a1ffda50 00007ffaa05e16b6 (MethodDesc 00007ffa9fdb0348 + 0x216 Raven.Server.Documents.Replication.IncomingReplicationHandler.HandleReceivedDocumentsAndAttachmentsBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Sparrow.Json.BlittableJsonReaderObject, Int64, Raven.Server.Documents.Replication.IncomingReplicationStatsScope)), calling (MethodDesc 00007ffa9fdb0398 + 0 Raven.Server.Documents.Replication.IncomingReplicationHandler.ReceiveSingleDocumentsBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Int32, Int32, Int64, Raven.Server.Documents.Replication.IncomingReplicationStatsScope)) 00000076a1ffdb20 00007ffaa05dc946 (MethodDesc 00007ffa9fdb0338 + 0x316 Raven.Server.Documents.Replication.IncomingReplicationHandler.HandleSingleReplicationBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Sparrow.Json.BlittableJsonReaderObject, Sparrow.Json.BlittableJsonTextWriter)), calling (MethodDesc 00007ffa9fdb0348 + 0 Raven.Server.Documents.Replication.IncomingReplicationHandler.HandleReceivedDocumentsAndAttachmentsBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Sparrow.Json.BlittableJsonReaderObject, Int64, Raven.Server.Documents.Replication.IncomingReplicationStatsScope)) 00000076a1ffde60 00007ffaa05da994 (MethodDesc 00007ffa9fdb0328 + 0x2a4 Raven.Server.Documents.Replication.IncomingReplicationHandler.ReceiveReplicationBatches()), calling (MethodDesc 00007ffa9fdb0338 + 0 Raven.Server.Documents.Replication.IncomingReplicationHandler.HandleSingleReplicationBatch(Raven.Server.ServerWide.Context.DocumentsOperationContext, Sparrow.Json.BlittableJsonReaderObject, Sparrow.Json.BlittableJsonTextWriter)) 00000076a1ffe0c0 00007ffaa05da6cf (MethodDesc 00007ffa9fdb0450 + 0x2f Raven.Server.Documents.Replication.IncomingReplicationHandler.<Start>b__25_0(System.Object)), calling 00007ffa9fcbedf8 (stub for Raven.Server.Documents.Replication.IncomingReplicationHandler.ReceiveReplicationBatches()) 00000076a1ffe0f0 00007ffaa0535fda (MethodDesc 00007ffa9ffb4718 + 0x18a Raven.Server.Utils.PoolOfThreads+PooledThread.Run()) 00000076a1ffe1c0 00007ffb51f56e4d (MethodDesc 00007ffa9fb509d8 + 0x3d System.Threading.Thread.ThreadMain_ThreadStart()) 00000076a1ffe1f0 00007ffafedbb3ee (MethodDesc 00007ffafe9ba670 + 0x6e System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)) 00000076a1ffe220 00007ffafedbd345 (MethodDesc 00007ffafe9bae50 + 0x25 System.Threading.ThreadHelper.ThreadStart()), calling coreclr!MetaDataGetDispenser + 0x739a0 00000076a1ffe260 00007ffaff4c35d3 coreclr!MetaDataGetDispenser + 0x71af3 00000076a1ffe2a0 00007ffaff3ed9bf coreclr + 0x5d9bf, calling coreclr!MetaDataGetDispenser + 0x71a70 00000076a1ffe2d0 00007ffaff3eedda coreclr + 0x5edda, calling coreclr + 0x1fa14 00000076a1ffe3f0 00007ffaff4b6a19 coreclr!MetaDataGetDispenser + 0x64f39, calling coreclr + 0x5d844 00000076a1ffe420 00007ffb64d90f05 ntdll!RtlpAllocateHeapInternal + 0x8c5, calling ntdll!RtlpLowFragHeapAllocFromContext 00000076a1ffe560 00007ffaff3ed66b coreclr + 0x5d66b 00000076a1ffe590 00007ffb64d90f05 ntdll!RtlpAllocateHeapInternal + 0x8c5, calling ntdll!RtlpLowFragHeapAllocFromContext 00000076a1ffe5a0 00007ffaff3ed586 coreclr + 0x5d586, calling coreclr + 0x5d628 00000076a1ffe640 00007ffaff3c5709 coreclr + 0x35709, calling ntdll!RtlAllocateHeap 00000076a1ffe660 00007ffaff4aa551 coreclr!MetaDataGetDispenser + 0x58a71 00000076a1ffe690 00007ffaff3dc403 coreclr + 0x4c403, calling coreclr!MetaDataGetDispenser + 0x58a48 00000076a1ffe6c0 00007ffaff494940 coreclr!MetaDataGetDispenser + 0x42e60, calling coreclr + 0x4c3d8 00000076a1ffe700 00007ffaff3ed498 coreclr + 0x5d498, calling coreclr + 0x5d504 00000076a1ffe7b0 00007ffaff4bb8b3 coreclr!MetaDataGetDispenser + 0x69dd3, calling coreclr + 0x5d3e4 00000076a1ffe810 00007ffaff4974e0 coreclr!MetaDataGetDispenser + 0x45a00, calling coreclr!MetaDataGetDispenser + 0x69da4 00000076a1ffe860 00007ffaff46f819 coreclr!MetaDataGetDispenser + 0x1dd39, calling KERNEL32!HeapFreeStub 00000076a1ffe8d0 00007ffaff4973fb coreclr!MetaDataGetDispenser + 0x4591b 00000076a1ffed30 00007ffb61f4eb24 KERNELBASE!ConsoleCallServerGeneric + 0xf4, calling KERNELBASE!_security_check_cookie 00000076a1ffee80 00007ffb64d8e168 ntdll!RtlpSubSegmentInitialize + 0x4a8, calling ntdll!RtlRunOnceBeginInitialize 00000076a1ffeec0 00007ffb64de0a49 ntdll!RtlSetLastWin32ErrorAndNtStatusFromNtStatus + 0x9, calling ntdll!RtlNtStatusToDosError 00000076a1ffef20 00007ffb64d92383 ntdll!RtlpLowFragHeapAllocFromContext + 0x1203, calling ntdll!memset 00000076a1ffef40 00007ffb61f4e2c5 KERNELBASE!KernelBaseBaseDllInitialize + 0x541, calling KERNELBASE!_security_check_cookie 00000076a1ffefe0 00007ffb64d90f05 ntdll!RtlpAllocateHeapInternal + 0x8c5, calling ntdll!RtlpLowFragHeapAllocFromContext 00000076a1fff070 00007ffb64de0aa0 ntdll!RtlSetLastWin32Error + 0x40, calling ntdll!_security_check_cookie 00000076a1fff090 00007ffb21f6a11a clrcompression!__vcrt_FlsSetValue + 0x4a [f:\dd\vctools\crt\vcruntime\src\internal\winapi_downlevel.cpp:400] 00000076a1fff0c0 00007ffb21f69d15 clrcompression!__vcrt_getptd_noexit + 0xa5 [f:\dd\vctools\crt\vcruntime\src\internal\per_thread_data.cpp:139], calling KERNEL32!SetLastErrorStub 00000076a1fff0f0 00007ffb21f69939 clrcompression!__vcrt_thread_attach + 0x9 [f:\dd\vctools\crt\vcruntime\src\internal\initialization.cpp:108], calling clrcompression!__vcrt_getptd_noexit [f:\dd\vctools\crt\vcruntime\src\internal\per_thread_data.cpp:90] 00000076a1fff120 00007ffb548eda7e webio!_scrt_dllmain_crt_thread_attach + 0x16, calling webio!_acrt_initialize 00000076a1fff130 00007ffb64de0aa0 ntdll!RtlSetLastWin32Error + 0x40, calling ntdll!_security_check_cookie 00000076a1fff140 00007ffb64dc8127 ntdll!RtlDeactivateActivationContextUnsafeFast + 0xc7, calling ntdll!_security_check_cookie 00000076a1fff150 00007ffb548ed2ad webio!_local_stdio_scanf_options + 0x55, calling webio!_scrt_dllmain_crt_thread_attach 00000076a1fff170 00007ffb64dc8243 ntdll!RtlActivateActivationContextUnsafeFast + 0x93, calling ntdll!_security_check_cookie 00000076a1fff180 00007ffb548ed50b webio!_local_stdio_scanf_options + 0x2b3, calling webio!WaDllMain 00000076a1fff1b0 00007ffb2ea7bf80 VCRUNTIME140!DllMainDispatch + 0x60 [f:\dd\vctools\crt\vcruntime\src\dll\vcruntime_dllmain.cpp:57], calling VCRUNTIME140!__vcrt_getptd_noexit [f:\dd\vctools\crt\vcruntime\src\internal\per_thread_data.cpp:92] 00000076a1fff1d0 00007ffb64dc836e ntdll!LdrpCallTlsInitializers + 0x36, calling ntdll!RtlReleaseSRWLockShared 00000076a1fff1e0 00007ffb64dc82d7 ntdll!LdrpCallInitRoutine + 0x6f 00000076a1fff210 00007ffb64da0663 ntdll!LdrpReleaseLoaderLock + 0x2f, calling ntdll!RtlGetCurrentServiceSessionId 00000076a1fff220 00007ffb64da13a4 ntdll!LdrpDropLastInProgressCount + 0x38, calling ntdll!RtlLeaveCriticalSection 00000076a1fff250 00007ffb64dc5e2e ntdll!LdrpInitializeThread + 0x1fa, calling ntdll!LdrpDropLastInProgressCount 00000076a1fff2c0 00007ffb64dc5d66 ntdll!LdrpInitializeThread + 0x132, calling ntdll!RtlActivateActivationContextUnsafeFast 00000076a1fff2c8 00007ffb64dc5d99 ntdll!LdrpInitializeThread + 0x165, calling ntdll!RtlDeactivateActivationContextUnsafeFast 00000076a1fff310 00007ffb64dc5df6 ntdll!LdrpInitializeThread + 0x1c2, calling ntdll!RtlActivateActivationContextUnsafeFast 00000076a1fff318 00007ffb64dc5e16 ntdll!LdrpInitializeThread + 0x1e2, calling ntdll!RtlDeactivateActivationContextUnsafeFast 00000076a1fff330 00007ffb64df6cce ntdll!_LdrpInitialize + 0x8e, calling ntdll!NtTestAlert 00000076a1fff3b0 00007ffb64df6c2b ntdll!LdrpInitialize + 0x3b, calling ntdll!_LdrpInitialize 00000076a1fff3e0 00007ffb64df6be8 ntdll!LdrInitializeThunk + 0x18, calling ntdll!NtContinue 00000076a1fff850 00007ffaff4973d6 coreclr!MetaDataGetDispenser + 0x458f6, calling coreclr!MetaDataGetDispenser + 0x78430 00000076a1fff890 00007ffb64864354 KERNEL32!BaseThreadInitThunk + 0x14, calling ntdll!LdrpDispatchUserCallTarget 00000076a1fff8c0 00007ffb64def051 ntdll!RtlUserThreadStart + 0x21, calling ntdll!LdrpDispatchUserCallTarget ``` 26630 area-Microsoft.CSharp Microsoft.CSharp uses internal enum value instead of natural language in error message. "Given: ``` public class C { public void M<T>() {} } /*…*/ dynamic d = new C(); d.M<int, long>(); ``` On netfx the resulting error message is ""Using the generic method 'UserQuery.C.M<T>()' requires '1' type arguments"", but on corefx it is ""Using the generic SK_METHOD 'UserQuery.C.M<T>()' requires '1' type arguments"". Similar things happen with other attempts to use a type of symbol (type, property, field, etc.) in an error message." 26632 area-Microsoft.CSharp Microsoft.CSharp inconsistent errors and InternalCompilerException on invoked name matches nested class "Given ```C# public class Outer { public class Inner { public void DoNothing() { } } } ``` Then the likes of: ```C# dynamic d = new Outer(); d.Inner(); d.Inner = 2; int i = d.Inner; d.Inner<int>(); ``` Will all throw an exception with a message of ""'Outer' does not contain a definition for 'Inner'"", which isn't quite right, but is reasonable. However, if `Outer.Inner` is used in a dynamic operation prior: ```C# dynamic di = new Outer.Inner(); di.DoNothing(); ``` Then the above code run after this will for the `d.Inner<int>()` case have an error message of ""The non-generic type 'UserQuery.Outer.Inner' cannot be used with type arguments."", and more seriously the other attempts to use `d.Inner` as a method or property name will throw a `RuntimeBinderInternalCompilerException` (or trip an assertion if in a debug build.). Strictly the message for `d.Inner<int>()` is in fact more correct in comparison with static compilation, and ideally we'd have CS1955, CS0572 or CS0118 rather than CS1061 for the other cases, but since that would require *having* to load nested types just to have a better error message, and since the error message that happens when the type hasn't been seen by the dynamic binder isn't very bad, it seems best to just consistently give that message. (And of course, to never throw `RuntimeBinderInternalCompilerException`) A similar thing happens with: ```C# dynamic d = new List<int>(); d.T(); ``` Throwing a `RuntimeBinderInternalCompilerException` because the binder attempts to use the type parameter `T` as a member." 26633 area-Microsoft.CSharp Only search for member types in Microsoft.CSharp member lookup. As opposed to nested classes, or type parameters. Fixes #26632 26634 area-System.Collections Add a generic OrderedDictionary class Often times I've come across places when needing a `Dictionary` where the insertion order of the elements is important to me. Unfortunately, .NET does not currently have a generic `OrderedDictionary` class. We've had a non-generic `OrderedDictionary` class since .NET Framework 2.0 which oddly enough was when generics were added but no generic equivalent. This has forced many to roll their own solution, typically by using a combination of a `List` and `Dictionary` field resulting in the worst of both worlds in terms of performance and resulting in larger memory usage, and even worse sometimes users instead rely on implementation details of `Dictionary` for ordering which is quite dangerous. ## Proposed API ```diff namespace System.Collections.Generic { + public class OrderedDictionary<TKey, TValue> : ICollection<KeyValuePair<TKey, TValue>>, IDictionary<TKey, TValue>, IEnumerable, IEnumerable<KeyValuePair<TKey, TValue>>, IList<KeyValuePair<TKey, TValue>>, IReadOnlyCollection<KeyValuePair<TKey, TValue>>, IReadOnlyDictionary<TKey, TValue>, IReadOnlyList<KeyValuePair<TKey, TValue>> { + public struct Enumerator : IDisposable, IEnumerator, IEnumerator<KeyValuePair<TKey, TValue>> { + public KeyValuePair<TKey, TValue> Current { get; } + public void Dispose(); + public bool MoveNext(); + } + public sealed class KeyCollection : ICollection<TKey>, IEnumerable, IEnumerable<TKey>, IList<TKey>, IReadOnlyCollection<TKey>, IReadOnlyList<TKey> { + public struct Enumerator : IDisposable, IEnumerator, IEnumerator<TKey> { + public TKey Current { get; } + public void Dispose(); + public bool MoveNext(); + } + public KeyCollection(OrderedDictionary<TKey, TValue> orderedDictionary); + public int Count { get; } + public void CopyTo(TKey[] array, int arrayIndex); + public OrderedDictionary<TKey, TValue>.KeyCollection.Enumerator GetEnumerator(); + } + public sealed class ValueCollection : ICollection<TValue>, IEnumerable, IEnumerable<TValue>, IList<TValue>, IReadOnlyCollection<TValue>, IReadOnlyList<TValue> { + public struct Enumerator : IDisposable, IEnumerator, IEnumerator<TValue> { + public TValue Current { get; } + public void Dispose(); + public bool MoveNext(); + } + public ValueCollection(OrderedDictionary<TKey, TValue> orderedDictionary); + public int Count { get; } + public void CopyTo(TValue[] array, int arrayIndex); + public OrderedDictionary<TKey, TValue>.ValueCollection.Enumerator GetEnumerator(); + } + public OrderedDictionary(); + public OrderedDictionary(int capacity); + public OrderedDictionary(IEqualityComparer<TKey> comparer); + public OrderedDictionary(int capacity, IEqualityComparer<TKey> comparer); + public OrderedDictionary(IDictionary<TKey, TValue> dictionary); + public OrderedDictionary(IDictionary<TKey, TValue> dictionary, IEqualityComparer<TKey> comparer); + public OrderedDictionary(IEnumerable<KeyValuePair<TKey, TValue>> collection); + public OrderedDictionary(IEnumerable<KeyValuePair<TKey, TValue>> collection, IEqualityComparer<TKey> comparer); + public IEqualityComparer<TKey> Comparer { get; } + public int Count { get; } + public TValue this[int index] { get; set; } + public TValue this[TKey key] { get; set; } + public OrderedDictionary<TKey, TValue>.KeyCollection Keys { get; } + public OrderedDictionary<TKey, TValue>.ValueCollection Values { get; } + public void Add(TKey key, TValue value); + public void Clear(); + public bool ContainsKey(TKey key); + public bool ContainsValue(TValue value); + public TValue GetAt(int index); + public TValue GetAt(int index, out TKey key); + public OrderedDictionary<TKey, TValue>.Enumerator GetEnumerator(); + public TValue GetValue(TKey key); + public int IndexOf(TKey key); + public void Insert(int index, TKey key, TValue value); + public bool Remove(TKey key); + public bool Remove(TKey key, out TValue value); + public void RemoveAt(int index); + public void SetAt(int index, TValue value); + public void SetAt(int index, TKey key, TValue value); + public void SetValue(TKey key, TValue value); + public void TrimExcess(); + public bool TryGetValue(TKey key, out TValue value); + } } ``` Perhaps one of the reasons there was no generic `OrderedDictionary` added initially was due to issues with having both a key and index indexer when the key is an `int`. A call to the indexer would be ambiguous. Roslyn prefers the non-generic parameter so in this case the index indexer will be called. If the user needs to access elements by key they can use the explicit `GetValue` and `SetValue` methods. ## API Details * `Insert` allows `index` to be equal to `Count` to insert the element at the end. * `SetAt(int index, TValue value)` requires `index` to be less than `Count` but `SetAt(int index, TKey key, TValue value)` allows `index` to be equal to `Count` similar to `Insert`. * `SetValue` will insert if needed, similar to the `Dictionary` indexer. * Performance will be the same as `Dictionary` for all operations except `Remove` which will necessarily be `O(n)`. `Insert` and `RemoveAt` which aren't members of `Dictionary` will also be `O(n)`. ## Open Questions * Should the namespace be `System.Collections.Generic` when it could easily be `System.Collections.Specialized` where the non-generic version is located? I just felt this collection is far more useful to be relegated to that namespace. * Should the non-generic interfaces `ICollection`, `IList`, and `IOrderedDictionary` be implemented? ## Updates * Added constructor overloads for `IEnumerable<KeyValuePair<TKey, TValue>>`. * Added `ContainsValue` method due to being needed for the `ValueCollection.Contains` method. * Proposal no longer advocates for throwing an exception when using an indexer while the key is an int. 26635 area-System.Memory Utf8Parsing for Int32 'N' format "https://github.com/dotnet/corefx/issues/24986 This is a piece of the Utf8Parser that was punted for time last year. There are 8 overloads for each of the 8 integer types. This PR only covers Int32. I'm putting this through by itself for this PR so I don't have to apply every PR feedback in octuplicate. The ""N"" format prints out integers like this: `""N2"" => 12,345.00` This parser mimics the behavior of `int.TryParse(v, NumberStyles.Integer | AllowThousands | AllowDecimalPoint)` The thing that may look strange is that the parser allows commas anywhere, not just on the 10^3 digits. This mimics the desktop api behavior. Comma placement is culture-dependent and this is an api that is culture-agnostic. The test data was confirmed on a control implementation that calls the classic int.TryParse()." 26637 area-System.Drawing System.Drawing.Common SetHdevmode_IntPtr_Success does not work for me locally ``` System.Drawing.Printing.Tests.PrinterSettingsTests.SetHdevmode_IntPtr_Success [FAIL] Assert.Equal() Failure Expected: 3 Actual: 6 Stack Trace: d:\repos\corefx\src\System.Drawing.Common\tests\Printing\PrinterSettingsTests.cs(559,0): at System.Drawing.Printing.Tests.PrinterSettingsTests.SetHdevmode_IntPtr_Success() ``` From a quick look, this appears like it could be a product bug rather than a test bug, on both netfx and netcoreapp. The Copies value is not being transferred as it's expected to be. Either it's a product bug to be fixed, or the test's expectation that Copies gets copied is incorrect. 26638 area-System.Collections Add an OrderedSet class Sometimes I've come across places when needing a `HashSet` where the insertion order of the elements is important to me. Unfortunately, .NET does not have an `OrderedSet` class even though it has a `SortedSet` which to me has less value but perhaps not to others. This has led to users rolling their own solution, typically by using a combination of a `LinkedList` and `Dictionary` field resulting in the worst of both worlds in terms of performance and resulting in larger memory usage, and even worse sometimes users instead rely on implementation details of `HashSet` for ordering which is quite dangerous. ## Proposed API ```diff namespace System.Collections.Generic { + public class OrderedSet<T> : ICollection<T>, IEnumerable, IEnumerable<T>, IList<T>, IReadOnlyCollection<T>, IReadOnlyList<T>, ISet<T> { + public struct Enumerator : IDisposable, IEnumerator, IEnumerator<T> { + public T Current { get; } + public void Dispose(); + public bool MoveNext(); + } + public OrderedSet(); + public OrderedSet(int capacity); + public OrderedSet(IEqualityComparer<T> comparer); + public OrderedSet(int capacity, IEqualityComparer<T> comparer); + public OrderedSet(IEnumerable<T> collection); + public OrderedSet(IEnumerable<T> collection, IEqualityComparer<T> comparer); + public IEqualityComparer<T> Comparer { get; } + public int Count { get; } + public T this[int index] { get; set; } + public bool Add(T item); + public void Clear(); + public bool Contains(T item); + public void CopyTo(T[] array); + public void CopyTo(T[] array, int arrayIndex); + public void CopyTo(T[] array, int arrayIndex, int count); + public void ExceptWith(IEnumerable<T> other); + public OrderedSet<T>.Enumerator GetEnumerator(); + public int IndexOf(T item); + public bool Insert(int index, T item); + public void IntersectWith(IEnumerable<T> other); + public bool IsProperSubsetOf(IEnumerable<T> other); + public bool IsProperSupersetOf(IEnumerable<T> other); + public bool IsSubsetOf(IEnumerable<T> other); + public bool IsSupersetOf(IEnumerable<T> other); + public bool Overlaps(IEnumerable<T> other); + public bool Remove(T item); + public void RemoveAt(int index); + public bool SetEquals(IEnumerable<T> other); + public void SymmetricExceptWith(IEnumerable<T> other); + public int TrimExcess(); + public bool TryGetValue(T equalValue, out T actualValue); + public void UnionWith(IEnumerable<T> other); + } } ``` ## API Details * `Insert` allows `index` to be equal to `Count` to insert the element at the end. * Performance will be the same as `HashSet` for all operations except `Remove` which will necessarily be `O(n)`. `Insert` and `RemoveAt` which aren't members of `HashSet` will also be `O(n)`. ## Open Questions * Should the namespace be `System.Collections.Generic` when it could easily be `System.Collections.Specialized` where the non-generic `OrderedDictionary` is located? 26643 area-System.IO Remove ValueStringBuilder.set_Length https://github.com/dotnet/corefx/pull/26642#discussion_r164504598 From @jkotas: > Is this Length setter really useful? I do not see why anybody would actually want to do this given the shape of this class. Indexer that let's you see and edit the content of the pending string would be more efficient replacement for the one place where this is used in DosMatcher.cs. 26644 area-System.Memory Span<T> : promote NonPortableCast (or Cast, whatever the new name) from an extension method to an instance method Problem: methods are currently extension methods: public static ReadOnlySpan<TTo> NonPortableCast<TFrom, TTo>(this ReadOnlySpan<TFrom> source) where TFrom : struct where TTo : struct; public static Span<TTo> NonPortableCast<TFrom, TTo>(this Span<TFrom> source) where TFrom : struct where TTo : struct; Due to limitations of generic type inference, this means that we constantly have to tell it the `TFrom`, which is ugly and annoying; for example, where `source` and `dest` are both `Span<uint>`: var vSource = source.NonPortableCast<uint, Vector<uint>>(); var vDest = destination.NonPortableCast<uint, Vector<uint>>(); If they were instance methods instead: public ReadOnlySpan<TTo> NonPortableCast<TTo>() where TTo : struct; public Span<TTo> NonPortableCast<TTo>() where TTo : struct; then this wouldn't be necessary: var vSource = source.NonPortableCast<Vector<uint>>(); var vDest = destination.NonPortableCast<Vector<uint>>(); A small redundancy, maybe; but it feels so much cleaner. 26646 area-System.Security Make ProtectedData function on empty input In .NET Framework the implementation used GCHandle.Alloc, which does not normalize an empty array to null. In .NET Core the implementation uses fixed, which does normalize empty to null. Since the Win32 API rejects null inputs, map empty to some other array for the duration of the call. Fixes #26273. 26647 area-System.Runtime Enable blob comparison for TimeZoneInfo* & fix comment Fixes https://github.com/dotnet/corefx/issues/23804 minor change 26648 area-System.Security Make Linux and macOS throw the same exception on unknown hash algorithms Currently Linux throws CryptographicException with a default message, and macOS throws a PNSE with a message. This normalizes them to throw CryptographicException with a message. Windows NetFX throws CryptographicException(NTE_BAD_ALGID), and CoreFx behaves similarly. Fixes #24462. 26649 area-System.Data Add try-finally statements around AbortTransaction calls in SqlBulkCopy, so that parser locks always get released. 26650 area-System.Threading Proposal to remove UnbufferedChannel UnbufferedChannel is a special channel that has to be used carefully and if not, we can run into some problems. here is some example demonstrates the problem: reading code: ```C# while (true) { if (!reader.TryRead(out int dequeuedNumber)) { if (!reader.WaitToReadAsync().GetAwaiter().GetResult()) { break; } try { dequeuedNumber = reader.ReadAsync().GetAwaiter().GetResult(); } catch (ChannelClosedException) { break; } } } ``` Writing code: ```C# while (true) { if (!writer.TryWrite(incrementedValue)) { if (writer.WaitToWriteAsync().GetAwaiter().GetResult()) { writer.WriteAsync(incrementedValue).GetAwaiter().GetResult(); } } } ``` That will cause the UnbufferChannel to hang because TryRead can succeed against a WriteAsync, but it can't against a WaitToWriteAsync because there wouldn't be anything to read. And conversely for TryWrite and WaitToReadAsync. The proposal here is to remove the UnbufferedChannel from 2.1 as looks nobody using it and we can add later if needed. 26651 area-System.Net libcurl maintains stale DNS information When building a HttpClientFactory in ASP.NET we did some experiments with DNS and HTTPClient. Specifically we are disposing of handlers periodically in order to avoid stale DNS, but re-using them enough to mitigate socket exhaustion problems with keeping a single client forever. Our issue is that when using libcurl on a mac disposing the handler doesn't appear to impact DNS at all. Suggesting some type of single DNS cache in libcurl itself. You can see the experiment and results here: https://github.com/aspnet/HttpClientFactory/wiki/Exploring-DNS-issues Issue on our side is: https://github.com/aspnet/HttpClientFactory/issues/10 Is this a bug in our libcurl usage or is there something we can do at a higher level to work around it? /cc @karelz 26652 area-Infrastructure http://apisof.net/ is returning HTTP 500 26653 area-System.Collections Improving EnsureCapacity unit tests Marking test ```EnsureCapacity_DictionaryNotInitialized_RequestedZero_ReturnsZero``` as ActiveIssue, until corecl behavioral change PR 16076 gets merged. cc: @danmosemsft 26654 area-System.ComponentModel DataAnnotaions in .net core misbehaving "@mquelcutti commented on [Fri Jan 26 2018](https://github.com/dotnet/standard/issues/632) Hi the range for dataannotaions does not seem to work or the (0) for the display attib correctly if you put in range of 1 250 it always errors after you enter any chars. Additionally if you try to use the {0} {1} {2} the param (0) never shows the display attrib. The {0] is puling in min length and {1) max length and you cant get the display name eg [Required(ErrorMessage =""{0} is required"")] [Display(Name = ""Message"")] [Range(1,250, ErrorMessage = ""{0) should be between {1} and {2}"")] public string Message { get; set; } as you type in the text area and tab off it errors with 1 should be between 250 and {2}: but i would expect is 'Message should be between 1 and 250' but only error if nothing is in the text area and or max has exceed not if the range of text is correct Edit (0) I am using .net core 2 " 26655 area-System.Threading Add stress test to System.Threading.Channels 26657 area-System.Net SslStreamInternal memory utilization I'm tracking some memory issues in my application and I run into the following line in when running `!fq` in the dump: ``` 00007ffbd1b73610 3233 284504 System.Net.Security.SslStreamInternal ``` I'm using `SslStream` heavily, but over 3000 sitting in the finalization queue was surprising. Looking at the code here: https://github.com/dotnet/corefx/blob/master/src/System.Net.Security/src/System/Net/Security/SslStreamInternal.cs This class has a finalizer, but it never calls to `GC.SuppressFinalizer` when it is explicitly returning its buffer. Given that it is held directly by a disposable resource (the `SslStream`, shouldn't this have a `Dispose` method that calls `GC.SuppressFinalizer`? 26659 area-Meta Expected behavior of gen 2 disposed finalizable objects I'm investigating high memory utilization in one of our systems, and I seeing very strange results: ``` Heap 0 generation 0 has 100 finalizable objects (000002809db65198->000002809db654b8) generation 1 has 234 finalizable objects (000002809db64a48->000002809db65198) generation 2 has 36105 finalizable objects (000002809db1e200->000002809db64a48) Ready for finalization 0 objects (000002809db654b8->000002809db654b8) ------------------------------ Heap 1 generation 0 has 282 finalizable objects (00000280463019f0->00000280463022c0) generation 1 has 777 finalizable objects (00000280463001a8->00000280463019f0) generation 2 has 39371 finalizable objects (00000280462b3350->00000280463001a8) Ready for finalization 0 objects (00000280463022c0->00000280463022c0) ``` The final tally is 76,869 objects in the queue. I am doing a lot to try to reuse instances, so it is not surprising that a lot of them are actually in gen 2. What is surprising to me is that in many cases, I have memory hanging around and the only reference to it is in the finalization queue. I checked the finalizer thread, and it is not blocked. In fact, it appears to be idle. ``` 0:004> k # Child-SP RetAddr Call Site 00 000000e0`1efff2d8 00007ffc`4074796f ntdll!NtWaitForMultipleObjects+0x14 01 000000e0`1efff2e0 00007ffc`308a6361 KERNELBASE!WaitForMultipleObjectsEx+0xef 02 000000e0`1efff5e0 00007ffc`308a5de2 coreclr!FinalizerThread::WaitForFinalizerEvent+0x85 [e:\a\_work\1791\s\src\vm\finalizerthread.cpp @ 469] 03 000000e0`1efff620 00007ffc`307fd66b coreclr!FinalizerThread::FinalizerThreadWorker+0x62 [e:\a\_work\1791\s\src\vm\finalizerthread.cpp @ 587] 04 000000e0`1efff680 00007ffc`307fd586 coreclr!ManagedThreadBase_DispatchInner+0x43 [e:\a\_work\1791\s\src\vm\threads.cpp @ 9204] 05 000000e0`1efff6c0 00007ffc`307fd498 coreclr!ManagedThreadBase_DispatchMiddle+0x82 [e:\a\_work\1791\s\src\vm\threads.cpp @ 9253] 06 000000e0`1efff820 00007ffc`308a587c coreclr!ManagedThreadBase_DispatchOuter+0xb4 [e:\a\_work\1791\s\src\vm\threads.cpp @ 9492] 07 (Inline Function) --------`-------- coreclr!ManagedThreadBase_NoADTransition+0x41 [e:\a\_work\1791\s\src\vm\threads.cpp @ 9575] 08 (Inline Function) --------`-------- coreclr!ManagedThreadBase::FinalizerBase+0x41 [e:\a\_work\1791\s\src\vm\threads.cpp @ 9601] 09 000000e0`1efff8d0 00007ffc`308a73fb coreclr!FinalizerThread::FinalizerThreadStart+0x9c [e:\a\_work\1791\s\src\vm\finalizerthread.cpp @ 774] 0a 000000e0`1efff970 00007ffc`40e98364 coreclr!Thread::intermediateThreadProc+0x8b [e:\a\_work\1791\s\src\vm\threads.cpp @ 2594] 0b 000000e0`1efffa30 00007ffc`43787091 kernel32!BaseThreadInitThunk+0x14 0c 000000e0`1efffa60 00000000`00000000 ntdll!RtlUserThreadStart+0x21 ``` It looks like it is here: https://github.com/dotnet/coreclr/blob/master/src/vm/finalizerthread.cpp#L462 What is really strange is that I have a _large_ number of objects there are hanging in the finalizer queue that I'm quite sure are properly disposed. And my dispose for them includes `GC.SuppressFinalizer(this)`. I don't have any calls to `GC.ReRegisterForFinalization` and I'm not patching references back to my objects from beyond the grave. I dumped the state of some of the objects, and the plot thickens, because their state shows that they _have_ been disposed properly and that the suppress finalizer was called. ``` 0:004> !DumpObj /d 0000027c88389c38 Name: Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking.UvTcpHandle MethodTable: 00007ffbd1c8da08 EEClass: 00007ffbd1c98d80 Size: 120(0x78) bytes File: D:\RavenDB\Server\Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.dll Fields: MT Field Offset Type VT Attr Value Name 00007ffc224c64e0 4001741 8 System.IntPtr 1 instance 0 handle 00007ffc224c6298 4001742 10 System.Int32 1 instance 3 _state 00007ffc224a8388 4001743 14 System.Boolean 1 instance 1 _ownsHandle 00007ffc224a8388 4001744 15 System.Boolean 1 instance 1 _fullyInitialized 00007ffbd1c8b260 400009a 18 ...ng.LibuvFunctions 0 instance 0000027b7d03da00 _uv 00007ffc224c6298 400009b 28 System.Int32 1 instance 21 _threadId 00007ffbd1bdecc0 400009c 20 ...ernal.ILibuvTrace 0 instance 0000027b7d0267b8 _log 00007ffc22457218 400009d 2c System.Int32 1 instance 0 _handleType 00007ffbd1ca1df8 4000099 30 ...Private.CoreLib]] 0 instance 0000027b7d04da08 _queueCloseHandle 00007ffbd1c8cef0 4000098 80 ...tions+uv_close_cb 0 static 0000027b7d074468 _destroyMemory 00007ffbd1cba8b8 40000a1 38 ...Private.CoreLib]] 0 instance 0000000000000000 _listenCallback 00007ffc224aaf30 40000a2 40 System.Object 0 instance 0000000000000000 _listenState 00007ffc224b08f8 40000a3 60 ...Services.GCHandle 1 instance 0000027c88389c98 _listenVitality 00007ffbd1d2edc8 40000a4 48 ...Transport.Libuv]] 0 instance 0000000000000000 _allocCallback 00007ffbd1d2eeb8 40000a5 50 ...Private.CoreLib]] 0 instance 0000000000000000 _readCallback 00007ffc224aaf30 40000a6 58 System.Object 0 instance 0000000000000000 _readState 00007ffc224b08f8 40000a7 68 ...Services.GCHandle 1 instance 0000027c88389ca0 _readVitality 00007ffbd1c8e5c8 400009e 88 ...+uv_connection_cb 0 static 0000027b7d0560d0 _uv_connection_cb 00007ffbd1c8f070 400009f 90 ...tions+uv_alloc_cb 0 static 0000027b7d056128 _uv_alloc_cb 00007ffbd1c8f208 40000a0 98 ...ctions+uv_read_cb 0 static 0000027b7d056168 _uv_read_cb 0:004> !gcroot 0000027c88389c38 Finalizer Queue: 0000027c88389c38 -> 0000027c88389c38 Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal.Networking.UvTcpHandle ``` I'm using `UvTcpHandle` because is inherits from `SafeHandle` and I assume that this one is properly used :-). Tracing the code, this instance is disposed (it's state is `3`, which means that it has been closed). And when it is disposed it is marked as skip finalizer: https://github.com/dotnet/coreclr/blob/60222780cde77346bff1eb8979846769c223f833/src/vm/safehandle.cpp#L240 So the question is, what is it still doing in the finalizer queue? I expected that when this is called (or the more usual `GC.SuppressFinalizer` , it'll be removed from this queue. In particular, I think that I'm asking about what is the expected behavior from the system. At what point the GC will collect such instances? And what is the expected state of the system in such a scenario? 26660 area-System.Security Make AsnSerializer resiliant to ILC reflection rules AsnSerializer had two different paths which checked for ordered fields, one which used the MetadataToken and one which didn't. The MetadataToken method is more reliable, but is not available on ILC. With this change * MetadataToken is used when available, and we hope for the best otherwise. * The two paths now use the same resolution, so future algorithms apply evenly * The results are cached, so we only sort once per type Fixes #26123. 26662 area-System.Memory Add Span/ReadOnlySpan TryCast "- Exposes Span.TryCast and ReadOnlySpan.TryCast as extension methods in MemoryExtensions. - Implemented for both the fast and portable implementations in equivalent ways, though eventually [the fast implementation should be moved to corelib with the other MemoryExtensions.Fast methods](https://github.com/dotnet/corefx/issues/25182) and implemented using compiler directives (e.g. #IF intelProcessorCompiled) or maybe an intrinsic for the else case. - I decided that requiring a fixed memory location for the source span would be too restrictive, so I implemented the functions in a way that works even if the memory pointed to by the span gets moved mid-operation or post-operation. The downside to this is that we can't handle the ""accidentally aligned"" case as well, but this is a worthy tradeoff in my opinion. More details in the doc comments for TryCast. - Added a bunch of tests for TryCast that assert the behavior for param types of various sizes and alignment. - This code is based around two large assumptions: - The alignment rules for TFrom will be followed if sourceSpan<TFrom> is moved. - The maximum alignment size of any data item is 8 bytes. For C# this is true for all primitives, including decimal. resolves https://github.com/dotnet/corefx/issues/26465 cc: @stephentoub @ahsonkhan @KrzysztofCwalina @GrabYourPitchforks " 26664 area-System.Net Socket should default to InterNetworkV6 only if OSSupportsIPv6 https://github.com/dotnet/corefx/blob/ff478ef06a053f145a784a9640a6f85d8fe560a9/src/System.Net.Sockets/src/System/Net/Sockets/Socket.cs#L81 I am working through a customer issue for the IoT Edge, running it on an embedded ARM device without IPv6. https://github.com/Azure/iot-edge/issues/481 The IoT Edge project uses libraries which wind up calling the `Socket(SocketType socketType, ProtocolType protocolType)` constructor linked at the top. This Socket constructor will by default choose `AddressFamily.InterNetworkV6` and set `DualMode = true;` even if the OS does not support IPv6. Creation of a Socket with a IPv6 address family on my test system throws an Error -97 EAFNOSUPPORT. Should the Socket constructor check to see if IPv6 is supported before setting the defaults? 26665 area-System.Net WIP: remove ActiveIssue for 10041 These passed in 100 runs on Windows 10 RS3 and 10 runs on Ubuntu 16.04 without errors. Measuring them in OuterLoop to see if they stay clean before any attempt to merge. [EDIT: removing fixes so nothing risks being automatically closed] 26666 area-System.Net Make SslStreamInternal to free resources with SslStream dispose. fixes #26657 cc @stephentoub @ayende @karelz 26669 area-System.Diagnostics Process class doesn't expose some memory usage properties on Linux/MacOs Tried on Ubuntu in a docker image and MacOs without docker, and I get this when running a simple web app: ``` WorkingSet64: 70 PeakWorkingSet64: VirtualMemorySize64: 23,789 PeakVirtualMemorySize64: PagedSystemMemorySize64: PeakPagedMemorySize64: ``` The values on Windows however are ``` WorkingSet64: 121 PeakWorkingSet64: 121 VirtualMemorySize64: 2,112,855 PeakVirtualMemorySize64: 2,112,856 PagedSystemMemorySize64: PeakPagedMemorySize64: 179 ``` Some __Peak__ values are not provided, and the list differs between windows and linux/mac. The code to repro is here: https://github.com/sebastienros/memoryusage PS: If I start a new `Process` dynamically, the value of `WorkingSet64` of the returned instance doesn't change overtime even if the application is used intensively with memory allocations. The value remains very low (something like 3 MB) though the system reports more than 400 MB of used memory for the app. I'll file an issue based on your feedback, with a repro if necessary. 26671 area-System.Runtime DateTime.Now takes 1 second to execute on WSL Repro (windows subsystem for Linux): - Create console app that does `Console.WriteLine(DateTime.Now)` - Publish it - Run it Result: The app takes 1.5s to run. 1 second out of that is time spent inside DateTime.Now 26673 area-System.Diagnostics "System.Diagnostics.Tests.ProcessTests.TestStartWithNormalUser failed with ""System.ComponentModel.Win32Exception : User with name 'dotnet-bot' was not found"" in CI." Failed tests: System.Diagnostics.Tests.ProcessTests.TestStartWithNormalUser Details: https://ci.dot.net/job/dotnet_corefx/job/master/job/centos7.1_debug/5151/testReport/System.Diagnostics.Tests/ProcessTests/TestStartWithNormalUser/ Failed configuration: Centos7.1_debug MESSAGE: System.ComponentModel.Win32Exception : User with name 'dotnet-bot' was not found. ~~~ STACK TRACE: at System.Diagnostics.Process.GetUserAndGroupIds(ProcessStartInfo startInfo) in /mnt/resource/j/workspace/dotnet_corefx/master/centos7.1_debug/src/System.Diagnostics.Process/src/System/Diagnostics/Process.Unix.cs:line 621 at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo) in /mnt/resource/j/workspace/dotnet_corefx/master/centos7.1_debug/src/System.Diagnostics.Process/src/System/Diagnostics/Process.Unix.cs:line 301 at System.Diagnostics.Process.Start() in /mnt/resource/j/workspace/dotnet_corefx/master/centos7.1_debug/src/System.Diagnostics.Process/src/System/Diagnostics/Process.cs:line 1208 at System.Diagnostics.Tests.ProcessTests.TestStartWithUserName() in /mnt/resource/j/workspace/dotnet_corefx/master/centos7.1_debug/src/System.Diagnostics.Process/tests/ProcessTests.Unix.cs:line 357 at System.Diagnostics.Tests.ProcessTests.TestStartWithNormalUser() in /mnt/resource/j/workspace/dotnet_corefx/master/centos7.1_debug/src/System.Diagnostics.Process/tests/ProcessTests.Unix.cs:line 322 ~~~ 26674 area-System.Net Make redirect test case really 'redirect' The test case was redirecting to the same URL this was bringing instability with the handlers (more with the managed). This change should make the test more reliable, as such moving it to inner loop. Fixes #23769 Since no action is planned for #26434 this also closes #26434 26675 area-System.Diagnostics "System.Diagnostics.Tests.ProcessTests.TestStartWithRootUser failed with ""Assert.Equal() Failure\nExpected: 0\nActual: 134"" in CI." Failed tests: System.Diagnostics.Tests.ProcessTests.TestStartWithRootUserCannotElevate System.Diagnostics.Tests.ProcessTests.TestStartWithRootUser Details: https://ci.dot.net/job/dotnet_corefx/job/master/job/outerloop_netcoreapp_centos7.1_debug/301/testReport/ Failed configuration: Outerloop_netcoreapp_centos7.1_debug MESSAGE: Assert.Equal() Failure\nExpected: 0\nActual: 134 ~~~ STACK TRACE: at System.Diagnostics.Tests.ProcessTests.RunTestAsSudo(Func`1 testMethod) in /mnt/resource/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_centos7.1_debug/src/System.Diagnostics.Process/tests/ProcessTests.Unix.cs:line 431 at System.Diagnostics.Tests.ProcessTests.TestStartWithRootUserCannotElevate() in /mnt/resource/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_centos7.1_debug/src/System.Diagnostics.Process/tests/ProcessTests.Unix.cs:line 386 ~~~ 26677 area-System.Runtime System.Environment.GetFolderPath fails with ArgumentException In Ubuntu 16.04 the following console app fails in case the special folder doesn't exist (e.g. in a new Docker container) even though SpecialFolderOption.Create is specified: ``` using System; namespace Test { class Program { static void Main(string[] args) { var path = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData, Environment.SpecialFolderOption.Create); } } } ``` Exception: ``` Unhandled Exception: System.ArgumentException: Cannot bind to the target method because its signature or security transparency is not compatible with that of the delegate type. at System.Reflection.RuntimeMethodInfo.CreateDelegateInternal(Type delegateType, Object firstArgument, DelegateBindingFlags bindingFlags, StackCrawlMark& stackMark) at System.Reflection.RuntimeMethodInfo.CreateDelegate(Type delegateType) at System.Environment.<>c.<GetFolderPathCore>b__52_0() at System.Threading.LazyInitializer.EnsureInitializedCore[T](T& target, Func`1 valueFactory) at System.Environment.GetFolderPathCore(SpecialFolder folder, SpecialFolderOption option) at System.Environment.GetFolderPath(SpecialFolder folder, SpecialFolderOption option) at Test.Program.Main(String[] args) in /home/crow/Test/Program.cs:line 9 Aborted (core dumped) ``` If the folder exists in advance there is no problem. Also, this workaround works: ``` using System; namespace Test { class Program { static void Main(string[] args) { var path = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData, Environment.SpecialFolderOption.DoNotVerify); if (System.IO.Directory.Exists(path) == false) System.IO.Directory.CreateDirectory(path); } } } ``` 26680 area-System.Net Http protocol dribble tests taking too long The time of inner loop is dominated by the http protocol dribble tests. Returning the Task.Delay to Task.Yield reduces it from ~19 seconds to less than a second on a Windows 10 RS3 box. Single run for comparison (times in seconds): | Test | Task.Delay(3) | Task.Yield | | ---- | -------------- | ----------- | ManagedHandler_HttpProtocolTests_Dribble | 19.308 | 0.569 | HttpProtocolTests_Dribble | 17.920 | 0.872 | 26682 area-System.Security X509Certificate2.PublicKey.Key is RSACng, not RSACryptoServiceProvider "## [Sample solution](https://github.com/dotnet/corefx/files/1678312/EmptyCSharp.zip) I'm on .NET Core 2.0, SDK is 2.1.4, Windows 10. I'm working to port a .NET framework library to `netcoreapp2.0` and I'm having an issue with `X509Certificate2`. [The docs say]( https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.x509certificates.x509certificate2.publickey?view=netcore-2.0) that `X509Certificate2.PublicKey.Key` will return either `RSACryptoServiceProvider` or `DSACryptoServiceProvider`, but the code below/attached solution actually return `RSACng`. The two types are not interchangeable from what I've gathered, so this is an issue. The `certPath` variable is hardcoded into the test for this library, that's why it's in here. If it's a problem with the cert itself then I'll have to find a workaround, but the docs don't lead me to think that's the issue. (Also I know `WebClient` is outdated, that's just what the lib uses at the moment, I haven't gotten to fixing it yet.) ```csharp const string certPath = ""https://sns.us-east-1.amazonaws.com/SimpleNotificationService-433026a4050d206028891664da859041.pem""; WebClient wc = new WebClient(); byte[] raw = wc.DownloadData(certPath); var cert = new X509Certificate2(raw); Console.WriteLine(cert.PublicKey.Key.GetType().Name); // Output is: RSACng ```" 26683 area-System.Memory Utf8Parsing - the remaining 'N' format overloads "Fixes https://github.com/dotnet/corefx/issues/24986 This is a piece of the Utf8Parser that was punted for time last year. There are 8 overloads for each of the 8 integer types. Int32 was done in a previous PR - this completes the set. The ""N"" format prints out integers like this: `""N2"" => 12,345.00` This parser mimics the behavior of `int.TryParse(v, NumberStyles.Integer | AllowThousands | AllowDecimalPoint)` The thing that may look strange is that the parser allows commas anywhere, not just on the 10^3 digits. This mimics the desktop api behavior. Comma placement is culture-dependent and this is an api that is culture-agnostic. The test data was confirmed on a control implementation that calls the classic int.TryParse()." 26684 area-System.Net Proposal: add an overload of EnsureSuccessStatusCode that doesn't dispose the content "Currently the `HttpResponseMessage.EnsureSuccessStatusCode` method always disposes the content of the response. The reason is explained in [a comment](https://github.com/dotnet/corefx/blob/bcc2940faeb58cc92a66c61ca404bed54a3a3bb3/src/System.Net.Http/src/System/Net/Http/HttpResponseMessage.cs#L152-L155): ```csharp // Disposing the content should help users: If users call EnsureSuccessStatusCode(), an exception is // thrown if the response status code is != 2xx. I.e. the behavior is similar to a failed request (e.g. // connection failure). Users don't expect to dispose the content in this case: If an exception is // thrown, the object is responsible fore cleaning up its state. ``` However, this isn't always helpful. It's frequent for web APIs to return details about the error in the response body. If I want to map the error to a specific domain exception, I might write something along these lines: ```csharp private async Task<T> GetResponseAsync<T>(HttpRequestMessage request) { using (var response = await _client.SendAsync(request)) { try { response.EnsureSuccessStatusCode(); return await response.Content.ReadAsAsync<T>(); } catch (HttpRequestException ex) { var errorDetails = await response.Content.ReadAsAsync<ErrorDetails>(); throw CreateDomainExceptionFromDetails(errorDetails, ex); } } } private Exception CreateDomainExceptionFromDetails(ErrorDetails errorDetails, Exception innerException) { // Some logic based on the error details // ... } ``` However, this doesn't work, because when I try to read the content in the `catch` block, the content is already disposed. So I need to read the content in the `try` block instead, before the call to `EnsureSuccessStatusCode`: ```csharp private async Task<T> GetResponseAsync<T>(HttpRequestMessage request) { using (var response = await _client.SendAsync(request)) { string content = null; try { content = await response.Content.ReadAsStringAsync(); response.EnsureSuccessStatusCode(); return JsonConvert.DeserializeObject<T>(content); } catch (HttpRequestException ex) when (content != null) { var errorDetails = JsonConvert.DeserializeObject<ErrorDetails>(content); throw CreateDomainExceptionFromDetails(errorDetails, ex); } } } ``` It's less intuitive and makes the code harder to read An `EnsureSuccessStatusCode(bool disposeContent)` overload would be helpful in this case. It would let the user state that they're taking responsibility for disposing the content (in the exemple above, the content would be disposed when the response is disposed at the end of the `using` statement). (I'm aware that I could just check the `IsSuccessStatusCode` property, but I want the ""normal"" `HttpRequestException` as the inner exception of my domain exception) I'm willing to submit a pull request if the proposal is approved." 26685 area-System.Security Remove synchronization on SecureString.Length Contention on this getter showed up in profiles of a cloud service that was reading the length several times in one method running on multiple threads (as one might expect for eg a password). It doesn't need to be synchronized. From discussion with @stephentoub : removing the Synchronized/lock on Length would mean the disposed check and accessing the length would no longer be atomic, but you don’t lose anything from that, because it could be disposed after accessing the length and before the caller gets back the value and acts on it. Removing it would also means that _length isn’t synchronized with other operations that change it, but again, the length could change immediately after using it, so it doesn’t really save anything. To minimise the staleness of the read we can replace the lock on Length with `Volatile.Read(ref _length)` The same could be done for IsReadOnly and MakeReadOnly, I think. @maryamariyan one for you. 26687 area-Serialization Use Load instead of LoadFile when load pregenerated xmlserializer We need use Assembly.Load here https://github.com/dotnet/corefx/blob/master/src/System.Private.Xml/src/System/Xml/Serialization/Compilation.cs#L187. LoadFile was a workaround when Load didn't work as expected. 26689 area-System.Threading Remove Unbuffered Channel #26650 CC @stephentoub 26690 area-System.IO Async File IO APIs mimicking Win32 OVERLAPPED "It would be great if the .NET framework had async file APIs that closely modelled Win32 OVERLAPPED without the need for building one ourselves with Interop (e.g. https://dschenkelman.github.io/2013/10/29/asynchronous-io-in-c-io-completion-ports/) Today, the APIs do not take an offset parameter and instead operate on the internal file position. While there are some workarounds (creating multiple Filestream objects and changing their file pointer before issuing the IO) this is unwieldy and inefficient. Ideally there'd be a single FILE_OBJECT (in kernel mode) opened with FILE_FLAG_OVERLAPPED against which you can queue many async IOs where .NET would allocate an OVERLAPPED internally and set the OffsetLow/High fields. You'd have to integrate this somehow with completions but keep it as flexible as possible. In Win32 you can check for completions via polling (looking at OVERLAPPED.Internal for STATUS_IO_PENDING), waiting on an event (OVERLAPPED.hEvent), waiting on the FILE_OBJECT's internal event (by waiting on the file handle itself), associating the handle with an IOCP and calling GetQueuedCompletionStatus(), and finally putting the thread in an alertable wait state via SleepEx et al and using ReadFileEx. We don't necessarily have to support all of these, but at the very least polling and event based should be supported somehow. The .NET ""Task"" model already wraps an event-like scheme with Task.WaitAny() for example, so we could try to plug into that. For polling, we'd want a method on the OVERLAPPED wrapper (whether we use the existing .NET Overlapped class or hide it is up to you) that checks the Internal field (i.e. HasOverlappedIoCompleted macro equivalent). This will allow a lot more high performance server style applications that care about the full functionality of the Win32 IO model to be written in C# without any hand-rolled Interop." 26691 area-System.Threading Task Cancelled By Manually-Thrown OperationCancelledException "According to .Net Standard's documentation for [Task.IsCancelled](https://docs.microsoft.com/en-us/dotnet/api/system.threading.tasks.task.iscanceled?view=netstandard-2.0#System_Threading_Tasks_Task_IsCanceled), there are three conditions when a task will report that it was cancelled. However, I'm observing cancelled tasks caused by a fourth condition. :-) I'm trying to figure out whether what I'm observing is a bug with .Net or a case of incomplete documentation. :-) ## Documentation According to the docs, the three reasons a task may complete as cancelled are: > * Its CancellationToken was marked for cancellation before the task started executing, > * The task acknowledged the cancellation request on its already signaled CancellationToken by throwing an OperationCanceledException that bears the same CancellationToken. > * The task acknowledged the cancellation request on its already signaled CancellationToken by calling the ThrowIfCancellationRequested method on the CancellationToken. All of these require that the Task is associated with a CancellationToken. ## What I'm Seeing Manually throwing an `OperationCancelledException` that is unassociated with a `CancellationToken` also results in the Task reporting that it was cancelled. ``` <Project Sdk=""Microsoft.NET.Sdk""> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>netcoreapp2.0</TargetFramework> </PropertyGroup> <PropertyGroup Condition=""'$(Configuration)|$(Platform)'=='Debug|AnyCPU'""> <LangVersion>latest</LangVersion> </PropertyGroup> </Project> ``` class Program { static async Task Main(string[] args) { var task = Task.Run(() => throw new OperationCanceledException()); try { await task; } catch { } Console.WriteLine(task.IsCanceled); // Outputs ""True"" } } ### Environment Microsoft Visual Studio Professional 2017 Version 15.5.4 (VisualStudio.15.Release/15.5.4+27130.2024) Microsoft .NET Framework Version 4.7.02556 dotNET Version 2.1.4 ## Question Should a Task report that it's cancelled in this case? If it is, there's a documentation bug—and I can work on a documentation PR addressing it. If it shouldn't, it looks like there's a code bug somewhere." 26692 area-System.IO Productize System.IO.Pipelines Tracking issue for moving Pipelines from corefxlab to corefx for .NET Core 2.1. https://github.com/dotnet/corefxlab/tree/master/src/System.IO.Pipelines 26694 area-System.Memory Add ReadOnlySequence API /cc @KrzysztofCwalina @davidfowl 26696 area-System.Net Purpose of the HttpWebRequest.Connection property? "I am currently porting some of the corefx tests to Mono and fixing compatibility issues in our implementation. While doing so, I stumbled upon [HttpWebRequest.Connection](https://github.com/dotnet/corefx/blob/release/2.0.0/src/System.Net.Requests/src/System/Net/HttpWebRequest.cs#L520). When I saw the implementation, I started to wonder what the exact purpose of this property's setter is. You cannot set it to either `close` or `keep-alive` (which are the only two valid values for this header) and setting it to null or whitespace removes the ""Connection"" header (is there any scenario where this could bet set other than with a previous call to this property?). I would assume the implementation doesn't allow setting `close` or `keep-alive` because there is already the `KeepAlive` property for that. However, I couldn't think of any other values that somebody might want to set this header so, so I am wondering whether it's actually used somewhere." 26697 area-Infrastructure Port compat pack fixes to 2.1 This is a port of: https://github.com/dotnet/corefx/pull/26576 and https://github.com/dotnet/corefx/pull/26281 Basically upgrading S.ServiceModel.* dependencies in the compat pack to depende on the latest stable package and fixing System.Data.DataSetExtensions public key to match the full framework one so that assembly identities are the same. cc: @weshaggard @danmosemsft 26698 area-System.Linq SelectNonNull extension method Could we have this in `System.Linq` ? ```C# public static IEnumerable<V> SelectNonNull<T,V>(this IEnumerable<T> items,Func<T,V> func) where V : class { foreach(var item in items) { var value = func(item); if(value != null) yield return value; } } public static IEnumerable<V> SelectNonNull<T,V>(this IEnumerable<T> items,Func<T,V?> func) where V : struct { foreach(var item in items) { var value = func(item); if(value.HasValue) yield return value.Value; } } ``` I don't know what name it should but this extension method is convenient 26702 area-System.Runtime Incomplete shutdown in docker container "This sample app below exits prematurely when stopping the docker container. Steps to reproduce: -------------------- 1) `docker build -t shutdowntest .` 2) `docker run --rm shutdowntest` 3) After it writes ""Server started"" to the standard output, try to stop it with `docker stop [containder id]` from another command prompt. Actual output: ----------------- ``` Server started Server stopping... ``` Expected output: ------------------ ``` Server started Server stopping... Server stopped Exit ``` Files: --------- Program.cs ```c# using System; using System.Runtime.Loader; using System.Threading; using System.Threading.Tasks; namespace ShutdownExample { class Program { static void Main(string[] args) { ManualResetEventSlim appStopping = new ManualResetEventSlim(); ManualResetEventSlim appStopped = new ManualResetEventSlim(); AssemblyLoadContext.Default.Unloading += o => { appStopping.Set(); appStopped.Wait(); }; var server = new Server(); server.Start(); appStopping.Wait(); server.StopAsync().Wait(); Console.WriteLine(""Exit""); appStopped.Set(); } } class Server { public void Start() { Console.WriteLine(""Server started""); } public async Task StopAsync() { Console.WriteLine(""Server stopping...""); await Task.Yield(); Console.WriteLine(""Server stopped""); return; } } } ``` Dockerfile: ``` FROM microsoft/dotnet:2.0.5-sdk-2.1.4 WORKDIR /app COPY *.csproj ./ RUN dotnet restore COPY . ./ RUN dotnet publish -c Release -o out ENTRYPOINT [""dotnet"", ""out/ShutdownExample.dll""] ``` ShutdownExample.csproj: ```xml <Project Sdk=""Microsoft.NET.Sdk""> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>netcoreapp2.0</TargetFramework> </PropertyGroup> </Project> ``` [EDIT] Add C# syntax highlighting by @karelz" 26704 area-System.ComponentModel #26600 PropertyDescriptor - MemberDescriptor.Attributes PropertyDescriptor - MemberDescriptor.Attributes returns base attribute instead of ancestor's attribute #26600 26708 area-System.Net ManagedHandler: implement connection retry logic Fixes #26495 Implement basic retry logic on connection failure. If a previously pooled connection fails before we start sending the request body, and before we start receiving the response, then it's retryable; we grab another connection and retry (and repeat as necessary). Additionally: (1) Refactor some connection creation code (2) Change HttpConnectionKey to include SSL Host Name (otherwise we could be sending requests on the wrong SSL connections) @stephentoub @davidsh @Priya91 @wfurt @caesar1995 26709 area-System.Net [ManagedHandler] Should do request validation before connecting There is some minor request validation that we do at the beginning of HttpConnection.SendAsync. This validation can cause us to throw NotSupportedException in some rare cases. We should do this validation earlier in the request processing. At this point, we've already established a connection (or pulled one from the pool), and throwing here will cause the connection to be torn down unnecessarily. 26710 area-System.Net [ManagedHandler] Digest proxy auth seems to skip proxy after 407 Code here: https://github.com/dotnet/corefx/blob/25c4a916bf1f35be1d009b679b19f7ebea535647/src/System.Net.Http/src/System/Net/Http/Managed/HttpProxyConnectionHandler.cs#L124 The key point here is we shouldn't be using _innerHandler at this point, we should be using a proxied connection, like the basic logic above does. 26711 area-System.Diagnostics Provide more control over handle inheritance and standard in/out in System.Diagnostics.Process Right now it's impossible to pass your own handles (or set null handles) for a new process created with System.Diagnostics.Process. In addition, System.Diagnostics.Process always creates processes with `bInheritHandles` set to `true`. This has lead to complicated deadlocks for us in the past, where a process inherits the stdout of its parent, but the created process is a daemon, intending to live longer than its creator. If there is a third process that is the parent of the second which blocks waiting on standard output or the handle closing, this produces a deadlock because the daemon process will never close standard out or necessarily output anything on it. We currently work around this by either setting our own stdin/stdout/stderr, or by P/Invoking, but it would be nice to have a first-class API option here. You can see [here](https://github.com/dotnet/roslyn/blob/c540e079bb19b17262b15e3dcad3abc0b179b635/src/Compilers/Shared/BuildServerConnection.cs#L371) how Roslyn has worked around this issue in our compiler server by PInvoking, and how we work around the issue on Unix by creating dummy stdin/out/error to avoid inheriting the parent's. The workaround is rather undesirable since, if we do end up accidentally outputting anything to standard out, there's a possibility that we may fill up the output buffer and never read from it, causing a different deadlock. 26713 area-System.Net Separate basic auth test cases for HttpClientHandler Per discussion in #23135: separating the test cases between compliant and non-compliant names. 26714 area-System.Data Consider a better design for ADO.NET connection pooling "In today's ADO.NET, connection pooling is purely an internal concern of ADO providers - no pooling API is exposed to the user in any way. It seems to be an unwritten contract that providers are supposed to pool by default, and disable pooling if the `Pooling=false` connection string parameter is used. The following is a (too lengthy) analysis of possible directions to get the conversation started. Disadvantages of the current model ---------------------------------------- * Since the pool isn't exposed, `DbConnection.Open()` must look up the pool internally, keyed on the connection string. A naïve implementation using a dictionary would add a dictionary string lookup for each pooled open, which is a significant overhead. * Pooling has to be reimplemented (efficiently!) by each provider. * The provider-implemented pool is forced upon the user - not really possible to have competing pool implementations. * Since pooling is internal to the provider, DbConnection is typically a lightweight façade to a more heavyweight internal ""physical connection"" class. The relationship and bookkeeping between these two objects adds complexity (and possibly some perf hit). The DbConnection façade is also newed-up and disposed, adding a needless allocation. Option 1: An ADO.NET user-facing pool *API* -------------------------------------------------- The connection string lookup imposed by the internal pooling mechanism could be mitigating by adding a simple, user-facing API. User code would look something like this: ```c# var factory = DbProviderFactories.GetFactory(providerName); var connFactory = factory.GetConnectionFactory(connectionString); using (var conn = connFactory.GetConnection()) { ... } ``` Regarding the naming, instead of `GetConnectionFactory()`: * We could have `GetPool()`, although seems to imply that all providers implement pooling, but some shouldn't (e.g. in-memory DBs or sqlite) * We could have `GetDatabase()`, although databases and pools aren't the same thing (e.g. you can have multiple pools for the same database0. * Maybe `GetConnectionProvider()`? * ConnectionFactory is abstract enough that it could be used for other purposes (e.g. a wrapper of other connection factories which returns connections that allow interception of certain events, or whatever). * JDBC calls it `DataSource` which isn't too bad IMHO. Option 2: A *complete* pooling API (not just user facing) ---------------------------------------------------------------- The above only provides a user-facing abstraction which allows avoiding the lookup (and possibly opens up possibility for composing connection provider), but the pool itself is still implemented by each provider. We could go further and provide a more complete abstraction that allows writing connection pools. This would allow pooling implementations which aren't connected to any specific provider (and which could be used with any provider). Users would be able to select a 3rd-party pooling implementation which fits their specific application needs, rather than being locked into a single, provider-implemented pool. This mainly has to do with defining standard public APIs for communication between the ADO provider and the pool in use. For example, when a connection is returned to the pool its state may need to be reset in a provider-specific, the DbConnection would have to expose that API. There may be other things as well. If we go down this route, we could also optionally provide a provider-independent, highly efficient connection pool that could be used instead of the providers' ones. Comparison with JDBC ------------------------- JDBC has had competing pool implementations for a very long time, which can be used with any JDBC database provider. A nice inspiration is https://brettwooldridge.github.io/HikariCP/, which claims to be the highest-performing pool implementation. The JDBC API includes several abstractions for manaing pooling (`ConnectionPoolDataSource`, `PooledConnection`), although more research is needed to understand exactly how the pooling model operates there. Things to keep in mind ------------------------------ * Connections enlisted in a TransactionScope and which are closed before the TransactionScope is disposed: they cannot be reused until the transaction commits/rolls back, and need to be returned if the user opens another connection with the same database and transaction to avoid escalation to a distributed transaction. This would all have some impact on the pooling. * Including/omitting authentication information in the key. When using ""integrated security"" the username can be omitted, I know SqlServer has some provisions for including that information alongside the connection string in the key. * Ability to include some arbitrary data on the pool. For example, Npgsql caches the password-less connection string on the pool (`Persist Security Info=false`). There could be other things. /cc @anpete @ajcvickers @divega @davidfowl *Edit by @roji 15/3*: Added ""things to keep in mind"" with some new points." 26715 area-System.IO Implement Unix file enumeration extensibility Tracking Unix work for #25873 26717 area-System.Numerics Use Vector<T> from System.Private.CoreLib. Add TypeForwards for `Vector<T>` and `Vector` in System.Numerics.Vectors to CoreLib when building for netcoreapp. This should complete the work for moving Vector into CoreLib - https://github.com/dotnet/corefx/issues/25182#issuecomment-343614677. This depends on https://github.com/dotnet/coreclr/pull/16133 getting merged and flown into corefx. CI is expected to fail before then - but putting it up early to get feedback and to see the holistic changes. /cc @joshfree 26718 area-System.Net WIP: Investigating test failures 26186 This is expected to fail at least in some Windows 7 configurations. Just for now it is in inner loop, even if we decide to re-enable it at this time it will be kept on outer loop since it is a slow test. 26719 area-System.IO FileInfo.Length returns always 0 "# FileInfo.Length return always 0 FileInfo.Length return always 0. I tried it with a MVC Web App and a console application. FileInfo is not null and the path is correct too. I tried to stream a video but if I don't get the range I can't stream it. - fi.Exists is true - fi.DirectoryName is correct (on both Windows and Mac) => Tried this in several folders. @Eilon wrote in this issue https://github.com/aspnet/Home/issues/2840 that it probably belongs to this repository. # General .NET Core 2.0 & 2.0.5 Mac & Windows # Sample ``` var fi = new FileInfo(Path.Combine(""Videos/sample.mp4"")); Console.WriteLine(fi.Length); Console.ReadLine(); ```" 26720 area-System.Diagnostics Test GetProcesses_InvalidMachineName_ThrowsInvalidOperationException crashes uap test run The InvalidOperationException thrown at test method GetProcesses_InvalidMachineName_ThrowsInvalidOperationException is currently crashing the UAP app when running the F5 tests. I did not dig deep to find out why this is, but I'm creating this issue to track the fix in order to be able to unblock the maestro auto update PRs. cc: @stephentoub 26721 area-System.Net HttpClient.SendAsync(request, httpcompletionoption, cancellationtoken) should be virtual. Hello, Similar to implementation of SendAsync(req, cancellationToken) the sendAsync(req, httpcompletion, cancellationtoken) should be also virtual. Currently we are able to override SendAsync(req, cancellationToken) with some custom code and would like to do the same for sendAsync(req, httpcompletion, cancellationtoken) Thanks. 26722 area-System.Net Need two Http requests to set cookies "_From @tanyado on January 31, 2018 22:21_ In .NET Core, I have to send a two http requests manually – only the second post request will succeed. HttpClientHandler handler = new HttpClientHandler(); handler.Credentials = new NetworkCredential(userName, userPass); HttpClient client = new HttpClient(handler); client.BaseAddress = new Uri(baseUri); // PROBLEM HERE: await client.PostAsync(requestUri, null); // The extra post request to set cookie var response = await client.PostAsync(requestUri, new StringContent(Body(), Encoding.UTF8, ""application/json"")); The server sets a cookie on the initial 401 challenge and rejects the subsequent credentialed request if it lacks this cookie. Fiddler Traces are in this folder: https://microsoft-my.sharepoint.com/:f:/p/tad/Ehuec61zdD9Fp1Vlf6QI718BynEnS-HF3tL4w9FXGgH7Eg?e=tsH1fU _Copied from original issue: aspnet/Home#2841_" 26724 area-System.Data flakey SqlConnectionBasicTests failure Failed in windows CI legs for 2.0.x PR https://github.com/dotnet/corefx/pull/26577 https://mc.dot.net/#/user/bording/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Frelease~2F2.0.0~2F/test~2Ffunctional~2Fcli~2F/289ddbee6ef7e22451bbe841e8171167b116e76a/workItem/System.Data.SqlClient.Tests/analysis/xunit/System.Data.SqlClient.Tests.SqlConnectionBasicTests~2FConnectionTimeoutTestWithThread ``` Unhandled Exception of Type Xunit.Sdk.TrueException Message : Assert.True() Failure Expected: True Actual: False Stack Trace : at System.Data.SqlClient.Tests.SqlConnectionBasicTests.ConnectionTimeoutTestWithThread() ``` cc: @saurabh500 26725 area-System.Net [Regression] [Linux] Test failure: System.Net.Http.Functional.Tests.HttpClientHandler_DangerousAcceptAllCertificatesValidator_Test / SetDelegate_ConnectionSucceeds ## Types of failures ``` Unhandled Exception of Type System.IO.IOException Message : System.IO.IOException : The decryption operation failed, see inner exception. ---- Interop+OpenSsl+SslException : Decrypt failed with OpenSSL error - SSL_ERROR_SSL. -------- System.Security.Cryptography.CryptographicException : Error occurred during a cryptographic operation. Stack Trace : at System.Net.Security.SslStreamInternal.ReadAsyncInternal[TReadAdapter](TReadAdapter adapter, Memory`1 buffer) in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/src/System.Net.Security/src/System/Net/Security/SslStreamInternal.cs:line 306 at System.IO.StreamReader.ReadBufferAsync() in /root/coreclr/src/mscorlib/shared/System/IO/StreamReader.cs:line 1328 at System.IO.StreamReader.ReadLineAsyncInternal() in /root/coreclr/src/mscorlib/shared/System/IO/StreamReader.cs:line 888 at System.Net.Test.Common.LoopbackServer.ReadWriteAcceptedAsync(Socket s, StreamReader reader, StreamWriter writer, String response) in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/src/Common/tests/System/Net/Http/LoopbackServer.cs:line 97 at System.Net.Test.Common.LoopbackServer.AcceptSocketAsync(Socket server, Func`5 funcAsync, Options options) in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/src/Common/tests/System/Net/Http/LoopbackServer.cs:line 177 at System.Net.Http.Functional.Tests.HttpClientHandler_DangerousAcceptAllCertificatesValidator_Test.<>c__DisplayClass3_1.<<SetDelegate_ConnectionSucceeds>b__0>d.MoveNext() in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.AcceptAllCerts.cs:line 53 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.<>c__DisplayClass3_0.<CreateServerAsync>b__0(Task t) in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/src/Common/tests/System/Net/Http/LoopbackServer.cs:line 68 at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) in /root/coreclr/src/mscorlib/shared/System/Threading/ExecutionContext.cs:line 151 at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) in /root/coreclr/src/mscorlib/src/System/Threading/Tasks/Task.cs:line 2440 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpClientHandler_DangerousAcceptAllCertificatesValidator_Test.SetDelegate_ConnectionSucceeds(SslProtocols acceptedProtocol, Boolean requestOnlyThisProtocol) in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.AcceptAllCerts.cs:line 51 --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at Interop.OpenSsl.Decrypt(SafeSslHandle context, Byte[] outBuffer, Int32 offset, Int32 count, SslErrorCode& errorCode) in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSsl.cs:line 279 at System.Net.Security.SslStreamPal.EncryptDecryptHelper(SafeDeleteContext securityContext, ReadOnlyMemory`1 input, Int32 offset, Int32 size, Boolean encrypt, Byte[]& output, Int32& resultSize) in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/src/System.Net.Security/src/System/Net/Security/SslStreamPal.Unix.cs:line 207 ----- Inner Stack Trace ----- ``` ## History of failure Day | Build | OS | Details -- | -- | -- | -- 1/31 | 20180131.01 | Ubuntu16.04 | [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180131.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_DangerousAcceptAllCertificatesValidator_Test~2FSetDelegate_ConnectionSucceeds(acceptedProtocol:%20Tls,%20requestOnlyThisProtocol:%20False)) 1/31 | 5665828df2bef3224b83bd4a544e2ab35bd63be3 - PR #26679 | Debian87 | [link](https://mc.dot.net/#/user/MichalStrehovsky/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/5665828df2bef3224b83bd4a544e2ab35bd63be3/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.ManagedHandler_HttpClientHandler_DangerousAcceptAllCertificatesValidator_Test~2FSetDelegate_ConnectionSucceeds(acceptedProtocol:%20Tls,%20requestOnlyThisProtocol:%20False)) 1/31 | 332eae1f1b935565c1bf54b283cddf714fb607e0 - PR #26686 | RedHat73 | [link](https://mc.dot.net/#/user/joperezr/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/332eae1f1b935565c1bf54b283cddf714fb607e0/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.ManagedHandler_HttpClientHandler_DangerousAcceptAllCertificatesValidator_Test~2FSetDelegate_ConnectionSucceeds(acceptedProtocol:%20Tls,%20requestOnlyThisProtocol:%20False)) 26726 area-System.Memory Change the semantics of Span ToString to return the contents for T=char Fixes https://github.com/dotnet/corefx/issues/26584 Related PR: https://github.com/dotnet/coreclr/pull/16143 This PR supersedes https://github.com/dotnet/corefx/pull/26663 It is blocked: After https://github.com/dotnet/coreclr/pull/16087 is merged and CoreFX is updated to use the new coreclr version, this PR can be merged. cc @pakrym, @jkotas, @stephentoub, @dotnet/corefxlab-contrib 26727 area-System.Net Update HttpStatusCode enum Closes: #4382 /cc: @dotnet/ncl 26729 area-System.Net "Lots of System.Net.Http ""dribble"" tests have started failing" These tests are failing randomly on a bunch of PRs, e.g.  https://mc.dot.net/#/user/caesar1995/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/811599f6d8f636fd0b43089acd4d5d4a338d8259/workItem/System.Net.Http.Functional.Tests They look like: ``` 2018-02-01 03:12:02,305: INFO: proc(54): run_and_log_output: Output: System.Net.Http.Functional.Tests.ManagedHandler_HttpProtocolTests_Dribble.GetAsync_ResponseVersion0X_ThrowsOr10(responseMinorVersion: 9) [FAIL] 2018-02-01 03:12:02,321: INFO: proc(54): run_and_log_output: Output: Assert.Throws() Failure 2018-02-01 03:12:02,321: INFO: proc(54): run_and_log_output: Output: Expected: typeof(System.Net.Http.HttpRequestException) 2018-02-01 03:12:02,321: INFO: proc(54): run_and_log_output: Output: Actual: typeof(System.IO.IOException): Unable to transfer data on the transport connection: An existing connection was forcibly closed by the remote host. 2018-02-01 03:12:02,321: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2018-02-01 03:12:02,414: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\tests\FunctionalTests\HttpProtocolTests.cs(496,0): at System.Net.Http.Functional.Tests.HttpProtocolTests_Dribble.DribbleStream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) 2018-02-01 03:12:02,414: INFO: proc(54): run_and_log_output: Output: E:\A\_work\1661\s\src\mscorlib\shared\System\IO\StreamWriter.cs(979,0): at System.IO.StreamWriter.FlushAsyncInternal(StreamWriter _this, Boolean flushStream, Boolean flushEncoder, Char[] charBuffer, Int32 charPos, Boolean haveWrittenPreamble, Encoding encoding, Encoder encoder, Byte[] byteBuffer, Stream stream, CancellationToken cancellationToken) 2018-02-01 03:12:02,414: INFO: proc(54): run_and_log_output: Output: E:\A\_work\1661\s\src\mscorlib\shared\System\IO\StreamWriter.cs(624,0): at System.IO.StreamWriter.WriteAsyncInternal(StreamWriter _this, String value, Char[] charBuffer, Int32 charPos, Int32 charLen, Char[] coreNewLine, Boolean autoFlush, Boolean appendNewLine) 2018-02-01 03:12:02,414: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---74aa877a\src\Common\tests\System\Net\Http\LoopbackServer.cs(102,0): at System.Net.Test.Common.LoopbackServer.ReadWriteAcceptedAsync(Socket s, StreamReader reader, StreamWriter writer, String response) 2018-02-01 03:12:02,414: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---74aa877a\src\Common\tests\System\Net\Http\LoopbackServer.cs(177,0): at System.Net.Test.Common.LoopbackServer.AcceptSocketAsync(Socket server, Func`5 funcAsync, Options options) 2018-02-01 03:12:02,414: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\tests\FunctionalTests\HttpProtocolTests.cs(261,0): at System.Net.Http.Functional.Tests.HttpProtocolTests.<>c__DisplayClass7_1.<<GetAsync_ResponseVersion0X_ThrowsOr10>b__1>d.MoveNext() 2018-02-01 03:12:02,414: INFO: proc(54): run_and_log_output: Output: --- End of stack trace from previous location where exception was thrown --- ``` 26731 area-System.Runtime bugfix and adding test for GetFolderPath when special folder doesnt exist Bugfix on GetFolderPath in Unix when special folder doesnt exist Fixes #26677 cc: @danmosemsft 26732 area-System.Net [ManagedHandler] responses to 407 proxy authentication request are always sent on new connection I tested this with curl handler and the authentication is sent back on same connection as original request. For managed handler the expectation would be same to save extra OS file descriptor and TCP (possibly TLS) handshake. The setup is trivial: configure managed Handler to use proxy requiring Basic or Digest authentication and request any page. Two connections will be established to handle single request. existing code looks like: ```c# if (response.StatusCode == HttpStatusCode.ProxyAuthenticationRequired) { foreach (AuthenticationHeaderValue h in response.Headers.ProxyAuthenticate) { if (h.Scheme == AuthenticationHelper.Basic) { NetworkCredential credential = _proxy.Credentials?.GetCredential(proxyUri, AuthenticationHelper.Basic) ?? _defaultCredentials?.GetCredential(proxyUri, AuthenticationHelper.Basic); if (credential != null) { response.Dispose(); ``` Because we Dispose context without processing it, that leaves HttpConnection in undefined state so it is disposed rather than returned back to connection pool. I verified that adding connection.LoadIntoBufferAsync() fixes this and authentication will happen on same connection when possible. We discussed this with @geoffkizer and we need some better mechanism how to drain/discard response we don't care about so we can use existing connection for other requests. 26733 area-System.Net get connection from pool to send digest auth response This fixes improper use of _innerHandler. The response still goes out on separate connection. #26732 is opened to track that. 26734 area-System.IO FileStream with no disk space kill process on Windows, corrupts data on Unix Consider the following code: ``` using(var fs = File.Create(...)) // open a file to a drive with very little space left { fs.Write(...); // this is held in the buffer, this pass fs.Write(...); // this is trigger, a write to disk, which will fail } // here we dispose the file stream properly ``` The problem is that the stream will try to write to the disk at three different times: * At the second `Write` call. - FAIL * On the `Dispose` - FAIL * On the `Finalize` - FAIL and *kill the process* The underlying reason is here: https://github.com/dotnet/coreclr/blob/master/src/mscorlib/src/System/IO/Stream.cs#L239-L240 The Stream will first call the `Dispose(true)` and only then will it suppress the finalizer. The problem is that if there is an issue writing to disk, such as no disk space, it will keep occurring and eventually the finalizer will execute the code and die. Here is the stack trace from a production crash: ``` Exception object: 0000012fbd33ac60 Exception type: System.IO.IOException Message: There is not enough space on the disk InnerException: <none> StackTrace (generated): SP IP Function 00000024382FF0D0 00007FFD8313108A System_Private_CoreLib!System.IO.FileStream.WriteCore(Byte[], Int32, Int32)+0x3cf7ea 00000024382FF140 00007FFD82D611A2 System_Private_CoreLib!System.IO.FileStream.FlushWriteBuffer(Boolean)+0x62 00000024382FF180 00007FFD82D60FA1 System_Private_CoreLib!System.IO.FileStream.Dispose(Boolean)+0x41 00000024382FF1D0 00007FFD82D60631 System_Private_CoreLib!System.IO.FileStream.Finalize()+0x11 ``` 26735 area-System.Net [ManagedHandler] HttpConnectionContent.TryComputeLength() always returns false/0 The function should return true and proper value if Content-length has been specified in response. Aside from debugging this may help with decision if to drain certain responses or to abort connection. 26738 area-System.Collections Test failure: System.Collections.Concurrent.Tests.ConcurrentBagTests/ManyConcurrentAddsTakes_ForceContentionWithToArray(seconds: 1) Opened on behalf of @Sunny-pu The test `System.Collections.Concurrent.Tests.ConcurrentBagTests/ManyConcurrentAddsTakes_ForceContentionWithToArray(seconds: 1)` has failed. Assert.DoesNotContain() Failure\r Found: 0\r In value: Int32[] [0] Stack Trace: at System.Collections.Concurrent.Tests.ProducerConsumerCollectionTests.ManyConcurrentAddsTakes_ForceContentionWithToArray(Double seconds) in E:\A\_work\400\s\corefx\src\System.Collections.Concurrent\tests\ProducerConsumerCollectionTests.cs:line 912 Build : Master - 20180201.01 (UWP F5 Tests) Failing configurations: - Windows.10.Arm64-arm - Release Details: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fuwp~2F/build/20180201.01/workItem/System.Collections.Concurrent.Tests/analysis/xunit/System.Collections.Concurrent.Tests.ConcurrentBagTests~2FManyConcurrentAddsTakes_ForceContentionWithToArray(seconds:%201) 26739 area-System.Security Is libressl (fully) supported instead of openssl? Hello! I'm currently trying to install the dotnet core sdk (via it's [binary package](https://www.microsoft.com/net/download/linux)) on [Void Linux](https://www.voidlinux.eu/) which uses libressl instead of openssl. After installing `libunwind` and `icu` the `dotnet -h` command works fine. However when I try to run `dotnet new console` I get the following error: https://github.com/dotnet/corefx/blob/4d7ee843bf1496c0d9c01671befdeb65548aef1f/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.cpp#L42 ``` No usable version of the libssl was found Aborted ``` When I symlink the existing libressl library `/lib/libssl.so.43` to one of the paths in the above linked source file, e.g. `/lib/libssl.so.1.0.0` everything works fine. I've cloned a [asp.net core rest api server / dotnet core rest api client solution](https://gitlab.com/lyze237/HelloLibraries/tree/refit) and ran it just fine without errors. --- Does dotnet core fully support libressl and what should the project do to detect those libraries easier/better? 26740 area-System.Memory Review performance of ReadOnlyBuffer and evaluate use of Inlining See https://github.com/dotnet/corefx/pull/26694#discussion_r165252355 for the discussion. We need to do another pass since all of the code churn took place make sure these are still valuable. 26741 area-System.Net ManagedHandler failure to copy request content to server could result in hang https://github.com/dotnet/corefx/blob/64976bf062b6cbc55a3e708dbf7116188d075ff1/src/System.Net.Http/src/System/Net/Http/Managed/HttpConnection.cs#L319 If something in the copy fails but not due to the connection closing (e.g. a bad source stream implementation), it's possible we could then wait for the server to send a response, but the server's still waiting for us to send the content, and we'll effectively hang until one side decides to timeout the connection. This should be very rare, as failures to copy here would generally be due to failure to write to a closed connection, but other failures are possible, e.g. if we're copying from another network stream that itself experiences a failure. We should stop waiting for a response from the server if this send task fails. 26743 area-System.Net [Desktop] HttpClient/WinHttpHandler - unexpected delay under heavy load I've found problem when using the HttpClient class. Under heavy load when I log when the SendAsync() method was called and when it returned the response I can see 3844ms for example. But the party on the other side is reporting 16ms only! By turning on all possible log switches in .NET FW I was able to track to the problematic part - which is in WinHttpHandler, private async void StartRequest(WinHttpRequestState state) method, line with await InternalSendRequestAsync(state); As you can see there is a missing .ConfigureAwait(false) which is (probably) doing this unexpected delay under heavy load as it's waiting for original context. Additional logging follows Client App [before/after SendAsync method call]: ``` 2018-01-31 18:16:51,148; [57]; DEBUG; $$Operation started, Id: 72c574c5c828644b-cba797e5-fcd59352 2018-01-31 18:16:54,992; [111]; TIMING; Id=72c574c5c828644b-cba797e5-fcd59352; Duration=3844; Operation=[POST] [http://<dns/path>]; Message=200 OK ``` Server App [WebAPI]: ``` 2018-01-31 18:16:54,988; [87]; DEBUG; 72c574c5c828644b-fcd59352-0fb4a886 Requested [POST] <dns/path> Id=72c574c5c828644b-cba797e5-fcd59352 2018-01-31 18:16:54,988; [87]; DEBUG; 72c574c5c828644b-fcd59352-0fb4a886 Response Status=200 OK ``` Verbose logging in Client App proves the delay problem is outside our control: ``` DateTime=2018-01-31T18:16:51.1637939Z System.Net Verbose: 0 : [3056] HttpWebRequest#33970533::HttpWebRequest(http://<dns/path>#1354891878) DateTime=2018-01-31T18:16:51.1637939Z System.Net Verbose: 0 : [3056] Exiting HttpWebRequest#33970533::HttpWebRequest() DateTime=2018-01-31T18:16:51.1637939Z System.Net Verbose: 0 : [3056] HttpWebRequest#33970533::HttpWebRequest(uri: 'http://<dns/path>', connectionGroupName: '62473202') DateTime=2018-01-31T18:16:51.1637939Z System.Net Verbose: 0 : [3056] Exiting HttpWebRequest#33970533::HttpWebRequest() ``` <other log events - see after 3seconds!!> ``` DateTime=2018-01-31T18:16:54.9765126Z System.Net Information: 0 : [19808] Associating HttpWebRequest#33970533 with ConnectStream#2301377 DateTime=2018-01-31T18:16:54.9765126Z System.Net Information: 0 : [19808] ConnectStream#2301377 - Sending headers { id: 72c574c5c828644b-cba797e5-fcd59352 ...} ``` [EDIT] Log formatting changes by @karelz 26746 area-System.IO Disable Brotli perf tests https://github.com/dotnet/corefx/issues/26566 [ActiveIssue] doesn't appear to work with [Benchmark], so I've just commented the files out of the .csproj. cc: @danmosemsft, @ianhays 26747 area-System.Net Disable failing NameResolutionPalTests https://github.com/dotnet/corefx/issues/20245 26748 area-System.Memory System.Memory tests hanging in CI e.g. https://mc.dot.net/#/user/Priya91/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/f66b25054d7156bafca6c8902158ff55036d6de3/workItem/System.Memory.Tests/wilogs ``` 2018-02-01 16:11:49,059: INFO: proc(54): run_and_log_output: Output: Discovering: System.Memory.Tests 2018-02-01 16:11:49,388: INFO: proc(54): run_and_log_output: Output: Discovered: System.Memory.Tests 2018-02-01 16:11:49,654: INFO: proc(54): run_and_log_output: Output: Starting: System.Memory.Tests 2018-02-01 16:14:02,436: INFO: proc(54): run_and_log_output: Output: Span.BinarySearch test BinarySearch_MaxLength_NoOverflow skipped (could not alloc memory). ``` cc: @ahsonkhan, @AtsushiKan 26749 area-Serialization SG doesn't catch all exception for unsupported type "SG throw unsupportedexception for the following type with the error ""Cannot deserialize type 'Xamarin.Forms.Element' because it contains property 'RealParent' which has no public setter."" ``` public class FloorPlanData { public Xamarin.Forms.ImageSource ImageData { get; } } ``` However it just gave the warning if ImageData has the public setter. ``` public class FloorPlanData { public Xamarin.Forms.ImageSource ImageData { get;set; } } ``` " 26750 area-System.Runtime Mark ValueTaskAwaiter and ConfiguredValueTaskAwaiter as readonly in contracts Can be done once we get an update .NET Native build that includes the associated updates. Both System.Runtime and System.Threading.Tasks.Extensions need to be updated. 26751 area-System.Memory Reduce test run time to help avoid timeouts in CI for outerloop tests Cannot reproduce the test failures locally, and hence trying to run in CI with XunitShowProgress enabled to see where the hang is happening. From https://github.com/dotnet/corefx/issues/26748 cc @stephentoub, @AtsushiKan, cc @KrzysztofCwalina 26752 area-System.Net DO NOT MERGE: add drain tests to understand behavior 26753 area-Serialization Area-Serialization Sprint 131 The issue is for tracking issues to be done in sprint 131 (due by 2/23/2018) 26754 area-System.Net Assert firing sporadically in ManagedHandler when returning connection to pool https://github.com/dotnet/corefx/blob/95bfb895707d5756d4b9693286672780f0a6ba02/src/System.Net.Http/src/System/Net/Http/Managed/HttpConnection.cs#L1216 (I added the current values of the variables to the assert message.) ``` FailFast: 34 != 32 at System.Diagnostics.Debug.Assert(Boolean condition, String message, String detailMessage) in E:\A\_work\2298\s\src\mscorlib\shared\System\Diagnostics\Debug.cs:line 97 at System.Net.Http.HttpConnection.ReturnConnectionToPoolCore() in d:\repos\corefx\src\System.Net.Http\src\System\Net\Http\Managed\HttpConnection.cs:line 1202 at System.Net.Http.HttpConnection.ReturnConnectionToPool() in d:\repos\corefx\src\System.Net.Http\src\System\Net\Http\Managed\HttpConnection.cs:line 1164 at System.Net.Http.HttpConnection.ContentLengthReadStream.ReadAsync(Memory`1 destination, CancellationToken cancellationToken) in d:\repos\corefx\src\System.Net.Http\src\System\Net\Http\Managed\ ContentLengthReadStream.cs:line 60 at System.Runtime.CompilerServices.AsyncMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine) in E:\A\_work\2298\s\src\mscorlib\shared\System\Runtime\CompilerServices\AsyncMethodBuilde r.cs:line 38 at System.Net.Http.HttpConnection.ContentLengthReadStream.ReadAsync(Memory`1 destination, CancellationToken cancellationToken) at System.Net.Http.HttpConnection.ContentLengthReadStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) in d:\repos\corefx\src\System.Net.Http\src\Syst em\Net\Http\Managed\ContentLengthReadStream.cs:line 28 at System.IO.Stream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count) in E:\A\_work\2298\s\src\mscorlib\src\System\IO\Stream.cs:line 376 at System.Net.Http.Functional.Tests.ResponseStreamTest.ReadAsStreamHelper(IPEndPoint serverEndPoint) in d:\repos\corefx\src\System.Net.Http\tests\FunctionalTests\ResponseStreamTest.cs:line 253 at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in E:\A\_work\2298\s\src\mscorlib\shared\System\Threading\ExecutionCon text.cs:line 166 at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext() in E:\A\_work\2298\s\src\mscorlib\src\System\Runtime\CompilerServices\AsyncMethodBuilder.cs:line 546 at Xunit.Sdk.AsyncTestSyncContext.<>c__DisplayClass7_0.<Post>b__1(Object _) in C:\BuildAgent\work\cb37e9acf085d108\src\xunit.execution\Sdk\AsyncTestSyncContext.cs:line 75 at Xunit.Sdk.MaxConcurrencySyncContext.RunOnSyncContext(SendOrPostCallback callback, Object state) in C:\BuildAgent\work\cb37e9acf085d108\src\xunit.execution\Sdk\MaxConcurrencySyncContext.cs:lin e 107 at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in E:\A\_work\2298\s\src\mscorlib\shared\System\Threading\ExecutionCon text.cs:line 166 at Xunit.Sdk.MaxConcurrencySyncContext.WorkerThreadProc() in C:\BuildAgent\work\cb37e9acf085d108\src\xunit.execution\Sdk\MaxConcurrencySyncContext.cs:line 89 at Xunit.Sdk.XunitWorkerThread.<>c.<QueueUserWorkItem>b__5_0(Object _) in C:\BuildAgent\work\cb37e9acf085d108\src\common\XunitWorkerThread.cs:line 37 at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in E:\A\_work\2298\s\src\mscorlib\shared\System\Threading\ExecutionCon text.cs:line 166 at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) in E:\A\_work\2298\s\src\mscorlib\src\System\Threading\Tasks\Task.cs:line 2440 at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in E:\A\_work\2298\s\src\mscorlib\shared\System\Threading\ExecutionCon text.cs:line 166 at System.Environment.FailFast(System.String, System.Exception) at System.Net.Http.HttpConnection.ReturnConnectionToPoolCore() at System.Net.Http.HttpConnection.ReturnConnectionToPool() at System.Net.Http.HttpConnection+ContentLengthReadStream+<ReadAsync>d__3.MoveNext() at System.Runtime.CompilerServices.AsyncMethodBuilder.Start[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon ByRef) at System.Net.Http.HttpConnection+ContentLengthReadStream.ReadAsync(System.Memory`1<Byte>, System.Threading.CancellationToken) at System.Net.Http.HttpConnection+ContentLengthReadStream.ReadAsync(Byte[], Int32, Int32, System.Threading.CancellationToken) at System.IO.Stream.ReadAsync(Byte[], Int32, Int32) at System.Net.Http.Functional.Tests.ResponseStreamTest+<ReadAsStreamHelper>d__9.MoveNext() at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToke n=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext() at Xunit.Sdk.AsyncTestSyncContext+<>c__DisplayClass7_0.<Post>b__1(System.Object) at Xunit.Sdk.MaxConcurrencySyncContext.RunOnSyncContext(System.Threading.SendOrPostCallback, System.Object) at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) at Xunit.Sdk.MaxConcurrencySyncContext.WorkerThreadProc() at Xunit.Sdk.XunitWorkerThread+<>c.<QueueUserWorkItem>b__5_0(System.Object) at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef) at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) ``` 26755 area-System.Net Use TryFormat with spans in a few more places in ManagedHandler While looking at something else, I noticed these allocations that could be easily avoided with our new span hotness. cc: @geoffkizer 26756 area-System.ComponentModel PropertyDescriptor - MemberDescriptor.Attributes (iteration 2) Fixes #26600 PropertyDescriptor - MemberDescriptor.Attributes returns base attribute instead of ancestor's attribute 26757 area-System.Runtime Add Unsafe.AsRef<T>(in T value) overload "Sometimes you really just want to turn a ""ref readonly"" variable into a standard ""ref"" variable, perhaps so that it can be passed to `Unsafe.As<TFrom, TTo>` or `Unsafe.ReadUnaligned<T>`. Since we don't want to add overloads to all of our unsafe APIs that take readonly-qualified parameters, we should have a utility method that strips the readonly qualifier from its input. /cc @KrzysztofCwalina @jkotas @ahsonkhan " 26758 area-System.Security Add System.Security.Permissions netfx facade and mark some APIs as obsolet to match desktop Fixes: https://github.com/dotnet/corefx/issues/24517 cc: @weshaggard @danmosemsft @ViktorHofer 26759 area-System.Net Clean up ManagedHandler sending of request content Centralize the copy into the function that actually sends the content. cc: @geoffkizer Closes https://github.com/dotnet/corefx/issues/26741 (turns it there wasn't actually a bug here, as if an exception did occur asynchronously, it would already cause the stream to be disposed, tearing down a concurrent await for a read) 26760 area-System.Net [New Test] Test failure: System.Net.Http.Functional.Tests.ManagedHandler_HttpRetryProtocolTests / PostAsyncExpect100Continue_RetryOnConnectionClosed_Success ## Types of failures ### An existing connection was forcibly closed by the remote host Failure [20180202.01](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180202.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.ManagedHandler_HttpRetryProtocolTests~2FPostAsyncExpect100Continue_RetryOnConnectionClosed_Success): ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.IO.IOException : Unable to transfer data on the transport connection: An existing connection was forcibly closed by the remote host. -------- System.Net.Sockets.SocketException : An existing connection was forcibly closed by the remote host at System.Net.Http.HttpConnection.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in E:\A\_work\1581\s\corefx\src\System.Net.Http\src\System\Net\Http\Managed\HttpConnection.cs:line 508 at System.Net.Http.HttpConnectionPool.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in E:\A\_work\1581\s\corefx\src\System.Net.Http\src\System\Net\Http\Managed\HttpConnectionPool.cs:line 178 at System.Net.Http.CookieHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in E:\A\_work\1581\s\corefx\src\System.Net.Http\src\System\Net\Http\Managed\CookieHandler.cs:line 31 at System.Net.Http.AuthenticateAndRedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in E:\A\_work\1581\s\corefx\src\System.Net.Http\src\System\Net\Http\Managed\AuthenticateAndRedirectHandler.cs:line 53 at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) in E:\A\_work\1581\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 488 at System.Net.Http.Functional.Tests.HttpRetryProtocolTests.<PostAsyncExpect100Continue_RetryOnConnectionClosed_Success>b__6_0(Uri url) in E:\A\_work\1581\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpRetryProtocolTests.cs:line 109 at System.Net.Http.Functional.Tests.HttpRetryProtocolTests.<>c__DisplayClass4_0.<<CreateServerAndClientAsync>b__0>d.MoveNext() in E:\A\_work\1581\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpRetryProtocolTests.cs:line 37 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.<>c__DisplayClass3_0.<CreateServerAsync>b__0(Task t) in E:\A\_work\1581\s\corefx\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 68 at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in E:\A\_work\2298\s\src\mscorlib\shared\System\Threading\ExecutionContext.cs:line 166 --- End of stack trace from previous location where exception was thrown --- at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) in E:\A\_work\2298\s\src\mscorlib\src\System\Threading\Tasks\Task.cs:line 2440 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpRetryProtocolTests.PostAsyncExpect100Continue_RetryOnConnectionClosed_Success() in E:\A\_work\1581\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpRetryProtocolTests.cs:line 93 --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Net.Http.HttpConnection.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in E:\A\_work\1581\s\corefx\src\System.Net.Http\src\System\Net\Http\Managed\HttpConnection.cs:line 365 ----- Inner Stack Trace ----- ``` ### The server returned an invalid or unrecognized response Failure [CI on 2/1](https://mc.dot.net/#/user/stephentoub/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/ca709efa277ed1849d2584dd8ffcb8d97254d7e3/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.ManagedHandler_HttpRetryProtocolTests~2FPostAsyncExpect100Continue_RetryOnConnectionClosed_Success) ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.IO.IOException : The server returned an invalid or unrecognized response. at System.Net.Http.HttpConnection.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\src\System\Net\Http\Managed\HttpConnection.cs:line 508 at System.Net.Http.HttpConnectionPool.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\src\System\Net\Http\Managed\HttpConnectionPool.cs:line 178 at System.Net.Http.CookieHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\src\System\Net\Http\Managed\CookieHandler.cs:line 31 at System.Net.Http.AuthenticateAndRedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\src\System\Net\Http\Managed\AuthenticateAndRedirectHandler.cs:line 53 at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 488 at System.Net.Http.Functional.Tests.HttpRetryProtocolTests.<PostAsyncExpect100Continue_RetryOnConnectionClosed_Success>b__6_0(Uri url) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\tests\FunctionalTests\HttpRetryProtocolTests.cs:line 109 at System.Net.Http.Functional.Tests.HttpRetryProtocolTests.<>c__DisplayClass4_0.<<CreateServerAndClientAsync>b__0>d.MoveNext() in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\tests\FunctionalTests\HttpRetryProtocolTests.cs:line 37 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.<>c__DisplayClass3_0.<CreateServerAsync>b__0(Task t) in D:\j\workspace\windows-TGrou---74aa877a\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 67 at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in E:\A\_work\2298\s\src\mscorlib\shared\System\Threading\ExecutionContext.cs:line 166 --- End of stack trace from previous location where exception was thrown --- at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) in E:\A\_work\2298\s\src\mscorlib\src\System\Threading\Tasks\Task.cs:line 2440 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpRetryProtocolTests.PostAsyncExpect100Continue_RetryOnConnectionClosed_Success() in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\tests\FunctionalTests\HttpRetryProtocolTests.cs:line 93 --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Net.Http.HttpConnection.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\src\System\Net\Http\Managed\HttpConnection.cs:line 373 ``` ## History of test failure Day | Build | OS | Details -- | -- | -- | -- 2/1 | ca709efa277ed1849d2584dd8ffcb8d97254d7e3 | Win10 | The server returned an invalid or unrecognized response - [link](https://mc.dot.net/#/user/stephentoub/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/ca709efa277ed1849d2584dd8ffcb8d97254d7e3/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.ManagedHandler_HttpRetryProtocolTests~2FPostAsyncExpect100Continue_RetryOnConnectionClosed_Success) 2/2 | 20180202.01 | Win7 | An existing connection was forcibly closed by the remote host - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180202.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.ManagedHandler_HttpRetryProtocolTests~2FPostAsyncExpect100Continue_RetryOnConnectionClosed_Success) 26763 area-System.Net Fix ManagedHandler env var / AppContext handling Fixes https://github.com/dotnet/corefx/issues/26466 cc: @eerhardt, @wfurt, @geoffkizer 26764 area-System.Net Remove Supports* properties from ManagedHandler Fixes https://github.com/dotnet/corefx/issues/26490 cc: @geoffkizer 26766 area-System.Net Move ManagedHandler version/chunking validation earlier Move it to ManagedHandler.SendAsync rather than HttpConnection.SendAsync so that it happens before we even try to get a connection. A minor benefit of the change as well is that isHttp10 is no longer lifted to the state machine. Fixes https://github.com/dotnet/corefx/issues/26709 cc: @geoffkizer, @pjanotti 26768 area-System.Memory Improve code coverage for ReadOnlySequence and BuffersExtensions - [ ] BuffersExtensions - code coverage is at 70% - [ ] ReadOnlySequence - (coverage at ~93%) - Add tests for longer than int.Max Edited by @ahsonkhan 26769 area-System.Net ManagedHandler: Disallow Expect100Continue for HTTP 1.0 requests We should either throw or ignore Expect100Continue in this case. 26770 area-System.Net [New test] [Desktop] Test Failure: System.Net.Http.Functional.Tests.HttpRetryProtocolTests / GetAsync_RetryOnConnectionClosed_Success https://ci3.dot.net/job/dotnet_corefx/job/master/job/windows-TGroup_netfx+CGroup_Release+AGroup_x86+TestOuter_false_prtest/7716/consoleFull Test added ~3 days ago by @geoffkizer . Test is part of innerloop CI, so should be fixed or disabled ASAP. ``` 14:55:29 System.Net.Http.Functional.Tests.HttpRetryProtocolTests.GetAsync_RetryOnConnectionClosed_Success [FAIL] 14:55:29 System.Net.Http.HttpRequestException : An error occurred while sending the request. 14:55:29 ---- System.Net.WebException : The request was aborted: The request was canceled. ``` 26772 area-System.Linq API Change Request: Expression support for ref and readonly ref types Currently expressions represents `ref` types only in one place, viz. `ParameterExpression` objects for which `IsByRef` is true. With a greater use of `ref` types due to greater language support, it seems fruitful to increase the availability of `ref` types in other expressions. While allowing such types directly on expressions' `Type` would be one reasonable approach (so that e.g. `exp.Type == typeof(int).MakeByRefType()` could be true) this has two problems: 1. It doesn't play well with generics, and while generics aren't used in the typing of most expressions, they are important for the type of lambdas, so keeping ref-ness separate is probably cleaner. 2. (More serious of the two, IMO). Doing this would not blend well with the current implementation of `ParameterExpression`. There is also metadata support for `ref` types for which the address should not be written through (`in` parameters and `ref readonly` variables and returns in C#). It would be useful to be able to express this in expressions. Note that #26238 would require such `ref` support as a prerequisite to making it available to Microsoft.CSharp. This proposal suggests adding a `IsByRef` property to `Expression` similar to that of `ParameterExpression` (which would hide it in that case, but should return the save value) to represent `ref` types and an `IsByRefReadOnly ` property to represent `in`/`ref readonly` types. The default implementation is given as part of the proposal as that would affect custom classes derived from `Expression`. `IsByRefReadOnly` only varies in the case where `IsByRef` is true. If `IsByRef` is false then `IsByRefReadOnly` should always be false. `GetDelegateType` would need at least an internal overload that indicated the readonly quality of `in` parameters and `ref readonly` returns, so it should probably be made public. The `Parameter` factory would similarly need to be able to indicate `in` parameters. Other factories will depend on inferring such types, unless experience shows that explicit factories are beneficial. ```C# namespace System.Linq.Expressions { public partial class Expression { public static Type GetDelegateType(Type[] typeArgs, bool[] isReadOnlyRef); public virtual bool IsByRef { get; } public virtual bool IsByRefReadOnly { get; } public static ParameterExpression Parameter(Type type, bool isReadOnlyRef); public static ParameterExpression Parameter(Type type, bool isReadOnlyRef, string name); } public class ParameterExpression : Expression { public new bool IsByRef { get; } // new added to prevent CS0108 } } ``` 26773 area-System.Net Disable SetDelegate_ConnectionSucceeds on Linux https://github.com/dotnet/corefx/issues/25676 26774 area-System.Net Disable ExpectContinue in ManagedHandler when using version 1.0 Don't fail, but disable sending the header and respecting the setting if the version is 1.0. This appears to match netfx behavior with regards to 1.0 and what's sent, and seems reasonable. Fixes https://github.com/dotnet/corefx/issues/26769 cc: @geoffkizer, @davidsh 26775 area-System.Net [Regression] Test failure: System.Net.Sockets.Tests.SocketOptionNameTest / MulticastInterface_Set_AnyInterface_Succeeds in CI Outerloop test ```MulticastInterface_Set_AnyInterface_Succeeds``` failing with following stacktrace: In PR #26731 (both [Release](https://ci.dot.net/job/dotnet_corefx/job/master/job/outerloop_netcoreapp_fedora24_release_prtest/7/testReport/junit/System.Net.Sockets.Tests/SocketOptionNameTest/MulticastInterface_Set_AnyInterface_Succeeds/) and [Debug](https://ci.dot.net/job/dotnet_corefx/job/master/job/outerloop_netcoreapp_fedora24_debug_prtest/13/testReport/junit/System.Net.Sockets.Tests/SocketOptionNameTest/MulticastInterface_Set_AnyInterface_Succeeds/)) ``` 11:32:20 /mnt/resource/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_fedora24_debug_prtest/src/System.ComponentModel.TypeConverter/tests/Performance 11:32:20 Finished running tests. End time=11:32:20. Return value was 0 11:32:20 System.Net.Sockets.Tests.SocketOptionNameTest.MulticastInterface_Set_AnyInterface_Succeeds [FAIL] 11:32:20 Waiting for received data timed out 11:32:20 Expected: True 11:32:20 Actual: False 11:32:20 Stack Trace: 11:32:20 Using as the test runtime folder. 11:32:20 /mnt/resource/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_fedora24_debug_prtest/src/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs(131,0): at System.Net.Sockets.Tests.SocketOptionNameTest.MulticastInterface_Set_Helper(Int32 interfaceIndex) 11:32:20 /mnt/resource/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_fedora24_debug_prtest/src/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs(91,0): at System.Net.Sockets.Tests.SocketOptionNameTest.MulticastInterface_Set_AnyInterface_Succeeds() 11:32:20 --- End of stack trace from previous location where exception was thrown --- ``` 26777 area-System.Collections Adding EnsureCapacity API to HashSet Issue is: #24445 26778 area-System.Collections Test System.Collections.Immutable.Tests.ImmutableDictionaryTest.AddRemoveRandomDataTest failed in CI. Test System.Collections.Immutable.Tests.ImmutableDictionaryTest.AddRemoveRandomDataTest failed. Details: https://ci.dot.net/job/dotnet_corefx/job/master/job/osx10.12_debug/4169/testReport/System.Collections.Immutable.Tests/ImmutableDictionaryTest/AddRemoveRandomDataTest/ Failed configuration: osx10.12_Debug MESSAGE: Assert.True() Failure\nExpected: True\nActual: False ~~~ STACK TRACE: at System.Collections.Immutable.Tests.ImmutableDictionaryTestBase.AddRemoveRandomDataTestHelper(IImmutableDictionary`2 map) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_debug/src/System.Collections.Immutable/tests/ImmutableDictionaryTestBase.cs:line 410 at System.Collections.Immutable.Tests.ImmutableDictionaryTestBase.AddRemoveRandomDataTest() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_debug/src/System.Collections.Immutable/tests/ImmutableDictionaryTestBase.cs:line 85 ~~~ 26780 area-System.Net ManagedHandler: ReadNextLineAsync logic appears incorrect https://github.com/dotnet/corefx/blob/bb738a07720a8c0888a088f2adb737d2cbe09ca2/src/System.Net.Http/src/System/Net/Http/Managed/HttpConnection.cs#L905 We are setting the searchOffset to length, but we should be doing searchOffset += length. Otherwise we will search through bytes we've already scanned. This isn't a correctness issue (we just rescan extra bytes), but if we're going to try to be smart here about not rescanning, we should do it correctly. @stephentoub can you look at this and let me know if I'm missing something here? 26782 area-System.Net ManagedHandler: support LF line endings and trailer headers Fixes #23130 Fixes #26326 Fixes #26780 Also, some minor cleanup and new properties on HttpClientTestBase to make it easier to make tests conditional on which handler is being tested. @stephentoub @davidsh 26783 area-System.Diagnostics Make it possible to specify ProcessPriorityClass when starting a process "When starting a process, I would like to be able to set the priority of the process in the ProcessStartInfo. ```csharp var pi = new ProcessStartInfo(""cmd.exe"", ""/c dir"") { Priority = ProcessPriorityClass.BelowNormal }; using(var p = Process.Start(pi)){ ... } ```" 26784 area-System.Diagnostics Make it possible to start a process suspened, and later resume it. This would make it a lot easier to (for example) attach it to a job. 26785 area-System.Runtime "In what cases ""R"" format fails to round-trip float value?" "[Standard Numeric Format Strings](https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings#the-general-g-format-specifier) article states that in order to successfully round-trip `Single` value one must use `G9` format specifier because `R` doesn't work sometimes: > When used with a [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single) value, the ""G9"" format specifier ensures that the original [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single) value successfully round-trips. This is because [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single) is an IEEE 754-2008-compliant single-precision (`binary32`) floating point number that gives up to nine significant digits of precision. We recommend its use instead of the [""R"" format specifier](https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings#RFormatString), since in some cases ""R"" fails to successfully round-trip single-precision floating point values. > For [Double](https://docs.microsoft.com/en-us/dotnet/api/system.double) and [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single) values, the ""R"" format specifier in some cases fails to successfully round-trip the original value and also offers relatively poor performance. Instead, we recommend that you use the [""G17""](https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings#GFormatString) format specifier for [Double](https://docs.microsoft.com/en-us/dotnet/api/system.double) values and the [""G9""](https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings#GFormatString) format specifier to successfully round-trip [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single) values. To find such cases I used code snippet similar to the following one (Windows 10 x64, .NET Core 2.0 and .NET Framework 4.5) and found none: ```csharp using System; using System.Globalization; public class Program { static unsafe float Int32BitsToSingle(int value) => *(float*)(&value); static void Main(string[] args) { long cnt = 0; long expCnt = (long)int.MaxValue - int.MinValue + 1; var inv = CultureInfo.InvariantCulture; for (int i = 0; cnt < expCnt; ++i, ++cnt) { float f = Int32BitsToSingle(i); if (cnt % 1000000 == 0) { Console.Clear(); Console.WriteLine(((float)cnt / expCnt).ToString(""#0.####%"", inv)); } if (float.IsNaN(f)) continue; var r = f.ToString(""R"", inv); if (float.Parse(r, inv) == f) continue; Console.WriteLine(""Found on "" + i); Console.WriteLine(f.ToString(inv)); Console.WriteLine(f.ToString(""G9"", inv)); Console.WriteLine(r); return; } Console.WriteLine(""Not found""); } } ```" 26786 area-Infrastructure Building with local CoreFx build: error NU1102: Unable to find package Microsoft.NETCore.App "Trying to make it work for few hours. How to make my console app to use my local build of CoreFX? Why it can't find my local nuget package (see below)? Location is correct. Build it Using [dogfooding man](https://github.com/dotnet/corefx/blob/master/Documentation/project-docs/dogfooding.md) It fails with this: ``` dotnet restore Restoring packages for C:\Users\XXXX\dev\artkpv.corefx\temp\System.RegularExpressions.Performance.Tests\System.RegularExpressions.Performance.Tests.csproj... C:\Users\XXXX\dev\artkpv.corefx\temp\System.RegularExpressions.Performance.Tests\System.RegularExpressions.Performance.Tests.csproj : error NU1102: Unable to find package Microsoft.NETCore.App with version (>= 2.1.0-preview2-26131-06) C:\Users\XXXX\dev\artkpv.corefx\temp\System.RegularExpressions.Performance.Tests\System.RegularExpressions.Performance.Tests.csproj : error NU1102: - Found 23 version(s) in nuget.org [ Nearest version: 2.0.5 ] C:\Users\XXXX\dev\artkpv.corefx\temp\System.RegularExpressions.Performance.Tests\System.RegularExpressions.Performance.Tests.csproj : error NU1102: - Found 0 version(s) in local coreclr C:\Users\XXXX\dev\artkpv.corefx\temp\System.RegularExpressions.Performance.Tests\System.RegularExpressions.Performance.Tests.csproj : error NU1102: - Found 0 version(s) in Microsoft Visual Studio Offline Packages Restore failed in 312.99 ms for C:\Users\XXXX\dev\artkpv.corefx\temp\System.RegularExpressions.Performance.Tests\System.RegularExpressions.Performance.Tests.csproj. ``` In `.csproj`: ``` <Project Sdk=""Microsoft.NET.Sdk""> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>netcoreapp2.1</TargetFramework> <RuntimeFrameworkVersion>2.1.0-preview2-26131-06</RuntimeFrameworkVersion> <!-- modify build in this line --> <RuntimeIdentifier>win10-x64</RuntimeIdentifier> <!-- make self-contained --> <PackageConflictPreferredPackages>Microsoft.Private.CoreFx.NETCoreApp;runtime.win10-x64.Microsoft.Private.CoreFx.NETCoreApp;$(PackageConflictPreferredPackages)</PackageConflictPreferredPackages> </PropertyGroup> <ItemGroup> <PackageReference Include=""Microsoft.Private.CoreFx.NETCoreApp"" Version=""4.5.0-preview2-26227-0"" /> <PackageReference Include=""benchmarkdotnet"" Version=""0.10.12"" /> </ItemGroup> </Project> ``` ``` > dotnet --info .NET Command Line Tools (2.1.300-preview2-008042) Product Information: Version: 2.1.300-preview2-008042 Commit SHA-1 hash: 03f3a93c92 Runtime Environment: OS Name: Windows OS Version: 10.0.16299 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\2.1.300-preview2-008042\ Microsoft .NET Core Shared Framework Host Version : 2.1.0-preview2-26131-06 Build : b13a0d5c331f374afd35ded57b9a4b4ab128864c ``` " 26787 area-System.Text "Regex conditional groups are broken if no ""else"" expression is given" "#### Scenario: Match match = Regex.Match(""abc"", ""(?(?=x)bx)""); Console.WriteLine(""Success: {0}"", match.Success); Console.WriteLine(""Value: \""{0}\"""", match.Value); Console.WriteLine(""Index: {0}"", match.Index); #### Output: Success: True Value: """" Index: 1 #### Expected result: I don't know. If leaving out the ""else"" expression isn't supported, it should throw an exception. Otherwise, matching anywhere seems the most reasonable option. In any case, if the condition fails, the result should not depend on the contents of the ""if"" expression. #### Additional notes: https://stackoverflow.com/q/48574288/785745" 26789 area-System.Net More DNS tests failing on macOS I've seen these failures now in a good number of PRs: DnsObsoleteGetHostByName_EmptyString_ReturnsHostName ``` Unhandled Exception of Type System.Net.Internals.SocketExceptionFactory+ExtendedSocketException Message : System.Net.Internals.SocketExceptionFactory+ExtendedSocketException : Device not configured Stack Trace : at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.NameResolution/src/System/Net/DNS.cs:line 83 at System.Net.Dns.GetHostByName(String hostName) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.NameResolution/src/System/Net/DNS.cs:line 41 at System.Net.NameResolution.Tests.GetHostByNameTest.DnsObsoleteGetHostByName_EmptyString_ReturnsHostName() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.NameResolution/tests/FunctionalTests/GetHostByNameTest.cs:line 108 ``` Dns_GetHostEntryAsync_HostString_Ok ``` Unhandled Exception of Type System.Net.Internals.SocketExceptionFactory+ExtendedSocketException Message : System.Net.Internals.SocketExceptionFactory+ExtendedSocketException : Device not configured Stack Trace : at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.NameResolution/src/System/Net/DNS.cs:line 83 at System.Net.Dns.ResolveCallback(Object context) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.NameResolution/src/System/Net/DNS.cs:line 290 --- End of stack trace from previous location where exception was thrown --- at System.Net.Dns.HostResolutionEndHelper(IAsyncResult asyncResult) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.NameResolution/src/System/Net/DNS.cs:line 420 at System.Net.Dns.EndGetHostEntry(IAsyncResult asyncResult) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.NameResolution/src/System/Net/DNS.cs:line 562 at System.Net.Dns.<>c.<GetHostEntryAsync>b__27_1(IAsyncResult asyncResult) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.NameResolution/src/System/Net/DNS.cs:line 652 at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization) in /Users/buildagent/agent/_work/382/s/src/mscorlib/src/System/Threading/Tasks/FutureFactory.cs:line 529 --- End of stack trace from previous location where exception was thrown --- at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks, Int32 millisecondsTimeout) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs:line 49 at System.Net.NameResolution.Tests.GetHostEntryTest.TestGetHostEntryAsync(Func`1 getHostEntryFunc) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.NameResolution/tests/FunctionalTests/GetHostEntryTest.cs:line 41 --- End of stack trace from previous location where exception was thrown --- ``` Dns_GetHostEntry_HostString_Ok ``` Unhandled Exception of Type System.Net.Internals.SocketExceptionFactory+ExtendedSocketException Message : System.Net.Internals.SocketExceptionFactory+ExtendedSocketException : Device not configured Stack Trace : at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.NameResolution/src/System/Net/DNS.cs:line 83 at System.Net.Dns.GetHostEntry(String hostNameOrAddress) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.NameResolution/src/System/Net/DNS.cs:line 475 at System.Net.NameResolution.Tests.GetHostEntryTest.<>c__DisplayClass1_0.<Dns_GetHostEntry_HostString_Ok>b__0() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.NameResolution/tests/FunctionalTests/GetHostEntryTest.cs:line 26 at System.Net.NameResolution.Tests.GetHostEntryTest.TestGetHostEntryAsync(Func`1 getHostEntryFunc) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.NameResolution/tests/FunctionalTests/GetHostEntryTest.cs:line 38 --- End of stack trace from previous location where exception was thrown --- ``` 26792 area-Infrastructure [Unix] Passing extra CMake args Added support for compiler and linker additional arguments in CMake. By using CLR_ADDITIONAL_LINKER_FLAGS and CLR_ADDITIONAL_COMPILER_OPTIONS it's possible to pass toolchain options without changing build scripts. Part of #26508. @janvorli please take a look. Say if more detailed description is needed. 26793 area-System.Net [Test failures] System.Net.Http.Functional.Tests.ManagedHandler_HttpClientHandlerTest / PostAsync_ThrowFromContentCopy_RequestFails It seems that the managed handler throws a different exception than the other ones. I'm looking into it. I'm going to submit a PR to deal with the test failures, but, want to confirm the desired behavior here. The exception throw by the managed handler (HttpRequestException) seems more appropriate then the one throw by the other handlers, and it has the proper InnerException (the one throw directly by the other handlers). Anyway, let's confirm that this is the desired behavior. /cc @geoffkizer @stephentoub @karelz 26794 area-System.Net Fix test PostAsync_ThrowFromContentCopy_RequestFails Fixes #26793 This fixes the test issues mentioned in #26793 26795 area-System.Threading Add Debug Views to the Channel 26796 area-System.Security Improve performance of Rfc2898DeriveBytes See https://github.com/aspnet/DataProtection/issues/272 for full context. ASP.NET has its own implementation of RFC2898 because it needs top-of-the-line performance for password hashing in order to have acceptable latency for login scenarios. If we bring these performance improvements to the framework's implementation of these APIs, ASP.NET can remove its own implementation and rely on the standard classes. 26797 area-System.IO [DirectoryInfo]::GetFiles()/GetDirectories() not working correctly on macOS "Based on default macOS case-insensitive filesystem Repro using PSCore6: ```powershell md Test $d = [System.IO.DirectoryInfo]::new($pwd) $d.GetDirectories(""test"") ``` Expected: DirectoryInfo for ""Test"" folder Actual: null This works as expected on Windows." 26798 area-System.Net Enable HttpProtocolTest status line test cases Closes: #24713 26799 area-System.Data Span-based way to read binary data in ADO.NET DbDataReader includes a method which allow reading sliced binary data from the database: [GetBytes()](https://msdn.microsoft.com/en-us/library/system.data.common.dbdatareader.getbytes(v=vs.110).aspx). With Span coming, it makes sense to add a similar method which simply return a ReadOnlySpan, that can slice the provider's internal buffer - this would provide a zero-copy way to get binary data out. A default implementation could be provided in DbDataReader which internally allocates the byte array and returns a ReadOnlySpan to it, but providers could override it to provide an efficient implementation. Note that the same isn't possible for char-based data ([GetChars()](https://msdn.microsoft.com/en-us/library/system.data.common.dbdatareader.getchars(v=vs.110).aspx)) because text decoding needs to be done someone. 26800 area-System.Data Update TVPTest error comparisons to use error codes instead of full exception messages. Exception messages can be slightly different between different versions of SQL Server. 26801 area-System.Linq Feature Request: .ToDictionary overload for IEnumerable<KeyValuePair<IKey,IValue>> returning Dictionary<IKey,IValue> Often it would be useful to be able to create a Dictionary<IKey, IValue>from an IEnumerable<KeyValuePair<IKey, IValue>>. With that, it would be easier to initialize Dictionaries from LINQ Expressions. Furthermore, it would make the code for initializing Dictionaries far more readable. The Method would be defined as below: ```c# public static Dictionary<TKey, TValue> ToDictionary<TKey, TValue>( this IEnumerable<KeyValuePair<TKey, TValue>> src) { return src.ToDictionary(keyValuePair => keyValuePair.Key, keyValuePair => keyValuePair.Value); } ``` or ```c# public static Dictionary<TKey, TValue> ToDictionary<TKey, TValue>( this IEnumerable<KeyValuePair<TKey, TValue>> src) { return new Dictionary<TKey, TValue>(src); } ``` (Credit to @benaadams) [EDIT] Add C# syntax highlighting by @karelz 26802 area-Infrastructure tracking UWP test leg disable/re-enable for Vector<T> Due to timing issues with consuming https://github.com/dotnet/coreclr/pull/16133 across coreclr / corert / .NET Native, we'll need to temporarily disable the UWP test leg in the corefx repo. Once .NET Native is updated to react to the Vector<T> typeforward, we'll re-enable the test leg - sometime next week Feb 5 - Feb9. cc: @eerhardt @nattress 26803 area-System.Net "[Fedora.27] Test failures: System.Net.Http.Functional / * - unsupported libcurl (7.55.1) and its SSL backend (\""OpenSSL/1.1.0g\"")" "Test pass on Fedora are failing for certificate and SSL: ``` Assert.Throws() Failure Expected: typeof(System.Net.Http.HttpRequestException) Actual: typeof(System.PlatformNotSupportedException): The handler does not support custom handling of certificates with this combination of libcurl (7.55.1) and its SSL backend (\""OpenSSL/1.1.0g\""). ``` Affected tests: 23 ## History of failures Day | Build | Details -- | -- | -- 2/2 | 20180202.05 | 23x - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180202.05/workItem/System.Net.Http.Functional.Tests) 2/2 | e328a11841e2c7cc34d6cba6925aaadaa6549721 | 2x - [link](https://mc.dot.net/#/user/pjanotti/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/e328a11841e2c7cc34d6cba6925aaadaa6549721/workItem/System.Net.Http.Functional.Tests) 2/3 | 20180203.01 | 23x - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180203.01/workItem/System.Net.Http.Functional.Tests) 2/3 | 20180203.03 | 23x - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180203.03/workItem/System.Net.Http.Functional.Tests) " 26806 area-System.IO File enumeration extensibility This change implements the new public API for file enumeration. See https://github.com/dotnet/designs/blob/master/accepted/file-enumeration.md. This is built off of the existing internal Windows implementation. The initial Unix implementation is _not_ optimized. #26715 tracks getting the performance up to snuff. The current implementation doesn't allow for skipping ReadOnly via the options as that will come more naturally via the pending performance refactoring. The Unix implementation is now aligned with the Windows implementation more closely. Matching will follow the Windows/DOS semantics much more closely for better cross platform search results. This change also introduces a simple match option for both platforms that removes all of the weird corner cases and treats `*` and `?` as 0 or more and 1 no matter where they are in the pattern and what they are next to. All file enumeration goes through this new model and as such existing tests hit it. I've added a few more and I'll be adding more as I work on the Unix optimization. This PR has two commits if you want to look at the Unix changes independently (there are, however, some overall fixes in that change as well). cc: @danmosemsft, @terrajobst, @KrzysztofCwalina 26807 area-System.Memory Changing Span to return default on null instead of throwing. Related to https://github.com/dotnet/corefx/issues/24409 which was fixed here https://github.com/dotnet/corefx/pull/25257. Depends on PR in coreclr to go through first: https://github.com/dotnet/coreclr/pull/16186 TODO: Add tests for when array/string are null but start/length are non-zero. There is an inconsistency between the implicit conversion APIs and the constructors/extension methods where one returns default Span/Memory while the other throws when a null array/string is passed in. This change fixes the inconsistency. We no longer throw when null input is passed in. **Before:** ```C# new ReadOnlySpan<char>(default(char[])); // throws (ReadOnlySpan<char>)default(char[]); // empty (ReadOnlySpan<char>)default(string); // empty ``` **Now:** ```C# new ReadOnlySpan<char>(default(char[])); // empty (ReadOnlySpan<char>)default(char[]); // empty (ReadOnlySpan<char>)default(string); // empty ``` cc @jkotas, @KrzysztofCwalina, @VSadov, @stephentoub, @JeremyKuhne 26809 area-System.Data Fix issues with test tables in SqlClient tests 2 major changes here: - Changes WarningBeforeRowsTest so that it checks for a fulltext index before using queries with the contains() function. - Change temp table creation in AdapterTest so that the new table won't have identity columns. This is achieved with a dummy union in the SELECT INTO query. I also changed some try-finally scoping in AdapterTest so that tests won't try to drop a temp table if the table creation itself threw an exception. 26810 area-System.Net System.Net.Sockets.Socket.DoConnect failed with Operation timed out in the CI https://mc.dot.net/#/user/tarekgh/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/f5e2e814d3f584d8578937fe41a907c507742f7e/workItem/System.Net.Sockets.Tests/analysis/xunit/System.Net.Sockets.Tests.SendPacketsAsync~2FSendPacketsElement_FileZeroCount_Success(type:%20APM) ``` System.Net.Internals.SocketExceptionFactory+ExtendedSocketException : Operation timed out [::1]:50296 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.Sockets/src/System/Net/Sockets/Socket.cs:line 4376 at System.Net.Sockets.Socket.Connect(EndPoint remoteEP) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.Sockets/src/System/Net/Sockets/Socket.cs:line 824 at System.Net.Sockets.Tests.SendPacketsAsync.SendPackets(SocketImplementationType type, SendPacketsElement[] elements, SocketError expectedResut, Int32 bytesExpected) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.Sockets/tests/FunctionalTests/SendPacketsAsync.cs:line 452 at System.Net.Sockets.Tests.SendPacketsAsync.SendPackets(SocketImplementationType type, SendPacketsElement element, Int32 bytesExpected) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.Sockets/tests/FunctionalTests/SendPacketsAsync.cs:line 433 at System.Net.Sockets.Tests.SendPacketsAsync.SendPacketsElement_FileZeroCount_Success(SocketImplementationType type) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.Sockets/tests/FunctionalTests/SendPacketsAsync.cs:line 343 ``` 26811 area-System.Net ManagedHandler currently doesn't distinguish ClientCertificateOptions.Manual/Automatic The setting is ignored. It shouldn't be. 26813 area-System.Net NetworkInterface.GetAllNetworkInterfaces() can't handle all interfaces on WSL It is hitting an assert while testing System.Net.Http for the `NetworkInterface.GetAllNetworkInterfaces()`. The issue is that one of the `AF_PACKET` enumerated by `getifaddrs` has an address large than the 8 bytes expected, so `memcpy_s` hits the assert: ``` System.Net.Http.Functional.Tests.ManagedHandler_HttpClientHandlerTest.GetAsync_IPv6LinkLocalAddressUri_Success [STARTING] dotnet: /home/pauloja/corefx/src/Native/Unix/Common/pal_safecrt.h:102: errno_t memcpy_s(void *, size_t, const void *, size_t): Assertion `sizeInBytes >= count' failed. ``` Running a quick code calling `getifaddrs` I can see that one of the interfaces, eth4, has size 16 for `sll_halen`. ``` eth0 AF_PACKET (17) sll_halen = 6 eth1 AF_PACKET (17) sll_halen = 6 eth2 AF_PACKET (17) sll_halen = 6 eth3 AF_PACKET (17) sll_halen = 6 lo AF_PACKET (17) sll_halen = 6 wifi0 AF_PACKET (17) sll_halen = 6 eth4 AF_PACKET (17) sll_halen = 16 eth0 AF_INET (2) eth0 AF_INET6 (10) eth1 AF_INET (2) eth1 AF_INET6 (10) eth2 AF_INET (2) eth2 AF_INET6 (10) eth3 AF_INET (2) eth3 AF_INET6 (10) lo AF_INET (2) lo AF_INET6 (10) wifi0 AF_INET (2) wifi0 AF_INET6 (10) eth4 AF_INET6 (10) ``` 26815 area-Serialization Microsoft.XmlSerializer.Generator - generate the serializer for a subset of types in the assembly "Sgen has the parameter /type to add a list of types to be included in the serializer. As far as I can see there is no built in way to do that for Microsoft.XmlSerializer.Generator. My workaround is to define a property in my project `<SgenTypes>""Type1;Type2""</SgenTypes>` and to change the exec line in the targets file to `<Exec Command=""dotnet Microsoft.XmlSerializer.Generator $(IntermediateOutputPath)$(AssemblyName)$(TargetExt) /force /quiet /type:$(SgenTypes)"" ContinueOnError=""true""/> ` Is there a better way to do this? If there is then it would be nice if it would be included in the documentation." 26816 area-System.Collections Remove special-cases tests TKey string Dictionary<TKey,TValue> "Contributes #26033 @maryamariyan is there other places where remove? @jkotas wrote ""Wait for the matching corefx change to go through as well."" Is there a way to understand when CI will use new CoreCLR? " 26817 area-System.IO Always use MemoryFileStreamCompletionSource in FileStream Today it looks like the code in FileStream is unwrapping the underlying `Memory<byte>` to a `byte[]` when it does an async Read or Write operation on windows. If you pass a pre-pinned buffer that happens to be backed by an array then you'll lose the benefits as the PreAllocatedOverlapped will pin the buffer again. https://github.com/dotnet/corefx/blob/103639b6ff5aa6ab6097f70732530e411817f09b/src/Common/src/CoreLib/System/IO/FileStream.Windows.cs#L851-L853 https://github.com/dotnet/corefx/blob/103639b6ff5aa6ab6097f70732530e411817f09b/src/Common/src/CoreLib/System/IO/FileStream.Windows.cs#L1072-L1074 I might be missing something, What was the reasoning behind this implementation? /cc @stephentoub 26818 area-Serialization Add generic methods to SerializationInfo class Hi, ## Proposal Please add a couple of generic methods to the [`SerializationInfo`](https://github.com/dotnet/coreclr/blob/master/src/mscorlib/src/System/Runtime/Serialization/SerializationInfo.cs#L441) class. ## Added API: ```c# public class SerializationInfo { + public void AddValue<T>(string name, T value); + public T GetValue<T>(string name); } ``` ## Motive Currently, when we want to use `SerializationInfo` in a serialization context (binary in my scenario), I have to convert all the fields back and forth. Here's an example of how ugly this can get. ```c# protected CategoryGroupDefinition(SerializationInfo info, StreamingContext context) : this( (Guid)info.GetValue(nameof(Id), typeof(Guid)), info.GetString(nameof(Title)), (CategoryGroupDefinition)info.GetValue(nameof(Parent), typeof(CategoryGroupDefinition)), (GroupType)info.GetValue(nameof(Type), typeof(GroupType)), info.GetBoolean(nameof(IsMandatory)), (CategoryDefinition[])info.GetValue(nameof(Children), typeof(CategoryDefinition[]))) { } ``` Adding some generic methods will shorten the above to: ```c# protected CategoryGroupDefinition(SerializationInfo info, StreamingContext context) : this( info.GetValue<Guid>(nameof(Id)), info.GetString(nameof(Title)), info.GetValue<CategoryGroupDefinition>(nameof(Parent)), info.GetValue<GroupType>(nameof(Type)), info.GetBoolean(nameof(IsMandatory)), info.GetValue<CategoryDefinition[]>(nameof(Children))) { } ``` 26821 area-System.Collections [Regression] [x64 Windows] Test failure: System.Collections.Immutable.Tests.ImmutableListTest / IndexOf & LastIndexOf ## Type of failures Affected OS: Win7 & Win8.1 & Win10 & Win10.Core & Win10.Nano - only x64 (x86 runs are fine) ``` Assert.Equal() Failure Expected: 2 Actual: -1 at System.Collections.Immutable.Tests.IndexOfTests.IndexOfTest[TCollection](Func`2 factory, Func`3 indexOfItem, Func`4 indexOfItemIndex, Func`5 indexOfItemIndexCount, Func`6 indexOfItemIndexCountEQ) in E:\A\_work\484\s\corefx\src\System.Collections.Immutable\tests\IndexOfTests.cs:line 45 at System.Collections.Immutable.Tests.ImmutableListTest.IndexOf() in E:\A\_work\484\s\corefx\src\System.Collections.Immutable\tests\ImmutableListTest.cs:line 505 ``` ## History of failures Day | Build | Details -- | -- | -- 2/3 | 20180203.03 | 10x failures - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180203.03/workItem/System.Collections.Immutable.Tests) 2/4 | 20180204.01 | 10x failures - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180204.01/workItem/System.Collections.Immutable.Tests) 26826 area-System.Runtime Add Convert.ToString(sbyte value, int toBase) And Allow _ separator "1. Why there is no Convert.ToString(sbyte value, int toBase) Overloaded method? When I use: ``` sbyte n = -1; var x = Convert.ToString(n, 2); Console.WriteLine(x); ``` the output is ""1111111111111111"" because the ToString casts n to short! The strange thing is that Convert.ToSByte has an overload for doing the opposite task! `sbyte n = Convert.ToSByte(""11111111"", 2);` But the parser fails to deal with the _ separator: ` sbyte n = Convert.ToSByte(""1111_1111"", 2);` I think you should update the binary parser to accept this separator. Edit: Maybe Convert class can have a new ToNumSystem(value, base) Method. It can have overloads to deal with deferent numeric data types, including SByte, BigInteger and Vectorts. Vectors can be converted to array containing string representations. May be a new FromNumSystem<T>(string, base) is useful too. " 26827 area-System.Text Regex perf test A crude start at regex perf tests. The patterns and inputs are a subset of those in RegexGroupTests.Groups_Basic_TestData -- I excluded a small number that were unusually slow. All patterns are valid patterns. I initially started by measuring each pattern separately but this produces too much data (and since each should take 100ms-1sec to measure, takes a long time). Rather than cherry pick a few of the patterns, I chose to start the tests with a single test that gets broad coverage, until we break tests out further. Execution time is ~15 sec and produces a table like this, with matching CSV. ``` System.Text.RegularExpressions.Performance.Tests.dll | Metric | Unit | Iterations | Average | STDEV.S | Min | Max :----------------------------------------------------- |:-------------- |:-----:|:----------:| ----------:| ---------:| ----------:| ----------: System.Text.RegularExpressions.Tests.Perf_Regex.Match | Duration | msec | 40 | 255.747 | 8.223 | 245.721 | 274.721 System.Text.RegularExpressions.Tests.Perf_Regex.Match | GC Allocations | bytes | 40 | 1.990E+008 | 43711.569 | 1.990E+008 | 1.992E+008 ``` 26828 area-System.Text Fix regex scanner for `\c[` Fix https://github.com/dotnet/corefx/issues/26501 In `(cat)(\c[*)(dog)` the `\c[` should match the `[` control character ie `\u001b`. However it was rejecting the pattern because it does a pre-scan for capturing groups. In this phase it assumes that `\` always escaped a single character, so it treats the `[` as the start of a character class, which is ultimately never closed. The fix is to call into the real scanner for escape characters. It is necessary to pass a flag indicating we are scanning. This is to avoid validating that backreferences refer to valid capturing groups (these are not all set up until the pre-scanning is complete) and also to avoid allocating objects that aren't needed in this phase. We already do something very similar with ScanCharClass. Ideally there would not be a pre-scan but I imagine that would be a substantial change. This causes more code to run during the pre-scan when a backslash is encountered. To verify this does not impact perf I used the perf test in #26827 ### Before System.Text.RegularExpressions.Performance.Tests.dll | Metric | Unit | Iterations | Average | STDEV.S | Min | Max --- | --- | --- | --- | --- | --- | --- | --- System.Text.RegularExpressions.Tests.Perf_Regex.Match | Duration | msec | 40 | 254.4937651 | 10.61602132 | 242.199422 | 292.2573603 System.Text.RegularExpressions.Tests.Perf_Regex.Match | GC Allocations | bytes | 40 | 199009143.4 | 51155.77152 | 198894312 | 199115104 --- | --- | --- | --- | --- | --- | --- | --- System.Text.RegularExpressions.Tests.Perf_Regex.Match | Duration | msec | 40 | 254.5757042 | 9.581244315 | 240.640903 | 280.4672477 System.Text.RegularExpressions.Tests.Perf_Regex.Match | GC Allocations | bytes | 40 | 199014283.6 | 53740.21012 | 198891600 | 199147112 ### After this and #26543 System.Text.RegularExpressions.Performance.Tests.dll | Metric | Unit | Iterations | Average | STDEV.S | Min | Max --- | --- | --- | --- | --- | --- | --- | --- System.Text.RegularExpressions.Tests.Perf_Regex.Match | Duration | msec | 40 | 255.7465251 | 8.22304857 | 245.721344 | 274.720744 System.Text.RegularExpressions.Tests.Perf_Regex.Match | GC Allocations | bytes | 40 | 199048536.2 | 43711.56892 | 198975760 | 199152184 --- | --- | --- | --- | --- | --- | --- | --- System.Text.RegularExpressions.Tests.Perf_Regex.Match | Duration | msec | 40 | 252.0985474 | 6.940020203 | 241.216865 | 268.1445129 System.Text.RegularExpressions.Tests.Perf_Regex.Match | GC Allocations | bytes | 40 | 199049236 | 42700.49669 | 198976144 | 199151832 Elapsed difference is within noise level and allocations are negligibly increased. 26830 area-System.Net Incorrectly closed websockets are throwing unobserved task exceptions 2 "This issue is very similar to https://github.com/dotnet/corefx/issues/24002 but with entirely different stacktrace. Basically, I have a simple code: ```c# try { HttpListenerWebSocketContext webSocketContext = await context.AcceptWebSocketAsync(null).ConfigureAwait(false); while (webSocketContext.WebSocket.State == WebSocketState.Open) { WebSocketReceiveResult result = await webSocketContext.WebSocket.ReceiveAsync(new byte[0], CancellationToken.None).ConfigureAwait(false); if (result.MessageType != WebSocketMessageType.Close) { await webSocketContext.WebSocket.CloseAsync(WebSocketCloseStatus.InvalidMessageType, ""You're not supposed to be sending any message but Close!"", CancellationToken.None); break; } await webSocketContext.WebSocket.CloseAsync(WebSocketCloseStatus.NormalClosure, string.Empty, CancellationToken.None).ConfigureAwait(false); break; } } catch (Exception e) { Console.WriteLine(e); } ``` Now, this code works totally fine in normal operation. However, there seems to be some kind of race condition if remote client sends `close` frame, but won't wait for connection being fully closed before abandoning it: ``` System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. (Es wurde versucht, auf eine nicht vorhandene Netzwerkverbindung zuzugreifen) ---> System.Net.HttpListenerException: Es wurde versucht, auf eine nicht vorhandene Netzwerkverbindung zuzugreifen (translation: An attempt was made to access a non-existent network connection) at System.Net.WebSockets.WebSocketHttpListenerDuplexStream.WriteAsyncFast(HttpListenerAsyncEventArgs eventArgs) at System.Net.WebSockets.WebSocketHttpListenerDuplexStream.<CloseNetworkConnectionAsync>d__50.MoveNext() --- End of inner exception stack trace --- ---> (Inner Exception #0) System.Net.HttpListenerException (0x80004005): Es wurde versucht, auf eine nicht vorhandene Netzwerkverbindung zuzugreifen (translation: An attempt was made to access a non-existent network connection) at System.Net.WebSockets.WebSocketHttpListenerDuplexStream.WriteAsyncFast(HttpListenerAsyncEventArgs eventArgs) at System.Net.WebSockets.WebSocketHttpListenerDuplexStream.<CloseNetworkConnectionAsync>d__50.MoveNext()<--- ``` Now, the problem is that this is task exception being thrown deep in corefx code, and it's unobserved, so it gets thrown back on `TaskScheduler.UnobservedTaskException` which I use for debugging (and catching incidents like this one). I believe this exception should be observed in .NET Core code, in similar way like done in #24002. I didn't find any way to solve this issue from consumer perspective, since the exception is thrown entirely out of my program's stacktrace, so it's uncatchable (as you can see from my code sample, and the stacktrace itself). Thank you in advance for looking into this. I'm sorry if this issue was already reported, I couldn't find anything related despite of searching, and my original issue #24002 doesn't seem to cover this scenario (unless I'm wrong, please correct me if I am). Cheers! [EDIT] Add C# syntax highlighting by @karelz" 26831 area-System.Data Cancellation not working in specific ADO.NET scenario A week ago someone on Stack Overflow reported an [issue with ADO.NET where cancelling a query was not possible](https://stackoverflow.com/questions/48461567/canceling-query-with-while-loop-hangs-forever) in a specific scenario. From the answer to that question it seems that no attention signal is being sent to the server. Although cancelling a SqlCommand is not expected to be instantaneous it should always send an attention to the server. SSMS manages to do that. I thought I'd report this issue here to bring it to attention. 26833 area-System.Memory Changing Span/Memory to return default on null instead of throwing Follow up on https://github.com/dotnet/corefx/pull/26807 : - TODO: Add tests for when array/string are null but start/length are non-zero. - Change Memory constructors. I had to disable tests for them in Update CoreCLR PR: https://github.com/dotnet/corefx/commit/87fd2766fdb3920b307b873c1cff824bebd17f3b 26834 area-System.Numerics Update System.Numerics.Vectors packaging for Vector<T> changes This part does not seem to right anymore: https://github.com/dotnet/corefx/blob/master/src/System.Numerics.Vectors/pkg/System.Numerics.Vectors.pkgproj#L25 26835 area-System.Net Disable Net.Http tests failing in Fedora.27 Disable tests that are failing in #26803 26836 area-System.IO Write enumeration perf tests Follow up to #26715. 26837 area-System.Net Re-enable some Socket tests @karelz I finally found the time to fix this pending issues from pull request 25544 26838 area-System.IO Create OOB FileSystem package Include new enumeration functionality under `Microsoft.IO.FileSystem` assembly/namespace. Follow up after 2.1 implementation is complete. See #25873. Ideally can create a .NET Standard assembly here. Will have to reference System.Memory. 26839 area-System.Net Add Connection{Idle}Timeouts to ManagedHandler We can agree on the final name(s) (and even if we want these exposed) when going through API reviews. For now, I chose what I think are easy to understand names: - ConnectionTimeout: how long a connection is allowed to be reused before it's no longer usable, defaults to infinite - ConnectionIdleTimeout: how long a connection can sit idle in the pool before it's no longer usable, defaults to 2 minutes (that value was hardcoded before this change) Fixes https://github.com/dotnet/corefx/issues/26331 cc: @geoffkizer, @davidsh 26840 area-System.Net PlatformNotSupportedException with TcpClient.ConnectAsync "I'm getting `PlatformNotSupportedException` on Linux when calling `TcpClient.ConnectAsync(host, port)`, with a rather unhelpful message: `Sockets on this platform are invalid for use after a failed connection attempt` (I'm not trying to reuse a socket) This is only happening under specific circumstances: 1. `host` is a hostname, such as ""localhost"", AND 2. KeepAlive is enabled using `tcpClient.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive, true)` Everything works fine if I change either one of these things. I did a search and came across issues #5829 and #8768, which led to PR #16373 - so it seems like you are supposed to be able to connect using a hostname, it's just not working when keep alives are enabled." 26843 area-System.Net Low performance when set GZip|Deflate to HttpClientHandler.AutomaticDecompression at Win7 x64 "when run this code at win7x64 core20,it will take 11s but 4s only at win10 x64 core20,if without decompression,they are both 4s at core20 or .net framework. ```c# static async void RunIUserApi(int loop = 1000) { var watch = new Stopwatch(); watch.Start(); using (var client = HttpApiClient.Create<IUserApi>()) { var decompression = DecompressionMethods.Deflate | DecompressionMethods.GZip; client.ApiConfig.HttpClient.Handler.AutomaticDecompression = decompression; for (var i = 0; i < loop; i++) { await Program.RunApisAsync(client); } } watch.Stop(); Console.WriteLine($""总共耗时:{watch.Elapsed}""); } ```" 26844 area-System.Data Performance issues using SQLClient "i use system.data.sqlclient in my aps.net core project,but why the first time i request it's very slow,after request it's faster.about few minutes later the request change slow again。 ``` using (IDbConnection conn = DBFactory.GetDbConnection(serviceInfo.DBType)) { conn.ConnectionString = serviceInfo.ConnectionString; conn.Open(); IEnumerable<dynamic> ret = await conn.QueryAsync(serviceInfo.CommandText, _paramsValue); var response = new { error_code = 0, error_desc = """", data = ret }; return JsonConvert.SerializeObject(response); } ``` first request 4479ms second request 269ms i use Dapper,but when i remove it,the test result is same. i used Connection Pool ``` Server=xxxx;Database=xxxx;UID=xxx;PWD=xxxx;Max Pool Size=50;Min Pool Size=10; ```" 26845 area-Meta DataFrame Discussion "With work underway on `Tensor`, and the new perf optimizations available via `Span`, I think it's time the .NET team seriously considered adding a DataFrame type. Working with large amounts of data has become critical in many applications these days, and is the reason libraries like Pandas for Python have been so successful. It's time to bring similar capabilities to .NET, and it needs to start with the framework itself adding a DataFrame type. There **are** DataFrame libraries out there available for .NET, but the problem is that they each have their own implementations of DataFrames, that are minimally compatible with the BCL or any of the other libraries out there. From my experience, support for many of these various libraries is also pretty weak. I think the BCL team implementing its own DataFrame is the first, most important step to improving the state of working with data in .NET. All we have right now is `DataTable`, a powerful but ancient type that is not well optimized for many scenarios and which I've variously seen .NET team members refer to as ""legacy"". I'm creating this issue to garner opinions on the topic. I don't have a specific API in mind to propose at this time, as gauging interest first is probably more important. Let's make .NET as great for data analysis as any other platform." 26846 area-System.Net Memory fragmentation as a result of using SslStream ? I'm tracking high memory usage in a server application over a period of about 12 hours or so. This is .Net Core 2.0.5 app running on Windows Server 2016. Interesting parts from the memory dump: ``` 000001bdb64d4b50 1590529 1762729490 Free Total 34634797 objects Fragmented blocks larger than 0.5 MB: Addr Size Followed by 000001be1155bb58 1.7MB 000001be11711418 System.Byte[] 000001be117126e8 1.5MB 000001be1189d5a0 System.Byte[] 000001be118a28a0 1.2MB 000001be119d18f0 System.Byte[] // total of 118 of these ``` I started to look at these, and found that we have the following distribution: 118 total fragmenting objects, all of them `byte[]` with the following distribution: * 96 buffers - size 3176 bytes * 16 buffers - size 72 bytes * 6 buffers - size (80, 88, 168, 8216, 16440, 65536) I dumped a few of the 3176 buffers, and they look like this:  This looks like it is a buffer holding a certificate. All communication with the application is done of over TLS, which means using SslStream. ``` 00007ffeff694160 86 6880 System.Net.Security.SslStream ``` The numbers don't match up exactly, but it does look like I have a lot of pinned instances like that. Runing `!gcroot` shows just a pinned handle and an async pinned handle. 26847 area-System.Data System.Data.SQLClient does not pass Store certification Hello, I have a Store-App that consumes System.Data.SQlClient. it works so far, but when I want to upload it to the store, the Windows App Cert Kit produced Errors: Windows Security check: Error in Datei C:\Program Files\windowsapps\martinstein.sql-dbdesigner_1.1.2.0_x64__9g9f70q8w59qy\sni.dll at AppContainerCheck. Test of supported APIs: API _mbschr in api-ms-win-crt-multibyte-l1-1-0.dll is not supported for this App-Type. sni.dll calls this API ◦ API _mbsnbicmp_l in api-ms-win-crt-multibytel1- 1-0.dll is not supported for this App-Type. sni.dll calls this API ◦ API _mbsspn in api-ms-win-crt-multibyte-l1- 1-0.dll is not supported for this App-Type. sni.dll calls this API ◦ API IsTokenRestricted in advapi32.dll ....... How can I fix this issues? I have opened a case at MS Support, but they don't feel responsible! Kind regards, Martin 26848 area-System.Net Error when using client certificate on .NET Core 2.0 "I need to connect with **REST API using client certificate**. I was able to do that on .NET Core 1.0, but now when I've migrated to **.NET Core 2.0 I'm getting this error:** > **The handler does not support client authentication certificates with this combination of libcurl (7.51.0) and its SSL backend (""NSS/3.28.4"")** Module ""System.Net.Http.CurlHandler+SslProvider"", line 28, col 0, in SetSslOptionsForUnsupportedBackend Void SetSslOptionsForUnsupportedBackend(EasyRequest, ClientCertificateProvider) Module ""System.Net.Http.CurlHandler+SslProvider"", line 196, col 0, in SetSslOptions Void SetSslOptions(EasyRequest, System.Net.Http.ClientCertificateOption) Module ""System.Net.Http.CurlHandler+EasyRequest"", line 208, col 0, in InitializeCurl **Code is deployed on Unix environment (AWS Lambda)**. I've posted this issue here as well: https://github.com/aws/aws-lambda-dotnet/issues/221 " 26849 area-System.Security RSAOpenSSL.SignHash/VerifyHash doesn't support padding mode RSASignaturePadding.Pss Hi, any plans to support `RSASignaturePadding.Pss`? I noticed its all forbidden on Linux (haven't checked on iOS), but works on Windows. OPC UA implements a new security policy which requires the PSS scheme. http://opcfoundation.org/UA/SecurityPolicy#Aes256_Sha256_RsaPss snip... ``` public override byte[] SignHash(byte[] hash, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) { ... if (padding != RSASignaturePadding.Pkcs1) throw PaddingModeNotSupported(); return SignHash(hash, hashAlgorithm); } ``` 26850 area-System.Net Modified Dns.GetHostAddressesAsync to be truly async PR for issue #8371 Modified Dns.GetHostAddressesAsync to use GetAddrInfoEx when supported. 26851 area-System.Runtime Fail to load type if the type has attribute to `ComImport` on Ubuntu/Mac/Docker container ### Description: Fail to load type if the type has attribute to `ComImport` on Ubuntu/Mac/Docker container. ### Repro Steps: - git clone https://github.com/smadala/samples - cd samples/ComImportIssue/consoleapp - dotnet run This works fine on windows. ### Expected Output: ``` Hello World! nslib.ClassFactory ``` ### Actual Output: ``` Hello World! Unhandled Exception: System.TypeLoadException: Could not load type 'nslib.ClassFactory' from assembly 'nslib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. at consoleapp.Program.Test1() at consoleapp.Program.Main(String[] args) in /home/satya/Downloads/TestIssue/consoleapp/Program.cs:line 15 ``` ### Background: In [vstest](https://github.com/Microsoft/vstest) we are using [`ComImport`](https://github.com/Microsoft/vstest/blob/347c59f73943921786bf9d5a7e42d2cf011ddd15/src/Microsoft.TestPlatform.ObjectModel/Navigation/NativeMethods.cs#L547 ) to PInvoke [msdia](https://msdn.microsoft.com/en-us/library/t6tay6cz.aspx) API to get line numbers of functions for netstandard1.4. This causing issue like https://github.com/Microsoft/testfx/issues/341. /cc: @mayankbansal018 26854 area-System.Net Disable GetAsync_RetryOnConnectionClosed_Success test for NETFX Related to https://github.com/dotnet/corefx/issues/26770 This is breaking CI 26855 area-System.Numerics The type 'Vector<T>' exists in both 'System.Numerics.Vectors' and 'System.Private.CoreLib' Opened on behalf of @jcagme Warnings: 1 Status Message: failed Build : Master - 20180205.05 (Product Build) Failing configurations: - Windows - uapaot-x86 - uapaot-x64 - uapaot-arm64 - uapaot-arm - uap-x86 - uap-x64 - uap-arm [Mission Control Build Info](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/build~2Fproduct~2F/build/20180205.05/workItem/Orchestration/analysis/external/Link) 26856 area-System.Net System.Net.NameResolution: remove old GetHostByName logic See comment here: https://github.com/dotnet/corefx/blob/a3e4e241c7b7c33750258082969287b9cf45d757/src/System.Net.NameResolution/src/System/Net/DNS.cs#L67 This comment is ancient. There should be no reason not to use GetAddrInfo today. We should remove the unnecessary fallback codepath here. 26857 area-Serialization Remove no warn tag in Microsoft.XmlSerializer.Geerator.csproj #23560 @huanwu @zhenlan @mconnew 26858 area-System.Net Disable some System.Net.Requests tests on Mono. These tests were already disabled on .NET Framework. 26859 area-System.Memory [WIP] Add Sort(...) extension methods for Span<T> "Implements https://github.com/dotnet/corefx/issues/15329 **WIP**: This is still very much a work-in-progress. Warts and all! :) #### Goals - Port `coreclr` `Array.Sort` code without major changes to the algorithm. That is, it is still Introspective Sort using median-of-three quick sort and heap sort. - Performance on par with `Array.Sort`. - Define performance tests that can be used for future new algorithms exploration. #### Non-Goals - No new algorithms such as say using histograms for byte or similar. - Generally no changes to the overall algorithm, the idea being for this PR to hopefully be accepted without too much controversy :) #### Array.Sort `Array.Sort` is implemented as both managed code and native code (for some primitives) in: - https://github.com/dotnet/coreclr/blob/master/src/mscorlib/src/System/Array.cs#L1593 (and following lines) - https://github.com/dotnet/coreclr/blob/master/src/mscorlib/src/System/Array.cs#L1860 (non-generic helper types start here) - https://github.com/dotnet/coreclr/blob/master/src/mscorlib/src/System/Collections/Generic/ArraySortHelper.cs (generic helper types - many variants) - https://github.com/dotnet/coreclr/blob/master/src/classlibnative/bcltype/arrayhelpers.cpp#L268 (native `TrySZSort`) - https://github.com/dotnet/coreclr/blob/master/src/classlibnative/bcltype/arrayhelpers.h#L128 (actual algorithm is in header) #### Base and Variant Differences This PR is based mainly on the native implementation and the generic implementation. In retrospective I believed the different variants of Array.Sort would sort identically, but they do not. The fact that I started out with the native implementation and focused on primitives and the specialization of these, appears to have been a mistake. The fact is `Array.Sort` can yield different sorting results depending on the variant used when also sorting items (also called values, since the items used for sorting are then keys). Note that the sort is still correct, it is just that equal keys can have different results for where the items are. I.e. here is an example that comes from a special test:  #### Minor Bug Fix Minor bug fix for introspective depth limit, see https://github.com/dotnet/coreclr/pull/16002 #### Code Structure Code is currently, probably temporary, structured into multiple files to allow for easier comparison of the different variants. Consolidated (most likely will be removed): - `SpanSortHelpers.KeysAndOrValues.cs` - This is my futile attempt to consolidate the different variants into a single code base. - I originally had a plan involving `ref struct` and value type generic arguments to ensure this would could be done with neglible performance impact but a few things were in the way: - https://github.com/dotnet/roslyn/issues/20226 - `ref struct`s can't contain `ref`s - Proposals to improve related to this: - https://github.com/dotnet/csharplang/issues/1147 - https://github.com/dotnet/csharplang/issues/1148 - And another proposal that would help: - https://github.com/dotnet/csharplang/issues/905 - I was hoping for this to allow for ""injecting"" values or not with minimal overhead... but probably a bit too C++ template like. - I even tried referencing [`System.Ben`](https://github.com/benaadams/System.Ben) to see if it helped ;) Current: - `SpanSortHelpers.Common.cs` - A few commonly used constants, types and methods e.g. `Swap`. - `SpanSortHelpers.Keys.cs` - Entry points and dispatch types for single span sort. - `SpanSortHelpers.Keys.IComparable.cs` - IComparable variant - `SpanSortHelpers.Keys.Specialized.cs` - Specialized switch for fast primitive versions and a little code sharing. - `SpanSortHelpers.Keys.TComparer.cs` - TComparer variant, used for specialized too. - `SpanSortHelpers.KeysValues.cs` - Entry points and dispatch types for two span sort (e.g. with items/values). - `SpanSortHelpers.KeysValues.IComparable.cs` - IComparable variant - `SpanSortHelpers.KeysValues.Specialized.cs` - Specialized switch for fast primitive versions and a little code sharing. - `SpanSortHelpers.KeysValues.TComparer.cs` - TComparer variant, used for specialized too. Primary development was done in my DotNetCross.Sorting repo: https://github.com/DotNetCross/Sorting/ This was to get a better feedback loop and to use BenchmarkDotNet for benchmark testing and disassembly. NOTE: I understand that in `corefx` we might want to consolidate this into a single file, but for now it is easier when comparing variants. Note also that the `coreclr` has more variants than currently in this PR, there is for example a variant for `Comparison<T>` in `coreclr`. #### Changes Many small changes have been made due to usings refs and Unsafe, but a couple notable changes are: - `Sort3` add a specific implementation for sorting three, used both for finding pivot and when sorting exactly 3 elements. - This has currently been changed to use `Sort2` three times like `coreclr` as otherwise, there would be differences for some same key cases. That I haven't had time to debug. - Why use a special `Sort3`? For expensive comparisons this can be a big improvement if keys are almost already sorted, since only 2 compares are needed instead of 3. - Remove unnecessary ifs on swaps, except for a few places where it is now explicit. - A few renames such as `Sort2` instead of `SwapIfGreater`. - Comparer based variant uses a specific `IDirectComparer` allowing for the kind of specialization for basic types that `coreclr` does in native code. This started out as just a `LessThan` method but the problem is then whether bogus comparers should yield the same result as `Array.Sort` so I changed this to have more methods. #### Benchmarks Since `Sort` is an in-place operation it is ""destructive"" and benchmarking is done a bit different than normal. The basic code for benchmarks is shown below, this uses https://github.com/dotnet/BenchmarkDotNet and was done in the https://github.com/DotNetCross/Sorting/ git repo. Porting these to the normal `corefx` performance tests is on the TODO list. The benchmarks use a `Filler` to pre-fill a `_filled` array with a pattern in slices of `Length`. Depending on the filler the full array will then be filled with either repeating patterns of `Length` or fill the entire array with a given pattern. This allows using this for testing sorts of different lengths, but measures the total time to do a number of sorts, so it includes the overhead of slicing and the loop. And allows testing different patterns/sequnces. The main point here is that this is used to compare **relatively** to the `Array.Sort`. ```csharp [GlobalSetup] public void GlobalSetup() { Filler.Fill(_filled, Length, _toValue); } [IterationSetup] public void IterationSetup() { Array.Copy(_filled, _work, _maxLength); } [Benchmark(Baseline = true)] public void ArraySort() { for (int i = 0; i <= _maxLength - Length; i += Length) { Array.Sort(_work, i, Length); } } [Benchmark] public void SpanSort() { for (int i = 0; i <= _maxLength - Length; i += Length) { new Span<TKey>(_work, i, Length).Sort(); } } ``` Results for this for specific commits will come in comments later. ##### Fillers As noted there are different fillers. Som fill the entire array not caring about the slice length. Others fill based on slice length. This is particularly important for **MedianOfThreeKiller**. - **Constant** one constant value, e. g. 42, note that this means a single reference type. - **Decrementing** full array filled with a decreasing sequence from array `length - 1` to `0`. - **Incrementing** full array filled with a increasing sequence from `0` to `length - 1`. - **MedianOfThreeKiller** each slice filled with a sequence as detailed in [Introspective Sorting and Selection Algorithms](http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.14.5196). For longer slice lengths this will use heap sort. - **Random** full array filled with random values. Seeded so each run is the same. - **PartialRandomShuffle** full array filled with incrementing sequence. Random pairs are then swapped, as a ratio of length. In this case 10%, i.e. 10% pairs have been swapped randomly. Seeded so each run is the same. For each different type, the `int` value is converted to the given type e.g. using `ToString(""D9"")` for `string`. These fillers are also used for test case generation. But are combined with other sort case generators. #### Difference to BinarySearch `BinarySearch` only has an overload without comparer for when `T : IComparable<T>`. That is, there is no overload where the value searched for is not not generically constrained. - Proposal https://github.com/dotnet/corefx/issues/15818 - Implementation https://github.com/dotnet/corefx/pull/25777 This is unlike `Sort` where there is no generic constraint on the key type. If we had https://github.com/dotnet/csharplang/issues/905 this might not be that big an issue, but we might expect issues for some uses of `BinarySearch`. #### Tests The fundamental principle of the tests are they use `Array.Sort` for generating the expected output. The idea being span `Sort` should give exactly the same result. #### Notes and TODOs Biggest problem currently is that there are differences for some specific test cases: - NaN for float and double will not give the same result when sorting keys **and** values. - I have not had time to debug this. In span Sort I wanted to use the specialized sort path for these, but `coreclr` only does that when items/values are of the same type. This means `coreclr` does not do a `NaNPrepass` for floating point types when items are not of same type. - I removed this then, but results are still different. - BogusComparable tests fail since `Array.Sort` will throw on these for **some** lengths. - Tests need to be modified to handle this, and span Sort must detect this issue and throw. There are a lot of other remaining TODOs e.g.: - Better separation between fast and slow (OuterLoop) tests, currently tests are slow, even the ""fast"" ones. - Port performance tests as per `corefx` standard. - Need to determine scope of these... a lot can be added. Performance is currently on par or significantly better than `coreclr` for value types. As soon as reference types are used performance is... well miserably. This probably reflects the fact that my main focus was on optimizing for `int`s. I believe the issue here must be around how I have factored the generic code. - Are the changes I have made acceptable? - Are there any issues with how I have factored the code into the different types and generic methods? - Any way to make reference type code faster? - Is there any way one can circumvent the canonical representation of generic types and methods when a type is a reference type? So we can avoid `JIT_GenericHandleMethod` or `JIT_GenericHandleClass`, which shows up during profiling? This is the reason for the `IComparable` variant of the code... but it is still slow. CC: @ahsonkhan @jkotas " 26860 area-System.Numerics Questions and suggestions about the Plane Structure ``` var p1 = new Plane(1, 1, 1, 4); var p2 = Plane.Normalize(p1); Console.WriteLine(p1 == p2); //False ``` Normal and D are different in p1 and p2, so == returns false. Are p1, p2 different planes or the same plane? And if d1 and d2 are identical but with different D values. Doesn't this say loudly that D is not the distance? Abs(D) is the distance if and only if Normal is the normalized vector. You can refer to the low for the distance of a point from a plane to calculate the distance of the origin. A small test, I'll take a point and calculate its distance from the p1 and p2 planes: ``` var p1 = new Plane(1, 1, 1, 4); var p2 = Plane.Normalize(p1); var point = new Vector3(5, 6, 7); var distanceFromP1 = (Vector3.Dot(point, p1.Normal) + p1.D)/ p1.Normal.Length(); var distanceFromP2 = (Vector3.Dot(point, p2.Normal) + p2.D)/ p2.Normal.Length(); ``` The distance in both cases is 12.7017059. P1 and p2 are defiantly the same plane. So, I suggest: 1. The Equals method of the Vector3 and other vectors should normalize both vectors before comparing them. Same is for the Equal method for the Plane. You can compromise by adding a new Plane.Equals(Plane other, bool MathematicallyEquals) method overload that normalizes both planes before comparing them. This at least will alert the user to the difference. 2. float comparisons should use the MathF.Round to avoid floating points errors. Otherwise there methods are useless, and we had to re-write them manually in each use. Why writing code with no practical usage, while it can be perfected? The source code already uses FLT_EPSILON in some comparisons. const float FLT_EPSILON = 1.192092896e-07f; // smallest such that 1.0+FLT_EPSILON != 1.0 3. Xml comments and documentation must correct the definition for D. I was totally misguided because saying it's the distance, and negative D values made me crazy. D is the coefficient of the plain equation, its magnitude can be the distance if the normal is normalized, and its sign came from it's location on the two sides of the plane. We wastes a lot of time in my previous issue because this inaccuracy. 4. it will be nice if you add a Plane.DistanceOfPoint method. The DotCoordinate method retuns the distance, only if the plane is normalized. 5. it will be helpfull to add this Method to the plane struct (and a similar one to the Vector struct). The code is based on the source code of the Normalize method: public static bool IsNormalized(Plane value) { const float FLT_EPSILON = 1.192092896e-07f; // smallest such that 1.0+FLT_EPSILON != 1.0 float normalLengthSquared = value.Normal.LengthSquared(); return MathF.Abs(normalLengthSquared - 1.0f) < FLT_EPSILON; } 6. I wonder what is the design goal behind making almost all vector and plane methods static? This makes code verbose without a purpose! If I have two vector3 instances named a and b, why write: var c = Vector3.Normalize(Vector3.Reflect(a, Vector3.Abs(a))); while it's shorter and easier to understand to write: var c = a.Reflect(b.Abs( )).Normalize( ); And why is Length is a method not a property? 26862 area-System.Net Disable some System.Net.WebHeaderCollection tests on Mono. 26864 area-System.Net Clear Authorization Headers on Redirect When a user has added an Authorization header to a request via the HttpClient DefaultRequestHeaders Authorization field, we currently do not strip that header on redirect. The correct behavior is to strip all Authorization headers on redirect, and that is the behavior implemented in .NET Framework. This change adds a method to strip Authorization headers that were set via the HttpClient DefaultRequestHeaders Authorization field, and calls that method on redirect. In addition, it adds a test to ensure that this behavior occurs as expected. The new method `ResetAuthRequestHeaders` is based on the method `ResetCookieRequestHeaders`, which is used to reset cookie headers on redirect. The issue also occurs in CurlHandler, but the fix is slightly different. Rather than remove the headers that have already been set, we can instead just skip them when copying over the new headers to the redirected request. Fixes #26426 26865 area-System.Security Make EnvelopedCms work for Linux and macOS "This change adds a version of EnvelopedCms which uses the platform crypto stack and new AsnSerializer capabilities, and makes no P/Invokes (other than the ones the crypto stack itself makes). .NET Framework EnvelopedCms is more or less RFC 2630 (CMS version ""2"") plus RFC 3565 (AES with CMS), and that is maintained with this implementation. No new API has been added, this merely populates the existing API for non-Windows OSes. Unlike the Windows implementation, FFC based Diffie-Hellman key agreement is not supported, because the platform has no exposure of FFC Diffie-Hellman. Unlike the WIndows implementation, RC4 is not supported, because the platform has no exposure of RC4. Fixes #3334." 26868 area-System.Memory Add tests for when array/string are null but start/length are non-zero. Fixes https://github.com/dotnet/corefx/issues/26833 which is a follow up on https://github.com/dotnet/corefx/pull/26807 This PR is blocked on the mirror, especially for the netfx CI tests to pass (see https://github.com/dotnet/coreclr/pull/16186#issuecomment-362947869). cc @jkotas, @KrzysztofCwalina, @stephentoub, @VSadov 26869 area-System.Net initial connect support This is initial part related to #23136. @geoffkizer wanted me to split it into two parts - one for connect it self (https://www.ietf.org/rfc/rfc2817.txt) , followed by hooks to proxy handling. I plan to extend HttpConnectMethod_Succeeds() once we have the proxy support so it is easier to do tests using public API. The connect method is not public yet. That may or may not change in future. 26870 area-System.Net Switch ManagedHandler to use SslClientAuthenticationOptions Simplifies the public ManagedHandler API by using the now existing SslClientAuthenticationOptions bag as a way to pass in all of the SSL-related options. This also means we start enabling anything already on SslClientAuthenticationOptions as well as anything new added in the future, without requiring new API on ManagedHandler. In the process of doing that, also added an implemention of HttpClientHandler.ClientCertificateOption for ManagedHandler; previously Automatic was just ignored. (I also removed UseDefaultCredentials from ManagedHandler, as it's ignored and not relevant until additional auth mechanisms are supported.) Fixes https://github.com/dotnet/corefx/issues/26811 Fixes https://github.com/dotnet/corefx/issues/26567 cc: @geoffkizer, @davidsh, @Priya91, @wfurt, @Drawaes 26873 area-System.Net Proper check for OpenSSL version in System.Net.Http.Tests Disable the tests affected by #26803 in the correct way so tests are skipped only when needed. 26875 area-System.Net Conditionally skip test causing assert in WSL. Skip test in WSL until #26813 and #26476 are fixed 26876 area-System.IO Add the ability to specify case matching behavior for GetFiles Adds options for specifying whether or not you want to respect casing when calling existing file enumeration APIs. cc: @iSazonov, @danmosemsft 26877 area-System.Runtime reduce regex op code time While stepping through the Regex code and analyzing the different steps to find the reason for https://github.com/dotnet/corefx/issues/26787 I noticed that the regex op code generation runs twice. a code comment also suggested that this could be simplified by using a growing data structure instead of a fixed array. Benchmark results (based on Dans xunit benchmarks, converted to BenchmarkDotNet): **[EDIT]: see benchmark below** 26878 area-System.Net minimal support for ManagedHandler proxy configuration on Windows This is part of #23150 and it provides some minimal integration using existing WinHttpProxyHelper. I tested this with manual proxy configuration as well as automatic configuration via script. In case of manual configuration we use proxy URI given to us in similar way as when configured via environment on Unix. In case of automatic configuration we let winhttp to decide for us. That should give us functionality consistent with current HTTP handler. Also note that this change will get basic setting once when HTTP Handler is initiated. That matches Unix behavior with using environmental variables. I'm not sure what is expectation for windows - I would expect we don't want to check for every request but it may be useful to have some mechanism to pick up configuration changes. This change is still missing processing for bypass in case of manual configuration. I also did not figure out how to configure authentication. I may try to set up two machines in same domain - currently I use HTTP Proxy on external Linux machine. Since this is primarily integration code with windows OS, I did not figure out how to write got test for it. All my tests so far are manual and I plan to continue testing more scenarios. 26879 area-System.Security X509AuthorityKeyIdentifierExtension should be public X509AuthorityKeyIdentifierExtension is currently a sealed class. Should make it public unless there is a good reason in keeping it sealed. 26880 area-System.Memory Add ROSpan StartsWith and EndsWith string-like APIs with StringComparison Part of https://github.com/dotnet/corefx/issues/21395#issuecomment-359906138 - StartsWith - EndsWith Depends on: https://github.com/dotnet/coreclr/pull/16223 and https://github.com/dotnet/coreclr/pull/16418 **TODO:** ~Add tests.~ cc @jkotas, @stephentoub, @KrzysztofCwalina, @tarekgh, @JeremyKuhne 26882 area-System.Net Socket LocalEndPoint not updated in SendToAsync(SocketAsyncEventArgs e) "The `SocketAsyncEventArgs` version of `SendToAsync` does not properly set `_rightEndPoint`, while it creates the `endPointSnapshot` variable that is used to set `_rightEndPoint` in `SendTo`, `BeginSendTo` and `SendToAsync (task)` methods. According to remarks section of the documentation on [recvfrom](https://msdn.microsoft.com/en-us/library/windows/desktop/ms740120(v=vs.85).aspx) method, all of `sendto`, `WSASendTo` and `WSAJoinLeaf` implicitly binds to a local address which is reflected by calling `getsockname`. Here is a reference link for Socket.cs with line number. [https://github.com/dotnet/corefx/blob/master/src/System.Net.Sockets/src/System/Net/Sockets/Socket.cs#L4213](https://github.com/dotnet/corefx/blob/master/src/System.Net.Sockets/src/System/Net/Sockets/Socket.cs#L4213) Otherwise it is in `public bool SendToAsync(SocketAsyncEventArgs e)` method. ### Example code for reproducing issue ```cs static void Main(string[] args) { using (var socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp)) { var destinationEndPoint = new IPEndPoint(IPAddress.Parse(""10.20.30.40""), 1234); var socketAsyncEventArgs = new SocketAsyncEventArgs(); socketAsyncEventArgs.RemoteEndPoint = destinationEndPoint; socketAsyncEventArgs.SetBuffer(new byte[32], 0, 32); // 32 bytes of zeros socketAsyncEventArgs.Completed += (sender, e) => SendCompleted(e); if (!socket.SendToAsync(socketAsyncEventArgs)) SendCompleted(socketAsyncEventArgs); Debug.Assert(socket.LocalEndPoint != null); // LocalEndPoint should not be null } Console.ReadLine(); } static void SendCompleted(SocketAsyncEventArgs args) { args.Dispose(); } ```" 26883 area-System.Runtime Hardening sliding expiration cache test The fix is just like described in #26586 - measure the delay and detect if we had not exceeded expiration timeout. 26886 area-System.Net multipart/form-data does not comply with the RFC 1867 standard "this is the package of MultipartFormDataContent/MultipartContent ``` POST /webapi/user/UpdateWithMulitpart HTTP/1.1 Host: localhost:9999 Content-Type: multipart/form-data; boundary=""456a4835-40c9-40c2-929e-502c01ff5562"" --456a4835-40c9-40c2-929e-502c01ff5562 Content-Disposition: form-data; name=Account laojiu --456a4835-40c9-40c2-929e-502c01ff5562-- ``` but RFC 1867 like this ``` POST /webapi/user/UpdateWithMulitpart HTTP/1.1 Host: localhost:9999 Content-Type: multipart/form-data; boundary=456a4835-40c9-40c2-929e-502c01ff5562 --456a4835-40c9-40c2-929e-502c01ff5562 Content-Disposition: form-data; name=""Account"" laojiu --456a4835-40c9-40c2-929e-502c01ff5562-- ```" 26887 area-System.Threading "Test System.Threading.Tasks.Dataflow.Tests.EtwTests.TestEtw failed with ""Exit code was 131 but it should have been 42\nExpected: True\nActual: False""" Failed test: System.Threading.Tasks.Dataflow.Tests.EtwTests.TestEtw Configuration: Osx10.12_release MESSAGE: Exit code was 131 but it should have been 42\nExpected: True\nActual: False ~~~ STACK TRACE: at System.Diagnostics.RemoteExecutorTestBase.RemoteInvokeHandle.Dispose() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_release/src/CoreFx.Private.TestUtilities/src/System/Diagnostics/RemoteExecutorTestBase.cs:line 186 ~~~ Details: https://ci.dot.net/job/dotnet_corefx/job/master/job/osx10.12_release/4258/testReport/System.Threading.Tasks.Dataflow.Tests/EtwTests/TestEtw/ 26889 area-System.Net SocketException: Invalid argument with SocketOptionName.Linger on Linux (Debian 9) "When executing `socket.Bind()` on a socket preconfigured with a `SocketOptionName.Linger` the following exception is observed on a Linux (Debian) machine. ``` System.Net.Sockets.SocketException: Invalid argument at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName) at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Int32 optionValue, Boolean silent) at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Int32 optionValue) ``` the same code executes and works well without exceptions on a Windows (Win8.1) machine. Example code for reproducing the issue ```c# using System; using System.Net.Sockets; using System.Net; public class Repro { static void Main() { //system ip string ipStr = ""127.0.1.1""; int port = 40000; IPAddress ipAddress; IPAddress.TryParse(ipStr, out ipAddress); int optionValue = 1; IPEndPoint ipEnd = new IPEndPoint(ipAddress, port); var s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); s.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Linger, optionValue); s.Bind(ipEnd); Console.WriteLine(s); Console.ReadLine(); } } ``` [EDIT] Add syntax highlighting by @karelz" 26892 area-System.Net It seems proxy address is never applied https://github.com/dotnet/corefx/blob/62e18e428a91293bda14ba287849f51a1f38bc51/src/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpHandler.cs#L687 Result of method is not applied and code is optimized. In my case WebProxy method is called https://github.com/dotnet/corefx/blob/master/src/System.Net.WebProxy/src/System/Net/WebProxy.cs#L87 26893 area-System.IO The FileSystemInfo.Exists anomaly; File.Exists() has no use This bug is mostly in the documentation. File.Exists() returns false if an I/O error or permission error causes it to be impossible to determine if the file exists or not. To get the error, call LastWriteTimeUTC() and throw away the result. If LastWriteTimeUTC() returns, the file doesn't exist. If it throws, you don't know if the file exists or not and the exception is the reason you don't know. This behavior is not documented. The apparent behavior from the documentation is FileInfo.Exists throws if an I/O error or permission error happens. Not writing the extra call to check if FileSystemInfo.Exists() is reliable on returning false causes corner case bugs to exist in the code that cause incorrect behavior on transient network drops rather than detect and retry. Due to this behavior, no correct code can ever call File.Exists() or Directory.Exists() even assuming static filesystems; should be tagged obsolete. 26894 area-System.Memory Cleanup after removal of MemoryExtensions As* api. In the Framework, there are many types that can be converted into ```Span<T>```, ```ReadOnlySpan```, ```Memory<T>```, and ```ReadOnlyMemory<T>``` (a.k.a. _slice types_). The conversions are implemented as: * constructors of _slice types_, e.g. ```Span<T>``` ctor taking ```T[]``` parameter * cast operators from source type to _slice type_, e.g. ```implicit operator Memory<T> (T[] array)``` * ```As<slice_type>``` extensions methods, e.g. ```static ReadOnlySpan<char> AsReadOnlySpan(this string text)``` Unfortunately, the set of these conversions is not very consistent. For example, ```AsReadOnlySpan``` method converting strings to ```ReadOnlySpan<char>``` has three overloads: ```c# public static System.ReadOnlySpan<char> AsReadOnlySpan(this string text); public static System.ReadOnlySpan<char> AsReadOnlySpan(this string text, int start); public static System.ReadOnlySpan<char> AsReadOnlySpan(this string text, int start, int length); ``` But logically equivalent ```T[]``` to ```Span<T>``` conversion method has only one overload: ```c# public static System.Span<T> AsSpan<T>(this T[] array) { throw null; } ``` This means string can be sliced using the following code: ```c# var slice = str.AsReadOnlySpan(5, 10); ``` ... but to slice an array, developers have to write: ```c# var slice = arr.AsSpan().Slice(5, 10); ``` This proposal outlines guidelines we could adopt to make the APIs more consistent and easier to use: 1. Always provide three overloads of As<slice_type> extension or instance methods. Such extension method will be the main conversion API (i.e. other conversions like ctors and casts are just icing on the cake). ```c# public static <slice_type> As<slice_type>(this <source_type> value) ; public static <slice_type> As<slice_type>(this <source_type> value, int start); public static <slice_type> As<slice_type>(this <source_type> value, int start, int length); ``` 2. If a type can be converted to both heapable slices and by-ref slices, provide extension methods for both. ```c# public static Span<T> AsSpan(this T[] value) ; public static Span<T> AsSpan(this T[] value, int start); public static Span<T> AsSpan(this T[] value, int start, int length); public static Memory<T> AsMemory(this T[] value) ; public static Memory<T> AsMemory(this T[] value, int start); public static Memory<T> AsMemory(this T[] value, int start, int length); ``` 3. Do not provide conversions to both read-only and read/write slice types. e.g T[] will have conversions to only ``Span<T>``` and ```Memory<T>```, not to ```ReadOnlySpan<T>``` or ```ReadOnlyMemory<T>```. Slice types provide cast from r/w versions to read-only versions. 4. Do provide implicit casts between types if appropriate. Not sure if we want, but we should discuss: 5. Limit constructors to the longest (most flexible) overload. 6. Provide ```AsReadOnly()`` methods on r/w/ slice types. 7. Skip ```ReadOnly``` from conversion method names if the source type is already read-only. For example, string can be converted only to ```ReadOnlySpan<char>``` and so the ```As<slice_type>``` method should be called ```AsSpan```, not ```AsReadOnlySpan```. The resulting changes are: ```c# public static partial class MemoryExtensions { // * ADD * // String public static System.ReadOnlyMemory<char> AsMemory(this string text) { throw null; } public static System.ReadOnlyMemory<char> AsMemory(this string text, int start) { throw null; } public static System.ReadOnlyMemory<char> AsMemory(this string text, int start, int length) { throw null; } public static System.ReadOnlySpan<char> AsSpan(this string text) { throw null; } public static System.ReadOnlySpan<char> AsSpan(this string text, int start) { throw null; } public static System.ReadOnlySpan<char> AsSpan(this string text, int start, int length) { throw null; } // T[] public static System.Memory<T> AsMemory(this T[] array) { throw null; } public static System.Memory<T> AsMemory(this T[] array, int start) { throw null; } public static System.Memory<T> AsMemory(tthis T[] array, int start, int length) { throw null; } public static System.Span<T> AsSpan(this T[] array) { throw null; } // this already exist public static System.Span<T> AsSpan(this T[] array, int start) { throw null; } public static System.Span<T> AsSpan(this T[] array, int start, int length) { throw null; } // ArraySegment public static System.Memory<T> AsMemory(this ArraySegment<T> segment) { throw null; } public static System.Memory<T> AsMemory(this ArraySegment<T> segment, int start) { throw null; } public static System.Memory<T> AsMemory(this ArraySegment<T> segment, int start, int length) { throw null; } public static System.Span<T> AsSpan(this ArraySegment<T> segment) { throw null; } // this already exist, just rename the parameter public static System.Span<T> AsSpan(this ArraySegment<T> segment, int start) { throw null; } public static System.Span<T> AsSpan(this ArraySegment<T> segment, int start, int length) { throw null; } // * REMOVE * // these actually just get renamed to AsMemory/Span (see above) public static System.ReadOnlyMemory<char> AsReadOnlyMemory(this string text) { throw null; } public static System.ReadOnlyMemory<char> AsReadOnlyMemory(this string text, int start) { throw null; } public static System.ReadOnlyMemory<char> AsReadOnlyMemory(this string text, int start, int length) { throw null; } public static System.ReadOnlySpan<char> AsReadOnlySpan(this string text) { throw null; } public static System.ReadOnlySpan<char> AsReadOnlySpan(this string text, int start) { throw null; } public static System.ReadOnlySpan<char> AsReadOnlySpan(this string text, int start, int length) { throw null; } // remove and simply use the casts, e.g. from Memory<T> to ReadOnlyMemory<T> instead public static System.ReadOnlyMemory<T> AsReadOnlyMemory<T>(this System.Memory<T> memory) { throw null; } public static System.ReadOnlySpan<T> AsReadOnlySpan<T>(this System.Span<T> span) { throw null; } public static System.ReadOnlySpan<T> AsReadOnlySpan<T>(this System.ArraySegment<T> arraySegment) { throw null; } public static System.ReadOnlySpan<T> AsReadOnlySpan<T>(this T[] array) { throw null; } } ``` 26895 area-System.Net ManagedHandler public API surface "For 2.1, we want to expose the new ""ManagedHandler"" we've been working on. It's not ""just the default"" as it's missing some features (e.g. HTTP/2, various forms of auth like NTLM and Negotiate), so it needs to be opt-in. We've allowed it to be opt-in on a process-wide level underneath HttpClientHandler, via an environment variable and via an AppContext setting, but we also want to expose the API so that a) developers can opt-in for specific uses rather than process-wide (e.g. we do this via a hack in ClientWebSocket, which runs on the managed handler now), and b) so that developers can control settings on it not available via HttpClientHandler. Proposed surface area: ```C# namespace System.Net.Http { public sealed class NetSocketsHandler : HttpMessageHandler // new name for ManagedHandler { public NetSocketsHandler(); // These are identical to those on HttpClientHandler: public bool AllowAutoRedirect { get; set; } public DecompressionMethods AutomaticDecompression { get; set; } // TODO: Also and Brotli to DecompressionMethods? public CookieContainer CookieContainer { get; set; } public ICredentials Credentials { get; set; } public ICredentials DefaultProxyCredentials { get; set; } protected override void Dispose(bool disposing); public int MaxAutomaticRedirections { get; set; } public int MaxConnectionsPerServer { get; set; } public int MaxResponseHeadersLength { get; set; } public bool PreAuthenticate { get; set; } public IDictionary<string, object> Properties { get; } public IWebProxy Proxy { get; set; } protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken); public bool UseCookies { get; set; } public bool UseProxy { get; set; } // This replaces the following from HttpClientHandler, while enabling additional functionality: // - public bool CheckCertificateRevocationList { get; set; } // - public X509CertificateCollection ClientCertificates { get; set; } // - public ClientCertificateOption ClientCertificateOptions { get; set; } // - public Func<HttpRequestMessage, X509Certificate2, X509Chain, SslPolicyErrors, bool> ServerCertificateCustomValidationCallback { get; set; } // - public SslProtocols SslProtocols { get; set; } public SslClientAuthenticationOptions SslOptions { get; set; } // Others not on HttpClientHandler but on NetSocketsHandler public TimeSpan ConnectionTimeout { get; set; } // How long a connection can be alive to still be poolable; primarily used to help with DNS changes public TimeSpan ConnectionIdleTimeout { get; set; } // How long a pooled connection can be idle before it's disposed; primarily used for resource management // Others not currently in the plan but which we've discussed as potential knobs: public TimeSpan DnsRefreshTimeout { get; set; } // If we do our own DNS caching, how often to flush public bool EnableDnsRoundRobin { get; set; } // Whether to go in order of the DNS results or round-robin through them public bool UseNagleAlgorithm { get; set; } // We currently always disable it, but maybe someone would want to override that? public int MaxResponseDrainSize { get; set; } // We're implementing draining, and may want to allow control over how much is drained public TimeSpan MaxResponseDrainTimeout { get; set; } // We're implementing draining, and may want to allow control over how long we spend draining } } ``` Current open issues: - **Naming**, in particular for the class itself. Most handlers describe what it is they're built on top of, hence the ""sockets"". We could do ""SocketsHandler"", but there was some concern aired that everything is on sockets at some level (the counterargument is that this is the direct level targeted by this handler); the ""Net"" prefix was added as a way to suggest it's the System.Net.Sockets. - **Assembly**. The current plan is this ships in System.Net.Http.dll. That will make it more difficult to make it available in the future downlevel. But the API currently relies on .NET Core-specific types (e.g. SslClientAuthenticationOptions) and the implementation relies on internals of HttpClient for perf. We also hope/expect it'll become the default in the future. - **MaxResponseHeadersLength** unit. HttpClientHandler defines it in kilobytes, which is inconsistent with most other sizes. Should we break from that and expose it in bytes?" 26898 area-System.Net Shutdown socket in some cases to prevent endless hang on blocking operation Fixes #22564 Fixes #26034 Use Shutdown() when closing on blocking sockets to prevent infinite blockage. 26899 area-System.Collections ConcurrentDictionary.Clear ignores the capacity specified in the constructor The Clear method always allocates DEFAULT_CAPACITY Nodes instead of using the capacity specified in the constructor. It should probably use m_tables.m_buckets.Length instead. ```cs public void Clear() { int locksAcquired = 0; try { AcquireAllLocks(ref locksAcquired); Tables newTables = new Tables(new Node[DEFAULT_CAPACITY], m_tables.m_locks, new int[m_tables.m_countPerLock.Length], m_tables.m_comparer); m_tables = newTables; m_budget = Math.Max(1, newTables.m_buckets.Length / newTables.m_locks.Length); } finally { ReleaseLocks(0, locksAcquired); } } ``` 26900 area-Serialization Update sgen version to 2.* 26901 area-Serialization Update usage in sgen Currently the usage contains dotnet dotnet-Microsoft.XmlSerializer.Generator, which should be dotnet Microsoft.XmlSerializer.Generator. 26902 area-Serialization Adopt new dotnet parameter conversion in sgen "user -- instead of / e.g. ""--help"" instead of ""/help"" " 26903 area-System.Net [ManagedHandler] Hit assert during local test run for ResponseStreamTest /cc @karelz @geoffkizer @stephentoub This is not happening on every run and prevents the generation of testResults.xml so I may have missed some other occurrences of it. I will try to see if it repros in other boxes and also to capture a dump. https://github.com/dotnet/corefx/blob/6f8a600be95671162bd4de3014adafabe0a0e5ed/src/System.Net.Http/src/System/Net/Http/Managed/HttpConnection.cs#L1181 ``` Assertion Failed 34 != 32 at System.Net.Http.HttpConnection.ReturnConnectionToPoolCore() in C:\s\github\pjanotti\corefx\src\System.Net.Http\src\System\Net\Http\Managed\HttpConnection.cs:line 1181 at System.Net.Http.HttpConnection.ReturnConnectionToPool() in C:\s\github\pjanotti\corefx\src\System.Net.Http\src\System\Net\Http\Managed\HttpConnection.cs:line 1143 at System.Net.Http.HttpConnection.ContentLengthReadStream.ReadAsync(Memory`1 destination, CancellationToken cancellationToken) in C:\s\github\pjanotti\corefx\src\System.Net.Http\src\System\Net\Http\Managed\ContentLengthReadStream.cs:line 60 at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in E:\A\_work\1024\s\src\mscorlib\src\System\Runtime\CompilerServices\AsyncMethodBuilder.cs:line 922 at System.Net.Http.HttpConnection.ContentLengthReadStream.ReadAsync(Memory`1 destination, CancellationToken cancellationToken) at System.Net.Http.HttpConnection.ContentLengthReadStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) in C:\s\github\pjanotti\corefx\src\System.Net.Http\src\System\Net\Http\Managed\ContentLengthReadStream.cs:line 28 at System.IO.Stream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count) in E:\A\_work\1024\s\src\mscorlib\src\System\IO\Stream.cs:line 376 at System.Net.Http.Functional.Tests.ResponseStreamTest.ReadAsStreamHelper(IPEndPoint serverEndPoint) in C:\s\github\pjanotti\corefx\src\System.Net.Http\tests\FunctionalTests\ResponseStreamTest.cs:line 253 at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in E:\A\_work\1024\s\src\mscorlib\shared\System\Threading\ExecutionContext.cs:line 166 at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext() in E:\A\_work\1024\s\src\mscorlib\src\System\Runtime\CompilerServices\AsyncMethodBuilder.cs:line 546 at Xunit.Sdk.AsyncTestSyncContext.<>c__DisplayClass7_0.<Post>b__1(Object _) in C:\BuildAgent\work\cb37e9acf085d108\src\xunit.execution\Sdk\AsyncTestSyncContext.cs:line 75 at Xunit.Sdk.MaxConcurrencySyncContext.RunOnSyncContext(SendOrPostCallback callback, Object state) in C:\BuildAgent\work\cb37e9acf085d108\src\xunit.execution\Sdk\MaxConcurrencySyncContext.cs:line 107 at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in E:\A\_work\1024\s\src\mscorlib\shared\System\Threading\ExecutionContext.cs:line 166 at Xunit.Sdk.MaxConcurrencySyncContext.WorkerThreadProc() in C:\BuildAgent\work\cb37e9acf085d108\src\xunit.execution\Sdk\MaxConcurrencySyncContext.cs:line 89 at Xunit.Sdk.XunitWorkerThread.<>c.<QueueUserWorkItem>b__5_0(Object _) in C:\BuildAgent\work\cb37e9acf085d108\src\common\XunitWorkerThread.cs:line 37 at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in E:\A\_work\1024\s\src\mscorlib\shared\System\Threading\ExecutionContext.cs:line 166 at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) in E:\A\_work\1024\s\src\mscorlib\src\System\Threading\Tasks\Task.cs:line 2440 at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in E:\A\_work\1024\s\src\mscorlib\shared\System\Threading\ExecutionContext.cs:line 166 ``` 26904 area-System.Collections Test failure: System.Collections.Immutable.Tests.ImmutableListTest/LastIndexOf Opened on behalf of @joshfree The test `System.Collections.Immutable.Tests.ImmutableListTest/LastIndexOf` has failed. Assert.Equal() Failure\r Expected: 2\r Actual: -1 Stack Trace: at System.Collections.Immutable.Tests.IndexOfTests.LastIndexOfTest[TCollection](Func`2 factory, Func`3 lastIndexOfItem, Func`4 lastIndexOfItemEQ, Func`4 lastIndexOfItemIndex, Func`5 lastIndexOfItemIndexCount, Func`6 lastIndexOfItemIndexCountEQ) in E:\A\_work\2146\s\corefx\src\System.Collections.Immutable\tests\IndexOfTests.cs:line 113 at System.Collections.Immutable.Tests.ImmutableListTest.LastIndexOf() in E:\A\_work\2146\s\corefx\src\System.Collections.Immutable\tests\ImmutableListTest.cs:line 524 Build : Master - 20180206.03 (Core Tests) Failing configurations: - Windows.81.Amd64-x64 - Release - Windows.7.Amd64-x64 - Release - Windows.10.Amd64.Core-x64 - Release - Windows.10.Nano.Amd64-x64 - Release - Windows.10.Amd64-x64 - Release 26905 area-Serialization Update Sgen version to 2.0 and assembly version to 2.0. #26900 @zhenlan @mconnew @yujayee 26906 area-System.Net Implement MaxResponseHeadersLength on ManagedHandler Fixes https://github.com/dotnet/corefx/issues/23142 @geoffkizer, this is going to conflict with https://github.com/dotnet/corefx/pull/26782. I will wait for you to merge that and then fix this up accordingly. cc: @geoffkizer, @davidsh, @Priya91, @wfurt 26907 area-Serialization Update Sgen version to 2.0 and assembly version to 2.0 in 2.1 release branch Port #26905 in release/2.1 branch 26908 area-Serialization Update Sgen version to 2.0 and assembly version to 2.0 in 2.1 release branch #26907 @zhenlan @mconnew @yujayee 26909 area-Infrastructure [rel/2.0.0] Update Linux test versions Update the helix rid matrix to remove EOL distro versions and add their replacements. cc: @MattGal 26910 area-System.Reflection MethodBodyStreamEncoder.AddMethodBody ignores attributes for tiny methods. RelatedTo:https://github.com/dotnet/roslyn/issues/23951 MethodBodyStreamEncoder.AddMethodBody checks if it is possible to emit Tiny method header, and if it otherwise fits in Tiny, the InitLocals flag get effectively ignored. There is a case where we may need Fat format specifically because we want the InitLocals flag. That happens if a method otherwise meets requirements of a Tiny format, but has `stackalloc` in it. If Tiny is used in such case, the caller will `stackalloc` a piece of nondeterministic garbage. Overall - it should be up to the caller to decide whether the InitLocals is needed. AddMethodBody should ensure that the flag is emitted if asked by the caller. 26911 area-Infrastructure Crossgening roslyn for non-Windows builds cc: @weshaggard @eerhardt When moving to the CLI's MSBuild we started using Roslyn comming in from the packages directory, which we are not crossgening. This is most likely causing the problem we are seeing on non-Windows builds where builds take twice as long as they used to take. These changes will make sure we crossgen roslyn so builds should go faster. 26914 area-Meta Add HID support to .netCore 26915 area-System.Globalization Add Hebrew Months test 26917 area-System.Net in .NET Core , after reset SocketAsyncEventArgs.Buffer's offset property and count property, socket.ReceiveAsync(SocketAsyncEventArgs) can't raise completed event . "In .NET Core/Standard , after reset SocketAsyncEventArgs.Buffer's offset property and count property, socket.ReceiveAsync(SocketAsyncEventArgs) can't raise completed event . But same code in .NET Framework , it can run properly. the whole code both in .NET Framework and .NET Core sample's URL as below: https://github.com/Microshaoft/Socket.Echo.Server the source code are same absolutely. the issue partial code snippet as below: https://github.com/Microshaoft/Socket.Echo.Server/blob/master/ShareClassLibrary/ShareClassLibrarySharedProject/SocketAsyncDataHandler.TCP.cs you can find ""issue"" for tips ``` ReceiveSocketAsyncEventArgs .Completed += ( (sender, e) => { var socket = sender as Socket; if (e.BytesTransferred >= 0) { byte[] buffer = e.Buffer; int r = e.BytesTransferred; int p = e.Offset; int l = e.Count; if (r < l) { p += r; // issue: reset buffer's Offset property and Count Property e.SetBuffer(p, l - r); } else if (r == l) { if (_isHeader) { byte[] data = new byte[headerBytesCount]; Buffer .BlockCopy ( buffer , HeaderBytesOffset , data , 0 , data.Length ); byte[] intBytes = new byte[4]; l = ( intBytes.Length < HeaderBytesCount ? intBytes.Length : HeaderBytesCount ); Buffer .BlockCopy ( data , 0 , intBytes , 0 , l ); //Array.Reverse(intBytes); bodyLength = BitConverter.ToInt32(intBytes, 0); p += r; // issue: reset buffer's Offset property and Count Property e.SetBuffer(p, bodyLength); _isHeader = false; } else { byte[] data = new byte[bodyLength + HeaderBytesLength]; bodyLength = 0; Buffer .BlockCopy ( buffer , 0 , data , 0 , data.Length ); _isHeader = true; // issue: reset buffer's Offset property and Count Property e.SetBuffer(0, HeaderBytesLength); onOneWholeDataPacketReceivedProcessFunc? .Invoke ( this , data , e ); } } else { if (onReceivedDataPacketErrorProcessFunc != null) { byte[] data = new byte[p + r + HeaderBytesLength]; Buffer .BlockCopy ( buffer , 0 , data , 0 , data.Length ); bool b = onReceivedDataPacketErrorProcessFunc ( this , data , e ); if (b) { bool i = DestoryWorkingSocket(); } else { _isHeader = true; // issue: reset buffer's Offset property and Count Property e.SetBuffer(0, HeaderBytesLength); } } } } if (!_isWorkingSocketDestoryed) { try { // loop ReceiveAsync // issue: after reset SocketAsyncEventArgs.Buffer's offset property and count property // , can't raise completed event socket.ReceiveAsync(e); } catch (Exception exception) { var r = false; if (onCaughtExceptionProcessFunc != null) { r = onCaughtExceptionProcessFunc ( this , e , exception ); } if (r) { DestoryWorkingSocket(); } } } } ); ```" 26918 area-System.IO Fix accessing trimmed paths "Paths with trailing spaces or periods are normally trimmed by Windows. They can, however, be created using `\\?\` or be exposed via mapping of remote file systems. This change fixes the ability to work with returned *Info classes on files of this type. This change also cleans up the Info classes: - removes non-relevant comments - removes ""display"" paths (limited trust holdover) Also remove dead PathPair class." 26920 area-System.Net add test for connection upgrade Add a basic test for how we handle 101 Switching Protocols response. @stephentoub @davidsh @wfurt @wfurt: The CONNECT verb handling should work similar to this; hopefully this is a useful example to follow. 26921 area-System.IO Adding test to verify FileStream.Dispose() ignores IO Related Exception in finalizer Adding test to verify FileStream.Dispose() skips IO Related Exception only on finalization. Making Unix and Windows FileStream Dispose behavior more consistent and throwing IO related exception only on Dispose(true) This tests coreclr bugfix dotnet/coreclr#16250 Fixes: #26734 cc: @danmosemsft 26922 area-System.Net HttpWebRequest.ServicePoint throws PlatformNotSupportedException unless Proxy is set ".NET Core 2.0.5 Accessing the ServicePoint on a newly created HttpWebRequest throws PlatformNotSupportedException. Code to reproduce: ``` var request = (HttpWebRequest)WebRequest.Create(""http://www.example.com/""); request.ServicePoint.UseNagleAlgorithm = false; // PlatformNotSupportedException ``` Exception: ``` Unhandled Exception: System.PlatformNotSupportedException: Operation is not supported on this platform. at System.Net.SystemWebProxy.GetProxy(Uri destination) at System.Net.ServicePointManager.ProxyAddressIfNecessary(Uri& address, IWebProxy proxy) at System.Net.ServicePointManager.FindServicePoint(Uri address, IWebProxy proxy) at System.Net.HttpWebRequest.get_ServicePoint() at WebRequestServicePointThrows.Program.Main(String[] args) in C:\W ork\Bugs\WebRequestServicePointThrows\Program.cs:line 12 ``` Workaround: ``` request.Proxy = null; ``` " 26925 area-System.Net "Fix ServicePointManager.ProxyAddressIfNecessary to ignore ""system"" proxy failures" The whole ServicePointManager implementation is there just to make basic stuff not fail. But HttpWebRequest's Proxy defaults to an internal dummy singleton SystemWebProxy whose GetProxy method throws a PlatformNotSupportedException. Until we can clean that up and have a real proxy in place, we should just eat that PlatformNotSupportedException when the ServicePointManager calls GetProxy. Fixes https://github.com/dotnet/corefx/issues/26922 cc: @davidsh, @geoffkizer 26926 area-System.Net Remove old GetHostByName logic fixes #26856 26927 area-System.Net Remove an incorrect CookieParser test The test CookieParserGet_SetCookieHeaderValue_Success was written with an incorrect understanding of the desired behavior of CookieParser.Get(). The test was disabled when it was merged, and is fundamentally incorrect enough that it doesn't make sense to rewrite it. The relevant code is already covered by the regular cookie parsing tests. Fixes: #22925 26931 area-System.IO Add FileStream tests for custom OwnedMemory with Read/WriteAsync Regression test for https://github.com/dotnet/coreclr/pull/16190 26932 area-System.Net Make response length match content-length See #26754 26934 area-System.Threading Restore Channels ReadAsync implementation 26935 area-System.Reflection Add API for reading/writing PDB Checksum Debug Directory entry "## Background The CodeView debug directory entry in PE/COFF file associates the PE file with one or more PDBs. The CodeView entry and the PDB both store the same PDB ID (for Portable PDB it's 20B for Windows PDB it's 16B of data). Debuggers, symbol servers and other tools use the PDB ID to match the PE file with the PDB. Although the PDB ID is good enough for finding the right PDB for the PE file it is not good enough for validating that the PDB has not been maliciously modified. PDB Checksum is a new debug directory record that can be used for such validation. PDB Checksum comprises of crypto hash algorithm name and the hash of the PDB content. See [Specification](https://github.com/dotnet/corefx/blob/master/src/System.Reflection.Metadata/specs/PE-COFF.md#pdb-checksum-debug-directory-entry-type-19) for details. ## Proposed APIs ```C# namespace System.Reflection.PortableExecutable { public enum DebugDirectoryEntryType { // ... PdbChecksum = 19, // ... } public class DebugDirectoryBuilder { // ... // Adds a custom entry - useful for emitting record for which specific API is not available (yet) public void AddEntry(DebugDirectoryEntryType type, uint version, uint stamp); // Adds a custom entry with data - useful for emitting record for which specific API is not available (yet) public void AddEntry<TData>(DebugDirectoryEntryType type, uint version, uint stamp, TData data, Action<BlobBuilder, TData> dataSerializer); // Adds PDB Checksum entry public void AddPdbChecksumEntry(string algorithmName, ImmutableArray<byte> checksum); // ... } public readonly struct PdbChecksumDebugDirectoryData { /// <summary> /// Checksum algorithm name. /// </summary> public string AlgorithmName { get; } /// <summary> /// GUID (Globally Unique Identifier) of the associated PDB. /// </summary> public ImmutableArray<byte> Checksum { get; } } public class PEReader { // ... public PdbChecksumDebugDirectoryData ReadPdbChecksumDebugDirectoryData(DebugDirectoryEntry entry); // ... } } ``` In addition add the following API to make it easy for the reader of a Portable PDB to determine where the PDB ID is located within the PDB. This information is required when validating PDB checksum. ```C# namespace System.Reflection.Metadata { public sealed class DebugMetadataHeader { // ... /// <summary> /// Gets the offset (in bytes) from the start of the metadata blob to the start of the <see cref=""Id""/> blob. /// </summary> public int IdStartOffset { get; } // ... } } ```" 26937 area-System.Net Consider moving System.Net.Mime.MedaTypeNames to System.Net.Primitives package `System.Net.Mime.MedaTypeNames` is used outside of Mail and is much a part of HTTP communications. Without a `System.Net.Http.Primitives` package, `System.Net.Primitives` seems like a better place for types like this to exist. HTTP in .NET Standard supports HTTP in versions lower than 2.0; but with `System.Net.Mime.MediaTypeNames` in its current location, it's not available for .NET Standard code lower than 2.0. Moving it to Primitives would make it available lower than 2.0 as well as 2.0. 26938 area-System.Diagnostics Update EventSource.Redist nuget package description https://www.nuget.org/packages/Microsoft.Diagnostics.Tracing.EventSource.Redist/ Add a description to the nuget package that explains that EventSource is inbox in .NET Core / is part of netstandard2.0. This helps existing customers to understand why installing the package on .NET Core fails and why it only support netfx TFMs. See https://github.com/dotnet/corefx/issues/7206 26939 area-Infrastructure Turn on ILLinker's clearing of initlocals for corefx We should set ILLinkClearInitLocals=true, and fix any issues that result. cc: @jkotas, @erozenfeld https://github.com/dotnet/corefx/pull/25956 26941 area-System.Numerics Update the System.Math and System.MathF tests to cover some more edge scenarios Currently the System.Math and System.MathF tests explicitly test the upper/lower inputs as well as +0, -0, NaN, +Inf, and -Inf. We should also explicitly test values between the lower limit and -Inf and between the upper limit and +Inf, where applicable. 26942 area-System.IO Reduce Unix enumeration allocations This change factors out the FileStatus access into a helper struct and adds overloads for the stat imports that allow passing a span. The next steps: - Handle errors manually - Skip using safehandle - Look for further opportunities around UTF-8/16 conversion cc: @danmosemsft 26944 area-Infrastructure Improvement needed to run tests with live CoreCLR There is an option to build corefx against live coreclr bits, passed to build.cmd as `-- /p:CoreCLROverridePath=<path>`. This option has been used in a CI testing scenario in the dotnet/coreclr repo, which (1) builds coreclr, (2) clones corefx and builds it using that option. This very frequently leads to failures in these CI jobs due to breaking changes. To make these tests more reliable, the CI job is changing (with https://github.com/dotnet/coreclr/pull/16263) to build corefx as-is, without the `/p:CoreCLROverridePath` argument, and then overwrite the generated runtime files (which were copied from downloaded packages) with built coreclr files. The idea is that there will be fewer failures with this method, for several reasons: (1) there should never be a build break since corefx is building as it does in the CI, (2) test breaks due to breaking changes might not occur, or should be minor, as new apis are added or changed in coreclr. Ideally, corefx could provide an argument like `/p:CoreCLROverridePath` to do what our run-corefx-tests.py script is now going to do: that is, copy coreclr binaries to the generated runtime directory AFTER the corefx build, and NOT build against them. This would encapsulate the information about where this runtime directory lives in the right place -- the corefx scripts. 26945 area-System.Diagnostics Fix ProcessStartInfo tests on CentOS in Debug There is a bug in CentOS7.1 getpwnam_r where it returns the wrong value if you pass in a buffer that is too small to hold the data. In Debug builds, we are purposefully passing in a buffer that is too small to test the fallback code, which is running into this OS bug. See https://bugs.centos.org/view.php?id=7324 Fixes #26673 26946 area-System.Net [ManagedHandler] HTTP Status line contains CR has parsing behavior difference "When ManagedHandler get a Http status line contains CR character, like ""HTTP/1.1 200 O\rK"", it throws `System.FormatException : The reason phrase must not contain new-line characters` ``` at System.Net.Http.HttpResponseMessage.set_ReasonPhrase(String value) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\src\System\Net\Http\HttpResponseMessage.cs:line 94 at System.Net.Http.HttpConnection.ParseStatusLine(Span`1 line, HttpResponseMessage response) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\src\System\Net\Http\Managed\HttpConnection.cs:line 586 at System.Net.Http.HttpConnection.ParseStatusLine(ArraySegment`1 line, HttpResponseMessage response) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\src\System\Net\Http\Managed\HttpConnection.cs:line 533 at System.Net.Http.HttpConnection.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\src\System\Net\Http\Managed\HttpConnection.cs:line 473 at System.Net.Http.HttpConnectionPool.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\src\System\Net\Http\Managed\HttpConnectionPool.cs:line 176 at System.Net.Http.CookieHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\src\System\Net\Http\Managed\CookieHandler.cs:line 31 at System.Net.Http.AuthenticateAndRedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\src\System\Net\Http\Managed\AuthenticateAndRedirectHandler.cs:line 53 at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 488 ``` On WinHttpHandler and Framework, they throw `HttpRequestException`; on UAP and CurlHandler, no Exception will be thrown. We should consider match at least one of the above behavior." 26947 area-Serialization Initialized a bool variable in XmlSerializationReader.cs to fix warning #23561 @huanwu @zhenlan @mconnew 26948 area-System.Memory Need a method similar to S.R.CS.RuntimeHelpers.InitializeArray, but for spans "Initialization of literal arrays like `new int[]{1,2,3,4,5,6}` has a special path where the blittable data is stored directly in the PE data and at runtime, instead of assigning every element of the array to a corresponding constant, we call `InitializeArray` with the target array instance and the token for the field that represents the data blob. Similar technique would be very useful when initializing spans. We already have two scenarios: * stack allocated spans - `stackalloc int[] {1,2,3,4,5}` * optimized conversion of literal arrays to ReadOnlySpan - ` (ReadOnlySpan<int>)new int[]{1,2,3,4,5}` in fact in the case with ReadOnlySpan conversion, it would be possible and desirable to just refer to the PE data directly. The preferred form of the API would be: ```C# ReadOnlySpan<T> GetGetReadOnlySpanFromTemplate<T>(RuntimeFieldHandle fldHandle); ``` Another acceptable alternative is: (but the one above feels more convenient since verifiability is less of a problem) ```C# ref T GetRefToTemplateData<T>(RuntimeFieldHandle fldHandle); ``` A valid question to be asked here - ""if it is possible to just load a reference to the field in the first place, why there is a need for the API?"" The problem is that the blob data is always stored in littleendian format, so on a bigendian machine the blob data is valid only for 1-byte sized elements. Similarly to the case of `InitializeArray`, this API would allow the runtime to abstract away the endianness of the blob. In a littleendian context (which is the most common case) the implementation could trivially forward to the field data and in bigendian case it may do fixups by either making a copy of the data while changing the endianness or even by performing the fixup in-place. NOTE: possibility of in-place fixup would require that the same blob is not used to initialize span data of different sizes - say shorts and longs. Such restriction would be acceptable on the C# side and runtime could validate that such ""sharing"" did not happen, or make it undefined behavior if that happens. NOTE: the presence of the API is statically known to the compiler, so it would be ok if some runtimes do not have it right away or never. Then optimization will simply not consider 1+ element sizes. " 26949 area-System.Net Re-Enable disabled DNS tests on OSX These were disabled a few days ago, but it looks like the issue may have been caused by problematic test infrastructure. One of the offending machines has been re-imaged, and the others have been rebooted. Re-enabling the tests should allow us to determine if it was an infrastructure issue, or if there is a real problem here. Fixes: #26789 26952 area-System.IO System.IO.IOException: 'Entries cannot be opened multiple times in Update mode.' "I am moving an application from .net to core. When I run core version I got System.IO.IOException: 'Entries cannot be opened multiple times in Update mode.' I use System.IO.Packaging library to create packages. ```csharp Package package = Package.Open(packageFile, System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.ReadWrite); AddFile(package, folder, filePath1, mimeType1, id1, reletionType); AddProperties(package); AddCoreAndHash(package); package.Close(); ``` Here is the AddProperties function: ```csharp private static void AddProperties(Package package) { package.PackageProperties.Subject = ""Subject""; package.PackageProperties.Creator = ""Creator""; } ``` After this I call the AddCoreAndHash function: ```csharp private static void AddCoreAndHash(Package package) { package.Flush(); // serialize core properties var coreRelations = package.GetRelationshipsByType(""http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties""); if (coreRelations == null || coreRelations.Count() == 0) { throw new ApplicationException(""Missing core relations.""); } var corePart = package.GetPart(coreRelations.First().TargetUri); var stream = corePart.GetStream(); stream.Position = 0; using (var memoryStream = new MemoryStream()) { Tools.CopyStream(stream, memoryStream); memoryStream.Position = 0; byte[] hash = Tools.CalculateHash(memoryStream); //... will add hash to package later } } ``` I get error while accessing the stream of corePart. I have attached sample files to reproduce the issue [Files.zip](https://github.com/dotnet/corefx/files/1705985/Files.zip) " 26954 area-System.Runtime Proposal: TryForSufficientStack method to support stackalloc usage "_From @kkokosa on February 8, 2018 12:8_ Due to changes in C# 7.2 and Span, more and more `stackalloc `usages may become popular like: `Span<byte> span = stackalloc byte[1000];` However, this call will end up with unrecoverable `StackOverflowException `if there is not enough stack space left. We can do nothing in such situation which makes this approach not useful at some point. It is now just completely unreliable to guess what `stackalloc `size may end up with such a catastrophe. @jkotas pointed out in #14675 that `RuntimeHelpers.EnsureSufficientExecutionStack` is a reliable solution for handling stack overflow in general but as MSDN says, this method ""_ensures that the remaining stack space is large enough to execute the average .NET Framework function_"". However, probing for _average_ .NET framework function is not very helpful as `stackalloc` makes it not average for sure. I propose to add a new helper method which gives at least some clue whether our `stackalloc `may end up with `StackOverflowException`: `public static bool RuntimeHelpers.TryForSufficientStack(long size)` I believe returning `bool` instead of throwing an exception (like `InsufficientExecutionStackException` from above method) is better because `stackalloc` is most probably used in hot paths already and adding exception handling there is rather undesirable. As far as I understand this method seems to be quite simple in terms of implementation as all necessary data are there already. My naive implementation proposal: ``` FCIMPL1(FC_BOOL_RET, ReflectionInvocation::TryForSufficientStack, INT64 size) { FCALL_CONTRACT; Thread *pThread = GetThread(); UINT_PTR current = reinterpret_cast<UINT_PTR>(&pThread); UINT_PTR limit = reinterpret_cast<UINT_PTR>(pThread->GetCachedStackLimit()); FC_RETURN_BOOL(current >= (limit + size)); } FCIMPLEND ``` PS. I am not sure whether stack guard size should be taken into consideration here or not... _Copied from original issue: dotnet/coreclr#16277_" 26956 area-System.Numerics Add Quaternion.Divide(Quaternion, float) I noticed that Quaternion.Divide Method has no overload to dived a quaternion by a scalar value, unlike the Multiply method! so I suggest to add it! I used this: ``` Dim Q1 = New Quaternion(1, -1, 2, -4) Dim Q2 = New Quaternion(-1, 1, -2, -4) * (1 / Q1.LengthSquared()) ``` Edit: After looking at the Inverse Methode source code, it appears it is the Reciprocal Method but with a confusing name! Inverse in math can mean addative Inverse or multiplicative inverse. SIMD-enabled types are not consistant with naming conventions of .net. One odd examole is implementing the Length of these types as a method not a property! I expected to find a Quaternion.Reciprocal as there is a Complex.Reciprocal, but found an Inverse method instead. Having a consistant naming convention makes new features easy to learn and thier methods names easy to remember. Also I think many of static members need to be instance members. 26957 area-System.Net Validate ClientWebSocket wss connections work through http proxies After https://github.com/dotnet/corefx/pull/26878 is merged, validate (and ideally add automated tests) that ClientWebSocket's proxy support works when using wss connections. And if it doesn't, fix it. 26959 area-System.Runtime Re-evaluate default buffer size for getpw native calls By default, we are allocating 1K of memory on the stack as the first buffer to use in getpwnam_r and getpwuid_r. https://github.com/dotnet/corefx/blob/bfac45af5dddcbd70b6935fcf92b4b8755f3cd1c/src/Common/src/System/IO/PersistedFiles.Unix.cs#L100 https://github.com/dotnet/corefx/blob/6f5ce856e9f40a7d247c241a6bb916fc546045ff/src/System.Runtime.Extensions/src/System/Environment.Unix.cs#L371 https://github.com/dotnet/corefx/blob/426e1c72a0dbda1aece127ec5f56696dc465d74b/src/System.Diagnostics.Process/src/System/Diagnostics/Process.Unix.cs#L632 We should re-evaluate if this is too large of a buffer to start with on the stack, as it may be too large for what is necessary. See https://github.com/dotnet/corefx/pull/26945/files/55c360ff0e62b30814a085f079304a126dab9d21#diff-015aad2514de8320cbfe19ed2b8ee9a7 26960 area-System.Net WebSocketProtocolTests causing failures in NETFX Outerloop "NETFX Outerloop test runs have been failing for a few weeks now with the following error: ``` 16:24:49 Build FAILED. 16:24:49 16:24:49 D:\j\workspace\windows-TGrou---bb3e71cd\Tools\tests.targets(492,5): warning : System.Net.WebSockets.WebSocketProtocol.Tests Total: 7, Errors: 0, Failed: 2, Skipped: 0, Time: 1.331s [D:\j\workspace\windows-TGrou---bb3e71cd\src\System.Net.WebSockets.WebSocketProtocol\tests\System.Net.WebSockets.WebSocketProtocol.Tests.csproj] 16:24:49 D:\j\workspace\windows-TGrou---bb3e71cd\Tools\tests.targets(492,5): warning MSB3073: The command ""D:\j\workspace\windows-TGrou---bb3e71cd\bin/tests/System.Net.WebSockets.WebSocketProtocol.Tests/netfx-Windows_NT-Release-x86//RunTests.cmd D:\j\workspace\windows-TGrou---bb3e71cd\bin/testhost/netfx-Windows_NT-Release-x86/"" exited with code 1. [D:\j\workspace\windows-TGrou---bb3e71cd\src\System.Net.WebSockets.WebSocketProtocol\tests\System.Net.WebSockets.WebSocketProtocol.Tests.csproj] 16:24:49 D:\j\workspace\windows-TGrou---bb3e71cd\Tools\tests.targets(500,5): error : One or more tests failed while running tests from 'System.Net.WebSockets.WebSocketProtocol.Tests' please check D:\j\workspace\windows-TGrou---bb3e71cd\bin/tests/System.Net.WebSockets.WebSocketProtocol.Tests/netfx-Windows_NT-Release-x86/testResults.xml for details! [D:\j\workspace\windows-TGrou---bb3e71cd\src\System.Net.WebSockets.WebSocketProtocol\tests\System.Net.WebSockets.WebSocketProtocol.Tests.csproj] 16:24:49 D:\j\workspace\windows-TGrou---bb3e71cd\dir.traversal.targets(77,5): error : (No message specified) [D:\j\workspace\windows-TGrou---bb3e71cd\src\tests.builds] ``` There have been ~200 runs that have failed at the same point. As far as I can tell the issue first occurred on January 18th. Based on that date and an offline discussion with the team I think the issue was probably introduced by PR #26429. You can find a few instances of failed runs here: [1](https://ci3.dot.net/job/dotnet_corefx/job/master/job/windows-TGroup_netfx+CGroup_Release+AGroup_x86+TestOuter_true_prtest/38/console), [2](https://ci3.dot.net/job/dotnet_corefx/job/master/job/windows-TGroup_netfx+CGroup_Release+AGroup_x86+TestOuter_true_prtest/34/console), [3](https://ci3.dot.net/job/dotnet_corefx/job/master/job/windows-TGroup_netfx+CGroup_Release+AGroup_x86+TestOuter_true_prtest/37/console) cc: @Priya91 " 26961 area-System.Security Support for RFC 3161 cryptographic timestamps with RFC 5816 additions "This change adds API to inspect, request, and create timestamp tokens in accordance with IETF RFC 3161 (Internet X.509 Public Key Infrastructure Time-Stamp Protocol (TSP)). The validation layer includes support for IETF RFC 5816 (ESSCertIDv2 Update for RFC 3161). Unlike the Win32 CryptRetrieveTimeStamp, this API does not provide ""Time-Stamp Protocol via HTTP"" functionality. Instead it provides enough of the processing logic to enable a client to do the HTTP(S) request using whatever preferred technology they desire, or to implement any of the other protocols (email, file, sockets, or a custom solution) as their application sees fit. Rfc3161TimestampRequest.CreateForSignerInfo and Rfc3161TimestampToken.VerifyForSignerInfo provide an accelerated path for IETF RFC 3161 Appendix A (Signature Time-stamp attribute using CMS). References: * https://tools.ietf.org/html/rfc3161 * https://tools.ietf.org/html/rfc5816 Fixes #24524." 26962 area-System.Net DO NOT MERGE: test HttpClient cookie handling 26963 area-Infrastructure Add TestUtilities NuGet package To be consumed by CoreRT in connection with the work done in https://github.com/dotnet/corert/pull/5329. cc @joperezr 26964 area-System.Net Expose SocketsHttpHandler - Renames ManagedHandler to SocketsHttpHandler - Moves a bunch of files around accordingly - Updates System.Net.WebSockets.Client to use SocketsHttpHandler directly - Updates System.Net.Http's tests with a reflection-based rather than TLS-based method for instantiating an HttpClientHandler backed by a SocketsHttpHandler. - Adds some more tests cc: @geoffkizer, @davidsh, @Priya91, @wfurt, @karelz Closes https://github.com/dotnet/corefx/issues/23166 Closes https://github.com/dotnet/corefx/issues/26895 Closes https://github.com/dotnet/corefx/issues/26960 26965 area-System.Data Crash in SqlConnection.Close() when using TransactionScope on linux. "I'm using SqlClient 4.5.0-preview1-26207-04 in netcoreapp2.0. ``` .NET Command Line Tools (2.0.0) Product Information: Version: 2.0.0 Commit SHA-1 hash: cdcd1928c9 Runtime Environment: OS Name: centos OS Version: 7 OS Platform: Linux RID: centos.7-x64 Base Path: /usr/share/dotnet/sdk/2.0.0/ Microsoft .NET Core Shared Framework Host Version : 2.0.0 Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d ``` The following snippet would crash on the above machine (removed some code for brevity). Works without issues on Windows. ```c# using (var txscope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled)) using (var cn = _dBProvider.GetWriteConnection()) { await cn.OpenAsync(); if (cmd.RecordCertificationStatus) { await cn.ExecuteAsync(@""INSERT INTO (...) (@iduser, @idtitle, @value, getdate()); "", new { @iduser = cmd.SubId, @idtitle=cmd.EntityId, @value = cmd.Model.IsCertified }); } await cn.ExecuteAsync(sql, data); txscope.Complete(); } ``` Both statements are inserts. Stacktrace is below: ``` ""System.NullReferenceException: Object reference not set to an instance of an object. at System.Data.ProviderBase.DbConnectionPool.DeactivateObject(DbConnectionInternal obj) at System.Data.ProviderBase.DbConnectionPool.PutObject(DbConnectionInternal obj, Object owningObject) at System.Data.ProviderBase.DbConnectionInternal.CloseConnection(DbConnection owningObject, DbConnectionFactory connectionFactory) at System.Data.SqlClient.SqlConnection.Close() at System.Data.SqlClient.SqlConnection.Dispose(Boolean disposing) at System.ComponentModel.Component.Dispose() at ...TitleUpdate.Handler.<HandleCore>d__2.MoveNext() in ...TitleUpdate.cs:line 189 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at MediatR.Internal.RequestHandlerWrapperImpl`1.<>c__DisplayClass0_0.<<Handle>g__Handler0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at ...ValidationBehavior`2.<Handle>d__2.MoveNext() in ...ValidationBehavior.cs:line 34 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at ....TitlesController.<Update>d__5.MoveNext() in TitleController.cs:line 98 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeActionMethodAsync>d__12.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeNextActionFilterAsync>d__10.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeInnerFilterAsync>d__14.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.<InvokeNextExceptionFilterAsync>d__23.MoveNext()"" ```" 26966 area-System.Console System.Console fails with ncurses 6.1 Released on Jan 27, 2018 - Announcement https://www.gnu.org/software/ncurses/ Original report: https://bugs.archlinux.org/task/57260 ``` MSBUILD : error MSB1025: An internal failure occurred while running MSBuild. System.InvalidOperationException: The terminfo database is invalid. at System.TermInfo.Database..ctor(String term, Byte[] data) at System.TermInfo.Database.ReadDatabase(String term, String directoryPath) at System.TermInfo.Database.ReadDatabase(String term) at System.TermInfo.Database.ReadActiveDatabase() at System.ConsolePal.TerminalFormatStrings.<>c.<.cctor>b__27_0() at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) at System.Lazy`1.CreateValue() at System.ConsolePal.EnsureInitializedCore() at System.ConsolePal.ControlCHandlerRegistrar.Register() at System.Console.add_CancelKeyPress(ConsoleCancelEventHandler value) at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine) in E:\A\_work\17\s\src\MSBuild\XMake.cs:line 526 Unhandled Exception: System.InvalidOperationException: The terminfo database is invalid. at System.TermInfo.Database..ctor(String term, Byte[] data) at System.TermInfo.Database.ReadDatabase(String term, String directoryPath) at System.TermInfo.Database.ReadDatabase(String term) at System.TermInfo.Database.ReadActiveDatabase() at System.ConsolePal.TerminalFormatStrings.<>c.<.cctor>b__27_0() at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) at System.Lazy`1.CreateValue() at System.ConsolePal.EnsureInitializedCore() at System.ConsolePal.ControlCHandlerRegistrar.Register() at System.Console.add_CancelKeyPress(ConsoleCancelEventHandler value) at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine) in E:\A\_work\17\s\src\MSBuild\XMake.cs:line 748 at Microsoft.Build.CommandLine.MSBuildApp.Main(String[] args) in E:\A\_work\17\s\src\MSBuild\XMake.cs:line 215 ``` 26967 area-System.Net "HttpClient PostAsync throws exception ""The server returned an invalid or unrecognized response"" when using linux container" "When I ran following code in Windows or Visual Studio, it worked fine. ```c# var httpClientHander = new HttpClientHandler() { AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip }; using (var client = new HttpClient(httpClientHander)) { client.DefaultRequestHeaders.Add(""Authorization"", $""Basic {_authorizationHeaderValue}""); var soapMessage = CreateSoapRequestForGetDocument(); using (var response = await client.PostAsync(_options.Value.BaseUri, new StringContent(soapMessage, Encoding.UTF8, ""text/xml""))) { documentResponse = await response.Content.ReadAsStringAsync(); } } ``` However, when I ran it with docker using Linux container, I got this error: ``` System.Net.Http.HttpRequestException: The server returned an invalid or unrecognized response. at System.Net.Http.CurlResponseHeaderReader.ReadHeader(String& headerName, String& headerValue) at System.Net.Http.CurlHandler.MultiAgent.CurlReceiveHeadersCallback(IntPtr buffer, UInt64 size, UInt64 nitems, IntPtr context) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) ``` I inspected the response via Fiddler and the raw response is like this: ``` > HTTP/1.1 200 OK Date: Wed, 07 Feb 2018 21:02:57 GMT Server: Web Server Vary: Accept-Encoding X-Robots-Tag: noindex Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Content-Type: multipart/related; type=""application/xop+xml""; start=""<soap.xml@xfire.codehaus.org>""; start-info=""text/xml""; boundary=""----=_Part_166_1126302715.1518037377448"" Content-Length: 2488 ------=_Part_166_1126302715.1518037377448 Content-Type: application/xop+xml; charset=UTF-8; type=""text/xml"" Content-Transfer-Encoding: 8bit Content-ID: <soap.xml@xfire.codehaus.org> <soap:Envelope xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""><soap:Body><ns1:getDocumentResponse xmlns:ns1=""http://www.test.com/ws/integration""><ns1:Document xmlns:ns2=""http://www.w3.org/2004/11/xmlmime"" ns2:contentType=""text/xml; charset=UTF-8""><Include xmlns=""http://www.w3.org/2004/08/xop/include"" href=""cid:1518037377448449414076338@http://www.w3.org/2001/XMLSchema""/></ns1:Document></ns1:getDocumentResponse></soap:Body></soap:Envelope> ------=_Part_166_1126302715.1518037377448 Content-Type: text/xml; charset=UTF-8 Content-Transfer-Encoding: binary Content-ID: <1518037377448449414076338@http://www.w3.org/2001/XMLSchema> <Document xmlns=""http://www.test.com/ws/integration""> </Document> ------=_Part_166_1126302715.1518037377448-- ``` I have tried to use HttpWebRequest, WebClient or RestSharp and I got the same error message from all of them. ## Steps to reproduce Call post async method with HttpClient in docker Linux container ## Expected behavior Get the SOAP response (Works fine on Windows). ## Actual behavior An exception was thrown ## Environment data Product Information: Windows 10 Version: .NET Core 2.0 / .NET Standard 2.0 Docker: Community Edition Version 17.12.0-ce-win47 (15139) [EDIT] Format code sample and logs/stacks, add syntax highlighting by @karelz" 26970 area-System.Runtime Fixing a regression introduced by the previous test fix. My previous fix introduced a regression which was not caught in normal desktop test runs. 26971 area-Infrastructure Adding a new resource string to .resx file doesn't regenerate generated SR.cs "Repro: 1. Open `corefx\src\System.Reflection.Metadata\System.Reflection.Metadata.sln` in VS. 2. Open `corefx\src\System.Reflection.Metadata\src\Resources\Strings.resx` 3. Add a new resource string and save the .resx file, e.g. ```xml <data name=""Foo"" xml:space=""preserve""> <value>Foo</value> </data> ``` 4. Open any .cs file and type `SR.Foo`. `Foo` is not in completion. 5. Build. Build fails due to missing `SR.Foo` property. **Expected behavior** `SR.Foo` is generated as soon as the .resx file is saved." 26975 area-System.Net CookieCollection should implement ICollection<Cookie> It implements `ICollection`, but not `ICollection<Cookie>`. 26976 area-System.Reflection Add support for PDB Checksum debug directory entry Implements proposal https://github.com/dotnet/corefx/issues/26935 The CodeView debug directory entry in PE/COFF file associates the PE file with one or more PDBs. The CodeView entry and the PDB both store the same PDB ID (for Portable PDB it's 20B for Windows PDB it's 16B of data). Debuggers, symbol servers and other tools use the PDB ID to match the PE file with the PDB. Although the PDB ID is good enough for finding the right PDB for the PE file it is not good enough for validating that the PDB has not been maliciously modified. _PDB Checksum_ is a new debug directory record that can be used for such validation. _PDB Checksum_ comprises of crypto hash algorithm name and the hash of the PDB content. See [Specification](https://github.com/dotnet/corefx/blob/master/src/System.Reflection.Metadata/specs/PE-COFF.md#pdb-checksum-debug-directory-entry-type-19) for details. This change introduces new APIs that allow tools to read and write PDB Checksum. 26978 area-System.IO Make Unix filename conversion lazy Also hook error handling. I'm working on shifting to IntPtr instead of SafeHandle like the Windows impl. cc: @danmosemsft, @pjanotti, @tarekgh 26979 area-System.Net Add test infra for auth testing. fixes #26375 @dotnet/ncl 26980 area-System.Net [New test] Test failure: System.Net.Http.Functional.Tests.HttpProtocolTests / GetAsync_InvalidStatusLine_ThrowsException "[8 test cases](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180209.01/workItem/System.Net.Http.Functional.Tests) fail on Fedora27 and Ubuntu17.10 (probably due to different libcurl version which changed the behavior) - introduced in #26798 * ""HTTP/1.1 "" * ""HTTP/1.1 !11"" * ""HTTP/1.1 "" (looks same as the first one - unclear why) * ""HTTP/1.1 a11"" * ""HTTP/1.1 abc"" * ""HTTP/1.1\\t"" * ""HTTP/1.1\\t\\t"" * ""HTTP/1.A 200 OK"" I would recommend to skip the test cases on CurlHandler in general." 26981 area-Infrastructure Add Ubuntu 18 to supported Linux list 26982 area-System.Net Disable Http status line parsing test cases on CurlHandler Closes: #26980 26983 area-System.Net CurlHandler: container cookies are not sent if you add a Cookie header to the header collection "If you add a Cookie header via ```csharp requestMessage.Headers.Add(""Cookie"", ""A=1""); ``` This causes cookies from the cookie container to not be sent. WinHttpHandler appends the cookies from the cookie container to the specified Cookie: header." 26984 area-System.Net SocketsHttpHandler: container cookies are incorrectly handled if you add a Cookie header to the cookie collection "If you add a Cookie header via ```csharp requestMessage.Headers.Add(""Cookie"", ""A=1""); ``` This causes cookies from the cookie container to be appended using the "","" separator, which is incorrect for cookies -- they use "";"" as a separator instead. WinHttpHandler appends the cookies properly." 26985 area-System.Net SocketsHttpHandler: incorrect cookie behavior with redirects When processing a redirect, the redirected request will be sent with cookies for both the initial request and the redirected request. Should be only the latter. 26986 area-System.Net WinHttpHandler: cookies received on a 401 response are not added to the CookieContainer If the server sends a 401 auth challenge with a Set-Cookie header, the cookie is not added to the CookieContainer. SocketsHttpHandler and CurlHandler handle this correctly. 26988 area-System.IO [Regression] Test failure: System.IO.Tests.* / DeleteRoot Affected OS: * All Linux & Mac OS Affected tests: * System.IO.Tests.DirectoryInfo_Delete / DeleteRoot * System.IO.Tests.DirectoryInfo_Delete_bool / DeleteRoot * System.IO.Tests.Directory_Delete_str / DeleteRoot * System.IO.Tests.Directory_Delete_str_bool / DeleteRoot Failure: ``` Assert.Throws() Failure Expected: typeof(System.IO.IOException) Actual: typeof(System.IO.DirectoryNotFoundException): Could not find a part of the path '/'. at System.IO.FileSystem.RemoveDirectory(String fullPath, Boolean recursive) ``` ## History of failures Day | Build | Details -- | -- | -- 2/9 | 20180209.01 | 56x (14 OS's) - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180209.01/workItem/System.IO.FileSystem.Tests) 2/9 | 20180209.03 | 48x (12 OS's) - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180209.03/workItem/System.IO.FileSystem.Tests) 2/9 | 20180209.05 | 56x - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180209.05/workItem/System.IO.FileSystem.Tests) 2/10 | 20180210.01 | 60x (15 OS's) - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180210.01/workItem/System.IO.FileSystem.Tests) 2/10 | 20180210.03 | 56x - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180210.03/workItem/System.IO.FileSystem.Tests) 26989 area-System.Net SocketsHttpHandler: Fix some issues with cookie handling, and add cookie tests Remove CookieHandler and integrate the cookie handling logic into HttpConnection, which fixes some issues with how cookies were handled. Add a bunch of protocol tests for cookie handling. Issues filed for failures in CurlHandler and WinHttpHandler. Fixes #26984 Fixes #26985 26990 area-System.Security Crypto provider wrappers in System.Security.Cryptography.Algorithms PR #12964 added crypto wrappers. I'm able to use them targeting netstandard 2.x but not for netstandard1.x. I see that those providers are not included as part of `System.Security.Cryptography.Algorithms` package (v4.3.1). Would it be possible to include them as part of the nuget package? 26991 area-System.Net HttpClient not setting Accept-Encoding: gzip, deflate on older Windows versions ".NET Core 2.1.4 SDK ```csharp var handler = new HttpClientHandler() { AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate }; using (var client = new HttpClient(handler)) { response = client.GetStringAsync(""http://scooterlabs.com/echo"").Result; } ``` On a Windows 2008 R2 box, it looks like `Accept-Encoding` is **not** set even though the `HttpClientHandler` has compression set. Windows 2008 R2 ``` [headers] => Array ( [Connection] => Keep-Alive [Host] => scooterlabs.com ) ``` Windows 10 ``` [headers] => Array ( [Connection] => Keep-Alive [Accept-Encoding] => gzip, deflate [Host] => scooterlabs.com ) ``` This works as expected on a Windows 10 box and Windows 8.1 VM. If you force the headers to be sent however, on Windows 2008 R2 it decompresses fine, so compression is supported. If you use WebClient or HttpWebRequest directly with `AutomaticDecompression` set it works on all versions with the correct headers and ability to handle the compressed payload. This works on all environments ```csharp var handler = new HttpClientHandler() { AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate }; using (var client = new HttpClient(handler)) { client.DefaultRequestHeaders.AcceptEncoding.Add(new StringWithQualityHeaderValue(""gzip"")); client.DefaultRequestHeaders.AcceptEncoding.Add(new StringWithQualityHeaderValue(""deflate"")); response = client.GetStringAsync(""http://scooterlabs.com/echo"").Result; } ``` P/s: SO question is here https://stackoverflow.com/questions/48703143/httpclient-not-sending-accept-encoding-on-different-machine " 26993 area-Infrastructure Clear initlocals in a bunch of assemblies Sets ```XML <ILLinkClearInitLocals>true</ILLinkClearInitLocals> ``` for the assemblies: - System.IO.FileSystem - System.IO.Pipes - System.Memory - System.Net.Http - System.Net.Http.WinHttpHandler - System.Net.NameResolution - System.Net.NetworkInformation - System.Net.Primitives - System.Net.Requests - System.Net.Security - System.Net.Sockets - System.Net.WebSockets - System.Net.WebSockets.Client - System.Net.WebSockets.WebSocketsProtocol - System.Private.Uri - System.Runtime - System.Runtime.Extensions Eventually we'd ideally set the flag (or eventually compiler switch) for the whole repo; these are just the ones I audited thus far. In a few cases I had to make code changes to adapt, where the code was expecting stackallocs to be cleared. I also looked at a few other projects (System.Collections, System.Runtime.Numerics) where there were more significant dependencies on clearing and I decided to leave those for later. Contributes to https://github.com/dotnet/corefx/issues/26939 cc: @jkotas, @erozenfeld, @VSadov 26994 area-System.Reflection Add new overload to System.Reflection.Assembly to load from Stream ## Rationale Currently we can load an assembly from byte array or by file name: ```c# public static Assembly Load(byte[] rawAssembly); public static Assembly Load(byte[] rawAssembly, byte[] rawSymbolStore); public static Assembly Load(AssemblyName assemblyRef); public static Assembly Load(string assemblyString); public static Assembly LoadFile(string path); public static Assembly LoadFrom(string assemblyFile, byte[] hashValue, Configuration.Assemblies.AssemblyHashAlgorithm hashAlgorithm); public static Assembly LoadFrom(string assemblyFile); ``` If we compile dynamically in a memory stream we have to do extra allocations to load the assembly: ```c# using (var ms = new MemoryStream()) { emitResult = compilation.Emit(peStream: ms, options: _emitOptions); if (emitResult.Success) { ms.Flush(); ms.Seek(0, SeekOrigin.Begin); Assembly assembly = Assembly.Load(ms.ToArray()); } } ``` ### Proposed API ```c# // Load the assembly from Stream. public static Assembly Load(Stream assemblyStream); ``` ### Update There is `AssemblyLoadContext.Default.LoadFromStream()` in `System.Reflection.Loader` but its hard to find. 26995 area-System.Net Add DecompressionMethods.Brotli? "System.Net.DecompressionMethods is an enum that is used by HttpClient handlers to determine whether/what to automatically decode in a response, e.g. if DecompressionMethods.Deflate is set and the response is encoded with deflate, it'll automatically decode the response as part of handing it back. The enum today is just: ```C# namespace System.Net { [Flags] public enum DecompressionMethods { None = 0, GZip = 1, Deflate = 2 } } ``` but we now also have BrotliStream, which we could use to support a DecompressionMethods.Brotli and a ""br"" encoding: ```C# namespace System.Net { [Flags] public enum DecompressionMethods { ... Brotli = 4 } } ``` From an implementation perspective, this would mean either System.Net.Http.dll taking a dependency on System.IO.Compression.Brotli.dll, or if we wanted to avoid the dependency, building all of the source into System.Net.Http.dll (there is currently a native dependency, with the native portion compiled into clrcompression.dll on Windows and System.IO.Compression.Native.so/dylib on Unix)." 26996 area-System.IO System.MissingMethodException : Method not found: 'Void System.IO.Compression.ZipFileExtensions.ExtractToFile(System.IO.Compression.ZipArchiveEntry, System.String, Boolean)' I'm having the following error when targetting netappcore2.0 and net471: System.MissingMethodException : Method not found: 'Void System.IO.Compression.ZipFileExtensions.ExtractToFile(System.IO.Compression.ZipArchiveEntry, System.String, Boolean)'. Is this a new bug? Is there any workaround available? Thanks. 26997 area-System.Net Trying to collect info about ping test failures in macOS 10.12 See #26358 26999 area-System.Collections Queue/Stack batch item Enqueue/Push "`Queue` and `Stack` in the `System.Collections.Generic` namespace currently only implement methods to enqueue/push single objects to the collection. In order to add multible elements, the source collection has to be enumerated, that could potentialy lead to a performance loss based on the required iterations. # Usage Because of performance, large input collections would profit from such a change. ````cs private static async void UseCaseLogic() { var workQueue = new Queue<char>(); var siteList = new List<string> { ""https://google.com"", ""https://github.com"", }; using (var wc = new WebClient()) { foreach (var cSite in siteList) { var cSiteText = await wc.DownloadStringTaskAsync(cSite); workQueue.EnqueueRange(cSiteText.ToCharArray()); } } while (workQueue.Count != 0) { var cItem = workQueue.Dequeue(); //Process } } ```` # Proposed API additions Because of a simmilar method in `List<T>` (`AddRange`) naming the new APIs `EnqueueRange`/`PushRange` appears to be the most logical way. ````cs namespace System.Collections.Generic { public class Stack<T> : IEnumerable<T>, IEnumerable, ICollection, IReadOnlyCollection<T> { public void EnqueueRange(IEnumerable<T> item); public void EnqueueRange(T[] item); } } ```` ````cs namespace System.Collections.Generic { public class Queue<T> : IEnumerable<T>, IEnumerable, ICollection, IReadOnlyCollection<T> { public void PushRange(IEnumerable<T> item); public void PushRange(T[] item); } } ```` # Open Questions In which order should the source array/collection be Inserted? Would reordering the source void the performance gains?" 27000 area-System.Net " The handler does not support client authentication certificates with this combination of libcurl (7.54.0) and its SSL backend (""LibreSSL/2.0.20"")" "I'm having an issue when calling an endpoint with the following code, and I don't know what can solve that critical issue on mac: ``` var handler = new HttpClientHandler(); handler.ClientCertificates.Add(cert); var client = new HttpClient(handler); var result = await client.GetAsync(url); ``` The error is below: ``` System.PlatformNotSupportedException: The handler does not support client authentication certificates with this combination of libcurl (7.54.0) and its SSL backend (""LibreSSL/2.0.20""). at System.Net.Http.CurlHandler.SslProvider.SetSslOptions(EasyRequest easy, ClientCertificateOption clientCertOption) at System.Net.Http.CurlHandler.EasyRequest.InitializeCurl() at System.Net.Http.CurlHandler.MultiAgent.ActivateNewRequest(EasyRequest easy) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() ``` **curl --version** ``` curl 7.54.0 (x86_64-apple-darwin17.0) libcurl/7.54.0 LibreSSL/2.0.20 zlib/1.2.11 nghttp2/1.24.0 Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp Features: AsynchDNS IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz HTTP2 UnixSockets HTTPS-proxy ``` **dotnet info** ``` .NET Command Line Tools (2.1.4) Product Information: Version: 2.1.4 Commit SHA-1 hash: 5e8add2190 Runtime Environment: OS Name: Mac OS X OS Version: 10.13 OS Platform: Darwin RID: osx.10.12-x64 Base Path: /usr/local/share/dotnet/sdk/2.1.4/ Microsoft .NET Core Shared Framework Host Version : 2.0.5 Build : 17373eb129b3b05aa18ece963f8795d65ef8ea54 ```" 27001 area-System.Memory API proposal: ReferenceCountedDisposable<T> ## Summary This proposal simplifies the use of disposable resources shared through code where single owner of the resource is either unclear, or complicates maintenance of the code. This situation is increasingly common when asynchronous code which needs to operate on a threading-agnostic API where the `Dispose` operation is explicitly called out as not safe for concurrent use. The semantics of a safe, shared wrapper for `IDisposable` objects is challenging, especially when considerations are made for handling missing and/or multiple calls to `Dispose` and for weakly-held references. Providing a holder for managing lifetimes of these objects allows developers to focus on the semantics of the underlying shared object, which is always a challenge in itself. ## Proposed API ```csharp namespace System.Memory { public sealed class ReferenceCountedDisposable<T> : IDisposable where T : class, IDisposable { public ReferenceCountedDisposable(T instance); public T Target { get; } public ReferenceCountedDisposable<T> TryAddReference(); public void Dispose(); public struct WeakReference { public WeakReference(ReferenceCountedDisposable<T> reference); public ReferenceCountedDisposable<T> TryAddReference(); } } } ``` ## Semantics A reference-counting wrapper which allows multiple uses of a single disposable object in code, which is deterministically released (by calling `IDisposable.Dispose`) when the last reference is disposed. Each instance of `ReferenceCountedDisposable<T>` represents a counted reference (also referred to as a *reference* in the following documentation) to a target object. Each of these references has a lifetime, starting when it is constructed and continuing through its release. During this time, the reference is considered *alive*. Each reference which is alive owns exactly one reference to the target object, ensuring that it will not be disposed while still in use. A reference is released through either of the following actions: * The reference is explicitly released by a call to `Dispose`. * The reference is no longer in use by managed code and gets reclaimed by the garbage collector. While each instance of `ReferenceCountedDisposable<T>` should be explicitly disposed when the object is no longer needed by the code owning the reference, this implementation will not leak resources in the event one or more callers fail to do so. When all references to an object are explicitly released (i.e. by calling `Dispose`), the target object will itself be deterministically released by a call to `IDisposable.Dispose` when the last reference to it is released. However, in the event one or more references is not explicitly released, the underlying object will still become eligible for non-deterministic release (i.e. finalization) as soon as each reference to it is released by one of the two actions described previously. When using `ReferenceCountedDisposable<T>`, certain steps must be taken to ensure the target object is not disposed early. 1. Use `ReferenceCountedDisposable<T>` consistently. In other words, do not mix code using reference-counted wrappers with code that references to the target directly. 1. Only use the `ReferenceCountedDisposable<T>(T reference)` constructor one time per target object. Additional references to the same target object must only be obtained by calling `TryAddReference`. 1. Do not call `IDisposable.Dispose` on the target object directly. It will be called automatically at the appropriate time, as described above. All public methods on this type adhere to their pre- and post-conditions and will not invalidate state even in concurrent execution. ### `ReferenceCountedDisposable<T>.TryAddReference` Increments the reference count for the disposable object, and returns a new disposable reference to it. The returned object is an independent reference to the same underlying object. Disposing of the returned value multiple times will only cause the reference count to be decreased once. Return value: a new `ReferenceCountedDisposable<T>` pointing to the same underlying object, if it has not yet been disposed; otherwise, `null` if this reference to the underlying object has already been disposed. ### `ReferenceCountedDisposable<T>.WeakReference` Represents a weak reference to a `ReferenceCountedDisposable<T>` which is capable of obtaining a new counted reference up until the point when the object is no longer accessible. ### Differences between `TryAddReference` operations The semantics of `ReferenceCountedDisposable<T>.TryAddReference` and `ReferenceCountedDisposable<T>.WeakReference.TryAddReference` are slightly different: * `ReferenceCountedDisposable<T>.TryAddReference`: This method returns `null` after *this reference* is disposed. In other words, it is possible for other references to the target object to still be held in code. * `ReferenceCountedDisposable<T>.WeakReference.TryAddReference`: This method returns `null` after *the last reference* to the target object is disposed. 27004 area-System.Runtime Wrong Type equality behavior when loading assembly from file I take a Type, query its assembly location, and then load the assembly from the same address, and find the same type from the loaded assembly. The resulting type is not equal to the original type. Here's the test case: [TestMethod] public void TestTypeLoadingWithFilePath() { var originalType = typeof(SomeClass); var assemblyAddress = originalType.Assembly.Location; var loadedAssembly = Assembly.LoadFile(assemblyAddress); Assert.IsNotNull(loadedAssembly); var loadedType = loadedAssembly.GetType(originalType.FullName); Assert.IsNotNull(loadedType); Assert.AreEqual(originalType, loadedType); } The test fails on the last assertion. This only happens on .NET Core on Windows. (I'm testing against latest version, 2.1.4). But this was not the case with .NET Framework. Is this by design, or a bug? If it's by design, why? Again, if it's by design, doesn't this mean different behavior between two implementations of .NET Standard? (.NET Core vs. .NET Framework) 27006 area-System.Net System.Net.Security.SslStream throws exception while running EF tests "While running EF tests on Ubuntu against netcoreapp2.1 an exception is thrown ``` Failed Microsoft.EntityFrameworkCore.SqlServerDatabaseCreatorEnsureDeletedTest.Deletes_database(async: False, open: True, ambientTransaction: False) Error Message: System.NotSupportedException : The WriteAsync method cannot be called when another write operation is pending. Stack Trace: at System.Net.Security.SslStreamInternal.WriteAsyncInternal[TWriteAdapter](TWriteAdapter writeAdapter, ReadOnlyMemory`1 buffer) at System.Net.Security.SslStreamInternal.Write(Byte[] buffer, Int32 offset, Int32 count) at System.Net.Security.SslStream.Write(Byte[] buffer, Int32 offset, Int32 count) at System.Data.SqlClient.SNI.SNITCPHandle.Send(SNIPacket packet) at System.Data.SqlClient.SNI.SNIMarsConnection.Send(SNIPacket packet) at System.Data.SqlClient.SNI.SNIMarsHandle.SendControlPacket(SNISMUXFlags flags) at System.Data.SqlClient.SNI.SNIMarsHandle.Dispose() at System.Data.SqlClient.SNI.TdsParserStateObjectManaged.Dispose() at System.Data.SqlClient.TdsParser.Disconnect() at System.Data.SqlClient.SqlInternalConnectionTds.Dispose() at System.Data.ProviderBase.DbConnectionPool.DestroyObject(DbConnectionInternal obj) at System.Data.ProviderBase.DbConnectionPool.DeactivateObject(DbConnectionInternal obj) at System.Data.ProviderBase.DbConnectionPool.PutObject(DbConnectionInternal obj, Object owningObject) at System.Data.ProviderBase.DbConnectionInternal.CloseConnection(DbConnection owningObject, DbConnectionFactory connectionFactory) at System.Data.SqlClient.SqlConnection.Close() at System.Data.SqlClient.SqlConnection.Dispose(Boolean disposing) at System.ComponentModel.Component.Dispose() at Microsoft.EntityFrameworkCore.TestUtilities.RelationalTestStore.Dispose() in /home/saurabh/EntityFrameworkCore/src/EFCore.Relational.Specification.Tests/TestUtilities/RelationalTestStore.cs:line 41 at Microsoft.EntityFrameworkCore.TestUtilities.SqlServerTestStore.Dispose() in /home/saurabh/EntityFrameworkCore/test/EFCore.SqlServer.FunctionalTests/TestUtilities/SqlServerTestStore.cs:line 414 at Microsoft.EntityFrameworkCore.SqlServerDatabaseCreatorEnsureDeletedTest.<Delete_database_test>d__2.MoveNext() in /home/saurabh/EntityFrameworkCore/test/EFCore.SqlServer.FunctionalTests/SqlServerDatabaseCreatorTest.cs:line 154 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ``` Steps to repro Clone the EFCore repo `https://github.com/aspnet/EntityFrameworkCore` Build the repo from the root using build.sh Execute the tests in /EntityFrameworkCore/test/EFCore.SqlServer.FunctionalTests Steps: 1. Modify config.json to have a valid connection string (something like) ""Data Source=tcp:server,1437;Database=master;Integrated Security=False;Connect Timeout=60;ConnectRetryCount=0;uid=saurabh;pwd=*******;MultipleActiveResultSets=False"" 2. Execute test ``` ~/.dotnet/dotnet test --framework netcoreapp2.1 --filter=""FullyQualifiedName=Microsoft.EntityFrameworkCore.SqlServerDatabaseCreatorEnsureDeletedTest.Deletes_database"" ``` This test passes one out of every 5 times when run for framework netcoreapp2.1 Run the test against netcoreapp2.0 and it passes consistently. Some in System.Net.Security changed? Please contact me for the database password via email for quicker setup." 27007 area-System.IO Add System.IO.Pipelines API 94% coverage of new API Please check csprojes, configuration.props and other infrastructure files. It's my first time adding a package to corefx so I may have done some mistakes there. 27008 area-System.Net DO NOT MERGE: test multiple cookie header handling 27010 area-System.Data Restrict the Long Running option to MARS This PR partially address https://github.com/dotnet/corefx/issues/19836 Restrict the usage of Long Running while reading data off the stream, to cases which are reading data for MARS enabled connections. This is to restrict the side effects of LongRunning continuation option. Validated with EF tests. 27011 area-System.Data Bump System.Data.SqlClient assembly version to 4.4.0. Fixes https://github.com/dotnet/corefx/issues/26142 27013 area-System.IO Implement Snappy compression algorithm The Brotli algorithm has been recently implemented. I think that it would be nice to see a similar implementation for Snappy: it is very popular, cross platform, open source, with a lower compression but faster than Brotli. 27014 area-System.Numerics Add Vector.Narrow and Vector.Widen overloads to cast elemnts values between float and int, and between double and long I suggest to add these two overloads to the Vector.Narrow method: ``` Vector<int> Vector.Narrow(Vector<float>, ConversionType ct) Vector<long> Vector.Narrow(Vector<double> ConversionType ct) ``` where: ``` enum ConversionType { Floor, // Apply Mathf.Floor Ceiling, // Apply Mathf.Ceiling Truncate, // Apply Mathf.Truncate Round // Apply Mathf.Round } ``` Example: ``` var v1 = new Vector<float>({-1.4, 2.1, -3.9, 4.3}); var v2 = Vector.Narrow(v1, ConversionType.Floor); // <-2, 2, -4, 4> ``` By the way, It will be nice if we can use foreach to iterate Vector<T> elemnts using foreach.. I think more mathematical methods (like the ones in the Math class) can be added to the Vector class. The fact that the Vector<T> is immutable, demands some long codes to construct a new version containing individual results. Or, is there a chance to make the Indexer read-write? 27015 area-System.Net Not a good idea to specify charset parameter for some content types in StringContent https://github.com/dotnet/corefx/blob/6bf1e7c3032d3c24d5a41bbd880549ef4a8de2da/src/System.Net.Http/src/System/Net/Http/StringContent.cs#L31 I was building a `StringContent` object with a `mediaType` of `application/json`. That media type does not specify a `charset` parameter, which is unconditionally added in this class. Adding this parameter automatically is probably not a good idea. I'm not sure the right fix, I just know that `Content-Type: application/json; charset=utf-8` will choke some parsers. 27018 area-System.Collections Test failure in CI: System.Collections.Tests.LinkedList_Generic_Tests_string/AddBefore_LLNode_LLNode https://mc.dot.net/#/user/tmat/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Frelease~2F2.1~2F/test~2Ffunctional~2Fcli~2F/76c888d757bf1e9d470ceb4b93d3d00b5be5d4ec/workItem/System.Collections.Tests/analysis/xunit/System.Collections.Tests.LinkedList_Generic_Tests_string~2FAddBefore_LLNode_LLNode 27019 area-System.IO Fix Unix enumeration For non-trivial recursive enumerations we were running out of file descriptors. Stop creating them when we queue pending subdirectories and only create when we dequeue. 27021 area-System.Drawing [Ubuntu18.04] Test failed: System.Drawing.Imaging.Tests.EncoderParameterTests / Ctor_Encoder_NegativeNumberOfValues_Type_Value_OutOfMemoryException Failed on newly added distro Ubuntu 18.04. Related to #24274 (failing in the past) Failure: ``` Assert.Throws() Failure Expected: typeof(System.OutOfMemoryException) Actual: (No exception was thrown) at System.Drawing.Imaging.Tests.EncoderParameterTests.Ctor_Encoder_NegativeNumberOfValues_Type_Value_OutOfMemoryException(Int32 numberOfValues) in /root/corefx-1371172/src/System.Drawing.Common/tests/Imaging/EncoderParameterTests.cs:line 327 ``` ## History of failure Day | Build | Details -- | -- | -- 2/10 | 20180210.01 | [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180210.01/workItem/System.Drawing.Common.Tests/analysis/xunit/System.Drawing.Imaging.Tests.EncoderParameterTests~2FCtor_Encoder_NegativeNumberOfValues_Type_Value_OutOfMemoryException(numberOfValues:%20-1)) 2/10 | 20180210.03 | [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180210.03/workItem/System.Drawing.Common.Tests/analysis/xunit/System.Drawing.Imaging.Tests.EncoderParameterTests~2FCtor_Encoder_NegativeNumberOfValues_Type_Value_OutOfMemoryException(numberOfValues:%20-1)) 2/12 | 20180212.01 | [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180212.01/workItem/System.Drawing.Common.Tests/analysis/xunit/System.Drawing.Imaging.Tests.EncoderParameterTests~2FCtor_Encoder_NegativeNumberOfValues_Type_Value_OutOfMemoryException(numberOfValues:%20-1)) 2/12 | 20180212.01 | [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180212.05/workItem/System.Drawing.Common.Tests/analysis/xunit/System.Drawing.Imaging.Tests.EncoderParameterTests~2FCtor_Encoder_NegativeNumberOfValues_Type_Value_OutOfMemoryException(numberOfValues:%20-1)) 27022 area-System.Globalization [Ubuntu18.04] Test failed: System.Globalization.Tests.NumberFormatInfoCurrencyNegativePattern / CurrencyNegativePattern_Get Fails on newly added distro: Ubuntu 18.04 Failure: ``` Assert.Contains() Failure Not found: 1 In value: Int32[] [8] ``` ## History of failures Day | Build | Details -- | -- | -- 2/10 | 20180210.01 | [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180210.01/workItem/System.Globalization.Tests/analysis/xunit/System.Globalization.Tests.NumberFormatInfoCurrencyNegativePattern~2FCurrencyNegativePattern_Get(locale:%20%5C%22fa-IR%5C%22)) 2/10 | 20180210.03 | [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180210.03/workItem/System.Globalization.Tests/analysis/xunit/System.Globalization.Tests.NumberFormatInfoCurrencyNegativePattern~2FCurrencyNegativePattern_Get(locale:%20%5C%22fa-IR%5C%22)) 27023 area-System.Net [Ubuntu18.04] Tests failed: System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test / * Failed on newly added distro Ubuntu18.04 Affected tests: * `GetAsync_AllowedSSLVersionDiffersFromServer_ThrowsException` (Tls11/Tls12 args) * `GetAsync_DisallowTls10_AllowTls11_AllowTls12` Test failure: ``` Assert.Throws() Failure Expected: typeof(System.IO.IOException) Actual: typeof(System.Security.Authentication.AuthenticationException): A call to SSPI failed, see inner exception. at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, ExceptionDispatchInfo exception) in /root/corefx-1372297/src/System.Net.Security/src/System/Net/Security/SslState.cs:line 973 at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest) in /root/corefx-1372297/src/System.Net.Security/src/System/Net/Security/SslState.cs:line 820 at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) in /root/corefx-1372297/src/System.Net.Security/src/System/Net/Security/SslState.cs:line 791 at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest) in /root/corefx-1372297/src/System.Net.Security/src/System/Net/Security/SslState.cs:line 960 at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest) in /root/corefx-1372297/src/System.Net.Security/src/System/Net/Security/SslState.cs:line 863 at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest) in /root/corefx-1372297/src/System.Net.Security/src/System/Net/Security/SslState.cs:line 820 at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) in /root/corefx-1372297/src/System.Net.Security/src/System/Net/Security/SslState.cs:line 791 at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest) in /root/corefx-1372297/src/System.Net.Security/src/System/Net/Security/SslState.cs:line 960 at System.Net.Security.SslState.PartialFrameCallback(AsyncProtocolRequest asyncRequest) in /root/corefx-1372297/src/System.Net.Security/src/System/Net/Security/SslState.cs:line 1094 --- End of stack trace from previous location where exception was thrown --- at System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult result) in /root/corefx-1372297/src/System.Net.Security/src/System/Net/Security/SslState.cs:line 709 at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization) in /root/coreclr/src/mscorlib/src/System/Threading/Tasks/FutureFactory.cs:line 533 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.AcceptSocketAsync(Socket server, Func`5 funcAsync, Options options) in /root/corefx-1372297/src/Common/tests/System/Net/Http/LoopbackServer.cs:line 165 ``` ## History of failures Day | Build | Details -- | -- | -- 2/10 | 20180210.01 | 3x - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180210.01/workItem/System.Net.Http.Functional.Tests) 2/10 | 20180210.03 | 3x - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180210.03/workItem/System.Net.Http.Functional.Tests) 27024 area-System.IO Fix *Info classes for Unix when opened on root Regression I introduced. Created a new inner loop test that will catch this in the future. Fixes #26988 27029 area-System.Net Enable SocketsHttpHandler cancellation support This change significantly improves the cancellation support in SocketsHttpHandler. Previously we were passing the CancellationToken around to every method, eventually bottoming out in calls to the underlying Stream which then ends up passing them down to the underlying Socket. But today Socket's support for cancellation is minimal, only doing up-front checks; if cancellation is requested during the socket operation rather than before, the request will be ignored. Since HttpClient implements features like timeouts on top of cancellation support, it's important to do better than this. The change implements cancellation by registering with the CancellationToken to dispose of the connection. This will cause any reads/writes to wake up. We then translate resulting exceptions into cancellation exceptions. When in the main SendAsync method, we register once for the whole body of the operation until the point that we're returning the response message. For individual operations on the response content stream, we register per operation; however, when feasible we try to avoid the registration costs by only registering if operations don't complete synchronously. We also account for the case that on Unix, closing the connection may result in read operations waking up not with an exception but rather with EOF, which we also need to translate into cancellation when appropriate. Along the way I cleaned up a few minor issues as well. I also added a bunch of cancellation-related tests: - Test cancellation occurring while sending request content - Test cancellation occurring while receiving response headers - Test cancellation occurring while receiving response body and using a buffered operation - Test that all of the above are triggerable with CancellationTokenSource.Cancel, HttpClient.CancelPendingRequests, and HttpClient.Dispose - Test cancellation occurring while receiving response body and using an unbuffered operation, either a ReadAsync or CopyToAsync on the response stream - Test that a CancelPendingRequests doesn't affect unbuffered operations on the response stream There are deficiencies here in the existing handlers, and tests have been selectively disabled accordingly. SocketsHttpHandler passes now for all of them. I will open issues for the non-netfx issues and include the corresponding numbers in comments before merging. cc: @geoffkizer, @Priya91, @wfurt, @davidsh Fixes https://github.com/dotnet/corefx/issues/23131 Fixes https://github.com/dotnet/corefx/issues/23141 27031 area-System.Net SocketsHttpHandler should check for transfer encoding chunked without content WinHttpHandler and CurlHandler both fail if TransferEncodingChunked is set to true but request.Content is null. SocketsHttpHandler should check for that, too. And there should be a test. 27033 area-System.Numerics [Feature-Request] N-bit sized int and floating point types @hamarb123 commented on [Fri Feb 09 2018](https://github.com/dotnet/standard/issues/647) I propose we should be able to have N-bit sized int and floating point types. Here is how it could work: Obviously we already have the following: - int 1 / uint 1 (bool) - uint 8 (byte) - int 8 (sbyte) - uint 16, 32 and 64 (ushort, uint and ulong) - int 16, 32 and 64 (short, int and long) - float 32 (single) - float 64 (double) But what about the following: - (u)int 2 (2 bits) - (u)int 4 (4 bits) - (u)int 128 (128 bits) - (u)int 256 (256 bits) - (u)int 2^n (2^n bits) - (float 1 makes no sense but you could still add it) - float 2 (2 bits) - float 4 (4 bits) - float 8 (8 bits) - float 16 (16 bits) - float 128 (128 bits) - float 256 (256 bits) - float 2^n (2^n bits) The classes could be called the following: For integers: `intj` where j is a power of 2 for a j bit integer For unsigned integers: `uintj` where j is a power of 2 for a j bit unsigned integer For floats: `floatj` where j is a power of 2 for a j bit float And there could be special names for floats between `float8` and `float256` ranging from `quarter`, `half`, `single` (already in .NET), `double` (already in .NET), `quadruple`, `octuple` Why do I need this in my beloved c#? 1. Because it will give you more/less precise floats to use 2. It will give you more integers to use 3. There are no good floating point (bigger than double) libraries out there that do not just use System.Math which reduces it to double precision anyway Won't this ruin my IDE with millions of different type names? 1. Not if you make a maximum for the types (say 1024) or make it so that the IDE can have the ability to only show you some (say up to 1024) then it will not give you millions of types suggested 27035 area-System.Globalization Fixing test CurrencyNegativePattern_Get() on distro Ubuntu 18.04 Fixing test CurrencyNegativePattern_Get() on newly added distro Ubuntu 18.04 From class/project System.Globalization.Tests.NumberFormatInfoCurrencyNegativePattern Fixes #27022 27036 area-System.Drawing Disable drawing test for distro Ubuntu18.04 Related to #27021 27037 area-System.Net Test failed: System.Net.Http.WinHttpHandlerFunctional.Tests.ServerCertificateTest / UseCallback_CallbackReturnsFailure_ThrowsInnerSecurityFailureException Failed tests: System.Net.Http.WinHttpHandlerFunctional.Tests.ServerCertificateTest.UseCallback_CallbackReturnsFailure_ThrowsInnerSecurityFailureException Details: https://ci.dot.net/job/dotnet_corefx/job/master/job/outerloop_netcoreapp_win7_release/398/testReport/System.Net.Http.WinHttpHandlerFunctional.Tests/ServerCertificateTest/UseCallback_CallbackReturnsFailure_ThrowsInnerSecurityFailureException/ Configuration: Outerloop_netcoreapp_win7_debug MESSAGE: Assert.Equal() Failure\r\nExpected: 12175\r\nActual: 12017 +++++++++++++++++++ STACK TRACE: at System.Net.Http.WinHttpHandlerFunctional.Tests.ServerCertificateTest.UseCallback_CallbackReturnsFailure_ThrowsInnerSecurityFailureException() --- End of stack trace from previous location where exception was thrown --- 27038 area-System.IO DirectoryEntry.GetName assert failure on macOS https://mc.dot.net/#/user/stephentoub/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/a137bbf42598202f999ead31d92754613145c849/workItem/System.IO.Tests/wilogs ``` 2018-02-10 19:37:45,431: INFO: proc(54): run_and_log_output: Output: Discovering: System.IO.Tests 2018-02-10 19:37:45,666: INFO: proc(54): run_and_log_output: Output: Discovered: System.IO.Tests 2018-02-10 19:37:45,821: INFO: proc(54): run_and_log_output: Output: Starting: System.IO.Tests 2018-02-10 19:37:46,351: INFO: proc(54): run_and_log_output: Output: Assertion Failed 2018-02-10 19:37:46,351: INFO: proc(54): run_and_log_output: Output: should not have embedded nulls 2018-02-10 19:37:46,351: INFO: proc(54): run_and_log_output: Output: 2018-02-10 19:37:46,351: INFO: proc(54): run_and_log_output: Output: at Interop.Sys.DirectoryEntry.GetName(Span`1 buffer) 2018-02-10 19:37:46,351: INFO: proc(54): run_and_log_output: Output: at System.IO.Enumeration.FileSystemEntry.get_FileName() 2018-02-10 19:37:46,352: INFO: proc(54): run_and_log_output: Output: at System.IO.Enumeration.FileSystemEnumerableFactory.<>c__DisplayClass5_0.<UserEntries>b__1(FileSystemEntry& entry) 2018-02-10 19:37:46,352: INFO: proc(54): run_and_log_output: Output: at System.IO.Enumeration.FileSystemEnumerable`1.DelegateEnumerator.ShouldIncludeEntry(FileSystemEntry& entry) 2018-02-10 19:37:46,352: INFO: proc(54): run_and_log_output: Output: at System.IO.Enumeration.FileSystemEnumerator`1.MoveNext() 2018-02-10 19:37:46,352: INFO: proc(54): run_and_log_output: Output: at System.IO.FileSystem.RemoveDirectoryInternal(DirectoryInfo directory, Boolean recursive, Boolean throwOnTopLevelDirectoryNotFound) 2018-02-10 19:37:46,353: INFO: proc(54): run_and_log_output: Output: at System.IO.FileSystem.RemoveDirectory(String fullPath, Boolean recursive) 2018-02-10 19:37:46,353: INFO: proc(54): run_and_log_output: Output: at System.IO.Directory.Delete(String path, Boolean recursive) 2018-02-10 19:37:46,353: INFO: proc(54): run_and_log_output: Output: at System.IO.FileCleanupTestBase.Dispose(Boolean disposing) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/CoreFx.Private.TestUtilities/src/System/IO/FileCleanupTestBase.cs:line 66 2018-02-10 19:37:46,354: INFO: proc(54): run_and_log_output: Output: at System.IO.FileCleanupTestBase.Dispose() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/CoreFx.Private.TestUtilities/src/System/IO/FileCleanupTestBase.cs:line 57 2018-02-10 19:37:46,354: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.ExecutionTimer.Aggregate(Action action) 2018-02-10 19:37:46,354: INFO: proc(54): run_and_log_output: Output: at ReflectionAbstractionExtensions.DisposeTestClass(ITest test, Object testClass, IMessageBus messageBus, ExecutionTimer timer, CancellationTokenSource cancellationTokenSource) 2018-02-10 19:37:46,354: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.ExceptionAggregator.Run(Action code) 2018-02-10 19:37:46,354: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestInvoker`1.<RunAsync>b__45_0() 2018-02-10 19:37:46,355: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /Users/buildagent/agent/_work/382/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-10 19:37:46,355: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestInvoker`1.<RunAsync>b__45_0() 2018-02-10 19:37:46,355: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.ExceptionAggregator.RunAsync[T](Func`1 code) 2018-02-10 19:37:46,355: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /Users/buildagent/agent/_work/382/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-10 19:37:46,356: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.ExceptionAggregator.RunAsync[T](Func`1 code) 2018-02-10 19:37:46,356: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.XunitTestRunner.InvokeTestAsync(ExceptionAggregator aggregator) 2018-02-10 19:37:46,356: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /Users/buildagent/agent/_work/382/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-10 19:37:46,356: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.XunitTestRunner.InvokeTestAsync(ExceptionAggregator aggregator) 2018-02-10 19:37:46,356: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.ExceptionAggregator.RunAsync[T](Func`1 code) 2018-02-10 19:37:46,357: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /Users/buildagent/agent/_work/382/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-10 19:37:46,357: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.ExceptionAggregator.RunAsync[T](Func`1 code) 2018-02-10 19:37:46,357: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestRunner`1.RunAsync() 2018-02-10 19:37:46,357: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /Users/buildagent/agent/_work/382/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-10 19:37:46,358: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestRunner`1.RunAsync() 2018-02-10 19:37:46,358: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.XunitTheoryTestCaseRunner.RunTestAsync() 2018-02-10 19:37:46,358: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /Users/buildagent/agent/_work/382/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-10 19:37:46,358: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.XunitTheoryTestCaseRunner.RunTestAsync() 2018-02-10 19:37:46,359: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestCaseRunner`1.RunAsync() 2018-02-10 19:37:46,359: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /Users/buildagent/agent/_work/382/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-10 19:37:46,359: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestCaseRunner`1.RunAsync() 2018-02-10 19:37:46,359: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestMethodRunner`1.RunTestCasesAsync() 2018-02-10 19:37:46,360: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /Users/buildagent/agent/_work/382/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-10 19:37:46,360: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestMethodRunner`1.RunTestCasesAsync() 2018-02-10 19:37:46,360: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestMethodRunner`1.RunAsync() 2018-02-10 19:37:46,360: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /Users/buildagent/agent/_work/382/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-10 19:37:46,361: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestMethodRunner`1.RunAsync() 2018-02-10 19:37:46,361: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestClassRunner`1.RunTestMethodsAsync() 2018-02-10 19:37:46,361: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /Users/buildagent/agent/_work/382/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-10 19:37:46,361: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestClassRunner`1.RunTestMethodsAsync() 2018-02-10 19:37:46,361: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestClassRunner`1.RunAsync() 2018-02-10 19:37:46,362: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /Users/buildagent/agent/_work/382/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-10 19:37:46,362: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestClassRunner`1.RunAsync() 2018-02-10 19:37:46,362: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestCollectionRunner`1.RunTestClassesAsync() 2018-02-10 19:37:46,362: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /Users/buildagent/agent/_work/382/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-10 19:37:46,362: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestCollectionRunner`1.RunTestClassesAsync() 2018-02-10 19:37:46,363: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestCollectionRunner`1.RunAsync() 2018-02-10 19:37:46,363: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /Users/buildagent/agent/_work/382/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-10 19:37:46,363: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestCollectionRunner`1.RunAsync() 2018-02-10 19:37:46,363: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.Task`1.InnerInvoke() in /Users/buildagent/agent/_work/382/s/src/mscorlib/src/System/Threading/Tasks/future.cs:line 610 2018-02-10 19:37:46,364: INFO: proc(54): run_and_log_output: Output: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /Users/buildagent/agent/_work/382/s/src/mscorlib/shared/System/Threading/ExecutionContext.cs:line 166 2018-02-10 19:37:46,364: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) in /Users/buildagent/agent/_work/382/s/src/mscorlib/src/System/Threading/Tasks/Task.cs:line 2440 2018-02-10 19:37:46,364: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.Task.ExecuteEntry() in /Users/buildagent/agent/_work/382/s/src/mscorlib/src/System/Threading/Tasks/Task.cs:line 2361 2018-02-10 19:37:46,365: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.SynchronizationContextTaskScheduler.<>c.<.cctor>b__8_0(Object s) in /Users/buildagent/agent/_work/382/s/src/mscorlib/src/System/Threading/Tasks/TaskScheduler.cs:line 694 2018-02-10 19:37:46,365: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.MaxConcurrencySyncContext.RunOnSyncContext(SendOrPostCallback callback, Object state) 2018-02-10 19:37:46,365: INFO: proc(54): run_and_log_output: Output: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /Users/buildagent/agent/_work/382/s/src/mscorlib/shared/System/Threading/ExecutionContext.cs:line 166 2018-02-10 19:37:46,365: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.MaxConcurrencySyncContext.WorkerThreadProc() 2018-02-10 19:37:46,365: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.XunitWorkerThread.<>c.<QueueUserWorkItem>b__5_0(Object _) 2018-02-10 19:37:46,366: INFO: proc(54): run_and_log_output: Output: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /Users/buildagent/agent/_work/382/s/src/mscorlib/shared/System/Threading/ExecutionContext.cs:line 166 2018-02-10 19:37:46,366: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) in /Users/buildagent/agent/_work/382/s/src/mscorlib/src/System/Threading/Tasks/Task.cs:line 2440 2018-02-10 19:37:46,366: INFO: proc(54): run_and_log_output: Output: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /Users/buildagent/agent/_work/382/s/src/mscorlib/shared/System/Threading/ExecutionContext.cs:line 166 2018-02-10 19:37:46,367: INFO: proc(54): run_and_log_output: Output: Assertion Failed 2018-02-10 19:37:46,367: INFO: proc(54): run_and_log_output: Output: should not have embedded nulls 2018-02-10 19:37:46,367: INFO: proc(54): run_and_log_output: Output: 2018-02-10 19:37:46,367: INFO: proc(54): run_and_log_output: Output: at Interop.Sys.DirectoryEntry.GetName(Span`1 buffer) 2018-02-10 19:37:46,367: INFO: proc(54): run_and_log_output: Output: at System.IO.Enumeration.FileSystemEntry.get_FileName() 2018-02-10 19:37:46,367: INFO: proc(54): run_and_log_output: Output: at System.IO.Enumeration.FileSystemEnumerableFactory.<>c__DisplayClass5_0.<UserEntries>b__1(FileSystemEntry& entry) 2018-02-10 19:37:46,367: INFO: proc(54): run_and_log_output: Output: at System.IO.Enumeration.FileSystemEnumerable`1.DelegateEnumerator.ShouldIncludeEntry(FileSystemEntry& entry) 2018-02-10 19:37:46,368: INFO: proc(54): run_and_log_output: Output: at System.IO.Enumeration.FileSystemEnumerator`1.MoveNext() 2018-02-10 19:37:46,368: INFO: proc(54): run_and_log_output: Output: at System.IO.FileSystem.RemoveDirectoryInternal(DirectoryInfo directory, Boolean recursive, Boolean throwOnTopLevelDirectoryNotFound) 2018-02-10 19:37:46,368: INFO: proc(54): run_and_log_output: Output: at System.IO.FileSystem.RemoveDirectory(String fullPath, Boolean recursive) 2018-02-10 19:37:46,368: INFO: proc(54): run_and_log_output: Output: at System.IO.Directory.Delete(String path, Boolean recursive) 2018-02-10 19:37:46,368: INFO: proc(54): run_and_log_output: Output: at System.IO.FileCleanupTestBase.Dispose(Boolean disposing) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/CoreFx.Private.TestUtilities/src/System/IO/FileCleanupTestBase.cs:line 66 2018-02-10 19:37:46,369: INFO: proc(54): run_and_log_output: Output: at System.IO.FileCleanupTestBase.Dispose() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/CoreFx.Private.TestUtilities/src/System/IO/FileCleanupTestBase.cs:line 57 2018-02-10 19:37:46,369: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.ExecutionTimer.Aggregate(Action action) 2018-02-10 19:37:46,369: INFO: proc(54): run_and_log_output: Output: at ReflectionAbstractionExtensions.DisposeTestClass(ITest test, Object testClass, IMessageBus messageBus, ExecutionTimer timer, CancellationTokenSource cancellationTokenSource) 2018-02-10 19:37:46,369: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.ExceptionAggregator.Run(Action code) 2018-02-10 19:37:46,369: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestInvoker`1.<RunAsync>b__45_0() 2018-02-10 19:37:46,370: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /Users/buildagent/agent/_work/382/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-10 19:37:46,370: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestInvoker`1.<RunAsync>b__45_0() 2018-02-10 19:37:46,370: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.ExceptionAggregator.RunAsync[T](Func`1 code) 2018-02-10 19:37:46,370: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /Users/buildagent/agent/_work/382/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-10 19:37:46,371: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.ExceptionAggregator.RunAsync[T](Func`1 code) 2018-02-10 19:37:46,371: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.XunitTestRunner.InvokeTestAsync(ExceptionAggregator aggregator) 2018-02-10 19:37:46,371: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /Users/buildagent/agent/_work/382/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-10 19:37:46,371: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.XunitTestRunner.InvokeTestAsync(ExceptionAggregator aggregator) 2018-02-10 19:37:46,371: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.ExceptionAggregator.RunAsync[T](Func`1 code) 2018-02-10 19:37:46,372: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /Users/buildagent/agent/_work/382/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-10 19:37:46,372: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.ExceptionAggregator.RunAsync[T](Func`1 code) 2018-02-10 19:37:46,372: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestRunner`1.RunAsync() 2018-02-10 19:37:46,372: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /Users/buildagent/agent/_work/382/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-10 19:37:46,372: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestRunner`1.RunAsync() 2018-02-10 19:37:46,372: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestCaseRunner`1.RunAsync() 2018-02-10 19:37:46,373: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /Users/buildagent/agent/_work/382/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-10 19:37:46,373: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestCaseRunner`1.RunAsync() 2018-02-10 19:37:46,373: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestMethodRunner`1.RunTestCasesAsync() 2018-02-10 19:37:46,373: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /Users/buildagent/agent/_work/382/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-10 19:37:46,374: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestMethodRunner`1.RunTestCasesAsync() 2018-02-10 19:37:46,374: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestMethodRunner`1.RunAsync() 2018-02-10 19:37:46,374: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /Users/buildagent/agent/_work/382/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-10 19:37:46,374: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestMethodRunner`1.RunAsync() 2018-02-10 19:37:46,374: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestClassRunner`1.RunTestMethodsAsync() 2018-02-10 19:37:46,375: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /Users/buildagent/agent/_work/382/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-10 19:37:46,375: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestClassRunner`1.RunTestMethodsAsync() 2018-02-10 19:37:46,375: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestClassRunner`1.RunAsync() 2018-02-10 19:37:46,375: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /Users/buildagent/agent/_work/382/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-10 19:37:46,375: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestClassRunner`1.RunAsync() 2018-02-10 19:37:46,375: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestCollectionRunner`1.RunTestClassesAsync() 2018-02-10 19:37:46,376: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /Users/buildagent/agent/_work/382/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-10 19:37:46,376: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestCollectionRunner`1.RunTestClassesAsync() 2018-02-10 19:37:46,376: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestCollectionRunner`1.RunAsync() 2018-02-10 19:37:46,376: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /Users/buildagent/agent/_work/382/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-10 19:37:46,376: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestCollectionRunner`1.RunAsync() 2018-02-10 19:37:46,377: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.Task`1.InnerInvoke() in /Users/buildagent/agent/_work/382/s/src/mscorlib/src/System/Threading/Tasks/future.cs:line 610 2018-02-10 19:37:46,377: INFO: proc(54): run_and_log_output: Output: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /Users/buildagent/agent/_work/382/s/src/mscorlib/shared/System/Threading/ExecutionContext.cs:line 166 2018-02-10 19:37:46,377: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) in /Users/buildagent/agent/_work/382/s/src/mscorlib/src/System/Threading/Tasks/Task.cs:line 2440 2018-02-10 19:37:46,377: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.Task.ExecuteEntry() in /Users/buildagent/agent/_work/382/s/src/mscorlib/src/System/Threading/Tasks/Task.cs:line 2361 2018-02-10 19:37:46,378: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.SynchronizationContextTaskScheduler.<>c.<.cctor>b__8_0(Object s) in /Users/buildagent/agent/_work/382/s/src/mscorlib/src/System/Threading/Tasks/TaskScheduler.cs:line 694 2018-02-10 19:37:46,378: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.MaxConcurrencySyncContext.RunOnSyncContext(SendOrPostCallback callback, Object state) 2018-02-10 19:37:46,378: INFO: proc(54): run_and_log_output: Output: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /Users/buildagent/agent/_work/382/s/src/mscorlib/shared/System/Threading/ExecutionContext.cs:line 166 2018-02-10 19:37:46,378: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.MaxConcurrencySyncContext.WorkerThreadProc() 2018-02-10 19:37:46,379: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.XunitWorkerThread.<>c.<QueueUserWorkItem>b__5_0(Object _) 2018-02-10 19:37:46,379: INFO: proc(54): run_and_log_output: Output: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /Users/buildagent/agent/_work/382/s/src/mscorlib/shared/System/Threading/ExecutionContext.cs:line 166 2018-02-10 19:37:46,379: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) in /Users/buildagent/agent/_work/382/s/src/mscorlib/src/System/Threading/Tasks/Task.cs:line 2440 2018-02-10 19:37:46,379: INFO: proc(54): run_and_log_output: Output: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /Users/buildagent/agent/_work/382/s/src/mscorlib/shared/System/Threading/ExecutionContext.cs:line 166 2018-02-10 19:37:49,001: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/dotnetbuild/work/78908c4b-3dbb-4ac4-8785-16df253cd217/Work/5674dd81-888b-46a4-9774-b7b0136812e8/Unzip/RunTests.sh: line 87: 64175 Abort trap: 6 ``` cc: @JeremyKuhne 27040 area-System.Net Add SocketsHttpHandler check for TransferEncodingChunked w/o Content Fixes https://github.com/dotnet/corefx/issues/27031 cc: @geoffkizer, @davidsh 27043 area-System.Net Tweak CurlHandler SSL not supported messages to be more helpful cc: @bartonjs, @karelz 27044 area-Microsoft.CSharp Make many helpers, factories and tables static in Microsoft.CSharp Microsoft.CSharp has several objects that are heavily used throughout the library that have circular dependencies on each other, as well as several other classes depending on them. Use of them hence requires either a field in each object that will use them, or to follow chains of such fields. Prior to #25191 it was necessary for them to be instances so that they could be replaced with new versions. This no longer being necessary it's possible to make them all static. At the same time, the related `RuntimeBinder`, `ExpressionBinder` and `BindingContext` classes are relatively heavy, mostly due to these dependencies. They are hence created once unless a cast must be attempted with a different `BindingContext`, and `BindingContext`'s state is overwritten for each operation. Removing these dependencies makes these very light, allowing them to be `readonly struct`s that are created for each operation. * Have `TypeArray` in charge of the empty `TypeArray` singleton * Make `TypeArray` allocation a static responsibility of `TypeArray` * Remove some orphaned members. Mostly `BSYMMGR`-returning members that had been used to allocate `TypeArrays` * Make members static where possible. Those that can already be easily made static. Includes removing some members that this makes no longer necessary. * Remove unused parameters Since some are of the types we'll be making static, and such parameters will have to go anyway. * Make `TypeTable` static And more conventional names within `TypeTable`. * More `TypeManager` state & methods to static * Make `SYMTBL.Key` an immutable struct. * `SYMTBL` completely static and renamed to `SymbolStore` More conventional name, and doesn't clash with other `SymbolTable` class. * `GetWinRTCollectionIfacesAll` to property. * `SymFactory` static class. * Remove `PredefinedTypes._symbolManager` field Only used in assertion. * Remove assert comparison with this in `GetAggregate` Assert is the only reason to not be static, allows a cascade of more changes to static. * Make `InternalsVisibleTo` check static. * Make cycle of instance methods static Take quite a large set of methods which must be instance because of cyclic instance dependencies, and make them all static. Removes dependency in `AggregateSymbol` and `NullableType` on `TypeManager` instances. * Replace `GetAggTypeSym` with virtual method on `CType`. Merged with existing `GetAts` on `NullableType`. Comment says this would be nice, and indeed it would, and its easy now. * Make those members that can now be static, static. * Remove orphaned members and fields. * `PredefinedMembers` entirely static. * Remove `UserStringBuilder.m_buildingInProgress` Only used in asserts, just assert on whether `m_strBuilder` is null or not. Also rename `m_strBuilder` to `_strBuilder` to be more conventional. * Favour returning over out in `UserStringBuilder` And favour clearing `StringBuilder` over creating another. * Make `ErrorHandling` completely static. Creating `UserStringBuilder` instances on demand. * `TypeManager` static. * Make `CNullable` methods static and merge directly into `ExpressionBinder` Don't cache method and property, as they're already cached. * Don't preload types. Either they'll be loaded soon anyway, or else it's a wasted effort. * Move `CompareTypes` into Better.cs * Remove `BSYMMGR.LookupAggMember` Just call into `SymbolStore.LookupSym` * Move `LookupNextSym` logic into `Symbol` * Remove `BSYMMGR` and `GlobalSymbolContext` No longer any use. * `ExprFactory` static * `SymbolLoader` static * `CSemanticChecker` static * Don't pre-emptively load `System.Object` Will be loaded as a base of the first type encountered anyway. * `SymbolTable` static * More methods can be made static * Remove orphaned method. * Move methods for getting `MemberInfo`s from expressions into those expressions * Replace `ExpressionTreeCallRewriter.GetObject` with virtual property in `Expr` * `TypeArray` tidy-up. * Pass `ExpressionBinder` to operator delegates, and make them static. Allows array to be created once statically, rather than on each instance construction. * Create `RuntimeBinder`, `ExpressionBinder` and `BindingContext` per operation These are now very lightweight, so it's simpler to create them anew each time rather than overwriting the values in the `BindingContext`. * Make `RuntimeBinder`, `ExpressionBinder` and `BindingContext` structs No need to allocate on the heap. * Remove `AggregateDeclaration` We only ever care about the `AggregateSymbol` it relates to. (The two aren't really separate in dynamic code, where there aren't really declarations). * Remove `IsChecked` and `CallingContext` from C# binders. Now not used as they are passed to `RuntimeBinder` on construction, except for `CallingContext` remaining in `CSharpInvokeMemberBinder` for use in deferring. * Make `RecordBinOpSigFromArgs` static. A last member that can be made static. CC @VSadov @OmarTawfik 27045 area-Infrastructure ILLink initlocals custom step fails when building on Unix Adding ```XML <ILLinkClearInitLocals>true</ILLinkClearInitLocals> ``` to a corefx .csproj works fine on Windows but fails to build on Linux with the error: ``` IL Linker Error: Step type 'ILLink.CustomSteps.ClearInitLocalsStep,ILLink.CustomSteps' not found. illink [options] -x|-a|-i file --about About the IL Linker --version Print the version number of the IL Linker --skip-unresolved Ignore unresolved types and methods (true or false) --dump-dependencies Dump dependencies for the linker analyzer tool -out Specify the output directory, default to `output' -c Action on the core assemblies, skip, copy, copyused, addbypassngen, addbypassngenused or link, default to skip -u Action on the user assemblies, skip, copy, copyused, addbypassngen, addbypassngenused or link, default to link -p Action per assembly -s Add a new step to the pipeline. -t Keep assemblies in which only type forwarders are referenced. -d Add a directory where the linker will look for assemblies -b Generate debug symbols for each linked module (true or false) -g Generate a new unique guid for each linked module (true or false) -v Keep memebers needed by debugger attributes (true or false) -h List of reflection heuristics separated with a comma. Supported heuristics: LdtokenTypeMethods: mark all methods of types whose token is used in an ldtoken instruction LdtokenTypeFields: mark all fields of types whose token is used in an ldtoken instruction InstanceConstructors: mark all instance constructors in types where an instance member has been marked but none of the instance constructors have been marked -l List of i18n assemblies to copy to the output directory separated with a comma: none,all,cjk,mideast,other,rare,west default is all -x Link from an XML descriptor -a Link from a list of assemblies -r Link from a list of assemblies using roots visible outside of the assembly -i Link from an mono-api-info descriptor -z Include default preservations (true or false), default to true Command execution failed with exit code 1. ``` cc: @sbomer, @JosephTremoulet 27046 area-System.Runtime System.Runtime.InteropServices bad calling convention when returning unions on linux "Hi, When using Interop on linux my app crashed. I managed to narrow it down to the cas where the native method returns an union. When I looked at the core dump with gdb it seemed to me that the calling convention is wrong. I was expecting to see the pointer to the string in register RDI but it contained garbage. I do not know if it is correct behavior or a bug, but I would appreciate if somebody has the time to take a look. Thanks ! ## Environnent * Fedora 26 linux 4.14.14-200.fc26.x86_64 * dotnet 2.1.4 * gcc (GCC) 7.2.1 20170915 ## C++ shared object code #include <iostream> #include <string> extern ""C"" union Union { int64_t f2; }; extern ""C"" Union crash(const char* msg) { std::cerr << __PRETTY_FUNCTION__ << "" start"" << std::endl; std::cerr << __PRETTY_FUNCTION__ << "" ptr "" << (void*)msg << std::endl; std::cerr << __PRETTY_FUNCTION__ << "" arg "" << msg << std::endl; return Union{}; } Compiled using : `g++ -Wall -fPIC -std=c++11 -shared -O0 -g -o libcrash.so crash.cpp` ## C# console app code using System; using System.Runtime.InteropServices; namespace question { [StructLayout(LayoutKind.Explicit)] public struct Union { [FieldOffset(0)] Int64 field2; } class Program { [DllImport(""libcrash.so"")] static extern Union crash(string s); static void Main(string[] args) { crash(""boom !!""); Console.WriteLine(""All Done""); } } }" 27047 area-System.IO Add more IO tests around problematic filename characters While we have some tests, it would be good to add more with problematic filenames and filename characters. Here is a good article describing difficult names for reference: https://www.dwheeler.com/essays/fixing-unix-linux-filenames.html Creating, copying, moving, enumerating, deleting, etc. Trailing spaces and periods on Windows are legal, but difficult to create and access. Calling Win32 APIs with paths normally will strip these. The exception is when prepended with `\\?\`. We purposefully do not handle creating these unless you use `\\?\` as creating these sort of paths frequently breaks apps. We should (and do) handle finding them via `GetFiles`, etc. and handle manipulating them with the *Info classes. We currently don't allow opening them directly from a path string unless you use `\\?\`. 27048 area-System.IO API Proposal: Path API that exposes the Portable Filename Character Set ``` c# namespace System.IO { public static class Path { public static bool IsPortablePosixFileName(ReadonlySpan<char> name); } } ``` Returns true if the name only has characters from the defined set. The set is small `[A-Z][a-z][0-9]._-`. The spec also discourages `-` as the first character, which we should also check. POSIX.1-2008 3.282 Portable Filename Character Set http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_282 http://www.boost.org/doc/libs/1_66_0/libs/filesystem/doc/portability_guide.htm See related #27049 27049 area-System.IO API Proposal: Add Path API that validates that path cross-plat safe "Essentially this is similar to the Windows `Path.GetInvalidFileNameChars()`. ``` c# namespace System.IO { public static class Path { public static bool IsPortableFileName(ReadonlySpan<char> name); } } ``` This API will not accept - invalid Windows filename characters (control chars, `<`, `>`, `:`, `""`, `/`, `\`, `|`) - starting or ending spaces ` ` - ending periods `.` - starting dashes `-` - normal globbing characters `[`, `]`, `*`, `?` See related #27048 " 27051 area-System.Runtime Tests for StringComparer Create(culture, CompareOptions) overload Related to dotnet/corefx#395 Implementation PR- https://github.com/dotnet/coreclr/pull/16334 27052 area-System.IO Switch from using SafeHandle for Unix enumeration This cuts enumeration time by a further 5-10%. For filtered results it also has 5%+ impact on memory allocation. For an unfiltered GetFiles of 66K files (CoreFX enlistment with some builds) GC count went from 5|2|1 to 4|1|0 (gen 0|1|2). On top of earlier changes we're seeing 20-30% time improvements and 40-60% improvements in memory usage over 2.0. Also tweak an assert to validate embedded nulls only when we try to filter them out. 27055 area-System.Net DO NOT MERGE: test some refactoring of LoopbackServer 27056 area-System.Threading [Question] Per thread finalizer Regarding https://github.com/dotnet/corefx/issues/26992, I have a question. @davidfowl > No, ReleaseHandle happens when the safe handle is disposed explicitly or finalized. If we cannot dispose the safe handle explicitly, only finalizer can release it. In this situation, is there a way that the safe handle is disposed by finalizer in the same thread as initialization? 27057 area-System.Data Nested Transactions failing - Enlisting in Ambient transactions is not supported "Nested transaction are broken in System.Data.SqlClient 4.4.2 (latest stable release) They work with System.Data.Sqlclient 4.3.1. The error is Enlisting in Ambient transactions is not supported. Below is sample code which works in 4.3.1 and now boken in 4.4.2 ```c# var option = new TransactionOptions { IsolationLevel = IsolationLevel.ReadCommitted, Timeout = TimeSpan.FromSeconds(60) }; using (var scopeOuter = new TransactionScope(TransactionScopeOption.Required, option)) { using (var conn = new SqlConnection(connectionString)) { using (SqlCommand cmd = conn.CreateCommand()) { cmd.CommandText = ""INSERT INTO Data(Code, FirstName) VALUES('A-100', 'Mr. A');""; cmd.Connection.Open(); cmd.ExecuteNonQuery(); } } using (var scopeInner = new TransactionScope(TransactionScopeOption.Required, option)) { using (var conn = new SqlConnection(connectionString)) { using (SqlCommand cmd = conn.CreateCommand()) { cmd.CommandText = ""INSERT INTO Data(Code, FirstName) VALUES('B-100', 'Mr. B');""; cmd.Connection.Open(); cmd.ExecuteNonQuery(); } } scopeInner.Complete(); } scopeOuter.Complete(); } ``` [EDIT] Update code formatting and syntax highlighting by @karelz" 27058 area-System.Net HttpClientMiniStress: consistent failure in UnreadResponseMessage_Collectible The Assert waiting for the response object to be collected fails. Happens for both WinHttpHandler and SocketsHttpHandler. 27059 area-System.Net Fix HttpClientMiniStressTest Fix an issue with response generation. Also, disable the UnreadResponseMessage_Collectible test, which is failing currently for reasons that are not obvious to me. @stephentoub @davidsh 27061 area-System.Net Fix HttpClientMiniStress.UnreadResponseMessage_Collectible test The async state machine was holding a reference to the response content object. Fixes https://github.com/dotnet/corefx/issues/27058 cc: @geoffkizer 27062 area-System.Threading My idea:Async and Task function pipeline I design a Lambda Expression:Task<IEnumerable> WhereAsync. If you used WhereAsync,You Lambda Expression pipline such as WhereAsync().SelectAsync() be broken. So If c# has a async Lambda Expression pipline,We used async and Task our function pipline don't be broken. 27063 area-System.Net Test failure: PostAsync_CancelDuringRequestContentSend_TaskCanceledQuickly WinHttpHandler has some cancellation support, but it doesn't appear to support cancellation during content send, e.g. if cancellation is requested and the server never sends back response headers. netfx has the same issue. 27064 area-System.Net Test failure: MaxConnectionsPerServer_WaitingConnectionsAreCancelable "The MaxConnectionsPerServer_WaitingConnectionsAreCancelable test fails on WinHttpHandler in a strange manner. It throws a ""The server returned an invalid or unrecognized response"" WinHttpException while receiving/parsing the response headers. This happens while handling the response from the first request, but doesn't happen if the last request is removed. It almost as if there's some state that bleeds between the requests." 27065 area-System.Net Test failure: GetAsync_CancelPendingRequests_DoesntCancelReadAsyncOnResponseStream CurlHandler incorrectly maintains a registration with the CancellationToken passed in to SendAsync for the duration of the whole operation, including processing of the response body, even if HttpCompletionOption.ResponseHeadersRead is used. That means that HttpClient.CancelAllPending will cancel such operations. It should unregister from that token once it completes the Task returned from SendAsync. 27066 area-System.Net Make Sockets behavior consistent in the face of cancellation See discussion at https://github.com/dotnet/corefx/pull/27029/files/a137bbf42598202f999ead31d92754613145c849#r167445914 cc: @geoffkizer 27067 area-System.Net WinHttpHandler/CurlHandler hangs or fails when connection pooling and connection dropped See GetAsync_DontDisposeResponse_EventuallyUnblocksWaiters test. It sets MaxConnectionsPerServer to 1, and then proceeds to issue a ResponseHeadersRead request but drops the response object without disposing it. It then creates a second request to the same server, and that request is never processed. 27068 area-System.Net Fix SocketsHttpHandler connection pool accounting for dropped connections When MaxConnectionsPerServer is set to anything other than int.MaxValue, the SocketsHttpHandler pool keeps track of the number of connections handed out, and this count is updated when a connection is disposed. But if a response stream isn't disposed of, resulting in the connection never being disposed of, the count may never be updated. This fix adds an HttpConnection derived type that simply adds a finalizer, making it pay-for-play when MaxConnectionsPerServer is set to something other than the default. cc: @geoffkizer, @davidsh, @Priya91, @wfurt 27069 area-System.Net Cache SslClientAuthenticationOptions on SocketsHttpHandler pool For the common case, we can just use a singleton cached instance with settings computed when the pool is created. Only if it's accessed via HttpClientHandler with a server certificate callback do we need to still create an instance per request, in order to wrap the delegate to provide the expected semantics. cc: @geoffkizer, @davidsh, @Priya91, @wfurt 27073 area-System.Globalization Fixing test CurrencyNegativePattern_Get() on distro Ubuntu18.04 From class/project System.Globalization.Tests.NumberFormatInfoCurrencyNegativePattern Fixes #27022 CC: @danmosemsft @krwq 27074 area-System.Data SqlClient: Avoid boxing values as much as possible We believe that for hot paths while consuming data readers this could have a significant enough impact. For parameters, there is already https://github.com/dotnet/corefx/issues/8955 about adding a generic API in ADO.NET base provider model that then can be implemented by SqlClient. cc @saurabh500 @geleems @roji @ajcvickers 27075 area-System.Data ADO.NET: Database-independent way to generate parameter placeholders In theory, parameter placeholders [are an entirely database-specific details](https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/configuring-parameters-and-parameter-data-types#working-with-parameter-placeholders) - there is no way to write a single SQL containing parameters, and then execute it on different databases. In practice, it seems that most ADO.NET have aligned on the `@name` convention. This is quite a problem, since for databases which don't support it natively, the ADO.NET provider must parse and replace the `@name` placeholder with the one accepted by the database. For example, PostgreSQL uses positional placeholders ($1, $2...), which by the way are also specific to individual statements in a batch (parameters are per-statement, not per-batch). We could design an API where the provider would generate the placeholder. This could be as simple as adding a `Placeholder` property on DbParameter, which each provider would implement as necessary. The user would then interpolate the placeholder into the CommandText. For positional placeholders, the logic would typically calculate the placeholder as the DbParameter is inserted into a DbParameterCollection, whereas for named placeholders the `ParameterName` would be returned. PS Parameter placeholder translation is one of two things forcing Npgsql to parse the CommandText - the other is the lack of a proper batching API (#3688), which requires to parse and split on semicolons. 27077 area-System.Net Log when an insecure Https -> Http redirect is blocked .NET Core does not allow insecure redirects from https to http, but .NET Framework does. Developers have had some trouble diagnosing the issue when they run into this difference. This change adds logging to help developers track down what is going on. Fixes: #24577 27079 area-System.Net Change HTTP default request version to HTTP/2 Close: #23394 27082 area-System.Drawing Added DCS Tests for System.Drawing Types This adds DataContractSerializer tests for basic types in System.Drawing -See issue #25729 for a list of types cc: @huanwu, @safern Resolves #25729 27084 area-System.Linq Linq support on Task I think we should add linq support for `IEnumerable<Task<T>>` and `Task<Enumerable<T>>` with the same set of function as linq, let the lambda could return `Task<T>` and become unwrap while seamlessly handle both combination of `IEnumerable<Task<T>>` and `Task<Enumerable<T>>` ```C# using System.Linq.Async; //// // Enumerable of Task can Select, Where and any function supporterd by Linq Task<IEnumerable<string>> texts = GetTask(); IEnumerable<Task<string[]>> tasks = task.ToEnumerablesTasks().Where((text) => text.Length > 10).Select((text) => text.Split(':')); string[][] splits = await Task.WhenAll(tasks); // Enumerable has extension method SelectAsync to create Enumerable of Task from lambda IEnumerable<Task<DBObject>> tasks2 = splits.SelectAsync(async(split) => await QuerySomeDB(split[0],split[1])); var result = await Task.WhenAll(tasks2); ``` If possible I would also want to have https://www.nuget.org/packages/System.Interactive.Async/ in BCL 27085 area-System.IO Tests For GetFullPath(string path,string basePath) Fixes #25535 Implementation PR:- dotnet/coreclr#15579 Previous PR:- https://github.com/dotnet/corefx/pull/25994 The Commits upto 4466ed9 this are already been reviewed in the previous PR. This PR has been opened beacause of large number of merge conflicts in the other PR due to span overload tests. 27086 area-Infrastructure Tests are not waiting on child processes when run Some tests use RemoteInvoke to launch child processes. Generally they should call Dispose() on the RemoteInvokeHandle that returns in order to WaitForExit on the process. If they forget, execution will continue and any assertion failure (or other unhandled exception) in the child process will not prevent the test passing. Eg.,: ``` Running tests... Start time: 22:29:13.23 xUnit.net console test runner (64-bit .NET Core) Copyright (C) 2014 Outercurve Foundation. Discovering: System.Text.RegularExpressions.Tests Discovered: System.Text.RegularExpressions.Tests Starting: System.Text.RegularExpressions.Tests Unhandled Exception: Xunit.Sdk.ThrowsException: Assert.Throws() Failure Expected: typeof(System.ArgumentException) Actual: typeof(System.TypeInitializationException): The type initializer for 'System.Text.RegularExpressions.Regex' threw an exception. at Xunit.Assert.Throws(Type exceptionType, Exception exception) in C:\BuildAgent\work\cb37e9acf085d108\src\xunit.a ssert\Asserts\ExceptionAsserts.cs:line 143 at Xunit.Assert.Throws[T](Func`1 testCode) in C:\BuildAgent\work\cb37e9acf085d108\src\xunit.assert\Asserts\Excepti onAsserts.cs:line 36 at System.Text.RegularExpressions.Tests.RegexConstructorTests.<>c.<StaticCtor_InvalidTimeoutObject_ExceptionThrown >b__3_0() in C:\git\corefx\src\System.Text.RegularExpressions\tests\Regex.Ctor.Tests.cs:line 85 --- End of stack trace from previous location where exception was thrown --- at RemoteExecutorConsoleApp.Program.Main(String[] args) in C:\git\corefx\src\Common\tests\System\Diagnostics\Remot eExecutorConsoleApp\RemoteExecutorConsoleApp.cs:line 92 Finished: System.Text.RegularExpressions.Tests === TEST EXECUTION SUMMARY === System.Text.RegularExpressions.Tests Total: 802, Errors: 0, Failed: 0, Skipped: 0, Time: 2.042s Finished running tests. End time=22:29:15.68, Exit code = 0 ``` This behavior is slightly obscured when running on a dev machine, as runtests.cmd is generally wrapped inside MSBuild, and MSBuild, after WaitforExit hsa returned on the process it launched, will then wait indefinitely for the console output streams to reach EOF. Those do not return until the grandchild remote processes have exited (@JeremyKuhne @stephentoub I'm unclear why this is - do they automatically duplicate the console handles from the test process which is MSBuild's direct child?). When the grandchild fails in this situation, the exception will appear in the console, but the test will already have succeeded and be counted as such. When Helix runs the tests using runtest.cmd directly, MSBuild is not involved so if Dispose() is forgotten there is no wait on the grandchildren and they are completely ignored. https://github.com/dotnet/corefx/pull/26543#issuecomment-365021333 is an example. We should add a finalizer to RemoteInvokeHandle which will mean that at least some waiting will occur on those child processes: they still wont fail the test, as it's too late, but their console output is more likely to show up in the log. (XUnit does not do WaitForPendingFinalizers so I figure if they don't complete within X seconds - I think 40 seconds - of the XUnit process completing, the output still won't show up.) @stephentoub does this sound like the best we can do? 27088 area-System.Net reorganize and cleanup some LoopbackServer code "As we are writing more and more LoopbackServer based tests, seems like a good time to do a bit of refactoring and simplification. Several related changes: (1) Move nonessential code out of LoopbackServer itself. E.g. the websocket test code and the ""transfer"" code. These are only used by a couple very specific tests, and don't actually need to be in LoopbackServer. (2) Simplify a few things that are awkward today. For example, the Options object gets passed in to several different places and used in different ways. I changed it to only be passed in to CreateServerAsync. Another example: the callback you pass to AcceptSocketAsync always has to return a Task<List>, even though many uses don't care about this and just pass null. (3) Add the Connection object, which makes the callback from AcceptSocketAsync (now AcceptConnectionAsync) cleaner. Today you have to have four params on the callback, even though you often only care about one or two. Connection just encapsulates these args into a single object, and allows you to easily discover and call instance methods on this object. (4) Rename some core methods to make them more descriptive. (5) Fix usage in tests to reflect the updates. @stephentoub @davidsh @Priya91 @wfurt " 27089 area-System.Data Revert Managed SNI usage flag Revert the managed SNI flag which was incorrectly toggled in https://github.com/dotnet/corefx/pull/27010 27090 area-System.Net Add a generic SASL API with GSSAPI support Provide GSSAPI mechanism support, for Kerberos V5 authentication. Sample SASL client methods: `EvaluateChallenge()`, `Wrap()`, `UnWrap()`. 27092 area-System.Threading Thread affinity isn't inherited from the process affinity in Linux "Ubuntu 16.04, dotnet 2.1.4 ```` [DllImport(""libc"", EntryPoint = ""syscall"", SetLastError = true)] public static extern long syscall0(long number); [DllImport(""libc"", SetLastError = true)] public static extern int sched_getaffinity(int pid, IntPtr cpusetsize, ref ulong cpuset); Process.GetCurrentProcess().ProcessorAffinity = new IntPtr(6); new Thread(() => { var sysGetId = (RuntimeInformation.OSArchitecture == Architecture.Arm || RuntimeInformation.OSArchitecture == Architecture.Arm64) ? 224 : 186; var threadId = syscall0(sysGetId); ulong affinity; var result = Syscall.sched_getaffinity((int)threadId, new IntPtr(sizeof(ulong)), ref affinity); // affinity == 255, expected == 6 }); ```` In Windows a new thread inherits the process affinity. Need to call sched_setaffinity after thread creation." 27094 area-System.Memory Move Span APIs that allow shipping visibility checks to MemoryMarshal "`BinaryPrimitives.TryReadMachineEndian` or `MemoryExtensions.AsBytes` APIs are an inherently ""unsafe"" API in the sense that they allow bypassing visibility checks. They allow creating structs with invalid content that can lead to unexpected behaviors. An example of such unexpected behavior is buffer overrun described in https://github.com/dotnet/coreclr/issues/16336 . Should we move these APIs to System.Runtime.InteropServices.MemoryMarshal to be together with other unsafe APIs that one has to be very careful about using?" 27095 area-Infrastructure Update RIDs used in test execution This issue is to track updating the RIDs being used in CoreFX Jenkins testing. Related: https://github.com/dotnet/corefx/issues/25252, https://github.com/dotnet/wcf/issues/2553, https://github.com/dotnet/core-eng/issues/2450 Current CoreFX Master Jenkins Linux RIDS: - RHEL7.2 - CentOS7.1 - Fedora24 - Debian8.4 - Ubuntu 14.04, 16.04, 16.10 Target RIDS: - RHEL7.4 - CentOS7.4 - Fedora27 - Debian9.0 - Ubuntu 14.04, 16.04, 18.04 Update 2/6/2018: Remaining work: - /+ RHEL7.4 - /+ CentOS7.4 27097 area-System.IO Consider adding MemoryMarshal.TryGetArray/MemoryList(ReadOnlySequence) We shouldn't interpret `SequencePositions` outside `ReadOnlySequence` but pipelines need to get IMemoryList reference and indexes out of SequencePositions received in `Advance` I'm proposing to add the following API's: ```C# public static partial class MemoryMarshal { bool TryGetArray<T>(ReadOnlySequence<T> sequence, out ArraySegment<T> array); bool TryGetOwnedMemory<T>(ReadOnlySequence<T> sequence, out OwnedMemory<T> ownedMemory, out int start, out int length); bool TryGetMemory<T>(ReadOnlySequence<T> sequence, out ReadOnlyMemory<T> readOnlyMemory); bool TryGetMemoryList<T>(ReadOnlySequence<T> sequence, out IMemoryList<T> startSegment, out int startIndex, out IMemoryList<T> endSegment, out int endIndex); } ``` /cc @davidfowl @KrzysztofCwalina 27098 area-System.Runtime .NET 4.7 - '\0' char in String causes GetHashCode to ignore remainder -- but on x64 only "@vsfeedback commented on [Mon Feb 12 2018](https://github.com/dotnet/roslyn/issues/24780) The `GetHashCode(...)` function for the **ordinal** `String` comparisons In **.NET 4.7** has a grossly different behavior between running on **x86** versus **x64**. Note: ***I am not talking about the different hash code values, per-platform***, since these are intended as opaque -- rather, the issue here is a ***semantic difference*** in runtime behavior between the two platforms. On **x86**, the full length of a `String` is always hashed, regardless of any `\0` characters. On **x64**, the hashing terminates at the first `\0` character. This is trivial to demonstrate: var h1 = ""\0AAAAAAAAA"".GetHashCode(); var h2 = ""\0BBBBBBBBBBBB"".GetHashCode(); var h3 = ""\0CCCCCCCCCCCCCCC"".GetHashCode(); // x64 results: // 0x162a16fe // 0x162a16fe // 0x162a16fe // x86 results: // 0x07b801bc // 0x048e22a3 // 0x21e2037d As shown above, this affects the `GetHashCode` instance virtual method (overriden by the `String` type), as well as two other **.NET**-provided techniques for obtaining an ordinal-based `String` hash code: `StringComparer.Ordinal.GetHashCode` and also `CultureInfo.CurrentCulture.CompareInfo.GetHashCode` (when using `CompareOptions.Ordinal`). These results are summarized below: <pre> -------------------------- x86 -------------------------- "\0AAAAAAAAA" s.GetHashCode 0x07b801bc StringComparer.Ordinal.GetHashCode 0x07b801bc CompareInfo.GetHashCode/CompareOptions.Ordinal 0x07b801bc "\0BBBBBBBBBBBB" s.GetHashCode 0x00001505 StringComparer.Ordinal.GetHashCode 0x00001505 CompareInfo.GetHashCode/CompareOptions.Ordinal 0x00001505 "\0CCCCCCCCCCCCCCC" s.GetHashCode 0x21e2037d StringComparer.Ordinal.GetHashCode 0x21e2037d CompareInfo.GetHashCode/CompareOptions.Ordinal 0x21e2037d -------------------------- x64 -------------------------- "\0AAAAAAAAA" s.GetHashCode 0x162a16fe StringComparer.Ordinal.GetHashCode 0x162a16fe CompareInfo.GetHashCode/CompareOptions.Ordinal 0x162a16fe "\0BBBBBBBBBBBB" s.GetHashCode 0x162a16fe StringComparer.Ordinal.GetHashCode 0x162a16fe CompareInfo.GetHashCode/CompareOptions.Ordinal 0x162a16fe "\0CCCCCCCCCCCCCCC" s.GetHashCode 0x162a16fe StringComparer.Ordinal.GetHashCode 0x162a16fe CompareInfo.GetHashCode/CompareOptions.Ordinal 0x162a16fe </pre> While I do realize that theoretical practice deems hash codes purely advisory, in practice applications will be designed to expect that hash code collisions are rare. Being able to trivially produce an infinite number of identical hashes, at will -- such as one can do via "\0A", "\0B", "\0C", "\012345..." (on **x64** all of these give the same hash code as above, `0x162a16fe`)-- is neither in the spirit of hashing nor accepted/expected common practice. Worse, this only happens on the x86 platform and not x64, which could cause considerable loss of design and development effort, if such proceeded based on a false impression of consistent behavior. _This issue has been moved from https://developercommunity.visualstudio.com/content/problem/196675/net-47-0-char-in-string-causes-gethashcode-to-igno-1.html VSTS ticketId: 565715_ _These are the original issue comments:_ Glenn Slayden on 2/9/2018, 06:39 PM (2 days ago): <p>I should also mention that the **x64** version of `String.GetHashCode(...)` in fact makes no reference to the string's length whatsoever, neither to incorporate that value into the hash, nor to determine how many characters to compute the hash code for. Instead, the x64 code ***just scans the string forward until it hits the first '\0' char***. If there are no embedded nulls, then it will scan to the end, where the **CLR** ensures there will always be an extra `\0` char (that is not included in the `Length`).</p><p>Thus, by ignoring the stored length of the string, the x64 code *takes a critical dependency* on that zero-terminating char being present. If that `\0` gets corrupted somehow, the failure mode is severe, since that loop can immediately scan off the end of the string into unrelated memory areas. </p><p>Since the **x86** version refers to the stored string length to determine how many chars to hash--it might seem like that code doesn't have the same problem, and it's true that it's not as fatal, as follows:</p><p>The x86 code does actually take a ***different kind of dependency*** on the zero terminator, namely, that loop is written such that the 16-bit terminator value itself is `XORed` into the returned hash value whenever the two lowest bits of the input string length are equal to `0b_00000011 == 0x03`. For that operation to have no effect, the terminator must be zero (since `xor` with zero is a `nop`.) So if the terminator somehow becomes corrupted, the returned hash code value will be affected, but there won't likely be an immediate `AccessViolationException` (as with the x64 case).</p> _These are the original issue solutions:_ (no solutions) --- @Joe4evr commented on [Mon Feb 12 2018](https://github.com/dotnet/roslyn/issues/24780#issuecomment-365098562) Curious, does this also repro for the `OrdinalIgnoreCase` variants? --- @jcouv commented on [Mon Feb 12 2018](https://github.com/dotnet/roslyn/issues/24780#issuecomment-365161086) @AlexGhiondea Could you help route? It feels like either a runtime or a BCL issue on desktop. --- @glenn-slayden commented on [Tue Feb 13 2018](https://github.com/dotnet/roslyn/issues/24780#issuecomment-365363366) Yes, it should be BCL. The problem is with MSIL code that exists in the `String.GetHashCode` function in mscorlib.dll. The difference between **x64** and **x86** is due to there being different mscorlib.dll builds for each. --- @glenn-slayden commented on [Tue Feb 13 2018](https://github.com/dotnet/roslyn/issues/24780#issuecomment-365370873) @jinujoseph The 'Area-IDE' tag doesn't sound right; as I mentioned the problem is with runtime code in the Base Class Library. --- @jcouv commented on [Tue Feb 13 2018](https://github.com/dotnet/roslyn/issues/24780#issuecomment-365374965) I'll move the issue over to corefx " 27100 area-Infrastructure Update inbox data for UAP 6 A number of assemblies shipped inbox in `release/uwp6.0` (10.0.15138), but have been rev'ed in master and ship ref-assms that would apply to UAP. This will cause a ref-def mismatch if we don't include the implementation assembly for UAP in the package. We need to make sure to update the packageIndex in to account for this and then ensure that the current packages validate cleanly (either rolling back reference assembly versions or adding UAP runtime assemblies to fix errors). This **must** be done before we ship the packages again. Ideally it's done before we ship a preview of the packages, so that we don't break folks if we decide to roll-back reference assembly versions. /cc @joperezr @weshaggard 27101 area-System.Memory Add an option to return finalizable versions of ArrayMemoryPoolBuffer from MemoryPool 27102 area-System.IO API tweaks to match latest updates to spec Add a few new tests See #25873 cc: @terrajobst, @danmosemsft 27103 area-System.Security Add FixedTimeEquals and other crypto helper routines as public API Fixes #10749. 27104 area-Microsoft.CSharp Remove more orphaned code in Microsoft.CSharp Missed a couple in #26491 but @ericstj rerunning the diffs in #17905 found them. 27106 area-System.Diagnostics Fix ETW EventCounter Tests and Manifest_Write_T Tests Both of these tests fail because the event names are incorrect. They both use TraceLogging but have statically defined events as well which results in them having a manifest produced as well (because they are not strictly marked as SelfDescribing EventSources). TraceEvent loads the manifests correctly but does not load the templates for the TraceLogging events. Template loading appears to be specific to TraceLog but swapping in TraceLog results in a bunch of other failures. This should be investigated so that these tests can be re-activated. 27109 area-System.Console Adding support for ncurses 6.1 TERM format on System.Console Fixes #26966 cc: @stephentoub @ianhays ncurses 6.1 introduced a new magic number in their header, that if read, then its contents should be parsed as 32-bit integers instead of 16-bit integers. These changes will add support for ncurses6.1. 27113 area-System.Net Fix failing authentication test cases on different httpclienthandlers. Search for issue number in code. 27114 area-System.Runtime "Test under ""System.Tests.EnvironmentTests"" failed with ""System.ArgumentOutOfRangeException""" The test System.Tests.EnvironmentTests.WorkingSet_Valid has failed. MESSAGE: System.ArgumentOutOfRangeException : Specified argument was out of the range of valid values. +++++++++++++++++++ STACK TRACE: at System.Environment.get_WorkingSet() at System.Tests.EnvironmentTests.WorkingSet_Valid() in /mnt/resource/j/workspace/dotnet_corefx/master/rhel7.2_release/src/System.Runtime.Extensions/tests/System/EnvironmentTests.cs:line 180 Details: https://ci.dot.net/job/dotnet_corefx/job/master/job/rhel7.2_release/5053/testReport/System.Tests/EnvironmentTests/WorkingSet_Valid/ 27116 area-System.Diagnostics Remove USE_ETW Compilation Constant from System.Diagnostics.Tracing.Tests It may be possible to remove USE_ETW and just mark the tests as Windows only. We should see if this is possible to simplify the test code. 27118 area-System.Threading Enable WaitHandle.SignalAndWait tests on Unix Depends on https://github.com/dotnet/coreclr/pull/16383 Fixes https://github.com/dotnet/coreclr/issues/10441 27119 area-System.Net DO NOT MERGE: simple connection reuse test 27120 area-System.Security The RSA implementation fails to encrypt an empty byte array - Steps to reproduce: run the following code on **Windows 10 or Mac OS X on .Net Core 2.0**: ```C# var key = RSA.Create(); var encrypted = key.Encrypt(new byte[0], RSAEncryptionPadding.Pkcs1); ``` - Expected result: A byte array that would be decrypted to an empty byte array. - Actual result: Exception on Windows 10: ``` Internal.Cryptography.CryptoThrowHelper.WindowsCryptographicException HResult=0x80090027 Message=The parameter is incorrect Source=System.Security.Cryptography.Algorithms StackTrace: at System.Security.Cryptography.RSAImplementation.RSACng.EncryptOrDecrypt(SafeNCryptKeyHandle key, Byte[] input, AsymmetricPaddingMode paddingMode, Void* paddingInfo, EncryptOrDecryptAction encryptOrDecrypt) at System.Security.Cryptography.RSAImplementation.RSACng.EncryptOrDecrypt(Byte[] data, RSAEncryptionPadding padding, EncryptOrDecryptAction encryptOrDecrypt) at System.Security.Cryptography.RSAImplementation.RSACng.Encrypt(Byte[] data, RSAEncryptionPadding padding) at ConsoleApp3.Program.Main(String[] args) ``` On Mac OS X the exception is: ``` System.ArgumentNullException: Value cannot be null. Parameter name: source at System.Runtime.InteropServices.Marshal.CopyToManaged(IntPtr source, Object destination, Int32 startIndex, Int32 length) at Interop.CoreFoundation.CFGetData(SafeCFDataHandle cfData) at Interop.AppleCrypto.ExecuteTransform(SecKeyTransform transform) at Interop.AppleCrypto.RsaEncrypt(SafeSecKeyRefHandle publicKey, Byte[] data, RSAEncryptionPadding padding) at System.Security.Cryptography.RSAImplementation.RSASecurityTransforms.Encrypt(Byte[] data, RSAEncryptionPadding padding) at ConsoleApp3.Program.Main(String[] args) ``` **Running the same code on .Net Framework 4.6.1 and on Core on Ubuntu returns the expected result.** 27121 area-System.Drawing Unable to create Bitmap from disk file on Linux "Hi, I'm referencing CoreCompat.System.Drawing.v2 from a .NET Core project and doing the following: Bitmap frame = new Bitmap($""{Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)}\\images\\image_0.bmp"") I've checked that the path is correct at runtime. On Windows this works fine, but on Debian I am getting: Unable to update the static FcBlanks: 0x0600 Unable to update the static FcBlanks: 0x0601 Unable to update the static FcBlanks: 0x0602 Unable to update the static FcBlanks: 0x0603 Unable to update the static FcBlanks: 0x06dd Unable to update the static FcBlanks: 0x070f Unable to update the static FcBlanks: 0x2028 Unable to update the static FcBlanks: 0x2029 Unable to update the static FcBlanks: 0xfff9 Unable to update the static FcBlanks: 0xfffa Unable to update the static FcBlanks: 0xfffb Unhandled Exception: System.ArgumentException: A null reference or invalid value was found [GDI+ status: InvalidParameter] at System.Drawing.GDIPlus.CheckStatus(Status status) at System.Drawing.Bitmap..ctor(String filename, Boolean useIcm) at TestVideoConvert.TestVideoConvert.Create() in /home/osboxes/Downloads/Test2/TestVideoConvert/TestVideoConvert.cs:line 44 at ImageResizeNetCore.Program.Main(String[] args) in /home/osboxes/Downloads/Test2/ImageResizeNetCore/Program.cs:line 15 I've installed libgdiplus, but no luck. Using System.Drawing.Common gives the following error: Unhandled Exception: System.ArgumentException: Parameter is not valid. at System.Drawing.Bitmap..ctor(String filename, Boolean useIcm) at TestVideoConvert.TestVideoConvert.Create() in /home/osboxes/Downloads/Test2/TestVideoConvert/TestVideoConvert.cs:line 44 at ImageResizeNetCore.Program.Main(String[] args) in /home/osboxes/Downloads/Test2/ImageResizeNetCore/Program.cs:line 15 I've read somewhere that this could be due to the image size being too large, but in my case it's a 1920x1080 bmp so not out of the ordinary. Here is a sample image to repro the issue: https://wallpaperscraft.com/image/stars_sky_shore_84534_1920x1080.jpg" 27123 area-System.IO Move System.IO.Pipelines to netstandard1.1 27124 area-System.Text Regex code optimization candidates The following items are potential candidates for code optimization which could result in an increased performance / reduced allocation. Based on perfview data and manual code review. ### Time - [x] Avoid additional iteration in op code generation (https://github.com/dotnet/corefx/pull/26877) - [x] CharInClass (Internal & Recursive) (12.7% + 7.9% time spent exclusively) https://source.dot.net/#System.Text.RegularExpressions/System/Text/RegularExpressions/RegexCharClass.cs,787 comments from @danmosemsft: optimizing for common characters [A-Za-z] first? Bloom filter? It's doing a binary search over a short list comments from myself: I think binary search shouldn't be an issue even for small classes. See this article: https://schani.wordpress.com/2010/04/30/linear-vs-binary-search/ - [x] Stringmatch (6.2 % time spent exclusively) https://source.dot.net/#System.Text.RegularExpressions/System/Text/RegularExpressions/RegexInterpreter.cs,256 Inline optimization for short case-sensitive strings (default). `if (str[--c] != _culture.TextInfo.ToLower(runtext[--pos]))` check whether the characters are identical before doing ToLower - [ ] SetOperator (5.4% time spent exclusively) https://source.dot.net/#System.Text.RegularExpressions/System/Text/RegularExpressions/RegexInterpreter.cs,148 Store a boolean whether either of those opcodes appear in the pattern at all. Reduces costs to a Boolean check only. - [ ] Forwardcharnext (3.5% time spent exclusively) https://source.dot.net/#System.Text.RegularExpressions/System/Text/RegularExpressions/RegexInterpreter.cs,249 The benchmark analyzed by perfview uses case sensitive comparison. I don't know why so much time is spent in this function when it only does two comparisons and an index operation. - [ ] EnsureStorage (2.3% time spent exclusively, a lot of allocation is done here) https://source.dot.net/#System.Text.RegularExpressions/System/Text/RegularExpressions/RegexRunner.cs,345 Though one of the functions is called Stack it's allocating arrays on the Heap. We should investigate how often these array sizes are increased and think about using stackalloc with Span/ValueListBuilder here. - [x] Analyze failing inlinees There are probably tons of other places where inline optimizations are applicable. [System.Text.RegularExpression.Inline.xlsx](https://github.com/dotnet/corefx/files/1725897/System.Text.RegularExpression.Inline.xlsx) ### Allocations In regex-redux there are 3 huge sets of allocations that dominate the rest - There is a cascade of replacements on a 50M character string, which creates 500MB of string garbage, presumably in LOH  - Its input file is read into a 100MB string. (double byte - 50MB file) - There are 100MB of StringBuilder allocations. Could we use spans or pooled buffers or otherwise avoid these huge temporary strings? Help is appreciated. If someone wants to collaborate I can share my perfview zip. I will extend this list over time. FYI @stephentoub @jkotas @joshfree @vancem 27125 area-System.Text Inline RegexCharClass code Relates to https://github.com/dotnet/corefx/issues/27124 Code wasn't inlined before because the JIT function size exceeds threshold. IL size is 26 bytes. Is there an easier way to tell for sure if a method is inlined? Currently I'm more or less guessing by looking at the generated JIT code and then I set a break point inside the function and if it not hit the code must be inlined. (in Release mode of course) cc @danmosemsft 27126 area-System.Security *CNG crypto algorithms missing from CNG library I was looking at porting some code targeting desktop and came across SHA256Cng which I noticed was missing. I did a diff and I see we're actually missing a number of Cng algorithms: - MD5Cng - SHA1Cng - SHA256Cng - SHA384Cng - SHA512Cng Moreover, I see quite a few more here: https://github.com/dotnet/corefx/blob/5edf66e4f35eca3ba409cb2e31154fb6a59bd4b3/src/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/CryptoConfig.cs#L266-L284 Any reason we left these out? /cc @bartonjs 27127 area-System.Globalization "Test failure: System.Globalization.Tests.NumberFormatInfoCurrencyNegativePattern/CurrencyNegativePattern_Get(locale: \""fa-IR\"")" "Opened on behalf of @danmosemsft The test `System.Globalization.Tests.NumberFormatInfoCurrencyNegativePattern/CurrencyNegativePattern_Get(locale: \""fa-IR\"")` has failed. Assert.Contains() Failure Not found: 1 In value: Int32[] [8] Stack Trace: null Build : Master - 20180214.02 (Core Tests) Failing configurations: - Ubuntu.1804.Amd64-x64 - Release " 27129 area-Infrastructure Remove EOL OS's from Jenkins - Removes some EOL OS's from our Jenkins Innerloop and Outerloop tests. These test definitions are triggerable on PR's but are not run by default. They are primarily used for daily/onPush runs that the badges on the corefx ReadMe.md can point to. By removing the definitions, we aren't losing any OS coverage since we run them on Helix. We are, however, losing the badge runs, so until we point the badges to the helix runs those are going to be outdated. - Add a daily trigger to helix outerloop runs to replace the outerloop runs I'm removing from the Jenkins build/test. resolves https://github.com/dotnet/corefx/issues/27095 for corefx/master. resolves https://github.com/dotnet/corefx/issues/25252 for corefx/master @mmitche @MattGal 27130 area-Infrastructure Point the Readme test badges to Helix runs We should abandon the Jenkins testing infrastructure for innerloop/outerloop which is currently only being used for the badges and instead point our badges at daily/onPush helix runs (daily outerloop added in https://github.com/dotnet/corefx/pull/27129). This greatly reduces the cost of updating our test OS versions and also makes the badges more accurately reflect our current build&test state. Forked from https://github.com/dotnet/corefx/issues/27095 Depends on https://github.com/dotnet/core-eng/issues/1901 27131 area-System.Threading Remove a SignalAndWait test so that relevant change in CoreCLR can be brought into CoreFX This test would fail after CoreCLR PR https://github.com/dotnet/coreclr/pull/16383, removing. https://github.com/dotnet/corefx/pull/27118 is the other part of this set of changes. 27132 area-System.IO WIP Move Pipes ACL types down /cc @pjanotti Just meant to test the changes I've made. 27133 area-System.IO Add some pattern transformation tests 27134 area-System.IO Change RootDirectory properties to span Exposing string restricts the ability to change internals without introducing unnecessary allocations. 27135 area-System.Net Improve test coverage of SocketsHttpHandler Used code coverage information to write targeted tests to cover various uncovered paths in SocketsHttpHandler. Along the way fixed a variety of issues relating to throwing the wrong exception type, a stack overflow due to an unexpected recursive call, etc. cc: @geoffkizer, @davidsh, @Priya91, @wfurt 27138 area-System.Globalization Fixing fa-IR neg currency format for test GetCurrencyNegativePattern Fixes #27022 27139 area-System.Globalization Fixing fa-IR neg. currency format for test GetCurrencyNegativePattern Fixing fa-IR negative currency format for test GetCurrencyNegativePattern Fixes #27022 27142 area-System.Data Fix the name of the schema queue Allow Schema queue to be detected from the database schema instead of assuming that the schema name is user name. This approach is more portable, especially while running tests in a SQL docker installation. 27145 area-System.Net SocketsHttpHandler: Consider exposing a setting for Expect: 100-continue timeout This is hardcoded to 1 second today. We should consider exposing a setting to control this. API proposal: ```C# public sealed class SocketsHttpHandler { public TimeSpan Expect100ContinueTimeout { get; set; } // Default is 1 second, as today } ``` 27146 area-System.Text Fix regression & enable ClearInitLocals in System.Text.RegularExpressions I expect we will use more stackalloc in Regex over time therefore it makes sense to enable the switch now. Relates to https://github.com/dotnet/corefx/pull/26993 Also fixes a bad code refactoring introduced by https://github.com/dotnet/corefx/pull/26877 27147 area-System.Diagnostics BasicEventSourceTests failing in non elevated Windows runs cc @brianrob Not all our Windows test runs are elevated. Tests need to pass non elevated. ``` BasicEventSourceTests.FuzzyTests.Test_Write_Fuzzy | 35 ms | 10 -- | -- | -- BasicEventSourceTests.TestsWriteEvent.Test_WriteEvent_ComplexData_SelfDescribing_ETW | 0 ms | 10 BasicEventSourceTests.TestsWriteEvent.Test_WriteEvent_SelfDescribing_ETW | 0 ms | 10 BasicEventSourceTests.TestsWriteEvent.Test_WriteEvent_Manifest_ETW | 0 ms | 10 BasicEventSourceTests.TestsWriteEvent.Test_WriteEvent_ByteArray_Manifest_ETW | 0 ms | 10 BasicEventSourceTests.TestsWriteEvent.Test_WriteEvent_ByteArray_SelfDescribing_ETW | 0 ms | 10 BasicEventSourceTests.TestsWrite.Test_Write_T_ETW | 0 ms | 10 BasicEventSourceTests.TestsUserErrors.Test_BadEventSource_MismatchedIds ``` eg https://ci.dot.net/job/dotnet_corefx/job/master/job/windows_nt_debug/lastCompletedBuild/testReport/BasicEventSourceTests/FuzzyTests/Test_Write_Fuzzy/ They are all failing this way ``` MESSAGE: System.Exception : Need to be elevated to run. +++++++++++++++++++ STACK TRACE: at BasicEventSourceTests.EtwListener..ctor(String dataFileName, String sessionName) in D:\j\workspace\windows_nt_debug88592b53\src\System.Diagnostics.Tracing\tests\BasicEventSourceTest\Harness\Listeners.cs:line 170 at BasicEventSourceTests.FuzzyTests.Test_Write_Fuzzy() in D:\j\workspace\windows_nt_debug88592b53\src\System.Diagnostics.Tracing\tests\BasicEventSourceTest\FuzzyTests.cs:line 2751 ``` Fix seems to be to change all these to have `[ConditionalFact(nameof(IsProcessElevated))]` 27148 area-System.Net Fix race condition in PostAsyncExpect100Continue_RetryOnConnectionClosed_Success test Fixes https://github.com/dotnet/corefx/issues/26760 cc: @geoffkizer 27150 area-System.IO Cleaning out dead code Also refactor Unix attribute handling a bit to be more consistent and ensure that we don't make unnecessary addtional filesystem calls. 27151 area-System.Net SocketsHttpHandler: refactor pool manager logic to enable SSL proxy tunneling support Reorganize and enhance a bunch of pool management logic to enable SSL proxy tunneling support. Note that proxy tunneling support isn't actually working yet; once Tomas gets his CONNECT PR in, this should enable the tunnel support. Split into two commits; first is general reorganization to enable proxy tunneling, second is the code to specifically implement proxy tunneling via CONNECT. @stephentoub @wfurt @davidsh 27152 area-System.IO NamedPipeClientStream does not work on Mac on Mono I've been trying to port the compiler server to work on Mono, but I hit a serious snag: looks like named pipes don't support Mono. Here's the stack trace I get: ```C# --- PID=37064 TID=29 Ticks=-1794243353: Attempt to open named pipe 'angocke.F.HUdVQvyExeOVtpAXeTBkTcTRj' --- PID=37064 TID=29 Ticks=-1794243341: Exception 'Error on creating named pipe: error code -1' occurred during 'Exception while connecting to process'. Stack trace: at System.IO.Pipes.UnixNamedPipe.EnsureTargetFile (System.String name) [0x00029] in <f7cad77794fc4fa5bf9a33531f4b94b4>:0 at System.IO.Pipes.UnixNamedPipeClient..ctor (System.IO.Pipes.NamedPipeClientStream owner, System.String serverName, System.String pipeName, System.IO.Pipes.PipeAccessRights desiredAccessRights, System.IO.Pipes.PipeOptions options, System.IO.HandleInheritability inheritability) [0x00080] in <f7cad77794fc4fa5bf9a33531f4b94b4>:0 at System.IO.Pipes.NamedPipeClientStream..ctor (System.String serverName, System.String pipeName, System.IO.Pipes.PipeAccessRights desiredAccessRights, System.IO.Pipes.PipeOptions options, System.Security.Principal.TokenImpersonationLevel impersonationLevel, System.IO.HandleInheritability inheritability) [0x0003b] in <f7cad77794fc4fa5bf9a33531f4b94b4>:0 at System.IO.Pipes.NamedPipeClientStream..ctor (System.String serverName, System.String pipeName, System.IO.Pipes.PipeDirection direction, System.IO.Pipes.PipeOptions options, System.Security.Principal.TokenImpersonationLevel impersonationLevel, System.IO.HandleInheritability inheritability) [0x00009] in <f7cad77794fc4fa5bf9a33531f4b94b4>:0 at System.IO.Pipes.NamedPipeClientStream..ctor (System.String serverName, System.String pipeName, System.IO.Pipes.PipeDirection direction, System.IO.Pipes.PipeOptions options, System.Security.Principal.TokenImpersonationLevel impersonationLevel) [0x00000] in <f7cad77794fc4fa5bf9a33531f4b94b4>:0 at System.IO.Pipes.NamedPipeClientStream..ctor (System.String serverName, System.String pipeName, System.IO.Pipes.PipeDirection direction, System.IO.Pipes.PipeOptions options) [0x00000] in <f7cad77794fc4fa5bf9a33531f4b94b4>:0 at (wrapper remoting-invoke-with-check) System.IO.Pipes.NamedPipeClientStream..ctor(string,string,System.IO.Pipes.PipeDirection,System.IO.Pipes.PipeOptions) ``` cc @jaredpar @stephentoub 27153 area-System.IO Current directory code duplicates Environment Just call Environment.CurrentDirectory. Remove a number of P/Invokes that are no longer in use. 27154 area-System.IO Remove IDisposable from IDuplexPipe The way you close a pipe is by completing both sides, and in the case of an IDuplexPipe, that's the input and output. There should be no dispose on the interface. /cc @pakrym 27155 area-System.IO Use shared IO helper code from CoreCLR Common IO source code helpers were copied to CoreCLR some time ago. Now that we are mirroring, we should switch to using the mirrored code. There has been quite a bit of drift, so it might take some effort. src/Common/src/System/IO/PathInternal.Windows.cs -> src/Common/src/CoreLib/System/IO/PathInternal.Windows.cs https://github.com/dotnet/corefx/pull/27150#discussion_r168377623 27157 area-System.IO Default the pipe scheduler to the thread pool instead of inline As a safe default for the 99% of people we should use the ThreadPool PipeScheduler instead of the Inline one. Running inline can cause unintended consequences (like deadlocks). 27158 area-System.IO Made a few tweaks to pipelines - Renamed the file containing the class IDuplexPipe - Changed the default scheduler to use the ThreadPool if none was specified Resolves #27157 27161 area-System.Collections ImmutableArray<byte> .Concat() includes a number of trailing zeroes not present in either argument ".NET Command Line Tools 2.0.2 Hello! Found a weird problem today, been able to isolate it to the following code sample: ```C# using Newtonsoft.Json; using System; using System.Collections.Immutable; using System.Linq; using System.Text; namespace ArraySanitycheck { class Program { public sealed class TestModel { public readonly string TestString; public readonly int TestNumber; public TestModel(string testString, int testNumber) { TestString = testString; TestNumber = testNumber; } } static void Main(string[] args) { var model = new TestModel(""Test String Content"", 268234); var bytes = Encoding.UTF8.GetBytes($""Test Purpose\0{JsonConvert.SerializeObject(model)}"").ToImmutableArray(); var a = bytes.TakeWhile(i => i != 0); var b = new byte[] { 0 }; var c = bytes.SkipWhile(i => i != 0).Skip(1).Take(5); var d = new byte[] { 254 }; var e = bytes.SkipWhile(i => i != 0).Skip(6); var concatenated = a.Concat(b).Concat(c).Concat(d).Concat(e); } } } ``` Set a breakpoint on the closing brace following `var concatenated...` and inspect `concatenated`. It ends with approximately 15 zeroes. Note that none of a, b, c, d or e include said zeroes. Weirdly, attempting to write this data to the console (`Console.WriteLine(string.Join("", "", concatenated));`) does not include the zeroes either. I suspect this may be an issue with how TakeWhile/SkipWhile perform ""slices"" of the underlying array (the length of the concatenated array is the same as the length of the sliced array)." 27162 area-System.IO Remove Commit from PipeWriter Commit was originally added because to allow an opportunistic pick up of data by the reader if it's already reading but it doesn't give any back pressure and can be a pit of failure in some cases. Originally, it was required when we had the requirement to Alloc() then Commit() but that requirement has been relaxed. On top of that the scenarios it was added for were a bit ill defined and we should remove it from the PipeWriter class. /cc @benaadams @pakrym 27163 area-System.Net Streamline SocketHttpHandler's ParseStatusLine validation "For a typical status line like ""HTTP/1.1 200 OK"", cuts the time of ParseStatusLine almost in half. Fixes https://github.com/dotnet/corefx/issues/26946 cc: @geoffkizer, @davidsh" 27164 area-Infrastructure more love from BenchmarkDotNet to CoreFX "To tell the long story short: I implemented new toolchain for BenchmarkDotNet which generates a self-contained app which can target **ANY** CoreFX and CoreCLR builds. I combined the knowledge from dogfooding docs from [corefx](https://github.com/dotnet/corefx/blob/master/Documentation/project-docs/dogfooding.md) and [coreclr](https://github.com/dotnet/coreclr/blob/master/Documentation/workflow/UsingDotNetCli.md). dotnet cli does the job for us, it's just a matter of generating the right `.csproj` and `NuGet.config` files. So you can now: 1. Benchmark local CoreFX builds 2. Benchmark nightly CoreFX builds 3. Benchmark local CoreCLR builds 4. Benchmark nightly CoreCLR builds 5. Mix them all together 6. Compare them 7. Use Disassembly Diagnoser to get the generated assembly code To use the new feature you need to add our CI feed to your `NuGet.config` file and download version `0.10.12.433` or newer. ```xml <packageSources> <add key=""bdn-CI"" value=""https://ci.appveyor.com/nuget/benchmarkdotnet"" /> </packageSources> ``` Simple example: ```cs public class LocalCoreFxConfig : ManualConfig { public LocalCoreFxConfig() { Add(Job.ShortRun.With(CustomCoreClrToolchain.CreateForLocalCoreFxBuild( @""C:\Projects\forks\corefx\bin\packages\Release"", ""4.5.0-preview2-26313-0""))); Add(DefaultConfig.Instance.GetExporters().ToArray()); Add(DefaultConfig.Instance.GetLoggers().ToArray()); Add(DefaultConfig.Instance.GetColumnProviders().ToArray()); Add(DisassemblyDiagnoser.Create(new DisassemblyDiagnoserConfig(printAsm: true, recursiveDepth: 2))); } } class Program { static void Main(string[] args) => BenchmarkSwitcher.FromAssembly(typeof(Program).GetTypeInfo().Assembly) .Run(args, new LocalCoreFxConfig()); } ``` Comparison: ```cs Add(Job.Default.With(CustomCoreClrToolchain.CreateForNightlyCoreFxBuild(""4.5.0-preview2-26214-01"", displayName: ""before my change""))); Add(Job.Default.With(CustomCoreClrToolchain.CreateForNightlyCoreFxBuild(""4.5.0-preview2-26215-01"", displayName: ""after my change""))); ``` Complex example: ``` public class LocalCoreClrConfig : ManualConfig { public LocalCoreClrConfig() { Add(Job.ShortRun.With( new CustomCoreClrToolchain( ""local builds"", coreClrNuGetFeed: @""C:\Projects\forks\coreclr\bin\Product\Windows_NT.x64.Release\.nuget\pkg"", coreClrVersion: ""2.1.0-preview2-26313-0"", coreFxNuGetFeed: @""C:\Projects\forks\corefx\bin\packages\Release"", coreFxVersion: ""4.5.0-preview2-26313-0"") )); Add(Job.ShortRun.With( new CustomCoreClrToolchain( ""local coreclr myget corefx"", coreClrNuGetFeed: @""C:\Projects\forks\coreclr\bin\Product\Windows_NT.x64.Release\.nuget\pkg"", coreClrVersion: ""2.1.0-preview2-26313-0"", coreFxNuGetFeed: ""https://dotnet.myget.org/F/dotnet-core/api/v3/index.json"", coreFxVersion: ""4.5.0-preview2-26215-01"") )); Add(Job.ShortRun.With( new CustomCoreClrToolchain( ""myget coreclr local corefx"", coreClrNuGetFeed: ""https://dotnet.myget.org/F/dotnet-core/api/v3/index.json"", coreClrVersion: ""2.1.0-preview2-26214-07"", coreFxNuGetFeed: @""C:\Projects\forks\corefx\bin\packages\Release"", coreFxVersion: ""4.5.0-preview2-26313-0"") )); Add(Job.ShortRun.With( new CustomCoreClrToolchain( ""myget builds"", coreClrNuGetFeed: ""https://dotnet.myget.org/F/dotnet-core/api/v3/index.json"", coreClrVersion: ""2.1.0-preview2-26214-07"", coreFxNuGetFeed: ""https://dotnet.myget.org/F/dotnet-core/api/v3/index.json"", coreFxVersion: ""4.5.0-preview2-26215-01"") )); // the rest of the config.. } } ``` The output is going to contain exact CoreCLR and CoreFX versions used: ``` BenchmarkDotNet=v0.10.12.20180215-develop, OS=Windows 10 Redstone 3 [1709, Fall Creators Update] (10.0.16299.192) Intel Core i7-3687U CPU 2.10GHz (Ivy Bridge), 1 CPU, 4 logical cores and 2 physical cores Frequency=2533308 Hz, Resolution=394.7408 ns, Timer=TSC .NET Core SDK=2.1.300-preview2-008162 [Host] : .NET Core 2.0.5 (CoreCLR 4.6.26020.03, CoreFX 4.6.26018.01), 64bit RyuJIT Job-DHYYZE : .NET Core ? (CoreCLR 4.6.26313.0, CoreFX 4.6.26313.0), 64bit RyuJIT Job-VGTPFY : .NET Core ? (CoreCLR 4.6.26313.0, CoreFX 4.6.26215.01), 64bit RyuJIT Job-IYZFNW : .NET Core ? (CoreCLR 4.6.26214.07, CoreFX 4.6.26215.01), 64bit RyuJIT Job-CTQFFQ : .NET Core ? (CoreCLR 4.6.26214.07, CoreFX 4.6.26313.0), 64bit RyuJIT ``` Corresponding change in BenchmarkDotNet https://github.com/dotnet/BenchmarkDotNet/issues/651 @ViktorHofer @benaadams @stephentoub @JosephTremoulet @maryamariyan @AndyAyersMS I am open to feedback and willing to improve/change the feature! " 27165 area-System.Diagnostics Process.Start fails to execute properly "_From @victorsample on February 15, 2018 14:44_ Using Visual Studio 2017 Community Process.Start (<name>,<command_line) fails to execute properly. Trying to start Postgresql utility ""psql"" with command line ""-U aobadmin aobdb <C:\\Temp\\backupdb.sql"" does not execute properly. Putting the execution in a "".bat"" file and building the command line in the bat file does work. Apparently the form of the ""psql"" command is causing a problem. _Copied from original issue: dotnet/coreclr#16399_" 27167 area-System.Numerics Add a special Numeric structure or INumeric Interface _Intrinsic_ numeric types (byte, int, float, ….etc) are structures, so unfortunately, they have no base class that can gather all basic methods and operators! So I suggest to add a special Numeric structure that can accept numeric values of any type. It should contain the value and the underling type of it, as Object class does. Numeric structure should have the basic arithmetic and logical operators. Or it can be an interace (say INumeric) that all numeric data types implement. This will not break any existing code. Usage: Numeric structure (or INumeric Inrerface) can be used in generic methods where T is expected to be a numeric type, to carry out the basic arithmetic and logical operators without writing a dozen if statements for each individual numeric type. Objects doesn't have the basic arithmetic and logical operators and have to be converted to numeric types to work with. For example, I tried to do this but failed: ``` public struct Numeric { public object Value { get; set; } public static Numeric operator +(Numeric n1, Numeric n2) { return (Numeric)(n1.Value + n2.Value); } } ``` C# refuses n1.Value + n2.Value because it doesn't know how to add objects. Many if statements are needed to deal with different types of n1 and n2, regarding the larger type to use as the output type. This is a hell of code to something that should be easy and direct if there was a general numeric type that can contain any numeric type. I face the same situation when I use the base Enum class in any method, because Enum can have any numeric type as an underling type! I saw similar problem in the source code of Vector<T>, where tons of code lines are repeated just to cover all cases of each numeric type! Note: If you add the numeric type, C# and VB.net should add a new constraint for generic parameters to be numerics. where T: numeric this means T can only be of type Numeric or any intrinsic numeric data types. So, If this Numeric Type or INumeric Interface exists, one can write ``` public static Enum SetFlag(Enum value, Enum flag) { var result = (Numeric)value | (Numeric)flag); return (Enum)result; } ``` instead of: ``` public static Enum SetFlags(Enum value, Enum flag) { if (Enum.GetUnderlyingType(value.GetType()) == typeof(byte)) return (Enum)(object)((byte)(object)value | (byte)(object)flag); if (Enum.GetUnderlyingType(value.GetType()) == typeof(int)) return (Enum)(object)((int)(object)value | (int)(object)flag); // // // etc } ``` and the same when writing generic types that deal with numeric data types only. This can be extended based on this proposal https://github.com/dotnet/csharplang/issues/1233, I also suggest to add these interfaces: numeric constraint. IIntegral: for integer tyoes (byte, sbyte, int, uint, short, ushort, long, ulong) IFloating: (float, double, decemal) IValue: (numerics and dates). ILetiral (Char and string). IPrimitive (numerics, dates, char, string) These Interfaces will make writting generics easier. IPerimative can help you format or parsing or using + operation depending on where T: IPerimative. Also it can be usefull when defining generic lists and dictionaries that can contain different values. This will make them more specialized than using objects. 27168 area-System.IO Add IsFlush to Pipelines ReadResult ```csharp public partial struct ReadResult { public bool IsFlush => (_resultFlags & ResultFlags.Flush) != 0; } ``` ```diff [Flags] internal enum ResultFlags : byte { None = 0x0, Canceled = 0x1, Completed = 0x2, + Flush = 0x4 } ``` And set for calls to `FlushAsync()` This allows the reader; if it chooses, to differentiate between a `WriteAsync()` and a `FlushAsync()` (if the writer differentiates) **Use case** If `WriteAsync` and `FlushAsync` are differentiated; a `TextWriter` type on a Pipeline does not need to maintain arrays of internal buffered data to have good performance but only needs a char (or two?) to maintain the outstanding surrogate pairs for encoding; the rest can be directly written to the Pipe. If they don't differentiate then it can't write directly to the Pipe as writing a very small chunk followed by a flush in a loop would have an unacceptable performance degradation; so its back to maintaining internal arrays and then writing in a large chunk 😢 /cc @davidfowl @pakrym @stephentoub 27169 area-Infrastructure [2.1] Update Linux Versions for test execution Port of https://github.com/dotnet/corefx/pull/26723 for the 2.1 branch. Removals: Fedora 25 - EOL 12/20/17 OpenSUSE 42.2 - EOL 01/26/18 RedHat 7.2 - EOL 11/30/17 Additions: OpenSUSE 42.3 Fedora 27 It may be too late to merge this with the impending lockdown, but I wanted to get it ready just in case we want to squeeze it in. These EOL Helix images are being removed soon which will cause red CI for Preview1 without an update. cc: @MattGal @joshfree 27171 area-System.Net Test failure: GetAsync_ManyDifferentRequestHeaders_SentCorrectly "From the test: ``` // Fails consistently with: // System.InvalidCastException: ""Unable to cast object of type 'System.Object[]' to type 'System.Net.Http.WinHttpRequestState'"" // This appears to be due to adding the Expect: 100-continue header, which causes winhttp // to fail with a ""The parameter is incorrect"" error, which in turn causes the request to // be torn down, and in doing so, we this this during disposal of the SafeWinHttpHandle. ```" 27172 area-System.Net CurlHandler allows invalid headers as long as they contain a colon "WinHttpHandler, SocketsHttpHandler, and the netfx all disallow response headers like: - "" : "" - "":"" - ""\x1234: \x5678"" but CurlHandler allows them... as long as there's a colon it's happy." 27173 area-System.Net Fix ConnectAsync not throwing exception for already connected Socket For issue https://github.com/dotnet/corefx/issues/22765. @geoffkizer @wfurt PTAL The previously failing tests are now passing for me locally, running a full test suite to make sure this doesn't regress anything else. 27176 area-System.Net Modify StreamContent to use default CopyToAsync buffer size when no size is provided When creating `StreamContent`, users have the option to provide a buffer size or to use our default. This change attempts to improve performance by deferring to the default buffer size chosen in CopyToAsync rather than selecting the default ourselves. The default buffer size in CopyToAsync is much larger than the default we chose in StreamContent. Deferring to that default greatly improves performance for uploads from slow stream sources like the file system. While it does add some cost for the initial allocation, the larger buffers are then pooled. Users are also still able to specify their own buffer size if they prefer not to use the default. Some rough performance testing on my machine showed a ~20% decrease in the time it took HttpClient to upload a 20 MB file. That performance testing was based off the code in [this article](http://weblogs.thinktecture.com/pawel/2017/03/aspnet-core-webapi-performance.html), which was the source for the original issue. Fixes: #24495 27177 area-System.Data NullReferenceException in SNITCPHandle.Send While attempting to write to a table using a table valued parameters with MARS on I am getting a `NullReferenceException` and the following stack trace. ``` System.NullReferenceException: Object reference not set to an instance of an object. at System.Data.SqlClient.SNI.SNITCPHandle.Send(SNIPacket packet) at System.Data.SqlClient.SNI.SNIMarsConnection.Send(SNIPacket packet) at System.Data.SqlClient.SNI.SNIMarsHandle.SendControlPacket(SNISMUXFlags flags) at System.Data.SqlClient.SNI.SNIMarsHandle.Dispose() at System.Data.SqlClient.SNI.TdsParserStateObjectManaged.Dispose() at System.Data.SqlClient.TdsParserSessionPool.PutSession(TdsParserStateObject session) at System.Data.SqlClient.SqlCommand.EndExecuteNonQuery(IAsyncResult asyncResult) at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, ``` I am on running dotnet-runtime-2.0.5-linux-x64. 27179 area-System.Runtime Need tests for 2.0<->2.1 binary serialization roundtripping We currently test 2.1<->2.1 and 2.1<->NETFX. We also need to verify 2.1<->2.0 works. If we add a new set of canned binary blobs, copy and pasted from the 2.0 servicing branch, we can test 2.0->2.1 with trivial extension of existing mechanisms. To test 2.1->2.0 we would need 2.0 on our test machines, and it isn't there. However it's sufficient to only do that occasionally by hand, and no more often than we update the 2.1 binary blobs, since 2.0 isn't changing. @ViktorHofer can you formalize a plan and then someone can work on it? 27181 area-System.Net Enable SendReceive_VaryingLengthBuffers_Success on Windows run Have run the test 500 times on local Windows 10 machine. No failure. The previous stack trace #22845 is too old, cannot reflect which code path results in this failure. Enable the test on Windows to see if it fails in CI. If it fails, I can investigate further. Related: #23765 27184 area-System.IO Remove FileSystem unused common files Also update .sln using UpdateVSConfigurations cc: @jkotas 27185 area-System.IO Ability to wait for a specific amount of data "Often a protocol knows how much data it is waiting for (TLS frames being one example, size headered binary protocols being another). Instead of ReadAsync() then you check the header and you see you don't have enough, so you ReadAsync() check if you have enough and continue doing loops until you have a complete frame. If you could do a ""ReadAsync(xxxxx)"" and it wouldn't return unless there was an error/complete or at least that amount of data was available it would solve extra looping in every downstream protocol /cc @Drawaes " 27187 area-System.Data SNIPacket performance improvement In `SNIPacket`, memory for `_data` byte array is allocated and released everytime `SqlClient` receives packets from server. I made it to reuse existing byte array if new allocation size is the same as existing byte array length. In `TdsParserStateObjectManaged`, `SNIPacket` object is newly created everytime it sends packets to server. I made it to reuse existing `SNIPacket` object if it is already created previously. This fix improves SqlClient (managedSNI) by around 1000 tps both in sync and async in TechEmpower benchmark testing.(https://github.com/aspnet/benchmarks) 27191 area-System.Diagnostics ArgumentList added to Process.StartInfo Fixes https://github.com/dotnet/corefx/issues/23592 This PR contains tests for the change also 27192 area-System.IO No easy way to see if FileStream.Lock is supported On OS X, FileStream.Lock throws a PlatfomNotSupportedException. There's no easy way to know if a given Platform supports this apart from either hardcoding a list of Platforms, or trying to do it and catching the Exception. Streams have methods like CanRead/CanWrite/CanSeek to allow developers to verify if something _could_ work before doing it. I'd like to propose a new static property on FileStream named like `SupportsLocking` than can be cheaply checked, even before creating the FileStream (as the result of this might influence the `FileMode` etc. arguments). A proposal is [in this commit](https://github.com/mstum/corefx/commit/a9dd5fe07e101807ea0a950ddf9edc9afc3d10ee). 27193 area-System.Memory Add ROSpan ToLower and ToUpper string-like APIs with CultureInfo Part of https://github.com/dotnet/corefx/issues/21395#issuecomment-359906138 - ToLower - ToLowerInvariant - ToUpper - ToUpperInvariant Depends on: https://github.com/dotnet/coreclr/pull/16379 and https://github.com/dotnet/coreclr/pull/16496 cc @jkotas, @stephentoub, @KrzysztofCwalina, @tarekgh, @JeremyKuhne, @joshfree 27194 area-System.Net Remove unsafe from Uri.HexEscape in favor of string.Create Remove unsafe, avoid allocation and write directly into the string's memory. Benchmarking with 200k * 100 samples. Relates to https://github.com/dotnet/corefx/pull/22872 Benchmark-Code: https://gist.github.com/ViktorHofer/43a61de5cd7d3e45b29e36e7a40f21c2 ``` ini BenchmarkDotNet=v0.10.12.431-nightly, OS=Windows 10.0.17101 Intel Core i7-6600U CPU 2.60GHz (Skylake), 1 CPU, 4 logical cores and 2 physical cores Frequency=2742189 Hz, Resolution=364.6722 ns, Timer=TSC [Host] : .NET Core ? (Framework 4.6.26214.07), 64bit RyuJIT Job=.NET Core 2.1 uri Runtime=Core Toolchain=InProcessToolchain ``` Before: | Method | Mean | Error | StdDev | Gen 0 | Allocated | |---------- |---------:|---------:|---------:|------------:|----------:| | HexEscape | 345.2 ms | 3.552 ms | 3.322 ms | 384500.0000 | 769.04 MB | After: | Method | Mean | Error | StdDev | Gen 0 | Allocated | |---------- |---------:|---------:|---------:|------------:|----------:| | HexEscape | 328.6 ms | 5.602 ms | 4.966 ms | 384500.0000 | 769.04 MB | cc @CIPop, @davidsh @danmosemsft 27195 area-System.IO Use NtCreateFile on Win32 NtCreateFile allows passing in a base handle which makes opening child directories much faster. This cuts anywhere from 3-10% of the time off of a GetFiles() call. It is significantly faster as it avoids normalization and path parsing overhead. cc: @terrajobst, @danmosemsft 27198 area-System.Net SocketsHttpHandler: improve chunked read handling Today, we only use a single chunk per ReadAsync on the content body. For example, if we receive a chunked response body like this: ``` 5\r\n hello\r\n 5\r\n world\r\n 0\r\n ``` The first ReadAsync on the response stream will only get the first 5 bytes, even though more bytes are available in subsequent chunks. We should improve this. We should process as many chunks are available in the buffer before returning to the user. Addditionally, we should consider doing a buffered read when we are close to the end of the chunk but haven't fully chunk yet. For example, assume the initial read on the body causes us to read into the connection read buffer, receiving the following chunks, with the second one incomplete: ``` 5\r\n hello\r\n 5\r\n wo ``` Per above, for the initial read, we should process both chunks and return 7 bytes. For the next read, we should notice that we are close to the end of the chunk (3 bytes remaining) and do a buffered read on the connection. This will allow us to process the rest of the current chunk and any additional chunks returned as part of the buffered read. We should only do unbuffered reads when there are enough bytes remaining in the current chunk to satisfy the requested read size, unless the remaining chunk bytes won't fit in the connection read buffer, in which case we should do an unbuffered read up to the remaining chunk bytes. 27199 area-System.Net Put method with Content on Linux is very slow ".Net core - Runtime v2.0.5 ``` csharp using System; using System.Diagnostics; using System.Net.Http; using System.Text; namespace Test { class Program { static void Main(string[] args) { var httpClient = new HttpClient(); // PUT using (var request = new HttpRequestMessage(HttpMethod.Put, ""http://httpbin.org/put"")) { request.Content = new StringContent(""{\""test\"": 123 }"", Encoding.UTF8, ""application/json""); var stopWatch = new Stopwatch(); stopWatch.Start(); using (var response = httpClient.SendAsync(request).Result) { stopWatch.Stop(); Console.WriteLine(""PUT with content - "" + stopWatch.Elapsed); } } using (var request = new HttpRequestMessage(HttpMethod.Put, ""http://httpbin.org/put"")) { var stopWatch = new Stopwatch(); stopWatch.Start(); using (var response = httpClient.SendAsync(request).Result) { stopWatch.Stop(); Console.WriteLine(""PUT without content - "" + stopWatch.Elapsed); } } // POST using (var request = new HttpRequestMessage(HttpMethod.Post, ""http://httpbin.org/post"")) { request.Content = new StringContent(""{\""test\"": 123 }"", Encoding.UTF8, ""application/json""); var stopWatch = new Stopwatch(); stopWatch.Start(); using (var response = httpClient.SendAsync(request).Result) { stopWatch.Stop(); Console.WriteLine(""POST with content - "" + stopWatch.Elapsed); } } using (var request = new HttpRequestMessage(HttpMethod.Post, ""http://httpbin.org/post"")) { var stopWatch = new Stopwatch(); stopWatch.Start(); using (var response = httpClient.SendAsync(request).Result) { stopWatch.Stop(); Console.WriteLine(""POST without content - "" + stopWatch.Elapsed); } } } } } ``` Result: ### Ubuntu 16.04.3 LTS ``` PUT with content - 00:00:02.5108530 PUT without content - 00:00:00.1544149 POST with content - 00:00:00.1640221 POST without content - 00:00:00.1710089 ``` ### Windows 10 Pro ``` PUT with content - 00:00:00.4485657 PUT without content - 00:00:00.2165181 POST with content - 00:00:00.1581848 POST without content - 00:00:00.1617438 ``` Why is Put method with content on Linux so slow? I tried use other content types(Steam/Bytes) and they all works slowly also" 27202 area-System.Text Regex perf test for cache, refs #24425 Performance test for System.Text.RegularExpressions.Regex cache. Refs #24425 27203 area-System.Net Add SslStream test to validate options aren't mutated While reading the code, I thought I saw the AuthenticateAsClientAsync options mutating the input options bag, which it shouldn't do. I wrote a test for it, only to realize that I'd read the code incorrectly and it wasn't mutating things incorrectly. But since I'd written the test, figured I might as well check it in. cc: @Priya91 27204 area-System.Runtime Use stackalloc for longer SystemDirectory paths nit change, use stackalloc for longer SystemDirectory path < 260 chars. 27206 area-Meta Scrub error messages for missing arguments It's really easy to have a resource string with substitutions but then in code forget to include arguments to fill them, e.g. https://github.com/dotnet/corefx/pull/27205. We should scrub through the codebase fixing any such issues we find. I expect 99% of cases would be easily automatable. 27207 area-System.Net Error with PostAsync "if you use this code in the .net core 1-2 then it gives an error with code 400. If you use the same code in .netframework, then everything passes successfully with code 200. Test on windows. Why error? ` class Program { private const string ProjectID = ""61""; private const string SubProjectId = ""0""; private const string ShardId = ""0""; private const string UserId = ""6918200764865613899""; private const string UserId2 = ""7816681534978888932""; private static string XML(string name, string username, string password) { return string.Format(""<?xml version=\""1.0\"" encoding=\""UTF-8\""?><{0} ProjectId=\""{1}\"" SubProjectId=\""{2}\"" ShardId=\""{3}\"" UserId=\""{4}\"" UserId2=\""{5}\"" Username=\""{6}\"" Password=\""{7}\"" />"", name, ProjectID, SubProjectId, ShardId, UserId, UserId2, username, password); } static void Main(string[] args) { HttpClient hc = new HttpClient(); ServicePointManager.ServerCertificateValidationCallback += (o, certificate, chain, errors) => true; hc.DefaultRequestHeaders.Add(""User-Agent"", ""Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.9 Downloader/12820 MailRuGameCenter/1282 Safari/537.36""); hc.DefaultRequestHeaders.Add(""Accept"", ""*/*""); var post = XML(""Auth"", ""artem.rizenkov@gmail.com"", ""XNCCFCWA""); var result = hc.PostAsync(""https://authdl.mail.ru/sz.php?hint=Auth"", new StringContent(post, Encoding.UTF8, ""application/x-www-form-urlencoded"")).GetAwaiter().GetResult(); } }`" 27208 area-System.Net Enable overriding of OpenSSL version Also change the order of attempts to load the libssl.so so that the version 1.0.2 is tried first to make it less probable that some of our other dependencies end up loading conflicting version of libssl on Debian 8 that has bumped the libssl soname to 1.0.2. Closes #24891 27209 area-System.Security Normalize names of span inputs in crypto API "The asymmetric types operate on either hashed input, or unprocessed input. The existing API tends to call hashed input ""hash"" (or ""rgbHash"" for older API), and unprocessed input ""data"" (or ""rgbData""). This change modifies the new (ReadOnly)Span-based methods to use ""data"" and ""hash"" (as appropriate) instead of ""source"". Particularly because the hash-based methods in DSA do not contain the word Hash, making ""source"" for CreateSignature ambiguous. In the cases where the existing parameter was named ""rgbHash"" (et al) the ""rgb"" was dropped in the (ReadOnly)Span variant, including in the cases where the (ReadOnly)Span variant is a proper overload." 27211 area-System.Net [Regresion] Test Failure: System.Net.WebSockets.Client.Tests.CancelTest / CloseAsync_Cancel_Success [System.Net.WebSockets.Client.Tests.CancelTest/CloseAsync_Cancel_Success(server: ws://corefx-net.cloudapp.net/WebSocket/EchoWebSocket.ashx)](https://mc.dot.net/#/user/caesar1995/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/8345c5e744278e6274af556e5bfd3957d7ab7a41/workItem/System.Net.WebSockets.Client.Tests/analysis/xunit/System.Net.WebSockets.Client.Tests.CancelTest~2FCloseAsync_Cancel_Success(server:%20ws:~2F~2Fcorefx-net.cloudapp.net~2FWebSocket~2FEchoWebSocket.ashx)) ``` Assert.Equal() Failure ↓ (pos 4) Expected: The 'System.Net.WebSockets.InternalClientWebS··· Actual: The remote party closed the WebSocket connect··· ↑ (pos 4) ``` ``` at System.Net.WebSockets.Client.Tests.ClientWebSocketTestBase.TestCancellation(Func`2 action, Uri server) in D:\j\workspace\windows-TGrou---6368dffa\src\System.Net.WebSockets.Client\tests\ClientWebSocketTestBase.cs:line 81 at System.Net.WebSockets.Client.Tests.CancelTest.CloseAsync_Cancel_Success(Uri server) in D:\j\workspace\windows-TGrou---6368dffa\src\System.Net.WebSockets.Client\tests\CancelTest.cs:line 80 --- End of stack trace from previous location where exception was thrown --- ``` Consistent repro on Windows. Different from: #22904 ## Failure history Build | OS -- | -- 20180214.01 | 2x OSX10.12 & 2x OSX10.13 20180214.02 | 4x Win10 & 2x Win7 & 2x OSX10.12 & 2x OSX10.13 20180215.01 | 10x Win10 & 4x Win8.1 & 2x OSX10.12 & 2x OSX10.13 20180215.04 | 10x Win10 & 2x Win8.1 & 4x Win7 & 2x OSX10.12 & 2x OSX10.13 20180216.01 | 5x Win10 & Win8.1 & OSX10.12 & OSX10.13 20180216.03 | 4x Win10 & 2x Win7 & Win8.1 & OSX10.12 & OSX10.13 27213 area-System.Net make sure socket is blocking after accept() on macOS and BSD This change will make sure new sockets after Accept() are in blocking mode on macOS. See the notes from #27210. It will also make them auto-close after exec to match Linux behavior. I have no direct evidence that it is causing problems but now remote exec xUnit tests will inherit sockets from main process. 27214 area-Infrastructure Add RH / Centos 7.4 skus @mmitche can you comment on the .groovy change? SHould 7.4 be in outerloop, replace 7.3, or ? 27215 area-Infrastructure [1.1] Stand up CI for new distro versions With [the changes to the supported distro map for 1.1](https://github.com/dotnet/core/pull/1219/files#diff-1c27310d2cbb36ac217c96d508e238f5R33), we need to add CI runs for those distros so we don't ship something without test coverage. Missing RIDS: - Fedora26/Fedora27 - OpenSuse 42.3 27216 area-System.IO Fix some compression tests - Remove an unnecessary, flaky compression test - Reduce brotli performance test time down to ~13 minutes. The problem looks to be that since i was using custom inneriterations the perf runner was going to the max time clock length each time, regardless of max iteration count. I switched my tests to use the Benchmark InnerIterations field and also artificially limited the max Compression iteration count to 100 instead of the usual 1000. resolves https://github.com/dotnet/corefx/issues/26089 resolves https://github.com/dotnet/corefx/issues/26566 27217 area-System.Net "Test Failure: System.Net.Http.Functional.Tests.HttpClientHandlerTest/GetAsync_AllowAutoRedirectTrue_RetainsOriginalFragmentIfAppropriate ""Unhandled Exception""" "[System.Net.Http.Functional.Tests.HttpClientHandlerTest/GetAsync_AllowAutoRedirectTrue_RetainsOriginalFragmentIfAppropriate(origFragment: \""#origFragment\"", redirFragment: \""\"", expectedFragment: \""#origFragment\"", useRelati)](https://mc.dot.net/#/user/caesar1995/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/c4522d10d10a1b622b3f2b0cf919ede239e636a6/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandlerTest~2FGetAsync_AllowAutoRedirectTrue_RetainsOriginalFragmentIfAppropriate(origFragment:%20%5C%22%23origFragment%5C%22,%20redirFragment:%20%5C%22%5C%22,%20expectedFragment:%20%5C%22%23origFragment%5C%22,%20useRelati)) Unhandled Exception of Type System.Net.Http.HttpRequestException Message : ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.WinHttpException : The server returned an invalid or unrecognized response ``` Stack Trace ``` at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) in D:\j\workspace\windows-TGrou---6368dffa\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 488 at System.Net.Http.Functional.Tests.HttpClientHandlerTest.<>c__DisplayClass60_1.<<GetAsync_AllowAutoRedirectTrue_RetainsOriginalFragmentIfAppropriate>b__0>d.MoveNext() in D:\j\workspace\windows-TGrou---6368dffa\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.cs:line 891 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.CreateServerAsync(Func`2 funcAsync, Options options) in D:\j\workspace\windows-TGrou---6368dffa\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 64 at System.Net.Http.Functional.Tests.HttpClientHandlerTest.GetAsync_AllowAutoRedirectTrue_RetainsOriginalFragmentIfAppropriate(String origFragment, String redirFragment, String expectedFragment, Boolean useRelativeRedirect) in D:\j\workspace\windows-TGrou---6368dffa\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.cs:line 876 --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Threading.Tasks.RendezvousAwaitable`1.GetResult() in D:\j\workspace\windows-TGrou---6368dffa\src\Common\src\System\Threading\Tasks\RendezvousAwaitable.cs:line 62 at System.Net.Http.WinHttpHandler.StartRequest(WinHttpRequestState state) in D:\j\workspace\windows-TGrou---6368dffa\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 863 ```" 27220 area-System.Net support for CONNECT method in SocketHttpHandler This is replacement for #26869 It is mainly to make git resolving easier after rebasing. To much changed in master since my original work so it is quire different PR anyway. Aside from unit tests, I did basic testing with HTTPS over HTTP proxy and it works. Authentication will still need some work as @geoffkizer mentioned in hist last commit. I plan to take a look next as well as I'll keep testing SocketHttpHandler with proxies. 27222 area-System.Data Convert continuations in SqlClient managed SNI to async/await Based on the comment at https://github.com/dotnet/corefx/pull/27187#discussion_r168739991 the continuations in SqlClient SNI layer can be changed to use async await to prevent unnecessary allocations during network calls. 27223 area-System.IO Fix enumerating the root directory. Shouldn't trim the trailing separator when at the root. On Windows that makes the path drive relative- which breaks most of the logic. Add a test to catch this case. 27224 area-System.Memory ReadOnlySequence with empty array returns wrong SequencePosition ``` var buffer = new ReadOnlySequence<byte>(new byte[0]); Console.WriteLine(buffer.Start.Index); Console.WriteLine(buffer.End.Index); ``` This prints: 0 -2147483648 It should print: 0 0 /cc @KrzysztofCwalina @pakrym @ahsonkhan 27226 area-System.IO Use PreallocatedOverlapped when internal FileStream buffer isn't being used on Windows See comment here https://github.com/dotnet/coreclr/pull/16190#issuecomment-363109865 /cc @stephentoub 27227 area-System.Runtime TimeZoneInfo incredibly slow "The TimeZoneInfo methods ConvertTimeToUtc, IsAmbiguousTime and IsDayLightSavingTime popped up as eating up about half of the processing time in a program importing, converting and storing lots of data in a database, As this was quite unbelievable to me, I programmed a little converter, which did these same conversions for our time zone ""W. Europe Standard Time"" and found it to be about 70 times as fast as the dotnet implementation. I tried to figure out what went wrong in TimeZoneInfo implementation, but it looked pretty complicated (even messed up) to me, and as I only have limited time resources thought, that someone responsible for this code should check this out instead. I know my comparison is only valid for our W.European timezone, but I think that most time zones are similarily easy to implement, so for these types of zones the dotnet code really should perform much better. Performance should really be an issue here, as time-related functionality is offen used in comination with engineering and measurment data, where converting between local timezones and UTC is very frequent, and needs to be fast. I have attached my test program and also paste it here for your convenience. Stefan [Program.zip](https://github.com/dotnet/corefx/files/1733570/Program.zip) using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace TestTimeZone { class MyWesternEuropeConverter { const int YFirst = 1900; DateTime TFirst = new DateTime(YFirst, 1, 1), TLast = new DateTime(YFirst + 200, 1, 1); DateTime[] FwdTimes = new DateTime[200], BwdTimes = new DateTime[200]; TimeZoneInfo RegularInfo; int StdHourDiff = 1; int HourOfChange = 2; public MyWesternEuropeConverter() { RegularInfo = TimeZoneInfo.FindSystemTimeZoneById(""W. Europe Standard Time""); InitDates(); } public DateTime ConvertTimeToUtcRegular(DateTime dt, out bool isAmbiguous, out bool isDayLightSavingTime, out bool isAllowed) { try { isAmbiguous = RegularInfo.IsAmbiguousTime(dt); dt = TimeZoneInfo.ConvertTimeToUtc(dt, RegularInfo); isDayLightSavingTime = RegularInfo.IsDaylightSavingTime(dt); isAllowed = true; } catch { isAllowed = false; isAmbiguous = true; isDayLightSavingTime = true; } return dt; } public DateTime ConvertTimeFromUtcRegular(DateTime dt) { return TimeZoneInfo.ConvertTimeFromUtc(dt, RegularInfo); } public DateTime ConvertTimeToUtc(DateTime dt, out bool isAmbiguous, out bool isDayLightSavingTime, out bool isAllowed) { int yearIdx = dt.Year - YFirst; if (yearIdx < 0 || yearIdx >= 200) { return ConvertTimeToUtcRegular(dt, out isAmbiguous, out isDayLightSavingTime, out isAllowed); } else { DateTime curFwd = FwdTimes[yearIdx]; DateTime curBwd = BwdTimes[yearIdx]; if (dt < curFwd || dt >= curBwd) { isAmbiguous = false; isAllowed = true; isDayLightSavingTime = false; return new DateTime(dt.Ticks - TimeSpan.TicksPerHour * StdHourDiff, DateTimeKind.Utc); } if (dt.Ticks < curFwd.Ticks + TimeSpan.TicksPerHour) { isAllowed = false; isAmbiguous = true; isDayLightSavingTime = true; return dt; // new DateTime(dt.Ticks - TimeSpan.TicksPerHour * StdHourDiff, DateTimeKind.Utc); } isAllowed = true; isAmbiguous = dt.Ticks >= curBwd.Ticks - TimeSpan.TicksPerHour; isDayLightSavingTime = !isAmbiguous; return new DateTime(dt.Ticks - TimeSpan.TicksPerHour * (StdHourDiff + (isAmbiguous ? 0 : 1)), DateTimeKind.Utc); } } public DateTime ConvertTimeFromUtc(DateTime dt) { DateTime utc = new DateTime(dt.Ticks + TimeSpan.TicksPerHour * StdHourDiff, DateTimeKind.Local); int yearIdx = utc.Year - YFirst; if (yearIdx < 0 || yearIdx >= 200) { return TimeZoneInfo.ConvertTimeFromUtc(dt, RegularInfo); } DateTime curFwd = FwdTimes[yearIdx]; DateTime curBwd = BwdTimes[yearIdx]; if (dt.Ticks >= curFwd.Ticks || dt.Ticks <= curBwd.Ticks - TimeSpan.TicksPerHour) dt = new DateTime(dt.Ticks + TimeSpan.TicksPerHour, DateTimeKind.Local); return dt; } void InitDates() { int yFirst = TFirst.Year; for (int i = 0; i < FwdTimes.Length; i++) { FwdTimes[i] = GetFwdDate(yFirst + i).AddHours(HourOfChange); BwdTimes[i] = GetBwdDate(yFirst + i).AddHours(HourOfChange + 1); // System.Diagnostics.Trace.WriteLine(string.Format(""{0}-{1}"", FwdTimes[i], BwdTimes[i])); } } DateTime GetFwdDate(int year) { DateTime dLast = new DateTime(year, 3, 31); return dLast.AddDays(-(int)dLast.DayOfWeek); } DateTime GetBwdDate(int year) { DateTime dLast = new DateTime(year, 10, 31); return dLast.AddDays(-(int)dLast.DayOfWeek); } } class Program { static void Echo(string s) { System.Diagnostics.Trace.WriteLine(s); System.Console.WriteLine(s); } static string Report(DateTime t, bool isAmbiguous, bool isDayLightSaving, bool isAllowed) { return string.Format(""{0:yyyy/MM/dd/HH:mm} ambiguous:{1} dayLightSaving:{2} allowed:{3}"", t, isAmbiguous, isDayLightSaving, isAllowed); } static void Main(string[] args) { MyWesternEuropeConverter conv = new MyWesternEuropeConverter(); TimeZoneInfo tzInfo = TimeZoneInfo.Local; DateTime tStart = new DateTime(1900, 1, 1); DateTime tEnd = new DateTime(2100, 1, 1); bool allowed1, allowed2, isAmbiguous1, isAmbiguous2, isDayLightSaving1, isDayLightSaving2; for (DateTime tCur = tStart; tCur < tEnd; tCur = tCur.AddMinutes(15)) { DateTime utc1 = conv.ConvertTimeToUtcRegular(tCur, out isAmbiguous1, out isDayLightSaving1, out allowed1); DateTime utc2 = conv.ConvertTimeToUtc(tCur, out isAmbiguous2, out isDayLightSaving2, out allowed2); if (utc1 != utc2 || isAmbiguous1 != isAmbiguous2 || isDayLightSaving1 != isDayLightSaving2 || allowed1 != allowed2) Echo(string.Format(""Different: {0} {1}"", Report(utc1, isAmbiguous1, isDayLightSaving1, allowed1), Report(utc2, isAmbiguous2, isDayLightSaving2, allowed2))); } DateTime utc = DateTime.UtcNow; int count = 0; for (DateTime tCur = tStart; tCur < tEnd; tCur = tCur.AddMinutes(15)) { count++; DateTime utc1 = conv.ConvertTimeToUtcRegular(tCur, out isAmbiguous1, out isDayLightSaving1, out allowed1); } TimeSpan tNeeded = DateTime.UtcNow - utc; Echo(string.Format(""seconds needed for {0} ToUtc regular: {1}, ticks per call: {2}"", count, tNeeded.TotalSeconds,((double) tNeeded.Ticks)/count)); utc = DateTime.UtcNow; count = 0; for (DateTime tCur = tStart; tCur < tEnd; tCur = tCur.AddMinutes(15)) { count++; DateTime utc2 = conv.ConvertTimeToUtc(tCur, out isAmbiguous2, out isDayLightSaving2, out allowed2); } tNeeded = DateTime.UtcNow - utc; Echo(string.Format(""seconds needed for {0} ToUtc mine: {1}, ticks per call: {2}"", count, tNeeded.TotalSeconds, ((double)tNeeded.Ticks) / count)); System.Console.Write(""Ready >""); System.Console.ReadKey(); } } } " 27228 area-System.Net Can not send email on .Net Core 2.0 with SmtpClient or TcpClient "I'm trying to send email using Google SMTP server but its throwing exception on socket connection. Simple code that works fine on .Net but not on .Net Core 2.0: ``` var client = new SmtpClient(""smtp.gmail.com"", 587); client.UseDefaultCredentials = false; client.Credentials = new NetworkCredential(""email@gmail.com"", ""some password""); client.EnableSsl = true; MailMessage mailMessage = new MailMessage(); mailMessage.From = new MailAddress(""email@gmail.com""); mailMessage.To.Add(""otheremail@gmail.com""); mailMessage.Body = ""Hello World!""; mailMessage.Subject = ""Subjeeect""; client.Send(mailMessage); ``` Exception: > System.Net.Mail.SmtpException: 'Failure sending mail.' > ExtendedSocketException: An attempt to establish a connection was unsuccessful, because from another computer for the required time, the desired response was not received, or the already established connection was broken because of the incorrect response of the computer already connected. 64.233.162.109:587 Same error will be if use TcpClient: ``` using (var client = new TcpClient()) { await client.ConnectAsync(""smtp.gmail.com"", 587); } ``` I'm running this code on Windows 10 if it's important." 27229 area-System.IO TryGet for ReadOnlysequence Fixes https://github.com/dotnet/corefx/issues/27097 Needs tests 27230 area-System.Xml XslCompiledTransform fails on high number of xsl:when elements ".NET core 2.0 (project in Visual Studio 2017 v15.5.6 ) crashes with StackOverflowException when a very high number (2725+) of xsl:when elements are encountered in a choice-element. .NET framework 4.7 has the same problem, but fails (""The stylesheet is too complex"") or crashes with stackoverflowexception (with the restriction disabled in app.config) on around 780 elements) (this has been reported separately) Below is code which reproduces the problem. Change the number to 2724 and it will complete successfully in my environment. static void Main() { var xslt = new StringBuilder(); xslt.AppendLine(@""<?xml version=""""1.0"""" encoding=""""utf-8""""?> <xsl:stylesheet version=""""1.0"""" xmlns:xsl=""""http://www.w3.org/1999/XSL/Transform""""> <xsl:output method=""""html"""" encoding=""""utf-8"""" /><xsl:template name=""""test""""><xsl:choose>""); for (int n = 1; n < 2725; n++) { xslt.AppendLine($""<xsl:when test=\""@V='k{n}'\"">Value {n}</xsl:when>""); } xslt.AppendLine(@""</xsl:choose></xsl:template></xsl:stylesheet>""); var ms = new MemoryStream(Encoding.UTF8.GetBytes(xslt.ToString())); var transform = new XslCompiledTransform(true); using (var rdr = XmlReader.Create(ms)) { transform.Load(rdr); } } " 27231 area-System.Net Several perf improvements/tweaks for SocketsHttpHandler - Chunked reads from buffer. We now process as much of the buffer as we can synchronously during ReadAsync, rather than returning once we hit the end of a chunk. For very small chunks that arrive quickly, this results in a huge perf increase, e.g. best case for the optimization, with lots of 1-byte chunks getting buffered together, it's now 10x faster. With 100-byte chunks buffered together, it's 2x faster. - Blitting byte[] to output for known headers. Rather than using WriteStringAsync to output all header names, we now use WriteBytesAsync for known headers, with the headers precomputed into byte[]s and cached. - Cached `Task<int>`s for ReadAsync. Hopefully consumers start moving to the new `ReadAsync(Memory<byte>, CancellationToken)` overload on Stream, but for those who consume via `ReadAsync(byte[], int, int)`, we need to allocate a task even for synchronously completing values, which will be common when reading from a buffer. We now cache `Task<int>`s for values < 1024, to account for small reads. - Removed delegate/closure allocation from connection. We were accidentally closing over a cancellation token, resulting in an extra delegate and closure allocation in ConnectHelper. Also reduced the size of the EstablishSslConnectionAsync state machine by splitting the method in order to remove several arguments from being included. - Use Utf8Formatter for hex values. Switched from custom formatting of hex values to just use Utf8Formatter.TryFormat. - Avoid buffering in HttpConnection.CopyToAsync(Stream). This is used when we want to copy the whole source stream until EOF (e.g. for a Connection: close response), and thus we can skip the buffer and use the source stream's CopyToAsync directly. - Added a test to exercise various size chunks, line endings, ReadAsync vs CopyToAsync, etc. - Fix CopyToAsync cancellation handling. Even though we'll abort the connection when cancellation is requested, we still need to pass the token to the destination stream's WriteAsync to give it the opportunity to cancel. Also properly pass the buffer size through to the underlying stream's CopyToAsync where appropriate. - Small miscellaneous cleanup, like removing a few unused arguments from methods, fixing an assert to validate the right thing, etc. Fixes https://github.com/dotnet/corefx/issues/27198 cc: @geoffkizer, @davidsh, @wfurt, @Priya91 27232 area-System.IO FileSystemWatcher does not raise events when target directory is symlink (on linux) "Steps to reproduce: ```shell mkdir /tmp/realdir ln -s /tmp/realdir /tmp/symdir ``` Launch a program similar to below: ```csharp var fsw = new FileSystemWatcher(""/tmp/symdir"") { NotifyFilter = NotifyFilters.FileName | NotifyFilters.LastWrite }; fsw.Created += (o, i) => Console.WriteLine(i.Name); fsw.EnableRaisingEvents = true; ``` Create empty file (or any other one): ```shell touch /tmp/symdir/test.txt # Could be also /tmp/realdir/test.txt, since it's one and the same ``` No event being raised. Event is raised properly if we listen in `/tmp/realdir` instead. Since expected behaviour of linux programs is to handle symlinks transparently, I expected that `FileSystemWatcher` would properly raise events that happened in real directory. That didn't happen though (no events being raised, I also tested with other event types). I couldn't find similar issue so I consider it a bug, but if this is expected then it should probably be noted somewhere. Thank you in advance for looking into this. ``` .NET Command Line Tools (2.1.300-preview2-008210) Product Information: Version: 2.1.300-preview2-008210 Commit SHA-1 hash: f6065dcc62 Runtime Environment: OS Name: debian OS Version: OS Platform: Linux RID: debian-x64 Base Path: /opt/dotnet/sdk/2.1.300-preview2-008210/ Microsoft .NET Core Shared Framework Host Version : 2.1.0-preview2-26131-06 Build : b13a0d5c331f374afd35ded57b9a4b4ab128864c ```" 27233 area-System.Net HttpContent.ReadStreamSync (CancellationToken does not work) "1. I see a strange line of code in HttpClient.cs But I did not found method with same name and 2 params. ``` await response.Content.LoadIntoBufferAsync(_maxResponseContentBufferSize, cts.Token) ``` And I did not found method in binary files. 2. Cancel token does not work. (windows 8.1, net core 2.0) ``` class Program { static void Main(string[] args) { new Program().Run().Wait(); } async Task Run() { using (var opt = new HttpClientHandler { Proxy = WebRequest.DefaultWebProxy }) { using (var http = new HttpClient(opt)) { var source = new CancellationTokenSource(); var token = source.Token; var dt = DateTime.Now; //BIG FILE var task = http.GetAsync( new Uri(""https://codeload.github.com/MediaBrowser/Emby/zip/master""), HttpCompletionOption.ResponseHeadersRead, cancellationToken: token); var res = await task; //await Task.WhenAny(Task.WhenAll(new[] { task }), Task.Delay(5000)); //source.Cancel(); Console.WriteLine(res.Content.Headers.ContentLength); Console.WriteLine($""{(DateTime.Now - dt).TotalSeconds} sec""); dt = DateTime.Now; source.Cancel(); var data = await res.Content.ReadAsByteArrayAsync(); // exception did not raised, why? Console.WriteLine($""read {data.Length} bytes ; {(DateTime.Now - dt).TotalSeconds} sec""); /* 70995752 0.7254927 sec read 70995752 bytes ; 9.8042545 sec */ } } } } ``` I think problem this ``` bool flag = this._timeout != HttpClient.s_infiniteTimeout; bool disposeCts; CancellationTokenSource cancellationTokenSource; if (flag || cancellationToken.CanBeCanceled) { disposeCts = true; cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, this._pendingRequestsCts.Token); if (flag) { cancellationTokenSource.CancelAfter(this._timeout); } } else { disposeCts = false; cancellationTokenSource = this._pendingRequestsCts; } ``` finally{ if(disposeCts){token.Dispose()} }" 27234 area-Infrastructure Consider making a property-based testing library available for tests. Consider making a property-based testing library, such as [FsCheck](https://github.com/fscheck/FsCheck), available for use in testing. In particular, [model-based testing](https://fscheck.github.io/FsCheck/StatefulTesting.html) would be useful for dealing with things like the [XML.LINQ](https://github.com/dotnet/corefx/blob/master/src/System.Private.Xml.Linq/tests/events/EventsAdd.cs) property tests, making it easier to write combinatorial tests that search through more possibilities. Now, it's true that FsCheck, like most libraries based on Quickcheck, normally use a random seed on each run; this is considered a feature. However, they all explicitly include the failing seed for any failing test in the output, and this can be included in the config for the test (meaning regression tests can be automatically re-run) 27235 area-System.Net SocketsHttpHandler: Consider exposing ConnectTimeout In some environments, in particular in a cloud, it's useful to be able to specify a timeout for just the connection phase of an HTTP request. That way, if the server is unresponsive, we don't need to wait for the full HttpClient timeout to cancel the request, and conversely, setting a small HttpClient timeout to avoid such issues doesn't cancel an active operation taking a long time simply because it's conversing a lot. We should add: ```C# public sealed class SocketsHttpHandler { public TimeSpan ConnectTimeout { get; set; } // defaults to infinite so that it's opt-in / pay for play ... } ``` 27237 area-System.Memory Consider adding MemoryMarshal.GetOwner(ROM) ```csharp public static partial class MemoryMarshal { public static object GetOwner(ReadOnlyMemory<T> readOnlyMemory) } ``` With Registered IO; when sending an receiving data the api doesn't use `address`, `offset`, `length`; it uses `id`, `offset`, `length` The `id`s are assigned upfront when you register the addresses (once) Currently you have to [loop through all the registered](https://github.com/dotnet/corefxlab/blob/ec47e7023bcd45fb40c4468f5b1234b33f14ffe4/src/System.IO.Pipelines.Networking.Windows.RIO/Internal/RioThread.cs#L95-L117) memory blocks to find which one matches and then get its `id` which is inefficient and also has to protect against concurrency of new memory being registered while its searching. This search and registration blocking could be avoided with the new api ```csharp if (GetOwner(readOnlyMemory) is RioMemoryPoolBlock block) { var idToUse = block.Id; } else { // Not registered memory, get registered memory block and copy data } ``` /cc @davidfowl @KrzysztofCwalina 27238 area-System.Memory [Jit] Improve struct passing (reduce copies) Before they are out there and it becomes a breaking change (byval => byref) ReadOnlyMemory is a `readonly struct`; currently a copy is made and that copy is then passed by reference; but there is an advantage to passing it `in` and no-disadvantage (as call-site doesn't need to be annotated with `in`) and since it is `readonly` and passed by ref anyway due to its size. e.g. changing ```csharp static int CompareOrdinalIgnoreCase(ReadOnlySpan<char> strA, ReadOnlySpan<char> strB) ``` to ```csharp static int CompareOrdinalIgnoreCase(in ReadOnlySpan<char> strA, in ReadOnlySpan<char> strB) ``` Changes the call site from ```asm G_M57521_IG05: lea rcx, bword ptr [rsp+38H] mov bword ptr [rcx], r9 mov dword ptr [rcx+8], edx lea rcx, bword ptr [rsp+28H] mov bword ptr [rcx], r8 mov dword ptr [rcx+8], edx lea rcx, bword ptr [rsp+38H] lea rdx, bword ptr [rsp+28H] call CompareInfo:CompareOrdinalIgnoreCase(struct,struct):int ``` to ```asm G_M57521_IG05: mov bword ptr [rsp+28H], r8 mov dword ptr [rsp+30H], eax lea rcx, bword ptr [rsp+28H] call CompareInfo:CompareOrdinalIgnoreCase(byref,byref):int ``` /cc @jkotas @stephentoub @KrzysztofCwalina @mikedn 27239 area-System.IO Handle errors getting state in Unix Throwing errors while examining extended state while enumerating isn't consistent with Windows behavior. Windows never throws past getting directory entry data as all state is already available. Ensure entry attribute state is consistent with initial construction. 27240 area-System.Linq Linq.Expressions don't support operator overloads with in parameters "For example: ```csharp readonly struct Foo { public static implicit operator Foo(in string x) { return new Foo(); } } class Program { public static void Main(string[] args) { Console.WriteLine((Foo)""hi""); // valid Expression.Convert(Expression.Constant(""hi""), typeof(Foo)); // throws } } ``` Exception: ``` System.InvalidOperationException: No coercion operator is defined between types 'System.String' and 'Test.Foo'. at System.Linq.Expressions.Expression.GetUserDefinedCoercionOrThrow(ExpressionType coercionType, Expression expression, Type convertToType) at System.Linq.Expressions.Expression.Convert(Expression expression, Type type, MethodInfo method) at System.Linq.Expressions.Expression.Convert(Expression expression, Type type) at Test.Program.Main(String[] args) in D:\Desktop\Test\Test\Program.cs:line 22 ``` This also happens with other operator overloads. Maybe other places too (method call?) but I haven't tested those." 27242 area-System.Net Implement SocketsHttpHandler's Expect100ContinueTimeout and ConnectTimeout With the expectation that we'll want to expose this in 2.1, implement Expect100ContinueTimeout and ConnectTimeout. The members are currently internal but can be flipped public easily once the APIs are approved. This also fixes an issue with cancellation around the connect phase, where a cancellation request that came in during the SSL auth phase would not be respected. Contributes to https://github.com/dotnet/corefx/issues/27145 Contributes to https://github.com/dotnet/corefx/issues/27235 cc: @geoffkizer, @davidsh 27244 area-System.IO Test failure: System.IO.Tests.Enumeration.RootTests/CanRecurseFromRoot Opened on behalf of @danmosemsft The test `System.IO.Tests.Enumeration.RootTests/CanRecurseFromRoot` has failed. System.InvalidOperationException : Sequence contains more than one matching element Stack Trace: at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source, Func`2 predicate) in /Users/buildagent/agent/_work/391/s/corefx/src/System.Linq/src/System/Linq/Single.cs:line 143 at System.IO.Tests.Enumeration.RootTests.CanRecurseFromRoot() in /Users/buildagent/agent/_work/391/s/corefx/src/System.IO.FileSystem/tests/Enumeration/RootTests.netcoreapp.cs:line 47 Build : Master - 20180219.01 (Core Tests) Failing configurations: - OSX.1012.Amd64-x64 - Release - Ubuntu.1710.Amd64-x64 - Release 27245 area-System.Net HttpContent auto-computed content length header is not exposed via header enumeration "If you access HttpContent.Headers.ContentLength directly, we will attempt to use the content's TryComputeLength to construct a content length header. However, if you access HttpContent.Headers via its enumerator or a method like TryGetValues, we won't construct the content length header. This means that just accessing the ContentLength property will change the results of header enumeration. For example: ```csharp var content = new StringContent(""hello world""); foreach (var kvp in content.Headers) { } // Content-Length not present var ignore = content.Headers.ContentLength; foreach (var kvp in content.Headers) { } // Content-Length present ``` Similarly, if you try to remove the header using the Remove method, it's not actually removed: ```csharp var content = new StringContent(""hello world""); content.Headers.Remove(""Content-Length""); Assert.Equal(null, content.Headers.ContentLength); // fails; returns value from TryComputeLength ``` The easiest fix here is probably just to try to compute the length when the content object is constructed. This assumes that TryComputeLength is always cheap, which seems reasonable, but is slightly different than how it's used today. Also, it seems like LoadIntoBufferAsync changes the Content-Length, but probably this is fine. Unfortunately, fixing this will cause SocketsHttpHandler to behave incorrectly. Currently, if you set TransferEncodingChunked = true, then SocketsHttpHandler will never access the ContentLength property directly, and thus it won't get populated and won't get sent on the wire. Fixing the above behavior will cause the ContentLength to get populated, and thus sent on the wire, which is not correct behavior, per RFC. So this will need to get fixed somehow. (Note that this problem exists today, it's just harder to hit it -- you would need to either set Content-Length explicitly, or force population of the header by accessing it.) (edited because I'm an idiot and can't read the RFC properly) " 27246 area-System.IO Add PipeReader and PipeWriter implementations over a Stream This will help with adoption of pipelines. This is possible today but we can provide an implementation with minimal allocations. The usual adapter code involves creating 2 pipes and creating 2 async loops that read from the stream and write into the pipe and reading from the pipe and writing into the Stream. This works well but there are some downsides: - Some streams buffer internally and we may end up copying from the Stream's internal buffer into the pipe's buffers. - Even if we can avoid that, we'll end up allocating a Task per read and write operation (though some streams cache the result of the previous operation) - We end up paying per read/write costs in general (for e.g. in FileStream allocating via ThreadPoolBoundHandle.AllocateNativeOverlapped per read/write pair). Most of the per read/write costs can be mitigated by using CopyToAsync (if overridden by the Stream) but there are some downsides there as well. - Using the default implementations CopyToAsync allocates an internal buffer if the Stream doesn't have one already and passes that buffer to the other stream. Using the default pipe implementation, we end up copying the Stream's buffer into the pipe's buffer which might be fine but is a bit unfortunate. We can avoid some of these overheads if we implement a PipeReader on top of CopyToAsync that doesn't use the Pipe internally. The idea here is that we call CopyToAsync on a fake stream that forwards WriteAsync calls to the PipeReader consumer. This implementation would pass buffers directly from the Stream to the consumer. If the consumer doesn't process the entire buffer, only the unconsumed buffer is copied into an internal buffer for the next read. The write side isn't as problematic because we need to be able to allocate memory to write into the Stream so reusing the pipe isn't so bad here. The implementation here would likely be using a Pipe internally, then writing to the Stream on FlushAsync. 27247 area-System.Data Reference to type 'SqlConnection' claims it is defined in 'System.Data', but it could not be found. "dotnet --version: 2.1.4 uname -a: Linux firefixmaarten 4.15.3-300.fc27.x86_64 #1 SMP Tue Feb 13 17:02:01 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux Also tested on windows 10: ``` <ItemGroup> <PackageReference Include=""EnterpriseLibrary.WindowsAzure.TransientFaultHandling"" Version=""5.1.1212.0"" /> <PackageReference Include=""log4net"" Version=""2.0.8"" /> <PackageReference Include=""Lz4.Net"" Version=""1.0.98"" /> <PackageReference Include=""MongoDB.Driver"" Version=""2.5.0"" /> <PackageReference Include=""Newtonsoft.Json"" Version=""11.0.1"" /> <PackageReference Include=""Newtonsoft.Json.Schema"" Version=""3.0.6"" /> <PackageReference Include=""ServiceStack.Text"" Version=""5.0.2"" /> <PackageReference Include=""System.Data.SqlClient"" Version=""4.4.2"" /> <PackageReference Include=""WindowsAzure.ServiceBus"" Version=""4.1.7"" /> <PackageReference Include=""WindowsAzure.Storage"" Version=""9.0.0"" /> </ItemGroup> ``` Getting this error everywhere: Reference to type 'SqlConnection' claims it is defined in 'System.Data', but it could not be found [commonlib]" 27248 area-Meta Guideline 14. formulation ('within type declarations') is unclear > 14. Fields should be specified at the top within type declarations This is very unclear to our team. It seems that a 'type declaration' is either a class or a struct declaration, and only classes and structs can have fields. Therefore it seems that either this information is redundant, or it should mean something else. 27249 area-System.Diagnostics ObjectDisposedException on Process.Start leaves defunct process on Linux "This is a difficult one to reproduce! We're starting a process repeatedly in 5 seconds gaps. After leaving running for a week, we end up with 4-5 defunct processes that failed to start. On the ones that failed we see the process handle is marked as invalid and an exception (see below) is thrown. Even though we're disposing, the process now has a defunct child for it's lifetime. C# details: - Self contained deployment - DotNetCore 2.0 - Centos 7.3 Code to reproduce: ```csharp using (var process = new Process()) { process.StartInfo.FileName = ""filename""; process.StartInfo.Arguments = ""arguments""; process.StartInfo.RedirectStandardOutput = true; process.EnableRaisingEvents = true; process.Start(); var output = process.StandardOutput.ReadToEnd(); process.WaitForExit(MaxWaitTime); } ``` Exception stack: ```csharp System.ObjectDisposedException: Safe handle has been closed at System.Runtime.InteropServices.SafeHandle.DangerousAddRef(Boolean& success) at System.Threading.RegisteredWaitHandleSafe.SetWaitObject(WaitHandle waitObject) at System.Threading.ThreadPool.RegisterWaitForSingleObject(WaitHandle waitObject, WaitOrTimerCallback callBack, Object state, UInt32 millisecondsTimeOutInterval, Boolean executeOnlyOnce, StackCrawlMark& stackMark, Boolean compressStack) at System.Threading.ThreadPool.RegisterWaitForSingleObject(WaitHandle waitObject, WaitOrTimerCallback callBack, Object state, Int32 millisecondsTimeOutInterval, Boolean executeOnlyOnce) at System.Diagnostics.Process.EnsureWatchingForExit() at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() ```" 27250 area-System.Net Optimise HtmlEncode and HtmlDecode to produce less garbage "This fixes https://github.com/dotnet/corefx/issues/13893. I'd noticed in a project of mine that the `TextWriter` overload of `WebUtility.HtmlEncode` was unexpectedly generating garbage. I added a `System.Buffers` project reference to the `System.Runtime.Extensions` csproj and wrote a simple implementation of `StringBuilder` based on `ArrayPool`, as suggested by @jkotas in https://github.com/dotnet/corefx/pull/13875. I benchmarked this implementation and while it appears to produce no garbage (except for the `string` that it returns) it does seem to run around 10-20% slower. I'm keen to get some input from you guys on what might be going on here. Benchmark code (using BenchmarkDotNet): ```csharp [MemoryDiagnoser] public class Bench { public static readonly string _toEncode = string.Concat(Enumerable.Repeat(""<>\""'"", 100)); [Benchmark(Baseline = true)] public void String_Old() { WebUtility.HtmlEncode(_toEncode); } [Benchmark] public void String_New() { WebUtility.HtmlEncodeNew(_toEncode); } [Benchmark] public void TextWriter_Old() { using (var writer = TextWriter.Null) { WebUtility.HtmlEncode(_toEncode, writer); } } [Benchmark] public void TextWriter_New() { using (var writer = TextWriter.Null) { WebUtility.HtmlEncodeNew(_toEncode, writer); } } } ``` And the results: ``` Method | Mean | Error | StdDev | Scaled | ScaledSD | Gen 0 | Gen 1 | Allocated | --------------- |---------:|----------:|----------:|-------:|---------:|-------:|-------:|----------:| String_Old | 5.394 us | 0.0987 us | 0.0924 us | 1.00 | 0.00 | 2.0828 | 0.0229 | 13120 B | String_New | 6.571 us | 0.1101 us | 0.1030 us | 1.22 | 0.03 | 0.7629 | - | 4832 B | TextWriter_Old | 5.431 us | 0.1078 us | 0.1153 us | 1.01 | 0.03 | 2.0828 | 0.0229 | 13120 B | TextWriter_New | 6.080 us | 0.1041 us | 0.0974 us | 1.13 | 0.03 | - | - | 0 B | ```" 27251 area-System.Data Null value in string array in DataRow causes DataRowComparer to throw NRE, but only if it is the first parameter Use object.Equals() to compare array elements and avoid NRE 27253 area-System.Text Consider adding Span<char> overloads to TextEncoder Seems like these were missed in the Spanification of the BCL. https://github.com/dotnet/corefx/blob/01fa16ffd618846a913cad719269c8bb441ceb28/src/System.Text.Encodings.Web/src/System/Text/Encodings/Web/TextEncoder.cs /cc @stephentoub @KrzysztofCwalina @GrabYourPitchforks 27254 area-System.IO Update root dir enum test Update assert for better logging. Skip directory entries. fixes #27244 27255 area-System.Net SocketsHttpHandler: remove Content-Length header if Transfer-Encoding: chunked is present This matches behavior of other handlers. We've been getting away with not doing this because #27245 would cause Content-Length to not appear in the enumeration in normal cases. Contributes to #27245 @stephentoub @davidsh 27256 area-System.Net Using Trusted Root Certification Authorities for server certificate validation in HttpClient I have created a self-signed certificate using ` openssl req -x509 -newkey rsa:2048 -keyout https-key.pem -out https.pem -days 365` then I created pkcs12 using (I have set the CN to my server's ip adress): ` openssl pkcs12 -export -out https.pfx -inkey https-key.pem -in https.pem -password pass:123456` In my server a use the generated `https.pfx` file for https. In my client I imported the generated certificate into the Windows' `Trusted Root Certification Authorities` (Current user and also local system). When I send a HTTP request to the server from my client, I get ``` System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.WinHttpException: A security error occurred at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Threading.Tasks.RendezvousAwaitable`1.GetResult() at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext() --- End of inner exception stack trace --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task). ``` In chrome it says: Attackers might be trying to steal your information from *** (for example, passwords, messages, or credit cards). NET::ERR_CERT_AUTHORITY_INVALID Does .NET Core 2.0's `HttpClient` use Windows certificate stores? What could be causing the issue. 27257 area-System.Net ValueWebSocketReceiveResult is missing CloseStatus and CloseStatusDescription I tried replacing ReceiveAsync(ArraySegment\<byte\>) with the Memory\<byte\> overload only to notice these missing properties. https://github.com/dotnet/corefx/blob/643bccc7f2c24a897cc15c42486d4184e1f931eb/src/System.Net.WebSockets/src/System/Net/WebSockets/WebSocketReceiveResult.cs#L34-L38 https://github.com/dotnet/corefx/blob/643bccc7f2c24a897cc15c42486d4184e1f931eb/src/System.Net.WebSockets/src/System/Net/WebSockets/ValueWebSocketReceiveResult.cs#L32-L34 Is there a reason for this? /cc @stephentoub 27258 area-System.Runtime [WIP] Add NativeLibrary reference assemblies and tests This is the corefx equivalent of https://github.com/dotnet/coreclr/pull/16409. 27259 area-System.Net DO NOT MERGE: Test response drain behavior 27260 area-System.Data Are there plans to support GetSchema in System.Data.Odbc? I'm currently using the System.Data.Odbc 4.5.0-preview1-25914-04. Works great for connecting to various sources both on Windows and Linux. I do however have a requirement to get the schema list for the source and when trying to use GetSchema I get a NotImplemented error. Are there plans to implement this feature? 27261 area-System.IO Add tests against corelib shared IO internals These were removed when we cleaned up unused code in CoreFX common. Next steps are to CoreFX PathInternal usages to CoreLib and remove existing CoreLib. 27262 area-System.Text Force inlining CheckTimeout in RegexRunner "I can't get any valuable measurements with BDN here. I tried multiple times but it seems either my benchmarks are bad or the absolute costs of the CheckTimeout native calls are to small. @AndyAyersMS Perfview tells me that without AggresiveInlining it won't inline the method with reason ""unprofitable inline"". Any idea why it doesn't inline a simple boolean check here (it doesn't inline either without the OR condition). Has it do with the state of inliner here (huge switch)? Perfview before: Name | Exc % -- | -- system.text.regularexpressions!RegexInterpreter.Go | 35.8 system.text.regularexpressions!RegexCharClass.CharInClassInternal | 12.1 system.text.regularexpressions!RegexCharClass.CharInClassRecursive | 7.1 system.text.regularexpressions!RegexInterpreter.Backtrack | 7.0 system.text.regularexpressions!RegexInterpreter.Stringmatch | 6.1 system.text.regularexpressions!RegexInterpreter.SetOperator | 5.4 system.text.regularexpressions!RegexInterpreter.FindFirstChar | 5.3 system.text.regularexpressions!RegexInterpreter.Forwardcharnext | 3.5 system.text.regularexpressions!RegexRunner.Scan | 3.1 system.text.regularexpressions!RegexRunner.CheckTimeout | 2.9 system.text.regularexpressions!RegexInterpreter.Goto | 2.5 Perfview after: Name | Exc % -- | -- system.text.regularexpressions!RegexInterpreter.Go | 35.3 system.text.regularexpressions!RegexCharClass.CharInClassInternal | 13.8 system.text.regularexpressions!RegexCharClass.CharInClassRecursive | 8.0 system.text.regularexpressions!RegexInterpreter.Backtrack | 7.3 system.text.regularexpressions!RegexInterpreter.Stringmatch | 6.0 system.text.regularexpressions!RegexInterpreter.SetOperator | 5.3 system.text.regularexpressions!RegexInterpreter.FindFirstChar | 5.0 system.text.regularexpressions!RegexInterpreter.Forwardcharnext | 3.8 system.text.regularexpressions!RegexRunner.Scan | 3.1 system.text.regularexpressions!RegexInterpreter.Goto | 2.5 cc @danmosemsft @stephentoub" 27265 area-System.Net SocketsHttpHandler: Don't reuse connection with extraneous received data Fixes #26754 27266 area-System.Net SocketsHttpHandler: split auth and redirect handling back into two separate handlers This will help with supporting NTLM auth, which will need to disable auth on redirects as well, but the auth will be handled at a different level (per connection vs per request). @stephentoub @davidsh @dotnet-bot test Outerloop Windows x64 Debug Build please @dotnet-bot test Outerloop Linux x64 Release Build please @dotnet-bot test Outerloop OSX x64 Debug Build please 27267 area-System.Text Introduce Regex.Replace Span API & optimize Regex-Redux benchmark "## Rationale Today we have the ability to replace certain parts of a string identified by a regex pattern by calling `Regex.Replace(string input, string pattern, string replacement)`. This does work well for small input strings but if you chain multiple Replace calls together and pass a large input string to it the number of string allocations are immensely high. ## Example In the regex-redux benchmark there are 3 huge sets of allocations that dominate the rest. - There is a cascade of replacements on a 50M character string, which creates 500MB of string garbage, presumably in LOH  - Its input file is read into a 100MB string. (double byte - 50MB file) - There are 100MB of StringBuilder allocations. ## API Proposal ```csharp namespace System.Text.RegularExpressions { public class Regex { // Returns amount of bytes written into the buffer public static int Replace(ReadOnlySpan<char> input, Span<char> buffer, string pattern, string replacement, RegexOptions options = RegexOptions.None, TimeSpan matchTimeout = default); } } ``` ## Notes This API would help us remove unnecessary string allocations in the regex-redux benchmark (http://benchmarksgame.alioth.debian.org/u64q/program.php?test=regexredux&lang=csharpcore&id=9). The Regex.Replace implementation uses Match internally to check the pattern on the input string. Can we also change the Match code to operate on Spans or do we need to allocate a string in that step? ## Sample Usage ```csharp // Sample implementation for regex-redux const int InputFileSize = 1024 * 1024 * 50; // 50 MB input file // Borrow buffers char[] buffer1Arr = ArrayPool<char>.Shared.Rent(InputFileSize); char[] buffer2Arr = ArrayPool<char>.Shared.Rent(InputFileSize); Span<char> buffer1 = new Span<char>(buffer1Arr); Span<char> buffer2 = new Span<char>(buffer2Arr); int bufferBytesWritten = Console.In.ReadBlock(buffer1); bufferBytesWritten = Regex.Replace(buffer1.Slice(0, bufferBytesWritten).AsReadOnlySpan(), buffer2, ""tHa[Nt]"", ""<4>""); bufferBytesWritten = Regex.Replace(buffer2.Slice(0, bufferBytesWritten).AsReadOnlySpan(), buffer1, ""aND|caN|Ha[DS]|WaS"", ""<3>""); bufferBytesWritten = Regex.Replace(buffer1.Slice(0, bufferBytesWritten).AsReadOnlySpan(), buffer2, ""a[NSt]|BY"", ""<2>""); bufferBytesWritten = Regex.Replace(buffer2.Slice(0, bufferBytesWritten).AsReadOnlySpan(), buffer1, ""<[^>]*>"", ""|""); bufferBytesWritten = Regex.Replace(buffer1.Slice(0, bufferBytesWritten).AsReadOnlySpan(), buffer2, ""\\|[^|][^|]*\\|"", ""-""); // Return buffers ArrayPool<char>.Shared.Return(buffer1Arr); ArrayPool<char>.Shared.Return(buffer2Arr); return bufferBytesWritten; ``` Relates to https://github.com/dotnet/corefx/issues/27124 cc @stephentoub @danmosemsft @vancem @jkotas @jfree" 27268 area-System.IO Add IPipeReader and IPipeWriter and have IDuplexPipe inherit from them Allows determination of whether a Pipe-like is Readable, Writable or Both via the type system Current API ```csharp public interface IDuplexPipe { PipeReader Input { get; } PipeWriter Output { get; } } ``` Proposed API ```csharp public interface IReadablePipe { PipeReader Input { get; } } public interface IWritablePipe { PipeWriter Output { get; } } public interface IDuplexPipe : IReadablePipe, IWritablePipe {} ``` Use case a Stream that is write only, but implemented on top of a Pipe ```csharp public class HttpResponseStream : Stream, IWritablePipe { private readonly Pipe _pipe; PipeWriter IWritablePipe.Output => _pipe.Writer; public override async Task FlushAsync(CancellationToken cancellationToken) => await _pipe.Writer.FlushAsync(cancellationToken); public override Task WriteAsync(ReadOnlyMemory<byte> source, CancellationToken cancellationToken = default) => _pipe.Writer.WriteAsync(source, cancellationToken); public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) => WriteAsync(new Memory<byte>(buffer, offset, count), cancellationToken); public override Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) => throw NotSupportedException(); public override async ValueTask<int> ReadAsync(Memory<byte> destination, CancellationToken cancellationToken = default) => throw NotSupportedException(); public override bool CanWrite => true; public override bool CanRead => false; public override bool CanSeek => false; // Other stream overloads } ``` This means you can have TextWriters that work with Streams; however, if the Stream has a pipe it can encode on the go in WriteAsync with no internal buffers (using the Pipe's memory directly) rather than waiting for FlushAsync and either allocating buffers or pulling them from the ArrayPool; and then having an additional copy to pass onto the Stream e.g. ```csharp public class HttpResponseStreamWriter : TextWriter { internal const int DefaultBufferSize = 16 * 1024; private readonly PipeWriter _pipe; private readonly StreamWriter _streamWriter; private readonly Encoder _encoder; public PipeStreamWriter(Stream stream, Encoding encoding) : this(stream, encoding, DefaultBufferSize) {} public PipeStreamWriter(Stream stream, Encoding encoding, int bufferSize) { Encoding = encoding; if (stream is IWritablePipe pipe) { _pipe = pipe.Output; } else { _streamWriter = new StreamWriter(stream, encoding, bufferSize); } } public override Encoding Encoding { get; } public unsafe override void Write(char value) { if (_pipe != null) { Span<byte> bytes = _pipe.GetSpan(Encoding.GetMaxByteCount(1)); var encoded = Encoding.GetBytes(new ReadOnlySpan<byte>(&value, sizeof(char)), bytes); _pipe.Advance(encoded); } else { _streamWriter.Write(value); } } public override Task WriteAsync(ReadOnlyMemory<char> source, cancellationToken = default) => (_pipe != null) ? _pipe.WriteAsyncImpl(source, cancellationToken) : _streamWriter.WriteAsync(source); private Task WriteAsyncImpl(ReadOnlyMemory<char> source, CancellationToken token) { ReadOnlySpan<char> input = source.Span; int minBytes = Encoding.GetMaxCharCount(1); while (input.Length > 0) { Span<byte> bytes = _pipe.GetSpan(minBytes); int totalEncoded = 0; while (bytes.Length > 0) { int toEncode = Math.Min(Encoding.GetMaxCharCount(bytes.Length), input.Length); var encoded = Encoding.GetBytes(input.Slice(0, toEncode), bytes); input = input.Slice(toEncode); bytes = bytes.Slice(encoded); totalEncoded += encoded; if (bytes.Length < minBytes) { break; } } _pipe.Advance(totalEncoded); } return _pipe.WriteAsync(default); } public override Task WriteAsync(char[] values, int index, int count) => WriteAsync(new ReadOnlyMemory<char>(values, index, count)); public override Task WriteAsync(string value) => WriteAsync(value.AsReadOnlyMemory()); public override Task FlushAsync() { if (_pipe != null) { await _pipe.Output.FlushAsync(); } else { await _streamWriter.FlushAsync(); } } // Other TextWriter overloads } ``` /cc @davidfowl @stephentoub @GrabYourPitchforks 27269 area-System.IO Need to update tests for https://github.com/dotnet/coreclr/pull/16447 I will link to the test change that disables the tests that are impacted. 27270 area-System.IO Test updates for https://github.com/dotnet/coreclr/pull/16447 Updates and disables tests, tracked by #27269. For Path change in CoreCLR: https://github.com/dotnet/coreclr/pull/16447 27272 area-System.Net Enable SocketsHttpHandler_HttpClientHandler_ConnectionPooling_Test for other handlers From comments in the class: ```csharp // TODO: Currently the subsequent tests sometimes fail/hang with WinHttpHandler / CurlHandler. // In theory they should pass with any handler that does appropriate connection pooling. // We should understand why they sometimes fail there and ideally move them to be // used by all handlers this test project tests. ``` 27273 area-System.Net "WinHttpHandler on Win7 is occasionally failing with ""System.Net.Http.WinHttpException : The handle is invalid""" For example, here: https://mc.dot.net/#/user/geoffkizer/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/aee82742ebc870d5831d6b0b95b5044cd9e53fc2/workItem/System.Net.Http.Functional.Tests I saw this earlier today in another PR as well. Only seems to happen on Win7. 27275 area-System.Data System.Data.SqlClient => Dynamic SQL generation is not supported against a SelectCommand that does not return any base table information. Hi guys, same piece of code compiled and run against .net framework 4.5 and dotnet core 2.0 .net framework 4.5 version runs without issues dotnet core 2.0 version returns error: Dynamic SQL generation is not supported against a SelectCommand that does not return any base table information. comparing info from both libraries used, i noticed the following difference: .net framework 4.5 Property: BaseTableName Value: TEST dotnet core 2.0: Property: BaseTableName Value: apparently, this property is not properly captured best regards, Raul 27277 area-Infrastructure E:\A\_work\2704\b\pipelineRepository\Tools\Symbols.targets(508,5): error : PDB0023: No supported URIs found in Source Link [E:\A\_work\2704\b\pipelineRepository\build.proj] Opened on behalf of @jcagme Warnings: 1 Status Message: failed Build : Master - 20180216.01 (Publish) Failing configurations: - Publish Symbols - Symbol Publish [Mission Control Build Info](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/build~2Fpublish~2F/build/20180216.01/workItem/Orchestration/analysis/external/Link) At least last 10 builds have failed to publish due to this error 27278 area-System.Text Improve Regex cache speed when cache is large Fixes https://github.com/dotnet/corefx/issues/24425 Fixes https://github.com/dotnet/corefx/issues/26364 A try to speed up cache using `Dictionary<CachedCodeEntryKey, CachedCodeEntry>`, refs #24425 27279 area-System.IO GZipStream cannot decompress multipart gzip files. "See the following [stackoverflow thread](https://stackoverflow.com/questions/47743788/gzipstream-from-memorystream-only-returns-a-few-hundred-bytes ) for more information. GZipStream currently fails if you try to decompress a concatenated gzip file. The RFC does state that two gzip files can be cated together and it is also a valid gzip file. However, the current implementation can only read the first gzip stream and stops there. Here is a simple repro:: ```cs using System; using System.IO; using System.IO.Compression; class Program { static void Main() { using (var fs = new FileStream(Path.Combine(Environment.CurrentDirectory,""test.txt.gz""), FileMode.Create)) { using(var gz = new GZipStream(fs, CompressionLevel.NoCompression, true)) using(var sw = new StreamWriter(gz)) sw.WriteLine(""Stream 1""); using(var gz = new GZipStream(fs, CompressionLevel.NoCompression, true)) using(var sw = new StreamWriter(gz)) sw.WriteLine(""Stream 2""); fs.Seek(0, SeekOrigin.Begin); using (var gz = new GZipStream(fs, CompressionMode.Decompress)) using (var sr = new StreamReader(gz)) Console.WriteLine(sr.ReadToEnd()); } } } ``` The expected output should be ``` Stream 1 Stream 2 ``` But the actual output is just `Stream 1`. If you open up ""test.txt.gz"" in your favorite gzip util, like 7z, you will be able to extract the file and you will see the correct output." 27281 area-Serialization Microsoft.XmlSerializer.Generator fails when project targets multiple frameworks "I am currently benchmarking all serializers. I want to compare `XmlSerializer` with SGEN enabled and disabled. The problem: when my project targets multiple frameworks (I need to compare Core 2.0 vs 2.1 vs .desktop 4.7.1) the tool fails. Repro: create a new console app and change TargetFramework to TargetFramework**s** ```xml <?xml version=""1.0"" encoding=""utf-8""?> <configuration> <packageSources> <!--To inherit the global NuGet package sources remove the <clear/> line below --> <clear /> <add key=""api.nuget.org"" value=""https://api.nuget.org/v3/index.json"" protocolVersion=""3"" /> <add key=""corefx CI"" value=""https://dotnet.myget.org/F/dotnet-core/api/v3/index.json"" /> </packageSources> </configuration> ``` ```xml <Project Sdk=""Microsoft.NET.Sdk""> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFrameworks>netcoreapp2.1</TargetFrameworks> <!-- S IS CRUCIAL HERE --> </PropertyGroup> <ItemGroup> <PackageReference Include=""Microsoft.XmlSerializer.Generator"" Version=""2.0.0-preview2-26216-03"" /> <PackageReference Include=""System.Xml.XmlSerializer"" Version=""4.3.0"" /> </ItemGroup> </Project> ``` ```cs class Program { static void Main(string[] args) { var xmlSerializer = new XmlSerializer(typeof(Test)); Console.WriteLine(xmlSerializer); } } public class Test { public int A, B; } ``` Now if I run `dotnet build -c Release -f netcoreapp2.1` it fails with: ``` PS C:\Users\adsitnik\source\repos\ConsoleApp14> dotnet build -c Release -f netcoreapp2.1 Microsoft (R) Build Engine version 15.6.54.9755 for .NET Core Copyright (C) Microsoft Corporation. All rights reserved. Restore completed in 59,85 ms for C:\Users\adsitnik\source\repos\ConsoleApp14\ConsoleApp14.csproj. ConsoleApp14 -> C:\Users\adsitnik\source\repos\ConsoleApp14\bin\Release\netcoreapp2.1\ConsoleApp14.dll No executable found matching command ""dotnet-Microsoft.XmlSerializer.Generator"" C:\Users\adsitnik\.nuget\packages\microsoft.xmlserializer.generator\2.0.0-preview2-26216-03\build\Microsoft.XmlSerializer.Generator.targets(15,5): warning MSB3073: The command ""dotnet Microsoft.XmlSerializer.Generator obj\Release\netcoreapp2.1\ConsoleApp14.dll /force /quiet"" exited with code 1. [C:\Users\adsitnik\source\repos\ConsoleApp14\ConsoleApp14.csproj] C:\Users\adsitnik\.nuget\packages\microsoft.xmlserializer.generator\2.0.0-preview2-26216-03\build\Microsoft.XmlSerializer.Generator.targets(16,5): warning : SGEN : warning SGEN1: Fail to generate the serializer for ConsoleApp14.dll. Please follow the instructions at https://go.microsoft.com/fwlink/?linkid=858594 and try again. [C:\Users\adsitnik\source\repos\ConsoleApp14\ConsoleApp14.csproj] ``` @huanwu I am new to the company, but I can see that you have been working on this feature. Can you recommend me any fix/workaround? /cc @jorive " 27283 area-System.Data .Net Core ExecuteReader GetSchemaTable() method not returning the BaseTableName and more details. "_From @ezra2310 on February 17, 2018 16:54_ Hi, In .Net Core ExecuteReader.GetSchemaTable() method not returning the BaseTableName and more details of the query will executed. I'm created an console application in Core .Net 2.0. The below code has written and do some R&D. Its working in .net Framework 4x version and get all schema details as BaseTablename,BaseColumn,etc.... But in Core .Net 2.0 the BaseTableName was not returning. Im tried in various way but still im not got the route. Can you please help me how to get the BaseTableName and all those details. Its very important R&D undergoing. Can you anybody please help me ?? ```c# SqlConnection sqlCnn = new SqlConnection(connetionString); sqlCnn.Open(); SqlCommand sqlCmd = new SqlCommand(sql, sqlCnn); SqlDataReader sqlReader = sqlCmd.ExecuteReader(CommandBehavior.KeyInfo); List<string> gotTableNames = new List<string>(); DataTable schemaTable = sqlReader.GetSchemaTable(); foreach (DataRow dr in schemaTable.Rows) { string data = Convert.ToString(dr[""BaseTableName""]); if (!gotTableNames.Contains(data)) { gotTableNames.Add(data); } } return string.Join("","", gotTableNames); ``` [edit by @danmosemsft to add triple tick formatting] _Copied from original issue: aspnet/Mvc#7389_" 27285 area-System.Net SocketsHttpHandler: Correct behavior when MaxAutomaticRedirections is exceeded? Currently, if MaxAutomaticRedirections is exceeded, we throw an exception. This matches WinHttpHandler/CurlHandler. This does not match full framework behavior, though. Framework will simply stop redirecting and return the last 3xx response. The latter seems slightly better to me. However, it also means the user needs to handle this case and not assume a 200 response. They pretty much have to do this anyway since the response could always be 4xx or 5xx anyway, but it's still one more situation for them to handle. See HttpClientHandlerTest.GetAsync_MaxAutomaticRedirectionsNServerHops_ThrowsIfTooMany. 27287 area-System.Threading Improve thread name and start tests Checking https://github.com/dotnet/coreclr/issues/16449 in CI 27291 area-System.Net SocketsHttpHandler cancellation test failures on windows [20180220.06 SocketsHttpHandler - Win7](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180220.06/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpClientHandler_Cancellation_Test~2FConnectTimeout_TimesOutSSLAuth_Throws) ``` Assert.InRange() Failure Range: (500 - 10000) Actual: 19271 at System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpClientHandler_Cancellation_Test.<>c__DisplayClass10_0.<<ConnectTimeout_TimesOutSSLAuth_Throws>b__0>d.MoveNext() in E:\A\_work\19\s\corefx\src\System.Net.Http\tests\FunctionalTests\SocketsHttpHandlerTest.cs:line 235 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.<>c__DisplayClass11_0.<<CreateClientAndServerAsync>b__0>d.MoveNext() in E:\A\_work\19\s\corefx\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 81 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.CreateServerAsync(Func`2 funcAsync, Options options) in E:\A\_work\19\s\corefx\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 64 at System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpClientHandler_Cancellation_Test.ConnectTimeout_TimesOutSSLAuth_Throws() in E:\A\_work\19\s\corefx\src\System.Net.Http\tests\FunctionalTests\SocketsHttpHandlerTest.cs:line 222 --- End of stack trace from previous location where exception was thrown --- ``` [20180220.07 SocketsHttpHandler - Win10](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180220.07/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpClientHandler_Cancellation_Test~2FConnectTimeout_TimesOutSSLAuth_Throws) ``` Assert.InRange() Failure Range: (500 - 10000) Actual: 14177 at System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpClientHandler_Cancellation_Test.<>c__DisplayClass10_0.<<ConnectTimeout_TimesOutSSLAuth_Throws>b__0>d.MoveNext() in E:\A\_work\14\s\corefx\src\System.Net.Http\tests\FunctionalTests\SocketsHttpHandlerTest.cs:line 235 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.<>c__DisplayClass11_0.<<CreateClientAndServerAsync>b__0>d.MoveNext() in E:\A\_work\14\s\corefx\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 81 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.CreateServerAsync(Func`2 funcAsync, Options options) in E:\A\_work\14\s\corefx\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 64 at System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpClientHandler_Cancellation_Test.ConnectTimeout_TimesOutSSLAuth_Throws() in E:\A\_work\14\s\corefx\src\System.Net.Http\tests\FunctionalTests\SocketsHttpHandlerTest.cs:line 222 --- End of stack trace from previous location where exception was thrown --- ``` 27292 area-System.Net Expose SocketsHttpHandler.ConnectTimeout/Expect100ContinueTimeout cc: @geoffkizer, @davidsh, @wfurt, @Priya91 Fixes https://github.com/dotnet/corefx/issues/27145 Fixes https://github.com/dotnet/corefx/issues/27235 27293 area-System.Net SocketsHttpHandler: proxy auth should choose digest over basic There's logic in the regular auth handler to choose digest over basic if both exist in the 401 challenge. The proxy logic doesn't seem to do this, it chooses whichever it finds first. 27295 area-System.Net SocketsHttpHandler: should validate request after chained handlers execute The code in `SocketsHttpHandler::ValidateAndNormalizeRequest` is performing some checks on request validity, e.g. don't allow chunked encoding if there's no content. These checks happen before the chained handlers (redirect, auth, etc) execute. Because of this, it's possible that one of these handlers could modify the request to be invalid. (In fact, we hit this previously because the redirect handler was changing POST to GET and clearing content but not removing Transfer-Encoding: chunked.) Just to be safe, we should at least consider moving the validation logic to execute after the chained handers run, but before we try to establish a connection. 27296 area-System.Runtime Testing GetHashCode works properly when using string with embedded null Related to #27098 27297 area-System.Data System.Data.Tests.DataTableTest.WriteXmlSchema3 test failed in CI on netfx "``` System.Data.Tests.DataTableTest.WriteXmlSchema3 [FAIL] Assert.Equal() Failure Expected: ���CurrentLocale=""true"">\n <xs:complexType>\n <xs:choice m��� Actual: ���CurrentLocale=""true"" msdata:EnforceConstraints=""True"">\n <x��� at System.Data.Tests.DataTableTest.WriteXmlSchema3() ``` https://ci3.dot.net/job/dotnet_corefx/job/master/job/windows-TGroup_netfx+CGroup_Release+AGroup_x86+TestOuter_false_prtest/8520/consoleText" 27298 area-System.Data Updated contract, exposed SqlMetaData ctors Updated contract, exposed SqlMetaData ctors and added SqlParameterCollection properties. Completed the following types: M:Microsoft.SqlServer.Server.SqlMetaData..ctor(System.String, System.Data.SqlDbType, System.Type, System.String) M:Microsoft.SqlServer.Server.SqlMetaData..ctor(System.String, System.Data.SqlDbType, System.Type, System.String, System.Boolean, System.Boolean, System.Data.SqlClient.SortOrder, System.Int32) P:Microsoft.SqlServer.Server.SqlMetaData.DbType {get;} P:Microsoft.SqlServer.Server.SqlMetaData.Type {get;} P:System.Data.SqlClient.SqlParameterCollection.IsFixedSize P:System.Data.SqlClient.SqlParameterCollection.IsReadOnly M:System.Data.SqlClient.SqlDataReader.IsCommandBehavior(System.Data.CommandBehavior) Adding reviewers: @saurabh500 @corivera @geleems 27299 area-System.ComponentModel System.ComponentModel.Composition is missing a typeforward for Lazy<T,TMetadata> "@joperezr and I noticed this when having a discussion. System.ComponentModel.Composition reference assembly is missing a type-forward for System.Lazy<T, TMetadata>. As a result, when you use a .NET assembly which makes use of this type and reference System.ComponentModel.Composition, you will see a compile error. ``` Error CS0012 The type 'Lazy<,>' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.ComponentModel.Composition, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. ``` See attached sample. [LazySample.zip](https://github.com/dotnet/corefx/files/1742137/LazySample.zip) We should fix this by added the typeforward to the ref. This also raises the question of ""what goes in netcoreapp2.1""? We can't remove System.ComponentModel.Composition.dll since that will be a breaking change. It was present in 2.0 in order to typeforward this one type to System.Runtime. Should we include all of MEF? /cc @weshaggard @danmosemsft " 27301 area-System.Net CurlHandler: Transfer-Encoding incorrectly sent on redirect from POST to GET If the initial request is a POST, and Transfer-Encoding: chunked is true for the request, and we receive a redirect code that forces the method to GET instead of POST, then CurlHandler is incorrectly sending Transfer-Encoding: chunked on the redirected GET request. 27302 area-System.Net [wcf.stress]: SocketsHttpHandler Test:Streaming Async:false Binding:Http StressRunDuration:4 Using `Async:true` we get the same exception wrapped on an `AggregateException`. `WinHttpHandler` completes this test without errors. The error message is suspicious in the sense that it seems to indicate that the server terminated the connection. /cc @KKhurin ``` Test:Streaming Async:false Binding:Http StressRunDuration:4 ExitOnSuccess:True Using CLITest-LocalCoreFX as the stress run name. Start 2/20/2018 10:35:14 PM 1 0 2/20/2018 10:35:14 PM 8 0 2/20/2018 10:35:14 PM 3 0 2/20/2018 10:35:14 PM 4 0 2/20/2018 10:35:14 PM 0 0 2/20/2018 10:35:14 PM 2 0 2/20/2018 10:35:14 PM 5 0 2/20/2018 10:35:14 PM 7 0 2/20/2018 10:35:14 PM 6 0 2/20/2018 10:35:14 PM 9 0 2/20/2018 10:36:11 PM 9 100 2/20/2018 10:36:11 PM 1 100 2/20/2018 10:36:11 PM 0 100 2/20/2018 10:36:11 PM 6 100 2/20/2018 10:36:11 PM 3 100 2/20/2018 10:36:11 PM 4 100 2/20/2018 10:36:11 PM 8 100 2/20/2018 10:36:11 PM 5 100 2/20/2018 10:36:11 PM 7 100 2/20/2018 10:36:11 PM 2 100 System.IO.IOException: An exception has been thrown when reading the stream. ---> System.IO.IOException: Unable to transfer data on the transport connection: The I/O operation has been aborted because of either a thread exit or an application request. ---> System.Net.Sockets.SocketException: The I/O operation has been aborted because of either a thread exit or an application request --- End of inner exception stack trace --- at System.Net.Http.HttpConnection.FillAsync() in d:\s\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnection.cs:line 1078 at System.Net.Http.HttpConnection.ReadNextLineAsync() in d:\s\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnection.cs:line 1038 at System.Net.Http.HttpConnection.ChunkedEncodingReadStream.TryGetNextChunkAsync() in d:\s\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\ChunkedEncodingReadStream.cs:line 39 at System.Net.Http.HttpConnection.ChunkedEncodingReadStream.ReadAsync(Memory`1 destination, CancellationToken cancellationToken) in d:\s\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\ChunkedEncodingReadStream.cs:line 120 at System.Net.Http.HttpContentReadStream.Read(Byte[] buffer, Int32 offset, Int32 count) in d:\s\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpContentReadStream.cs:line 30 at System.ServiceModel.Channels.BufferedReadStream.Read(Byte[] array, Int32 offset, Int32 count) at System.ServiceModel.Channels.MaxMessageSizeStream.Read(Byte[] buffer, Int32 offset, Int32 count) at System.Xml.EncodingStreamWrapper.Read(Byte[] buffer, Int32 offset, Int32 count) in d:\s\corefx\src\System.Private.DataContractSerialization\src\System\Xml\EncodingStreamWrapper.cs:line 629 at System.Xml.XmlBufferReader.TryEnsureBytes(Int32 count) in d:\s\corefx\src\System.Private.DataContractSerialization\src\System\Xml\XmlBufferReader.cs:line 232 at System.Xml.XmlUTF8TextReader.ReadText(Boolean hasLeadingByteOf0xEF) in d:\s\corefx\src\System.Private.DataContractSerialization\src\System\Xml\XmlUTF8TextReader.cs:line 1254 at System.Xml.XmlUTF8TextReader.Read() in d:\s\corefx\src\System.Private.DataContractSerialization\src\System\Xml\XmlUTF8TextReader.cs:line 1363 at System.Xml.XmlBaseReader.MoveToContent() in d:\s\corefx\src\System.Private.DataContractSerialization\src\System\Xml\XmlBaseReader.cs:line 878 at System.ServiceModel.Dispatcher.StreamFormatter.MessageBodyStream.Read(Byte[] buffer, Int32 offset, Int32 count) --- End of inner exception stack trace --- at System.ServiceModel.Dispatcher.StreamFormatter.MessageBodyStream.Read(Byte[] buffer, Int32 offset, Int32 count) at SharedPoolsOfWCFObjects.VerifiableStream.VerifyStream(Stream stream, Int32 expectedStreamSize, Int32 bufSize, Boolean verifyContent) in d:\s\wcf\src\System.Private.ServiceModel\tests\Stress\SharedPoolsOfWCFObjects\Tests\StreamingTest.cs:line 387 at SharedPoolsOfWCFObjects.StreamingTest`2.TestEchoStream(StreamingRequestContext`1 details) in d:\s\wcf\src\System.Private.ServiceModel\tests\Stress\SharedPoolsOfWCFObjects\Tests\StreamingTest.cs:line 264 at SharedPoolsOfWCFObjects.CallStats.CallFuncAndRecordStats[T](Func`1 func, Boolean hideExceptions) in d:\s\wcf\src\System.Private.ServiceModel\tests\Stress\SharedPoolsOfWCFObjects\CallStats.cs:line 71 System.IO.IOException: An exception has been thrown when reading the stream. ---> System.IO.IOException: Unable to transfer data on the transport connection: The I/O operation has been aborted because of either a thread exit or an application request. ---> System.Net.Sockets.SocketException: The I/O operation has been aborted because of either a thread exit or an application request --- End of inner exception stack trace --- at System.Net.Http.HttpConnection.FillAsync() in d:\s\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnection.cs:line 1078 at System.Net.Http.HttpConnection.ReadNextLineAsync() in d:\s\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnection.cs:line 1038 at System.Net.Http.HttpConnection.ChunkedEncodingReadStream.TryGetNextChunkAsync() in d:\s\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\ChunkedEncodingReadStream.cs:line 39 at System.Net.Http.HttpConnection.ChunkedEncodingReadStream.ReadAsync(Memory`1 destination, CancellationToken cancellationToken) in d:\s\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\ChunkedEncodingReadStream.cs:line 120 at System.Net.Http.HttpContentReadStream.Read(Byte[] buffer, Int32 offset, Int32 count) in d:\s\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpContentReadStream.cs:line 30 at System.ServiceModel.Channels.BufferedReadStream.Read(Byte[] array, Int32 offset, Int32 count) at System.ServiceModel.Channels.MaxMessageSizeStream.Read(Byte[] buffer, Int32 offset, Int32 count) at System.Xml.EncodingStreamWrapper.Read(Byte[] buffer, Int32 offset, Int32 count) in d:\s\corefx\src\System.Private.DataContractSerialization\src\System\Xml\EncodingStreamWrapper.cs:line 629 at System.Xml.XmlBufferReader.TryEnsureBytes(Int32 count) in d:\s\corefx\src\System.Private.DataContractSerialization\src\System\Xml\XmlBufferReader.cs:line 232 at System.Xml.XmlUTF8TextReader.ReadText(Boolean hasLeadingByteOf0xEF) in d:\s\corefx\src\System.Private.DataContractSerialization\src\System\Xml\XmlUTF8TextReader.cs:line 1254 at System.Xml.XmlUTF8TextReader.Read() in d:\s\corefx\src\System.Private.DataContractSerialization\src\System\Xml\XmlUTF8TextReader.cs:line 1363 at System.Xml.XmlBaseReader.MoveToContent() in d:\s\corefx\src\System.Private.DataContractSerialization\src\System\Xml\XmlBaseReader.cs:line 878 at System.ServiceModel.Dispatcher.StreamFormatter.MessageBodyStream.Read(Byte[] buffer, Int32 offset, Int32 count) --- End of inner exception stack trace --- at System.ServiceModel.Dispatcher.StreamFormatter.MessageBodyStream.Read(Byte[] buffer, Int32 offset, Int32 count) at SharedPoolsOfWCFObjects.VerifiableStream.VerifyStream(Stream stream, Int32 expectedStreamSize, Int32 bufSize, Boolean verifyContent) in d:\s\wcf\src\System.Private.ServiceModel\tests\Stress\SharedPoolsOfWCFObjects\Tests\StreamingTest.cs:line 387 at SharedPoolsOfWCFObjects.StreamingTest`2.TestEchoStream(StreamingRequestContext`1 details) in d:\s\wcf\src\System.Private.ServiceModel\tests\Stress\SharedPoolsOfWCFObjects\Tests\StreamingTest.cs:line 264 at SharedPoolsOfWCFObjects.CallStats.CallFuncAndRecordStats[T](Func`1 func, Boolean hideExceptions) in d:\s\wcf\src\System.Private.ServiceModel\tests\Stress\SharedPoolsOfWCFObjects\CallStats.cs:line 81 at SharedPoolsOfWCFObjects.CommonMultiCallTest`3.<UseChannel>b__0_0(ChannelType channel) in d:\s\wcf\src\System.Private.ServiceModel\tests\Stress\SharedPoolsOfWCFObjects\Tests\CommonTest.cs:line 337 at SharedPoolsOfWCFObjects.PooledFactoriesAndChannels`3.UseAllChannelsInPooledFactoriesAndChannels() in d:\s\wcf\src\System.Private.ServiceModel\tests\Stress\SharedPoolsOfWCFObjects\SharedPoolsOfWCFObjects.cs:line 244 at SharedPoolsOfWCFObjects.Program.RunAllStressTests[ChannelType,TestTemplate,TestParams]() in d:\s\wcf\src\System.Private.ServiceModel\tests\Stress\SharedPoolsOfWCFObjects\Program.cs:line 632 at SharedPoolsOfWCFObjects.Program.<>c__DisplayClass53_0.<DoTheStressRun>b__0() in d:\s\wcf\src\System.Private.ServiceModel\tests\Stress\SharedPoolsOfWCFObjects\Program.cs:line 551 at SharedPoolsOfWCFObjects.Program.<>c__DisplayClass54_1.<<DoTheStressRunImpl>b__1>d.MoveNext() in d:\s\wcf\src\System.Private.ServiceModel\tests\Stress\SharedPoolsOfWCFObjects\Program.cs:line 587 System.IO.IOException: An exception has been thrown when reading the stream. ---> System.IO.IOException: Unable to transfer data on the transport connection: The I/O operation has been aborted because of either a thread exit or an application request. ---> System.Net.Sockets.SocketException: The I/O operation has been aborted because of either a thread exit or an application request --- End of inner exception stack trace --- at System.Net.Http.HttpConnection.FillAsync() in d:\s\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnection.cs:line 1078 at System.Net.Http.HttpConnection.ReadNextLineAsync() in d:\s\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnection.cs:line 1038 at System.Net.Http.HttpConnection.ChunkedEncodingReadStream.TryGetNextChunkAsync() in d:\s\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\ChunkedEncodingReadStream.cs:line 39 at System.Net.Http.HttpConnection.ChunkedEncodingReadStream.ReadAsync(Memory`1 destination, CancellationToken cancellationToken) in d:\s\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\ChunkedEncodingReadStream.cs:line 120 at System.Net.Http.HttpContentReadStream.Read(Byte[] buffer, Int32 offset, Int32 count) in d:\s\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpContentReadStream.cs:line 30 at System.ServiceModel.Channels.BufferedReadStream.Read(Byte[] array, Int32 offset, Int32 count) at System.ServiceModel.Channels.MaxMessageSizeStream.Read(Byte[] buffer, Int32 offset, Int32 count) at System.Xml.EncodingStreamWrapper.Read(Byte[] buffer, Int32 offset, Int32 count) in d:\s\corefx\src\System.Private.DataContractSerialization\src\System\Xml\EncodingStreamWrapper.cs:line 629 at System.Xml.XmlBufferReader.TryEnsureBytes(Int32 count) in d:\s\corefx\src\System.Private.DataContractSerialization\src\System\Xml\XmlBufferReader.cs:line 232 at System.Xml.XmlUTF8TextReader.ReadText(Boolean hasLeadingByteOf0xEF) in d:\s\corefx\src\System.Private.DataContractSerialization\src\System\Xml\XmlUTF8TextReader.cs:line 1254 at System.Xml.XmlUTF8TextReader.Read() in d:\s\corefx\src\System.Private.DataContractSerialization\src\System\Xml\XmlUTF8TextReader.cs:line 1363 at System.Xml.XmlBaseReader.MoveToContent() in d:\s\corefx\src\System.Private.DataContractSerialization\src\System\Xml\XmlBaseReader.cs:line 878 at System.ServiceModel.Dispatcher.StreamFormatter.MessageBodyStream.Read(Byte[] buffer, Int32 offset, Int32 count) --- End of inner exception stack trace --- at System.ServiceModel.Dispatcher.StreamFormatter.MessageBodyStream.Read(Byte[] buffer, Int32 offset, Int32 count) at SharedPoolsOfWCFObjects.VerifiableStream.VerifyStream(Stream stream, Int32 expectedStreamSize, Int32 bufSize, Boolean verifyContent) in d:\s\wcf\src\System.Private.ServiceModel\tests\Stress\SharedPoolsOfWCFObjects\Tests\StreamingTest.cs:line 387 at SharedPoolsOfWCFObjects.StreamingTest`2.TestEchoStream(StreamingRequestContext`1 details) in d:\s\wcf\src\System.Private.ServiceModel\tests\Stress\SharedPoolsOfWCFObjects\Tests\StreamingTest.cs:line 264 at SharedPoolsOfWCFObjects.CallStats.CallFuncAndRecordStats[T](Func`1 func, Boolean hideExceptions) in d:\s\wcf\src\System.Private.ServiceModel\tests\Stress\SharedPoolsOfWCFObjects\CallStats.cs:line 71 System.IO.IOException: An exception has been thrown when reading the stream. ---> System.IO.IOException: Unable to transfer data on the transport connection: The I/O operation has been aborted because of either a thread exit or an application request. ---> System.Net.Sockets.SocketException: The I/O operation has been aborted because of either a thread exit or an application request --- End of inner exception stack trace --- at System.Net.Http.HttpConnection.FillAsync() in d:\s\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnection.cs:line 1078 at System.Net.Http.HttpConnection.ReadNextLineAsync() in d:\s\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnection.cs:line 1038 at System.Net.Http.HttpConnection.ChunkedEncodingReadStream.TryGetNextChunkAsync() in d:\s\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\ChunkedEncodingReadStream.cs:line 39 at System.Net.Http.HttpConnection.ChunkedEncodingReadStream.ReadAsync(Memory`1 destination, CancellationToken cancellationToken) in d:\s\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\ChunkedEncodingReadStream.cs:line 120 at System.Net.Http.HttpContentReadStream.Read(Byte[] buffer, Int32 offset, Int32 count) in d:\s\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpContentReadStream.cs:line 30 at System.ServiceModel.Channels.BufferedReadStream.Read(Byte[] array, Int32 offset, Int32 count) at System.ServiceModel.Channels.MaxMessageSizeStream.Read(Byte[] buffer, Int32 offset, Int32 count) at System.Xml.EncodingStreamWrapper.Read(Byte[] buffer, Int32 offset, Int32 count) in d:\s\corefx\src\System.Private.DataContractSerialization\src\System\Xml\EncodingStreamWrapper.cs:line 629 at System.Xml.XmlBufferReader.TryEnsureBytes(Int32 count) in d:\s\corefx\src\System.Private.DataContractSerialization\src\System\Xml\XmlBufferReader.cs:line 232 at System.Xml.XmlUTF8TextReader.ReadText(Boolean hasLeadingByteOf0xEF) in d:\s\corefx\src\System.Private.DataContractSerialization\src\System\Xml\XmlUTF8TextReader.cs:line 1254 at System.Xml.XmlUTF8TextReader.Read() in d:\s\corefx\src\System.Private.DataContractSerialization\src\System\Xml\XmlUTF8TextReader.cs:line 1363 at System.Xml.XmlBaseReader.MoveToContent() in d:\s\corefx\src\System.Private.DataContractSerialization\src\System\Xml\XmlBaseReader.cs:line 878 at System.ServiceModel.Dispatcher.StreamFormatter.MessageBodyStream.Read(Byte[] buffer, Int32 offset, Int32 count) --- End of inner exception stack trace --- at System.ServiceModel.Dispatcher.StreamFormatter.MessageBodyStream.Read(Byte[] buffer, Int32 offset, Int32 count) at SharedPoolsOfWCFObjects.VerifiableStream.VerifyStream(Stream stream, Int32 expectedStreamSize, Int32 bufSize, Boolean verifyContent) in d:\s\wcf\src\System.Private.ServiceModel\tests\Stress\SharedPoolsOfWCFObjects\Tests\StreamingTest.cs:line 387 at SharedPoolsOfWCFObjects.StreamingTest`2.TestEchoStream(StreamingRequestContext`1 details) in d:\s\wcf\src\System.Private.ServiceModel\tests\Stress\SharedPoolsOfWCFObjects\Tests\StreamingTest.cs:line 264 at SharedPoolsOfWCFObjects.CallStats.CallFuncAndRecordStats[T](Func`1 func, Boolean hideExceptions) in d:\s\wcf\src\System.Private.ServiceModel\tests\Stress\SharedPoolsOfWCFObjects\CallStats.cs:line 81 at SharedPoolsOfWCFObjects.CommonMultiCallTest`3.<UseChannel>b__0_0(ChannelType channel) in d:\s\wcf\src\System.Private.ServiceModel\tests\Stress\SharedPoolsOfWCFObjects\Tests\CommonTest.cs:line 337 at SharedPoolsOfWCFObjects.PooledFactoriesAndChannels`3.UseAllChannelsInPooledFactoriesAndChannels() in d:\s\wcf\src\System.Private.ServiceModel\tests\Stress\SharedPoolsOfWCFObjects\SharedPoolsOfWCFObjects.cs:line 244 at SharedPoolsOfWCFObjects.Program.RunAllStressTests[ChannelType,TestTemplate,TestParams]() in d:\s\wcf\src\System.Private.ServiceModel\tests\Stress\SharedPoolsOfWCFObjects\Program.cs:line 632 at SharedPoolsOfWCFObjects.Program.<>c__DisplayClass53_0.<DoTheStressRun>b__0() in d:\s\wcf\src\System.Private.ServiceModel\tests\Stress\SharedPoolsOfWCFObjects\Program.cs:line 551 at SharedPoolsOfWCFObjects.Program.<>c__DisplayClass54_1.<<DoTheStressRunImpl>b__1>d.MoveNext() in d:\s\wcf\src\System.Private.ServiceModel\tests\Stress\SharedPoolsOfWCFObjects\Program.cs:line 587 System.IO.IOException: An exception has been thrown when reading the stream. ---> System.IO.IOException: Unable to transfer data on the transport connection: The I/O operation has been aborted because of either a thread exit or an application request. ---> System.Net.Sockets.SocketException: The I/O operation has been aborted because of either a thread exit or an application request --- End of inner exception stack trace --- at System.Net.Http.HttpConnection.FillAsync() in d:\s\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnection.cs:line 1078 at System.Net.Http.HttpConnection.ReadNextLineAsync() in d:\s\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnection.cs:line 1038 at System.Net.Http.HttpConnection.ChunkedEncodingReadStream.TryGetNextChunkAsync() in d:\s\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\ChunkedEncodingReadStream.cs:line 39 at System.Net.Http.HttpConnection.ChunkedEncodingReadStream.ReadAsync(Memory`1 destination, CancellationToken cancellationToken) in d:\s\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\ChunkedEncodingReadStream.cs:line 120 at System.Net.Http.HttpContentReadStream.Read(Byte[] buffer, Int32 offset, Int32 count) in d:\s\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpContentReadStream.cs:line 30 at System.ServiceModel.Channels.BufferedReadStream.Read(Byte[] array, Int32 offset, Int32 count) at System.ServiceModel.Channels.MaxMessageSizeStream.Read(Byte[] buffer, Int32 offset, Int32 count) at System.Xml.EncodingStreamWrapper.Read(Byte[] buffer, Int32 offset, Int32 count) in d:\s\corefx\src\System.Private.DataContractSerialization\src\System\Xml\EncodingStreamWrapper.cs:line 629 at System.Xml.XmlBufferReader.TryEnsureBytes(Int32 count) in d:\s\corefx\src\System.Private.DataContractSerialization\src\System\Xml\XmlBufferReader.cs:line 232 at System.Xml.XmlUTF8TextReader.ReadText(Boolean hasLeadingByteOf0xEF) in d:\s\corefx\src\System.Private.DataContractSerialization\src\System\Xml\XmlUTF8TextReader.cs:line 1254 at System.Xml.XmlUTF8TextReader.Read() in d:\s\corefx\src\System.Private.DataContractSerialization\src\System\Xml\XmlUTF8TextReader.cs:line 1363 at System.Xml.XmlBaseReader.MoveToContent() in d:\s\corefx\src\System.Private.DataContractSerialization\src\System\Xml\XmlBaseReader.cs:line 878 at System.ServiceModel.Dispatcher.StreamFormatter.MessageBodyStream.Read(Byte[] buffer, Int32 offset, Int32 count) --- End of inner exception stack trace --- at System.ServiceModel.Dispatcher.StreamFormatter.MessageBodyStream.Read(Byte[] buffer, Int32 offset, Int32 count) at SharedPoolsOfWCFObjects.VerifiableStream.VerifyStream(Stream stream, Int32 expectedStreamSize, Int32 bufSize, Boolean verifyContent) in d:\s\wcf\src\System.Private.ServiceModel\tests\Stress\SharedPoolsOfWCFObjects\Tests\StreamingTest.cs:line 387 at SharedPoolsOfWCFObjects.StreamingTest`2.TestEchoStream(StreamingRequestContext`1 details) in d:\s\wcf\src\System.Private.ServiceModel\tests\Stress\SharedPoolsOfWCFObjects\Tests\StreamingTest.cs:line 264 at SharedPoolsOfWCFObjects.CallStats.CallFuncAndRecordStats[T](Func`1 func, Boolean hideExceptions) in d:\s\wcf\src\System.Private.ServiceModel\tests\Stress\SharedPoolsOfWCFObjects\CallStats.cs:line 71 ``` 27304 area-System.Runtime Check if app is run by sudo/admin on Linux @maroallegro commented on [Mon Jan 29 2018](https://github.com/dotnet/core/issues/1244) I am trying to check if .NetCore code is running as sudo/admin on Linux. It works on Windows but throws exception on Linux. How do I check if app is run by admin/sudo on Ubuntu Linux by using .NET Core2.0 build-in class? Here is the code I have tried (however i thought that it will not manage admin rights on Linux): ``` using System; using System.Security.Principal; namespace smallTestsCore { class Program { static void Main(string[] args) { Console.WriteLine(Program.IsAdministrator); Console.ReadLine(); } public static bool IsAdministrator => new WindowsPrincipal(WindowsIdentity.GetCurrent()) .IsInRole(WindowsBuiltInRole.Administrator); } } ``` The code works on Windows, but does not work on Linux: ``` Exception has occurred: CLR/System.PlatformNotSupportedException An unhandled exception of type 'System.PlatformNotSupportedException' occurred in System.Security.Principal.Windows.dll: 'Windows Principal functionality is not supported on this platform.' at System.Security.Principal.WindowsIdentity.GetCurrent() at adminTst.Program.get_IsAdministrator() in /home/user/adminTst/Program.cs:line 15 at adminTst.Program.Main(String[] args) in /home/user/adminTst/Program.cs:line 11 ``` 27305 area-System.Net Behavioral difference between Linux and Windows in httprequest with 302 reply and # "@jdelrue commented on [Thu Feb 01 2018](https://github.com/dotnet/core/issues/1246) # General Operating system 1: Windows 10 Operating system 2: Ubuntu (16.04 or 17.04) Execute: ``` using System; using System.Net.Http; using System.Threading.Tasks; namespace redirtest { class Program { static void Main(string[] args) { var res = Task.Run(async () => await method()); res.Wait(); } public static async Task method() { using (var client = new HttpClient(new HttpClientHandler { AllowAutoRedirect = true })) { var connect = await client.GetAsync(""http://www.jimber.org/redirect.php""); var requestUri = connect.RequestMessage.RequestUri.AbsoluteUri; Console.WriteLine(requestUri); } } } } ``` Output Windows: http://www.google.be/#youdontgetthisinlinux Output Linux: http://www.google.be/ Expected output is the Windows version. Workaround: Disable autoredirect and read location header. " 27306 area-System.Runtime DateTime.TryParse produces different results in different environments "@Doff3n commented on [Wed Feb 14 2018](https://github.com/dotnet/core/issues/1267) # DateTime.TryParse produces different results in different environments # General I am trying to parse a date, with DateTime.TryParse and with a provided Norwegian culture and no DatetimeStyles: ``` csharp var result: DateTime.TryParse(""29.01"", new CultureInfo(""nb-NO"", false), DateTimeStyles.None, out var parsedDateTime) ``` I am purposely sending in ""29.01"" and expecting the result to parse to a default Datetime: ""29.01.2018"", I also expect that 29.01.18 and 29.01.2018 parses to the correct dates. In norway the date format is dd.MM.YYYY HH:mm Code: https://github.com/Doff3n/HelloDate Commands: - dotnet build - dotnet run Running this on my PC: - dotnet run parsedDateTime: 29.01.2018 00:00:00 result: True Running this on the VM: - dotnet run parsedDateTime: 01.01.0001 00.00.00 result: False .Net core sdk version: 2.1.4, runtime: 2.0.5 In desperation I have also tried setting Date and Time formats in Windows, but I would have expected the property UseUserOverride: false to not allow user settings. " 27307 area-System.Data Issue connecting to MS SQL Server running on non default port 1433 "@mahesji commented on [Fri Feb 09 2018](https://github.com/dotnet/core/issues/1264) # Issue Title Issue connecting to MS SQL Server running on non default port 1433 from Linux environment **OS Version** Linux 4.4.0-109-generic #132~14.04.1-Ubuntu SMP Tue Jan 9 21:46:42 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux dotnet core project settings ``` <Project Sdk=""Microsoft.NET.Sdk.Web""> <PropertyGroup> <TargetFramework>netcoreapp2.0</TargetFramework> <RuntimeFrameworkVersion>2.0.5</RuntimeFrameworkVersion> </PropertyGroup> <ItemGroup> <Folder Include=""wwwroot\"" /> </ItemGroup> <ItemGroup> <PackageReference Include=""Microsoft.AspNetCore.All"" Version=""2.0.5"" /> <PackageReference Include=""System.Data.SqlClient"" Version=""4.4.2"" /> </ItemGroup> <ItemGroup> <DotNetCliToolReference Include=""Microsoft.VisualStudio.Web.CodeGeneration.Tools"" Version=""2.0.2"" /> </ItemGroup> </Project> ``` # General Using System.Data.SqlClient to connect to Sql server database. Following the sample in this post https://blogs.msdn.microsoft.com/dotnet/2016/11/09/net-core-data-access/ It works fine if the sql server is listening on port 1433 but fails when connecting to sql servers listening on port 1434. Confirmed that there is no network / firewall issues that that is blocking the ports. Able to connect to the same sql server on port 1434 using java code. This connection string works > Server=myhostname,1433;Database=mydatabase;User Id=myuser;Password=mypassword; This connection string does not work in above linux environment. Works fine on windows Server=myhostname,1434;Database=mydatabase;User Id=myuser;Password=mypassword; Both connect strings work fine in Windows environment. Record Fetch Error: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 35 - An internal exception was caught) --- @usergiga commented on [Fri Feb 09 2018](https://github.com/dotnet/core/issues/1264#issuecomment-364605423) If an instance of SQL Server is listening on any other port, than 1433. You have to specify a server-alias or change the standard port globally. You can have SQL Server listening on multiple ports. --- @mahesji commented on [Mon Feb 12 2018](https://github.com/dotnet/core/issues/1264#issuecomment-364967845) @usergiga , Thank you for the reply. I have the alias created and that doesn't seem to help. The connection works fine in Windows runtime. Have this issue only in the Linux (Ubuntu) runtime. " 27310 area-System.Drawing Translation vector of Transformation matrix works incorrect when PageUnit is Point. "The issue is observed on linux platform, but not observed on the Windows. Its looks like graphics.PageUnits does not taken into account on applying of translation vector to the graphical objects. 1. Run the following code: ```c# var bmp = new Bitmap(200, 50); using (var graphics = Graphics.FromImage(bmp)) using(var font = new Font(""Arial"", 10)) using(var brush = new SolidBrush(Color.Black)) using(var bgBrush = new SolidBrush(Color.White)) { //Fill background graphics.PageUnit = GraphicsUnit.Pixel; graphics.FillRectangle(bgBrush, 0, 0, 200, 100); // Draw text with 10 pixel offset graphics.PageUnit = GraphicsUnit.Pixel; graphics.Transform = new Matrix(1,0,0,1,10,0); graphics.DrawString(""|<- 10 pixels offset"", font, brush, 0,0); // Draw text with 10 points offset graphics.PageUnit = GraphicsUnit.Point; graphics.DrawString(""|<- 10 points offset"", font, brush, 0,10); Console.WriteLine(""Actual Dpi is: "" + graphics.DpiX);//96 } bmp.Save(""units.png"", ImageFormat.Png); } ``` 2. Open generated png file Observed: both line of the text have the same offset - 10px (see attached units_linux.png)  Expected: Second line should have 10 points offset (or ~13px for 96 dpi) (see attached units_win.png)  " 27312 area-System.Drawing Graphics.MeasureString wrong results in case of PageUnit is Point and all chars fitted "charsFitted and linesFitted output paramters values are 0 in case of text fitted in provided area and graphics's PageUnit is Point. The issue is reproducible under linux, but not reproducible under Windows. Run the following code under linux ```c# var bmp = new Bitmap(200, 50); using (var graphics = Graphics.FromImage(bmp)) using(var font = new Font(""Arial"", 10)) { graphics.PageUnit = GraphicsUnit.Point; graphics.MeasureString(""HELLO"", font, new SizeF(float.MaxValue, float.MaxValue), StringFormat.GenericTypographic, out var chars, out var lines); Console.WriteLine($""Chars fitted: {chars}""); Console.WriteLine($""Lines fitted: {lines}""); } ``` Observed: Console output is Chars fitted: 0 Lines fitted: 0 Expected: Console output is Chars fitted: 5 Lines fitted: 1 " 27313 area-System.Drawing Graphics.Measure string wrong result in case of the text broken into lines "charsFilled output parameter value is wrong in case of text broken into lines. The issue is reproducible under linux, but not reproducible under windows. Run the following code: ```c# var bmp = new Bitmap(200, 50); using (var graphics = Graphics.FromImage(bmp)) using(var font = new Font(""Arial"", 10)) { graphics.MeasureString(""H E L L O"", font, new SizeF(20, float.MaxValue), StringFormat.GenericTypographic, out var chars, out var lines); Console.WriteLine($""Chars fitted: {chars}""); Console.WriteLine($""Lines fitted: {lines}""); } ``` Observed: console output is Chars fitted: 3 Lines fitted: 4 Expected: console output is Chars fitted: 9 Lines fitted: 4 " 27314 area-System.Text RegexPrefix struct, RegexFCD buffer to ValueListBuilder & ArrayPool **Updated results from yesterday (couldn't repro the better number in commit 2).** before: | Method | Mean | Error | StdDev | Gen 0 | Allocated | |----------- |---------:|---------:|----------:|------------:|----------:| | RegexCtor | 339.5 ms | 0.9025 ms | 0.8442 ms | 201000.0000 | 402.07 MB | after: | Method | Mean | Error | StdDev | Gen 0 | Allocated | |----------- |---------:|---------:|----------:|------------:|----------:| | RegexCtor | 312.0 ms | 1.447 ms | 1.1258 ms | 189125.0000 | 378.36 MB | ### Results After the first regex construction: ~ 8% increased throughput ~ 4% less allocation 27315 area-System.Net SocketsHttpHandler: add response stream drain When an HttpResponseMessage is disposed before the entire response stream is read, we are currently just killing the connection. Instead, try to drain the connection (up to a limit) so that it can be reused. @stephentoub @davidsh @dotnet/ncl 27317 area-System.IO Brotli Compression not working in an Azure Web App Opened on behalf of @jmkni from https://github.com/dotnet/corefxlab/issues/2068 --- Hi all I have the Brotli compression working nicely in development, but when I push it to Azure the files just don't compress. The Content-Encoding is returned as **br**, but the files are no smaller than with GZIP. Running locally, they are significantly smaller. On my Azure Web App, I have installed the **Brotli HTTP Compression (x86)** extension, and I am running on 32-bit. Any ideas? Cheers Edit, have tried switching to 64-bit, and using the 64-bit extension. Same issue. I have also tried both 32 and 64 bit without the extension, no joy! Buffer size: 65520 Quality: CompressionLevel.Optimal 27318 area-System.IO Make final API review changes to file enumeration Tweak stack array initialization to just zero the first element in matcher algorithm. cc: @danmosemsft @terrajobst 27319 area-System.Memory Add ROSpan Equals/CompareTo/IndexOf/Contains string-like APIs with StringComparison Part of https://github.com/dotnet/corefx/issues/21395#issuecomment-359906138 - Equals - CompareTo - IndexOf ~(fast span only)~ - Contains ~(fast span only)~ Depends on: https://github.com/dotnet/coreclr/pull/16467 **TODO:** - Add more tests - ~Verify correctness on Unix~ - ~Can we expose string.IndexOf with `out int matchedLength` parameter? Can we expose string.Contains with `StringComparison comparisonType` parameter? If not, these APIs cannot be implemented for portable span.~ cc @jkotas, @stephentoub, @KrzysztofCwalina, @tarekgh, @JeremyKuhne, @joshfree 27320 area-System.Drawing Graphics.Transform does not affect clip region specified by Path on Linux "The clip region remains in the same place, regardless of the transformation matrix. The issue is not reproducible on Windows, but reproducible on Linux. The issue is not reproducible with using of graphics.SetClip(Rectangle). 1. Run the following code on Linux: ```c# var bmp = new Bitmap(200, 50); using (var graphics = Graphics.FromImage(bmp)) using(var pen = new Pen(Color.Black, 1f)) { graphics.Clear(Color.White); graphics.TranslateTransform(50f,0f); var clipRectangle = new Rectangle(0, 0, 50, 50); graphics.DrawRectangle(pen, clipRectangle); //mark the clip area // set clip area using path var path = new GraphicsPath(); path.AddRectangle(clipRectangle); graphics.SetClip(path); // Draw diagonal line to be clipped by rectangle graphics.DrawLine(pen, -50,0,150,50); } bmp.Save(""/mnt/c/Temp/clip_linux.png"", ImageFormat.Png); ``` 2. Compare results of running the code on windows and linux Observed: Clip area does not affected by transformation matrix and located at 0,0 point.  Expected: Clip area should affected by translation matrix and shifted to the right by 50 pixels like on Windows.  " 27322 area-System.Net DO NOT MERGE: add request drain test to understand behavior 27323 area-System.ComponentModel EmailAddressAttribute validates invalid emails I've been using [`EmailAddressAttribute`](https://github.com/dotnet/corefx/blob/master/src/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/EmailAddressAttribute.cs) to validate email addresses in an MVC app but I've noticed that it uses a very naive validation method that validates addresses like `.name@example.org` and other formats forbidden by [RFC 2822](https://tools.ietf.org/html/rfc2822#section-3.4.1) and [3696](https://tools.ietf.org/html/rfc3696#section-3). Should this attribute use the same regex validation method as its [Framework equivalent](https://github.com/Microsoft/referencesource/blob/master/System.ComponentModel.DataAnnotations/DataAnnotations/EmailAddressAttribute.cs#L54), which seems much more robust? 27324 area-System.Net SocketsHttpHandler may corrupt pooled connection if send content is canceled When a connection is about to be returned to the pool, we're nulling out the _currentRequest field, which then causes the send content to stop sending if it's still going. But if the connection remains open, the server may still expect a promised amount of content to be received, causing a hang. 27326 area-System.Security CryptoStream.Dispose calls Flush on read-only Stream in CryptoStreamMode.Read ```csharp class ReadOnlyStream : Stream { public override void Flush() => throw new NotSupportedException(); public override int Read(byte[] buffer, int offset, int count) => count; public override long Seek(long offset, SeekOrigin origin) => throw new NotSupportedException(); public override void SetLength(long value) => throw new NotSupportedException(); public override void Write(byte[] buffer, int offset, int count) => throw new NotSupportedException(); public override bool CanRead => true; public override bool CanSeek => false; public override bool CanWrite => false; public override long Length => throw new NotSupportedException(); public override long Position { get => throw new NotSupportedException(); set => throw new NotSupportedException(); } } static void Main(string[] args) { var aes = Aes.Create().CreateDecryptor(); var crypto = new CryptoStream(new ReadOnlyStream(), aes, CryptoStreamMode.Read, false); crypto.Dispose(); } ``` I'm not sure if that's the intended behavior, but it makes no logical sense to me and also prevents me from reading encrypted payload from http requests in ASP.NET Core. 27328 area-System.Memory Rename string-slicing extension methods "As part of https://github.com/dotnet/corefx/issues/26894 the api folks have approved renaming AsROSpan and AsROMemory on string instances to AsSpan and AsMemory (as the ""readonly"" is obvious given the read-only nature of the input.) This puts the renaming in effect. Basically a big search-replace commit." 27329 area-System.Net SocketsHttpHandler: Consider exposing setting for maximum response drain size When a response is disposed before the response stream is read to the end, we attempt to drain the remaining response body up to a limit. We should consider making this limit configurable via a setting on SocketsHttpHandler. See discussion on #27315 EDIT (@stephentoub): Added API: ```C# public int MaxResponseDrainSize { get; set; } // Question: should we use long instead? ``` 27330 area-Meta Look for places to collapse AsSpan().Slice(start, length) into .AsSpan(start,length) 27332 area-Serialization Update sgen usage and --parameters #26901 #26902 @huanwu @zhenlan @mconnew 27333 area-Infrastructure CoreFX publish steps should support running on systems with only VS 2017 Currently, the checked-in build definitions used by CoreFX publish tasks ( [example](https://github.com/dotnet/corefx/blob/master/buildpipeline/DotNet-Trusted-Publish.json#L38) ) are hard-coded to expect to find VS 2015 tools installed on the machine. Ideally these steps could work on either system. However, to support SourceLink and other new features we'd like to move all build processes to 2017 for now. @weshaggard FYI. 27334 area-System.Runtime StringBuilder should allow copying efficiently to a TextWriter ## Motivation At present to copy a StringBuilder into a TextWriter you must allocate a throwaway string as large as the amount you want to copy. This can cause a LOH allocation. ## Workaround To avoid that today you must write code to copy in blocks via a char[] buffer. ASP.NET were forced to do this ([PR here](https://github.com/aspnet/AspNetWebStack/commit/3fe0d348f00864e4f1eeaefbd027ea965787b892#diff-fe84a6b0645ee996bea1ec4d8445823f)) in response to an issue in a customer workload. If we add an API for StringBuilder to copy to a TextWriter, we can take care of that loop, and also use a pooled char[]. ## Proposed API ```c# public sealed partial class StringBuilder : System.Runtime.Serialization.ISerializable { // existing public void CopyTo(int sourceIndex, char[] destination, int destinationIndex, int count) { } public void CopyTo(int sourceIndex, System.Span<char> destination, int count) { } // proposed public void CopyTo(int sourceIndex, TextWriter destination, int count) { } } ``` ## Rough Implementation Basically [what ASP.NET did](https://github.com/aspnet/AspNetWebStack/blob/62d0b2df0bcca848a8e0848fd1866928df15528e/src/System.Web.WebPages/StringWriterExtensions.cs#L15) but using a pooled char[] buffer. ```c# public void CopyTo(int sourceIndex, TextWriter destination, int count) { int remainingChars = this.Length; int bufferSize = Math.Min(this.Length, 1024); char[] buffer = ArrayPool<byte>.Shared.Rent(bufferSize); int currentPosition = 0; while (remainingChars > 0) { int copyLen = Math.Min(bufferSize, remainingChars); this.CopyTo(currentPosition, buffer, copyLen); destination.Write(buffer, 0, copyLen); currentPosition += copyLen; remainingChars -= copyLen; } ArrayPool<byte>.Shared.Return(buffer); } ```` 27336 area-Meta .NET Core Assembly Code Signing on Mac "I have a class library that needs to be signed due to other references in the project it is in. I tried to pull it into my Mac app using Xamarin and Visual Studio for Mac but I keep getting this error: ``` Target ResolveAssemblyReferences: A TargetFramework profile exclusion list will be generated. Target ResolveKeySource: /Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(3105,5): error MSB4018: The ""ResolveKeySource"" task failed unexpectedly. /Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(3105,5): error MSB4018: System.NotSupportedException: Specified method is not supported. /Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(3105,5): error MSB4018: at System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeInterfaceAsObject (System.Guid clsid, System.Guid riid) [0x00006] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/interopservices/runtimeenvironment.cs:204 /Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(3105,5): error MSB4018: at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) /Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(3105,5): error MSB4018: at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.Reflection/MonoMethod.cs:305 Done building target ""ResolveKeySource"" in project ""POSModel.Shared.csproj"" -- FAILED. Done building project ""POSModel.Shared.csproj"" -- FAILED. Build FAILED. /Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(3105,5): error MSB4018: The ""ResolveKeySource"" task failed unexpectedly. /Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(3105,5): error MSB4018: System.NotSupportedException: Specified method is not supported. /Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(3105,5): error MSB4018: at System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeInterfaceAsObject (System.Guid clsid, System.Guid riid) [0x00006] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/interopservices/runtimeenvironment.cs:204 /Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(3105,5): error MSB4018: at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) /Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(3105,5): error MSB4018: at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.Reflection/MonoMethod.cs:305 0 Warning(s) 1 Error(s) ``` It obviously says NotSupported, but didn't know if there was any way to sign this on the Mac or any plans to support this in the future. I tried to do a search through issues and couldn't find anything related. I noticed the strong name tool does work on Mac `sn -i key.pfx <machine container>`. However because of the NotSupported exception I am not given a machine container to sign against. Any help would be appreciated!" 27337 area-System.ComponentModel Adding missing typeforward for Lazy<T,TMetadata> to S.CM.Composition Adding missing typeforward for Lazy<T,TMetadata> to System.ComponentModel.Composition Fixes #27299 27341 area-System.Net Disable SocketsHttpHandler's concurrent content sends SocketsHttpHandler currently has some support for allowing request content sending to run concurrently with response content receiving. However, we don't actually have a need for this, and there are a lot of subtleties that would need to be made robust, e.g. how to handle exceptions that occur concurrently in the sending and receiving. For now, we're removing it. Unless ExpectContinue is set to true, we just send the content before receiving the response, and if it is set, we start the send and then wait for it once we've received the final status code from the server. cc: @geoffkizer, @davidsh, @wfurt Fixes #https://github.com/dotnet/corefx/issues/27324 27342 area-System.Text Proposal: Add pre-defined regular expressions "# Suggestion: I suggest to add pre-defined regular exertions as static fields in Regex class or in a new Regexs class. There are some famous widely used expressions, such as Phone numbers, dates, times, zip codes, emails…. etc. Regexs class can be put in a separate NuGet, to allow contributors to add as many Expressions as they want. Note: Regexs should appears in the auto-complete list displayed with Regex methods that expects expressions. # Implementation: ``` public static class Regexs { public static readonly string Email = @""^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$""; // ........... } ``` # Usage: `var rgx = new Regex(Regexs.Email); ` # Benefit: This will be a time saver for repeated Regex tasks, and will make it easier for beginners to use Regex, " 27343 area-Infrastructure Publish symbols using Microsoft.SymbolUploader.Build.Task package The `Microsoft.SymbolUploader.Build.Task` package on the BuildTools feed is the new way to index and publish symbols to the symbol server. It should be used instead of the current combination of BuildTools' `GetAllSymbolFilesToPublish` and the VSTS symbol publish build step. Example implementation in Core-Setup: https://github.com/dotnet/core-setup/pull/3465 27344 area-System.Net refactor some proxy tests using new loopback server functions and new auth This is beginning to get some feedback. If it looks ok, I can finish rest of the tests and retire LoopbackGetRequestHttpProxy. It also should be easier to write tests for something like #27293. 27346 area-System.ComponentModel EmailAddressAttribute.IsValid Method (Object) cannot validate hyphen at the beginning of domain name "_From @ahmetbombaci-united on February 21, 2018 22:25_ Domain names cannot start with hyphen (ref: https://tools.ietf.org/html/rfc952) However; IsValid method does not respect to this rule Test case: var checkMail = new System.ComponentModel.DataAnnotations.EmailAddressAttribute().IsValid(""ahmet.bombaci@yahoo.-united.COM""); _Copied from original issue: aspnet/Home#2893_" 27347 area-System.IO Directory and File Exists using charPool for normalization Fixes https://github.com/dotnet/corefx/issues/20876 27348 area-System.IO Update tests for Path changes Updates for https://github.com/dotnet/coreclr/pull/16478 Tagged these tests with #27269 as they're related. Will update for both PRs from CoreCLR. cc: @danmosemsft 27349 area-System.Net Ignore ping6 failures on macOS 10.12 Fixes #26358 27350 area-System.Memory Should Span.Empty return a pointer to an empty array instead of default? "Currently, there is inconsistent behavior in the following scenario: ```C# byte[] array = new byte[10]; Span<byte> span = new Span<byte>(array, 0, 0); // effectively empty Span<byte> emptySpan = Span<byte>.Empty; // returns ""default"" Assert.True(span.IsEmpty); Assert.True(emptySpan.IsEmpty); fixed (byte* pSpan = &MemoryMarshal.GetReference(span)) { fixed (byte* pEmptySpan = &MemoryMarshal.GetReference(emptySpan)) { // pSpan != null // pEmptySpan == null } } ``` Should `Span<T>.Empty` return either `SpanHelpers.PerTypeValues<T>.EmptyArray;` or `Array.Empty<T>();` instead? As an aside, should we do a null check and throw if someone calls `MemoryMarshal.GetReference(default(Span<T>))` instead of returning a null pointer (especially now that we return default if we pass null array to the constructor)? Otherwise, we would have to do pointer null checks (for span.Length == 0) before passing it to native libraries (for example here - https://github.com/dotnet/coreclr/blob/master/src/mscorlib/src/System/Globalization/CompareInfo.Windows.cs#L166). cc @jkotas, @KrzysztofCwalina, @stephentoub, @tarekgh, @VSadov, @AndyAyersMS " 27351 area-System.Drawing Graphics.MeasureString produces wrong result if text contains Unicode characters at the end. "Run the following code on Linux: ```c# var txt = ""1\uFF09"";//1) using (var graphics = Graphics.FromImage(new Bitmap(200, 50))) using(var font = new Font(""Arial"", 10)) { var size = graphics.MeasureString(txt, font, new SizeF(float.MaxValue, float.MaxValue), StringFormat.GenericTypographic, out var chars, out var lines); Console.WriteLine($""Chars fitted: {chars}""); Console.WriteLine($""Lines fitted: {lines}""); } ``` Observed: console output is Chars fitted: 1 Lines fitted: 1 Expected: console output is Chars fitted: 2 Lines fitted: 1 " 27352 area-System.Net be more liberal on what exception type to get on handshake failure on Ubuntu18 following tests were failing: (#27023) - GetAsync_AllowedSSLVersionDiffersFromServer_ThrowsException (Tls11/Tls12 args) - GetAsync_DisallowTls10_AllowTls11_AllowTls12 The both set mismatched TLS versions and they expect handshake to fail. However newer openssl sends Alert message before shutting down TCP connection. The existing test expected IO failure and failed because we got Exception from SSL handshake. This change will accept either exception as successful test pass. The handshake should fail but that can happen in different ways. 27354 area-System.Net SSL certificate validation on Windows 7 with .Net Framework is ignored after a connection to port different than 443 was established "- Steps to reproduce: 1. Create/find a server that hosts 2 SSL endpoins on port 443 and port 10443 (probably any port different that 443) - the IP address of the two endpoints should be the same, the server certificates of the endpoints should be self-signed and different. 2. Build the following code for **net471**: ```c# static void Main(string[] args) { string host = ""your server IP""; MakeRequest(host, 10443); MakeRequest(host, 443); } private static void MakeRequest(string host, int port) { HttpRequestMessage webRequest = new HttpRequestMessage( HttpMethod.Get, $""https://{host}:{port}/""); webRequest.Version = new Version(1, 1); var handler = new HttpClientHandler { ServerCertificateCustomValidationCallback = (sender, cert, chain, errors) => true }; HttpClient client = new HttpClient(handler); client.SendAsync(webRequest).Wait(); } ``` 3. Run the following code to connect to that server **on Windows 7 64-bit** - Expected result: The code should complete without errors - Actual result: There is an exception: ``` System.Net.Http.HttpRequestException: An error occurred while sending the request. System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel. ``` **This does not reproduce on Windows 10.** Considering that this API is part of the .Net Standard 2.0 API, it affects portable code running on Windows 7 and on .Net Framework. The issue is also observed on all net451+ frameworks on Windows 7. The test for those frameworks uses the ```WebRequestHandler``` as it is the only one that has a certificate validation support. I think it has something to do with the ServicePointManager and it reusing of connections as reducing the MaxServicePointIdleTime seems to have some effect (though in the distilled repro above I couldn't make it pass). If the order of the request is changed so that the connection to the port 443 is established first, then the connection to port 10443 is ok. " 27355 area-System.Net HttpWebRequest/HttpWebResponse never releases connection after http server error (.Net Core 2.0.1, Debian 8) "I'm running a .Net Core Console App under Debian 8, which constantly queries a REST server via HTTPS. The app uses plain syncronous http calls using HttpWebRequest / HttpWebResponse . I noticed that after some hours of operation all calls raise exceptions with description ""Too many open files"", meaning that there are too many connections left non-closed. After some investigation I figured out that each time the http server responds with non-200 status code (for example, 5хх server errors of 429 Too many requests), even after disposing HttpWebResponse the connection remains open but is never reused by ServicePoint manager for next HttpWebRequest, even for the same host/URL. After a significant amount of errors the open file limit (default 4096) is exhausted an no further requests are possible. The connections are never released until the dotnet process is killed. Actions to reproduce he problem: 1. I wrote a simple php script `getstatus.php` and placed it on a test web serer. The script emulates http error. It accepts a numeric code as GET query and responds with same HTTP code. The response body always contains the same - the resquest headers. When requesting `https://myserver/getstatus.php` or `https://myserver/getstaus.php?200` I get normal response. When requesting `https://myserver/getstaus.php?500` I get same content, but with 500 status code (""Internal server error"") etc. The php code is below: ```php <?php $code=$_SERVER['QUERY_STRING']; if ($code) { http_response_code($code); }; echo ""Request headers: <br /> \n""; foreach (getallheaders() as $name => $value) { echo ""$name: $value <br />\n""; } ?> ``` 2. The sample vb.net code for quering the server. The program accepts a numeric code as argument and makes 100 requests to test server: ```vb Imports System Imports System.IO Imports System.Net Imports System.Threading Module Program Private Const USER_AGENT = ""Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36"" Sub Main(args As String()) Dim result As String For counter = 1 To 100 If args.Count < 1 Then Console.WriteLine(""Launched without arguments"") result = DownloadString(""https://mytestserver/getstatus.php"") Else Console.WriteLine(""Launched with argument: {0}"", args(0)) result = DownloadString(""https://mytestserver/getstatus.php?"" & args(0)) End If Console.WriteLine(""Respone content > "" & result) Thread.Sleep(500) Next Console.ReadLine() End Sub Private Function GetResult(ByRef w As HttpWebRequest) As String Try Using r As HttpWebResponse = w.GetResponse Console.WriteLine(""Response status > "" & r.StatusCode) Console.WriteLine(""Response headers > "" & r.Headers.ToString) Using s As Stream = r.GetResponseStream Using rd As StreamReader = New StreamReader(s) Dim st As String = rd.ReadToEnd Return st End Using End Using End Using Catch ex As webException Console.WriteLine(""Catch in GetResult(): "" & ex.Message) End Try End Function Private Function DownloadString(ByVal __Url As String) As String Try Dim w As HttpWebRequest = CType(WebRequest.Create(__Url), HttpWebRequest) w.UserAgent = USER_AGENT w.KeepAlive = True w.Timeout = 10000 w.ReadWriteTimeout = 10000 Console.WriteLine(""Requesting "" & __Url) Return GetResult(w) Catch ex As Exception Console.WriteLine(""Catch in DownloadString(): "" & ex.Message) End Try End Function End Module ``` I use VS 2017 Community to write the code. The project was created using a "".Net Core Console application"" template with no additional changes to project configuration. The target platform is shown as "".NET Core 2.0"" The project is compiled under VS, then published to a folder, then the folder contents are transferred to the Debian 8 machine (VPS) and run like `dotnet myproj.dll` 3. To count open file handles I use a bash script found on StackOverflow ```bash cd /proc for pid in [0-9]* do echo ""PID = $pid with $(ls /proc/$pid/fd/ | wc -l) file descriptors"" done | sort -rn -k5 | head | while read -r _ _ pid _ fdcount _ do command=$(ps -o cmd -p ""$pid"" -hc) printf ""pid = %5d with %4d fds: %s\n"" ""$pid"" ""$fdcount"" ""$command"" done ``` 4. Actual testing 4.1. Run `dotnet myproj.dll`. On a separate session monitor open file count with the above script. In my case there are no more than 42 open files for the dotnet process, from start to finish. 4.2. Run `dotnet myproj.dll 500` emulating http errors. Each attempt to get httpwebresponse object results in exception which is logged to console. After each error the number of open files for dotnet process increases by 3 (!). After 100 ""unsuccessful"" requests the open file count reaches 344 (started at 42). Note that all objects for response handling are wrapped in `using`, so they should be disposed properly after exception, and tcp connection should be released for reusing for next calls. I might be wrong, but current behavior is a bug. During further experiments I found a workaround. If I completely read a ResponseStream of WebException.Response object, the connection seems to be released, and total connection count does not increse. The `Catch` block in `GetResponse` function should containg following lines: ```vb Catch ex As webException Console.WriteLine(""Catch in GetResult(): "" & ex.Message) Console.WriteLine(""WebException.Reponse.Headers: "" & ex.Response.Headers.ToString) Using s As Stream = ex.Response.GetResponseStream Using rd As StreamReader = New StreamReader(s) Dim st As String = rd.ReadToEnd Return st End Using End Using End Try ``` But this seems to be redundant because in many cases servers don't return any meaningful info after http error in the response body, so reading it is unneeded work and anyway non-intuinive way of programming. Thanks for attention and please don't mind any mistakes, I'm not a professiona l programmer. " 27356 area-System.Security Fix NullReferenceException on exception cascade when CEK doesn't decrypt "A late change caused a test which only runs in outer-loop to fail with a NullReferenceException instead of a CryptographicException. This is caused by the ""return now if decryption failed"" path." 27357 area-System.IO Path changes resulting in failing DriveInfo test https://github.com/dotnet/corefx/pull/27339#issuecomment-367578790 https://mc.dot.net/#/user/dotnet-maestro-bot/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/e91038db253e351822d63ed2cf875f94cb0cabc7/workItem/System.IO.FileSystem.DriveInfo.Tests/analysis/xunit/System.IO.FileSystem.DriveInfoTests.DriveInfoWindowsTests~2FCtor_InvalidPath_ThrowsArgumentException(driveName:%20%5C%22%5C%22,%20paramName:%20%5C%22path%5C%22) ``` Unhandled Exception of Type Xunit.Sdk.EqualException Message : Assert.Equal() Failure Expected: path Actual: (null) Stack Trace : at System.AssertExtensions.Throws[T](String netCoreParamName, String netFxParamName, Action action) in D:\j\workspace\windows-TGrou---f8ac6754\src\CoreFx.Private.TestUtilities\src\System\AssertExtensions.cs:line 39 at System.IO.FileSystem.DriveInfoTests.DriveInfoWindowsTests.Ctor_InvalidPath_ThrowsArgumentException(String driveName, String paramName) in D:\j\workspace\windows-TGrou---f8ac6754\src\System.IO.FileSystem.DriveInfo\tests\DriveInfo.Windows.Tests.cs:line 35 ``` 27358 area-System.Security X509Certificate2 unclear error message when attempting to store certificate in non-existent store "Had a problem where my app would work fine locally, but fail when hosted on azure app services. I was trying to load a certificate from a file using ```new X509Certificate2(string fileName, string password)```. (Although hrom cursory research the error message is identically as ambiguous with other construction methods) The error message I received was: ``` Unhandled Exception: Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException: The system cannot find the file specified at Internal.Cryptography.Pal.CertificatePal.FromBlobOrFile(Byte[] rawData, String fileName, String password, X509KeyStorageFlags keyStorageFlags) at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(String fileName, String password, X509KeyStorageFlags keyStorageFlags) at System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(String fileName) at ConsoleApplication.Program.Main(String[] args) ``` The certificate was, indeed, present and was readable from the user running - so it's not an issue that the certificate can't be found! The actual error is, I believe, that it can't put the certificate the LocalUser's cert store. Info [here](http://web.archive.org/web/20151101033040/http://blog.tylerdoerksen.com:80/2013/08/23/pfx-certificate-files-and-windows-azure-websites/). I think the culprit is here https://github.com/dotnet/corefx/blob/29cd6a0b0ac2993cee23ebaf36ca3d4bce6dd75f/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/CertificatePal.Import.cs#L150-L152 I believe the last hresult from PFXImportCertStore will be CRYPT_E_NOT_FOUND ""can't find file"". Which causes ambiguity between ""can't find the given certificate file to import"" and ""got an error when trying to put the certificate after trying to put it in a store"". Not sure how you'd go about solving this as we're only returned CRYPT_E_NOT_FOUND for failed imports regardless of reason. Repro: 1. Create a web app that pulls a certificate from a file 2. ```new X509Certificate2(string fileName, string password)``` 3. Upload and run on azure app services 4. Pull hair out for 2h wondering why it can't find a file that blatantly exists. Workaround: Store it in the MachineKey set ```new X509Certificate2(filePath, pass, X509KeyStorageFlags.MachineKeySet);```" 27360 area-System.Net Fix fragment handling in HttpClient SocketsHttpHandler isn't sending fragments, nor is it properly inheriting the fragment from the original request URI into the redirect location URI when the original URI had one and the redirect URI did not, even though RFC 7231 says it must. This commit fixes that for SocketsHttpHandler. WinHttpHandler also isn't handling this inheritance according to the RFC. It appears that the logic for WinHttpHandler would actually need to be changed in WINHTTP itself, or else WinHttpHandler would need to be changed to do the redirects itself. Neither CurlHandler or NetFxHandler send fragments at all. This commit also fixes the test to correctly compare the expected and actual Uris... apparently Uri equality doesn't factor in fragments, so they're first converted to strings. It also updates the test to also validate that the server received the URI with the fragment included. Closes https://github.com/dotnet/corefx/issues/27305 cc: @geoffkizer, @davidsh, @wfurt, @rmkerr 27361 area-System.Drawing ToolboxBitmapAttributeTests.Ctor_FileName test failed on netfx "https://ci3.dot.net/job/dotnet_corefx/job/master/job/windows-TGroup_netfx+CGroup_Release+AGroup_x86+TestOuter_false_prtest/8667/consoleText ``` System.Drawing.Tests.ToolboxBitmapAttributeTests.Ctor_FileName(fileName: ""D:\\j\\workspace\\windows-TGrou---2a8f9c29\\bin\\t""..., size: {Width=16, Height=16}) [FAIL] System.ArgumentException : Parameter is not valid. Stack Trace: at System.Drawing.Image.get_Width() at System.Drawing.Image.get_Size() at System.Drawing.Tests.ToolboxBitmapAttributeTests.Ctor_FileName(String fileName, Size size) ```" 27362 area-System.Net Revisit SocketsHttpHandler's HttpConnection.WriteAsync buffering strategy "There's a note in the code: ""CONSIDER: May want to be a bit smarter here? Think about how large writes should work..."" cc: @geoffkizer " 27363 area-System.Net AllowAutoRedirect_True_ValidateNewMethodUsedOnRedirection test failed on Windows https://mc.dot.net/#/user/ahsonkhan/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/e0a26daab80419c10a37646444d5155d5495d241/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandlerTest~2FAllowAutoRedirect_True_ValidateNewMethodUsedOnRedirection(statusCode:%20307,%20oldMethod:%20%5C%22POST%5C%22,%20newMethod:%20%5C%22POST%5C%22,%20useTE:%20False) ```text System.Net.Http.HttpRequestException : Error while copying content to a stream. ---- System.IO.IOException : The write operation failed, see inner exception. -------- System.Net.Http.WinHttpException : The connection with the server was terminated abnormally ``` ```text at System.Net.Http.HttpContent.CopyToAsyncCore(Task copyTask) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\src\System\Net\Http\HttpContent.cs:line 351 at System.Net.Http.WinHttpHandler.InternalSendRequestBodyAsync(WinHttpRequestState state, Boolean chunkedModeForSend) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 1361 at System.Net.Http.WinHttpHandler.StartRequest(WinHttpRequestState state) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 860 at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 488 at System.Net.Http.Functional.Tests.HttpClientHandlerTest.<>c__DisplayClass51_2.<<AllowAutoRedirect_True_ValidateNewMethodUsedOnRedirection>b__1>d.MoveNext() in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.cs:line 654 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.CreateServerAsync(Func`2 funcAsync, Options options) in D:\j\workspace\windows-TGrou---74aa877a\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 66 at System.Net.Http.Functional.Tests.HttpClientHandlerTest.<>c__DisplayClass51_1.<<AllowAutoRedirect_True_ValidateNewMethodUsedOnRedirection>b__0>d.MoveNext() in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.cs:line 628 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.CreateServerAsync(Func`2 funcAsync, Options options) in D:\j\workspace\windows-TGrou---74aa877a\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 66 at System.Net.Http.Functional.Tests.HttpClientHandlerTest.AllowAutoRedirect_True_ValidateNewMethodUsedOnRedirection(Int32 statusCode, String oldMethod, String newMethod, Boolean useTE) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.cs:line 612 --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Net.Http.HttpContent.CopyToAsyncCore(Task copyTask) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\src\System\Net\Http\HttpContent.cs:line 347 ----- Inner Stack Trace ----- at System.Environment.get_StackTrace() in D:\j\workspace\windows-TGrou---74aa877a\src\System.Runtime.Extensions\src\System\Environment.cs:line 146 at System.Runtime.ExceptionServices.ExceptionStackTrace.AddCurrentStack(Exception exception) in D:\j\workspace\windows-TGrou---74aa877a\src\Common\src\System\Runtime\ExceptionServices\ExceptionStackTrace.cs:line 23 at System.Net.Http.WinHttpException.CreateExceptionUsingError(Int32 error) in D:\j\workspace\windows-TGrou---74aa877a\src\Common\src\System\Net\Http\WinHttpException.cs:line 56 at System.Net.Http.WinHttpRequestCallback.OnRequestError(WinHttpRequestState state, WINHTTP_ASYNC_RESULT asyncResult) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpRequestCallback.cs:line 324 at System.Net.Http.WinHttpRequestCallback.RequestCallback(IntPtr handle, WinHttpRequestState state, UInt32 internetStatus, IntPtr statusInformation, UInt32 statusInformationLength) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpRequestCallback.cs:line 104 at System.Net.Http.WinHttpRequestCallback.WinHttpCallback(IntPtr handle, IntPtr context, UInt32 internetStatus, IntPtr statusInformation, UInt32 statusInformationLength) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpRequestCallback.cs:line 47 at Interop.WinHttp.WinHttpWriteData(SafeWinHttpHandle requestHandle, IntPtr buffer, UInt32 bufferSize, IntPtr parameterIgnoredAndShouldBeNullForAsync) at Interop.WinHttp.WinHttpWriteData(SafeWinHttpHandle requestHandle, IntPtr buffer, UInt32 bufferSize, IntPtr parameterIgnoredAndShouldBeNullForAsync) at System.Net.Http.WinHttpRequestStream.InternalWriteDataAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken token) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpRequestStream.cs:line 245 at System.Net.Http.WinHttpRequestStream.InternalWriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken token) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpRequestStream.cs:line 203 at System.Net.Http.WinHttpRequestStream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken token) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpRequestStream.cs:line 131 at System.Net.Http.HttpContent.CopyToAsync(Stream stream, TransportContext context, CancellationToken cancellationToken) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\src\System\Net\Http\HttpContent.cs:line 327 at System.Net.Http.HttpContent.CopyToAsync(Stream stream, TransportContext context) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\src\System\Net\Http\HttpContent.cs:line 310 at System.Net.Http.WinHttpHandler.InternalSendRequestBodyAsync(WinHttpRequestState state, Boolean chunkedModeForSend) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 1361 at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in E:\A\_work\1994\s\src\mscorlib\src\System\Runtime\CompilerServices\AsyncMethodBuilder.cs:line 922 at System.Net.Http.WinHttpHandler.InternalSendRequestBodyAsync(WinHttpRequestState state, Boolean chunkedModeForSend) at System.Net.Http.WinHttpHandler.StartRequest(WinHttpRequestState state) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 860 at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in E:\A\_work\1994\s\src\mscorlib\shared\System\Threading\ExecutionContext.cs:line 166 at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext() in E:\A\_work\1994\s\src\mscorlib\src\System\Runtime\CompilerServices\AsyncMethodBuilder.cs:line 546 at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in E:\A\_work\1994\s\src\mscorlib\shared\System\Threading\ExecutionContext.cs:line 166 at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) in E:\A\_work\1994\s\src\mscorlib\src\System\Threading\Tasks\Task.cs:line 2440 at System.Threading.ThreadPoolWorkQueue.Dispatch() in E:\A\_work\1994\s\src\mscorlib\src\System\Threading\ThreadPool.cs:line 588 --- End of stack trace from AddCurrentStack --- ``` 27364 area-System.Net Specify sub protocol for WebSocket Client _From @andylyonette on February 21, 2018 16:51_ Hi, I can't work out how to specify the sub protocol when creating a client connect to a websocket endpoint. Is this possible like it is with this JavaScript client? (https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_client_applications) Thanks, Andy _Copied from original issue: aspnet/Home#2892_ 27365 area-System.Diagnostics TestStartWithUserName forgot to Dispose() the result of RemoteInvoke() ``` 2018-02-22 11:54:49,269: INFO: proc(54): run_and_log_output: Output: Unhandled Exception: Xunit.Sdk.TrueException: A test System.Diagnostics.Process.Tests, Version=4.2.1.0, Culture=neutral, PublicKeyToken=9d77cc7ad39b68eb!System.Diagnostics.Tests.ProcessTests.TestStartWithUserName forgot to Dispose() the result of RemoteInvoke() 2018-02-22 11:54:49,269: INFO: proc(54): run_and_log_output: Output: Expected: True 2018-02-22 11:54:49,269: INFO: proc(54): run_and_log_output: Output: Actual: False 2018-02-22 11:54:49,269: INFO: proc(54): run_and_log_output: Output: at Xunit.Assert.True(Nullable`1 condition, String userMessage) 2018-02-22 11:54:49,270: INFO: proc(54): run_and_log_output: Output: at System.Diagnostics.RemoteExecutorTestBase.RemoteInvokeHandle.Dispose(Boolean disposing) in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_true_prtest/src/CoreFx.Private.TestUtilities/src/System/Diagnostics/RemoteExecutorTestBase.cs:line 212 2018-02-22 11:54:49,271: INFO: proc(54): run_and_log_output: Output: at System.Diagnostics.RemoteExecutorTestBase.RemoteInvokeHandle.Finalize() in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_true_prtest/src/CoreFx.Private.TestUtilities/src/System/Diagnostics/RemoteExecutorTestBase.cs:line 258 ``` cc: @danmosemsft, @maryamariyan 27366 area-System.Runtime EnvironmentTests+<>c.<FailFast_ExpectFailureExitCode>b__21_0 forgot to Dispose() the result of RemoteInvoke() "https://mc.dot.net/#/user/bartonjs/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/481f6f62c7f54058bd8e5d25ab175d3b77f711ea/workItem/System.Runtime.Extensions.Tests/wilogs ``` 2018-02-22 16:30:18,821: INFO: proc(54): run_and_log_output: Output: Unhandled Exception: Xunit.Sdk.TrueException: A test System.Runtime.Extensions.Tests, Version=4.2.1.0, Culture=neutral, PublicKeyToken=9d77cc7ad39b68eb!System.Tests.EnvironmentTests+<>c.<FailFast_ExpectFailureExitCode>b__21_0 forgot to Dispose() the result of RemoteInvoke() 2018-02-22 16:30:18,821: INFO: proc(54): run_and_log_output: Output: Expected: True 2018-02-22 16:30:18,821: INFO: proc(54): run_and_log_output: Output: Actual: False 2018-02-22 16:30:18,822: INFO: proc(54): run_and_log_output: Output: at Xunit.Assert.True(Nullable`1 condition, String userMessage) 2018-02-22 16:30:18,823: INFO: proc(54): run_and_log_output: Output: at System.Diagnostics.RemoteExecutorTestBase.RemoteInvokeHandle.Dispose(Boolean disposing) in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_true_prtest/src/CoreFx.Private.TestUtilities/src/System/Diagnostics/RemoteExecutorTestBase.cs:line 212 2018-02-22 16:30:18,823: INFO: proc(54): run_and_log_output: Output: at System.Diagnostics.RemoteExecutorTestBase.RemoteInvokeHandle.Finalize() in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_true_prtest/src/CoreFx.Private.TestUtilities/src/System/Diagnostics/RemoteExecutorTestBase.cs:line 258 2018-02-22 16:30:19,580: INFO: proc(54): run_and_log_output: Output: /home/helixbot/dotnetbuild/work/e8585d9d-2db1-4361-9bb9-0fdcc3167640/Work/3d6117c8-79c6-4d5b-bd1b-2fa612c7ac00/Unzip/RunTests.sh: line 94: 18070 Aborted (core dumped) $RUNTIME_PATH/dotnet xunit.console.netcore.exe System.Runtime.Extensions.Tests.dll -xml testResults.xml -notrait category=nonnetcoreapptests -notrait category=nonlinuxtests -notrait category=failing 2018-02-22 16:30:19,728: INFO: proc(54): run_and_log_output: Output: Dumpling has not been installed yet. Please run ""DumplingHelper.py install_dumpling"" before collect_dumps. 2018-02-22 16:30:19,733: INFO: proc(54): run_and_log_output: Output: ~/dotnetbuild/work/e8585d9d-2db1-4361-9bb9-0fdcc3167640/Work/3d6117c8-79c6-4d5b-bd1b-2fa612c7ac00/Unzip ``` Many of the legs hit the same issue. cc: @danmosemsft, @maryamariyan " 27367 area-Serialization Need support reference in sgen #27281 27369 area-System.Threading Dataflow tests segfault on Fedora.27.Amd64-x64:Release "Dumpling is down, so we need a local repro. @kouvel do you have cycles to take a look? You can set up a repro box using the new system. LMK if you need a pointer. https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180222.04/workItem/System.Threading.Tasks.Dataflow.Tests/wilogs Fedora.27.Amd64-x64:Release ``` 2018-02-22 06:07:21,137: INFO: proc(54): run_and_log_output: Output: Discovering: System.Threading.Tasks.Dataflow.Tests 2018-02-22 06:07:21,366: INFO: proc(54): run_and_log_output: Output: Discovered: System.Threading.Tasks.Dataflow.Tests 2018-02-22 06:07:21,539: INFO: proc(54): run_and_log_output: Output: Starting: System.Threading.Tasks.Dataflow.Tests 2018-02-22 06:07:24,653: INFO: proc(54): run_and_log_output: Output: /home/helixbot/dotnetbuild/work/5bf3c2e2-9870-45cc-9dbf-4bc81eaddb1e/Work/aef23661-8b18-4137-b246-24dbb12648ba/Unzip/RunTests.sh: line 94: 24381 Aborted (core dumped) $RUNTIME_PATH/dotnet xunit.console.netcore.exe System.Threading.Tasks.Dataflow.Tests.dll -xml testResults.xml -notrait category=nonnetcoreapptests -notrait category=nonlinuxtests -notrait category=failing 2018-02-22 06:07:24,707: INFO: proc(54): run_and_log_output: Output: Dumpling has not been installed yet. Please run ""DumplingHelper.py install_dumpling"" before collect_dumps. 2018-02-22 06:07:24,711: INFO: proc(54): run_and_log_output: Output: ~/dotnetbuild/work/5bf3c2e2-9870-45cc-9dbf-4bc81eaddb1e/Work/aef23661-8b18-4137-b246-24dbb12648ba/Unzip 2018-02-22 06:07:24,713: INFO: proc(54): run_and_log_output: Output: ----- end 06:07:24 ----- exit code 134 ---------------------------------------------------------- ```" 27370 area-Serialization bypass the exceptions in sgen during the loop for each type Catch the exception [here](https://github.com/dotnet/corefx/blob/master/src/Microsoft.XmlSerializer.Generator/src/Sgen.cs#L231) 27371 area-System.IO Make File.Move copy when the file system doesn't support link Fixes https://github.com/dotnet/corefx/issues/26105. cc: @danmosemsft, @markekraus 27372 area-System.Security NRE in ManagedDecryptorPal.TryDecrypt This test is failing on all OSes [mc link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180222.04/workItem/System.Security.Cryptography.Pkcs.Tests/analysis/xunit/System.Security.Cryptography.Pkcs.EnvelopedCmsTests.Tests.DecryptTests~2FDecrypt_512_CekDoesNotDecrypt_FixedValue) EnvelopedCmsTests.Tests.DecryptTests/Decrypt_512_CekDoesNotDecrypt_FixedValue ``` Unhandled Exception of Type Xunit.Sdk.ThrowsException Message : Assert.Throws() Failure Expected: typeof(System.Security.Cryptography.CryptographicException) Actual: typeof(System.NullReferenceException): Object reference not set to an instance of an object. Stack Trace : at Internal.Cryptography.Pal.AnyOS.ManagedPkcsPal.ManagedDecryptorPal.TryDecrypt(RecipientInfo recipientInfo, X509Certificate2 cert, X509Certificate2Collection originatorCerts, X509Certificate2Collection extraStore, Exception& exception) in /Users/buildagent/agent/_work/381/s/corefx/src/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/AnyOS/ManagedPal.Decrypt.cs:line 85 at System.Security.Cryptography.Pkcs.EnvelopedCms.DecryptContent(RecipientInfoCollection recipientInfos, X509Certificate2Collection extraStore) in /Users/buildagent/agent/_work/381/s/corefx/src/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/EnvelopedCms.cs:line 230 at System.Security.Cryptography.Pkcs.EnvelopedCmsTests.Tests.DecryptTests.VerifySimpleDecrypt(Byte[] encodedMessage, CertLoader certLoader, ContentInfo expectedContent) in /Users/buildagent/agent/_work/381/s/corefx/src/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/DecryptTests.cs:line 279 ``` 27374 area-System.Net Test failure: System.Net.Http.Functional.Tests.HttpCookieProtocolTests / GetAsyncWithRedirect_ReceiveSetCookie_CookieSent "## Failure type ""The server returned an invalid or unrecognized response"" https://mc.dot.net/#/user/stephentoub/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/201009d077e71fcadbc44ddad6995a9b7fc37d7a/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpCookieProtocolTests~2FGetAsyncWithRedirect_ReceiveSetCookie_CookieSent ``` Unhandled Exception of Type System.Net.Http.HttpRequestException Message : System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.WinHttpException : The server returned an invalid or unrecognized response Stack Trace : at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) in D:\j\workspace\windows-TGrou---f8ac6754\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 469 at System.Net.Http.Functional.Tests.HttpCookieProtocolTests.<GetAsyncWithRedirect_ReceiveSetCookie_CookieSent>b__20_0(Uri url) in D:\j\workspace\windows-TGrou---f8ac6754\src\System.Net.Http\tests\FunctionalTests\HttpCookieProtocolTests.cs:line 464 at System.Net.Test.Common.LoopbackServer.<>c__DisplayClass11_0.<<CreateClientAndServerAsync>b__0>d.MoveNext() in D:\j\workspace\windows-TGrou---f8ac6754\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 84 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.CreateServerAsync(Func`2 funcAsync, Options options) in D:\j\workspace\windows-TGrou---f8ac6754\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 67 at System.Net.Http.Functional.Tests.HttpCookieProtocolTests.GetAsyncWithRedirect_ReceiveSetCookie_CookieSent() in D:\j\workspace\windows-TGrou---f8ac6754\src\System.Net.Http\tests\FunctionalTests\HttpCookieProtocolTests.cs:line 456 --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Threading.Tasks.RendezvousAwaitable`1.GetResult() in D:\j\workspace\windows-TGrou---f8ac6754\src\Common\src\System\Threading\Tasks\RendezvousAwaitable.cs:line 62 at System.Net.Http.WinHttpHandler.StartRequest(WinHttpRequestState state) in D:\j\workspace\windows-TGrou---f8ac6754\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 863 ``` ## Failure history Day | Build | OS | Details -- | -- | -- | -- 2/15 | 20180215.01 | Win10 | The server returned an invalid or unrecognized response - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180215.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpCookieProtocolTests~2FGetAsyncWithRedirect_ReceiveSetCookie_CookieSent) 2/21 | 20180221.01 | Win10 | The server returned an invalid or unrecognized response - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180221.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpCookieProtocolTests~2FGetAsyncWithRedirect_ReceiveSetCookie_CookieSent) 2/26 | 20180226.04 | Win10 | The server returned an invalid or unrecognized response - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180226.04/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpCookieProtocolTests~2FGetAsyncWithRedirect_ReceiveSetCookie_CookieSent) " 27375 area-System.Reflection Random hang/timeout in System.Reflection.Metadata.Tests in CI https://mc.dot.net/#/user/stephentoub/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/39ad031acb4bda1d91f5654e70e31fef299e50bd/workItem/System.Reflection.Metadata.Tests/wilogs ``` 2018-02-22 10:12:36,642: INFO: proc(54): run_and_log_output: Output: Discovering: System.Reflection.Metadata.Tests 2018-02-22 10:12:36,884: INFO: proc(54): run_and_log_output: Output: Discovered: System.Reflection.Metadata.Tests 2018-02-22 10:12:37,059: INFO: proc(54): run_and_log_output: Output: Starting: System.Reflection.Metadata.Tests ``` ... ``` 2018-02-22 10:32:35,798: ERROR: job(44): kill: Job running for too long. Killing... 2018-02-22 10:32:35,803: ERROR: executor(398): _execute_command: Executor timed out after 1200 seconds and was killed. 2018-02-22 10:32:35,803: INFO: event(43): send: Sending event type WorkItemTimeout 2018-02-22 10:32:35,876: INFO: saferequests(90): request_with_retry: Response complete with status code '201' 2018-02-22 10:32:35,877: INFO: executor(417): _execute_command: Finished _execute_command, exit code: -3 ``` 27377 area-System.Net add shutdown call to try to make redirect test more reliable Fixes #27363 (hopefully) @stephentoub @davidsh @dotnet/ncl 27379 area-System.Memory Optimize string-like portable Span APIs for Ordinal and OrdinalIgnoreCase This is specific to portable span (and not fast span). We do not need to allocate and call the string APIs when StringComparison is Ordinal or OrdinalIgnoreCase. Similar to APIs like EndsWith/etc., add a non-allocating code path for CompareTo for Ordinal: https://github.com/dotnet/corefx/blob/42d5370f8c6cec8d1961f54a0974e52b0562b0a7/src/System.Memory/src/System/MemoryExtensions.Portable.cs#L23 Also optimize for OrdinalIgnoreCase for all the string-like APIs. See: https://github.com/dotnet/corefx/pull/27319#discussion_r170048253 cc @tarekgh 27380 area-Infrastructure [release/2.1] Fix build on clang 5 (#27178) This is a port of https://github.com/dotnet/corefx/pull/27178 to the `release/2.1` branch. It lets us build corefx with clang 5. clang 5 is the default on some platforms supported by .NET Core 2.1, such as Fedora 27. 27382 area-System.Net Use SCH_USE_STRONG_CRYPTO with SystemDefaults "The current SslStream implementation was applying SCH_USE_STRONG_CRYPTO only when TLS1.2, TLS1.1 and/or TLS1.0 flags were set. In .NET Core 2.0, we introduced a new TLS option (#13075), called 'SystemDefault', which means to use the best (strongest) TLS security protocol available in the operating system. But since SystemDefault (equal to all flag bits set to zero) doesn't match any of the TLS bit masks, we weren't passing in the SCH_USE_STRONG_CRYPTO flag. This fix adds a check for SystemDefault and makes sure that the SCH_USE_STRONG_CRYPTO flag is passed to SCHANNEL. According to the SCHANNEL experts, the current ""SystemDefault' will actually use strong crypto settings on current Windows OS's. But they advised us that we should always pass in the SCH_USE_STRONG_CRYPTO flag when using 'SystemDefault'. This is related to internal bug 458042." 27383 area-System.Net Split up cookie headers that are added via HttpListenerResponse.WebHeaders.Add "This fixes an inconsistency between the Windows and Managed implementation of HttpListenerResponse. Basically, there are two ways to add cookies to an HttpListenerResponse. The 'usual' way is to add them to the cookie collection: ``` response.Cookies = cookies; ``` On Unix and on Windows that yields the following Set-Cookie header: ``` Set-Cookie: name1=value1, name2=value2 ``` In this case though the user is setting the headers by adding them directly: ``` foreach (var c in cookies) { HttpListenerResponse.Headers.Add(""Set-Cookie"",c); } ``` According to the relevant documentation for WebHeaderCollection.Add headers added more than once will be added in a comma separated list. So, even adding the headers directly, we expect the same result. That is true on Unix, and we get the following header: ``` Set-Cookie: name1=value1,name2=value2 ``` However, on Windows we see an unexpected result: ``` Set-Cookie: name1=value1 Set-Cookie: name2=value2 ``` While both behaviors are acceptable, I think that the Windows behavior was intentionally added. That is based off of this comment in the relevant code: https://github.com/dotnet/corefx/blob/3db29b721a45fb4f300e27c5df5750f57b38ec45/src/System.Net.HttpListener/src/System/Net/Windows/HttpListenerResponse.Windows.cs#L460-L482 This PR ensures that the managed implementation follows the same behavior as the Windows version. I think that should also update the documentation to reflect this behavior, since it seems to be by design. Fixes: #22910 " 27385 area-Infrastructure Adding to PackageIndex all of the information about our release from 6.0 and fixing packages that needed placeholders Fixes #27100 After shipping UAP 6.0 we didn't update the package index with this data so package validation has not been testing for breaks on packages that we will soon release. These changes include updating said index and reacting to the validation errors. cc: @weshaggard @ericstj @joshfree 27386 area-System.Runtime Is RuntimeInformation.OSArchitecture fixed on .NET 4.7.2? .NET 4.7.1 contains the embedded RuntimeInformation class which returns a wrong OSArchitecture. See https://github.com/Microsoft/perfview/issues/478#issuecomment-367845285 Is this fixed with the upcoming .NET 4.7.2? 27387 area-System.IO Stop FileSystem WriteAsync test from writing too much data to disk For https://github.com/dotnet/corefx/issues/24505 @danmosemsft PTAL 27389 area-Serialization Catch the FileNotFoundException when to get the obsolete attribute for type. #27370 @mconnew @zhenlan 27390 area-System.Net System.Net.Http.Functional.Tests.HttpCookieProtocolTests.GetAsyncWithRedirect_SetCookieContainer_CorrectCookiesSent [FAIL] NETFX https://github.com/dotnet/corefx/pull/27288#issuecomment-367821183 ``` System.Net.Http.Functional.Tests.HttpCookieProtocolTests.GetAsyncWithRedirect_SetCookieContainer_CorrectCookiesSent [FAIL] System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.WebException : The request was aborted: The request was canceled. Stack Trace: at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.Http.Functional.Tests.HttpCookieProtocolTests.<<GetAsyncWithRedirect_SetCookieContainer_CorrectCookiesSent>b__15_0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.Test.Common.LoopbackServer.<>c__DisplayClass11_0.<<CreateClientAndServerAsync>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.Test.Common.LoopbackServer.<CreateServerAsync>d__9.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.Http.Functional.Tests.HttpCookieProtocolTests.<GetAsyncWithRedirect_SetCookieContainer_CorrectCookiesSent>d__15.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) ----- Inner Stack Trace ----- at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar) ``` 27391 area-System.Security "System.Security.Cryptography.Pkcs.EnvelopedCmsTests.Tests.DecryptTests.Decrypt_512_CekDoesNotDecrypt_FixedValue failed with ""System.NullReferenceException""" failed test: System.Security.Cryptography.Pkcs.EnvelopedCmsTests.Tests.DecryptTests.Decrypt_512_CekDoesNotDecrypt_FixedValue detail: https://ci.dot.net/job/dotnet_corefx/job/master/job/outerloop_netcoreapp_centos7.1_debug/324/testReport/System.Security.Cryptography.Pkcs.EnvelopedCmsTests.Tests/DecryptTests/Decrypt_512_CekDoesNotDecrypt_FixedValue/ MESSAGE: ~~~ Assert.Throws() Failure\n Expected: typeof(System.Security.Cryptography.CryptographicException)\n Actual: typeof(System.NullReferenceException): Object reference not set to an instance of an object. ~~~ STACK TRACE: ~~~ at Internal.Cryptography.Pal.AnyOS.ManagedPkcsPal.ManagedDecryptorPal.TryDecrypt(RecipientInfo recipientInfo, X509Certificate2 cert, X509Certificate2Collection originatorCerts, X509Certificate2Collection extraStore, Exception& exception) in /mnt/resource/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_centos7.1_debug/src/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/AnyOS/ManagedPal.Decrypt.cs:line 85 at System.Security.Cryptography.Pkcs.EnvelopedCms.DecryptContent(RecipientInfoCollection recipientInfos, X509Certificate2Collection extraStore) in /mnt/resource/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_centos7.1_debug/src/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/EnvelopedCms.cs:line 230 at System.Security.Cryptography.Pkcs.EnvelopedCms.Decrypt(X509Certificate2Collection extraStore) in /mnt/resource/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_centos7.1_debug/src/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/EnvelopedCms.cs:line 188 at System.Security.Cryptography.Pkcs.EnvelopedCmsTests.Tests.DecryptTests.VerifySimpleDecrypt(Byte[] encodedMessage, CertLoader certLoader, ContentInfo expectedContent) in /mnt/resource/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_centos7.1_debug/src/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/DecryptTests.cs:line 279 at System.Security.Cryptography.Pkcs.EnvelopedCmsTests.Tests.DecryptTests.<>c__DisplayClass11_0.<Decrypt_512_CekDoesNotDecrypt_FixedValue>b__0() in /mnt/resource/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_centos7.1_debug/src/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/DecryptTests.cs:line 144 ~~~ 27392 area-System.Net Re-enable clearing of initlocals in System.Net.Sockets on Unix Temporarily disabled in https://github.com/dotnet/corefx/pull/27345 due to failures in ReceiveMessageFrom tests. Needs investigation. 27393 area-Serialization Area-Serialization Sprint 132 The issue is for tracking issues to be done in sprint 132 (due by 3/16/2018) 27394 area-System.Security Enable RSA-OAEP(SHA-2) and RSA-PSS on Unix systems This change provides an implementation of the OAEP padding algorithm and the PSS encoding and verification routines in managed code. On the platforms where we currently lack support for SHA-2-based OAEP and/or PSS the managed implementation will be used in conjunction with the native layer in a pre-padded operational context. The suite of tests which were added uncovered other bugs which are being addressed in this change, as well. Mainly that RSACng and RSASecurityTransforms both failed at encrypting zero-length data. To solve that problem the RSA padding class can build PKCS#1 encryption padding, but since the native layers are capable of correctly decrypting the payloads no unpadding code is needed at this time. Fixes #2522 Fixes #2523 Fixes #27120 27395 area-System.Security Add CU\My to the search path for resolving cert chains on Linux No test is being committed because it requires editing the user's CU\My store, which doesn't make me happy. This was tested by taking the CertificateRequest chain tests, saving the created intermediate to CU\My, removing the intermediate from ExtraStore, and then removing them at the end of the test. After the test succeeded on Windows (and failed on Linux), the fix was made on the Linux chain builder driver. Fixes #26020. 27396 area-Serialization Support NegativeInfinity and PositiveInfinity as default value in sgen Make the similar fix as #19724 for NegativeInfinity and PositiveInfinity 27400 area-System.Net System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpClientHandler_Authentication_Test.HttpClientHandler_MultipleAuthenticateHeaders_Succeeds failed in CI failed test: System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpClientHandler_Authentication_Test.HttpClientHandler_MultipleAuthenticateHeaders_Succeeds detail: https://ci.dot.net/job/dotnet_corefx/job/master/job/outerloop_netcoreapp_debian8.4_release/318/testReport/System.Net.Http.Functional.Tests/SocketsHttpHandler_HttpClientHandler_Authentication_Test/HttpClientHandler_MultipleAuthenticateHeaders_Succeeds_authenticateHeader____WWW_Authenticate__Basic_realm_____hello______r__nWWW_Aut______/ MESSAGE: ~~~ Assert.Equal() Failure\nExpected: OK\nActual: Unauthorized ~~~ STACK TRACE: ~~~ at System.Net.Http.Functional.Tests.HttpClientHandler_Authentication_Test.<>c.<<-ctor>b__10_0>d.MoveNext() in /mnt/resource/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_debian8.4_release/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Authentication.cs:line 29 --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.Functional.Tests.HttpClientHandler_Authentication_Test.<>c__DisplayClass7_0.<<HttpClientHandler_MultipleAuthenticateHeaders_Succeeds>b__0>d.MoveNext() in /mnt/resource/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_debian8.4_release/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Authentication.cs:line 89 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.CreateServerAsync(Func`2 funcAsync, Options options) in /mnt/resource/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_debian8.4_release/src/Common/tests/System/Net/Http/LoopbackServer.cs:line 66 at System.Net.Http.Functional.Tests.HttpClientHandler_Authentication_Test.HttpClientHandler_MultipleAuthenticateHeaders_Succeeds(String authenticateHeader) in /mnt/resource/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_debian8.4_release/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Authentication.cs:line 85 --- End of stack trace from previous location where exception was thrown --- ~~~ 27401 area-System.IO Path changes resulting in failing Common NormalizeDirectorySeparatorTests From https://mc.dot.net/#/user/dotnet-bot/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/4fb11f22f98f2106002799957aa0993cbf188b4e/workItem/Common.Tests/analysis/xunit/Tests.System.IO.PathInternalTests_Windows~2FNormalizeDirectorySeparatorTests(path:%20%5C%22%20%20%20%20~2F~2F%5C%22,%20expected:%20%5C%22%5C%5C%5C%5C%5C%5C%5C%5C%5C%22) ``` Unhandled Exception of Type Xunit.Sdk.EqualException Message : Assert.Equal() Failure ↓ (pos 0) Expected: \\\\ Actual: \\ ↑ (pos 0) Stack Trace : at Tests.System.IO.PathInternalTests_Windows.NormalizeDirectorySeparatorTests(String path, String expected) in D:\j\workspace\windows-TGrou---74aa877a\src\Common\tests\Tests\System\IO\PathInternal.Windows.Tests.cs:line 126 ``` Test disabled in #27398 27402 area-System.Diagnostics System.Diagnostics.Tests.ProcessTests.TestStartWithNormalUser failed in CI failed test: System.Diagnostics.Tests.ProcessTests.TestStartWithNormalUser detail: https://ci.dot.net/job/dotnet_corefx/job/master/job/osx10.12_debug/4450/testReport/System.Diagnostics.Tests/ProcessTests/TestStartWithNormalUser/ MESSAGE: Assert.NotNull() Failure STACK TRACE: ~~~ at System.Diagnostics.Tests.ProcessTests.GetCurrentRealUserName() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_debug/src/System.Diagnostics.Process/tests/ProcessTests.Unix.cs:line 373 at System.Diagnostics.Tests.ProcessTests.TestStartWithNormalUser() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_debug/src/System.Diagnostics.Process/tests/ProcessTests.Unix.cs:line 322 ~~~ 27403 area-System.Memory Add GetPosition overload to ReadOnlySequence that only takes an int/long Today GetPosition requires a relative offset but there are scenarios where you just want to get the position from the start. Today that looks like: ```C# // Get position 100 var position = sequence.GetPosition(sequence.Start, 100); ``` ## Proposal Add GetPosition that takes an int/long that assumes sequence.Start is the origin: ```C# var position = sequence.GetPosition(100); ``` /cc @pakrym @KrzysztofCwalina @ahsonkhan @terrajobst @halter73 27405 area-System.Security X509Certificate2Collection.Find() does not return the same certificates as full framework Hi, I have a strange issue with handling of certificates from the windows certificate store. On full .NET framework, this code returns the expected certificates, on dotnet core, the very same code does not return any certificates from the store. The code is the following: ``` var certificates = new List<X509Certificate2>(); using (var myStore = new X509Store(StoreName.My, StoreLocation.CurrentUser)) { myStore.Open(OpenFlags.ReadOnly); var certsWithCorrectUsage = myStore.Certificates.Find(X509FindType.FindByKeyUsage, X509KeyUsageFlags.DataEncipherment.ToString(), true); foreach (var cert in certsWithCorrectUsage) { if (cert.HasPrivateKey) { certificates.Add(cert); } } } return certificates; ``` When debugging into the `.Find()` method I get down into `FindPal.VerifyCertificateIgnoringErrors()`, and there on the `chainPal.ChainStatus` I see the following error messages: ``` The signature of the certificate cannot be verified. A certificate chain processed, but terminated in a root certificate which is not trusted by the tust provider. ``` I used the following powershell script to generate a root certificate, install it in the Trusted Root Certification Authorities, and create two other test certificates which are signed by this root cert: [createcerts.ps1.txt](https://github.com/dotnet/corefx/files/1751455/createcerts.ps1.txt) Why doesn't the code on dotnet core find the root certificate, while it obviously seems to be trusted by my machine and also the full framework finds these certificates as valid for the requested purpose. 27406 area-System.Net ReceiveAsync_AfterCancellationDoReceiveAsync_ThrowsWebSocketException sporadically failing in CI e.g. https://mc.dot.net/#/user/geoffkizer/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/edf649a71bbe7c160274113d0f1c5349f1b266d1/workItem/System.Net.WebSockets.Client.Tests/analysis/xunit/System.Net.WebSockets.Client.Tests.CancelTest~2FReceiveAsync_AfterCancellationDoReceiveAsync_ThrowsWebSocketException(server:%20ws:~2F~2Fcorefx-net.cloudapp.net~2FWebSocket~2FEchoWebSocket.ashx) ``` Unhandled Exception of Type Xunit.Sdk.ThrowsException Message : Assert.Throws() Failure Expected: typeof(System.OperationCanceledException) Actual: typeof(System.Net.WebSockets.WebSocketException): The remote party closed the WebSocket connection without completing the close handshake. Stack Trace : at System.Net.WebSockets.ManagedWebSocket.ReceiveAsyncPrivate[TWebSocketReceiveResultGetter,TWebSocketReceiveResult](Memory`1 payloadBuffer, CancellationToken cancellationToken, TWebSocketReceiveResultGetter resultGetter) in /mnt/j/workspa ``` 27407 area-System.Net Fix ManagedWebSocket cancellation race condition When a cancelable cancellation token is passed to Receive/SendAsync, the code registers with the token to abort the web socket. The resulting exception is then translated into an OperationCanceledException if _abort is true. But this logic doesn't count on the possibility that the underlying Read/WriteAsync on the transport stream could actually throw a cancellation exception. If it does, there's a race condition as to whether the web socket's abort flag will be set in time; if it is, we wrap the cancellation exception in another cancellation exception, and if it's not, we treat it as a non-cancellation exception. This commit fixes that, by explicitly allowing OperationCanceledExceptions to proceed uninterrupted. This should fix the ReceiveAsync_AfterCancellationDoReceiveAsync_ThrowsWebSocketException test, which recently started failing sporadically, I believe because we improved the cancellation support in SocketsHttpHandler, on top of which ClientWebSocket now sits. Fixes https://github.com/dotnet/corefx/issues/27406 cc: @geoffkizer, @davidsh, @wfurt, @anurse 27410 area-System.Memory Use TrailingZeroCount rather than LocateLastFoundByte `Bmi1.TrailingZeroCount` isn't currently supported; so can't test, so this is mostly for feedback ```csharp return i * 8 + (int)Bmi1.TrailingZeroCount(candidate) >> 3; ``` Using `LeadingZeroCount` ended up more instructions than the current flow ```csharp return i * 8 + (int)(((match ^ (match - 1)) * XorPowerOfTwoToHighByte) >> 57) ``` Changing multiply to Lzcnt and subtraction ```csharp return i * 8 + (63 - (int)Lzcnt.LeadingZeroCount((candidate ^ (candidate - 1)))) >> 3; ``` /cc @fiigii @tannergooding 27411 area-System.Net Re-enable initlocals clearing in System.Net.Sockets on Unix We disabled it because some ReceiveMessageFrom tests were failing. The issue turned out to be that we weren't explicitly clearing an IPPacketInformation struct before handing it to native code, and the native code wasn't clearing it. This fixes that (https://github.com/dotnet/corefx/pull/27411/files#diff-74b2e83ee829756a9dc8177b5154b7f7R50). Along with it, I initialized a few other variables, just for good measure. Fixes https://github.com/dotnet/corefx/issues/27392 cc: @erozenfeld, @geoffkizer 27412 area-System.Memory TryGetArray(ReadOnlyMemory<T>.Empty) returns false This is an API quirk I ran into when using `ReadOnlyMemory<byte>` to do some parsing the other in SignalR. ```C# var isArray = MemoryMarshal.TryGetArray(ReadOnlyMemory<byte>.Empty, out var array); Console.WriteLine(isArray); ``` This prints false and I think it should print true. We should back the Empty read only memory with an empty array as it makes it easier to interop with systems that expect arrays. /cc @KrzysztofCwalina @ahsonkhan @stephentoub @jkotas 27413 area-System.Net Don't reset content stream position on CurlHandler. fixes #23782 @dotnet/ncl 27416 area-System.Data Improve SqlDataRecord test coverage Improve SqlDataRecord test coverage. cc @remibou 27417 area-System.Runtime [System.Runtime.InteropServices] Introduce broader platform definitions. "Unity, Xamarin and Mono users suffers from a historic problem with platform detection. This patch introduces definitions for all the existing platforms that .NET supports beyond .NET Core via Unity and Xamarin. To cope with the historical setting that OSX has been used in existing code to probe for an Apple OS (iOS, tvOS, watchOS), we introduce new values for all four apple platforms (macOS, iOS, tvOS, watchOS) and also return true when probed for the legacy OSX setting. The same principle is applied to Linux, we will continue to return true, but the more specific versions of Tizen and Android are supported. The list has been expanded to all the platforms currently supported by Mono and Unity. # Proposed Changes The System.Runtime.InteropServices.OSPlatform is updated to surface the following public definitions: ```csharp public static OSPlatform Android { get; } = new OSPlatform(""ANDROID""); public static OSPlatform iOS { get; } = new OSPlatform(""IOS""); // Returns true for Linux, Tizen and Android systems public static OSPlatform Linux { get; } = new OSPlatform(""LINUX""); public static OSPlatform macOS { get; } = new OSPlatform(""MACOS""); public static OSPlatform N3DS { get; } = new OSPlatform(""3DS""); // This one has historically been used as ""Apple platforms"", so it returns true // on iOS, tvOS, macOS, watchOS. public static OSPlatform OSX { get; } = new OSPlatform(""OSX""); public static OSPlatform PlayStation4 { get; } = new OSPlatform(""PS4""); public static OSPlatform PlayStationPortable2 { get; } = new OSPlatform(""PSP2""); public static OSPlatform PlayStationVita { get; } = new OSPlatform(""PSVITA""); public static OSPlatform Switch { get; } = new OSPlatform(""SWITCH""); public static OSPlatform Tizen { get; } = new OSPlatform(""TIZEN""); public static OSPlatform tvOS { get; } = new OSPlatform(""TVOS""); public static OSPlatform watchOS { get; } = new OSPlatform(""WATCHOS""); public static OSPlatform WebAssembly { get; } = new OSPlatform(""WEBASSEMBLY""); public static OSPlatform WiiU { get; } = new OSPlatform(""WIIU""); public static OSPlatform Windows { get; } = new OSPlatform(""WINDOWS""); public static OSPlatform XboxOne { get; } = new OSPlatform(""XBOXONE""); ``` Additionally, `RuntimeInformation`'s `IsOSPlatform` method is modified to cope with the aliasing described before, and Android and Tizen systems are Linux systems, and macOS, tvOS, iOS and watchOS are reported as OSX systems. Twist: we could make OSX deprecated as well, and introduce an additional AppleOS definition or a Darwin definition to cover Apple-based OSes. # PR A pull request with the first batch is available here: https://github.com/dotnet/corefx/pull/27378 " 27418 area-System.IO API Proposal: Path Span APIs that write into a specified buffer We've added `System.IO.Path` overloads that take spans and output strings. To facilitate additional scenarios we should create overloads that allow you to specify the buffer to write to, rather than creating a string. `Path.GetFullPath` and `Path.Combine` are the key APIs here. We've added the following for 2.1: ``` C# namespace System.IO { public static class Path { public static bool TryJoin(ReadOnlySpan<char> path1, ReadOnlySpan<char> path2, Span<char> destination, out int charsWritten); public static bool TryJoin(ReadOnlySpan<char> path1, ReadOnlySpan<char> path2, ReadOnlySpan<char> path3, Span<char> destination, out int charsWritten) } } ``` What we'd like to consider adding: ``` C# namespace System.IO { public static class Path { public static bool TryGetTempPath(Span<char> destination, out int charsWritten); public static bool TryGetRandomFileName(Span<char> destination, out int charsWritten); public static bool TryGetRelativePath(ReadOnlySpan<char> relativeTo, ReadOnlySpan<char> path, Span<char> destination, out int charsWritten); public static bool TryGetFullPath(ReadOnlySpan<char> path, Span<char> destination, out int charsWritten); public static bool TryGetFullPath(ReadOnlySpan<char> path, ReadOnlySpan<char> basePath, Span<char> destination, out int charsWritten); } } ``` ### Notes - Often we know what the needed buffer size will likely be, how do / should we express that from the API? - We don't know positively as the current working directory can be changed, so the char count _can_ change 27419 area-Infrastructure Update BuildTools to 2.1.0-preview2-02522-03 This version includes a fix to start unblocking dependency auto-update flow after GitHub stopped allowing weak cryptographic standards yesterday. dotnet/core-eng#2734 27422 area-System.IO Add default threshold size to pipe To prevent people from getting OOM. I think 64k is large enough. /cc @davidfowl @KrzysztofCwalina 27423 area-System.Data SqlConnection.GetSchema() Throws Exception in Release Build "In a UWP app, SqlConnection.GetSchema(string, string[] args) will throw an ""ArgumentNull"" exception in a release build, with or without code optimization. Same exact GetSchema() call works fine in debug builds. I can also otherwise successfully connect and query the server (a remote machine). Tried SQL Server versions 2012 & 2017. Specific Exception is a System.AggregateException, with an Inner Exception of ArgumentNull: ""value cannot be null. Parameter name: xmlStream."" Sample app is [here](https://github.com/tuggernuts/GetSchema) Using Visual Studio 15.5.7, targeting build 16299." 27424 area-System.Data Improve SqlDataRecord test coverage Improved code coverage (+83 lines), added some tests for edge case, see #27416 Fixes #27416 cc @saurabh500 27425 area-Serialization Add references parameter for sgen. #27367 @zhenlan @mconnew @yujayee 27428 area-System.Net add basic and digest authentication for tunnel/https proxy in SocketHttpHandler this allows https request to go through proxy requiring basic or digest authentication. Note, that this builds on top of some pending changes and it will not work on its own. There is now unit test yet as that also depending PR. I'm going to add more tests as follow-op PR. If preferable I think I can refactor this more and get more sharing with AuthenticationHandler code and existing proxy. But this change works and I wanted to get more feedback. Also note, that we will throw if authentication to proxy fails. That is different from existing handlers. At least curl will return failed response to the caller. 27430 area-System.Memory Add tests for empty array in Memory/MemoryMarshal Depends on https://github.com/dotnet/coreclr/pull/16529 27431 area-Microsoft.CSharp Are exceptions from failed dynamic binding clear enough? "When you use `dynamic` incorrectly, the resulting `RuntimeBinderException` can be fairly confusing. Can the situation be improved? For example, consider this code (based on code from a confused user from https://github.com/dotnet/docs/issues/4487): ```c# dynamic fileContent = 42; new System.Net.Http.StringContent(fileContent, Encoding.UTF8, ""application/base64""); ``` This throws: ``` Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: The best overloaded method match for 'System.Net.Http.StringContent.StringContent(string, System.Text.Encoding, string)' has some invalid arguments at CallSite.Target(Closure , CallSite , Type , Object , Encoding , String ) at System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at UserQuery.RunUserAuthoredQuery() ``` To somebody who does not know how `dynamic` is implemented, this exception is going to be very confusing, because: * There is almost no indication that this exception is related to `dynamic` (except for the `System.Dynamic` namespace in the stack trace). * There is no indication regarding which arguments are invalid. * Nitpick: The error message talks about overloaded method, when it's actually a constructor. Since the exception type can't really be changed because of backwards compatibility, that leaves the exception message. Maybe it could be changed to something like the following? > Error in dynamic binding: The best overloaded constructor match for 'System.Net.Http.StringContent.StringContent(string, System.Text.Encoding, string)' has some invalid arguments: > Argument 1: cannot convert from 'int' to 'string' Do you agree that this is something that should be improved? Is changing the error message to something like the above the way to go?" 27433 area-System.ComponentModel NETCore System.ComponentModel.Composition (MEF1) fails "Hi. Could you help me to make a simple example with mef1? Thank you in advance. My system is Archlinux x64. I'm using component from myget.org (dotnet add package System.ComponentModel.Composition --version 4.5.0-preview2-26223-06 --source https://dotnet.myget.org/F/dotnet-core/api/v3/index.json). My code is here: ``` dotnet --version 2.1.4 ``` ``` pwd /at/c# ``` Contract (in /at/c#/example_console_mef_contract): ```csharp cat /at/c#/example_console_mef_contract/Class1.cs using System; namespace example_console_mef_contract { public interface IHelloWorld { string HelloWorld(); } } ``` Library aka plugin (in /at/c#/example_console_mef_lib). Csproj file includes a reference to contract project. ```csharp cat /at/c#/example_console_mef_lib/Class1.cs using System; using System.ComponentModel.Composition; using System.ComponentModel.Composition.Hosting; using System.Reflection; using example_console_mef_contract; namespace example_console_mef_lib { [Export(typeof(example_console_mef_contract.IHelloWorld))] public class MefHelloWorld : IHelloWorld { public string HelloWorld() { return ""Hello world""; } } } ``` ``` cat /at/c#/example_console_mef_lib/example_console_mef_lib.csproj <Project Sdk=""Microsoft.NET.Sdk""> <PropertyGroup> <TargetFramework>netstandard2.0</TargetFramework> </PropertyGroup> <ItemGroup> <PackageReference Include=""System.ComponentModel.Composition"" Version=""4.5.0-preview2-26223-06"" /> </ItemGroup> <ItemGroup> **<ProjectReference Include=""/at/c#/example_console_mef_contract/example_console_mef_contract.csproj"" />** </ItemGroup> </Project> ``` Main application (in /at/c#/example_console_mef). Csproj file includes a reference to contract project. ```csharp cat /at/c#/example_console_mef/Program.cs using System; using System.ComponentModel.Composition; using System.ComponentModel.Composition.Hosting; using System.Reflection; using example_console_mef_contract; namespace example_console_mef { class Program { private CompositionContainer _container; [Import(typeof(example_console_mef_contract.IHelloWorld))] private example_console_mef_contract.IHelloWorld helloWorld; private Program() { var catalog = new AggregateCatalog(); catalog.Catalogs.Add(new AssemblyCatalog(typeof(Program).Assembly)); catalog.Catalogs.Add(new DirectoryCatalog(@""/at/c#/example_console_mef_lib/bin/Debug/netstandard2.0"")); _container = new CompositionContainer(catalog); try { this._container.ComposeParts(this); } catch (CompositionException compositionException) { Console.WriteLine(compositionException.ToString()); } } static void Main(string[] args) { Program p = new Program(); // Console.WriteLine(p.helloWorld.HelloWorld()); // Console.ReadKey(); } } } ``` ``` cat /at/c#/example_console_mef/example_console_mef.csproj <Project Sdk=""Microsoft.NET.Sdk""> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>netcoreapp2.0</TargetFramework> </PropertyGroup> <ItemGroup> <PackageReference Include=""System.ComponentModel.Composition"" Version=""4.5.0-preview2-26223-06"" /> </ItemGroup> <ItemGroup> **<ProjectReference Include=""/at/c#/example_console_mef_contract/example_console_mef_contract.csproj"" />** </ItemGroup> </Project> ``` Contract and library projects compiled without errors. Now I try run main application but it fails: ``` cd /at/c#/example_console_mef dotnet run System.ComponentModel.Composition.ChangeRejectedException: The composition remains unchanged. The changes were rejected because of the following error(s): The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information. 1) No exports were found that match the constraint: ContractName example_console_mef_contract.IHelloWorld RequiredTypeIdentity example_console_mef_contract.IHelloWorld Resulting in: Cannot set import 'example_console_mef.Program.helloWorld (ContractName=""example_console_mef_contract.IHelloWorld"")' on part 'example_console_mef.Program'. Element: example_console_mef.Program.helloWorld (ContractName=""example_console_mef_contract.IHelloWorld"") --> example_console_mef.Program at System.ComponentModel.Composition.CompositionResult.ThrowOnErrors(AtomicComposition atomicComposition) at System.ComponentModel.Composition.Hosting.ComposablePartExportProvider.Compose(CompositionBatch batch) at example_console_mef.Program..ctor() in /at/c#/example_console_mef/Program.cs:line 26 ```" 27434 area-System.Memory Complete debugger story for ReadOnlySequence We need to add implementation for `ReadOnlySequence<char>` same as in `Span<char>` and `Memory<char>`. We also need a better way to display positions - with masks removed, possibly segments visualized. /cc @ahsonkhan @davidfowl @KrzysztofCwalina 27435 area-System.IO Remove RunningIndex add a way for IMemoryList to provide seek implementation "Addresses https://github.com/dotnet/corefx/issues/26603 Right now `ReadOnlySequence` walks linked list of segments to implement `GetPosition` operation. We could envision other implementation that could provide better performance in some cases. This API suggestion focuses on delegating more functionality to `IMemoryList`. I propose the following change: ``` diff public interface IMemoryList<T> { - public long RunningIndex { get; } + /// Returns <see cref=""IMemoryList{T}""/> that contains <typeparamref name=""T""/> item offset from beginning of current <see cref=""IMemoryList{T}""/> by <paramref name=""offset""/>. + /// <paramref name=""localIndex""/> would contain index inside returned <see cref=""IMemoryList{T}""/> + public IMemoryList<T> GetNext(long offset, out int localIndex); + /// Returns count of items between start of this <see cref=""IMemoryList{T}""/> to <paramref name=""memoryList""/>. + public long GetLength(IMemoryList<T> memoryList); } ``` Has additional benefit of doing less interface calls per operation (GetLength 2->1, GetPosition N->1). /cc @terrajobst @KrzysztofCwalina @davidfowl " 27436 area-System.IO [WIP] Prototype removing RunningLength and delegating seek to IMemoryList API Review issue: https://github.com/dotnet/corefx/issues/27435 /cc @davidfowl @KrzysztofCwalina @ahsonkhan 27439 area-System.Data Dont allow exceptions to emerge on the threadpool PoolCreateRequest handles creation of new connections on the thread pool. However when an exception occurs, it is bubbled up to the thread pool. This is a regression from .Net Framework and causes applications using Min Pool Size to crash. The solution is to catch all exceptions during connection open and to swallow them. This will not change the exception that app sees from Connection Pool, as the error is bubbled up from another code path where the errorWaitHandle is set during connection Open. The test added, makes sure that we can open 3 bad connections using MinPoolSize. Before the fix, the test would crash after the first exception. Fixes https://github.com/dotnet/corefx/issues/14615 27440 area-System.Net Test issue: AllowAutoRedirect_True_PostToGetDoesNotSendTE fails occasionally on WinHttpHandler Something about how the loopback server is sending the response before the request is fully received, and/or the way the server is shutting down the connection, causes occasional failures with WinHttpHandler. The specific error is: System.Net.Http.HttpRequestException : Error while copying content to a stream. ---- System.IO.IOException : The write operation failed, see inner exception. -------- System.Net.Http.WinHttpException : The connection with the server was terminated abnormally We should change the test so that the server behaves in a way that makes WinHttpHandler happy. 27441 area-System.Net revert change to existing redirect test and split into new test Fixes #27363 I've reverted the additions I made to the AllowAutoRedirect_True_ValidateNewMethodUsedOnRedirection test and instead split them into a separate test, which is disabled for WinHttpHandler (issue #27440 to track). @stephentoub @davidsh @ahsonkhan @dotnet/ncl 27442 area-System.Security Test failure: System.Security.Cryptography.Pkcs.EnvelopedCmsTests.Tests.DecryptTests/Decrypt_512_NoData_FixedValue Opened on behalf of @danmosemsft Note this is on .NET Framework. The test `System.Security.Cryptography.Pkcs.EnvelopedCmsTests.Tests.DecryptTests/Decrypt_512_NoData_FixedValue` has failed. ``` Assert.Equal() Failure\r Expected: Byte[] []\r Actual: Byte[] [0, 0, 0, 0, 0, ...] Stack Trace: at System.Security.Cryptography.Pkcs.EnvelopedCmsTests.Tests.DecryptTests.VerifySimpleDecrypt(Byte[] encodedMessage, CertLoader certLoader, ContentInfo expectedContent) ``` Build : Master - 20180224.02 (Full Framework Tests) Failing configurations: - Windows.10.Amd64-x86 - Release - Windows.10.Amd64-x64 - Release @bartonjs 27445 area-System.Threading Allocation-free awaitable async operations with ValueTask<T> and ValueTask ## Background `ValueTask<T>` is currently a discriminated union of a `T` and a `Task<T>`. This lets APIs that are likely to complete synchronously and return a value do so without allocating a `Task<T>` object to carry the result value. However, operations that complete asynchronously still need to allocate a `Task<T>`. There is no non-generic `ValueTask` counterpart today because if you have an operation that completes synchronously and successfully, you can just return `Task.CompletedTask`, no allocation. That addresses the 80% case where synchronously completing operations no longer allocate. But for cases where you want to strive to address the 20% case of operations completing asynchronously and still not allocating, you’re forced to play tricks with custom awaitables, which are one-offs, don’t compose well, and generally aren’t appropriate for public surface area. `Task` and `Task<T>`, by design, never go from a completed to incomplete state, meaning you can’t reuse the same object; this has many usability benefits, but for APIs that really care about that last pound of performance, in particular around allocations, it can get in the way. We have a bunch of new APIs in .NET Core 2.1 that return `ValueTask<T>`s, e.g. `Stream.ReadAsync`, `ChannelReader.ReadAsync`, `PipeReader.ReadAsync`, etc. In many of these cases, we’ve simply accepted that they might allocate; in others, custom APIs have been introduced specific to that method. Neither of these is a good place to be. ## Proposal I have implemented a new feature in `ValueTask<T>` and a counterpart non-generic `ValueTask` that lets these not only wrap a `T` result or a `Task<T>`, but also another arbitrary object that implements the `IValueTaskSource<T>` interface (or `IValueTaskSource` for the non-generic `ValueTask`). An implementation of that interface can be reused, pooled, etc., allowing for an implementation that returns a `ValueTask<T>` or `ValueTask` to have amortized non-allocating operations, both synchronously completing and asynchronously completing. ### The enabling APIs First, we need to add these interfaces: ```C# namespace System.Threading.Tasks { public interface IValueTaskSource { bool IsCompleted { get; } bool IsCompletedSuccessfully { get; } void OnCompleted(Action<object> continuation, object state, ValueTaskSourceOnCompletedFlags flags); void GetResult(); } public interface IValueTaskSource<out TResult> { bool IsCompleted { get; } bool IsCompletedSuccessfully { get; } void OnCompleted(Action<object> continuation, object state, ValueTaskSourceOnCompletedFlags flags); TResult GetResult(); } [Flags] public enum ValueTaskSourceOnCompletedFlags { None = 0x0, UseSchedulingContext = 0x1, FlowExecutionContext = 0x2, } } ``` An object implements `IValueTaskSource` to be wrappable by `ValueTask`, and `IValueTaskSource<TResult>` to be wrappable by `ValueTask<TResult>`. Then we add this ctor to `ValueTask<TResult>`: ```C# namespace System.Threading.Tasks { public struct ValueTask<TResult> { public ValueTask(IValueTaskSource<TResult> source); ... } } ``` Then we add a non-generic `ValueTask` counterpart to `ValueTask<TResult>`. This mirrors the `ValueTask<TResult>` surface area, except that it doesn’t have a `Result` property, doesn’t have a ctor that takes a `TResult`, uses `Task` in places where `Task<TResult>` was used, etc. ```C# namespace System.Threading.Tasks { [AsyncMethodBuilder(typeof(AsyncValueTaskMethodBuilder))] public readonly partial struct ValueTask : IEquatable<ValueTask> { public ValueTask(Task task); public ValueTask(IValueTaskSource source); public bool IsCanceled { get; } public bool IsCompleted { get; } public bool IsCompletedSuccessfully { get; } public bool IsFaulted { get; } public Task AsTask(); public ConfiguredValueTaskAwaitable ConfigureAwait(bool continueOnCapturedContext); public override bool Equals(object obj); public bool Equals(ValueTask other); public ValueTaskAwaiter GetAwaiter(); public override int GetHashCode(); public static bool operator ==(ValueTask left, ValueTask right); public static bool operator !=(ValueTask left, ValueTask right); } } ``` And finally we add the System.Runtime.CompilerServices goo that allows `ValueTask` to be awaited and used as the return type of an async method: ```C# namespace System.Runtime.CompilerServices { public struct AsyncValueTaskMethodBuilder { public static AsyncValueTaskMethodBuilder Create(); public void Start<TStateMachine>(ref TStateMachine stateMachine) where TStateMachine : IAsyncStateMachine; public void SetStateMachine(IAsyncStateMachine stateMachine); public void AwaitOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : INotifyCompletion where TStateMachine : IAsyncStateMachine; public void AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : ICriticalNotifyCompletion where TStateMachine : IAsyncStateMachine; public void SetResult(); public void SetException(Exception exception); public ValueTask Task; } public readonly struct ValueTaskAwaiter : ICriticalNotifyCompletion { public bool IsCompleted { get; } public void GetResult() { } public void OnCompleted(Action continuation); public void UnsafeOnCompleted(Action continuation); } public readonly struct ConfiguredValueTaskAwaitable { public ConfiguredValueTaskAwaiter GetAwaiter(); public readonly struct ConfiguredValueTaskAwaiter : ICriticalNotifyCompletion { public bool IsCompleted { get; } public void GetResult(); public void OnCompleted(Action continuation); public void UnsafeOnCompleted(Action continuation); } } } ``` ### Changes to Previously Accepted APIs At the very least, we would use the `ValueTask` and `ValueTask<T>` types in the following previously accepted/implemented APIs that are shipping in 2.1: - **Pipelines**. Instead of pipelines having a custom `PipeAwaiter<T>` type, it will return `ValueTask<T>` from the `ReadAsync` and `FlushAsync` methods that currently return `PipeAwaiter`. `PipeAwaiter<T>` will be deleted. `Pipe` uses this to reuse the same pipe object over and over so that reads and flushes are allocation-free. - **Channels**. The `WaitToReadAsync` and `WaitToWriteAsync` methods will return `ValueTask<bool>` instead of `Task<bool>`. The `WriteAsync` method will return `ValueTask` instead of `Task`. At least some of the channel implementations, if not all, will pool and reuse objects backing these value tasks. - **Streams**. The new `WriteAsync(ReadOnlyMemory<byte>, CancellationToken)` overload will return `ValueTask` instead of `Task`. `Socket`’s new `ReceiveAsync`/`SendAsync` methods that are already defined to return `ValueTask<int>` will take advantage of this support, making sending and receiving on a socket allocation free. `NetworkStream` will then expose that functionality via `ReadAsync`/`WriteAsync`. `FileStream` will potentially also pool so as to make synchronous and asynchronous reads/writes allocation-free. - **WebSockets**. The new `SendAsync(ReadOnlyMemory<byte>, …)` overload will return `ValueTask` instead of `Task`. Many `SendAsync` calls just pass back the result from the underlying `NetworkStream`, so this will incur the benefits mentioned above. There are likely to be other opportunities in the future as well. And we could re-review some of the other newly added APIs in .NET Core 2.1, e.g. `TextWriter.WriteLineAsync(ReadOnlyMemory<char>, ...)`, to determine if we want to change those from returning `Task` to `ValueTask`. The tradeoff is one of `Task`'s usability vs the future potential for additional optimization. ### Limitations `Task` is powerful, in large part due to its “once completed, never go back” design. As a result, a `ValueTask<T>` that wraps either a `T` or a `Task<T>` has similar power. A `ValueTask<T>` that wraps an `IValueTaskSource<T>` can be used only in much more limited ways: - The 99.9% use case: either directly await the operation (e.g. `await SomethingAsync();`), await it with configuration (e.g. `await SomethingAsync().ConfigureAwait(false);`), or get a Task out (e.g. `Task t = SomethingAsync().AsTask();`). Using `AsTask()` incurs allocation if the `ValueTask`/`ValueTask<T>` wraps something other than a `Task`/`Task<T>`. - Once you’ve either awaited the `ValueTask`/`ValueTask<T>` or called `AsTask`, you must never touch it again. - With a `ValueTask<T>` that wraps a `Task<T>`, today you can call `GetAwaiter().GetResult()`, and if it hasn’t completed yet, it will block. That is unsupported for a `ValueTask<T>` wrapping an `IValueTaskSource<T>`, and thus should be generally discouraged unless you're sure of what it's wrapping. `GetResult` must only be used once the operation has completed, as is guaranteed by the await pattern. - With a `ValueTask<T>` that wraps a `Task<T>`, you can await it an unlimited number of times, both serially and in parallel. That is unsupported for a `ValueTask<T>` wrapping an `IValueTaskSource<T>`; it can be `await`ed/`AsTask`'d once and only once. - With a `ValueTask<T>` that wraps a `Task<T>`, you can call any other operations in the interim and then await the `ValueTask<T>`. That is unsupported for a `ValueTask<T>` wrapping an `IValueTaskSource<T>`; it should be `await`ed/`AsTask`’d immediately, as the underlying implementation may be used for other operation, subject to whatever the library author chose to do. - You can choose to explicitly call `IsCompletedSuccessfully` and then use `Result` or `GetAwaiter().GetResult()`, but that is the only coding pattern outside of `await`/`AsTask` that’s supported. We will need to document that `ValueTask`/`ValueTask<T>` should only be used in these limited patterns unless you know for sure what it wraps and that the wrapped object supports what's being done. And APIs that return a `ValueTask`/`ValueTask<T>` will need to be clear on the limitations, in hopes of preserving our ability to change the backing store behind `ValueTask<T>` in the future, e.g. an API that we ship in 2.1 that returns `ValueTask<T>` around a `Task<T>` then in the future instead wrapping an `IValueTaskSource<T>`. Finally, note that as with any solution that involves object reuse and pooling, usability/diagnostics/debuggability are impacted. If an object is used after it's already been effectively freed, strange/bad behaviors can result. ### Why now? If we don’t ship this in 2.1, we will be unable to do so as effectively in the future: - Some methods (e.g. the new `Stream.WriteAsync` overload) are currently defined to return `Task` but should be changed to return `ValueTask`. - Some methods return `ValueTask<T>`, but if we’re not explicit about the limitations of how it should be used, it’ll be a breaking change to modify what it backs in the future. - Various types (e.g. `PipeAwaiter<T>`) will be instant legacy. - Prior to .NET Core 2.1, `ValueTask<T>` was just OOB. It’s now also in System.Private.CoreLib, with core types like `Stream` depending on it. ### Implementation Status With the exception of pipelines, I have these changes implemented across coreclr and corefx. I can respond to any changes from API review, clean things up, and get it submitted as PRs across coreclr and corefx. Due to the breaking changes in existing APIs, it will require some coordination across the repos. (EDIT stephentoub 2/25: Renamed IValueTaskObject to IValueTaskSource.) (EDIT stephentoub 2/25: Changed OnCompleted to accept object state.) 27446 area-System.IO Add SafeFindHandle ## Motivation Handles returned by FindFirstFile on Windows should be closed with FindClose, not CloseHandle. Therefore a SafeFileHandle or similar is not appropriate for it. We have a SafeFindHandle internally, if we expose it publicly it is not necessary to reinvent it. ## API ```c# namespace Microsoft.Win32.SafeHandles { public sealed partial class SafeFindHandle : Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid { protected override bool ReleaseHandle() { throw null; } } } ``` ## Implementation ```c# internal sealed class SafeFindHandle : SafeHandle { protected override bool ReleaseHandle() { return Interop.Kernel32.FindClose(handle); } } ``` cc @JeremyKuhne 27447 area-System.Data Clarify persistency of prepared commands across pooled connection lifespan ADO.NET has an explicit `Prepare()` API which can be very important for performance - the effect is dramatic on PostgreSQL and there's a potential for big gains also on Sqlite and on SqlServer (where the operation is currently a no-op, but could obviate sending the query SQL and resultset shape description on each query). Unfortunately, this feature currently isn't very compatible with short-lived connection scenarios such as web applications: since `Prepare()` is invoked on `DbCommand`, the reasonable expectation from the API is that once the instance is disposed or the DbConnection is closed/disposed, the benefits of preparation disappear. So the benefits of prepare are currently restricted to applications which call `Prepare()` on a `DbCommand` instance, and then re-execute that instance many times on the same `DbConnection` - the opposite of how web applications work. Since preparation is so important with PostgreSQL, Npgsql works around this problem by internally persisting command - when a prepared `NpgsqlCommand` is disposed, the prepared resources are kept internally on the physical connection, keyed on the SQL, even when the connection is returned to the pool. A subsequent call to `Prepare()` on the same physical connection will just look up those resources and reuse them. It's worth thinking about this problem in a more general way in ADO.NET, to make sure that other providers benefit from prepared command persistency. This could mean the introduction of a new preparation API or something else. 27448 area-System.Data Provider-independent mechanism for automatic database command preparation "ADO.NET has an explicit Prepare() API which can be very important for performance - the effect is dramatic on PostgreSQL and there's a potential for big gains also on Sqlite and on SqlServer (where the operation is currently a no-op, but could obviate sending the query SQL and resultset shape description on each query). Unfortunately, when using data layers above ADO.NET (dapper, EF Core), it's usually impossible to benefit from preparation as the `DbCommand` API is hidden away. Npgsql deals with this problem via an internal, opt-in ""autoprepare"" feature - it counts the number of times a given SQL has been executed, and once a certain threshold is passed, automatically prepares the command. To avoid preparing too many commands (which could put a strain on the database), an LRU cache ejects old commands. We should consider promoting this mechanism (or building something similar) to ADO.NET, so that all providers can benefit from it. This mechanism would implement all of the necessary tracking, and would call `Prepare()` when the proper threshold is passed. Note: when the threshold is reached, Npgsql currently executes both the preparation and the execution in a single round-trip, this can be important for thrashing scenarios. Note: we should provide a way for specific providers to opt out of this when preparation really is a no-op (like current SqlClient), to avoid the overhead and added complexity." 27449 area-System.IO Path tests overhaul Path tests weren't running due to a test infra or runtime bug (too many test methods in one class apparently). Cleaned up path tests, fixing issues and adding coverage. cc: @danmosemsft, @Anipik, @maryamariyan, @pjanotti See https://github.com/dotnet/coreclr/pull/16554, #27426 27450 area-System.Net AuthenticateAsServerAsync fails on Ubuntu with SSL routines:ssl3_get_client_hello:no shared cipher The following code works fine when running under .Net Core 2.0 on Windows 10 with both Windows and Linux clients. ``` var tlsCert = new X509Certificate2(tlsPfxFile); var server = new Socket(SocketType.Stream, ProtocolType.Tcp); server.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true); server.Bind(port.IPEndpoint); server.Listen(512); var socket = await server.AcceptAsync(); socket.NoDelay = true; var stream = (Stream) new NetworkStream(socket, true); var sslStream = new SslStream(stream, false); await sslStream.AuthenticateAsServerAsync(tlsCert, false, SslProtocols.Tls | SslProtocols.Tls11 | SslProtocols.Tls12, false); ``` Running the same code on Ubuntu (either real Ubuntu or Windows Subsystem for Linux) fails with: > TLS init failed: A call to SSPI failed, see inner exception.: Interop+OpenSsl+SslException: SSL Handshake failed with OpenSSL error - SSL_ERROR_SSL. ---> Interop+Crypto+OpenSslCryptographicException: error:1408A0C1:SSL routines:ssl3_get_client_hello:no shared cipher > --- End of inner exception stack trace --- > at Interop.OpenSsl.DoSslHandshake(SafeSslHandle context, Byte[] recvBuf, Int32 recvOffset, Int32 recvCount, Byte[]& sendBuf, Int32& sendCount) > at System.Net.Security.SslStreamPal.HandshakeInternal(SafeFreeCredentials credential, SafeDeleteContext& context, SecurityBuffer inputBuffer, SecurityBuffer outputBuffer, Boolean isServer, Boolean remoteCertRequired) > 27451 area-System.Memory [API change] Move Memory.TryGetXxx Extensions to MemoryMarshal.TryGetXxx Proposed api ```csharp public static class MemoryMarshal { public static bool TryGetString(ReadOnlyMemory<char> readOnlyMemory, out string text, out int start, out int length); public static bool TryGetArray(Memory<T> readOnlyMemory, out ArraySegment<T> arraySegment) } ``` Currently these methods are on `MemoryExtensions` or `Memory` for `TryGetArray` acting directly as methods on `Memory` ```csharp public static partial class MemoryExtensions { public static bool TryGetString(this ReadOnlyMemory<char> readOnlyMemory, out string text, out int start, out int length); } ``` ```csharp public static partial struct Memory<T> { public bool TryGetArray(out ArraySegment<T> arraySegment) } ``` However, for consistency, and because they violate the window of visibility of the `Memory` they should probably move to `MemoryMarshal` to join their other friends `TryGetArray` and `TryGetOwnedMemory`. /cc @KrzysztofCwalina @stephentoub @ahsonkhan @terrajobst @joshfree @jkotas 27453 area-System.Runtime API Proposal: Add a Generic version of GetValues to Enum (probably GetName/GetNames) I suggest to implement Generic version of GetValues method in the Enum class. In present, if we going to get an typed array of some enum values we have to write following code: `SomeEnum[] values = (SomeEnum[])Enum.GetValues(typeof(SomeEnum));` It seems as unconvenient way. In my opinion, the following Generics-based syntax should seems shorter, more convenient and safely (by reason of type casting necessity): `SomeEnum[] values = Enum.GetValues<SomeEnum>();` The possible way to implement this syntax is: ``` public static TEnum[] GetValues<TEnum>() where TEnum : struct { Type enumType = typeof(TEnum); return (TEnum[])enumType.GetEnumValues(); } ``` This proposal is inspired by the great Generic-based version of Enum.TryParse method laying besides with legacy non-Generic version: ``` public static bool TryParse(Type enumType, String value, out Object result) public static bool TryParse<TEnum>(String value, out TEnum result) where TEnum : struct ``` If proposal to implement Generic version of GetValues will be accepted I guess following Generics-based implementations of GetName GetNames should be implemented for symmetry reason: ``` public static String GetName<TEnum>(Object value) where TEnum : struct { Type enumType = typeof(TEnum); return enumType.GetEnumName(value); } public static String[] GetNames<TEnum>() where TEnum : struct { Type enumType = typeof(TEnum); return enumType.GetEnumNames(); } ``` I introduce possible implementation of this proposal in [dotnet/coreclr/pull#16557](https://github.com/dotnet/coreclr/pull/16557) This is a small point improvement suggestion. It can be implemented separately of as a part of total Enum improvements discussing in [dotnet/corefx/#15453](https://github.com/dotnet/corefx/issues/15453) 27456 area-System.IO API Proposal: Add Regex option to enumeration APIs ## Proposal Now that we have the ability to specify the match type, we should expose `Regex` as an option: ``` C# namespace System.IO { public enum MatchType { Simple, Win32, /// <summary> /// Expression is treated as a regular expression. /// </summary> /// <remarks> /// Single line, culture invariant, explicit capture matching is used. /// </remarks> Regex } } namespace System.IO.Enumeration { public static class FileSystemName { public static string TranslateWin32Expression(string expression); public static bool MatchesWin32Expression(ReadOnlySpan<char> expression, ReadOnlySpan<char> name, bool ignoreCase = true); public static bool MatchesSimpleExpression(ReadOnlySpan<char> expression, ReadOnlySpan<char> name, bool ignoreCase = true); /// <summary> /// Return true if the given regular expression matches the given name. /// </summary> /// <remarks> /// Uses single line, invariant, explicit capture mode. /// </remarks> public static bool MatchesRegularExpression(ReadOnlySpan<char> expression, ReadOnlySpan<char> name, bool ignoreCase = true); } } ``` ## Motivation Partners are interested in having this exposed (MSBuild, PowerShell). Even though we don't have a span version of `Regex.IsMatch()`, exposing the API now will allow easier lighting up of higher performance, lower allocation implementations in the future. (As opposed to customers using `IsMatch` directly and needing to update their clients if we provide a span version in the future.) ## Details - We'll pick sensible RegexOptions as a default (as described in the signature comments) - Users can override either by using Regex directly or using `?(imnsx)` options in their expressions 27457 area-System.IO Initial implementation of a regex match option Implementation of a `MatchType.Regex` per https://github.com/dotnet/corefx/issues/27456. Marking as no merge until approval. cc: @danmosemsft, @ViktorHofer, @terrajobst 27458 area-System.Net Ambigous error message for SSL validation error. "When I use HttpClient, I've encounter the SSL validation error. However, the error message just said that ""Security Error"" (in Japanese) it is not user friendly message. I might better if it is ""SSL validation error"" or something. The actual error message is ``` System.Net.Http.HttpRequestException HResult=0x80072F8F Message=An error occurred while sending the request. Source=System.Private.CoreLib StackTrace: at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() at System.Net.Http.DiagnosticsHandler.<SendAsync>d__2.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at KubernetesRestSpike.Program.<RunAsync>d__7.MoveNext() in C:\Users\tsushi\Source\Repos\CustomBindingsSample\KubernetesRestSpike\Program.cs:line 42 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at KubernetesRestSpike.Program.Main(String[] args) in C:\Users\tsushi\Source\Repos\CustomBindingsSample\KubernetesRestSpike\Program.cs:line 31 Inner Exception 1: WinHttpException: セキュリティ エラーが発生しました ``` This error is thrown from here. https://github.com/dotnet/corefx/blob/7e6396b2bcb4d372b199cfb7b3b13e290c441124/src/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpRequestCallback.cs#L312-L313 " 27459 area-System.Diagnostics System.Diagnostics.Tests.ProcessTests failures on Unix System.Diagnostics.Tests.ProcessTests.HandleCountChanges fails with: ``` MESSAGE: Assert.All() Failure: 1 out of 1 items in the collection did not pass. [0]: Xunit.Sdk.TrueException: Field marshaling is not supported by RemoteInvoke: s_allowedProgramsToRun Expected: True Actual: False at Xunit.Assert.True(Nullable`1 condition, String userMessage) at System.Diagnostics.RemoteExecutorTestBase.<>c.<GetMethodInfo>b__14_0(FieldInfo fi) in /mnt/j/workspace/dotnet_coreclr/master/jitstress/x64_checked_ubuntu_corefx_baseline_prtest/_/fx/src/CoreFx.Private.TestUtilities/src/System/Diagnostics/RemoteExecutorTestBase.cs:line 180 at Xunit.Assert.All[T](IEnumerable`1 collection, Action`1 action) +++++++++++++++++++ STACK TRACE: at System.Diagnostics.RemoteExecutorTestBase.GetMethodInfo(Delegate d) in /mnt/j/workspace/dotnet_coreclr/master/jitstress/x64_checked_ubuntu_corefx_baseline_prtest/_/fx/src/CoreFx.Private.TestUtilities/src/System/Diagnostics/RemoteExecutorTestBase.cs:line 178 at System.Diagnostics.RemoteExecutorTestBase.RemoteInvoke(Func`1 method, RemoteInvokeOptions options) in /mnt/j/workspace/dotnet_coreclr/master/jitstress/x64_checked_ubuntu_corefx_baseline_prtest/_/fx/src/CoreFx.Private.TestUtilities/src/System/Diagnostics/RemoteExecutorTestBase.cs:line 46 at System.Diagnostics.Tests.ProcessTests.HandleCountChanges() in /mnt/j/workspace/dotnet_coreclr/master/jitstress/x64_checked_ubuntu_corefx_baseline_prtest/_/fx/src/System.Diagnostics.Process/tests/ProcessTests.cs:line 1289 ``` System.Diagnostics.Tests.ProcessTests.GetProcesses_InvalidMachineName_ThrowsInvalidOperationException fails with: ``` MESSAGE: Assert.All() Failure: 1 out of 1 items in the collection did not pass. [0]: Xunit.Sdk.TrueException: Field marshaling is not supported by RemoteInvoke: s_allowedProgramsToRun Expected: True Actual: False at Xunit.Assert.True(Nullable`1 condition, String userMessage) at System.Diagnostics.RemoteExecutorTestBase.<>c.<GetMethodInfo>b__14_0(FieldInfo fi) in /mnt/j/workspace/dotnet_coreclr/master/jitstress/x64_checked_ubuntu_corefx_baseline_prtest/_/fx/src/CoreFx.Private.TestUtilities/src/System/Diagnostics/RemoteExecutorTestBase.cs:line 180 at Xunit.Assert.All[T](IEnumerable`1 collection, Action`1 action) +++++++++++++++++++ STACK TRACE: at System.Diagnostics.RemoteExecutorTestBase.GetMethodInfo(Delegate d) in /mnt/j/workspace/dotnet_coreclr/master/jitstress/x64_checked_ubuntu_corefx_baseline_prtest/_/fx/src/CoreFx.Private.TestUtilities/src/System/Diagnostics/RemoteExecutorTestBase.cs:line 178 at System.Diagnostics.RemoteExecutorTestBase.RemoteInvoke(Func`1 method, RemoteInvokeOptions options) in /mnt/j/workspace/dotnet_coreclr/master/jitstress/x64_checked_ubuntu_corefx_baseline_prtest/_/fx/src/CoreFx.Private.TestUtilities/src ``` This failure was masked by https://github.com/dotnet/corefx/issues/27426 27460 area-System.Runtime HandleProcessCorruptedStateExceptionsTests.ProcessExit_Called test failing on Windows ``` MESSAGE: Exit code was -1073741819 but it should have been 42 Expected: True Actual: False +++++++++++++++++++ STACK TRACE: at System.Diagnostics.RemoteExecutorTestBase.RemoteInvokeHandle.Dispose(Boolean disposing) in D:\j\workspace\x64_checked_w---d7295605\_\fx\src\CoreFx.Private.TestUtilities\src\System\Diagnostics\RemoteExecutorTestBase.cs:line 231 at System.Diagnostics.RemoteExecutorTestBase.RemoteInvokeHandle.Dispose() in D:\j\workspace\x64_checked_w---d7295605\_\fx\src\CoreFx.Private.TestUtilities\src\System\Diagnostics\RemoteExecutorTestBase.cs:line 207 at System.Runtime.ExceptionServices.Tests.HandleProcessCorruptedStateExceptionsTests.ProcessExit_Called() in D:\j\workspace\x64_checked_w---d7295605\_\fx\src\System.Runtime\tests\System\Runtime\ExceptionServices\HandleProcessCorruptedStateExceptions.cs:line 51 ``` This failure was masked by #27426 27462 area-System.Reflection Add test coverage for reflection on PseudoCustomAttributes Follow up on https://github.com/dotnet/corefx/issues/27426 27463 area-System.IO NamedPipe: CurrentUserOnly, quick fixes for Unix * The path for the directory when using current user only was wrong and not using the intended folder. * Added getpeerid validation on the server side (see https://github.com/dotnet/corefx/pull/26395#discussion_r166484692) 27464 area-System.Threading Change new QueueUserWorkItem method to use `TState` In .NET Core 2.1 we've added this new overload: ```C# public static bool QueueUserWorkItem(WaitCallback callBack, object state, bool preferLocal) ``` We should change it to instead be: ```C# public static bool QueueUserWorkItem<TState>(Action<TState> callBack, TState state, bool preferLocal) ``` This has several benefits: 1. `Action<object>` with `object state` can be used, without a mismatch of delegate signatures. `Action<object>` is now commonly used in these situations. 2. We can now avoid boxing value type arguments passed in. 3. And because of (2) and value tuples, we can easily pass any number of arguments in without allocating a separate object to store them all. We should fix this before we ship 2.1. cc: @benaadams, @davidfowl, @kouvel 27465 area-System.IO PipeReader.Complete shouldn't throw if AdvanceTo wasn't called Today we throw an exception that forces you to `AdvanceTo` before calling Complete. It's forcing into a very specific programming pattern to make sure you don't leak memory in certain cases. The downside is that you end up with lots of try finally to make sure that things get called in the right order. We'd still recommend only calling Complete after all reading is complete but I'm not sure what we have is worth the pain. /cc @pakrym @halter73 @benaadams 27466 area-System.Security Cannot decode X500DistinguishedName correctly with T61String. "In an ASP.NET CORE 2.0 project under MAC OS, we have a byte array which is the raw data of the x500 distinguished name, to decode it with the X500DistinguishedName class, the value can be decoded if it is a printable string, but the value CANNOT be decoded if it is a T61String. It's OK in: 1) Windows platform (all projects) 2) MAC, .NET Framework project It's NOT OK in: 1) MAC, ASP.NET CORE 2.0 project Steps: 1) Run the following codes in a ASP.NET CORE 2.0 project. // CN=GrapeCity inc., OU=Tools Development, O=GrapeCity inc., L=Sendai Izumi-ku, S=Miyagi, C=JP // the CN, OU, O value is T61String // the L, S, C value is printable string var base64 = ""MIGGMQswCQYDVQQGEwJKUDEPMA0GA1UECBMGTWl5YWdpMRgwFgYDVQQHEw9TZW5kYWkgSXp1bWkta3UxFzAVBgNVBAoUDkdyYXBlQ2l0eSBpbmMuMRowGAYDVQQLFBFUb29scyBEZXZlbG9wbWVudDEXMBUGA1UEAxQOR3JhcGVDaXR5IGluYy4=""; var bytes = System.Convert.FromBase64String(base64); var x500name = new System.Security.Cryptography.X509Certificates.X500DistinguishedName(bytes); var name = x500name.Name; 2) get's the value of name. <observed>CN="""", OU="""", O="""", L=Sendai Izumi-ku, S=Miyagi, C=JP <expected>CN=GrapeCity inc., OU=Tools Development, O=GrapeCity inc., L=Sendai Izumi-ku, S=Miyagi, C=JP " 27467 area-System.IO Pipelines: ReadAsync completion error is inverted If you call `ReadAsync` on a completed pipe, you incorrectly get the `SR.WritingAfterCompleted` message that says that write is not allowed, via `CreateInvalidOperationException_NoReadingAllowed`; this should probably be `SR.ReadingAfterCompleted`. Likewise - the `ThrowInvalidOperationException_NoReadingAllowed` uses `SR.WritingAfterCompleted`. /src/System.IO.Pipelines/src/System/IO/Pipelines/ThrowHelper.cs 27468 area-System.Net Memory leak in SendAsync in HttpClient In corefx/src/System.Net.Http/src/System/Net/Http/HttpClient.cs:SendAsync there seems to be a memory leak that is triggered when CancellationToken.None is used. We have created HttpClient once and reuse it: var httpClientHandler = new HttpClientHandler(); httpClientHandler.ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => true; httpClient = new HttpClient(httpClientHandler); httpClient.Timeout = Timeout.InfiniteTimeSpan; And are calling like this: using (var content = PrepareHttpContentJson(input)) using (HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, new Uri(fullUrl, UriKind.RelativeOrAbsolute))) { request.Content = content; using (HttpResponseMessage result = await httpClient.SendAsync(request, CancellationToken.None)) { // work on result } } PrepareHttpContentJson returns a ByteArrayContent (json content) with ContentType set. If this code is called repeatably, it leaks every `ByteArrayContent` created. Looking to the memory using Diagnostic Tools in Visual Studio, this is what seems to lock the memory: ByteArrayContent > Action<Stream> > HttpWebRequest > ConnectStream > ContextAwareResult > HttpClientHandler+RequestState > CancellationCallbackInfo If I replace `CancellationToken.None` with `cts.Token` in `SendAsync` and create `var cts = new CancellationTokenSource();` just before the first `using`, the memory leak stops. I made this attempt as I checked the source code for HttpClient.cs and noticed some handling of cancellation tokens going on and figured this might be the cause. Note: This MAY be an interaction issue with Autofac, but I don't think so. The `using` code block is resolve by Autofac, but there is only ever 1 instance (registered as single instance) of it (so it wont be disposed between usages). 27469 area-System.Reflection Requesting a net35 target for the S.R.Metadata package Projects like https://github.com/nunit/nunit-console (including the engine shared by the console and adapter) and https://github.com/OpenCover/opencover allow users to execute their assemblies on desktop CLR v2 and therefore cannot target net40 or greater. Without a net35 target, or maintaining such a port, we can't move away from Mono.Cecil. Mono.Cecil has a major drawback for projects that use rely on it, crashing when reading portable PDB information. It hasn't been updated in a while. S.R.Metadata is also better-designed for efficient low-level reading. This would make it desirable to publish a net35 build of S.C.Immutable. @sharwell has one at https://github.com/tunnelvisionlabs/dotnet-collections, though adding a net35 target to the S.C.Immutable package would also be welcome for even more projects than stated above. It looks like this would make the difference for me between days and months of work, so I'm happy to contribute here! 27471 area-System.Runtime AsyncTaskMethodBuilder<decimal> incorrectly caches decimal tasks with zero value "`AsyncTaskMethodBuilder<decimal>` uses cached tasks for common zero values. There's a check for `(decimal)result == 0m`. The decimal type can store trailing zeroes, though. But `==` is blind to this: `0m == 0.0m`. (I also found no other way to get this comparison to return false. This is in my view an API omission.) This makes caching observable and creates a wrong result: static void Main() { Console.WriteLine(Return(0m) + "" / "" + Return(0.0m)); // 0 / 0.0 Console.WriteLine(ReturnAsync(0m).Result + "" / "" + ReturnAsync(0.0m).Result); // 0 / 0 } static decimal Return(decimal value) => value; static async Task<decimal> ReturnAsync(decimal value) => value; Both lines should return the same string. The async line is wrong. I tested this on .NET 4.7.1 but it should apply to all .NET versions where this particular optimization landed." 27472 area-System.Net Activity for HttpClient calls not stopped if inner handler does not use async/await "I've been writing some `DiagnosticSource`/`Activity` based instrumentation for HttpClient. [In my unit tests](https://github.com/cwe1ss/opentracing-contrib-dotnet/blob/ba20de4ba57e43cb685083e3c0b2b19022ce067e/test/OpenTracing.Contrib.AspNetCore.Tests/HttpOut/HttpOutInterceptorTest.cs) I've created a HttpMessageHandler and wrapped it with the existing `DiagnosticsHandler` (by using reflection, so in an unsupported way) to test the different scenarios. However, I noticed that if my handler doesn't use `async/await`, the `DiagnosticsHandler` does NOT raise the Diagnostics-events for `System.Net.Http.Exception` and `System.Net.Http.HttpRequestOut.Stop` because the invocation is outside of the try...catch block. E.g. if DiagnosticsHandler is using an inner handler that looks like this, it does NOT raise the events: ```csharp public class FailingHttpMessageHandler : HttpMessageHandler { protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) { throw new InvalidOperationException(""foo""); } } ``` It only works, if I change the code as follows: ```csharp public class FailingHttpMessageHandler : HttpMessageHandler { protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) { await Task.CompletedTask; throw new InvalidOperationException(""foo""); } } ``` My direct usage of DiagnosticsHandler is obviously a hack as it is internal and AFAIU in a regular application `DiagnosticsHandler` is an internal feature of `HttpClientHandler` so there shouldn't be any user code after it but nevertheless, I think that it would make sense to move the call from this PR into the try..catch block. /cc @lmolkova @vancem" 27473 area-System.Text Regex refactoring From the previous PR with the changes now grouped into multiple commits. No squash please! @stephentoub I will incorporate your feedback here later today. 27476 area-System.Net Add MaxResponseDrainSize, and fix a few draining bugs I've added MaxResponseDrainSize to make the setting configurable rather than a const; I left it internal until the API is approved. In adding tests for it, I found a few existing bugs in draining that I fixed: - HttpConnectionResponseContent nulls out its Stream when the Stream is consumed. Then when the response content is disposed, the Stream is null, so it's not disposed, so it's not drained. - HttpContentReadStream's Dispose wasn't checking whether it was already called, and would kick off a new draining operation if the connection was still associated. So if the stream was disposed multiple times, which happens if the response content and stream are both disposed (since the content disposes of the stream), we end up corrupting the response due to multiple threads concurrently accessing and draining it. cc: @geoffkizer, @davidsh, @wfurt Contributes to https://github.com/dotnet/corefx/issues/27329 27477 area-System.Net SocketsHttpHandler: auth scheme lookup should be case-insensitive "If we receive an auth challenge with a scheme like ""basic"" or ""DIGEST"", we don't handle this properly. Scheme name should be case-insensitive. " 27481 area-System.Memory Update System.Memory package description to be complete Right now it only includes Span within the description. https://github.com/dotnet/corefx/blob/3c708ab64564304fed352355b52e2ea047860e4d/pkg/descriptions.json#L1004 cc @KrzysztofCwalina, @dotnet/corefxlab-contrib, @pakrym, @davidfowl 27482 area-Infrastructure Mark Microsoft.XmlSerializer.Generator as NonShipping=true (product construction) "In orchestrated builds, `Microsoft.XmlSerializer.Generator` should be marked `NonShipping=""true""` because it's not meant to be published to the NuGet Gallery. Example manifest without NonShipping: https://github.com/dotnet/versions/blob/beb08dc78641604883b17ee3010e602378b1c361/build-info/dotnet/product/cli/release/2.1/build.xml#L371 We will start to rely on this attribute with automated pushes: https://github.com/dotnet/core-eng/issues/2334. /cc @weshaggard " 27483 area-Serialization [Perf] Investigate Xml/XmlSerializer benchmarks regressions in 2.1 (part I) [Perf] Investigate Xml/XmlSerializer benchmark regressions in 2.1 (part I) Regression across multiple tests in Xml/XmlSerializer of ~10% from this range of commits: https://github.com/dotnet/corefx/compare/6ded3992a29c48ec3c9e641589b9805a1dbc50a3...dotnet:697e2b910e6cccbc1f3d58be111e309db4823ab7 27484 area-Serialization [Perf] Investigate Xml/XmlSerializer benchmark regressions in 2.1 (part 2) [Perf] Investigate Xml/XmlSerializer benchmark regressions in 2.1 (part 2) Second regression across multiple tests in Xml/XmlSerializer of >15% from this range of commits: https://github.com/dotnet/corefx/compare/6f5d255a76a192906f692fd3d2b9104ab6aeb2f2...dotnet:504781cbfb166c71204b9077c0528623c85cf68c 27486 area-System.Runtime System.Runtime.Intrinsics in .NET Core 2.1 # System.Runtime.Intrinsics in .NET Core 2.1 .NET Core 2.1 has been adding platform intrinsic APIs to support directly calling processor specific instructions, such as Intel’s x86 SIMD instructions. See the [initial platform intrinsics design](https://github.com/dotnet/designs/blob/master/accepted/platform-intrinsics.md) for more information. We have decided that it makes the most sense for this intrinsics feature to ship in a “preview” status in the .NET Core 2.1 RTM timeframe. This means that the runtime support we are implementing will be included, but the assembly exposing the intrinsics will only be available to projects via explicit reference to a “preview-only” package. These APIs won’t be included in the official .NET Core 2.1 packages. Given our limited time and resources, recent changes in the approach we take to expose the intrinsics, and API changes prompted by design feedback from the community, we don’t believe there is enough time to settle these APIs for 2.1. We plan to follow the pattern of other recent features like `Span<T>` and `Memory<T>` that first shipped in preview before formally joining the supported API surface. Not only would we expect the next version of .NET Core to support more intrinsics than could be supported in 2.1, but we expect to have real usage examples in CoreFX and higher level components as well. These real world examples, as well as feedback from customers who opt in to the preview, should give us the confidence we need to officially support the APIs going forward. ## Details In the coming days, we plan on removing System.Runtime.Intrinsics.dll from the Microsoft.NETCore.App package. This means any libraries/applications that are using these APIs will no longer compile by default, and will not run on new builds of .NET Core 2.1. At the same time, we will start producing a new System.Runtime.Intrinsics.Experimental NuGet package. In order to continue using these APIs on .NET Core 2.1, a project will need to add a reference to this new package. As its name implies, this package is experimental and should only be used for preview purposes. It isn’t expected to be used in production scenarios. Future version of .NET Core (after 2.1) will be allowed to break this package. This enables us respond to future feedback that requires the APIs to be modified. In the future, when we are confident we have the intrinsic APIs right, we will stop producing the System.Runtime.Intrinsics.Experimental package. The platform intrinsics APIs will then be added back to Microsoft.NETCore.App and will be officially supported. ## Call to action Please review this plan and provide any feedback in the comments of this issue. 27487 area-System.Memory Optimize MemoryExtensions SequenceEqual for T = char One option could be to convert to `Span<byte>` using AsBytes for any T = blittable type and call the existing vectorized method: https://github.com/dotnet/corefx/blob/master/src/System.Memory/src/System/SpanHelpers.byte.cs#L889 Alternatively, create a char specific implementation and add a type check. cc @KrzysztofCwalina, @GrabYourPitchforks, @stephentoub, @jkotas, @benaadams 27488 area-Serialization Warning of serializer generation failure when there are just no types serializable When there are no types found to pre-gen serializers, I got warning below, which is a bit confusing. Ideally, I can be told the real reason. c:\users\xxxxx\\.nuget\packages\microsoft.xmlserializer.generator\2.0.0-preview1-26216-02\build\Microsoft.XmlSerializer.Generator.targets(16,5): warning : SGEN : warning SGEN1: Fail to generate the serializer for test-sgen.dll. Please follow the instructions at https://go.microsoft.com/fwlink/?linkid=858594 and try again. [C:\Temp\test-sgen\test-sgen.csproj] 27489 area-System.Memory Removing files since MemoryExtensions is in CoreLib now. Part of https://github.com/dotnet/corefx/issues/25182 Depends on https://github.com/dotnet/coreclr/pull/16521 (and the subsequent mirror PR). - Removed duplicated files - Moved the internal Clear helper methods from SpanHelpers.Clear.cs to SpanHelpers.cs since it is a small enough file cc @jkotas, @KrzysztofCwalina, @stephentoub 27490 area-System.Security Add more EnvelopedCms tests This change brings the EnvelopedCms tests which were added in the dev/cms_unix branch to master. Thankfully, they all just pass. Thanks for contributing these long ago, @hoyosjs. 27492 area-Serialization Incorrect error message from MS.XS.Gen when running with older runtime When using Microsoft.XmlSerializer.Generator 2.0.0-preview1-26216-02 on a machine with 2.0.x runtime, I got error `'System.Xml.Serialization.XmlSerializer' does not have a method named 'GenerateSerializerNotFound'. SGen does not support the framework of the version you are using.` The error message is from [here](https://github.com/dotnet/corefx/blob/b032565f4c8186dcb82a0d6be8a94e660184405a/src/System.Private.Xml/src/Resources/Strings.resx#L3452). There is no such a method called `GenerateSerializerNotFound`. Can we update the error message to: `Method 'System.Xml.Serialization.XmlSerializer.GenerateSerializer' was not found. This is likely because you are using an older version of the framework. Please update to .NET Core v2.1 or later.` 27494 area-System.IO Tests For GetPathRoot and Enabling NormalizeDirectorySeparatorTests Fixes https://github.com/dotnet/corefx/issues/27401 27495 area-System.IO [Perf][Windows_NT] Investigate the regression on some System/IO/Tests benchmarks due to OS upgrade It looks like changing the OS on the perf machines, from Windows Server 2012 to Windows Server 2016 (https://github.com/dotnet/corefx/pull/23714) caused a regression of: - System/IO/Tests/[Perf_File & Perf_FileStream] - ~400% on Perf_File.Delete - ~24% on Perf_File.Exist - ~15% on Perf_FileStream - System/IO/Tests/Perf_Path/GetTempPath ~32% regression 27496 area-System.IO [Perf][Windows_NT] Investigate the improvement/regressions on System/IO/Tests/PerfStreamWriter From release/2.0.0 to release/2.1 there has been the following changes in the tests: ``` WriteCharArray(writeLength: 100) // Improved ~8% WriteCharArray(writeLength: 2) // Improved ~7% WritePartialCharArray(writeLength: 100) // Improved ~16% WritePartialCharArray(writeLength: 2) // Regressed ~25% WriteString(writeLength: 2) // Regressed ~4% ``` 27498 area-System.ComponentModel Microsoft.Windows.Compatibility depends on nonexistent System.ComponentModel.Composition package Guessing this may have already been noted elsewhere, but took me by surprise - the MEF1 work for the Windows Compatibility Pack hasn't been done yet (mentioned on #24909), but _Microsoft.Windows.Compatibility_ still declares it as a package dependency. The NuGet client falls back to installing this unlisted non-Microsoft package uploaded in 2010: https://www.nuget.org/packages/System.ComponentModel.Composition ``` error NU1603: Microsoft.Windows.Compatibility 2.0.0-preview1-26216-02 depends on System.ComponentModel.Composition (>= 4.5.0-preview1-26216-02) but System.ComponentModel.Composition 4.5.0-preview1-26216-02 was not found. An approximate best match of System.ComponentModel.Composition 2010.2.11 was resolved. ``` 27499 area-System.IO ReadOnlySequence Performance Improvements Change `IMemoryList` to POCO object; then inherit for Pipeline`s `BufferSegment`; this means all its properties inline in use rather than being interface dispatch. Improve some of the code paths Bottom numbers after the effect for 1, 100 and 1000 segments; top is current ``` Method | Categories | Mean | Op/s | Scaled | --------------------------------- |-------------- |------------:|-------------:|-------:| ReadOnlySequence<T> (previous) | 1 segment | 104.86 ns | 9,536,378.9 | 1.00 | ReadOnlySequence<T> (current) | 1 segment | 85.64 ns | 11,677,040.0 | 0.82 | ReadOnlySequence<T> (this PR) | 1 segment | 70.79 ns | 14,125,877.7 | 0.68 | | | | | | ReadOnlySequence<T> (previous) | 2 segment | 188.92 ns | 5,293,250.6 | 1.00 | ReadOnlySequence<T> (current) | 2 segment | 181.64 ns | 5,505,269.8 | 0.96 | ReadOnlySequence<T> (this PR) | 2 segment | 111.34 ns | 8,981,178.5 | 0.59 | | | | | | ReadOnlySequence<T> (previous) | 100 segments | 1,297.69 ns | 770,599.7 | 1.00 | ReadOnlySequence<T> (current) | 100 segments | 966.50 ns | 1,034,659.7 | 0.74 | ReadOnlySequence<T> (this PR) | 100 segments | 233.30 ns | 4,286,286.4 | 0.18 | | | | | | ReadOnlySequence<T> (previous) | 1000 segments | 1,390.97 ns | 718,923.3 | 1.00 | ReadOnlySequence<T> (current) | 1000 segments | 1,095.54 ns | 912,790.8 | 0.79 | ReadOnlySequence<T> (this PR) | 1000 segments | 275.27 ns | 3,632,776.9 | 0.20 | | | | | | Span<T> | MM item | 147.34 ns | 6,787,204.7 | 0.54 | BufferSlice<T> | MM item | 152.70 ns | 6,548,884.8 | 0.56 | ReadOnlySequence<T> (previous) | MM item | 272.44 ns | 3,670,500.0 | 1.00 | ReadOnlySequence<T> (current) | MM item | 251.15 ns | 3,981,724.7 | 0.92 | ReadOnlySequence<T> (this PR) | MM item | 200.79 ns | 4,980,437.7 | 0.74 | ``` Resolves https://github.com/dotnet/corefx/issues/27500 27500 area-System.IO [API Change] Drop `IMemoryList` and replace with abstract `ReadOnlySequenceSegment` "Alternative to ""Remove RunningIndex add a way for IMemoryList to provide seek implementation"" https://github.com/dotnet/corefx/issues/27435 The is a performance issue with `ReadOnlySequence` as accessing the properties of its segments have to go via interface dispatch which makes them slower an non-inlineable. Proposed api: ```csharp public abstract class ReadOnlySequenceSegment<T> { public ReadOnlyMemory<T> Memory { get; protected set; } public ReadOnlySequenceSegment<T> Next { get; protected set; } public long RunningIndex { get; protected set; } } ``` Changing to an `abstract` class with `protected` setters and non-virtual properties makes them inlinable and fast. The `ReadOnlySequence` doesn't care what the segments are, only that thy have these properties and then it can perform all of its functions: Removing ```csharp public interface IMemoryList<T> { public Memory<T> Memory { get; set; } public IMemoryList<T> Next { get; set; } public long RunningIndex { get; set; } } ``` More functionality can't be delegated via the interface as in https://github.com/dotnet/corefx/issues/27435 as that will cause greater performance issues for mixed segment type `ReadOnlySequence`s as every call will have to go via the interface for the next block as its real type is unknown. With the above approach it doesn't need to know what the next block is; it can use the fast base properties. The total change in Pipelines to work with this faster approach is: (and PR for the change https://github.com/dotnet/corefx/pull/27499/commits/63ddad596763675165015c496e9647ee449adec1 ) ```diff - internal partial sealed class BufferSegment : IMemoryList<byte> + internal partial sealed class BufferSegment : ReadOnlySequenceSegment<byte> { + private BufferSegment _next; - public BufferSegment NextSegment { get; set; } + public BufferSegment NextSegment + { + get => _next; + set + { + _next = value; + Next = value; + } + } - public long RunningIndex { get; private set; } - public Memory<byte> Memory { get; private set; } - public IMemoryList<byte> Next => NextSegment; } ``` /cc @davidfowl @KrzysztofCwalina @pakrym @ahsonkhan @stephentoub " 27503 area-System.Net Test failure: System.Net.Http.Functional.Tests.HttpClientHandler_ResponseDrain_Test/GetAsync_DisposeBeforeReadingToEnd_DrainsRequestsAndReusesConnection(mode: BytePerChunk) Opened on behalf of @v-haren The test `System.Net.Http.Functional.Tests.HttpClientHandler_ResponseDrain_Test/GetAsync_DisposeBeforeReadingToEnd_DrainsRequestsAndReusesConnection(mode: BytePerChunk)` has failed. System.Exception : Unexpected EOF trying to read request header Stack Trace: at System.Net.Test.Common.LoopbackServer.Connection.ReadRequestHeaderAsync() in /Users/buildagent/agent/_work/391/s/corefx/src/Common/tests/System/Net/Http/LoopbackServer.cs:line 343 at System.Net.Test.Common.LoopbackServer.Connection.ReadRequestHeaderAndSendCustomResponseAsync(String response) in /Users/buildagent/agent/_work/391/s/corefx/src/Common/tests/System/Net/Http/LoopbackServer.cs:line 363 at System.Net.Http.Functional.Tests.HttpClientHandler_ResponseDrain_Test.<>c__DisplayClass2_0.<<GetAsync_DisposeBeforeReadingToEnd_DrainsRequestsAndReusesConnection>b__2>d.MoveNext() in /Users/buildagent/agent/_work/391/s/corefx/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.ResponseDrain.cs:line 86 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.AcceptConnectionAsync(Func`2 funcAsync) in /Users/buildagent/agent/_work/391/s/corefx/src/Common/tests/System/Net/Http/LoopbackServer.cs:line 117 at System.Net.Http.Functional.Tests.HttpClientHandler_ResponseDrain_Test.<>c__DisplayClass2_0.<<GetAsync_DisposeBeforeReadingToEnd_DrainsRequestsAndReusesConnection>b__1>d.MoveNext() in /Users/buildagent/agent/_work/391/s/corefx/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.ResponseDrain.cs:line 82 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.<>c__DisplayClass11_0.<<CreateClientAndServerAsync>b__0>d.MoveNext() in /Users/buildagent/agent/_work/391/s/corefx/src/Common/tests/System/Net/Http/LoopbackServer.cs:line 84 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.CreateServerAsync(Func`2 funcAsync, Options options) in /Users/buildagent/agent/_work/391/s/corefx/src/Common/tests/System/Net/Http/LoopbackServer.cs:line 67 at System.Net.Http.Functional.Tests.HttpClientHandler_ResponseDrain_Test.GetAsync_DisposeBeforeReadingToEnd_DrainsRequestsAndReusesConnection(ContentMode mode) in /Users/buildagent/agent/_work/391/s/corefx/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.ResponseDrain.cs:line 55 --- End of stack trace from previous location where exception was thrown --- Build : Master - 20180224.02 (Core Tests) Failing configurations: - OSX.1013.Amd64-x64 - Release 27504 area-System.IO should not have embedded nulls assertion in XML schema test On Ubuntu: https://mc.dot.net/#/user/stephentoub/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/1ffa18fb64d1bac969cb3b659178d65bcd4aea2e/workItem/System.Xml.XmlSchemaSet.Tests/wilogs ``` 2018-02-27 12:24:44,675: INFO: proc(54): run_and_log_output: Output: Discovering: System.Xml.XmlSchemaSet.Tests 2018-02-27 12:24:44,895: INFO: proc(54): run_and_log_output: Output: Discovered: System.Xml.XmlSchemaSet.Tests 2018-02-27 12:24:45,053: INFO: proc(54): run_and_log_output: Output: Starting: System.Xml.XmlSchemaSet.Tests 2018-02-27 12:24:45,905: INFO: proc(54): run_and_log_output: Output: Assertion Failed 2018-02-27 12:24:45,905: INFO: proc(54): run_and_log_output: Output: should not have embedded nulls if we parsed the end of string 2018-02-27 12:24:45,906: INFO: proc(54): run_and_log_output: Output: 2018-02-27 12:24:45,906: INFO: proc(54): run_and_log_output: Output: at Interop.Sys.DirectoryEntry.GetName(Span`1 buffer) 2018-02-27 12:24:45,906: INFO: proc(54): run_and_log_output: Output: at System.IO.Enumeration.FileSystemEntry.get_FileName() 2018-02-27 12:24:45,906: INFO: proc(54): run_and_log_output: Output: at System.IO.Enumeration.FileSystemEnumerableFactory.<>c__DisplayClass5_0.<UserEntries>b__1(FileSystemEntry& entry) 2018-02-27 12:24:45,907: INFO: proc(54): run_and_log_output: Output: at System.IO.Enumeration.FileSystemEnumerable`1.DelegateEnumerator.ShouldIncludeEntry(FileSystemEntry& entry) 2018-02-27 12:24:45,907: INFO: proc(54): run_and_log_output: Output: at System.IO.Enumeration.FileSystemEnumerator`1.MoveNext() 2018-02-27 12:24:45,907: INFO: proc(54): run_and_log_output: Output: at System.IO.FileSystem.RemoveDirectoryInternal(DirectoryInfo directory, Boolean recursive, Boolean throwOnTopLevelDirectoryNotFound) 2018-02-27 12:24:45,907: INFO: proc(54): run_and_log_output: Output: at System.IO.FileSystem.RemoveDirectory(String fullPath, Boolean recursive) 2018-02-27 12:24:45,908: INFO: proc(54): run_and_log_output: Output: at System.IO.Directory.Delete(String path, Boolean recursive) 2018-02-27 12:24:45,908: INFO: proc(54): run_and_log_output: Output: at System.IO.TempDirectory.DeleteDirectory() in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_true_prtest/src/Common/tests/System/IO/TempDirectory.cs:line 42 2018-02-27 12:24:45,909: INFO: proc(54): run_and_log_output: Output: at System.IO.TempDirectory.Dispose() in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_true_prtest/src/Common/tests/System/IO/TempDirectory.cs:line 35 2018-02-27 12:24:45,909: INFO: proc(54): run_and_log_output: Output: at System.Xml.Tests.TC_SchemaSet_Compile.TFS_470021() in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_true_prtest/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Compile.cs:line 91 2018-02-27 12:24:45,910: INFO: proc(54): run_and_log_output: Output: at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions) 2018-02-27 12:24:45,910: INFO: proc(54): run_and_log_output: Output: at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, BindingFlags invokeAttr, Object[] parameters, Object[] arguments) in /root/coreclr/src/mscorlib/src/System/Reflection/RuntimeMethodInfo.cs:line 489 2018-02-27 12:24:45,910: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestInvoker`1.<>c__DisplayClass46_1.<<InvokeTestMethodAsync>b__1>d.MoveNext() 2018-02-27 12:24:45,911: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-27 12:24:45,911: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestInvoker`1.<>c__DisplayClass46_1.<InvokeTestMethodAsync>b__1() 2018-02-27 12:24:45,911: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.ExecutionTimer.AggregateAsync(Func`1 asyncAction) 2018-02-27 12:24:45,912: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-27 12:24:45,912: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.ExecutionTimer.AggregateAsync(Func`1 asyncAction) 2018-02-27 12:24:45,912: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.ExceptionAggregator.RunAsync(Func`1 code) 2018-02-27 12:24:45,913: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-27 12:24:45,913: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.ExceptionAggregator.RunAsync(Func`1 code) 2018-02-27 12:24:45,913: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestInvoker`1.InvokeTestMethodAsync(Object testClassInstance) 2018-02-27 12:24:45,913: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-27 12:24:45,913: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestInvoker`1.InvokeTestMethodAsync(Object testClassInstance) 2018-02-27 12:24:45,913: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestInvoker`1.<RunAsync>b__45_0() 2018-02-27 12:24:45,914: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-27 12:24:45,914: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestInvoker`1.<RunAsync>b__45_0() 2018-02-27 12:24:45,914: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.ExceptionAggregator.RunAsync[T](Func`1 code) 2018-02-27 12:24:45,914: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-27 12:24:45,914: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.ExceptionAggregator.RunAsync[T](Func`1 code) 2018-02-27 12:24:45,915: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.XunitTestRunner.InvokeTestAsync(ExceptionAggregator aggregator) 2018-02-27 12:24:45,915: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-27 12:24:45,915: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.XunitTestRunner.InvokeTestAsync(ExceptionAggregator aggregator) 2018-02-27 12:24:45,915: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.ExceptionAggregator.RunAsync[T](Func`1 code) 2018-02-27 12:24:45,916: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-27 12:24:45,916: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.ExceptionAggregator.RunAsync[T](Func`1 code) 2018-02-27 12:24:45,916: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestRunner`1.RunAsync() 2018-02-27 12:24:45,917: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-27 12:24:45,917: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestRunner`1.RunAsync() 2018-02-27 12:24:45,917: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestCaseRunner`1.RunAsync() 2018-02-27 12:24:45,917: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-27 12:24:45,918: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestCaseRunner`1.RunAsync() 2018-02-27 12:24:45,918: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestMethodRunner`1.RunTestCasesAsync() 2018-02-27 12:24:45,918: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-27 12:24:45,918: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestMethodRunner`1.RunTestCasesAsync() 2018-02-27 12:24:45,919: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestMethodRunner`1.RunAsync() 2018-02-27 12:24:45,919: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-27 12:24:45,919: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestMethodRunner`1.RunAsync() 2018-02-27 12:24:45,919: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestClassRunner`1.RunTestMethodsAsync() 2018-02-27 12:24:45,919: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-27 12:24:45,920: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestClassRunner`1.RunTestMethodsAsync() 2018-02-27 12:24:45,920: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestClassRunner`1.RunAsync() 2018-02-27 12:24:45,920: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-27 12:24:45,920: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestClassRunner`1.RunAsync() 2018-02-27 12:24:45,920: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestCollectionRunner`1.RunTestClassesAsync() 2018-02-27 12:24:45,921: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-27 12:24:45,921: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestCollectionRunner`1.RunTestClassesAsync() 2018-02-27 12:24:45,921: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestCollectionRunner`1.RunAsync() 2018-02-27 12:24:45,921: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /root/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 922 2018-02-27 12:24:45,921: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestCollectionRunner`1.RunAsync() 2018-02-27 12:24:45,921: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.Task`1.InnerInvoke() in /root/coreclr/src/mscorlib/src/System/Threading/Tasks/future.cs:line 610 2018-02-27 12:24:45,922: INFO: proc(54): run_and_log_output: Output: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /root/coreclr/src/mscorlib/shared/System/Threading/ExecutionContext.cs:line 166 2018-02-27 12:24:45,922: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) in /root/coreclr/src/mscorlib/src/System/Threading/Tasks/Task.cs:line 2440 2018-02-27 12:24:45,922: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.Task.ExecuteEntry() in /root/coreclr/src/mscorlib/src/System/Threading/Tasks/Task.cs:line 2361 2018-02-27 12:24:45,923: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.SynchronizationContextTaskScheduler.<>c.<.cctor>b__8_0(Object s) in /root/coreclr/src/mscorlib/src/System/Threading/Tasks/TaskScheduler.cs:line 694 2018-02-27 12:24:45,923: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.MaxConcurrencySyncContext.RunOnSyncContext(SendOrPostCallback callback, Object state) 2018-02-27 12:24:45,923: INFO: proc(54): run_and_log_output: Output: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /root/coreclr/src/mscorlib/shared/System/Threading/ExecutionContext.cs:line 166 2018-02-27 12:24:45,923: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.MaxConcurrencySyncContext.WorkerThreadProc() 2018-02-27 12:24:45,923: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.XunitWorkerThread.<>c.<QueueUserWorkItem>b__5_0(Object _) 2018-02-27 12:24:45,924: INFO: proc(54): run_and_log_output: Output: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /root/coreclr/src/mscorlib/shared/System/Threading/ExecutionContext.cs:line 166 2018-02-27 12:24:45,924: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) in /root/coreclr/src/mscorlib/src/System/Threading/Tasks/Task.cs:line 2440 2018-02-27 12:24:45,924: INFO: proc(54): run_and_log_output: Output: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /root/coreclr/src/mscorlib/shared/System/Threading/ExecutionContext.cs:line 166 2018-02-27 12:24:47,225: INFO: proc(54): run_and_log_output: Output: /home/helixbot/dotnetbuild/work/0ec45d2b-1ec5-4f7f-8e8b-9183b55fcf0a/Work/67d69836-ddc0-4203-9413-cd7b112969c9/Unzip/RunTests.sh: line 94: 21004 Aborted ``` cc: @JeremyKuhne, @Anipik, @danmosemsft Related to https://github.com/dotnet/corefx/issues/27038 27505 area-System.Security WindowsPrincipalIsInRoleNeg test fails locally I deterministically get this failure when I run the tests for the repo: ``` Discovering: System.Security.Principal.Windows.Tests Discovered: System.Security.Principal.Windows.Tests Starting: System.Security.Principal.Windows.Tests WindowsPrincipalTests.WindowsPrincipalIsInRoleNeg [FAIL] System.ComponentModel.Win32Exception : The trust relationship between this workstation and the primary domain failed Stack Trace: d:\repos\corefx\src\System.Security.Principal.Windows\src\System\Security\Principal\NTAccount.cs(327,0): at System.Security.Principal.NTAccount.TranslateToSids(IdentityReferenceCollection sourceAccounts, Boolean& someFailed) d:\repos\corefx\src\System.Security.Principal.Windows\src\System\Security\Principal\NTAccount.cs(189,0): at System.Security.Principal.NTAccount.Translate(IdentityReferenceCollection sourceAccounts, Type targetType, Boolean& someFailed) d:\repos\corefx\src\System.Security.Principal.Windows\src\System\Security\Principal\NTAccount.cs(160,0): at System.Security.Principal.NTAccount.Translate(IdentityReferenceCollection sourceAccounts, Type targetType, Boolean forceSuccess) d:\repos\corefx\src\System.Security.Principal.Windows\src\System\Security\Principal\WindowsPrincipal.cs(68,0): at System.Security.Principal.WindowsPrincipal.IsInRole(String role) d:\repos\corefx\src\System.Security.Principal.Windows\tests\WindowsPrincipalTests.cs(15,0): at WindowsPrincipalTests.WindowsPrincipalIsInRoleNeg() ``` 27506 area-System.Globalization Japanese calendar test failures locally I deterministically get these test failures when I run the tests in the repo locally: ``` System.Globalization.Tests.MiscCalendarsTests.JapaneseTest [FAIL] Assert.Equal() Failure Expected: 2019-01-08T00:00:00.0000000 Actual: 1989-01-08T00:00:00.0000000 Stack Trace: d:\repos\corefx\src\System.Globalization.Calendars\tests\Misc\MiscCalendars.cs(44,0): at System.Globalization.Tests.MiscCalendarsTests.JapaneseTest() System.Globalization.Tests.JapaneseCalendarEras.Eras [FAIL] Assert.Equal() Failure Expected: Int32[] [4, 3, 2, 1] Actual: Int32[] [5, 4, 3, 2, 1] Stack Trace: d:\repos\corefx\src\System.Globalization.Calendars\tests\JapaneseCalendar\JapaneseCalendarEras.cs(14,0): at System.Globalization.Tests.JapaneseCalendarEras.Eras() System.Globalization.Tests.CalendarHelpers.ToDateTime_Invalid(calendar: JapaneseLunisolarCalendar { AlgorithmType = LunisolarCalendar, Eras = [5, 4, 3], IsReadOnly = False, MaxSupportedDateTime = 2050-01-22T23:59:59.9999999, MinSupportedDateTime = 1960-01-28T00:00:00.0000000, ... }) [FAIL] Assert.Throws() Failure Expected: typeof(System.ArgumentOutOfRangeException) Actual: (No exception was thrown) Stack Trace: d:\repos\corefx\src\System.Globalization.Calendars\tests\CalendarHelpers.cs(347,0): at System.Globalization.Tests.CalendarHelpers.ToDateTime_Invalid(Calendar calendar) ``` 27508 area-Infrastructure Microsoft.NETCore.App version required in netcoreapp2.1 preview A .NET Core Web API project targeting `netcoreapp2.1` requires right now `Microsoft.NETCore.App >= 2.1.0-preview2-26131-06`, which doesn't seem to exist in NuGet (yet). 27509 area-Infrastructure [release/2.1] Update BuildTools to 2.1.0-preview1-02523-01 This version includes a fix to unblock dependency auto-update flow after GitHub stopped allowing weak cryptographic standards: dotnet/core-eng#2734. This problem hasn't affected builds because 2.1 is built in ProdCon, where CoreFX's toolset isn't used to publish to dotnet/versions. 27510 area-Infrastructure Linux builds have increased in time beyond 1 hour average; needs investigation Opened on behalf of @jcagme Warnings: 2 Status Message: failed Build : Master - 20180227.02 (Product Build) Failing configurations: - RedHat6 - x64 - Linux - x64 [Mission Control Build Info](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/build~2Fproduct~2F/build/20180227.02/workItem/Orchestration/analysis/external/Link) In the last 4 days at least 3 build have failed since Linux and/or RH6 legs have timed out 27511 area-System.Security Use user-scope chains when doing Find with validOnly=true ".NET Framework's version passes new IntPtr(CAPI.HCCE_CURRENT_USER), so we need to also pass that same value (eventually) which we control by setting useMachineContext to false (which is the default for `new X509Chain()`). Fixes #27405. No test is added with this because adding trust to CU\Root gives a blocking modal dialog (""are you sure?""). Turns out, removing something from CU\Root also gives one. This was verified, however, by splicing a test into the CertificateRequest chains tests: * Verify that Find(validOnly=false) matched 1 thing * Verify that FInd(validOnly=true) matched 0 things * Add the new root to CU\Root (and accept the consent popup) * Add the new intermediate to CU\CA * Verify that FInd(validOnly=true) matched 1 thing * Remove the new intermediate from CU\CA * Remove the new root from CU\Root (and accept the consent popup) Given that that test runs 3 times per run (RSA, ECDSA, Hybrid) and I didn't think about the intermediate on the first attempt, many consent dialogs were seen in the making of this fix." 27512 area-Serialization [Perf][Windows_NT] Investigate System/Runtime/Serialization/Json/Tests/Performance/DcjsPerformanceTest Improvement/Regression between release/2.0.0 and release/2.1 There are multiple improvement/regressions across this noisy suite +/-4%. 27513 area-Serialization [Perf][Windows_NT] Investigate System/Runtime/Serialization/Json/Tests/Performance/JsonNetPerformanceTest Improvement/Regression between release/2.0.0 and release/2.1 There are multiple improvement/regressions across this noisy suite +/-4%. 27516 area-Serialization [Perf][Windows_NT] Investigate System/Runtime/Serialization/Xml/Tests/Performance/DcsPerformanceTest Improvement/Regression between release/2.0.0 and release/2.1 There are multiple improvement/regressions across this noisy suite +/-4%. 27518 area-System.Globalization [Perf] Investigate System/Globalization benchmarks improvements in 2.1 [Perf] Investigate System/Globalization benchmarks improvements in 2.1 Several DateTimeCultureInfo and NumberCultureInfo tests show improvements in 2.1 27519 area-System.Net [Fail] PostAsyncExpect100Continue_FailsAfterContentSendStarted_Throws Windows.10.Amd64.Open-Release-x86 ``` System.Net.Http.Functional.Tests.HttpRetryProtocolTests/ PostAsyncExpect100Continue_FailsAfterContentSendStarted_Throws ``` ``` System.Exception : Unexpected EOF trying to read request header at System.Net.Test.Common.LoopbackServer.Connection.ReadRequestHeaderAsync() in D:\j\workspace\windows-TGrou---f8ac6754\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 350 at System.Net.Http.Functional.Tests.HttpRetryProtocolTests.<>c__DisplayClass4_3.<<PostAsyncExpect100Continue_FailsAfterContentSendStarted_Throws>b__3>d.MoveNext() in D:\j\workspace\windows-TGrou---f8ac6754\src\System.Net.Http\tests\FunctionalTests\HttpRetryProtocolTests.cs:line 101 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.AcceptConnectionAsync(Func`2 funcAsync) in D:\j\workspace\windows-TGrou---f8ac6754\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 117 at System.Net.Http.Functional.Tests.HttpRetryProtocolTests.<>c__DisplayClass4_0.<<PostAsyncExpect100Continue_FailsAfterContentSendStarted_Throws>b__1>d.MoveNext() in D:\j\workspace\windows-TGrou---f8ac6754\src\System.Net.Http\tests\FunctionalTests\HttpRetryProtocolTests.cs:line 92 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.<>c__DisplayClass11_0.<<CreateClientAndServerAsync>b__0>d.MoveNext() in D:\j\workspace\windows-TGrou---f8ac6754\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 84 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.CreateServerAsync(Func`2 funcAsync, Options options) in D:\j\workspace\windows-TGrou---f8ac6754\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 67 at System.Net.Http.Functional.Tests.HttpRetryProtocolTests.PostAsyncExpect100Continue_FailsAfterContentSendStarted_Throws() in D:\j\workspace\windows-TGrou---f8ac6754\src\System.Net.Http\tests\FunctionalTests\HttpRetryProtocolTests.cs:line 70 --- End of stack trace from previous location where exception was thrown --- ``` Seen in https://github.com/dotnet/corefx/pull/27499 27520 area-System.Net HttpClient does not handle cookies with a non-matching path "_From @dgweldon on February 15, 2018 22:28_ I have an interesting problem related to OpenID Connect Authentication in ASP .NET Core. We have an Identity Server 3 OIDC implementation that uses a client certificate authentication provider. When migrating to ASP .NET Core, we had no problem integrating with our existing OIDC server. At least when launched from a browser (Edge, Chrome). However, we have a small ClickOnce application (using the full .NET framework) that also authenticates and makes calls through the ASP. It does this by using a HttpClient with a certificate selected by the user. This ClickOnce application fails during authentication. The code is pretty simple. ``` using (WebRequestHandler certHandler = new WebRequestHandler { CookieContainer = new CookieContainer(), ClientCertificateOptions = ClientCertificateOption.Manual, UseDefaultCredentials = true, AllowAutoRedirect = true }) { // Init certHandler.ClientCertificates.Add(certificate); using (HttpClient client = new HttpClient(certHandler) { BaseAddress = baseUri }) { HttpResponseMessage response = a_client.GetAsync(ssoLoginUri).GetAwaiter().GetResult(); response.EnsureSuccessStatusCode(); // Process self submitting form responses as long as needed do { response = ProcessFormAutoSubmit(a_client, response); } while (response != null); } } ``` After moving to ASP .NET Core, this code no longer works. The issue is that when MVC redirects to Identity Server, it includes 2 cookies (.ASPNetCore.Correlation.OpenIdConnect and .AspNetCore.OpenIdConnect.Nonce). Those cookies never make it into my CookieContainer (other cookies from Identity Server are handled fine). When the signin-oidc callback is made, MVC fails with the error: ""Correlation failed: .AspNetCore.Correlation.OpenIdConnect.9N18bzJ1hcpG5YjRMw_QgUJ_PnapfVx2lBmdvb8Q_zA' cookie not found."". Makes sense. But why is the cookie not added? After playing around, I was able to get around this by handling each redirect and manually adding any cookies that had a path (both of which the 2 missing cookies had). The code now looks like this: ``` ... HttpResponseMessage response = a_client.GetAsync(ssoLoginUri).GetAwaiter().GetResult(); Regex cookiePathRegex = new Regex(@""path=([^;]*);?""); do { // Ideally we would just use automatic redirects in the HttpClient, but we need to intercept cookies for special processing if (response.StatusCode == HttpStatusCode.Redirect) { Uri requestUri = response.Headers.Location; if (!requestUri.IsAbsoluteUri) { requestUri = UriUtil.Combine(response.RequestMessage.RequestUri.GetLeftPart(UriPartial.Authority), response.Headers.Location.OriginalString); } response = a_client.GetAsync(requestUri).GetAwaiter().GetResult(); IEnumerable<string> responseCookies = null; if (response.Headers.TryGetValues(""set-cookie"", out responseCookies)) { // Cookies that have a path aren't currently supported with HttpClient // Such cookies are used with the new ASP .NET Core OpenId Connect implementation // Just manually add these cookies foreach (string sCookie in responseCookies) { Match pathMatch = cookiePathRegex.Match(sCookie); if (pathMatch.Success) { a_webRequestHandler.CookieContainer.SetCookies( UriUtil.Combine(requestUri.GetLeftPart(UriPartial.Authority), pathMatch.Groups[1].Value), cookiePathRegex.Replace(sCookie, String.Empty)); } } } } else { response.EnsureSuccessStatusCode(); response = ProcessFormAutoSubmit(a_client, response); } } while (response != null); ``` This works, but seems like a hack. Any idea why these cookies aren't handled by HttpClient? I realize this may not be directly be an ASP .NET Core issue, but wanted to start here since it seems to be related to cookies from ASP .NET Core. Thanks, --David _Copied from original issue: aspnet/Home#2880_" 27522 area-System.IO Expose Path.Join and tests Goes with https://github.com/dotnet/coreclr/pull/16561. Will need an updated CoreCLR with those bits. Will fail until that point. cc: @pjanotti, @danmosemsft, @Anipik 27523 area-System.Data Fix issue 26965 transaction scope crash "Fixes GitHub issue: #26965 **Problem Description:** The culprit here is the platform specific if block, it only initializes the __**transactedConnectionPool**_ object for Windows and not for Linux/Mac, hence it later throws a NullReferenceException while closing the connection. **Affected Tests:** System.Data.SqlClient.ManualTesting.Tests.TransactionEnlistmentTest **Review:** Requesting review @saurabh500 @geleems @corivera **Before Changes** ```bash keerats@ubuntu:/mnt/d/corefx/src/System.Data.SqlClient/tests/ManualTests$ ~/dotnetcore/corefx/Tools/msbuild.sh /t:RebuildAndTest /p:ConfigurationGroup=Release /p:XunitOptions=""-class System.Data.SqlClient.ManualTesting.Tests.TransactionEnlistmentTest"" Microsoft (R) Build Engine version 15.5.179.9764 for .NET Core Copyright (C) Microsoft Corporation. All rights reserved. Address -> /mnt/d/corefx/bin/AnyOS.AnyCPU.Release/Address/netstandard/Address.dll Circle -> /mnt/d/corefx/bin/AnyOS.AnyCPU.Release/Circle/netstandard/Circle.dll Shapes -> /mnt/d/corefx/bin/AnyOS.AnyCPU.Release/Shapes/netstandard/Shapes.dll Utf8String -> /mnt/d/corefx/bin/AnyOS.AnyCPU.Release/Utf8String/netstandard/Utf8String.dll System.Data.SqlClient.ManualTesting.Tests -> /mnt/d/corefx/bin/AnyOS.AnyCPU.Release/System.Data.SqlClient.ManualTesting.Tests/netstandard/System.Data.SqlClient.ManualTesting.Tests.dll ----- start 13:33:50 =============== To repro directly: ===================================================== pushd /mnt/d/corefx/bin/tests/System.Data.SqlClient.ManualTesting.Tests/netcoreapp-Linux-Release-x64 chmod +x /mnt/d/corefx/bin/testhost/netcoreapp-Linux-Release-x64//dotnet /mnt/d/corefx/bin/testhost/netcoreapp-Linux-Release-x64//dotnet xunit.console.netcore.exe System.Data.SqlClient.ManualTesting.Tests.dll -xml testResults.xml -notrait Benchmark=true -notrait category=nonnetcoreapptests -notrait category=nonlinuxtests -class System.Data.SqlClient.ManualTesting.Tests.TransactionEnlistmentTest -notrait category=OuterLoop -notrait category=failing popd =========================================================================================================== /mnt/d/corefx/bin/tests/System.Data.SqlClient.ManualTesting.Tests/netcoreapp-Linux-Release-x64 /mnt/d/corefx/src/System.Data.SqlClient/tests/ManualTests xUnit.net console test runner (64-bit .NET Core) Copyright (C) 2014 Outercurve Foundation. Discovering: System.Data.SqlClient.ManualTesting.Tests Discovered: System.Data.SqlClient.ManualTesting.Tests Starting: System.Data.SqlClient.ManualTesting.Tests System.Data.SqlClient.ManualTesting.Tests.TransactionEnlistmentTest.TestAutoEnlistment_TxScopeComplete [FAIL] System.NullReferenceException : Object reference not set to an instance of an object. Stack Trace: /mnt/d/corefx/src/System.Data.SqlClient/src/System/Data/ProviderBase/DbConnectionPool.cs(834,0): at System.Data.ProviderBase.DbConnectionPool.DeactivateObject(DbConnectionInternal obj) /mnt/d/corefx/src/System.Data.SqlClient/src/System/Data/ProviderBase/DbConnectionPool.cs(1458,0): at System.Data.ProviderBase.DbConnectionPool.PutObject(DbConnectionInternal obj, Object owningObject) /mnt/d/corefx/src/System.Data.SqlClient/src/System/Data/ProviderBase/DbConnectionInternal.cs(451,0): at System.Data.ProviderBase.DbConnectionInternal.CloseConnection(DbConnection owningObject, DbConnectionFactory connectionFactory) /mnt/d/corefx/src/System.Data.SqlClient/src/System/Data/SqlClient/SqlConnection.cs(505,0): at System.Data.SqlClient.SqlConnection.Close() /mnt/d/corefx/src/System.Data.SqlClient/tests/ManualTests/SQL/TransactionTest/TransactionEnlistmentTest.cs(59,0): at System.Data.SqlClient.ManualTesting.Tests.TransactionEnlistmentTest.TestCase_AutoEnlistment_TxScopeComplete() /mnt/d/corefx/src/System.Data.SqlClient/tests/ManualTests/SQL/TransactionTest/TransactionEnlistmentTest.cs(197,0): at System.Data.SqlClient.ManualTesting.Tests.TransactionEnlistmentTest.RunTestFormat(Action testCase) /mnt/d/corefx/src/System.Data.SqlClient/tests/ManualTests/SQL/TransactionTest/TransactionEnlistmentTest.cs(185,0): at System.Data.SqlClient.ManualTesting.Tests.TransactionEnlistmentTest.RunTestSet(Action TestCase) System.Data.SqlClient.ManualTesting.Tests.TransactionEnlistmentTest.TestAutoEnlistment_TxScopeNonComplete [FAIL] System.NullReferenceException : Object reference not set to an instance of an object. Stack Trace: /mnt/d/corefx/src/System.Data.SqlClient/src/System/Data/ProviderBase/DbConnectionPool.cs(834,0): at System.Data.ProviderBase.DbConnectionPool.DeactivateObject(DbConnectionInternal obj) /mnt/d/corefx/src/System.Data.SqlClient/src/System/Data/ProviderBase/DbConnectionPool.cs(1458,0): at System.Data.ProviderBase.DbConnectionPool.PutObject(DbConnectionInternal obj, Object owningObject) /mnt/d/corefx/src/System.Data.SqlClient/src/System/Data/ProviderBase/DbConnectionInternal.cs(451,0): at System.Data.ProviderBase.DbConnectionInternal.CloseConnection(DbConnection owningObject, DbConnectionFactory connectionFactory) /mnt/d/corefx/src/System.Data.SqlClient/src/System/Data/SqlClient/SqlConnection.cs(505,0): at System.Data.SqlClient.SqlConnection.Close() /mnt/d/corefx/src/System.Data.SqlClient/tests/ManualTests/SQL/TransactionTest/TransactionEnlistmentTest.cs(84,0): at System.Data.SqlClient.ManualTesting.Tests.TransactionEnlistmentTest.TestCase_AutoEnlistment_TxScopeNonComplete() /mnt/d/corefx/src/System.Data.SqlClient/tests/ManualTests/SQL/TransactionTest/TransactionEnlistmentTest.cs(197,0): at System.Data.SqlClient.ManualTesting.Tests.TransactionEnlistmentTest.RunTestFormat(Action testCase) /mnt/d/corefx/src/System.Data.SqlClient/tests/ManualTests/SQL/TransactionTest/TransactionEnlistmentTest.cs(185,0): at System.Data.SqlClient.ManualTesting.Tests.TransactionEnlistmentTest.RunTestSet(Action TestCase) Finished: System.Data.SqlClient.ManualTesting.Tests === TEST EXECUTION SUMMARY === /mnt/d/corefx/Tools/tests.targets(492,5): warning : System.Data.SqlClient.ManualTesting.Tests Total: 5, Errors: 0, Failed: 2, Skipped: 0, Time: 1.507s [/mnt/d/corefx/src/System.Data.SqlClient/tests/ManualTests/System.Data.SqlClient.ManualTesting.Tests.csproj] /mnt/d/corefx/src/System.Data.SqlClient/tests/ManualTests ----- end 13:33:52 ----- exit code 1 ---------------------------------------------------------- /mnt/d/corefx/Tools/tests.targets(492,5): warning MSB3073: The command ""/mnt/d/corefx/bin/tests/System.Data.SqlClient.ManualTesting.Tests/netcoreapp-Linux-Release-x64/RunTests.sh /mnt/d/corefx/bin/testhost/netcoreapp-Linux-Release-x64/"" exited with code 1. [/mnt/d/corefx/src/System.Data.SqlClient/tests/ManualTests/System.Data.SqlClient.ManualTesting.Tests.csproj] /mnt/d/corefx/Tools/tests.targets(500,5): error : One or more tests failed while running tests from 'System.Data.SqlClient.ManualTesting.Tests' please check /mnt/d/corefx/bin/tests/System.Data.SqlClient.ManualTesting.Tests/netcoreapp-Linux-Release-x64/testResults.xml for details! [/mnt/d/corefx/src/System.Data.SqlClient/tests/ManualTests/System.Data.SqlClient.ManualTesting.Tests.csproj] keerats@ubuntu:/mnt/d/corefx/src/System.Data.SqlClient/tests/ManualTests$ ``` **After Changes** ```bash keerats@ubuntu:/mnt/d/corefx/src/System.Data.SqlClient/tests/ManualTests$ ~/dotnetcore/corefx/Tools/msbuild.sh /t:RebuildAndTest /p:ConfigurationGroup=Release /p:XunitOptions=""-class System.Data.SqlClient.ManualTesting.Tests.TransactionEnlistmentTest"" Microsoft (R) Build Engine version 15.5.179.9764 for .NET Core Copyright (C) Microsoft Corporation. All rights reserved. Circle -> /mnt/d/corefx/bin/AnyOS.AnyCPU.Release/Circle/netstandard/Circle.dll Address -> /mnt/d/corefx/bin/AnyOS.AnyCPU.Release/Address/netstandard/Address.dll Shapes -> /mnt/d/corefx/bin/AnyOS.AnyCPU.Release/Shapes/netstandard/Shapes.dll Utf8String -> /mnt/d/corefx/bin/AnyOS.AnyCPU.Release/Utf8String/netstandard/Utf8String.dll System.Data.SqlClient.ManualTesting.Tests -> /mnt/d/corefx/bin/AnyOS.AnyCPU.Release/System.Data.SqlClient.ManualTesting.Tests/netstandard/System.Data.SqlClient.ManualTesting.Tests.dll ----- start 13:40:09 =============== To repro directly: ===================================================== pushd /mnt/d/corefx/bin/tests/System.Data.SqlClient.ManualTesting.Tests/netcoreapp-Linux-Release-x64 chmod +x /mnt/d/corefx/bin/testhost/netcoreapp-Linux-Release-x64//dotnet /mnt/d/corefx/bin/testhost/netcoreapp-Linux-Release-x64//dotnet xunit.console.netcore.exe System.Data.SqlClient.ManualTesting.Tests.dll -xml testResults.xml -notrait Benchmark=true -notrait category=nonnetcoreapptests -notrait category=nonlinuxtests -class System.Data.SqlClient.ManualTesting.Tests.TransactionEnlistmentTest -notrait category=OuterLoop -notrait category=failing popd =========================================================================================================== /mnt/d/corefx/bin/tests/System.Data.SqlClient.ManualTesting.Tests/netcoreapp-Linux-Release-x64 /mnt/d/corefx/src/System.Data.SqlClient/tests/ManualTests xUnit.net console test runner (64-bit .NET Core) Copyright (C) 2014 Outercurve Foundation. Discovering: System.Data.SqlClient.ManualTesting.Tests Discovered: System.Data.SqlClient.ManualTesting.Tests Starting: System.Data.SqlClient.ManualTesting.Tests Finished: System.Data.SqlClient.ManualTesting.Tests === TEST EXECUTION SUMMARY === System.Data.SqlClient.ManualTesting.Tests Total: 5, Errors: 0, Failed: 0, Skipped: 0, Time: 1.680s /mnt/d/corefx/src/System.Data.SqlClient/tests/ManualTests ----- end 13:40:11 ----- exit code 0 ---------------------------------------------------------- keerats@ubuntu:/mnt/d/corefx/src/System.Data.SqlClient/tests/ManualTests$ ```" 27524 area-System.Security Make Decrypt_512_NoData_FixedValue pass on netfx Fixes #27442. 27525 area-System.IO Remove ActiveIssue tags now that CLR is updated Fixes #27269 cc: @Anipik, @pjanotti, @danmosemsft 27526 area-System.Memory [API] Add MemoryExtensions.Contains Proposal: ```cs public static class MemoryExtensions { bool Contains<T>(this Span<T> span, T value); bool Contains<T>(this ReadOnlySpan<T> span, T value); bool Contains<T>(this Span<T> span, T value, IEqualityComparer<T> comparer); bool Contains<T>(this ReadOnlySpan<T> span, T value, IEqualityComparer<T> comparer); } ``` This is different from the `IndexOf` method in that we can perform certain optimizations if we know you don't need the exact index of where the value was found. There are a few places in the framework that would benefit from this. https://github.com/dotnet/corefx/blob/f0a032e4a1c8a848574a5db3e69e8a6fa0aae91e/src/System.Net.Primitives/src/System/Net/IPAddressParser.cs#L19 https://github.com/dotnet/coreclr/blob/8ec9bdfd53220b555f0b19eebd6a2c4ab5dab8bf/src/mscorlib/shared/System/Guid.cs#L430 https://github.com/dotnet/corefxlab/blob/c3624ba2c5f4fc4926ef64e5e35f2f6e895df6eb/src/System.Buffers.Experimental/System/Buffers/BufferExtensions.cs#L101 https://github.com/dotnet/coreclr/blob/22f1bc00d018a49f9550ee3b564f5f7737960b0d/src/mscorlib/shared/System/Version.cs#L342 27527 area-System.Net [Regression][Linux] System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test / GetAsync_AllowedSSLVersion_Succeeds ## Test failure ### Server returned nothing (no headers, no data) ``` System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.CurlException : Server returned nothing (no headers, no data) at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) in /root/corefx-1420690/src/System.Net.Http/src/System/Net/Http/HttpClient.cs:line 469 at System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test.<>c__DisplayClass4_0.<<GetAsync_AllowedSSLVersion_Succeeds>b__0>d.MoveNext() in /root/corefx-1420690/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.SslProtocols.cs:line 121 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.CreateServerAsync(Func`2 funcAsync, Options options) in /root/corefx-1420690/src/Common/tests/System/Net/Http/LoopbackServer.cs:line 67 at System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test.GetAsync_AllowedSSLVersion_Succeeds(SslProtocols acceptedProtocol, Boolean requestOnlyThisProtocol) in /root/corefx-1420690/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.SslProtocols.cs:line 119 --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Net.Http.CurlHandler.ThrowIfCURLEError(CURLcode error) in /root/corefx-1420690/src/System.Net.Http/src/System/Net/Http/CurlHandler/CurlHandler.cs:line 661 at System.Net.Http.CurlHandler.MultiAgent.FinishRequest(StrongToWeakReference`1 easyWrapper, CURLcode messageResult) in /root/corefx-1420690/src/System.Net.Http/src/System/Net/Http/CurlHandler/CurlHandler.MultiAgent.cs:line 883 ``` ## Failure history Day | Build | OS | Details -- | -- | -- | -- 2/21 | 20180221.05 | RedHat69 | 2/23 | 20180223.04 | Ubuntu17.10 | 2/23 | 20180223.06 | Suse12 | [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180223.06/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test~2FGetAsync_AllowedSSLVersion_Succeeds(acceptedProtocol:%20Tls,%20requestOnlyThisProtocol:%20True)) 2/23 | 20180223.06 | Ubuntu18.04 | [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180223.06/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test~2FGetAsync_AllowedSSLVersion_Succeeds(acceptedProtocol:%20Tls,%20requestOnlyThisProtocol:%20True)) 2/24 | 20180224.02 | Suse12 | [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180224.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test~2FGetAsync_AllowedSSLVersion_Succeeds(acceptedProtocol:%20Tls,%20requestOnlyThisProtocol:%20True)) 2/26 | 20180226.02 | Ubuntu14.04 | [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180226.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test~2FGetAsync_AllowedSSLVersion_Succeeds(acceptedProtocol:%20Tls,%20requestOnlyThisProtocol:%20True)) 2/27 | 20180227.01 | Ubuntu14.04 | [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180227.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test~2FGetAsync_AllowedSSLVersion_Succeeds(acceptedProtocol:%20Tls,%20requestOnlyThisProtocol:%20True)) 2/28 | 20180228.03 | Debian90 2/28 | 20180228.03 | Ubuntu16.04 2/28 | 20180228.03 | OpenSuse42.3 2/28 | 20180228.04 | OpenSuse42.3 2/28 | 20180228.04 | RedHat69 2/28 | 20180228.07 | SLES12 3/1 | 20180301.01 | Ubuntu14.04 3/1 | 20180301.04 | OpenSuse42.3 3/5 | 20180305.03 | Debian90 3/7 | 20180307.04 | RedHat69 3/8 | 20180308.09 | OpenSuse42.3 3/13 | 20180313.01 | SLES12 3/18 | 20180318.01 | Ubuntu17.10 4/2 | 20180402.05 | SLES12 4/3 | 20180403.04 | RedHat69 27528 area-System.Net [New test] Test failure: System.Net.Http.Functional.Tests.HttpClientHandler_ResponseDrain_Test / * - Unexpected EOF trying to read request header ## Failure type The test was added on 2/23 ``` System.Exception : Unexpected EOF trying to read request header at System.Net.Test.Common.LoopbackServer.Connection.ReadRequestHeaderAsync() in E:\A\_work\14\s\corefx\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 350 at System.Net.Test.Common.LoopbackServer.Connection.ReadRequestHeaderAndSendCustomResponseAsync(String response) in E:\A\_work\14\s\corefx\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 363 at System.Net.Http.Functional.Tests.HttpClientHandler_ResponseDrain_Test.<>c__DisplayClass3_1.<<GetAsyncWithMaxConnections_DisposeBeforeReadingToEnd_DrainsRequestsAndReusesConnection>b__2>d.MoveNext() in E:\A\_work\14\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.ResponseDrain.cs:line 166 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.AcceptConnectionAsync(Func`2 funcAsync) in E:\A\_work\14\s\corefx\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 117 at System.Net.Http.Functional.Tests.HttpClientHandler_ResponseDrain_Test.<>c__DisplayClass3_0.<<GetAsyncWithMaxConnections_DisposeBeforeReadingToEnd_DrainsRequestsAndReusesConnection>b__1>d.MoveNext() in E:\A\_work\14\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.ResponseDrain.cs:line 163 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.<>c__DisplayClass11_0.<<CreateClientAndServerAsync>b__0>d.MoveNext() in E:\A\_work\14\s\corefx\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 84 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.CreateServerAsync(Func`2 funcAsync, Options options) in E:\A\_work\14\s\corefx\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 67 at System.Net.Http.Functional.Tests.HttpClientHandler_ResponseDrain_Test.GetAsyncWithMaxConnections_DisposeBeforeReadingToEnd_DrainsRequestsAndReusesConnection(Int32 totalSize, Int32 readSize, ContentMode mode) in E:\A\_work\14\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.ResponseDrain.cs:line 134 --- End of stack trace from previous location where exception was thrown --- ``` ## Failure history Day | Build | OS | Details -- | -- | -- | -- 2/24 | 20180224.02 | OSX10.13 | GetAsync_DisposeBeforeReadingToEnd_DrainsRequestsAndReusesConnection - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180224.02/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_ResponseDrain_Test~2FGetAsync_DisposeBeforeReadingToEnd_DrainsRequestsAndReusesConnection(mode:%20BytePerChunk)) 2/27 | 20180227.01 | Win7 | GetAsyncWithMaxConnections_DisposeBeforeReadingToEnd_DrainsRequestsAndReusesConnection - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180227.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_ResponseDrain_Test~2FGetAsyncWithMaxConnections_DisposeBeforeReadingToEnd_DrainsRequestsAndReusesConnection(totalSize:%201000,%20readSize:%20950,%20mode:%20SingleChunk)) 2/27 | 20180227.01 | OSX10.13 | GetAsync_DisposeBeforeReadingToEnd_DrainsRequestsAndReusesConnection - [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180227.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_ResponseDrain_Test~2FGetAsync_DisposeBeforeReadingToEnd_DrainsRequestsAndReusesConnection(mode:%20BytePerChunk)) 27529 area-System.Net unable to parse IPv6 link-local address with interface name "https://tools.ietf.org/html/rfc4007#section-11.3 The example shows ff08::9abc%interface10 and Unix systems generally use address%if_name notation. (https://en.wikipedia.org/wiki/IPv6_address) > furt@Ubuntu:~/ipv6$ ping6 fe80::108e:ac5e:1999:d42f%enp0s5 > PING fe80::108e:ac5e:1999:d42f%enp0s5(fe80::108e:ac5e:1999:d42f) 56 data bytes > .... > however ```C# IPAddress.Parse(""fe80::108e:ac5e:1999:d42f%enp0s5"") Unhandled Exception: System.FormatException: An invalid IP address was specified. ---> System.Net.Sockets.SocketException: Invalid argument ``` throws exception. The c# parser assumes that the zoneid can only be integer. On Linux and macOS this can be either interface index or valid interface name. " 27531 area-Infrastructure Re-enable UAP builds - Revert the three commits that initially disabled the build - Add a uapaot flavor for System.Numerics.Vectors. It can no longer use the uap flavor since it depends directly on System.Private.CoreLib (whose strong name key is different for uap and uapaot). - Fix a series of UAP build breaks that have crept in over the last couple weeks Fixes https://github.com/dotnet/corefx/issues/26802 27532 area-System.Text Prefer the generic IEnumerator over non-generic in regex MatchCollection and GroupCollection This allows the use of `var` in `foreach` loops as well as removing the `.Cast<Match>()` noise in LINQ queries. A merge commit for this pull request to preserve the commit's GPG signature is appreciated. 27533 area-Microsoft.CSharp Don't look at base classes for interfaces in Microsoft.CSharp Since the interface list obtained through reflection already includes those inherited from base classes the first pass contains all the interfaces and the later passes are redundant. Since only `AggregateType` would have any results in the removed `AllPossibleInterfaces` just include testing for that as part of seeing if there is a matching interface. 27534 area-System.IO UnixSearchPatternFileValidChar test failed on Linux in CI https://mc.dot.net/#/user/stephentoub/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/80ee09145e8bfc94263218893ca47dcf67675ae5/workItem/System.IO.FileSystem.Tests/analysis/xunit/System.IO.Tests.DirectoryInfo_EnumFSI_str_str~2FUnixSearchPatternFileValidChar(valid:%20%5C%22%20%20%20%20%20%20%20%20%20%5C%22) ``` Unhandled Exception of Type Xunit.Sdk.ContainsException Message : Assert.Contains() Failure Not found: /tmp/DirectoryInfo_EnumFSI_str_str_maxzoa0e.h5p/UnixSearchPatternFileValidChar_999_3530a72b/ In value: String[] [] Stack Trace : at System.IO.Tests.Directory_GetFileSystemEntries_str_str.UnixSearchPatternFileValidChar(String valid) in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/src/System.IO.FileSystem/tests/Directory/GetFileSystemEntries_str_str.cs:line 1004 ``` 27536 area-System.Net disable drain test variation for CurlHandler Fixes #27528 @stephentoub @davidsh @dotnet/ncl 27537 area-System.Drawing Is the upcoming .net core 2.1 going to include System.Drawing.common? Does anyone know where i can find the list of libraries that are going to be included in each new release of .Net Core? I am trying to use System.Drawing.Common in particular. If it is not, does anyone know when it will be included? 27538 area-System.Net disable Expect: 100-continue test on WinHttpHandler Fixes #27519 @stephentoub 27539 area-System.IO Fix a bug in TranslateWin32Expression Add test coverage. cc: @danmosemsft, @Anipik, @pjanotti 27541 area-System.Runtime Expose Thread.GetCurrentProcessorId() Fixes #16767 27542 area-System.Net Socket_CreateUnixDomainSocket_Throws_OnWindows fails locally on Windows This test fails locally for me: ```C# [OuterLoop] // TODO: Issue #11345 [Fact] [PlatformSpecific(TestPlatforms.Windows)] // CreateUnixDomainSocket should throw on Windows public void Socket_CreateUnixDomainSocket_Throws_OnWindows() { SocketException e = Assert.Throws<SocketException>(() => new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified)); Assert.Equal(SocketError.AddressFamilyNotSupported, e.SocketErrorCode); } ``` as `new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified)` doesn't throw, on both core and netfx. Presumably the AF_UNIX address family is now supported on my Windows OS, maybe due to my having installed Windows Subsystem for Linux. 27543 area-System.Memory ArrayMemoryPool.ArrayMemoryPoolBuffer implementation of ref counting isn't thread safe We're not using interlocked for some reason here and we should be https://github.com/dotnet/corefx/blob/865f08623bd493fb6d239530e00db29bf6736330/src/System.Memory/src/System/Buffers/ArrayMemoryPool.ArrayMemoryPoolBuffer.cs#L80-L98. This could potentially lead to leaks. /cc @jkotas @AtsushiKan @ahsonkhan @pakrym @KrzysztofCwalina 27544 area-System.Memory ArrayMemoryPool.ArrayMemoryPoolBuffer implementation does not dispose if the ref count reaches 0 Seems like when we ported this from corefxlab we removed a bunch of functionality. Originally the implementation called Dispose on the reference count = 0: https://github.com/dotnet/corefxlab/blob/c81145ba362ca6649dcf97ae662869f7005061ee/src/System.Buffers.Primitives/System/Buffers/Pooling/ArrayMemoryPool.cs#L91-L97 Now it does nothing. https://github.com/dotnet/corefx/blob/master/src/System.Memory/src/System/Buffers/ArrayMemoryPool.ArrayMemoryPoolBuffer.cs#L88 This is making pipelines basically leak memory like crazy when using this pool implementation (which is now the default). Can we clarify on the semantics here ASAP? /cc @stephentoub @KrzysztofCwalina @ahsonkhan @AtsushiKan 27546 area-System.Net Test failed: System.Net.Tests.HttpListenerResponseTests / CopyFrom_AllValues_ReturnsClone https://mc.dot.net/#/user/maryamariyan/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/103ec78a5875598ab5c876a9a7520615796dcbf4/workItem/System.Net.HttpListener.Tests/wilogs ``` 2018-02-27 06:39:02,321: INFO: proc(54): run_and_log_output: Output: System.Net.Tests.HttpListenerResponseTests.CopyFrom_AllValues_ReturnsClone [FAIL] 2018-02-27 06:39:02,321: INFO: proc(54): run_and_log_output: Output: System.BadImageFormatException : Invalid access to memory location. (Exception from HRESULT: 0x800703E6) 2018-02-27 06:39:02,321: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2018-02-27 06:39:02,384: INFO: proc(54): run_and_log_output: Output: at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) 2018-02-27 06:39:02,384: INFO: proc(54): run_and_log_output: Output: E:\A\_work\12\s\src\mscorlib\src\System\Runtime\InteropServices\Marshal.cs(1055,0): at System.Runtime.InteropServices.Marshal.FreeHGlobal(IntPtr hglobal) 2018-02-27 06:39:02,384: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---a11f5128\src\System.Net.HttpListener\src\System\Net\Windows\RequestContextBase.cs(57,0): at System.Net.RequestContextBase.Dispose(Boolean disposing) 2018-02-27 06:39:02,384: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---a11f5128\src\System.Net.HttpListener\src\System\Net\Windows\AsyncRequestContext.cs(97,0): at System.Net.AsyncRequestContext.Dispose(Boolean disposing) 2018-02-27 06:39:02,384: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---a11f5128\src\System.Net.HttpListener\src\System\Net\Windows\RequestContextBase.cs(50,0): at System.Net.RequestContextBase.Dispose() 2018-02-27 06:39:02,384: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---a11f5128\src\System.Net.HttpListener\src\System\Net\Windows\RequestContextBase.cs(44,0): at System.Net.RequestContextBase.Close() 2018-02-27 06:39:02,384: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---a11f5128\src\System.Net.HttpListener\src\System\Net\Windows\HttpListenerRequest.Windows.cs(334,0): at System.Net.HttpListenerRequest.Close() 2018-02-27 06:39:02,384: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---a11f5128\src\System.Net.HttpListener\src\System\Net\Windows\HttpListenerContext.Windows.cs(88,0): at System.Net.HttpListenerContext.Close() 2018-02-27 06:39:02,384: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---a11f5128\src\System.Net.HttpListener\src\System\Net\Windows\HttpListenerResponse.Windows.cs(185,0): at System.Net.HttpListenerResponse.Dispose() 2018-02-27 06:39:02,384: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---a11f5128\src\System.Net.HttpListener\src\System\Net\HttpListenerResponse.cs(297,0): at System.Net.HttpListenerResponse.System.IDisposable.Dispose() 2018-02-27 06:39:02,384: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---a11f5128\src\System.Net.HttpListener\tests\HttpListenerResponseTests.cs(96,0): at System.Net.Tests.HttpListenerResponseTests.CopyFrom_AllValues_ReturnsClone() 2018-02-27 06:39:02,384: INFO: proc(54): run_and_log_output: Output: --- End of stack trace from previous location where exception was thrown --- 2018-02-27 06:39:03,821: INFO: proc(54): run_and_log_output: Output: ----- end 6:39:03.82 ----- exit code -1073741819 ---------------------------------------------------------- ``` 27547 area-System.Diagnostics Test failure: System.Diagnostics.Tests.ProcessTests/ProcessStart_UseShellExecuteTrue_OpenMissingFile_Throws Opened on behalf of @Sunny-pu The test `System.Diagnostics.Tests.ProcessTests/ProcessStart_UseShellExecuteTrue_OpenMissingFile_Throws` has failed. Assert.Throws() Failure Expected: typeof(System.ComponentModel.Win32Exception) Actual: (No exception was thrown) Stack Trace: at System.Diagnostics.Tests.ProcessTests.ProcessStart_UseShellExecuteTrue_OpenMissingFile_Throws() in /Users/buildagent/agent/_work/168/s/corefx/src/System.Diagnostics.Process/tests/ProcessTests.cs:line 183 Build : Master - 20180228.03 (Core Tests) Failing configurations: - OSX.1013.Amd64-x64 - Release - OSX.1012.Amd64-x64 - Release - RedHat.69.Amd64-x64 - Release - OpenSuse.423.Amd64-x64 - Release - RedHat.74.Amd64-x64 - Release - RedHat.73.Amd64-x64 - Release - Centos.74.Amd64-x64 - Release - Centos.73.Amd64-x64 - Release Details: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180228.03/workItem/System.Diagnostics.Process.Tests/analysis/xunit/System.Diagnostics.Tests.ProcessTests~2FProcessStart_UseShellExecuteTrue_OpenMissingFile_Throws 27549 area-System.Net [Desktop] System.AccessViolationException on HttpClient with Certificates "Hi, I think, this bug relates to #17127, respective to #15839. When I'm using mutual authentification per SSL and I send something to a server, then I get a `System.AccessViolationException` without any stack trace. Here is my custom class which extends `HttpClient` and uses a client certificate and has a custom certificate validation: ```C# public class QlcHttpsClient : HttpClient { private static readonly QlcHttpsClient instance = new QlcHttpsClient(); public QlcHttpsClient() : base(GetHttpMessageHandler()) { } public static QlcHttpsClient Instance { get { return instance; } } private static HttpMessageHandler GetHttpMessageHandler() { X509Certificate2 cert = new X509Certificate2(); cert.Import(GetClientCertificate(), ""mypass"", X509KeyStorageFlags.DefaultKeySet); var clientHandler = new WebRequestHandler(); clientHandler.ClientCertificates.Add(cert); clientHandler.ServerCertificateValidationCallback = RemoteCertificateValidationCallback; return clientHandler; } private static byte[] GetClientCertificate() { var res = new ResourceManager(""QLCClient.resources"", typeof(QlcTestResultsController).Assembly); byte[] rawCert = (byte[]) res.GetObject(""my_cert""); return rawCert; } private static bool RemoteCertificateValidationCallback(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { string thumbprint = certificate.GetCertHashString(); string expectedThumbprint = ""5D772BB5C085AB490E2773DAA54EC27F3605BDF9""; if (certificate.Issuer.Contains(""CN=MyCN"") && thumbprint.Equals(expectedThumbprint, StringComparison.OrdinalIgnoreCase)) { return true; } return false; } } ``` When I step with Visual Studio line by line, then I get the named Exception on `SendAsync()`. ```C# class QlcHttpTransmitter { private static readonly QlcHttpsClient client = QlcHttpsClient.Instance; public static async Task<HttpResponseMessage> Send(string pathValue, HttpContent content, HttpMethod httpMethod) { UriBuilder builder = QlcUriBuilder.GetUriBuilder(pathValue); HttpRequestMessage httpRequestMessage = new HttpRequestMessage(httpMethod, builder.Uri) { Content = content }; HttpResponseMessage response = await client.SendAsync(httpRequestMessage); // Throws System.AccessViolationException return response; } } ``` I'm using .Net Framework 4.6.2 and I get this Exception only in my system test. But when I migrate to .Net Framework 4.7.1 then I get this also in production code. So I think the bug is always there and it depends on the runtime behaviour." 27550 area-System.Net SocketsHttpHandler: including NT auth sources causes trace test to fail After adding the NT auth source files to the project, there seems to be some sort of event source conflict. The SendAsync_HttpTracingEnabled_Succeeds is failing, specifically on this line: ```csharp Assert.DoesNotContain(events, ev => ev.EventId == 0); // make sure there are no event source error messages ``` I'm disabling the test for now. 27551 area-System.Net SocketsHttpHandler: add ntlm auth and proxy auth for tunnel, and rework auth handling generally Several auth-related changes: (1) Add support for Negotiate and NTLM auth (2) Add support for proxy auth on SSL proxy tunnel (3) Consolidate and rework some auth logic (4) Fix some auth bugs Note that we don't have automated NTLM tests currently (due to test environment issues), so I tested NTLM auth manually on my local machine against a local IIS server. Fixes #27477 Fixes #27293 Fixes #26325 Fixes #23154 Fixes #23153 @stephentoub @davidsh @dotnet/ncl 27552 area-System.IO Several FileSystem and Path tests failing with latest coreclr "``` 2018-02-28 13:24:45,135: INFO: proc(54): run_and_log_output: Output: System.IO.Tests.PathTests_Windows.GetPathRoot_Span(value: \""C:\\\\\\\\\"", expected: \""C:\\\\\"") [FAIL] 2018-02-28 13:24:45,135: INFO: proc(54): run_and_log_output: Output: Assert.Equal() Failure 2018-02-28 13:24:45,135: INFO: proc(54): run_and_log_output: Output: ↓ (pos 3) 2018-02-28 13:24:45,135: INFO: proc(54): run_and_log_output: Output: Expected: C:\ 2018-02-28 13:24:45,135: INFO: proc(54): run_and_log_output: Output: Actual: C:\\ 2018-02-28 13:24:45,135: INFO: proc(54): run_and_log_output: Output: ↑ (pos 3) 2018-02-28 13:24:45,135: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2018-02-28 13:24:45,244: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---74aa877a\src\System.Runtime.Extensions\tests\System\IO\PathTests_Windows.netcoreapp.cs(17,0): at System.IO.Tests.PathTests_Windows.GetPathRoot_Span(String value, String expected) 2018-02-28 13:24:45,244: INFO: proc(54): run_and_log_output: Output: System.IO.Tests.PathTests_Windows.GetPathRoot_Span(value: \""C:\\\\\\\\foo2\"", expected: \""C:\\\\\"") [FAIL] 2018-02-28 13:24:45,244: INFO: proc(54): run_and_log_output: Output: Assert.Equal() Failure 2018-02-28 13:24:45,244: INFO: proc(54): run_and_log_output: Output: ↓ (pos 3) 2018-02-28 13:24:45,244: INFO: proc(54): run_and_log_output: Output: Expected: C:\ 2018-02-28 13:24:45,244: INFO: proc(54): run_and_log_output: Output: Actual: C:\\ 2018-02-28 13:24:45,244: INFO: proc(54): run_and_log_output: Output: ↑ (pos 3) 2018-02-28 13:24:45,244: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2018-02-28 13:24:45,244: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---74aa877a\src\System.Runtime.Extensions\tests\System\IO\PathTests_Windows.netcoreapp.cs(17,0): at System.IO.Tests.PathTests_Windows.GetPathRoot_Span(String value, String expected) 2018-02-28 13:24:45,244: INFO: proc(54): run_and_log_output: Output: System.IO.Tests.PathTests_Windows.GetPathRoot_Span(value: \""\\\\\\\\test\\\\unc\\\\path\\\\to\\\\something\"", expected: \""\\\\\\\\test\\\\unc\"") [FAIL] 2018-02-28 13:24:45,260: INFO: proc(54): run_and_log_output: Output: Assert.Equal() Failure 2018-02-28 13:24:45,260: INFO: proc(54): run_and_log_output: Output: ↓ (pos 10) 2018-02-28 13:24:45,260: INFO: proc(54): run_and_log_output: Output: Expected: \\test\unc 2018-02-28 13:24:45,260: INFO: proc(54): run_and_log_output: Output: Actual: \\test\unc\ 2018-02-28 13:24:45,260: INFO: proc(54): run_and_log_output: Output: ↑ (pos 10) 2018-02-28 13:24:45,260: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2018-02-28 13:24:45,260: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---74aa877a\src\System.Runtime.Extensions\tests\System\IO\PathTests_Windows.netcoreapp.cs(17,0): at System.IO.Tests.PathTests_Windows.GetPathRoot_Span(String value, String expected) 2018-02-28 13:24:45,260: INFO: proc(54): run_and_log_output: Output: System.IO.Tests.PathTests_Windows.GetPathRoot_Span(value: \""\\\\\\\\a\\\\b\\\\c\\\\d\\\\e\"", expected: \""\\\\\\\\a\\\\b\"") [FAIL] 2018-02-28 13:24:45,260: INFO: proc(54): run_and_log_output: Output: Assert.Equal() Failure 2018-02-28 13:24:45,260: INFO: proc(54): run_and_log_output: Output: ↓ (pos 5) 2018-02-28 13:24:45,260: INFO: proc(54): run_and_log_output: Output: Expected: \\a\b 2018-02-28 13:24:45,260: INFO: proc(54): run_and_log_output: Output: Actual: \\a\b\ 2018-02-28 13:24:45,260: INFO: proc(54): run_and_log_output: Output: ↑ (pos 5) 2018-02-28 13:24:45,260: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2018-02-28 13:24:45,260: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---74aa877a\src\System.Runtime.Extensions\tests\System\IO\PathTests_Windows.netcoreapp.cs(17,0): at System.IO.Tests.PathTests_Windows.GetPathRoot_Span(String value, String expected) 2018-02-28 13:24:45,260: INFO: proc(54): run_and_log_output: Output: System.IO.Tests.PathTests_Windows.GetPathRoot_Span(value: \""\\\\\\\\a\\\\b\\\\\"", expected: \""\\\\\\\\a\\\\b\"") [FAIL] 2018-02-28 13:24:45,260: INFO: proc(54): run_and_log_output: Output: Assert.Equal() Failure 2018-02-28 13:24:45,260: INFO: proc(54): run_and_log_output: Output: ↓ (pos 5) 2018-02-28 13:24:45,260: INFO: proc(54): run_and_log_output: Output: Expected: \\a\b 2018-02-28 13:24:45,260: INFO: proc(54): run_and_log_output: Output: Actual: \\a\b\ 2018-02-28 13:24:45,260: INFO: proc(54): run_and_log_output: Output: ↑ (pos 5) 2018-02-28 13:24:45,260: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2018-02-28 13:24:45,260: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---74aa877a\src\System.Runtime.Extensions\tests\System\IO\PathTests_Windows.netcoreapp.cs(17,0): at System.IO.Tests.PathTests_Windows.GetPathRoot_Span(String value, String expected) 2018-02-28 13:24:45,260: INFO: proc(54): run_and_log_output: Output: System.IO.Tests.PathTests_Windows.GetPathRoot_Span(value: \""\\\\\\\\?\\\\UNC\\\\test\\\\unc\\\\path\\\\to\\\\something\"", expected: \""\\\\\\\\?\\\\UNC\\\\test\\\\unc\"") [FAIL] 2018-02-28 13:24:45,260: INFO: proc(54): run_and_log_output: Output: Assert.Equal() Failure 2018-02-28 13:24:45,260: INFO: proc(54): run_and_log_output: Output: ↓ (pos 16) 2018-02-28 13:24:45,260: INFO: proc(54): run_and_log_output: Output: Expected: \\?\UNC\test\unc 2018-02-28 13:24:45,260: INFO: proc(54): run_and_log_output: Output: Actual: \\?\UNC\test\unc\ 2018-02-28 13:24:45,260: INFO: proc(54): run_and_log_output: Output: ↑ (pos 16) 2018-02-28 13:24:45,260: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2018-02-28 13:24:45,260: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---74aa877a\src\System.Runtime.Extensions\tests\System\IO\PathTests_Windows.netcoreapp.cs(17,0): at System.IO.Tests.PathTests_Windows.GetPathRoot_Span(String value, String expected) 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: System.IO.Tests.PathTests_Windows.GetPathRoot_Span(value: \""\\\\\\\\?\\\\UNC\\\\a\\\\b2\\\\\"", expected: \""\\\\\\\\?\\\\UNC\\\\a\\\\b2\"") [FAIL] 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: Assert.Equal() Failure 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: ↓ (pos 12) 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: Expected: \\?\UNC\a\b2 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: Actual: \\?\UNC\a\b2\ 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: ↑ (pos 12) 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---74aa877a\src\System.Runtime.Extensions\tests\System\IO\PathTests_Windows.netcoreapp.cs(17,0): at System.IO.Tests.PathTests_Windows.GetPathRoot_Span(String value, String expected) 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: System.IO.Tests.PathTests_Windows.GetPathRoot_Windows(value: \""\\\\\\\\test\\\\unc\\\\path\\\\to\\\\something\"", expected: \""\\\\\\\\test\\\\unc\"") [FAIL] 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: Assert.Equal() Failure 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: ↓ (pos 10) 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: Expected: \\test\unc 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: Actual: \\test\unc\ 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: ↑ (pos 10) 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---74aa877a\src\System.Runtime.Extensions\tests\System\IO\PathTests_Windows.cs(48,0): at System.IO.Tests.PathTests_Windows.GetPathRoot_Windows(String value, String expected) 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: System.IO.Tests.PathTests_Windows.GetPathRoot_Windows(value: \""\\\\\\\\a\\\\b\\\\c\\\\d\\\\e\"", expected: \""\\\\\\\\a\\\\b\"") [FAIL] 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: Assert.Equal() Failure 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: ↓ (pos 5) 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: Expected: \\a\b 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: Actual: \\a\b\ 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: ↑ (pos 5) 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---74aa877a\src\System.Runtime.Extensions\tests\System\IO\PathTests_Windows.cs(48,0): at System.IO.Tests.PathTests_Windows.GetPathRoot_Windows(String value, String expected) 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: System.IO.Tests.PathTests_Windows.GetPathRoot_Windows(value: \""\\\\\\\\a\\\\b\\\\\"", expected: \""\\\\\\\\a\\\\b\"") [FAIL] 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: Assert.Equal() Failure 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: ↓ (pos 5) 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: Expected: \\a\b 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: Actual: \\a\b\ 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: ↑ (pos 5) 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---74aa877a\src\System.Runtime.Extensions\tests\System\IO\PathTests_Windows.cs(48,0): at System.IO.Tests.PathTests_Windows.GetPathRoot_Windows(String value, String expected) 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: System.IO.Tests.PathTests_Windows.GetPathRoot_Windows(value: \""\\\\\\\\?\\\\UNC\\\\test\\\\unc\\\\path\\\\to\\\\something\"", expected: \""\\\\\\\\?\\\\UNC\\\\test\\\\unc\"") [FAIL] 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: Assert.Equal() Failure 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: ↓ (pos 16) 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: Expected: \\?\UNC\test\unc 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: Actual: \\?\UNC\test\unc\ 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: ↑ (pos 16) 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---74aa877a\src\System.Runtime.Extensions\tests\System\IO\PathTests_Windows.cs(48,0): at System.IO.Tests.PathTests_Windows.GetPathRoot_Windows(String value, String expected) 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: System.IO.Tests.PathTests_Windows.GetPathRoot_Windows(value: \""\\\\\\\\?\\\\UNC\\\\a\\\\b2\\\\\"", expected: \""\\\\\\\\?\\\\UNC\\\\a\\\\b2\"") [FAIL] 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: Assert.Equal() Failure 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: ↓ (pos 12) 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: Expected: \\?\UNC\a\b2 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: Actual: \\?\UNC\a\b2\ 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: ↑ (pos 12) 2018-02-28 13:24:45,276: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2018-02-28 13:24:45,292: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---74aa877a\src\System.Runtime.Extensions\tests\System\IO\PathTests_Windows.cs(48,0): at System.IO.Tests.PathTests_Windows.GetPathRoot_Windows(String value, String expected) ``` and ``` 2018-02-28 13:24:34,276: INFO: proc(54): run_and_log_output: Output: System.IO.Tests.FileInfo_Directory.UNCShares [FAIL] 2018-02-28 13:24:34,276: INFO: proc(54): run_and_log_output: Output: Assert.Equal() Failure 2018-02-28 13:24:34,276: INFO: proc(54): run_and_log_output: Output: ↓ (pos 19) 2018-02-28 13:24:34,276: INFO: proc(54): run_and_log_output: Output: Expected: \\Machine\Directory 2018-02-28 13:24:34,276: INFO: proc(54): run_and_log_output: Output: Actual: \\Machine\Directory\ 2018-02-28 13:24:34,276: INFO: proc(54): run_and_log_output: Output: ↑ (pos 19) 2018-02-28 13:24:34,292: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2018-02-28 13:24:34,401: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---74aa877a\src\System.IO.FileSystem\tests\FileInfo\Directory.cs(55,0): at System.IO.Tests.FileInfo_Directory.UNCShares() 2018-02-28 13:24:38,369: INFO: proc(54): run_and_log_output: Output: System.IO.Tests.FileInfo_DirectoryName.UNCShares [FAIL] 2018-02-28 13:24:38,369: INFO: proc(54): run_and_log_output: Output: Assert.Equal() Failure 2018-02-28 13:24:38,369: INFO: proc(54): run_and_log_output: Output: ↓ (pos 19) 2018-02-28 13:24:38,369: INFO: proc(54): run_and_log_output: Output: Expected: \\Machine\Directory 2018-02-28 13:24:38,369: INFO: proc(54): run_and_log_output: Output: Actual: \\Machine\Directory\ 2018-02-28 13:24:38,369: INFO: proc(54): run_and_log_output: Output: ↑ (pos 19) 2018-02-28 13:24:38,369: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2018-02-28 13:24:38,369: INFO: proc(54): run_and_log_output: Output: D:\j\workspace\windows-TGrou---74aa877a\src\System.IO.FileSystem\tests\FileInfo\Directory.cs(55,0): at System.IO.Tests.FileInfo_Directory.UNCShares() ```" 27554 area-System.Runtime TypeForwardedFromAttribute accepts null as assemblyFullName According to https://docs.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.typeforwardedfromattribute.-ctor?view=netcore-2.0#Definition there should be a null-check - https://github.com/dotnet/corefx/blob/103639b6ff5aa6ab6097f70732530e411817f09b/src/Common/src/CoreLib/System/Runtime/CompilerServices/TypeForwardedFromAttribute.cs#L12. We have a test in mono that checks this behavior so `TypeForwardedFromAttribute `from corefx broke it 🙂 27556 area-System.Net Update WebSocket status when the underlying connection is closed This fix addresses a behavior difference between the new managed `WebSocket` implementation and the old Windows only version. When the underlying connection is closed, we need to also update the state of the `WebSocket` to show that it has been aborted. All of the code to do this was already written, it just needed to be called in one additional place. Making this fix also allowed me to remove most of the platform specific code in the relevant test. Fixes #26219 27558 area-System.Net fallback to IPv4 if AF is not specified and OS does not support IPv6 fixes #26664 Following code does not throw any more when IPv6 is not available on given system: TcpListener l = TcpListener.Create(5666); var s = new Socket(SocketType.Stream, ProtocolType.Tcp) I did not craft any test for this as it is unlikely we will ever have such situation in CI. I'm open to suggestions how to test this. 27560 area-System.IO Add PipeWriter.WaitToWriteAsync api to pipelines With the current pattern of using pipe there is no way to delay starting producer until consumer starts reading without using the side channel. If we take HTTP MessageBody as an example we have to start consuming raw bytes and populating message body pipe as soon as the user accesses HttpRequest.MessageBody property instead of waiting for the actual read. This some resource and could be avoided. I propose adding a method `PipeWriter.WaitToWriteAsync()` that would return `ValueTask` that gets completed when `ReadAsync` is called by the reader and there is no backpressure being applied currently. ```C# public abstract class PipeWriter { public abstract ValueTask WaitToWriteAsync(); } ``` Open questions: - Do we need cancellation token argument. - Do we need `CancelPendingWaitToWrite`? - How wuld `CancelPendingFlush` affect this call? - Do we need result struct with `IsCompleted`? /cc @davidfowl @KrzysztofCwalina 27561 area-Serialization Cannot deserialize SOAP arrays "I`ve got some problems when deserilizing array of objects in one of my web services. The following class was generated by the dotnet-svcutil and during deserialization countField is deserilized properly while the clientsField which is of type clientDetails[] is always null. ```c# [System.CodeDom.Compiler.GeneratedCodeAttribute(""dotnet-svcutil"", ""0.5.0.0"")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.Xml.Serialization.SoapTypeAttribute(Namespace=""http://www.example.org/ResellerAPI/"")] public partial class clientDetailsArray { private int countField; private clientDetails[] clientsField; /// <remarks/> public int count { get { return this.countField; } set { this.countField = value; } } /// <remarks/> public clientDetails[] clients { get { return this.clientsField; } set { this.clientsField = value; } } } ``` When I enabled XML debugging and step into the whole process I found the following piece of code that is theoretically responsible for deserilization of the clientsField and it returns null no matter what: ```c# object Read610_Array() { // dummy array method UnknownNode(null); return null; } ``` By looking for the phrase ""// dummy array method"" I`ve found the following method related to XmlSerializationReader: https://referencesource.microsoft.com/#System.Xml/System/Xml/Serialization/XmlSerializationReader.cs,2259 Does this means that Collections cannot be deserialized in this case? How to fix that? [EDIT] Add C# syntax highlighting by @karelz" 27563 area-System.Net Tweak Socket.InitializeSockets Scratching an itch; it's called in a bunch of places to ensure sockets have been initialized, but it's not inlineable. Make it so. cc: @geoffkizer 27564 area-System.Globalization .NET Core returned a Adar A in a non-leap year "@MosheL commented on [Wed Feb 28 2018](https://github.com/dotnet/core/issues/1314) # Issue Title Adar (אדר) month name on the .net core is displayed as a Adar A (אדר א') # General Example code: static System.Globalization.HebrewCalendar hc = new System.Globalization.HebrewCalendar(); static System.Globalization.CultureInfo jewishCulture = System.Globalization.CultureInfo.CreateSpecificCulture(""he-IL""); static public string toHebrewString(DateTime dDate) { var s= dDate.ToString(""dd בMMMM y"", jewishCulture); return s; } ... toHebrewString(new DateTime(2018,2,28) // י""ג באדר א' תשע""ח 28/2/2018 is in Adar( י""ג באדר), not in Adar A (י""ג באדר א'), as תשע""ח is not a leap year. On Windows 10 machine the correct month (אדר) is displayed. " 27565 area-System.Globalization Display issue for Euro currency "@dpjain commented on [Sun Feb 25 2018](https://github.com/dotnet/core/issues/1283) In our application, we have used English and French language. We need to use Euro currency for French language and "","" is used as separator for Euro currency. But have no idea how to display the same format. The numeric text box only accepts the decimal values, not accepting the comma. And also the property are set as Currency data type. ConfigureServices: services.Configure<RequestLocalizationOptions>(options => { var supportedCultures = new[] { new CultureInfo(""en-GB""), new CultureInfo(""fr-FR"") { NumberFormat = { CurrencyDecimalSeparator = "","" }, DateTimeFormat = new CultureInfo(""en-GB"").DateTimeFormat } }; options.DefaultRequestCulture = new RequestCulture(culture: new CultureInfo(""en-GB""), uiCulture: new CultureInfo(""en-GB"")); options.SupportedCultures = supportedCultures; options.SupportedUICultures = supportedCultures; }); Configure: var locOptions = app.ApplicationServices.GetService<IOptions<RequestLocalizationOptions>>(); app.UseRequestLocalization(locOptions.Value); " 27566 area-System.Net HttpClient doesn't send Connection: close header on some platforms WCF allows disabling persistent connections for HTTP requests. When persistent connections are disabled, WCF runs this code: ```csharp httpClient.DefaultRequestHeaders.ConnectionClose = true; ``` This fails to send the `Connection: close` header for requests on Fedora.27, Fedora.26, Debian.90 and OSX.1013. This header is successfully sent on Centos, Debian.87, OSX.1012, RedHat, SLES, Ubuntu, Windows and OpenSuse. 27567 area-System.Runtime Remove System.Runtime.Intrinsics for .NET Core 2.1 - Remove System.Runtime.Intrinsics from Microsoft.NETCore.App. - Rename to System.Runtime.Intrinsics.Experimental - Create a standalone nupkg. See https://github.com/dotnet/corefx/issues/27486 for more information. 27569 area-Infrastructure Update buildtools for TLS 1.2 GitHub update We need this change to be able to update the versions repo from uwp6.1, but per @weshaggard there could be more problems here too. 27571 area-Infrastructure Corefx package update in corefxlab results in free before malloc error during restore on OSX "From https://github.com/dotnet/corefxlab/pull/2140 Update Cli, CoreFx, CoreSetup to preview2-008266, preview2-26228-03, preview2-26227-03, respectively https://ci.dot.net/job/dotnet_corefxlab/job/master/job/osx10.12_debug_prtest/1613/consoleFull#7440085258bb52e59-de52-4f1c-b131-470db4c594cd ```text 22:09:53 Restoring all packages 22:09:53 Error: 22:09:53 An assembly specified in the application dependencies manifest (dotnet.deps.json) was not found: 22:09:53 package: 'Microsoft.ApplicationInsights', version: '2.0.0' 22:09:53 path: 'lib/dotnet5.4/Microsoft.ApplicationInsights.dll' 22:09:53 dotnet(51167,0x7fffcf7163c0) malloc: *** error for object 0xffffffffffffffff: pointer being freed was not allocated 22:09:53 *** set a breakpoint in malloc_error_break to debug 22:09:53 ./build.sh: line 84: 51167 Abort trap: 6 ./$dotnetExePath restore $myFile /p:VersionSuffix=""$BuildVersion"" 22:09:53 Failed to restore packages. ``` cc @danmosemsft, @livarcocc, @joshfree " 27572 area-System.IO Fix GetPathRoot issues cc: @stephentoub, @Anipik, @danmosemsft, @pjanotti fixes #27552 27573 area-System.IO PipeOptions.CurrentUserOnly: remove dir on Unix and add negative tests for Windows The directory is being removed on Unix due to the following reasons: * Ensure compatibility between servers/clients when only one side is on 2.1 and specifying `PipeOptions.CurrentUserOnly` (migration case). * Bring the behavior in Unix and Windows closer when only one side is specifying the flag. * Since it is advisable to use `getpeerid` on server and client sides, and we are now doing that, the directory becomes redundant and bring the two problems described above. 27574 area-System.Data System.Data.SqlClient.ManualTesting.Tests.CommandCancelTest crashes with Unhandled Exception on Linux "System.Data.SqlClient.ManualTesting.Tests.CommandCancelTest crashes on Linux while executing the following tests: **MultiThreadedCancel_NonAsync** **MultiThreadedCancel_Async** Both the tests crash in the method **ExecuteCommandCancelExpected** The same tests pass on windows, I am creating this GitHub issue to track and fix the tests. **Command to Reproduce:** ```bash <CoreFX Location>/Tools/msbuild.sh /t:RebuildAndTest /p:ConfigurationGroup=Release /p:XunitOptions=""-method System.Data.SqlClient.ManualTesting.Tests.CommandCancelTest.MultiThreadedCancel_NonAsync"" ``` ```bash <CoreFX Location>/Tools/msbuild.sh /t:RebuildAndTest /p:ConfigurationGroup=Release /p:XunitOptions=""-method System.Data.SqlClient.ManualTesting.Tests.CommandCancelTest.MultiThreadedCancel_Async"" ``` **Logs MultiThreadedCancel_NonAsync:** ```bash keerats@ubuntu:/mnt/d/corefx/src/System.Data.SqlClient/tests/ManualTests$ ~/dotnetcore/corefx/Tools/msbuild.sh /t:RebuildAndTest /p:ConfigurationGroup=Release /p:XunitOptions=""-method System.Data.SqlClient.ManualTesting.Tests.CommandCancelTest.MultiThreadedCancel_NonAsync"" Microsoft (R) Build Engine version 15.5.179.9764 for .NET Core Copyright (C) Microsoft Corporation. All rights reserved. Address -> /mnt/d/corefx/bin/AnyOS.AnyCPU.Release/Address/netstandard/Address.dll Circle -> /mnt/d/corefx/bin/AnyOS.AnyCPU.Release/Circle/netstandard/Circle.dll Shapes -> /mnt/d/corefx/bin/AnyOS.AnyCPU.Release/Shapes/netstandard/Shapes.dll Utf8String -> /mnt/d/corefx/bin/AnyOS.AnyCPU.Release/Utf8String/netstandard/Utf8String.dll System.Data.SqlClient.ManualTesting.Tests -> /mnt/d/corefx/bin/AnyOS.AnyCPU.Release/System.Data.SqlClient.ManualTesting.Tests/netstandard/System.Data.SqlClient.ManualTesting.Tests.dll ----- start 10:37:27 =============== To repro directly: ===================================================== pushd /mnt/d/corefx/bin/tests/System.Data.SqlClient.ManualTesting.Tests/netcoreapp-Linux-Release-x64 chmod +x /mnt/d/corefx/bin/testhost/netcoreapp-Linux-Release-x64//dotnet /mnt/d/corefx/bin/testhost/netcoreapp-Linux-Release-x64//dotnet xunit.console.netcore.exe System.Data.SqlClient.ManualTesting.Tests.dll -xml testResults.xml -notrait Benchmark=true -notrait category=nonnetcoreapptests -notrait category=nonlinuxtests -method System.Data.SqlClient.ManualTesting.Tests.CommandCancelTest.MultiThreadedCancel_NonAsync -notrait category=OuterLoop -notrait category=failing popd =========================================================================================================== /mnt/d/corefx/bin/tests/System.Data.SqlClient.ManualTesting.Tests/netcoreapp-Linux-Release-x64 /mnt/d/corefx/src/System.Data.SqlClient/tests/ManualTests xUnit.net console test runner (64-bit .NET Core) Copyright (C) 2014 Outercurve Foundation. Discovering: System.Data.SqlClient.ManualTesting.Tests Discovered: System.Data.SqlClient.ManualTesting.Tests Starting: System.Data.SqlClient.ManualTesting.Tests Unhandled Exception: System.Data.SqlClient.SqlException: A severe error occurred on the current command. The results, if any, should be discarded. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) in /mnt/d/corefx/src/System.Data.SqlClient/src/System/Data/SqlClient/SqlConnection.cs:line 1170 at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) in /mnt/d/corefx/src/System.Data.SqlClient/src/System/Data/SqlClient/TdsParser.cs:line 1106 at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlDataReader.TryHasMoreRows(Boolean& moreRows) in /mnt/d/corefx/src/System.Data.SqlClient/src/System/Data/SqlClient/SqlDataReader.cs:line 2861 at System.Data.SqlClient.SqlDataReader.TryReadInternal(Boolean setTimeout, Boolean& more) in /mnt/d/corefx/src/System.Data.SqlClient/src/System/Data/SqlClient/SqlDataReader.cs:line 3121 at System.Data.SqlClient.SqlDataReader.Read() in /mnt/d/corefx/src/System.Data.SqlClient/src/System/Data/SqlClient/SqlDataReader.cs:line 3083 at System.Data.SqlClient.ManualTesting.Tests.CommandCancelTest.<>c__DisplayClass16_0.<ExecuteCommandCancelExpected>b__0() in /mnt/d/corefx/src/System.Data.SqlClient/tests/ManualTests/SQL/CommandCancelTest/CommandCancelTest.cs:line 220 at System.Data.SqlClient.ManualTesting.Tests.DataTestUtility.ExpectFailure[TException](Action actionThatFails, String exceptionMessage, Boolean innerExceptionMustBeNull, Func`2 customExceptionVerifier) in /mnt/d/corefx/src/System.Data.SqlClient/tests/ManualTests/DataCommon/DataTestUtility.cs:line 159 at System.Data.SqlClient.ManualTesting.Tests.CommandCancelTest.ExecuteCommandCancelExpected(Object state) in /mnt/d/corefx/src/System.Data.SqlClient/tests/ManualTests/SQL/CommandCancelTest/CommandCancelTest.cs:line 226 at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /root/coreclr/src/mscorlib/shared/System/Threading/ExecutionContext.cs:line 166 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in /root/coreclr/src/mscorlib/src/System/Runtime/ExceptionServices/ExceptionDispatchInfo.cs:line 132 /mnt/d/corefx/bin/tests/System.Data.SqlClient.ManualTesting.Tests/netcoreapp-Linux-Release-x64/RunTests.sh: line 83: 2669 Aborted (core dumped) $RUNTIME_PATH/dotnet xunit.console.netcore.exe System.Data.SqlClient.ManualTesting.Tests.dll -xml testResults.xml -notrait Benchmark=true -notrait category=nonnetcoreapptests -notrait category=nonlinuxtests -method System.Data.SqlClient.ManualTesting.Tests.CommandCancelTest.MultiThreadedCancel_NonAsync -notrait category=OuterLoop -notrait category=failing /mnt/d/corefx/src/System.Data.SqlClient/tests/ManualTests ----- end 10:37:29 ----- exit code 134 ---------------------------------------------------------- /mnt/d/corefx/Tools/tests.targets(492,5): warning MSB3073: The command ""/mnt/d/corefx/bin/tests/System.Data.SqlClient.ManualTesting.Tests/netcoreapp-Linux-Release-x64/RunTests.sh /mnt/d/corefx/bin/testhost/netcoreapp-Linux-Release-x64/"" exited with code 134. [/mnt/d/corefx/src/System.Data.SqlClient/tests/ManualTests/System.Data.SqlClient.ManualTesting.Tests.csproj] /mnt/d/corefx/Tools/tests.targets(500,5): error : One or more tests failed while running tests from 'System.Data.SqlClient.ManualTesting.Tests' please check /mnt/d/corefx/bin/tests/System.Data.SqlClient.ManualTesting.Tests/netcoreapp-Linux-Release-x64/testResults.xml for details! [/mnt/d/corefx/src/System.Data.SqlClient/tests/ManualTests/System.Data.SqlClient.ManualTesting.Tests.csproj] ``` **Logs MultiThreadedCancel_Async:** ```bash keerats@ubuntu:/mnt/d/corefx/src/System.Data.SqlClient/tests/ManualTests$ ~/dotnetcore/corefx/Tools/msbuild.sh /t:RebuildAndTest /p:ConfigurationGroup=Release /p:XunitOptions=""-method System.Data.SqlClient.ManualTesting.Tests.CommandCancelTest.MultiThreadedCancel_Async"" Microsoft (R) Build Engine version 15.5.179.9764 for .NET Core Copyright (C) Microsoft Corporation. All rights reserved. Address -> /mnt/d/corefx/bin/AnyOS.AnyCPU.Release/Address/netstandard/Address.dll Circle -> /mnt/d/corefx/bin/AnyOS.AnyCPU.Release/Circle/netstandard/Circle.dll Shapes -> /mnt/d/corefx/bin/AnyOS.AnyCPU.Release/Shapes/netstandard/Shapes.dll Utf8String -> /mnt/d/corefx/bin/AnyOS.AnyCPU.Release/Utf8String/netstandard/Utf8String.dll System.Data.SqlClient.ManualTesting.Tests -> /mnt/d/corefx/bin/AnyOS.AnyCPU.Release/System.Data.SqlClient.ManualTesting.Tests/netstandard/System.Data.SqlClient.ManualTesting.Tests.dll ----- start 10:39:45 =============== To repro directly: ===================================================== pushd /mnt/d/corefx/bin/tests/System.Data.SqlClient.ManualTesting.Tests/netcoreapp-Linux-Release-x64 chmod +x /mnt/d/corefx/bin/testhost/netcoreapp-Linux-Release-x64//dotnet /mnt/d/corefx/bin/testhost/netcoreapp-Linux-Release-x64//dotnet xunit.console.netcore.exe System.Data.SqlClient.ManualTesting.Tests.dll -xml testResults.xml -notrait Benchmark=true -notrait category=nonnetcoreapptests -notrait category=nonlinuxtests -method System.Data.SqlClient.ManualTesting.Tests.CommandCancelTest.MultiThreadedCancel_Async -notrait category=OuterLoop -notrait category=failing popd =========================================================================================================== /mnt/d/corefx/bin/tests/System.Data.SqlClient.ManualTesting.Tests/netcoreapp-Linux-Release-x64 /mnt/d/corefx/src/System.Data.SqlClient/tests/ManualTests xUnit.net console test runner (64-bit .NET Core) Copyright (C) 2014 Outercurve Foundation. Discovering: System.Data.SqlClient.ManualTesting.Tests Discovered: System.Data.SqlClient.ManualTesting.Tests Starting: System.Data.SqlClient.ManualTesting.Tests Unhandled Exception: System.Data.SqlClient.SqlException: A severe error occurred on the current command. The results, if any, should be discarded. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) in /mnt/d/corefx/src/System.Data.SqlClient/src/System/Data/SqlClient/SqlConnection.cs:line 1170 at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) in /mnt/d/corefx/src/System.Data.SqlClient/src/System/Data/SqlClient/TdsParser.cs:line 1106 at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlDataReader.TryHasMoreRows(Boolean& moreRows) in /mnt/d/corefx/src/System.Data.SqlClient/src/System/Data/SqlClient/SqlDataReader.cs:line 2861 at System.Data.SqlClient.SqlDataReader.TryReadInternal(Boolean setTimeout, Boolean& more) in /mnt/d/corefx/src/System.Data.SqlClient/src/System/Data/SqlClient/SqlDataReader.cs:line 3121 at System.Data.SqlClient.SqlDataReader.Read() in /mnt/d/corefx/src/System.Data.SqlClient/src/System/Data/SqlClient/SqlDataReader.cs:line 3083 at System.Data.SqlClient.ManualTesting.Tests.CommandCancelTest.<>c__DisplayClass16_0.<ExecuteCommandCancelExpected>b__0() in /mnt/d/corefx/src/System.Data.SqlClient/tests/ManualTests/SQL/CommandCancelTest/CommandCancelTest.cs:line 220 at System.Data.SqlClient.ManualTesting.Tests.DataTestUtility.ExpectFailure[TException](Action actionThatFails, String exceptionMessage, Boolean innerExceptionMustBeNull, Func`2 customExceptionVerifier) in /mnt/d/corefx/src/System.Data.SqlClient/tests/ManualTests/DataCommon/DataTestUtility.cs:line 159 at System.Data.SqlClient.ManualTesting.Tests.CommandCancelTest.ExecuteCommandCancelExpected(Object state) in /mnt/d/corefx/src/System.Data.SqlClient/tests/ManualTests/SQL/CommandCancelTest/CommandCancelTest.cs:line 226 at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /root/coreclr/src/mscorlib/shared/System/Threading/ExecutionContext.cs:line 166 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in /root/coreclr/src/mscorlib/src/System/Runtime/ExceptionServices/ExceptionDispatchInfo.cs:line 132 /mnt/d/corefx/bin/tests/System.Data.SqlClient.ManualTesting.Tests/netcoreapp-Linux-Release-x64/RunTests.sh: line 83: 3044 Aborted (core dumped) $RUNTIME_PATH/dotnet xunit.console.netcore.exe System.Data.SqlClient.ManualTesting.Tests.dll -xml testResults.xml -notrait Benchmark=true -notrait category=nonnetcoreapptests -notrait category=nonlinuxtests -method System.Data.SqlClient.ManualTesting.Tests.CommandCancelTest.MultiThreadedCancel_Async -notrait category=OuterLoop -notrait category=failing /mnt/d/corefx/src/System.Data.SqlClient/tests/ManualTests ----- end 10:39:48 ----- exit code 134 ---------------------------------------------------------- /mnt/d/corefx/Tools/tests.targets(492,5): warning MSB3073: The command ""/mnt/d/corefx/bin/tests/System.Data.SqlClient.ManualTesting.Tests/netcoreapp-Linux-Release-x64/RunTests.sh /mnt/d/corefx/bin/testhost/netcoreapp-Linux-Release-x64/"" exited with code 134. [/mnt/d/corefx/src/System.Data.SqlClient/tests/ManualTests/System.Data.SqlClient.ManualTesting.Tests.csproj] /mnt/d/corefx/Tools/tests.targets(500,5): error : One or more tests failed while running tests from 'System.Data.SqlClient.ManualTesting.Tests' please check /mnt/d/corefx/bin/tests/System.Data.SqlClient.ManualTesting.Tests/netcoreapp-Linux-Release-x64/testResults.xml for details! [/mnt/d/corefx/src/System.Data.SqlClient/tests/ManualTests/System.Data.SqlClient.ManualTesting.Tests.csproj] keerats@ubuntu:/mnt/d/corefx/src/System.Data.SqlClient/tests/ManualTests$ ``` @saurabh500 @geleems @corivera @AfsanehR " 27577 area-System.Text Add parallel perf tests to Regex Relates to https://github.com/dotnet/corefx/pull/27314 As we are now using ArrayPool in a couple of places and refining our cache data structure we should add perf tests that run in parallel (each one individually). 27578 area-System.Diagnostics Unexpected status character: I in ProcessTests.TestGetProcesses "https://mc.dot.net/#/user/danmosemsft/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/01337d9cc1d615c0367d1625028ac2cc95cdb34f/workItem/System.Diagnostics.Process.Tests/wilogs ``` 2018-02-28 21:54:38,644: INFO: proc(54): run_and_log_output: Output: None of the following programs were installed on this machine: xdg-open,gnome-open,kfmclient. 2018-02-28 21:54:39,611: INFO: proc(54): run_and_log_output: Output: Assertion Failed 2018-02-28 21:54:39,611: INFO: proc(54): run_and_log_output: Output: Unexpected status character: I 2018-02-28 21:54:39,612: INFO: proc(54): run_and_log_output: Output: 2018-02-28 21:54:39,612: INFO: proc(54): run_and_log_output: Output: at System.Diagnostics.Tests.ProcessTests.TestGetProcesses() in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Diagnostics.Process/tests/ProcessTests.cs:line 899 2018-02-28 21:54:39,613: INFO: proc(54): run_and_log_output: Output: at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions) ``` ProcFsStateToThreadState needs to be updated to include ""I"" it seems this was added in https://github.com/torvalds/linux/commit/06eb61844d841d0032a9950ce7f8e783ee49c0d0" 27580 area-System.Diagnostics InstanceDataCollection_* failures in CI https://mc.dot.net/#/user/danmosemsft/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/01337d9cc1d615c0367d1625028ac2cc95cdb34f/workItem/System.Diagnostics.PerformanceCounter.Tests/analysis/xunit/System.Diagnostics.Tests.InstanceDataTests~2FInstanceDataCollectionCollection_Contains_Valid Windows.10.Amd64.Open-Release-x86 all failed the same way on this particular machine/config: InstanceDataCollection_GetItem_ExistingCounter InstanceDataCollection_GetKeys InstanceDataCollection_GetValues InstanceDataCollection_NullTest InstanceDataCollectionCollection_Contains_inValid InstanceDataCollectionCollection_Contains_Valid InstanceDataCollectionCollection_CopyTo InstanceDataCollectionCollection_GetItem_Invalid InstanceDataCollectionCollection_GetKeys InstanceDataCollectionCollection_GetValues ``` Unhandled Exception of Type Xunit.Sdk.NotEqualException Message : Assert.NotEqual() Failure Expected: Not 0 Actual: 0 Stack Trace : at System.Diagnostics.Tests.Helpers.RetryOnAllPlatforms[T](Func`1 func) in D:\j\workspace\windows-TGrou---f8ac6754\src\System.Diagnostics.PerformanceCounter\tests\Helpers.cs:line 74 at System.Diagnostics.Tests.InstanceDataTests.GetInstanceDataCollectionCollection() in D:\j\workspace\windows-TGrou---f8ac6754\src\System.Diagnostics.PerformanceCounter\tests\InstanceDataTests.cs:line 130 at System.Diagnostics.Tests.InstanceDataTests.InstanceDataCollectionCollection_Contains_Valid() in D:\j\workspace\windows-TGrou---f8ac6754\src\System.Diagnostics.PerformanceCounter\tests\InstanceDataTests.cs:line 104 ``` @brianrob 27581 area-Infrastructure Ensure unique tasknames in crossbuild.json CC @MattGal 27583 area-System.Net IOControl_SIOCATMARK_Success test improvements The behavior of SIOCATMARK varies significantly between different socket implementations. This test ensures that the expected behavior occurs on Windows, Linux, and OSX. Here's a table with the state on different platforms during the modified test: | SIOCATMARK(Win) | SIOCATMARK(Unix) -- | -- | -- Before Data Received: | 1 | 0 After Non-OOB Data Received | 1 | 0 After OOB Data Received (Read pointer not at OOB Mark) | 0 | 0 After OOB Data Received (Read pointer at OOB Mark) | 0 | 1 OOB Data Read (Read pointer at OOB Mark) | 1 | (1/0) OOB Data Read (Read pointer not at OOB Mark) | 1 | 0 Note: When the OOB data has been read but the read pointer is still at the OOB mark, behavior varies on Linux and OSX. For more details check out issue #25639. 27584 area-System.Memory Add the array/arraysegment->Span/Memory overloads to MemoryExtensions Part of https://github.com/dotnet/corefx/issues/26894 27585 area-System.IO Remove span helpers, use mirrored PathInternal helper Remove other unnecessary helpers (notably with Path.Join available) cc: @ahsonkhan, @Anipik, @pjanotti, @danmosemsft 27587 area-System.Data Removal of locks from SNITcpHandle.cs breaks EF tests Removal of locks in the PR https://github.com/dotnet/corefx/pull/27187 breaks EF tests with the following stack trace. To trace this failure to the lock removal I undid the changes in the PR and then just removed the locks without any allocation optimizations. I could repro this by running EF tests on Windows with Managed SNI and on Linux as well This could potentially be a timing issue and could repro on Linux in different scenarios. ``` [xUnit.net 00:01:45.7938557] Microsoft.EntityFrameworkCore.Query.QueryBugsTest.Repro5456_multiple_include_group_join_is_per_query_context_async [FAIL] [xUnit.net 00:01:45.7967113] System.InvalidOperationException : Invalid attempt to call ReadAsync when reader is closed. [xUnit.net 00:01:45.7990081] Stack Trace: [xUnit.net 00:01:45.8012431] at System.Data.Common.ADP.ExceptionWithStackTrace(Exception e) [xUnit.net 00:01:45.8017075] --- End of stack trace from previous location where exception was thrown --- [xUnit.net 00:01:45.8068374] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() [xUnit.net 00:01:45.8070711] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) [xUnit.net 00:01:45.8073990] at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() [xUnit.net 00:01:45.8075715] D:\aspnet\EntityFrameworkCore\src\EFCore.Relational\Query\Internal\AsyncQueryingEnumerable.cs(138,0): at Microsoft.EntityFrameworkCore.Query.Internal.AsyncQueryingEnumerable`1.AsyncEnumerator.<BufferlessMoveNext>d__12.MoveNext() [xUnit.net 00:01:45.8078974] --- End of stack trace from previous location where exception was thrown --- [xUnit.net 00:01:45.8080208] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() [xUnit.net 00:01:45.8082113] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) [xUnit.net 00:01:45.8083356] at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() [xUnit.net 00:01:45.8084510] D:\aspnet\EntityFrameworkCore\src\EFCore.SqlServer\Storage\Internal\SqlServerExecutionStrategy.cs(66,0): at Microsoft.EntityFrameworkCore.Storage.Internal.SqlServerExecutionStrategy.<ExecuteAsync>d__7`2.MoveNext() [xUnit.net 00:01:45.8086315] --- End of stack trace from previous location where exception was thrown --- [xUnit.net 00:01:45.8087293] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() [xUnit.net 00:01:45.8088197] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) [xUnit.net 00:01:45.8089066] at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() [xUnit.net 00:01:45.8090061] D:\aspnet\EntityFrameworkCore\src\EFCore.Relational\Query\Internal\AsyncQueryingEnumerable.cs(84,0): at Microsoft.EntityFrameworkCore.Query.Internal.AsyncQueryingEnumerable`1.AsyncEnumerator.<MoveNext>d__11.MoveNext() [xUnit.net 00:01:45.8091798] --- End of stack trace from previous location where exception was thrown --- [xUnit.net 00:01:45.8092741] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() [xUnit.net 00:01:45.8136308] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) [xUnit.net 00:01:45.8138275] at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() [xUnit.net 00:01:45.8139079] D:\aspnet\EntityFrameworkCore\src\EFCore\Query\EntityQueryModelVisitor.cs(1252,0): at Microsoft.EntityFrameworkCore.Query.EntityQueryModelVisitor.AsyncSelectEnumerable`2.AsyncSelectEnumerator.<MoveNext>d__3.MoveNext() [xUnit.net 00:01:45.8139669] --- End of stack trace from previous location where exception was thrown --- [xUnit.net 00:01:45.8140505] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() [xUnit.net 00:01:45.8141557] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) [xUnit.net 00:01:45.8142535] at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() [xUnit.net 00:01:45.8143464] at System.Linq.AsyncEnumerable.SelectEnumerableAsyncIterator`2.<MoveNextCore>d__7.MoveNext() [xUnit.net 00:01:45.8144448] --- End of stack trace from previous location where exception was thrown --- [xUnit.net 00:01:45.8145468] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() [xUnit.net 00:01:45.8146503] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) [xUnit.net 00:01:45.8149178] at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() [xUnit.net 00:01:45.8150135] at System.Linq.AsyncEnumerable.AsyncIterator`1.<MoveNext>d__10.MoveNext() [xUnit.net 00:01:45.8150609] --- End of stack trace from previous location where exception was thrown --- [xUnit.net 00:01:45.8151621] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() [xUnit.net 00:01:45.8153297] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) [xUnit.net 00:01:45.8154215] at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() [xUnit.net 00:01:45.8155213] D:\aspnet\EntityFrameworkCore\src\EFCore\Query\Internal\AsyncLinqOperatorProvider.cs(157,0): at Microsoft.EntityFrameworkCore.Query.Internal.AsyncLinqOperatorProvider.ExceptionInterceptor`1.EnumeratorExceptionInterceptor.<MoveNext>d__5.MoveNext() [xUnit.net 00:01:45.8155743] --- End of stack trace from previous location where exception was thrown --- [xUnit.net 00:01:45.8156111] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() [xUnit.net 00:01:45.8156864] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) [xUnit.net 00:01:45.8157309] at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() [xUnit.net 00:01:45.8158184] at System.Linq.AsyncEnumerable.<Aggregate_>d__6`3.MoveNext() [xUnit.net 00:01:45.8159034] --- End of stack trace from previous location where exception was thrown --- [xUnit.net 00:01:45.8159504] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() [xUnit.net 00:01:45.8159906] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) [xUnit.net 00:01:45.8160622] at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() [xUnit.net 00:01:45.8161423] D:\aspnet\EntityFrameworkCore\test\EFCore.SqlServer.FunctionalTests\Query\QueryBugsTest.cs(1559,0): at Microsoft.EntityFrameworkCore.Query.QueryBugsTest.<<Repro5456_multiple_include_group_join_is_per_query_context_async>b__83_0>d.MoveNext() [xUnit.net 00:01:45.8163444] --- End of stack trace from previous location where exception was thrown --- [xUnit.net 00:01:45.8164334] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() [xUnit.net 00:01:45.8165463] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) [xUnit.net 00:01:45.8166412] D:\aspnet\EntityFrameworkCore\test\EFCore.SqlServer.FunctionalTests\Query\QueryBugsTest.cs(1552,0): at Microsoft.EntityFrameworkCore.Query.QueryBugsTest.<Repro5456_multiple_include_group_join_is_per_query_context_async>d__83.MoveNext() [xUnit.net 00:01:45.8167330] --- End of stack trace from previous location where exception was thrown --- [xUnit.net 00:01:45.8168143] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() [xUnit.net 00:01:45.8168972] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) [xUnit.net 00:01:45.8169579] --- End of stack trace from previous location where exception was thrown --- [xUnit.net 00:01:45.8170187] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() [xUnit.net 00:01:45.8170617] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) [xUnit.net 00:01:45.8171179] --- End of stack trace from previous location where exception was thrown --- [xUnit.net 00:01:45.8171815] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() [xUnit.net 00:01:45.8172482] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) Failed Microsoft.EntityFrameworkCore.Query.QueryBugsTest.Repro5456_multiple_include_group_join_is_per_query_context_async Error Message: System.InvalidOperationException : Invalid attempt to call ReadAsync when reader is closed. Stack Trace: at System.Data.Common.ADP.ExceptionWithStackTrace(Exception e) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at Microsoft.EntityFrameworkCore.Query.Internal.AsyncQueryingEnumerable`1.AsyncEnumerator.<BufferlessMoveNext>d__12.MoveNext() in D:\aspnet\EntityFrameworkCore\src\EFCore.Relational\Query\Internal\AsyncQueryingEnumerable.cs:line 138 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at Microsoft.EntityFrameworkCore.Storage.Internal.SqlServerExecutionStrategy.<ExecuteAsync>d__7`2.MoveNext() in D:\aspnet\EntityFrameworkCore\src\EFCore.SqlServer\Storage\Internal\SqlServerExecutionStrategy.cs:line 66 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at Microsoft.EntityFrameworkCore.Query.Internal.AsyncQueryingEnumerable`1.AsyncEnumerator.<MoveNext>d__11.MoveNext() in D:\aspnet\EntityFrameworkCore\src\EFCore.Relational\Query\Internal\AsyncQueryingEnumerable.cs:line 84 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at Microsoft.EntityFrameworkCore.Query.EntityQueryModelVisitor.AsyncSelectEnumerable`2.AsyncSelectEnumerator.<MoveNext>d__3.MoveNext() in D:\aspnet\EntityFrameworkCore\src\EFCore\Query\EntityQueryModelVisitor.cs:line 1252 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() at System.Linq.AsyncEnumerable.SelectEnumerableAsyncIterator`2.<MoveNextCore>d__7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() at System.Linq.AsyncEnumerable.AsyncIterator`1.<MoveNext>d__10.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at Microsoft.EntityFrameworkCore.Query.Internal.AsyncLinqOperatorProvider.ExceptionInterceptor`1.EnumeratorExceptionInterceptor.<MoveNext>d__5.MoveNext() in D:\aspnet\EntityFrameworkCore\src\EFCore\Query\Internal\AsyncLinqOperatorProvider.cs:line 157 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() at System.Linq.AsyncEnumerable.<Aggregate_>d__6`3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at Microsoft.EntityFrameworkCore.Query.QueryBugsTest.<<Repro5456_multiple_include_group_join_is_per_query_context_async>b__83_0>d.MoveNext() in D:\aspnet\EntityFrameworkCore\test\EFCore.SqlServer.FunctionalTests\Query\QueryBugsTest.cs:line 1559 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.EntityFrameworkCore.Query.QueryBugsTest.<Repro5456_multiple_include_group_join_is_per_query_context_async>d__83.MoveNext() in D:\aspnet\EntityFrameworkCore\test\EFCore.SqlServer.FunctionalTests\Query\QueryBugsTest.cs:line 1552 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) ``` 27588 area-System.IO Investigate failling test in CLI insertion https://github.com/dotnet/cli/pull/8689 insertion cause a test `GivenAnInstalledPackageUninstallRollsbackWhenTransactionAborts` fails constantly in REHL 7 Jenkins machine. However, when the test is renamed, the problem is gone. There is no local repo. Also after change test directory, a [similar error](https://ci.dot.net/job/dotnet_cli/job/master/job/release_windows_nt_x64_prtest/2384/testReport/(root)/(empty)/Microsoft_DotNet_ToolPackage_Tests_ToolPackageInstallerTests_GivenAnInstalledPackageUninstallRemovesThePackageWhenTransactionCommits_testMockBehaviorIsInSync__True_/) happened at a different part of the code. This time it is on Windows. But there is still no local repo. Both tests has Directory Enumerator involved. Consider there is change in that area. I believe we need to find the root cause of the issue. 27589 area-System.Reflection Add API that allows the emitter to indicate presence of localloc When encoding method body header the encoder needs to decide whether to emit tiny or fat header. A small method that has no locals but contains `localloc` instruction and has InitLocals set to true should not be encoded with tiny header since tiny header implies InitLocals is false. The presence of `localloc` instruction needs to be indicated by the caller of the method body encoder similarly to max stack and other info. Hence we need to add an overload that takes an extra bool parameter. Fixes https://github.com/dotnet/corefx/issues/26910 Implements https://github.com/dotnet/corefx/issues/27611 27590 area-System.Security Newly added System.Security.Cryptography.Rsa tests failing locally These tests consistently fail for me locally on my Windows machine running insiders builds: ``` System.Security.Cryptography.Rsa.Tests.EncryptDecrypt_Span.RsaDecryptOaepWrongDataLength [FAIL] Assert.Throws() Failure Expected: typeof(System.Security.Cryptography.CryptographicException) Actual: (No exception was thrown) Stack Trace: d:\repos\corefx\src\Common\tests\System\Security\Cryptography\AlgorithmImplementations\RSA\EncryptDecrypt.cs(453,0): at System.Security.Cryptography.Rsa.Tests.EncryptDecrypt.RsaDecryptOaepWrongDataLeng th() System.Security.Cryptography.Rsa.Tests.EncryptDecrypt_Array.RsaDecryptOaepWrongDataLength [FAIL] Assert.Throws() Failure Expected: typeof(System.Security.Cryptography.CryptographicException) Actual: (No exception was thrown) Stack Trace: d:\repos\corefx\src\Common\tests\System\Security\Cryptography\AlgorithmImplementations\RSA\EncryptDecrypt.cs(453,0): at System.Security.Cryptography.Rsa.Tests.EncryptDecrypt.RsaDecryptOaepWrongDataLength() ``` cc: @bartonjs 27592 area-Infrastructure Build warnings when targeting System.* nuget packages from projects targeting .NET 4.7.1 "I have a problem with a very simple repro: 1) Using VS 2017 15.5.7 create a new project using the template ""Console App (.NET Framework) targeting .net 4.7.1 2) Add a nuget package reference for the package ""System.Net.Http"" v4.3.3. Use the 'packages.config' package manager format when prompted. Several other System.* nuget package dependencies are also added. 3) Compile the project. No build errors or warnings. 4) Close and re-open the solution 5) Compile the project. **Several build warnings of ""The referenced component 'System.IO' could not be found"" appear**. Many of the references in the solution explorer appear with an exclamation mark. The project seems to build successfully, but the warnings cause concern that something is wrong. These build warnings don't seem like they should be expected or desirable. Is there something obvious I'm doing wrong or misunderstanding? I do not get these build warnings if I follow all the above steps but instead target .NET 4.6.1. You may ask why I'd want to reference System.* nuget packages when I'm targeting .NET 4.7.1. Instead I should use the 'in box' System.* references from the .net framework. My real problem is in trying to reference the nuget package ['IdentityModel' v3.3.1](https://www.nuget.org/packages/IdentityModel/). This brings in a dependency on the System.Net.Http nuget package (not the built in framework reference) and thus, I get these warnings. My repro is just the basic scenario of directly referencing the System.Net.Http nuget package, but in my case I want to use IdentityModel and don't have any choice or control over the dependencies. IdentityModel is part of the popular ""Identity Server"" OSS product, so I would expect my scenario to be very natural/mainstream. " 27593 area-System.Net Why System.Uri discards RTL/LTR chars? "According to [the document](https://docs.microsoft.com/en-us/dotnet/framework/network-programming/international-resource-identifier-support-in-system-uri), System.Uri supports [IRIs](https://tools.ietf.org/html/rfc3987). In my test code, System.Uri discards RTL/LTR(right-to-left/left-to-right) chars. ```csharp var codePoints = new[] { 0xE0000, 0xE0FFF, 0xE000, 0xF8FF, //some other chars work 0x200F, 0x200E, 0x202E, 0x202D, 0x202C, 0x202B, 0x202A //RTL LTR chars discarded }; foreach (var cp in codePoints) { var uri = new Uri($""http://localhost/{char.ConvertFromUtf32(cp)}""); if (uri.AbsolutePath.Equals(""/"")) { Console.WriteLine($""0x{cp.ToString(""X4"")} is discarded""); } } ``` Am I missing anything?" 27594 area-System.Net SIGSEGV in System.Security.Cryptography.Native.OpenSsl.so(CryptoNative_EnsureLibSslInitialized https://mc.dot.net/#/user/saurabh500/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/74636ba8ad8c32bee63361f8523b98b0ebe25839/workItem/System.Net.Http.Functional.Tests/wilogs Ubuntu.1604.Amd64.Open:Release-x64 ``` 2018-03-01 05:04:20,665: INFO: proc(54): run_and_log_output: Output: *** Error in `/home/helixbot/dotnetbuild/work/d3f9c471-fed9-4c43-8dc6-5d5f451c081a/Payload/dotnet': double free or corruption (fasttop): 0x00007f61b4028070 *** 2018-03-01 05:04:20,665: INFO: proc(54): run_and_log_output: Output: ======= Backtrace: ========= 2018-03-01 05:04:20,666: INFO: proc(54): run_and_log_output: Output: /lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f626dfee7e5] 2018-03-01 05:04:20,666: INFO: proc(54): run_and_log_output: Output: /lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f626dff737a] 2018-03-01 05:04:20,666: INFO: proc(54): run_and_log_output: Output: /lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f626dffb53c] 2018-03-01 05:04:20,667: INFO: proc(54): run_and_log_output: Output: /lib/x86_64-linux-gnu/libcrypto.so.1.0.0(CRYPTO_free+0x1d)[0x7f61f26b70cd] 2018-03-01 05:04:20,667: INFO: proc(54): run_and_log_output: Output: /lib/x86_64-linux-gnu/libcrypto.so.1.0.0(OBJ_NAME_add+0x8c)[0x7f61f26b9c7c] 2018-03-01 05:04:20,667: INFO: proc(54): run_and_log_output: Output: /lib/x86_64-linux-gnu/libcrypto.so.1.0.0(EVP_add_cipher+0x25)[0x7f61f2778bf5] 2018-03-01 05:04:20,668: INFO: proc(54): run_and_log_output: Output: /lib/x86_64-linux-gnu/libssl.so.1.0.0(SSL_library_init+0x45)[0x7f61f2ae3bb5] 2018-03-01 05:04:20,668: INFO: proc(54): run_and_log_output: Output: /home/helixbot/dotnetbuild/work/d3f9c471-fed9-4c43-8dc6-5d5f451c081a/Payload/shared/Microsoft.NETCore.App/9.9.9/System.Security.Cryptography.Native.OpenSsl.so(CryptoNative_EnsureLibSslInitialized+0xf)[0x7f61ca0c129f] 2018-03-01 05:04:20,668: INFO: proc(54): run_and_log_output: Output: [0x7f61f4a57c82] ``` @bartonjs apparently this isn't consistent. 27595 area-System.Data "Revert ""Skip CommandCancelTests [MultiThreadedCancel_NonAsync & MultiThreadedCancel_Async] on Unix (#27576)""" This reverts commit 7020ee17617f0563acf41a9d10ace814f8227de9. After merging https://github.com/dotnet/corefx/pull/27591 this test is safe to re-enable. Tested on Ubuntu to make sure this doesn't fail Fixes: https://github.com/dotnet/corefx/issues/27574 27597 area-System.Net SocketsHttpHandler: Should only do preauthentication when credentials are a CredentialCache Currently, when PreAuthenticate is set to true, we always send basic credentials on every request to every server. To avoid sending credentials to servers that don't care, we should only preauthenticate when the credentials are a CredentialCache and thus known to be specific to a particular server. I tried making this change in my ntlm PR (https://github.com/dotnet/corefx/pull/27551), but it caused failures on Linux/OSX only -- Windows worked fine. No idea why the behavior differs by platform (it's all SocketsHttpHandler so should be consistent). The failures were in PostNonRewindableContentUsingAuth_PreAuthenticate_Success; see here for more details: https://mc.dot.net/#/user/geoffkizer/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/abfadff769bb9dbba1dc870f70944d1fbb26ad87/workItem/System.Net.Http.Functional.Tests We should understand why the behavior is different by platform. We should also consider adding pre-auth tests specifically; I don't think we have any tests that explicitly validate preauth behavior (as opposed to just confirming that auth succeeded, whether preauth actually occurred or not). cc @Tratcher, who pointed out this issue originally. 27599 area-System.Runtime Add tests for TypeForwardedFromAttribute Fixes #27554 27601 area-System.Security Improve performance of SystemNative_GetNonCryptographicallySecureRandomBytes Based on the same change in coreclr. Improves the performance 6 times. Main improvement comes from using just one read per the whole buffer instead of one per byte. Smaller part of the win comes from using only the /dev/urandom. 27603 area-System.Net WinHttpHandler: Consider exposing ConnectTimeout In some environments, in particular in a cloud, it's useful to be able to specify a timeout for just the connection phase of an HTTP request. That way, if the server is unresponsive, we don't need to wait for the full HttpClient timeout to cancel the request, and conversely, setting a small HttpClient timeout to avoid such issues doesn't cancel an active operation taking a long time simply because it's conversing a lot. We should add: ``` public sealed class WinHttpHandler { public TimeSpan ConnectTimeout { get; set; } // defaults to infinite so that it's opt-in / pay for play ... } ``` The underlying Interop.WinHttp.WinHttpSetTimeouts has the connect timeout, which is currently not set. 27604 area-System.Net HttpClientHandler: Consider exposing ConnectTimeout Exposing the ConnectTimeout on HttpClientHandler like suggested on SocketsHttpHandler (#27235) and WinHttpHandler (#27603). It will also make it possible to be consistent with the CurlHandler without making the CurlHandler public. ``` public sealed class HttpClientHandler { public TimeSpan ConnectTimeout { get; set; } // defaults to infinite so that it's opt-in / pay for play ... } ``` 27605 area-System.Data [Regression][Perf][Linux] TransactionScope and Connection pool problems on Linux I have a business application that uses TransactionScope. The application runs on Windows and we are migrating it to dotnet core in order to work Linux. I have 2 problems on **Linux** environment: 1- TransactionScope is not supported 2- The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached. We tried to use dotnet core 2.0 and system.Data.SqlClient Version 4.5.0-preview1-26216-02. The Connection pool problem is solved but the TransactionScope problem is not solved. (MSDTC problems, this platform does not support Distributed Transaction) We tried to use dotnet core 2.1 and System.Data.SqlClient Version 4.5.0-preview2-26228-08. The TransactionScope is solved but the connection pool problem is not solved. Thank you for your support. 27606 area-System.Reflection Unhelpful error when Activator.CreateInstance can't find default constructor When `Activator.CreateInstance` tries to create an object without a default constructor, it fails with the unhelpful error `System.MissingMethodException: No parameterless constructor defined for this object.` It would be much more helpful if this error message contained the actual type that was failing to be constructed - e.g. `System.MissingMethodException: No parameterless constructor defined for Namespace.NoParamaterlessConstructor` This is particularly useful when the code is trying to load types from some kind of configuration file, in which a stack trace alone may not allow you to identify what type it was trying to instantiate. Repo code: ```csharp class Program { static void Main(string[] args) { var x = Activator.CreateInstance(typeof(NoParameterlessConstructor)); } } class NoParameterlessConstructor { public NoParameterlessConstructor(object foo) { } } ``` 27607 area-System.Security RSACryptoServiceProvider/RSAPKCS1SignatureDeformatter fail for SHA256 I can consistently reproduce a problem when verifying a signature with the SHA256 algorithm. I initially got an issue when trying to validate JWTs (RS256) with JwtSecurityTokenHandler's ValidateSignature. However, drilling thru the source code, I found that the problem occurs when RSAPKCS1SignatureDeformatter validates the signature with the SHA256 algorithm. The thing is, the tokens are valid. I can validate them all in JavaScript and on jwt.io (RS256). Also, the token signature validation always succeeds when I validate tokens from Google and always fail when validating token from ForgeRock (https://www.forgerock.com/). But again, all the tokens from ForgeRock validate properly in JavaScript and on jwt.io, so there's really something happening in .NET. I join a small console app that validates token signatures from Google and from ForgeRock. Although they are now expired, both of these tokens passed validation in JavaScript and on jwt.io and their signature validation with SHA256 should work in both cases, not just with Google's token. Thanks in advance for any follow up, this is a critical issue for us. (We've already been thru Stackoverflow and other forums.) [JwtValidation.zip](https://github.com/dotnet/corefx/files/1771596/JwtValidation.zip) 27610 area-System.Data Port DataTable.AsDataView extension methods These were in System.Data.DatasetExtensions but we did not port them because they need internal access to System.Data.Common (was System.Data) Would probably be best to merge S.D.DSE into S.D.C with type forwards. Usage seems very low but at least one porting customer needs it. See https://github.com/dotnet/corefx/issues/19771 27611 area-System.Reflection Add API that allows the emitter to indicate presence of localloc "When encoding method body header the encoder needs to decide whether to emit tiny or fat header. A small method that has no locals but contains localloc instruction and has InitLocals set to true should not be encoded with tiny header since tiny header implies InitLocals is false. The presence of localloc instruction needs to be indicated by the caller of the method body encoder similarly to max stack and other info. Hence we need to add an overload that takes an extra bool parameter. Addresses https://github.com/dotnet/corefx/issues/26910 **Proposed API** ```C# namespace System.Reflection.Metadata.Ecma335 { public readonly struct MethodBodyStreamEncoder { // existing overloads public MethodBody AddMethodBody( int codeSize, int maxStack, int exceptionRegionCount, bool hasSmallExceptionRegions, StandaloneSignatureHandle localVariablesSignature, MethodBodyAttributes attributes); public int AddMethodBody( InstructionEncoder instructionEncoder, int maxStack, StandaloneSignatureHandle localVariablesSignature, MethodBodyAttributes attributes) // new overloads /// <summary> /// Encodes a method body and adds it to the method body stream. /// </summary> /// <param name=""codeSize"">Number of bytes to be reserved for instructions.</param> /// <param name=""maxStack"">Max stack.</param> /// <param name=""exceptionRegionCount"">Number of exception regions.</param> /// <param name=""hasSmallExceptionRegions"">True if the exception regions should be encoded in 'small' format.</param> /// <param name=""localVariablesSignature"">Local variables signature handle.</param> /// <param name=""attributes"">Attributes.</param> /// <param name=""hasDynamicStackAllocation"">True if the method allocates from dynamic local memory pool (<c>localloc</c> instruction).</param> /// <returns>The offset of the encoded body within the method body stream.</returns> /// <exception cref=""ArgumentOutOfRangeException""> /// <paramref name=""codeSize""/>, <paramref name=""exceptionRegionCount""/>, or <paramref name=""maxStack""/> is out of allowed range. /// </exception> public MethodBody AddMethodBody( int codeSize, int maxStack = 8, int exceptionRegionCount = 0, bool hasSmallExceptionRegions = true, StandaloneSignatureHandle localVariablesSignature = default, MethodBodyAttributes attributes = MethodBodyAttributes.InitLocals, bool hasDynamicStackAllocation = false); /// <summary> /// Encodes a method body and adds it to the method body stream. /// </summary> /// <param name=""instructionEncoder"">Instruction encoder.</param> /// <param name=""maxStack"">Max stack.</param> /// <param name=""localVariablesSignature"">Local variables signature handle.</param> /// <param name=""attributes"">Attributes.</param> /// <param name=""hasDynamicStackAllocation"">True if the method allocates from dynamic local memory pool (the IL contains <c>localloc</c> instruction). /// </param> /// <returns>The offset of the encoded body within the method body stream.</returns> /// <exception cref=""ArgumentNullException""><paramref name=""instructionEncoder""/> has default value.</exception> /// <exception cref=""ArgumentOutOfRangeException""><paramref name=""maxStack""/> is out of range [0, <see cref=""ushort.MaxValue""/>].</exception> /// <exception cref=""InvalidOperationException""> /// A label targeted by a branch in the instruction stream has not been marked, /// or the distance between a branch instruction and the target label is doesn't fit the size of the instruction operand. /// </exception> public int AddMethodBody( InstructionEncoder instructionEncoder, int maxStack = 8, StandaloneSignatureHandle localVariablesSignature = default, MethodBodyAttributes attributes = MethodBodyAttributes.InitLocals, bool hasDynamicStackAllocation = false) } } ```" 27612 area-System.Net UseCallback_HaveCredsAndUseAuthenticatedCustomProxyAndPostToSecureServer_Success is failing on Win7 Error is ``` System.IO.IOException : Unable to transfer data on the transport connection: An existing connection was forcibly closed by the remote host. ---- System.Net.Sockets.SocketException : An existing connection was forcibly closed by the remote host ``` From the loopback proxy server. https://mc.dot.net/#/user/geoffkizer/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/1810ecb8564830d72a8b8b7404d5cf846e1a6ccb/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandler_ServerCertificates_Test~2FUseCallback_HaveCredsAndUseAuthenticatedCustomProxyAndPostToSecureServer_Success 27613 area-System.Net UdpClient does not receive Broadcasts on Linux "As the title suggest I'm currently trying to write an application that listens for udp broadcasts on the local network. The following snippet works without problems on Windows but does not produce any results on my Fedora machine (I'm running Fedora 27 - 4.15.4-300.fc27.x86_64): ``` class Program { static async Task Main(string[] args) { var receiveClient = new UdpClient(new IPEndPoint(IPAddress.Any, 21027)); receiveClient.EnableBroadcast = true; while (true) { var result = await receiveClient.ReceiveAsync(); Console.WriteLine($""Received packet from {result.RemoteEndPoint}""); } } } ``` I also checked that the packets are actually received by my machine with WireShark:  And `netstat -tulpn | grep 21027` provides the following output: ``` udp 0 0 0.0.0.0:21027 0.0.0.0:* 27806/dotnet ``` I'm running all my tests on the SDK Version 2.1.4" 27615 area-System.Memory Fix semantics of ArrayMemoryPool https://github.com/dotnet/corefx/issues/27544 https://github.com/dotnet/corefx/issues/27543 1. Make ArrayMemoryPool block ref counting thread-safe. 2. ArrayMemoryPool block returned from the pool has ref count == 1 3. Releasing ArrayMemoryPool block causes it to be disposed and returned to the pool. 27616 area-System.Runtime [Arm64] Add crypto intrinsics Add crypto APIs merged today into CoreCLR. These tests will not pass until new CoreCLR bits propagate to CoreFX Includes #26580 (Simd), because that is expected to merge first. @tannergooding @CarolEidt @eerhardt @4creators @debayang @RussKeldorph 27618 area-System.Text Investigate porting some/all of Roslyn regex parsing checker tests Look at https://github.com/dotnet/roslyn/pull/23984 and see whether there is test material there that would make sense to pull into CoreFX (ie., not too duplicative, easy to port, not too long to run...) cc @CyrusNajmabadi 27619 area-Infrastructure Remove workarounds when uapaot System.Private.CoreLib is updated 27620 area-System.Linq Removed unnecessary Dispose in DistinctIterator.MoveNext method. `DistinctIterator.MoveNext` method contains unnecessary call of `Dispose` method if to execute `MoveNext` method many times. Now `DistinctIterator.MoveNext` method call `Dispose` method only one time. 27623 area-System.Memory Move TryGetString to MemoryMarshal, remove TryGetArray and update tests Resolves https://github.com/dotnet/corefx/issues/27451 Depends on https://github.com/dotnet/coreclr/pull/16692 and subsequent mirror PR. cc @jkotas, @stephentoub, @KrzysztofCwalina, @benaadams, @pakrym 27625 area-System.Runtime System.Text.StringBuilder.Insert uses a lot of memory in certain scenarios "Ported from: https://developercommunity.visualstudio.com/content/problem/63747/systemtextstringbuilderinsert.html Method System.Text.StringBuilder.Insert in a couple with System.Text.StringBuilder.Clear in some cases leads to very dramatic performance degradation and very high memory consumption. For the following test the StringBuilder class is absolutely unsuilable. But this case is only a simple try to reuse object in order to reduce the loading of GC. But the test shows that the result is absolutely opposite to expected. Test case: ``` [TestMethod] public void TestStringBuilderInsert() { const int iterationGranularity = 10000; var buffer = new StringBuilder(); var s = new string(' ', 10); Console.WriteLine($""{buffer.Length}->{buffer.Capacity}""); var sw = Stopwatch.StartNew(); for (int k = 0; k < 10; k++) { for (int i = 1; i <= iterationGranularity; i++) { buffer.Clear(); buffer.Append(s); buffer.Append(s); buffer.Append(s); buffer.Insert(0, s); buffer.Insert(0, s); } Console.WriteLine($""{sw.ElapsedMilliseconds,5}: {buffer.Length}->{buffer.Capacity}""); } sw.Stop(); } ``` Test result: ``` 0->16 71: 50->100042 251: 50->200042 548: 50->300042 1456: 50->400042 2807: 50->500042 4311: 50->600042 6091: 50->700042 8007: 50->800042 9999: 50->900042 12203: 50->1000042 ``` So, the question: If I never put into builder more than 50 characters at the iteration why the Capacity is over 1e6? Moreover if you use memory profiler, you will understand that the memory usage is much worse that it seems at first glance. Screenshot of profiler I will attach. Do you think that allocation 100 Gb of memory is enought? I operated only with 10 Mb... Name Inclusive Allocations Exclusive Allocations Inclusive Bytes Exclusive Bytes Inclusive Allocations % System.Char[] 200 018 200 018 100 015 401 486 100 015 401 486 66,63 " 27626 area-System.Data System.Data.Common.Tests fails some tests in non english locale `System.Data.Common.Tests` fails some tests in non english locale with next log ``` Starting: System.Data.Common.Tests System.Data.Tests.SqlTypes.SqlSingleTest.Conversions [FAIL] Assert.Equal() Failure (pos 1) Expected: 6.4E+17 Actual: 6,4E+17 (pos 1) Stack Trace: C:\Code\corefx\src\System.Data.Common\tests\System\Data\SqlTypes\SqlSingleTest.cs(395,0): at System.Data.Tests.SqlTypes.SqlSingleTest.Conversions() System.Data.Tests.SqlTypes.SqlDoubleTest.Conversions [FAIL] Assert.Equal() Failure (pos 1) Expected: 6.4E+65 Actual: 6,4E+65 (pos 1) Stack Trace: C:\Code\corefx\src\System.Data.Common\tests\System\Data\SqlTypes\SqlDoubleTest.cs(408,0): at System.Data.Tests.SqlTypes.SqlDoubleTest.Conversions() System.Data.Tests.SqlTypes.SqlMoneyTest.Conversions [FAIL] Assert.Equal() Failure (pos 4) Expected: 6464.6464 Actual: 6464,6464 (pos 4) Stack Trace: C:\Code\corefx\src\System.Data.Common\tests\System\Data\SqlTypes\SqlMoneyTest.cs(357,0): at System.Data.Tests.SqlTypes.SqlMoneyTest.Conversions() System.Data.Tests.DataColumnTest2.Expression_Simple [FAIL] Assert.Equal() Failure (pos 3) Expected: 7,6 Actual: 7,60 (pos 3) Stack Trace: C:\Code\corefx\src\System.Data.Common\tests\System\Data\DataColumnTest2.cs(614,0): at System.Data.Tests.DataColumnTest2.Expression_Simple() System.Data.Tests.SqlTypes.SqlStringTest.SqlDoubleToSqlString [FAIL] Assert.Equal() Failure (pos 1) Expected: 6.4E+65 Actual: 6,4E+65 (pos 1) Stack Trace: C:\Code\corefx\src\System.Data.Common\tests\System\Data\SqlTypes\SqlStringTest.cs(665,0): at System.Data.Tests.SqlTypes.SqlStringTest.SqlDoubleToSqlString() System.Data.Tests.SqlTypes.SqlStringTest.SqlMoneyToSqlString [FAIL] Assert.Equal() Failure (pos 6) Expected: 646464.6464 Actual: 646464,6464 (pos 6) Stack Trace: C:\Code\corefx\src\System.Data.Common\tests\System\Data\SqlTypes\SqlStringTest.cs(731,0): at System.Data.Tests.SqlTypes.SqlStringTest.SqlMoneyToSqlString() System.Data.Tests.SqlTypes.SqlDecimalTest.AdjustScale [FAIL] Assert.Equal() Failure (pos 4) Expected: 6464.646400 Actual: 6464,646400 (pos 4) Stack Trace: C:\Code\corefx\src\System.Data.Common\tests\System\Data\SqlTypes\SqlDecimalTest.cs(256,0): at System.Data.Tests.SqlTypes.SqlDecimalTest.AdjustScale() Finished: System.Data.Common.Tests ``` Is it error in tests or in functions? 27628 area-System.IO System.IO.FileSystem.AccessControl.Tests fails some tests on non english windows 27629 area-System.IO System.IO.FileSystem.AccessControl.Tests fails 14 tests on my computer System.IO.FileSystem.AccessControl.Tests fails 14 tests on my computer with next log: ``` Starting: System.IO.FileSystem.AccessControl.Tests System.IO.FileSystemSecurityTests.RemoveAccessRule_IdenticalRule_Succeeds [FAIL] Assert.Equal() Failure Expected: 0 Actual: 1 Stack Trace: C:\Code\corefx\src\System.IO.FileSystem.AccessControl\tests\FileSystemSecurityTests.cs(161,0): at System.IO.FileSystemSecurityTests.RemoveAccessRule_IdenticalRule_Succeeds() System.Security.AccessControl.DirectoryObjectSecurityTests.RemoveAuditRuleSpecific_NoMatchableRuleFound [FAIL] Assert.True() Failure Expected: True Actual: False Stack Trace: C:\Code\corefx\src\System.IO.FileSystem.AccessControl\tests\DirectoryObjectSecurityTests.cs(195,0): at System.Security.AccessControl.DirectoryObjectSecurityTests.RemoveAuditRuleSpecific_NoMatchableRuleFound() System.IO.FileSystemSecurityTests.RemoveAccessRuleSpecific_Succeeds [FAIL] Assert.Equal() Failure Expected: 0 Actual: 1 Stack Trace: C:\Code\corefx\src\System.IO.FileSystem.AccessControl\tests\FileSystemSecurityTests.cs(223,0): at System.IO.FileSystemSecurityTests.RemoveAccessRuleSpecific_Succeeds() System.Security.AccessControl.DirectoryObjectSecurityTests.SetAccessRule_AccessControlType_Deny_Succeeds [FAIL] Assert.True() Failure Expected: True Actual: False Stack Trace: C:\Code\corefx\src\System.IO.FileSystem.AccessControl\tests\DirectoryObjectSecurityTests.cs(692,0): at System.Security.AccessControl.DirectoryObjectSecurityTests.SetAccessRule_AccessControlType_Deny_Succeeds() System.Security.AccessControl.DirectoryObjectSecurityTests.RemoveAuditRule_Succeeds [FAIL] Assert.True() Failure Expected: True Actual: False Stack Trace: C:\Code\corefx\src\System.IO.FileSystem.AccessControl\tests\DirectoryObjectSecurityTests.cs(232,0): at System.Security.AccessControl.DirectoryObjectSecurityTests.RemoveAuditRule_Succeeds() System.Security.AccessControl.DirectoryObjectSecurityTests.SetAuditRule_Succeeds [FAIL] Assert.True() Failure Expected: True Actual: False Stack Trace: C:\Code\corefx\src\System.IO.FileSystem.AccessControl\tests\DirectoryObjectSecurityTests.cs(275,0): at System.Security.AccessControl.DirectoryObjectSecurityTests.SetAuditRule_Succeeds() System.Security.AccessControl.DirectoryObjectSecurityTests.RemoveAccessRuleSpecific_AccessControlType_Deny_NoMatchableRules_Succeeds [FAIL] Assert.True() Failure Expected: True Actual: False Stack Trace: C:\Code\corefx\src\System.IO.FileSystem.AccessControl\tests\DirectoryObjectSecurityTests.cs(455,0): at System.Security.AccessControl.DirectoryObjectSecurityTests.RemoveAccessRuleSpecific_AccessControlType_Deny_NoMatchableRules_Succeeds() System.Security.AccessControl.DirectoryObjectSecurityTests.ResetAccessRule_AccessControlType_Deny_Succeeds [FAIL] Assert.True() Failure Expected: True Actual: False Stack Trace: C:\Code\corefx\src\System.IO.FileSystem.AccessControl\tests\DirectoryObjectSecurityTests.cs(624,0): at System.Security.AccessControl.DirectoryObjectSecurityTests.ResetAccessRule_AccessControlType_Deny_Succeeds() System.Security.AccessControl.DirectoryObjectSecurityTests.AddAccessRule_Succeeds [FAIL] Assert.True() Failure Expected: True Actual: False Stack Trace: C:\Code\corefx\src\System.IO.FileSystem.AccessControl\tests\DirectoryObjectSecurityTests.cs(728,0): at System.Security.AccessControl.DirectoryObjectSecurityTests.AddAccessRule_Succeeds() System.Security.AccessControl.DirectoryObjectSecurityTests.RemoveAccessRule_AccessControlType_Deny_Succeeds [FAIL] Assert.True() Failure Expected: True Actual: False Stack Trace: C:\Code\corefx\src\System.IO.FileSystem.AccessControl\tests\DirectoryObjectSecurityTests.cs(388,0): at System.Security.AccessControl.DirectoryObjectSecurityTests.RemoveAccessRule_AccessControlType_Deny_Succeeds() System.Security.AccessControl.DirectoryObjectSecurityTests.AddAuditRule_Succeeds [FAIL] Assert.True() Failure Expected: True Actual: False Stack Trace: C:\Code\corefx\src\System.IO.FileSystem.AccessControl\tests\DirectoryObjectSecurityTests.cs(311,0): at System.Security.AccessControl.DirectoryObjectSecurityTests.AddAuditRule_Succeeds() System.Security.AccessControl.DirectoryObjectSecurityTests.RemoveRule_AccessControlType_Allow_Succeeds [FAIL] Assert.True() Failure Expected: True Actual: False Stack Trace: C:\Code\corefx\src\System.IO.FileSystem.AccessControl\tests\DirectoryObjectSecurityTests.cs(351,0): at System.Security.AccessControl.DirectoryObjectSecurityTests.RemoveRule_AccessControlType_Allow_Succeeds() System.Security.AccessControl.DirectoryObjectSecurityTests.SetAccessRule_AccessControlType_Allow_Succeeds [FAIL] Assert.True() Failure Expected: True Actual: False Stack Trace: C:\Code\corefx\src\System.IO.FileSystem.AccessControl\tests\DirectoryObjectSecurityTests.cs(661,0): at System.Security.AccessControl.DirectoryObjectSecurityTests.SetAccessRule_AccessControlType_Allow_Succeeds() System.Security.AccessControl.DirectoryObjectSecurityTests.ResetAccessRule_AccessControlType_Allow_Succeeds [FAIL] Assert.True() Failure Expected: True Actual: False Stack Trace: C:\Code\corefx\src\System.IO.FileSystem.AccessControl\tests\DirectoryObjectSecurityTests.cs(587,0): at System.Security.AccessControl.DirectoryObjectSecurityTests.ResetAccessRule_AccessControlType_Allow_Succeeds() Finished: System.IO.FileSystem.AccessControl.Tests ``` 27631 area-System.Net Support UnixDomainSocketEndPoint on Windows Windows is adding support for Unix domain sockets, and it's easy to enable that support via our new UnixDomainSocketEndPoint type. Fixes https://github.com/dotnet/corefx/issues/27542 cc: @eerhardt, @danmosemsft, @geoffkizer, @sunilmut, @tmds 27633 area-System.Memory Add GetPosition overload to ReadOnlySequence Resolves https://github.com/dotnet/corefx/issues/27403 cc @pakrym, @davidfowl, @halter73, @KrzysztofCwalina 27636 area-Serialization [Perf] XmlSerializer.Deserialize() regression between release/2.0.0 and release/2.1 "This is a follow up of https://github.com/dotnet/coreclr/issues/16627 There is a performance regression of `XmlSerializer.Deserialize(Stream)` for 2.1 compared to 2.0. For Windows it's from 10 to 30%, for Linux it's from 50% to 100%. I did a small investigation, it looks that few calls to `system.private.xml!System.Marvin.ComputeHash(System.ReadOnlySpan<Byte>, UInt64)` are responsible for that. 2.1 most time-consuming methods by name:  2.0 most time-consuming methods by name:  Methods which call `Marvin.ComputeHash`  Later I am going to provide a separate PR with a new benchmark for our benchmarking suite. For now please use following plain simple code: ```cs using System; using System.Diagnostics; using System.IO; using System.Xml.Serialization; namespace XmlDeserializationRegression { class Program { static void Main(string[] args) { var serializer = new XmlSerializer(typeof(LoginViewModel)); using (var memoryStream = new MemoryStream(capacity: short.MaxValue)) { serializer.Serialize(memoryStream, CreateLoginViewModel()); Benchmark(memoryStream, serializer, 1, ""Warmup""); Benchmark(memoryStream, serializer, 10000, ""Actual run""); } var coreclrAssemblyInfo = FileVersionInfo.GetVersionInfo(typeof(object).Assembly.Location); var corefxAssemblyInfo = FileVersionInfo.GetVersionInfo(typeof(System.Text.RegularExpressions.Regex).Assembly.Location); Console.WriteLine($""CoreCLR {coreclrAssemblyInfo.FileVersion}, CoreFX {corefxAssemblyInfo.FileVersion}""); } private static void Benchmark(Stream stream, XmlSerializer xmlSerializer, int invocationCount, string displayText) { object deserialized = null; GC.Collect(); GC.WaitForPendingFinalizers(); GC.Collect(); var timer = Stopwatch.StartNew(); for (int i = 0; i < invocationCount; i++) { stream.Position = 0; deserialized = xmlSerializer.Deserialize(stream); } TimeSpan avg = timer.Elapsed / invocationCount; Console.WriteLine($""{displayText}: Average elapsed milliseconds: {avg.TotalMilliseconds}""); GC.KeepAlive(deserialized); } private static LoginViewModel CreateLoginViewModel() => new LoginViewModel { Email = ""name.familyname@not.com"", Password = ""abcdefgh123456!@"", RememberMe = true }; } public class LoginViewModel { public string Email { get; set; } public string Password { get; set; } public bool RememberMe { get; set; } } } ``` The csproj: ```xml <Project Sdk=""Microsoft.NET.Sdk""> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFrameworks>netcoreapp2.1;netcoreapp2.0</TargetFrameworks> <RuntimeIdentifier>win-x64</RuntimeIdentifier> </PropertyGroup> </Project> ``` To run the benchmark: `dotnet run -c Release -f netcoreapp2.0` and `dotnet run -c Release -f netcoreapp2.0` Some Flame Graphs from PerfView which give good overview: For 2.0:  For 2.1:  The problematic part:  It's my first perf investigation as a new member of the .NET Performance Team, please let me know if something is missing or wrong. " 27638 area-System.Net TcpClient uses Socket class which can fail in odd ways on UWP I am unsure what the actual cause of this is, but when I call Connect on a TcpClient that is working on an endpoint that is connected to the machine via VPN, then the underlying Socket connect call returns AccessDenied (as stated [here](https://social.msdn.microsoft.com/Forums/en-US/d9171ccf-efbc-498a-bc4d-ebe58055d3a7/uwpcannot-connect-to-private-server-socketerror-accessdenied?forum=wpdevelop)). The link suggests using StreamSocket to connect, but how can I do that when this is an implementation detail of TcpClient. Is there no way to accomplish this connection? 27639 area-Infrastructure Improve ref assembly generation process Currently reference assembly sources are checked into the repository and generated manually. Nothing in the build system validates that the resulting reference assemblies actually match the implementation assemblies. This is very error prone process. Especially for external contributor who doesn't know that they need to run some custom build target to regenerate the ref assembly sources. As it happened a few times already for System.Reflection.Metadata these ref assemblies get out of sync. The unit tests do not catch these breaks since they need to reference the implementation assembly in order to access internal methods and types for testing purposes. These breaks go thus unnoticed. 27642 area-Infrastructure ApiCompat giving incorrect error about implementation instead of correctly pointing to the contract The ApiCompat error from https://github.com/dotnet/corefx/pull/27640#issuecomment-369808688 seems to be reversed. ```text D:\GitHub\Fork\corefx\src\shims\ApiCompat.proj(76,5): error : TypeCannotChangeClassification : Type 'System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable.ConfiguredValueTaskAwaiter' is marked as readonly in the contract so it mu st also be marked readonly in the implementation. ``` The fix was to add `readonly` to the ref (contract). The error message indicates that the contract is marked as readonly, but the implementation is not, which is the opposite of what it should have been. Any ideas why? cc @ericstj, @weshaggard, @joperezr, @stephentoub 27643 area-System.Net Consider Socket.OSSupportsUnixDomainSockets property `System.Net.Socket` currently has these two properties: ```C# public static bool OSSupportsIPv4 { get; } public static bool OSSupportsIPv6 { get; } ``` In .NET Core 2.1, we've added a public EndPoint-derived type for Unix domain sockets (UnixDomainSocketEndPoint). Unix domain sockets work across all Unixes we target, but Windows is also adding support (https://blogs.msdn.microsoft.com/commandline/2017/12/19/af_unix-comes-to-windows/), and we can support that via UnixDomainSocketEndPoint as well. We should consider adding: ```C# public static bool OSSupportsUnixDomainSockets { get; } ``` 27644 area-System.IO Fix System.IO.Pipelines reference assembly cc @pakrym, @davidfowl, @joperezr, @weshaggard ~The ref csproj doesn't need System.Buffers.~ And if I reference System.Memory as a ProjectReference, I get the following errors, when I run `msbuild` after navigating to `corefx\src\System.IO.Pipelines`: ```text ... System.IO.Pipelines.cs(86,107): error CS1069: The type name 'ReadOnlyMemory<>' could not be found in the namespace 'System'. This type has been forwarded to assembly 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b0 3f5f7f11d50a3a' Consider adding a reference to that assembly. [D:\GitHub\Fork\corefx\src\System.IO.Pipelines\ref\System.IO.Pipelines.csproj] System.IO.Pipelines.cs(76,48): error CS0012: The type 'Memory<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a '. [D:\GitHub\Fork\corefx\src\System.IO.Pipelines\ref\System.IO.Pipelines.csproj] System.IO.Pipelines.cs(76,48): error CS0012: The type 'Span<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. [D:\GitHub\Fork\corefx\src\System.IO.Pipelines\ref\System.IO.Pipelines.csproj] CSC : error CS0012: The type 'CLSCompliantAttribute' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. [D:\GitHu b\Fork\corefx\src\System.IO.Pipelines\ref\System.IO.Pipelines.csproj] System.IO.Pipelines.cs(91,65): error CS3001: Argument type 'ReadOnlySequence<byte>' is not CLS-compliant [D:\GitHub\Fork\corefx\src\System.IO.Pipelines\ref\System.IO.Pipelines.csproj] System.IO.Pipelines.cs(48,60): error CS3001: Argument type 'MemoryPool<byte>' is not CLS-compliant [D:\GitHub\Fork\corefx\src\System.IO.Pipelines\ref\System.IO.Pipelines.csproj] System.IO.Pipelines.cs(60,64): error CS3001: Argument type 'SequencePosition' is not CLS-compliant [D:\GitHub\Fork\corefx\src\System.IO.Pipelines\ref\System.IO.Pipelines.csproj] System.IO.Pipelines.cs(61,64): error CS3001: Argument type 'SequencePosition' is not CLS-compliant [D:\GitHub\Fork\corefx\src\System.IO.Pipelines\ref\System.IO.Pipelines.csproj] System.IO.Pipelines.cs(61,98): error CS3001: Argument type 'SequencePosition' is not CLS-compliant [D:\GitHub\Fork\corefx\src\System.IO.Pipelines\ref\System.IO.Pipelines.csproj] ... ``` Also, only include reference to System.Threading.Tasks when necessary in src csproj. 27645 area-System.Data Add SqlCredential dependent APIs This PR adds APIs that were dependent on the SqlCredential class ported in #27311. A large chunk of this was ported from reference source, but I had to fill in gaps in assembling the SNI packets for login when using SecureStrings. This happens in TdsParserStateObjectManaged.cs and TdsParserStateObjectNative.cs, and while functional may not be perfect (this is my first time dealing with SecureStrings in this context). Both unit tests and integration tests have been added. The integration tests for this change connect to the database and create a login on which changes are tested. These are passing on my local SQL instance. Always happy to make any requested changes. Related issue: #11542 Edit Fixes #11542 @saurabh500 27646 area-System.Diagnostics System.Diagnostics.EventLog.Tests fails 2 tests in non-English Windows `System.Diagnostics.EventLog.Tests` fails 2 tests in non-English Windows with next log: ``` System.Diagnostics.Tests.EventLogTests.CheckLogName_Get [FAIL] Assert.Equal() Failure (pos 0) Expected: Application Actual: Приложение (pos 0) Stack Trace: C:\Code\corefx\src\System.Diagnostics.EventLog\tests\EventLogTests\EventLogTests.cs(83,0): at System.Diagnostics.Tests.EventLogTests.CheckLogName_Get() System.Diagnostics.Tests.EventLogTests.GetLogDisplayName_Set [FAIL] Assert.Equal() Failure (pos 0) Expected: Application Actual: Приложение (pos 0) Stack Trace: C:\Code\corefx\src\System.Diagnostics.EventLog\tests\EventLogTests\EventLogTests.cs(112,0): at System.Diagnostics.Tests.EventLogTests.GetLogDisplayName_Set() ``` I do not know how to fix these tests, because `EventLog.LogDisplayName` differs in non-English Windows. May be test `EventLog.Log` property ? Or test that `EventLog.LogDisplayName` is not empty string? 27647 area-System.Drawing System.Drawing.Common.Tests fails 10 tests in non-English Windows "System.Drawing.Common.Tests fails 10 tests in non-English Windows with next log: ``` Starting: System.Drawing.Common.Tests System.Drawing.Tests.FontTests.ToLogFont_Invoke_ReturnsExpected(fontStyle: Bold, Italic, Strikeout, gdiCharSet: 1, gdiVerticalFont: True, expectedNamePrefix: \""@\"", expectedWeight: 700) [FAIL] Assert.Equal() Failure Expected: 1 Actual: 204 Stack Trace: C:\Code\corefx\src\System.Drawing.Common\tests\FontTests.cs(719,0): at System.Drawing.Tests.FontTests.ToLogFont_Invoke_ReturnsExpected(FontStyle fontStyle, Byte gdiCharSet, Boolean gdiVerticalFont, String expectedNamePrefix, Int32 expectedWeight) System.Drawing.Tests.FontTests.ToLogFont_Invoke_ReturnsExpected(fontStyle: Regular, gdiCharSet: 0, gdiVerticalFont: False, expectedNamePrefix: \""\"", expectedWeight: 400) [FAIL] Assert.Equal() Failure Expected: 0 Actual: 204 Stack Trace: C:\Code\corefx\src\System.Drawing.Common\tests\FontTests.cs(719,0): at System.Drawing.Tests.FontTests.ToLogFont_Invoke_ReturnsExpected(FontStyle fontStyle, Byte gdiCharSet, Boolean gdiVerticalFont, String expectedNamePrefix, Int32 expectedWeight) System.Drawing.Tests.FontTests.ToLogFont_Invoke_ReturnsExpected(fontStyle: Regular, gdiCharSet: 10, gdiVerticalFont: False, expectedNamePrefix: \""\"", expectedWeight: 400) [FAIL] Assert.Equal() Failure Expected: 10 Actual: 204 Stack Trace: C:\Code\corefx\src\System.Drawing.Common\tests\FontTests.cs(719,0): at System.Drawing.Tests.FontTests.ToLogFont_Invoke_ReturnsExpected(FontStyle fontStyle, Byte gdiCharSet, Boolean gdiVerticalFont, String expectedNamePrefix, Int32 expectedWeight) System.Drawing.Tests.FontTests.ToLogFont_InvokeGraphics_ReturnsExpected(textRenderingHint: SystemDefault, expectedQuality: 0) [FAIL] Assert.Equal() Failure Expected: 1 Actual: 204 Stack Trace: C:\Code\corefx\src\System.Drawing.Common\tests\FontTests.cs(756,0): at System.Drawing.Tests.FontTests.ToLogFont_InvokeGraphics_ReturnsExpected(TextRenderingHint textRenderingHint, Int32 expectedQuality) System.Drawing.Tests.FontTests.ToLogFont_InvokeGraphics_ReturnsExpected(textRenderingHint: AntiAlias, expectedQuality: 3) [FAIL] Assert.Equal() Failure Expected: 1 Actual: 204 Stack Trace: C:\Code\corefx\src\System.Drawing.Common\tests\FontTests.cs(756,0): at System.Drawing.Tests.FontTests.ToLogFont_InvokeGraphics_ReturnsExpected(TextRenderingHint textRenderingHint, Int32 expectedQuality) System.Drawing.Tests.FontTests.ToLogFont_InvokeGraphics_ReturnsExpected(textRenderingHint: AntiAliasGridFit, expectedQuality: 3) [FAIL] Assert.Equal() Failure Expected: 1 Actual: 204 Stack Trace: C:\Code\corefx\src\System.Drawing.Common\tests\FontTests.cs(756,0): at System.Drawing.Tests.FontTests.ToLogFont_InvokeGraphics_ReturnsExpected(TextRenderingHint textRenderingHint, Int32 expectedQuality) System.Drawing.Tests.FontTests.ToLogFont_InvokeGraphics_ReturnsExpected(textRenderingHint: SingleBitPerPixel, expectedQuality: 3) [FAIL] Assert.Equal() Failure Expected: 1 Actual: 204 Stack Trace: C:\Code\corefx\src\System.Drawing.Common\tests\FontTests.cs(756,0): at System.Drawing.Tests.FontTests.ToLogFont_InvokeGraphics_ReturnsExpected(TextRenderingHint textRenderingHint, Int32 expectedQuality) System.Drawing.Tests.FontTests.ToLogFont_InvokeGraphics_ReturnsExpected(textRenderingHint: SingleBitPerPixelGridFit, expectedQuality: 3) [FAIL] Assert.Equal() Failure Expected: 1 Actual: 204 Stack Trace: C:\Code\corefx\src\System.Drawing.Common\tests\FontTests.cs(756,0): at System.Drawing.Tests.FontTests.ToLogFont_InvokeGraphics_ReturnsExpected(TextRenderingHint textRenderingHint, Int32 expectedQuality) System.Drawing.Tests.FontTests.ToLogFont_InvokeGraphics_ReturnsExpected(textRenderingHint: ClearTypeGridFit, expectedQuality: 5) [FAIL] Assert.Equal() Failure Expected: 1 Actual: 204 Stack Trace: C:\Code\corefx\src\System.Drawing.Common\tests\FontTests.cs(756,0): at System.Drawing.Tests.FontTests.ToLogFont_InvokeGraphics_ReturnsExpected(TextRenderingHint textRenderingHint, Int32 expectedQuality) System.Drawing.Imaging.Tests.MetafileTests.Ctor_StringIntPtrEmfType_Success(emfType: EmfPlusDual) [FAIL] System.Runtime.InteropServices.ExternalException : A generic error occurred in GDI+. Stack Trace: C:\Code\corefx\src\System.Drawing.Common\src\System\Drawing\Imaging\Metafile.Windows.cs(264,0): at System.Drawing.Imaging.Metafile..ctor(String fileName, IntPtr referenceHdc, EmfType type, String description) C:\Code\corefx\src\System.Drawing.Common\src\System\Drawing\Imaging\Metafile.Windows.cs(241,0): at System.Drawing.Imaging.Metafile..ctor(String fileName, IntPtr referenceHdc, EmfType type) C:\Code\corefx\src\System.Drawing.Common\tests\Imaging\MetafileTests.cs(399,0): at System.Drawing.Imaging.Tests.MetafileTests.Ctor_StringIntPtrEmfType_Success(EmfType emfType) Finished: System.Drawing.Common.Tests ``` On my computer `font.ToLogFont(logFont);` always set `logFont.lfCharSet` to 204. Is it error in test or in implementation?" 27650 area-System.Net System.Net.Security.Tests fails 3 tests in non-English Windows System.Net.Security.Tests fails 3 tests in non-English Windows 27651 area-System.IO ValueTask adoption in System.IO.Pipelines - Use the new IValueTaskSource support added to corefx - Implement IValueTaskSource on the defualt PipeReader and PipeWriter implementations. - Handle the case where there is a sync context and allow turning this behavior off to favor the specified schedulers /cc @pakrym @stephentoub ~PS: I couldn't get it compiling so I assume that something was wrong with my build locally or the ref in corefx (I didn't try hard enough yet). I'm sending this out as a WIP so it can be reviewed. I still need to update tests accordingly~ 27653 area-System.IO System.IO.Tests.DirectoryInfo Win10 UWP CI Failures UWP CoreCLR x64 Debug Build Windows.10.Amd64.ClientRS2.Open-Debug-x64 ``` System.IO.Tests.DirectoryInfo_Create RootPath Unhandled Exception of Type System.IO.DirectoryNotFoundException Message : System.IO.DirectoryNotFoundException : Could not find a part of the path 'C:\\'. Stack Trace : at System.IO.FileSystem.CreateDirectory(String fullPath) at System.IO.DirectoryInfo.Create() at System.IO.Tests.DirectoryInfo_Create.Create(String path) in D:\j\workspace\windows-TGrou---33cbf18b\src\System.IO.FileSystem\tests\DirectoryInfo\Create.cs:line 16 at System.IO.Tests.Directory_CreateDirectory.RootPath() in D:\j\workspace\windows-TGrou---33cbf18b\src\System.IO.FileSystem\tests\Directory\CreateDirectory.cs:line 89 ``` ``` System.IO.Tests.DirectoryInfo_Exists Root Assert.True() Failure Expected: True Actual: False Stack Trace : at System.IO.Tests.DirectoryInfo_Exists.Root() in D:\j\workspace\windows-TGrou---33cbf18b\src\System.IO.FileSystem\tests\DirectoryInfo\Exists.cs:line 43 ``` ``` System.IO.Tests.DirectoryInfo_ToString DriveOnlyReturnsPeriod_Windows_Desktop Assert.Equal() Failure ↓ (pos 0) Expected: . Actual: C: ↑ (pos 0) Stack Trace : at System.IO.Tests.DirectoryInfo_ToString.DriveOnlyReturnsPeriod_Windows_Desktop() in D:\j\workspace\windows-TGrou---33cbf18b\src\System.IO.FileSystem\tests\DirectoryInfo\ToString.cs:line 47 ``` ``` System.IO.Tests.Directory_CreateDirectory RootPath Unhandled Exception of Type System.IO.DirectoryNotFoundException Message : System.IO.DirectoryNotFoundException : Could not find a part of the path 'C:\\'. Stack Trace : at System.IO.FileSystem.CreateDirectory(String fullPath) at System.IO.Directory.CreateDirectory(String path) at System.IO.Tests.Directory_CreateDirectory.Create(String path) in D:\j\workspace\windows-TGrou---33cbf18b\src\System.IO.FileSystem\tests\Directory\CreateDirectory.cs:line 17 at System.IO.Tests.Directory_CreateDirectory.RootPath() in D:\j\workspace\windows-TGrou---33cbf18b\src\System.IO.FileSystem\tests\Directory\CreateDirectory.cs:line 89 ``` #27644 #27650 #27645 27654 area-System.Net Remove temporary ByteArrayHelpers and use Span.Equals The issue - https://github.com/dotnet/corefx/issues/21395 - has been resolved. cc @stephentoub, @geoffkizer 27655 area-System.Net System.Net.Http.Functional.Tests Win10 UWP CI Failures "UWP CoreCLR x64 Debug Build Windows.10.Amd64.ClientRS2.Open:Debug-x64 ``` C:\dotnetbuild\work\2ceaeb93-cc2a-4fd8-bdc6-34ca814f1b98\Work\04be80d4-1146-45e6-a5a3-bb5aa0291119\Unzip>mklink /H xunit.runner.utility.dotnet.dll C:\dotnetbuild\work\2ceaeb93-cc2a-4fd8-bdc6-34ca814f1b98\Payload\UAPLayout\xunit.runner.utility.dotnet.dll Cannot create a file when that file already exists. C:\dotnetbuild\work\2ceaeb93-cc2a-4fd8-bdc6-34ca814f1b98\Work\04be80d4-1146-45e6-a5a3-bb5aa0291119\Unzip>mklink /H xunit.runner.utility.dotnet.pdb C:\dotnetbuild\work\2ceaeb93-cc2a-4fd8-bdc6-34ca814f1b98\Payload\UAPLayout\xunit.runner.utility.dotnet.pdb Hardlink created for xunit.runner.utility.dotnet.pdb <<===>> C:\dotnetbuild\work\2ceaeb93-cc2a-4fd8-bdc6-34ca814f1b98\Payload\UAPLayout\xunit.runner.utility.dotnet.pdb C:\dotnetbuild\work\2ceaeb93-cc2a-4fd8-bdc6-34ca814f1b98\Work\04be80d4-1146-45e6-a5a3-bb5aa0291119\Unzip>copy /y C:\dotnetbuild\work\2ceaeb93-cc2a-4fd8-bdc6-34ca814f1b98\Payload\UAPLayout\System.Private.CoreLib.dll System.Private.CoreLib.ni.dll 1 file(s) copied. C:\dotnetbuild\work\2ceaeb93-cc2a-4fd8-bdc6-34ca814f1b98\Work\04be80d4-1146-45e6-a5a3-bb5aa0291119\Unzip>call C:\dotnetbuild\work\2ceaeb93-cc2a-4fd8-bdc6-34ca814f1b98\Payload\Launcher\WindowsStoreAppLauncher.exe -test appxmanifest.xml System.Net.Http.Functional.Tests.dll -xml testResults.xml -notrait Benchmark=true -notrait category=nonuaptests -notrait category=nonwindowstests -notrait category=OuterLoop -notrait category=failing Got manifest file appxmanifest.xml Removing any previous installation... Installing the application... Package ID is 5cd54353-3ed7-4a6e-a72f-db349f28867c_1.0.0.0_x64__v52bfwc2c21ha Starting the application... Resolved Folder Path: C:\Users\DotNetTestRunner\AppData\Local\Packages\5cd54353-3ed7-4a6e-a72f-db349f28867c_v52bfwc2c21ha\ Waiting for the application to exit... Process has just exited with return code -2146232797. Disabling the debugger... STDOUT & STDERR from immersive process: ================================================================================== System.Net.Http.Functional.Tests.dll -xml testResults.xml -notrait Benchmark=true -notrait category=nonuaptests -notrait category=nonwindowstests -notrait category=OuterLoop -notrait category=failing Discovering: System.Net.Http.Functional.Tests Discovered: System.Net.Http.Functional.Tests Starting: System.Net.Http.Functional.Tests System.Net.Http.Functional.Tests.HttpClientEKUTest.HttpClient_ClientEKUServerAuth_Fails [SKIP] Condition(s) not met: \""CanTestCertificates\"" System.Net.Http.Functional.Tests.HttpClientEKUTest.HttpClient_NoEKUClientAuth_Ok [SKIP] Condition(s) not met: \""CanTestClientCertificates\"" System.Net.Http.Functional.Tests.HttpClientEKUTest.HttpClient_NoEKUServerAuth_Ok [SKIP] Condition(s) not met: \""CanTestCertificates\"" System.Net.Http.Functional.Tests.HttpClientEKUTest.HttpClient_ServerEKUClientAuth_Fails [SKIP] Condition(s) not met: \""CanTestClientCertificates\"" ================================================================================== Removing the application... SUCCESS ExitCode -2146232797 C:\dotnetbuild\work\2ceaeb93-cc2a-4fd8-bdc6-34ca814f1b98\Work\04be80d4-1146-45e6-a5a3-bb5aa0291119\Unzip>move C:\Users\DotNetTestRunner\Documents\TestResults\System.Net.Http.Functional.Tests.dll.xml .\testResults.xml The system cannot find the file specified. ----- end 10:54:22.20 ----- exit code 1 ---------------------------------------------------------- INFO: proc(58): run_and_log_output: Exit Code: 1 scriptrunner(91): _main: Error: No exception thrown, but XUnit results not created helix_test_execution(83): report_error: Error running xunit None ``` #27644 #27650 #27645" 27656 area-Infrastructure [Arm64/Linux] Enable CI & Official builds @jashook @janvorli Needs coreclr linux-arm64 in nuget PTAL let me know if there is anything else which I might have missed. 27659 area-System.ComponentModel Test failure: System.ComponentModel.Composition.CompositionExceptionTests/Message_ShouldFormatCountOfRootCausesUsingTheCurrentCulture Opened on behalf of @danmosemsft The test `System.ComponentModel.Composition.CompositionExceptionTests/Message_ShouldFormatCountOfRootCausesUsingTheCurrentCulture` has failed. Assert.True() Failure\r Expected: True\r Actual: False Stack Trace: at System.ComponentModel.Composition.CompositionExceptionTests.AssertMessage(CompositionException exception, Int32 rootCauseCount, CultureInfo culture) in E:\A\_work\5\s\corefx\src\System.ComponentModel.Composition\tests\System\ComponentModel\Composition\CompositionExceptionTests.cs:line 413 at System.ComponentModel.Composition.CompositionExceptionTests.Message_ShouldFormatCountOfRootCausesUsingTheCurrentCulture() in E:\A\_work\5\s\corefx\src\System.ComponentModel.Composition\tests\System\ComponentModel\Composition\CompositionExceptionTests.cs:line 378 Build : Master - 20180302.04 (UWP F5 Tests) Failing configurations: - Windows.10.Amd64.ClientRS3-x86 - Release 27660 area-System.Diagnostics EventSource: Arrays in the Event payload are not supported "I see a major problem with the Lttng output on Linux when an array is passed to an Event using a custom EventSource. One of the events in our EventSource includes a byte array in its payload. [a data buffer] On Windows the event log correctly shows the data in that buffer, but on Linux it simply shows ""System.Byte[]"". Apparently it is using ToString() which will not work for arrays. I am simply passing a Byte[] to the WriteEvent() function in my EventSource: ``` [Event(6, Level = EventLevel.LogAlways)] private void DataMsg(String action, String msgType, UInt32 sesssion, UInt32 request, Int32 length, Byte[] data) { WriteEvent(6, action, msgType, sesssion, request, length, data); } ``` I copied the log file [chanel0_0] to Windows and read it using Notepad++. (I'm sure there is a simple way to read it on Ubuntu but I'm not familiar with Linux.) An example of the payload received from this DataMsg event follows: **{""action"":""SEND"", ""msgType"":""Start"", ""sesssion"":9774, ""request"":1, ""length"":61, ""data"":System.Byte[]}** Everything looks good except for the 'data' value. On Windows the *.etl file contains the actual contents of the data buffer. (This value is displayed in PerfView as a hex-string.) " 27662 area-System.IO Test failure: System.IO.Tests.DirectoryInfo_GetSetTimes/TimesIncludeMillisecondPart Test passes on all Linux distros in CI: https://github.com/dotnet/corefx/pull/27559 Test fails on all Linux distros in official build. Investigating whether build is exactly the same. The test `System.IO.Tests.DirectoryInfo_GetSetTimes/TimesIncludeMillisecondPart` has failed. ``` Assert.All() Failure: 6 out of 6 items in the collection did not pass. [5]: Xunit.Sdk.NotEqualException: Assert.NotEqual() Failure Expected: Not 0 Actual: 0 at Xunit.Assert.NotEqual[T](T expected, T actual, IEqualityComparer`1 comparer) at System.IO.Tests.BaseGetSetTimes`1.<>c__DisplayClass8_0.<TimesIncludeMillisecondPart>b__0(TimeFunction function) in /root/corefx-1435242/src/System.IO.FileSystem/tests/Base/BaseGetSetTimes.cs:line 101 at Xunit.Assert.All[T](IEnumerable`1 collection, Action`1 action) [4]: Xunit.Sdk.NotEqualException: Assert.NotEqual() Failure Expected: Not 0 Actual: 0 at Xunit.Assert.NotEqual[T](T expected, T actual, IEqualityComparer`1 comparer) at System.IO.Tests.BaseGetSetTimes`1.<>c__DisplayClass8_0.<TimesIncludeMillisecondPart>b__0(TimeFunction function) in /root/corefx-1435242/src/System.IO.FileSystem/tests/Base/BaseGetSetTimes.cs:line 101 at Xunit.Assert.All[T](IEnumerable`1 collection, Action`1 action) [3]: Xunit.Sdk.NotEqualException: Assert.NotEqual() Failure Expected: Not 0 Actual: 0 at Xunit.Assert.NotEqual[T](T expected, T actual, IEqualityComparer`1 comparer) at System.IO.Tests.BaseGetSetTimes`1.<>c__DisplayClass8_0.<TimesIncludeMillisecondPart>b__0(TimeFunction function) in /root/corefx-1435242/src/System.IO.FileSystem/tests/Base/BaseGetSetTimes.cs:line 101 at Xunit.Assert.All[T](IEnumerable`1 collection, Action`1 action) [2]: Xunit.Sdk.NotEqualException: Assert.NotEqual() Failure Expected: Not 0 Actual: 0 at Xunit.Assert.NotEqual[T](T expected, T actual, IEqualityComparer`1 comparer) at System.IO.Tests.BaseGetSetTimes`1.<>c__DisplayClass8_0.<TimesIncludeMillisecondPart>b__0(TimeFunction function) in /root/corefx-1435242/src/System.IO.FileSystem/tests/Base/BaseGetSetTimes.cs:line 101 at Xunit.Assert.All[T](IEnumerable`1 collection, Action`1 action) [1]: Xunit.Sdk.NotEqualException: Assert.NotEqual() Failure Expected: Not 0 Actual: 0 at Xunit.Assert.NotEqual[T](T expected, T actual, IEqualityComparer`1 comparer) at System.IO.Tests.BaseGetSetTimes`1.<>c__DisplayClass8_0.<TimesIncludeMillisecondPart>b__0(TimeFunction function) in /root/corefx-1435242/src/System.IO.FileSystem/tests/Base/BaseGetSetTimes.cs:line 101 at Xunit.Assert.All[T](IEnumerable`1 collection, Action`1 action) [0]: Xunit.Sdk.NotEqualException: Assert.NotEqual() Failure Expected: Not 0 Actual: 0 at Xunit.Assert.NotEqual[T](T expected, T actual, IEqualityComparer`1 comparer) at System.IO.Tests.BaseGetSetTimes`1.<>c__DisplayClass8_0.<TimesIncludeMillisecondPart>b__0(TimeFunction function) in /root/corefx-1435242/src/System.IO.FileSystem/tests/Base/BaseGetSetTimes.cs:line 101 at Xunit.Assert.All[T](IEnumerable`1 collection, Action`1 action) Stack Trace: null Build : Master - 20180302.04 (Core Tests) Failing configurations: - RedHat.69.Amd64-x64 - Release - Fedora.27.Amd64-x64 - Release - Fedora.26.Amd64-x64 - Release - SLES.12.Amd64-x64 - Release - OpenSuse.423.Amd64-x64 - Release - Ubuntu.1804.Amd64-x64 - Release - Ubuntu.1710.Amd64-x64 - Release - Ubuntu.1604.Amd64-x64 - Release - Ubuntu.1404.Amd64-x64 - Release - Debian.90.Amd64-x64 - Release - Debian.87.Amd64-x64 - Release - RedHat.74.Amd64-x64 - Release - RedHat.73.Amd64-x64 - Release - Centos.74.Amd64-x64 - Release - Centos.73.Amd64-x64 - Release 27664 area-System.Memory System.Memory.Tests fails 516 tests of parsing numbers System.Memory.Tests fails 516 tests of parsing numbers with next log ``` System.Buffers.Text.Tests.ParserTests.TestParserInt16(testData: [ParseInt16 '32 747,00',N to 32747)]) [FAIL] TestException : This parse attempt [ParseInt16 '32 747,00',N to 32747)] succeeded as expected but parsed to the wrong value: Expected: 32747 Actual: 32 Stack Trace: C:\Code\corefx\src\System.Memory\tests\ParsersAndFormatters\Parser\ValidateParser.cs(45,0): at System.Buffers.Text.Tests.ParserTests.ValidateParserHelper[T](ParserTestData`1 testData) C:\Code\corefx\src\System.Memory\tests\ParsersAndFormatters\Parser\ValidateParser.cs(13,0): at System.Buffers.Text.Tests.ParserTests.ValidateParser[T](ParserTestData`1 testData) C:\Code\corefx\src\System.Memory\tests\ParsersAndFormatters\Parser\ParserTests.cs(37,0): at System.Buffers.Text.Tests.ParserTests.TestParserInt16(ParserTestData`1 testData) ``` and so on... To reproduce it. Set the decimal separator different from dot. And set thousand separator different from comma. So bug is in test data generator that have very intricate code. And I can not find bug location. I spend about 4 hours to find bug location. 27665 area-Infrastructure Use .Net lib for SecurityProtocol Should resolve updating the Versions repo in the 1.0.0 Pipebuild. @dagood PTAL 27666 area-Infrastructure Use .Net Core for UpdatePublishDependencies To unblock updating Versions repo in 1.1.0 pipebuild @dagood PTAL (this one is different than the CoreCLR ones due to directly invoking VersionTools.targets) 27667 area-Infrastructure Use .Net Core for updating Versions repo Should unblock updating the Versions repo in the pipebuild. @dagood PTAL 27669 area-System.Text Revert exposing Capture.Text Mistake from my side... 27672 area-System.Net NTLM authentication sometimes broken by multiple WWW-Authenticate headers "This issue has been split off from #9234, which turned out to be a problem in the tool being used to observe network traffic. Other users saw similar results, but under different conditions and not caused by the testing tool. That issue will be tracked here to clearly separate the two issues. The issue tracked here occurs with the following code, targeting .NET Core 2.0: ```C# var creds = new CredentialCache(); creds.Add(new Uri(addy),""NTLM"",new NetworkCredential(Username,Password)); var handler = new HttpClientHandler { Credentials = creds, }; HttpClient client = new HttpClient(handler); client.BaseAddress = new Uri(addy); var response = await client.GetAsync(""api/myresource""); ``` In Windows, the server receives the following headers, but does not initiate the NTLM handshake: ```http HTTP/1.1 401 Unauthorized Content-Type: text/html Server: Microsoft-IIS/8.5 WWW-Authenticate: NTLM WWW-Authenticate: Negotiate X-Powered-By: ASP.NET Date: Thu, 01 Mar 2018 22:17:34 GMT Content-Length: 1293 ``` @dbrownxc, can you provide more information on the situation in which you were able to reproduce this issue? It would be good to have full logs for the unsuccessful authentication attempt. cc: @seriouz @karelz @davidsh " 27674 area-Infrastructure [uap] CoreFx build is failing since 'RemotelyInvokable' does not contain a definition for 'LongWait' https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_build?_a=summary&buildId=1436514 ```text 2018-03-02T21:25:47.5255290Z Build FAILED. 2018-03-02T21:25:47.5268140Z 2018-03-02T21:25:47.5269301Z ProcessTestBase.Uap.cs(68,57): error CS0117: 'RemotelyInvokable' does not contain a definition for 'LongWait' [E:\A\_work\36\s\corefx\src\System.Diagnostics.Process\tests\System.Diagnostics.Process.Tests.csproj] 2018-03-02T21:25:47.5272048Z 0 Warning(s) 2018-03-02T21:25:47.5273015Z 1 Error(s) ``` cc @jkotas, @stephentoub 27675 area-System.Threading IsValidLocationForInlining no longer considered when running await continuations "when up to 2.1 preview1 run app in cmd dotnet run -c release -f netcoreapp2.1 TaskCompletionSource TrySetResult be blocked netcoreapp2.0 is ok ```C# public sealed class TaskCompletionSource : TaskCompletionSource<int> { public static readonly TaskCompletionSource Void = CreateVoidTcs(); public TaskCompletionSource(object state) : base(state) { } public TaskCompletionSource() { } public bool TryComplete() { return this.TrySetResult(0); } public void Complete() => this.SetResult(0); // todo: support cancellation token where used public bool SetUncancellable() => true; public override string ToString() => ""TaskCompletionSource[status: "" + this.Task.Status.ToString() + ""]""; static TaskCompletionSource CreateVoidTcs() { var tcs = new TaskCompletionSource(); tcs.TryComplete(); return tcs; } } ```" 27677 area-Infrastructure System.Transactions.Local.Tests 🔥 Linux x64 Release Build Linux x64 Release Build OpenSuse.423.Amd64.Open:Release-x64 System.Transactions.Local.Tests 🔥 ``` Details from Job ab3d3d99-d911-4dbc-bb9b-bcf3ee74d226 ExitCode: -3 Ran on Machine: jofortes-opensuse-test Executed on jofortes-opensuse-test lix Script Runner v0.1 starting pying execution payload files from /home/jofortes/dotnetbuild/work/ab3d3d99-d911-4dbc-bb9b-bcf3ee74d226/Work/6288c9a0-0d0b-41e7-b7c4-d4ef6369079a/Unzip to /home/jofortes/dotnetbuild/work/ab3d3d99-d911-4dbc-bb9b-bcf3ee74d226/Work/6288c9a0-0d0b-41e7-b7c4-d4ef6369079a/Exec/execution ofortes/dotnetbuild/work/ab3d3d99-d911-4dbc-bb9b-bcf3ee74d226/Work/6288c9a0-0d0b-41e7-b7c4-d4ef6369079a/Unzip/System.Transactions.Local.Tests.dll' to '/home/jofortes/dotnetbuild/work/ab3d3d99-d911-4dbc-bb9b-bcf3ee74d226/Work/6288c9a0-0d0b-41e7-b7c4-d4ef6369079a/Exec/execution/System.Transactions.Local.Tests.dll' ofortes/dotnetbuild/work/ab3d3d99-d911-4dbc-bb9b-bcf3ee74d226/Work/6288c9a0-0d0b-41e7-b7c4-d4ef6369079a/Unzip/xunit.console.netcore.exe' to '/home/jofortes/dotnetbuild/work/ab3d3d99-d911-4dbc-bb9b-bcf3ee74d226/Work/6288c9a0-0d0b-41e7-b7c4-d4ef6369079a/Exec/execution/xunit.console.netcore.exe' ofortes/dotnetbuild/work/ab3d3d99-d911-4dbc-bb9b-bcf3ee74d226/Work/6288c9a0-0d0b-41e7-b7c4-d4ef6369079a/Unzip/RunTests.sh' to '/home/jofortes/dotnetbuild/work/ab3d3d99-d911-4dbc-bb9b-bcf3ee74d226/Work/6288c9a0-0d0b-41e7-b7c4-d4ef6369079a/Exec/execution/RunTests.sh' ofortes/dotnetbuild/work/ab3d3d99-d911-4dbc-bb9b-bcf3ee74d226/Work/6288c9a0-0d0b-41e7-b7c4-d4ef6369079a/Unzip/xunit.console.netcore.runtimeconfig.json' to '/home/jofortes/dotnetbuild/work/ab3d3d99-d911-4dbc-bb9b-bcf3ee74d226/Work/6288c9a0-0d0b-41e7-b7c4-d4ef6369079a/Exec/execution/xunit.console.netcore.runtimeconfig.json' ofortes/dotnetbuild/work/ab3d3d99-d911-4dbc-bb9b-bcf3ee74d226/Work/6288c9a0-0d0b-41e7-b7c4-d4ef6369079a/Unzip/System.Transactions.Local.Tests.pdb' to '/home/jofortes/dotnetbuild/work/ab3d3d99-d911-4dbc-bb9b-bcf3ee74d226/Work/6288c9a0-0d0b-41e7-b7c4-d4ef6369079a/Exec/execution/System.Transactions.Local.Tests.pdb' ofortes/dotnetbuild/work/ab3d3d99-d911-4dbc-bb9b-bcf3ee74d226/Work/6288c9a0-0d0b-41e7-b7c4-d4ef6369079a/Unzip/DumplingHelper.py' to '/home/jofortes/dotnetbuild/work/ab3d3d99-d911-4dbc-bb9b-bcf3ee74d226/Work/6288c9a0-0d0b-41e7-b7c4-d4ef6369079a/Exec/execution/DumplingHelper.py' /home/jofortes/dotnetbuild/work/ab3d3d99-d911-4dbc-bb9b-bcf3ee74d226/Work/6288c9a0-0d0b-41e7-b7c4-d4ef6369079a/Unzip/RunTests.sh /home/jofortes/dotnetbuild/work/ab3d3d99-d911-4dbc-bb9b-bcf3ee74d226/Payload me/jofortes/dotnetbuild/work/ab3d3d99-d911-4dbc-bb9b-bcf3ee74d226/Work/6288c9a0-0d0b-41e7-b7c4-d4ef6369079a/Unzip ----- start 02:25:09 =============== To repro directly: ===================================================== pushd /home/jofortes/dotnetbuild/work/ab3d3d99-d911-4dbc-bb9b-bcf3ee74d226/Work/6288c9a0-0d0b-41e7-b7c4-d4ef6369079a/Unzip python DumplingHelper.py install_dumpling __TIMESTAMP=`python DumplingHelper.py get_timestamp` chmod +x /home/jofortes/dotnetbuild/work/ab3d3d99-d911-4dbc-bb9b-bcf3ee74d226/Payload/dotnet /home/jofortes/dotnetbuild/work/ab3d3d99-d911-4dbc-bb9b-bcf3ee74d226/Payload/dotnet xunit.console.netcore.exe System.Transactions.Local.Tests.dll -xml testResults.xml -notrait Benchmark=true -notrait category=nonnetcoreapptests -notrait category=nonlinuxtests -notrait category=OuterLoop -notrait category=failing python DumplingHelper.py collect_dump $\ `pwd` System.Transactions.Local.Tests /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/bin/runtime/netcoreapp-Linux-Release-x64/,/mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/bin/tests/System.Transactions.Local.Tests/netcoreapp-Linux-Release-x64/,/home/jofortes/dotnetbuild/work/ab3d3d99-d911-4dbc-bb9b-bcf3ee74d226/Payload,/lib/x86_64-linux-gnu/libgcc_s.so.1,/lib/x86_64-linux-gnu/libpthread.so.0,/lib/x86_64-linux-gnu/librt.so.1,/usr/lib/x86_64-linux-gnu/libunwind.so.8,/lib/x86_64-linux-gnu/libdl.so.2,/lib/x86_64-linux-gnu/libuuid.so.1,/usr/lib/x86_64-linux-gnu/libunwind-x86_64.so.8,/usr/lib/x86_64-linux-gnu/libstdc++.so.6,/lib/x86_64-linux-gnu/libm.so.6,/lib/x86_64-linux-gnu/libc.so.6,/lib64/ld-linux-x86-64.so.2,/lib/x86_64-linux-gnu/liblzma.so.5 popd =========================================================================================================== ~/dotnetbuild/work/ab3d3d99-d911-4dbc-bb9b-bcf3ee74d226/Work/6288c9a0-0d0b-41e7-b7c4-d4ef6369079a/Unzip ~/dotnetbuild/work/ab3d3d99-d911-4dbc-bb9b-bcf3ee74d226/Work/6288c9a0-0d0b-41e7-b7c4-d4ef6369079a/Unzip Dumpling cannot be installed due to: HTTP Error 403 Site Disabled xUnit.net console test runner (64-bit .NET Core) Copyright (C) 2014 Outercurve Foundation. Discovering: System.Transactions.Local.Tests Discovered: System.Transactions.Local.Tests Starting: System.Transactions.Local.Tests ``` Seen in https://github.com/dotnet/corefx/pull/27673 27678 area-System.Runtime Add DateTime ParseExact test with 'Allow White' styles See https://github.com/dotnet/coreclr/pull/16718#discussion_r171988184 for context. cc @jkotas, @stephentoub Added some test to cover code paths leading to RemoveLeadingInQuoteSpaces / RemoveTrailingInQuoteSpaces. There are other DateTimeStyles that are still not well covered. Filed issue - https://github.com/dotnet/corefx/issues/27679 27679 area-System.Runtime Improve test coverage of DateTime ParseExact with different DateTimeStyles See https://github.com/dotnet/corefx/pull/27678 for context. @joperezr, @AlexGhiondea, @stephentoub, @jkotas 27681 area-System.IO Enabling tests for GetPathRoot Fixes #27552 27682 area-System.Data Add ValueTask overloads to ADO.NET async APIs With https://github.com/dotnet/corefx/issues/27445 allowing elimination of allocations in asynchronously-executing async methods, we should look into adding ValueTask-returning counterparts to ADO.NET. This would potentially allow zero-allocation database access. I'm not sure what naming should be like. Some parts of corefx are lucky in that they're introducing ValueTask overloads along with Span (e.g. Stream) but ADO.NET has no upcoming parameter changes/additions. Here are the relevant methods: ```c# ValueTask DbConnection.OpenAsync(...); ValueTask<DbDataReader> DbCommand.ExecuteReaderAsync(...); ValueTask<DbDataReader> DbCommand.ExecuteDbDataReaderAsync(...); ValueTask<object> DbCommand.ExecuteScalarAsync(...); ValueTask DbCommand.ExecuteNonQueryAsync(...); ValueTask<bool> DbDataReader.ReadAsync(...); ValueTask<T> DblDataReader.GetFieldValueAsync<T>(...); ValueTask<bool> DbDataReader.IsDBNullAsync(...); ``` Note that there are some missing async methods in ADO.NET in general (e.g. `DbCommand.Prepare()`, `DbConnection.BeginTransactionAsync(...)`, `DbTransaction.CommitAsync(...)`...). These can be added directly with return value ValueTask. 27684 area-System.Data Consider making DbDataReader implement IAsyncEnumerable DbDataReader is used to stream rows from a database. Although it does implement IEnumerable (of DbDataRecord), that API is old and rarely-used (it's non-generic, sync-only and quite inefficient). Consider making DbDataReader implement IAsyncEnumerable, to provide a modern and efficient API for going through the rows. This would simply be a layer implemented on top of DbDataReader's existing async operations (e.g. `ReadAsync()`), so it wouldn't require any sort of change from providers. 27685 area-System.Net SocketsHttpHandler: Add response drain timeout We have a byte limit for response drain, but not a time limit. So a poorly behaved server could tie up the connection indefinitely. We should add a time limit. EDIT 3/6/2018 by @stephentoub. Adding API proposal: ```C# public int MaxResponseDrainSize { get; set; } // exists public TimeSpan MaxResponseDrainTime { get; set; } // new (exists in implementation but as internal) ``` 27686 area-System.Data null reference exception while using transactionScope in async method on linux "I was developing a blog project based on asp.net core mvc and trying to deploy my project on ubuntu 16.04 LTS x86-64. And I encountered a null reference exception while using transactionScope with dapper on inserting object to sql server. the sql server version is :12.0.4100.1 running on a windows 2012SP1 system. and the code was running just fine on windows 10 (OS Build 17074.1002). but when i deploy project to ubutun, it throws null refernce exceptions. the exception details was like: {System.NullReferenceException: Object reference not set to an instance of an object. at System.Data.ProviderBase.DbConnectionPool.DeactivateObject(DbConnectionInternal obj) at System.Data.ProviderBase.DbConnectionPool.PutObject(DbConnectionInternal obj, Object owningObject) at System.Data.ProviderBase.DbConnectionInternal.CloseConnection(DbConnection owningObject, DbConnectionFactory connectionFactory) at System.Data.SqlClient.SqlConnection.CloseInnerConnection() at System.Data.SqlClient.SqlConnection.Close() at Dapper.SqlMapper.d__641.MoveNext() in C:\projects\dapper\Dapper\SqlMapper.Async.cs:line 1191 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at Autyan.NiChiJou.Repository.Dapper.BaseDapperRepository1.<InsertAsync>d__22.MoveNext() in /home/alex/Documents/Github/Autyan.NiChiJou/src/Autyan.NiChiJou.Repository.Dapper/BaseDapperRepository.cs:line 167 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at Autyan.NiChiJou.Repository.Dapper.LongKeyDapperRepository1.<InsertAsync>d__1.MoveNext() in /home/alex/Documents/Github/Autyan.NiChiJou/src/Autyan.NiChiJou.Repository.Dapper/LongKeyDapperRepository.cs:line 23 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at Autyan.NiChiJou.Service.Blog.ArticleService.d__10.MoveNext() in /home/alex/Documents/Github/Autyan.NiChiJou/src/Autyan.NiChiJou.Service.Blog/ArticleService.cs:line 39} my code that throws exception is like this: using (var scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled)) { var create = await ArticleRepo.InsertAsync(article); if (create <= 0) { return Failed<Article>(""create article failed""); } create = await ContentRepo.InsertAsync(new ArticleContent { ArticleId = create, Content = content }); if (create <= 0) { return Failed<Article>(""create articleContent failed""); } scope.Complete(); } I tried to remove the transactionScope and after that , my codes runs just fine with everything the new code was like: var create = await ArticleRepo.InsertAsync(article); if (create <= 0) { return Failed<Article>(""create article failed""); } create = await ContentRepo.InsertAsync(new ArticleContent { ArticleId = create, Content = content }); if (create <= 0) { return Failed<Article>(""create articleContent failed""); } Am i using trancsationScope the wrong way? Or it's just a bug from dotnet core it self?" 27688 area-System.Memory Productize OwnedArray<T> What are the plans for productizing OwnedArray<T>? (https://github.com/dotnet/corefxlab/blob/master/src/System.Buffers.Primitives/System/Buffers/OwnedArray.cs) Is it expected to be included in System.Buffers in 2.1? cc @ahsonkhan @KrzysztofCwalina 27691 area-System.Memory Fix ReadOnlySequence First Seen in https://github.com/dotnet/corefxlab/pull/2143 Don't have enough bandwidth on the train to download and install a fresh coreclr to get passed apicheck; but the test definitely fails before the change. Hopefully it passes after :) /cc @ahsonkhan @davidfowl @pakrym 27692 area-System.Net Lookup interface index when IN_PKTINFO isn't available Fix #7855 27694 area-System.Memory Add back Memory.ToString() to referencey assembly and add tests Depends on https://github.com/dotnet/coreclr/pull/16732 and the subsequent mirror PR (https://github.com/dotnet/corefx/pull/27697). cc @jkotas, @KrzysztofCwalina, @stephentoub, @pakrym, @khellang 27699 area-System.IO Added argument name to the exception Fixes #27357 27702 area-System.Net HTTP client - API error c# (A task was canceled.) "We are calling multiple API's in foreach loop and all API are of Async call. Now in the foreach loop due to some reason 1 API call has returned internal error and we are skipping that record and progressing with other requests in for loop. When the next loop continues the first API call we are getting error with ""System.Threading.Tasks.TaskCanceledException: A task was canceled"" and ""Aggregation exception"". Code Snippet: We are making Httpclient initialization per loop and object used multiple times in the loop. using (var httpClientHelper = new HttpClientHelper(tokenService)) API call snippet: var response = await httpClientHelper.GetAsync(""http://xyz""); Help or thoughts on this will be much appreciated." 27705 area-System.IO Rename PipeReader.OnWriterCompleted and PipeWriter.OnReaderCompleted In an early API review we agreed that OnWriterCompleted and OnReaderCompleted should be renamed to RegisterWriterCompleted and RegisterReaderCompleted since they were registering callbacks. /cc @terrajobst @pakrym @KrzysztofCwalina @halter73 27707 area-System.Numerics Span<T> And Vectors Is there a plan to use Span< T > with Vectors? It can be faster than copying array elements to the Vector. Also, the static Vector calss can use it to do operations on two arrays in slices. Ecah method in the Vector class can have another overload with two T[] params instead of Vector< T > param and returns T[] or Memory< T >. If Vector< T > can make use of Span<T> slices (by adding a new constuctor that accepts Span< T >), it will be easy and fast to repeat the same operations on the array slices. 27708 area-System.Net Add response drain max time to SocketsHttpHandler Adds support for a max time limit on how long we'll try to drain a connection before returning it to the pool, and adds a (currently non-public) knob for controlling that limit. This also fixes a race condition with regards to cancellation and chunked responses. If cancellation was requested after returning the connection to the pool but before we disposed of the cancellation registration, someone else could get the pooled connection and then cancellation of one request could end up canceling the other request. Contributes to https://github.com/dotnet/corefx/issues/27685 cc: @geoffkizer, @davidsh 27712 area-Meta Cross Platform GUI for desktop applications? As one of the co-founders of a local startup, my partners and I were looking for a framework that could do it all and do it well. .NET Core very closely hit the mark but fell short in just one specific area: a cross-platform library for a Graphical User Interface. I wasn't sure where to post this but I thought it was worth mentioning as an important feedback, my partners and I are big fans of what .NET Core is able to achieve (and the tools available for it) but we had to look elsewhere due to the fact that we need to be as efficient as possible due to our limited resources. Hopefully our feedback and request makes a difference. Phidler 27714 area-System.Threading IValueTaskSource doesn't work on netcoreapp2.0 Strangely, if you reference System.Threading.Tasks.Extensions on a .NET Core 2.0 project IValueTaskSource doesn't exist. The netcoreapp2.0 folder in the nuget package has a `_._` and ValueTask gets resolved from the shared framework instead of the package (System.Threading.Tasks.Extensions is in Microsoft.NETCore.App 2.0 but an older version) This leads to the following error when trying to use ValueTask with IValueTaskSource on .NET Core 2.0 projects: ``` Unhandled Exception: System.AggregateException: One or more errors occurred. (Could not load type 'System.Threading.Tasks.Sources.IValueTaskSource`1' from assembly 'System.Threading.Tasks.Extensions, Version=4.1.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.) ---> System.TypeLoadException: Could not load type 'System.Threading.Tasks.Sources.IValueTaskSource`1' from assembly 'System.Threading.Tasks.Extensions, Version=4.1.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. at System.IO.Pipelines.Pipe..ctor(PipeOptions options) at ConsoleApp41.Program.<DefaultPipe>d__1.MoveNext() in C:\Users\dfowler\documents\visual studio 2017\Projects\ConsoleApp41\ConsoleApp41\Program.cs:line 20 --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at ConsoleApp41.Program.Main(String[] args) in C:\Users\dfowler\documents\visual studio 2017\Projects\ConsoleApp41\ConsoleApp41\Program.cs:line 16 ``` Seems like this package should lift on netcoreapp2.0 instead of skip. I know we had other instances of this in the netcoreapp2.0 timeframe (things that shipped in box that were then taken out of band). This looks like another category of this issue. /cc @stephentoub @weshaggard @ericstj @terrajobst @KrzysztofCwalina 27717 area-System.Net System.Net.Sockets.Tests - IOControl_SIOCATMARK_Windows_Success failing on Windows.7.Amd64.Open-Release-x86 From https://github.com/dotnet/corefx/pull/27713 Windows.7.Amd64.Open-Release-x86 System.Net.Sockets.Tests.OSSupportTest/IOControl_SIOCATMARK_Windows_Success https://mc.dot.net/#/user/dotnet-maestro-bot/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/79e54627d75ab93d5654d9803b57c9ea305cfb9f/workItem/System.Net.Sockets.Tests/analysis/xunit/System.Net.Sockets.Tests.OSSupportTest~2FIOControl_SIOCATMARK_Windows_Success ```text Message : Assert.Equal() Failure Expected: 0 Actual: 1 Stack Trace : at System.Net.Sockets.Tests.OSSupportTest.IOControl_SIOCATMARK_Windows_Success() in D:\j\workspace\windows-TGrou---f8ac6754\src\System.Net.Sockets\tests\FunctionalTests\OSSupport.cs:line 166 ``` 27718 area-System.Threading "Test: System.Threading.Channels.Tests.SpscUnboundedChannelPerfTests.PingPong failed with ""System.OperationCanceledException""" The test: System.Threading.Channels.Tests.SpscUnboundedChannelPerfTests.PingPong (from (empty)) failed. MESSAGE: System.OperationCanceledException : The operation was canceled. ~~~ STACK TRACE: at System.Threading.Channels.ResettableValueTaskSource`1.GetResult(Int16 token) in /mnt/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_ubuntu16.04_debug/src/System.Threading.Channels/src/System/Threading/Channels/AsyncOperation.cs:line 100 at System.Threading.Channels.Tests.PerfTests.<>c__DisplayClass4_1.<<PingPong>b__0>d.MoveNext() in /mnt/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_ubuntu16.04_debug/src/System.Threading.Channels/tests/Performance/Perf.Channel.cs:line 112 --- End of stack trace from previous location where exception was thrown --- at System.Threading.Channels.Tests.PerfTests.PingPong() in /mnt/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_ubuntu16.04_debug/src/System.Threading.Channels/tests/Performance/Perf.Channel.cs:line 104 at Microsoft.Xunit.Performance.BenchmarkTestInvoker.<>c__DisplayClass1_0.<<CallTestMethod>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.Xunit.Performance.Internal.BenchmarkIterator.RunAsync(Func`1 testMethod) --- End of stack trace from previous location where exception was thrown --- ~~~ Details: https://ci.dot.net/job/dotnet_corefx/job/master/job/outerloop_netcoreapp_ubuntu16.04_debug/329/testReport/System.Threading.Channels.Tests/SpscUnboundedChannelPerfTests/PingPong/ 27719 area-System.Data Table Alias name not able to get from GetSchemaTable() "Hi All, I have one task to get the table alias name from the sql Query. Im tried with GetSchemaTable(). string query = ""select A.id as ParentId,B.id as ChildId from Parent A,ChildB""; sqlCnn.Open(); sqlCmd = new SqlCommand(query, sqlCnn); sqlReader = sqlCmd.ExecuteReader(CommandBehavior.KeyInfo); DataTable schemaTable = sqlReader.GetSchemaTable(); It's not returning the table alias but it return the Column alias. Can you please help me how to get the table alias name from executing query . Please give me a solution it. Thanks, Ezra " 27721 area-System.Net _preAllocatedOverlapped is null assert in Http tests This has been failing sporadically since my ValueTask changes. The issue is that we end up disposing a SocketAsyncEventArgs while it's in use and then hit this assert in cleanup code. ``` _preAllocatedOverlapped is null 2018-03-05 13:12:16,275: INFO: proc(54): run_and_log_output: Output: 2018-03-05 13:12:16,275: INFO: proc(54): run_and_log_output: Output: at System.Net.Sockets.SocketAsyncEventArgs.FreeNativeOverlapped(NativeOverlapped* overlapped) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Sockets\src\System\Net\Sockets\SocketAsyncEventArgs.Windows.cs:line 76 2018-03-05 13:12:16,275: INFO: proc(54): run_and_log_output: Output: at System.Net.Sockets.SocketAsyncEventArgs.FreeNativeOverlappedIfNotPending(NativeOverlapped* overlapped, SocketError error) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Sockets\src\System\Net\Sockets\SocketAsyncEventArgs.Windows.cs:line 85 2018-03-05 13:12:16,275: INFO: proc(54): run_and_log_output: Output: at System.Net.Sockets.SocketAsyncEventArgs.DoOperationSendSingleBuffer(SafeCloseSocket handle) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Sockets\src\System\Net\Sockets\SocketAsyncEventArgs.Windows.cs:line 556 2018-03-05 13:12:16,275: INFO: proc(54): run_and_log_output: Output: at System.Net.Sockets.SocketAsyncEventArgs.DoOperationSend(SafeCloseSocket handle) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Sockets\src\System\Net\Sockets\SocketAsyncEventArgs.Windows.cs:line 551 2018-03-05 13:12:16,275: INFO: proc(54): run_and_log_output: Output: at System.Net.Sockets.Socket.SendAsync(SocketAsyncEventArgs e) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Sockets\src\System\Net\Sockets\Socket.cs:line 4178 2018-03-05 13:12:16,275: INFO: proc(54): run_and_log_output: Output: at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.SendAsyncForNetworkStream(Socket socket) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Sockets\src\System\Net\Sockets\Socket.Tasks.cs:line 921 2018-03-05 13:12:16,290: INFO: proc(54): run_and_log_output: Output: at System.Net.Sockets.Socket.SendAsyncForNetworkStream(ReadOnlyMemory`1 buffer, SocketFlags socketFlags, CancellationToken cancellationToken) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Sockets\src\System\Net\Sockets\Socket.Tasks.cs:line 377 2018-03-05 13:12:16,290: INFO: proc(54): run_and_log_output: Output: at System.Net.Sockets.NetworkStream.WriteAsync(ReadOnlyMemory`1 source, CancellationToken cancellationToken) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Sockets\src\System\Net\Sockets\NetworkStream.cs:line 846 2018-03-05 13:12:16,290: INFO: proc(54): run_and_log_output: Output: at System.Net.Http.HttpConnection.WriteToStreamAsync(ReadOnlyMemory`1 source) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnection.cs:line 1042 2018-03-05 13:12:16,290: INFO: proc(54): run_and_log_output: Output: at System.Net.Http.HttpConnection.FlushAsync() in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnection.cs:line 1032 2018-03-05 13:12:16,290: INFO: proc(54): run_and_log_output: Output: at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnection.cs:line 350 2018-03-05 13:12:16,290: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in E:\A\_work\1986\s\src\mscorlib\src\System\Runtime\CompilerServices\AsyncMethodBuilder.cs:line 938 2018-03-05 13:12:16,290: INFO: proc(54): run_and_log_output: Output: at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken) 2018-03-05 13:12:16,290: INFO: proc(54): run_and_log_output: Output: at System.Net.Http.HttpConnection.SendWithNtProxyAuthAsync(HttpRequestMessage request, CancellationToken cancellationToken) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnection.cs:line 589 2018-03-05 13:12:16,290: INFO: proc(54): run_and_log_output: Output: at System.Net.Http.HttpConnection.SendAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnection.cs:line 599 2018-03-05 13:12:16,290: INFO: proc(54): run_and_log_output: Output: at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnectionPool.cs:line 249 2018-03-05 13:12:16,290: INFO: proc(54): run_and_log_output: Output: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in E:\A\_work\1986\s\src\mscorlib\shared\System\Threading\ExecutionContext.cs:line 166 2018-03-05 13:12:16,290: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext() in E:\A\_work\1986\s\src\mscorlib\src\System\Runtime\CompilerServices\AsyncMethodBuilder.cs:line 559 2018-03-05 13:12:16,290: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.Task.RunContinuations(Object continuationObject) in E:\A\_work\1986\s\src\mscorlib\src\System\Threading\Tasks\Task.cs:line 3283 2018-03-05 13:12:16,290: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.Task`1.TrySetResult(TResult result) in E:\A\_work\1986\s\src\mscorlib\src\System\Threading\Tasks\future.cs:line 421 2018-03-05 13:12:16,290: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetExistingTaskResult(TResult result) in E:\A\_work\1986\s\src\mscorlib\src\System\Runtime\CompilerServices\AsyncMethodBuilder.cs:line 650 2018-03-05 13:12:16,290: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetResult(TResult result) in E:\A\_work\1986\s\src\mscorlib\src\System\Runtime\CompilerServices\AsyncMethodBuilder.cs:line 640 2018-03-05 13:12:16,290: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder`1.SetResult(TResult result) in E:\A\_work\1986\s\src\mscorlib\shared\System\Runtime\CompilerServices\AsyncValueTaskMethodBuilder.cs:line 169 2018-03-05 13:12:16,290: INFO: proc(54): run_and_log_output: Output: at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync(ValueTask`1 creationTask) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnectionPool.cs:line 456 2018-03-05 13:12:16,290: INFO: proc(54): run_and_log_output: Output: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in E:\A\_work\1986\s\src\mscorlib\shared\System\Threading\ExecutionContext.cs:line 166 2018-03-05 13:12:16,290: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext() in E:\A\_work\1986\s\src\mscorlib\src\System\Runtime\CompilerServices\AsyncMethodBuilder.cs:line 559 2018-03-05 13:12:16,290: INFO: proc(54): run_and_log_output: Output: at System.Threading.ThreadPoolWorkQueue.Dispatch() in E:\A\_work\1986\s\src\mscorlib\src\System\Threading\ThreadPool.cs:line 588 2018-03-05 13:12:18,809: INFO: proc(54): run_and_log_output: Output: ----- end 13:12:18.80 ----- exit code -2146232797 ---------------------------------------------------------- 2018-03-05 13:12:18,809: INFO: proc(58): run_and_log_output: Exit Code: -2146232797 2018-03-05 13:12:18,809: ERROR: scriptrunner(91): _main: Error: No exception thrown, but XUnit results not created 2018-03-05 13:12:18,809: ERROR: helix_test_execution(83): report_error: Error running xunit None ``` 27723 area-System.Collections Move, Reverse, etc. on LinkedList Similar to #14338 we need the ability to manipulate a `LinkedList<T>`, most notably moving nodes within the collection. Another use case is to `Merge` one `LinkedList` into another one at a certain position (before / after a node). Technically the architecture of a double linked list and its nodes makes those feature quite easy to implement while offering good performance independent from list size. ## Useful additions **Swap** nodes in the collection ([SO Thread](https://stackoverflow.com/questions/3473787/swapping-nodes-on-a-single-linked-list)) ````cs public void Swap(object foo, object blah) { // Currently we exploit the fact that the value of nodes can be set var fooNode = _list.Find(foo); var blahNode = _list.Find(blah); fooNode.Value = blah; blahNode.Value = foo; // Proposed _list.Swap(foo, blah); } ```` Overloads for `Swap` should accept nodes and objects. **Move** nodes within the collection ````cs public void MoveNode(object foo, object blah) { // Currently var fooNode = _list.Find(foo); _list.Remove(blah); _list.AddAfter(fooNode, blah); // Proposed _list.MoveAfter(foo, blah); } ```` There should be a method `MoveBefore` and `MoveAfter` with overloads for passing two nodes, one node and one object and two objects. An `InternalMove` method could even be used to replace the code for `AddBefore` and `AddAfter`. **Insert** one linked list into another ````cs public void InsertInto(object foo, LinkedList<object> other) { var position = _list.Find(foo); // Currently foreach(var foo in other) { position = _list.AddAfter(position, foo); } // Proposed _list.InsertAfter(position, other); } ```` Here the workaround is especially painful. I can not simply `AddAfter` because this would reverse the direction. I also can not `AddBefore(position.Next, foo)` because I would have to check for end of collection. I can either reverse `other` or steadily update the `position` variable. Because [`System.Linq.Reverse()`](https://github.com/dotnet/corefx/blob/master/src/System.Linq/src/System/Linq/Reverse.cs#L59) does not specifically check for `LinkedList` it will copy the other list to a buffer and reverse iterate that, which is a waste of time and memory in itself. In each case inserting item-by-item also causes constant updates of the pointers that are complety unnessary when looking at the end result. Only the pointers for the first and last node of `other` as well as `position` and possibly `position.Next`. **ReverseIterate** a linked list ````cs public IEnumerable<object> Reverse() { // Currently return _list.Reverse(); // Linq extension copying to buffer // Proposed new implementation of Reverse var current = _list.Last; while(current != null) { yield return current; current = current.Previous; } } ```` I am not sure whether to implement this in `LinkedList` and call it from `Linq.Reverse` or just implementing it in Linq. ## Conclusion I know `ArrayList` is the preferred type in .NET for numerous reasons and when just storing data I agree. But right now we have a use-case of a list that is frequently altered, elements are moved or smaller sorted chunks are inserted and removed. The collection as a whole is less important than the information which elements are next to each other. For all this `LinkedList` is the perfect solution by design. Unfortunately the current implementation of [`LinkedList<T>`](https://github.com/dotnet/corefx/blob/master/src/System.Collections/src/System/Collections/Generic/LinkedList.cs) and its [`LinkedListNode<T>`](https://github.com/dotnet/corefx/blob/master/src/System.Collections/src/System/Collections/Generic/LinkedList.cs) is locked down like Fort-Knox, making it impossible to add the features in a derived type, even if I wanted to. So I need to decide whether to implement the entire list myself or to work around the features. Most of the workarounds (e.g. Remove + AddBefore instead of MoveBefore) require creating new objects instead of changing references because most operations and members are internal or perform node validation when trying to insert nodes from a different collection. 27724 area-System.IO File.ReadAllTextAsync not behaving asynchronously when called on inaccessible network files "When accessing a file on a network share that for some reason cannot be accessed (e.g. server not existent), `File.ReadAllTextAsync` appears to block, rather than running asynchronously, until the file request fails. This can be reproduced with the following console app: ```csharp using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading.Tasks; namespace ReadAllTextAsync { class Program { public static void Main(string[] args) { Console.WriteLine(""Beginning""); int count = 20; var files = Enumerable.Range(0, count).Select(i => $@""\\server_{Guid.NewGuid():N}\file.txt"").ToList(); var tasks = new List<Task>(); foreach (string file in files) { tasks.Add(_ReadFile(file)); } Console.WriteLine(""Waiting...""); Task.WhenAll(tasks).Wait(); Console.WriteLine(""Ending""); } private static async Task _ReadFile(string file) { try { // await Task.Delay(1); // Uncomment this line allows calls to execute in parallel string text = await File.ReadAllTextAsync(file); } catch { Console.WriteLine($""Error reading file: {file}""); } } } } ``` The result of running the above code is a regular stream of (the expected) ""Error reading file"" messages but they come in slowly one after the other. When uncommenting the `await Task.Delay(1)` line, the messages all come in nearly simulataneously. I would have expected this behaviour without this line. I believe this is to do with the behaviour of the `new FileStream` object in https://github.com/dotnet/corefx/blob/release/2.0.0/src/System.IO.FileSystem/src/System/IO/File.cs ```csharp private static StreamReader AsyncStreamReader(string path, Encoding encoding) { FileStream stream = new FileStream( path, FileMode.Open, FileAccess.Read, FileShare.Read, DefaultBufferSize, FileOptions.Asynchronous | FileOptions.SequentialScan); return new StreamReader(stream, encoding, detectEncodingFromByteOrderMarks: true); } ``` which is called before any code is awaited." 27725 area-System.Security Normalize the too-big-to-decrypt message across RSA implementations Also add some more tests to make sure other boundary cases are covered. Fixes #27590. 27726 area-System.Text Use generic WeakReference and avoid casting in Regex Using WeakReference<T> with a simple lock instead of Interlocked.Exchange for SharedReference. @stephentoub you commented in another PR that I could use a simple lock for the ExclusiveReference. As concurrent calls shouldn't wait until the lock is released but return immediately, I don't think that's possible here with just lock? 27727 area-System.Net Add folded response header support to SocketsHttpHandler The feature is deprecated by RFC 7230, but some servers still utilize it, and if they do, SocketsHttpHandler currently fails (WinHttpHandler and the netfx handler both allow it, CurlHandler currently fails as well). This commit updates the header parsing logic to allow for them. cc: @geoffkizer, @davidsh 27728 area-System.Net Fix order of native overlapped freeing in SocketAsyncEventArgs on Windows SocketAsyncEventArgs tracks its disposal, and if it's disposed while an async operation is in flight, it delays the actual disposal until the operation completes. That disposal includes disposing of the PreAllocatedOverlapped used for async operations. When an operation is initiated, if the operation completes synchronously, then the NativeOverlapped associated with that PreAllocatedOverlapped is freed in a finally block once the operation completes synchronously. But if during the operation the SAEA is disposed of, then the PreAllocatedOverlapped can get disposed of before the finally block. The fix is to ensure we clean up the NativeOverlapped before completing the operation. This was already handled correctly when an operation completed asynchronously, it just needed to be fixed for when it completes synchronously. As a happy side-effect, fixing this also cleans up the call sites a bit. (This was highlighted by an assert once we switched Socket.WriteAsync to return a ValueTask instead of a Task, because the way it was done means that when the Socket is disposed, the associated SocketAsyncEventArgs will be disposed, and SocketsHttpHandler is aggressive about disposing of the Socket as a way to enable cancellation, so the assert was triggering not-infrequently when running the System.Net.Http tests, especially in CI.) Fixes https://github.com/dotnet/corefx/issues/27721 cc: @geoffkizer, @davidsh 27729 area-System.Memory Fix Utf8ParserFormatter test culture settings dependency Fixes https://github.com/dotnet/corefx/issues/27664 Make sure we're always using the invariant culture when generating test data using the classic .NET api. 27730 area-System.Net libcurl HttpClient incompatibility with HTTP2 protocol Recently I started running into issues like this one: ```csharp OnUnobservedTaskException() System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. (An error occurred while sending the request.) ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.CurlException: Error in the HTTP2 framing layer at System.Net.Http.CurlHandler.ThrowIfCURLEError(CURLcode error) at System.Net.Http.CurlHandler.MultiAgent.FinishRequest(StrongToWeakReference`1 easyWrapper, CURLcode messageResult) --- End of inner exception stack trace --- at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) at Discord.Net.Rest.DefaultRestClient.SendInternalAsync(HttpRequestMessage request, CancellationToken cancelToken, Boolean headerOnly) at Discord.Net.Rest.DefaultRestClient.SendAsync(String method, String endpoint, CancellationToken cancelToken, Boolean headerOnly, String reason) at Discord.Net.Queue.RestRequest.SendAsync() at Discord.Net.Queue.RequestBucket.SendAsync(RestRequest request) at Discord.Net.Queue.RequestQueue.SendAsync(RestRequest request) at Discord.API.DiscordRestApiClient.SendInternalAsync(String method, String endpoint, RestRequest request) at Discord.API.DiscordRestApiClient.SendAsync[TResponse](String method, String endpoint, String bucketId, ClientBucketType clientBucket, RequestOptions options) at Discord.API.DiscordSocketApiClient.GetGatewayAsync(RequestOptions options) at Discord.API.DiscordSocketApiClient.ConnectInternalAsync() at Discord.API.DiscordSocketApiClient.ConnectInternalAsync() at Discord.API.DiscordSocketApiClient.ConnectAsync() at Discord.WebSocket.DiscordSocketClient.OnConnectingAsync() at Discord.WebSocket.DiscordSocketClient.OnConnectingAsync() at Discord.ConnectionManager.ConnectAsync(CancellationTokenSource reconnectCancelToken) at Discord.ConnectionManager.<>c__DisplayClass28_0.<<StartAsync>b__0>d.MoveNext() --- End of inner exception stack trace --- ---> (Inner Exception #0) System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.CurlException: Error in the HTTP2 framing layer at System.Net.Http.CurlHandler.ThrowIfCURLEError(CURLcode error) at System.Net.Http.CurlHandler.MultiAgent.FinishRequest(StrongToWeakReference`1 easyWrapper, CURLcode messageResult) --- End of inner exception stack trace --- at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) at Discord.Net.Rest.DefaultRestClient.SendInternalAsync(HttpRequestMessage request, CancellationToken cancelToken, Boolean headerOnly) at Discord.Net.Rest.DefaultRestClient.SendAsync(String method, String endpoint, CancellationToken cancelToken, Boolean headerOnly, String reason) at Discord.Net.Queue.RestRequest.SendAsync() at Discord.Net.Queue.RequestBucket.SendAsync(RestRequest request) at Discord.Net.Queue.RequestQueue.SendAsync(RestRequest request) at Discord.API.DiscordRestApiClient.SendInternalAsync(String method, String endpoint, RestRequest request) at Discord.API.DiscordRestApiClient.SendAsync[TResponse](String method, String endpoint, String bucketId, ClientBucketType clientBucket, RequestOptions options) at Discord.API.DiscordSocketApiClient.GetGatewayAsync(RequestOptions options) at Discord.API.DiscordSocketApiClient.ConnectInternalAsync() at Discord.API.DiscordSocketApiClient.ConnectInternalAsync() at Discord.API.DiscordSocketApiClient.ConnectAsync() at Discord.WebSocket.DiscordSocketClient.OnConnectingAsync() at Discord.WebSocket.DiscordSocketClient.OnConnectingAsync() at Discord.ConnectionManager.ConnectAsync(CancellationTokenSource reconnectCancelToken) at Discord.ConnectionManager.<>c__DisplayClass28_0.<<StartAsync>b__0>d.MoveNext()<--- ``` I'm almost 100% sure that this issue is the result of some incompatibility with recent libcurl version. I reproduced it with libcurl3 in version 7.58.0 available in Debian testing repo. Temporarily I downgraded myself back to 7.52.1 available in Debian stable and I can't reproduce the issue anymore, at least for now. The exception itself isn't exactly in my code but in third-party library I'm using, although there is nothing unusual there. ```csharp private async Task<RestResponse> SendInternalAsync(HttpRequestMessage request, CancellationToken cancelToken, bool headerOnly) { cancelToken = CancellationTokenSource.CreateLinkedTokenSource(_cancelToken, cancelToken).Token; HttpResponseMessage response = await _client.SendAsync(request, cancelToken).ConfigureAwait(false); var headers = response.Headers.ToDictionary(x => x.Key, x => x.Value.FirstOrDefault(), StringComparer.OrdinalIgnoreCase); var stream = !headerOnly ? await response.Content.ReadAsStreamAsync().ConfigureAwait(false) : null; return new RestResponse(response.StatusCode, headers, stream); } ``` I'm using one of the recent master builds and I didn't see anything related fixed lately. ``` .NET Command Line Tools (2.1.300-preview2-008293) Product Information: Version: 2.1.300-preview2-008293 Commit SHA-1 hash: 68922e2a51 Runtime Environment: OS Name: debian OS Version: OS Platform: Linux RID: debian-x64 Base Path: /opt/dotnet/sdk/2.1.300-preview2-008293/ Host (useful for support): Version: 2.1.0-preview2-26227-01 Commit: 86d1f92013 .NET Core SDKs installed: 2.1.300-preview2-008293 [/opt/dotnet/sdk] The.NET Core runtimes installed: Microsoft.AspNetCore.App 2.1.0-preview2-30171 [/opt/dotnet/shared] Microsoft.NETCore.App 2.1.0-preview2-26227-01 [/opt/dotnet/shared] Microsoft.AspNetCore.All 2.1.0-preview2-30171 [/opt/dotnet/shared] ``` I'm now making sure that old libcurl version fixes the issue, since I could've identified the root cause wrong, but for now I can't run into this issue anymore with older libcurl version. I'll make sure to let you know in case it's something else, but if my guess was right then this should be fixed in corefx repo, and stacktrace suggests that even if my guess is wrong then there is some incompatibility in net core internals that should be verified. Also I have no clue under exactly what condition the exception is happening. It's definitely related to HTTP2 connection, but it seems that not all requests going through HTTP2 throw this exception (?) Thank you in advance for looking into this. 27731 area-System.Memory System.Memory package needs Xamarin support Dev 15-7 is shipping with inbox Memory/Span support on Xamarin. We need System.Memory package update to behave as inbox on all Xamarin profiles 27732 area-System.IO Consider removing support for 0-byte flushes from pipelines Currently, we allow 0-byte flushes to wake up the reader. There is not a lot of functional use for it except to try and build a side channel and different action based on empty flushes. /cc @davidfowl @KrzysztofCwalina @Tratcher 27734 area-Serialization Support PositiveInfinity and NegativeInfinity as default value in sgen Fix #27396 @huanwu @zhenlan @mconnew 27739 area-System.Net SocketsHttpHandler: Change caching of Host header value to include port when necessary We already cache the hostname part of the header value. Change this so the cached value includes the port as well when using a non-default port. @stephentoub @davidsh 27740 area-System.Xml System.Xml.XmlSchemaSet.Tests crashed on Linux in CI "Ubuntu.1804.Amd64.Open:Release-x64 https://mc.dot.net/#/user/stephentoub/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/1d125d16b24421e74b724ab374a6083462b90fe6/workItem/System.Xml.XmlSchemaSet.Tests/wilogs ``` 2018-03-04 16:03:33,449: INFO: proc(54): run_and_log_output: Output: Discovering: System.Xml.XmlSchemaSet.Tests 2018-03-04 16:03:33,686: INFO: proc(54): run_and_log_output: Output: Discovered: System.Xml.XmlSchemaSet.Tests 2018-03-04 16:03:33,844: INFO: proc(54): run_and_log_output: Output: Starting: System.Xml.XmlSchemaSet.Tests 2018-03-04 16:03:36,421: INFO: proc(54): run_and_log_output: Output: /home/helixbot/dotnetbuild/work/8373cbba-9bd6-476d-b0c8-c0dfd260a434/Work/82d55039-9303-4bb6-a0b9-1513ddf0ce22/Unzip/RunTests.sh: line 88: 12798 Aborted (core dumped) $RUNTIME_PATH/dotnet xunit.console.netcore.exe System.Xml.XmlSchemaSet.Tests.dll -xml testResults.xml -notrait Benchmark=true -notrait category=nonnetcoreapptests -notrait category=nonlinuxtests -notrait category=OuterLoop -notrait category=failing 2018-03-04 16:03:36,470: INFO: proc(54): run_and_log_output: Output: Dumpling has not been installed yet. Please run ""DumplingHelper.py install_dumpling"" before collect_dumps. 2018-03-04 16:03:36,474: INFO: proc(54): run_and_log_output: Output: ~/dotnetbuild/work/8373cbba-9bd6-476d-b0c8-c0dfd260a434/Work/82d55039-9303-4bb6-a0b9-1513ddf0ce22/Unzip 2018-03-04 16:03:36,476: INFO: proc(54): run_and_log_output: Output: ----- end 16:03:36 ----- exit code 134 ---------------------------------------------------------- 2018-03-04 16:03:36,478: INFO: proc(54): run_and_log_output: Output: Unable to find executable corerun 2018-03-04 16:03:36,481: INFO: proc(54): run_and_log_output: Output: Copying core file core to /tmp/coredumps 2018-03-04 16:03:36,679: INFO: proc(58): run_and_log_output: Exit Code: 134 2018-03-04 16:03:36,685: ERROR: scriptrunner(91): _main: Error: No exception thrown, but XUnit results not created 2018-03-04 16:03:36,686: ERROR: helix_test_execution(83): report_error: Error running xunit None ```" 27741 area-System.Net Should HttpHeaders remove newlines from values when they're parsed? See discussion at https://github.com/dotnet/corefx/pull/27727#discussion_r172263740. HttpHeaders isn't removing newlines adding in header values with TryAddWithoutValidation when that value is parsed. 27744 area-System.Memory Remove apis that duplicate implicit operators. "https://github.com/dotnet/corefx/issues/26894 Last set of approved api changes from this issue. Since we have to get this in by 3/7, we're doing the minbar here of removing the methods from the reference assemblies only and (in some cases) adding the ""api"" internally in some test assemblies rather than clean up dozens of individual callsites. (I wouldn't be surprised if we end up adding these back in the next version anyway...)" 27745 area-System.Net Add support for SocketsHttpHandler to use provided SPN WCF has the requirement to use non-default SPN's when using Kerberos authentication over HTTP. The `AuthenticationHandler` class specifies the SPN in [this line of code](https://github.com/dotnet/corefx/blob/master/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/AuthenticationHelper.NtAuth.cs#L52). WCF needs a way to optionally specify which value is used on this line. Ideally this would be exposed via an api mechanism available on `HttpClientHandler`/`HttpClient`/`HttpRequestMessage` so that WCF wouldn't need to dictate that a client always uses `SocketsHttpHandler` once available. We need to be able to specify either a mapping between hostname and SPN or to be able to specify on a per-request basis. This is especially important as there are likely to be some compatibility edge cases with `SocketsHttpHandler` once released and we would need to allow developers to specify which implementation that WCF will use. An issue to expose the ability to specify the SPN in a general way to support mutual authentication was previously opened in 2015 in issue #4502. This issue is a more specific ask for this support to be available in `SocketsHttpHandler` and hopefully for it to be exposed in a more generic manner. 27746 area-System.Net Proxy_UseSecureProxyTunnel_Success test hangs on WinHttpHandler/NetFxHandler/CurlHandler It was already disabled but the ActiveIssue was wrong, so I'm filing this to track. 27747 area-System.Net HTTP client - API error c# (A task was canceled.) "_From @rajurh on March 4, 2018 6:53_ We are calling multiple API's in foreach loop and all API are of Async call. Now in the foreach loop due to some reason 1 API call has returned internal error and we are skipping that record and progressing with other requests in for loop. When the next loop continues the first API call we are getting error with ""System.Threading.Tasks.TaskCanceledException: A task was canceled"" and ""Aggregation exception"". Code Snippet: We are making Httpclient initialization per loop and object used multiple times in the loop. using (var httpClientHelper = new HttpClientHelper(tokenService)) API call snippet: var response = await httpClientHelper.GetAsync(""http://xyz""); Help or thoughts on this will be much appreciated. _Copied from original issue: aspnet/Home#2918_" 27748 area-System.Net fix some conditional test logic related to SocketsHttpHandler There were a few test cases where we were using platform tests like IsWindows to disable or modify tests. Clean these up so they run properly on SocketsHttpHandler. @stephentoub @davidsh 27750 area-System.Runtime [Arm64] Revise Crypto HW Intrinsic argument names Per https://github.com/dotnet/corefx/pull/27616#discussion_r172359746 we need to revise the argument names for the Crypto HW intrinsics Please assign to @debayang @eerhardt FYI 27753 area-System.Net Fix SocketsHttpHandler TLS client cert handling "SocketHttpHandler was not filtering down the client certificates when sending in ""Manual"" mode. This caused a client certificate to be sent to a server when it didn't have the proper EKU OID for ""Client Authentication"". Changed this so that both ""Manual"" and ""Automatic"" modes will use the CertificateHelper GetEligibleCertificate() API. Fixes #23128" 27754 area-System.Threading Assertion in channels using pooled object ``` Assertion Failed 2018-03-05 22:00:23,076: INFO: proc(54): run_and_log_output: Output: The continuation was the completion sentinel. State=CompletionSet. 2018-03-05 22:00:23,076: INFO: proc(54): run_and_log_output: Output: 2018-03-05 22:00:23,076: INFO: proc(54): run_and_log_output: Output: at System.Threading.Channels.ResettableValueTaskSource`1.InvokeContinuation() in D:\j\workspace\windows-TGrou---db113413\src\System.Threading.Channels\src\System\Threading\Channels\AsyncOperation.cs:line 261 2018-03-05 22:00:23,076: INFO: proc(54): run_and_log_output: Output: at System.Threading.Channels.ResettableValueTaskSource`1.SignalCompletion() in D:\j\workspace\windows-TGrou---db113413\src\System.Threading.Channels\src\System\Threading\Channels\AsyncOperation.cs:line 254 2018-03-05 22:00:23,076: INFO: proc(54): run_and_log_output: Output: at System.Threading.Channels.ResettableValueTaskSource`1.TrySetResult(T result) in D:\j\workspace\windows-TGrou---db113413\src\System.Threading.Channels\src\System\Threading\Channels\AsyncOperation.cs:line 211 2018-03-05 22:00:23,076: INFO: proc(54): run_and_log_output: Output: at System.Threading.Channels.AsyncOperation`1.Success(TResult item) in D:\j\workspace\windows-TGrou---db113413\src\System.Threading.Channels\src\System\Threading\Channels\AsyncOperation.cs:line 336 2018-03-05 22:00:23,076: INFO: proc(54): run_and_log_output: Output: at System.Threading.Channels.SingleConsumerUnboundedChannel`1.UnboundedChannelWriter.TryWrite(T item) in D:\j\workspace\windows-TGrou---db113413\src\System.Threading.Channels\src\System\Threading\Channels\SingleConsumerUnboundedChannel.cs:line 327 2018-03-05 22:00:23,076: INFO: proc(54): run_and_log_output: Output: at System.Threading.Channels.SingleConsumerUnboundedChannel`1.UnboundedChannelWriter.WriteAsync(T item, CancellationToken cancellationToken) in D:\j\workspace\windows-TGrou---db113413\src\System.Threading.Channels\src\System\Threading\Channels\SingleConsumerUnboundedChannel.cs:line 347 2018-03-05 22:00:23,076: INFO: proc(54): run_and_log_output: Output: at System.Threading.Channels.Tests.PerfTests.<>c__DisplayClass4_1.<<PingPong>b__1>d.MoveNext() in D:\j\workspace\windows-TGrou---db113413\src\System.Threading.Channels\tests\Performance\Perf.Channel.cs:line 122 2018-03-05 22:00:23,076: INFO: proc(54): run_and_log_output: Output: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in E:\A\_work\1250\s\src\mscorlib\shared\System\Threading\ExecutionContext.cs:line 166 2018-03-05 22:00:23,076: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext() in E:\A\_work\1250\s\src\mscorlib\src\System\Runtime\CompilerServices\AsyncMethodBuilder.cs:line 559 2018-03-05 22:00:23,076: INFO: proc(54): run_and_log_output: Output: at System.Threading.Channels.ResettableValueTaskSource`1.<>c.<InvokeContinuation>b__30_0(Object s) in D:\j\workspace\windows-TGrou---db113413\src\System.Threading.Channels\src\System\Threading\Channels\AsyncOperation.cs:line 270 2018-03-05 22:00:23,076: INFO: proc(54): run_and_log_output: Output: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in E:\A\_work\1250\s\src\mscorlib\shared\System\Threading\ExecutionContext.cs:line 166 2018-03-05 22:00:23,076: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) in E:\A\_work\1250\s\src\mscorlib\src\System\Threading\Tasks\Task.cs:line 2440 2018-03-05 22:00:23,076: INFO: proc(54): run_and_log_output: Output: at System.Threading.ThreadPoolWorkQueue.Dispatch() in E:\A\_work\1250\s\src\mscorlib\src\System\Threading\ThreadPool.cs:line 588 2018-03-05 22:00:23,076: INFO: proc(54): run_and_log_output: Output: Expected IsCompleted, got Owned 2018-03-05 22:00:23,076: INFO: proc(54): run_and_log_output: Output: 2018-03-05 22:00:23,076: INFO: proc(54): run_and_log_output: Output: at System.Threading.Channels.ResettableValueTaskSource`1.OnCompleted(Action`1 continuation, Object state, Int16 token, ValueTaskSourceOnCompletedFlags flags) in D:\j\workspace\windows-TGrou---db113413\src\System.Threading.Channels\src\System\Threading\Channels\AsyncOperation.cs:line 190 2018-03-05 22:00:23,076: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.ValueTaskAwaiter`1.System.Runtime.CompilerServices.IValueTaskAwaiter.AwaitUnsafeOnCompleted(IAsyncStateMachineBox box) in E:\A\_work\1250\s\src\mscorlib\shared\System\Runtime\CompilerServices\ValueTaskAwaiter.cs:line 183 2018-03-05 22:00:23,076: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AwaitUnsafeOnCompleted[TAwaiter,TStateMachine](TAwaiter& awaiter, TStateMachine& stateMachine) in E:\A\_work\1250\s\src\mscorlib\src\System\Runtime\CompilerServices\AsyncMethodBuilder.cs:line 377 2018-03-05 22:00:23,076: INFO: proc(54): run_and_log_output: Output: at System.Threading.Channels.Tests.PerfTests.<>c__DisplayClass4_1.<<PingPong>b__0>d.MoveNext() in D:\j\workspace\windows-TGrou---db113413\src\System.Threading.Channels\tests\Performance\Perf.Channel.cs:line 112 2018-03-05 22:00:23,076: INFO: proc(54): run_and_log_output: Output: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in E:\A\_work\1250\s\src\mscorlib\shared\System\Threading\ExecutionContext.cs:line 166 2018-03-05 22:00:23,076: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext() in E:\A\_work\1250\s\src\mscorlib\src\System\Runtime\CompilerServices\AsyncMethodBuilder.cs:line 559 2018-03-05 22:00:23,076: INFO: proc(54): run_and_log_output: Output: at System.Threading.Channels.ResettableValueTaskSource`1.<>c.<InvokeContinuation>b__30_0(Object s) in D:\j\workspace\windows-TGrou---db113413\src\System.Threading.Channels\src\System\Threading\Channels\AsyncOperation.cs:line 270 2018-03-05 22:00:23,076: INFO: proc(54): run_and_log_output: Output: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in E:\A\_work\1250\s\src\mscorlib\shared\System\Threading\ExecutionContext.cs:line 166 2018-03-05 22:00:23,076: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) in E:\A\_work\1250\s\src\mscorlib\src\System\Threading\Tasks\Task.cs:line 2440 2018-03-05 22:00:23,076: INFO: proc(54): run_and_log_output: Output: at System.Threading.ThreadPoolWorkQueue.Dispatch() in E:\A\_work\1250\s\src\mscorlib\src\System\Threading\ThreadPool.cs:line 588 2018-03-05 22:00:23,076: INFO: proc(54): run_and_log_output: Output: ----- end 22:00:23.07 ----- exit code -2146232797 ---------------------------------------------------------- 2018-03-05 22:00:23,092: INFO: proc(58): run_and_log_output: Exit Code: -2146232797 2018-03-05 22:00:23,092: ERROR: scriptrunner(91): _main: Error: No exception thrown, but XUnit results not created 2018-03-05 22:00:23,092: ERROR: helix_test_execution(83): report_error: Error running xunit None 2018-03-05 22:00:23,092: INFO: azure_storage(205): _upload: Uploading single blob: 'error.log' 2018-03-05 22:00:23,124: INFO: saferequests(90): request_with_retry: Response complete with status code '201' 2018-03-05 22:00:23,124: INFO: helix_test_execution(93): report_error: Sending ToF test failure event 2018-03-05 22:00:23,124: INFO: event(43): send: Sending event type XUnitTestFailure 2018-03-05 22:00:23,358: INFO: saferequests(90): request_with_retry: Response complete with status code '201' 2018-03-05 22:00:23,374: INFO: azure_storage(205): _upload: Uploading single blob: '7b71c5bca82b4295bcadc5567fd2aa32.log' 2018-03-05 22:00:23,436: INFO: saferequests(90): request_with_retry: Response complete with status code '201' 2018-03-05 22:00:23,436: INFO: event(43): send: Sending event type Logs 2018-03-05 22:00:23,576: INFO: saferequests(90): request_with_retry: Response complete with status code '201' scriptrunner.py ``` 27755 area-System.Net HttpListener - Prefix WWW-Authenticate header with scheme Fixes https://github.com/dotnet/corefx/issues/26606 27758 area-System.Data SNIPacket memory allocation perf improvement (revised) Previous version of `SNIPacket` change (https://github.com/dotnet/corefx/pull/27187) contains couple of issues, and caused several test failures (https://github.com/dotnet/corefx/issues/27587, https://github.com/dotnet/corefx/issues/27574). One of the failures caused by missing locks, and other ones were caused by unreleased byte array on `SNIPacket.Release()`. This revised fix excludes dealing with locks, and also properly deallocates byte array when `SNIPacket.Release()` is called. 27759 area-System.Reflection Keep memory a MetadataReader created from provider/PEReader accesses alive until the provider/PEReader is released Fix https://github.com/dotnet/corefx/issues/25946. 27761 area-System.Net Windows Auth Issue from UWP Applications Hi @rmkerr As discussed I have created a sample project, you may download it from the repository path below. The code as three projects, a WebAPI with windows Authentication and two consumers that have more or less the same code. The console application is able to make the call while the UWP gets a 500 error. Another thing that I noted is if I remove the Authorize attribute from the API it works fine for both. https://github.com/luvhsail/Samples.git 27763 area-System.Diagnostics Handle recycled child PIDs "When the user keeping references to old processes, a new child would re-use some state of an old process with the same PID. This causes the following code to throw when PID is recycled (https://github.com/dotnet/corefx/issues/27249#issuecomment-367288949). ```C# List<Process> processes = new List<Process>(); for (int i = 0; i < 1_000_000; i++) { if (i % 100 == 0) { System.Console.Write("".""); } try { var process = new Process(); processes.Add(process); process.StartInfo.FileName = ""/usr/bin/sleep""; process.StartInfo.Arguments = ""0""; process.EnableRaisingEvents = true; process.Start(); process.WaitForExit(); } catch { System.Console.WriteLine($""Exception when creating process {i}""); throw; } } ``` We detect when the PID is recycled and use a new ProcessWaitState for the new child. Also, we ensure the ProcessWaitHandle is using the same ProcessWaitState as the Process it was created for. The above test code no longer throws now when the PID is recycled. I have not added a test because it takes a long time to run. CC @stephentoub @danmosemsft " 27764 area-Meta Where is System.Web.Http? Hi, I'm trying to convert an ASP.NET project from .NET Framework 4.7.1 to .NET Core 2.1 (preview). My methodology was to rename the folder from `MyAspProj` to `MyAspProj.Old`, then in the solution I created a new .NET Core ASP.NET project called `MyAspProj`, then copied over all the files from `MyAspProj.Old`. I added a reference to `Microsoft.AspNetCore.All`, which I hoped would bring through all the necessary types. but alas, everywhere that I have references to objects from the `System.Web.Http` namespace, my code is broken, with no obvious contenders to redirect the references. For example, `HttpConfiguration`, which is used for Owin configuration. And, while we're there, the Owin package itself is targeting .NET Framework. Is there a successor that targets .NET Core? 27765 area-System.Net WebSocket file descriptor leak when server returns error **Description:** WebSocket file descriptor leak when server returns error **Environment:** NETCore 2.0.5, Linux x64 **How to reproduce:** Connect to a server which constantly returns errors with Websocket. You will see that on Linux amount of file descriptors will drastically grow with each connection attempt. The reason is that [here](https://github.com/dotnet/corefx/blob/release/2.0.0/src/System.Net.WebSockets.Client/src/System/Net/WebSockets/WebSocketHandle.Managed.cs) when `sslStream.AuthenticateAsClientAsync` or any other function throws error on connect `stream` will not be disposed. 27767 area-System.Net fix WebSocket socket descriptor leak in case of error on connection Connect to a server which constantly returns errors with Websocket. You will see that on Linux amount of file descriptors will drastically grow with each connection attempt. The reason is that here when sslStream.AuthenticateAsClientAsync or any other function throws error on connect stream will not be disposed. closes #27765 27768 area-System.Net NRE from ClientWebSocket.ConnectAsync when using ClientCertificates option "Version: 2.1.300-preview2-008302 (also checked using latest master branch) Sample code: ``` var cws = new ClientWebSocket(); cws.Options.ClientCertificates.Add(new X509Certificate2(@""path-to-certificate.pfx"")); await cws.ConnectAsync(new Uri(""wss://....""), CancellationToken.None); ``` throws: ``` System.NullReferenceException: Object reference not set to an instance of an object. at System.Net.WebSockets.WebSocketHandle.ConnectAsyncCore(Uri uri, CancellationToken cancellationToken, ClientWebSocketOptions options) at System.Net.WebSockets.ClientWebSocket.ConnectAsyncCore(Uri uri, CancellationToken cancellationToken) ``` According to my investigation NRE is thrown in the following line: https://github.com/dotnet/corefx/blob/9ce903333efeb3eb5fef069f9caf868cb2309170/src/System.Net.WebSockets.Client/src/System/Net/WebSockets/WebSocketHandle.Managed.cs#L97 `handler.SslOptions.ClientCertificates` is `null` Initializing the certificates collection there: `handler.SslOptions.ClientCertificates = new X509Certificate2Collection();` seems to fix the problem (`await cws.ConnectAsync()` succeeds) " 27769 area-System.Data SQL Reader Async 10 times slower than sync "Hi, we got a problem with the async sql reader. We can reproduce that in ef core and with the sql data reader. Its so slow, that it's not usable. I also tried 4.5.0-preview2-26225-02, but the speed tests give the same result. Example: **Async Sql Client** ```csharp using (var conn = new System.Data.SqlClient.SqlConnection(getConnectionstring(_config))) { using (var cmd = new System.Data.SqlClient.SqlCommand(""SELECT TOP 350 * FROM users.Users;"", conn)) { cmd.CommandType = System.Data.CommandType.Text; conn.Open(); var reader = await cmd.ExecuteReaderAsync(); while (await reader.ReadAsync()) { Guid id = reader.GetGuid(0); stringBuilder2.AppendLine(id.ToString()); } } } ``` **Result: 218ms** **Sync Sql Client** ```csharp using (var conn = new System.Data.SqlClient.SqlConnection(getConnectionstring(_config))) { using (var cmd = new System.Data.SqlClient.SqlCommand(""SELECT TOP 350 * FROM users.Users;"", conn)) { cmd.CommandType = System.Data.CommandType.Text; conn.Open(); var reader = cmd.ExecuteReader(); while (reader.Read()) { Guid id = reader.GetGuid(0); stringBuilder.AppendLine(id.ToString()); } } } ``` **Result: 28 ms** I always tried 10 or more times to exclude warmup. The same happens using ef: **Sync ef example** ```csharp using (var db = new TestContext(_config)) { db.ConfigureLogging(s => stringLogger.AppendLine(stopwatch.ElapsedMilliseconds.ToString() + "" "" + s)); var blogs = db.Users.Take(350) .ToList(); } break;` ``` **Result:** ef-client took 22ms 0 Opening connection to database 'users-service' on server 'xx.database.cloudapi.de'. 0 Opened connection to database 'users-service' on server 'xx.database.cloudapi.de'. 0 Executing DbCommand [Parameters=[@__p_0='?'], CommandType='Text', CommandTimeout='30'] SELECT TOP(@__p_0) [u].[Id], [u].[FirstName], [u].[LastName] FROM [users].[Users] AS [u] 21 Executed DbCommand (21ms) [Parameters=[@__p_0='?'], CommandType='Text', CommandTimeout='30'] SELECT TOP(@__p_0) [u].[Id], [u].[FirstName], [u].[LastName] FROM [users].[Users] AS [u] 22 A data reader was disposed. 22 Closing connection to database 'users-service' on server 'xx.database.cloudapi.de'. 22 Closed connection to database 'users-service' on server 'xx.database.cloudapi.de'. **Async ef example:** ```csharp using (var db = new TestContext(_config)) { db.ConfigureLogging(s => stringLogger.AppendLine(stopwatch.ElapsedMilliseconds.ToString() + "" "" + s)); var blogs = await db.Users.Take(350) .ToListAsync(); } ``` **Result:** ef-client-async took 197ms 0 Opening connection to database 'users-service' on server 'xx.cloudapi.de'. 0 Opened connection to database 'users-service' on server 'xx.database.cloudapi.de'. 0 Executing DbCommand [Parameters=[@__p_0='?'], CommandType='Text', CommandTimeout='30'] SELECT TOP(@__p_0) [u].[Id], [u].[FirstName], [u].[LastName] FROM [users].[Users] AS [u] 125 Executed DbCommand (125ms) [Parameters=[@__p_0='?'], CommandType='Text', CommandTimeout='30'] SELECT TOP(@__p_0) [u].[Id], [u].[FirstName], [u].[LastName] FROM [users].[Users] AS [u] 197 A data reader was disposed. 197 Closing connection to database 'users-service' on server 'xx.database.cloudapi.de'. 197 Closed connection to database 'users-service' on server 'xx.database.cloudapi.de'. I would expect the async code to be slower but not 5 to 10 times. I tried all available versions (preview 1, 2 and normal version). My tests are generated with vs code on mac and in our docker images, e.g dotnet-nightly:2.1.0-preview1-runtime-stretch Any ideas? " 27770 area-System.Runtime BinaryFormatter has no benchmarks defined During my recent serializers comparison, I have discovered huge perf boost for BinaryFormatter.Serialize. The problem is that BinaryFormatter has no benchmarks defined in CoreFX so any perf change is not tracked by `BenchView`. Our other serializers have some benchmarks [link](https://github.com/dotnet/corefx/search?utf8=%E2%9C%93&q=RunSerializationPerformanceTest&type=) I think that `BinaryFormatter` should also have some. This is a follow up of https://github.com/dotnet/coreclr/issues/16628 27773 area-System.Runtime Type 'System.TimeZoneInfo' cannot be serialized by DCS Originally reported as a [VS Feedback issue](https://developercommunity.visualstudio.com/content/problem/200357/unable-to-create-web-service-reference-on-net-core.html). Try the following code: ``` TimeZoneInfo tzi = TimeZoneInfo.Local; DataContractSerializer ser = new DataContractSerializer(typeof(TimeZoneInfo)); MemoryStream stream = new MemoryStream(); ser.WriteObject(stream, tzi); ``` The following exception is thrown: > System.Runtime.Serialization.SerializationException > HResult=0x8013150C > Message=Type 'System.TimeZoneInfo+AdjustmentRule[]' with data contract name 'ArrayOfTimeZoneInfo.AdjustmentRule:http://schemas.datacontract.org/2004/07/System' is not expected. Add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer. 27774 area-System.Memory Cleanup use of nuint in portable System.Memory implementation From https://github.com/dotnet/corefx/pull/27757#discussion_r172514619 SpanHelpers.cs is included in portable System.Memory. It does not work - files that use nuint can be used for fast Span only. They cannot be used for portable System.Memory. Portable System.Memory is not compiled bitness specific. 27775 area-System.Net Activity for HttpClient calls not stopped if inner handler does not use async/await (PR 2) "Note: This is a new version of #27472. I restored my branch but the PR didn't pick up the new commits. Sorry for that. Original description from #27472: I've been writing some `DiagnosticSource`/`Activity` based instrumentation for HttpClient. [In my unit tests](https://github.com/cwe1ss/opentracing-contrib-dotnet/blob/ba20de4ba57e43cb685083e3c0b2b19022ce067e/test/OpenTracing.Contrib.AspNetCore.Tests/HttpOut/HttpOutInterceptorTest.cs) I've created a HttpMessageHandler and wrapped it with the existing `DiagnosticsHandler` (by using reflection, so in an unsupported way) to test the different scenarios. However, I noticed that if my handler doesn't use `async/await`, the `DiagnosticsHandler` does NOT raise the Diagnostics-events for `System.Net.Http.Exception` and `System.Net.Http.HttpRequestOut.Stop` because the invocation is outside of the try...catch block. E.g. if DiagnosticsHandler is using an inner handler that looks like this, it does NOT raise the events: ```csharp public class FailingHttpMessageHandler : HttpMessageHandler { protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) { throw new InvalidOperationException(""foo""); } } ``` It only works, if I change the code as follows: ```csharp public class FailingHttpMessageHandler : HttpMessageHandler { protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) { await Task.CompletedTask; throw new InvalidOperationException(""foo""); } } ``` My direct usage of DiagnosticsHandler is obviously a hack as it is internal and AFAIU in a regular application `DiagnosticsHandler` is an internal feature of `HttpClientHandler` so there shouldn't be any user code after it but nevertheless, I think that it would make sense to move the call from this PR into the try..catch block. /cc @lmolkova @vancem" 27776 area-System.Security RSA incompatibility between full framework and .net core? "I have a problem when working with RSA in .NET Full framework (4.6.2) and .net core 2. There is an existing full framework application that encrypts and decrypts files using certificates. The goal is to create a compatible .net core application that can exchange encrypted files with the existing application. In short, an symmetrical AES key is used to encrypt the actual file data. The AES key is then encrypted with the receivers public RSA key. I got it working 3/4 of the way. That is: * The full framework application can (of course) encrypt files and decrypt them. * The .net core application can encrypt files and decrypt them. * The .net core application can encrypt files, which can be decrypted with the full framework application. * The .net core application **cannot** decrypt files, which have been encrypted with the full framework application. In the last case I get an `WindowsCryptographicException` with the message `The parameter is incorrect` (internally its Error code 87). The full 4.6.2 framework application uses the certificate of the receiver as such: ``` var rsa = receiverCertificate.PublicKey.Key as RSACryptoServiceProvider; // *snip* create AES key var encryptedAesKey = rsa.Encrypt(aesManaged.Key, false); ``` When decrypting, it does the following: ``` var rsa = receiverCertificate.PrivateKey as RSACryptoServiceProvider; // *snip* extract encrypted aes key from encrypted file var decryptedKey = rsa.Decrypt(encryptedKey, false); ``` Now, in .net core it is not possible to cast the key directly to `RSACryptoServiceProvider`. To re-use most of the existing code and port that over to .NET core I wrote these two extension methods to get an `RSACryptoServiceProvider` out of the keys, like this: ``` public static RSACryptoServiceProvider GetPublicKeyRsaCryptoServiceProvider(this X509Certificate2 certificate) { // Get params from public key var rsa = certificate.GetRSAPublicKey(); var rsaParameters = rsa.ExportParameters(false); var csp = new RSACryptoServiceProvider(rsa.KeySize, new CspParameters() { ProviderType = 24, ProviderName = ""Microsoft Enhanced RSA and AES Cryptographic Provider"", }); csp.ImportParameters(rsaParameters); return rsacsp; } public static RSACryptoServiceProvider GetPrivateKeyRsaCryptoServiceProvider(this X509Certificate2 certificate) { // Get params from private key var rsa = certificate.GetRSAPrivateKey(); var rsaParameters = rsa.ExportParameters(true); var csp = new RSACryptoServiceProvider(rsa.KeySize, new CspParameters() { ProviderType = 24, ProviderName = ""Microsoft Enhanced RSA and AES Cryptographic Provider"", }); csp.ImportParameters(rsaParameters); return rsacsp; } ``` The only lines I changed while porting the existing code over to .net core were the lines that casted the public/private key to `RSACryptoServiceProvider `and replaced the casts with calls to my extension methods. Before changing more and to completely move over to the RSA class from `RSACryptoServiceProvider`, so that the .net core application can eventually run on other OSes, I want this to work first in a full roundtrip. For additional info: I get hold of the `X509Certificate2` instance like this: ``` using (var myStore = new X509Store(StoreName.My, StoreLocation.CurrentUser)) { myStore.Open(OpenFlags.ReadOnly); var certs = myStore.Certificates.Find(X509FindType.FindByKeyUsage, X509KeyUsageFlags.DataEncipherment.ToString(), true); return certs.FirstOrDefault(c => c.Subject.Contains(""receiver"")); } ``` The error is thrown in the actual call to `RSACryptoServiceProvider.Decrypt()`, when it goes through the `CapiHelper.Decrypt()` into `CapiHelper.Interop.CryptDecrypt()` which returns with the error code. " 27777 area-System.Net Fix NullReferenceException when using client certs with ClientWebSocket Fixes https://github.com/dotnet/corefx/issues/27768 Contributes to https://github.com/dotnet/corefx/issues/12038 (necessary to test the fix well) cc: @geoffkizer, @davidsh, @rmkerr, @caesar1995 27778 area-System.Net Proposal: Implement useful properties in WebClient "The following proposal is intended to make WebClient easier to use. ``` WebClient wc = new WebClient(); wc.Timeout = 500; // Does not exist - Requires overloads wc.UserAgent = ""Awesome WebClient User Agent""; // Hidden behind .Headers[""User-Agent""] wc.ContentType = ""application/x-www-form-urlencoded""; // Hidden behind .Headers[""Content-Type""] / .Headers[HttpRequestHeader.ContentType] wc.Cookie = ""val=someSessionValue""; // Hidden behind .Headers[""Cookie""] ```" 27779 area-System.IO Wildcard pattern is matching files incorrectly. "Some MSBuild tests started failing against the latest .NET CLI preview because file pattern matching is returning unexpected results on Linux and Mac. # Repro: 1. Create two files in the program output directory, `Foo.cs` and `Foo2.cs` 2. `dotnet run` the following: ```C# using System; using System.IO; namespace wildcards { class Program { static void Main(string[] args) { foreach (string path in Directory.EnumerateFiles(""."", ""????.cs"")) { Console.WriteLine(path); } } } } ``` # Expected Result Program should print out the path to `Foo2.cs` since its file name has four characters that match the four questions marks. ``` /Users/UserA/Foo/bin/Debug/netcoreapp2.0/Foo2.cs ``` # Actual Result Program prints out the path to `Foo.cs` and `Foo2.cs` since `Foo2.cs` is the only file that matches `????.cs` ``` /Users/UserA/Foo/bin/Debug/netcoreapp2.0/Foo.cs /Users/UserA/Foo/bin/Debug/netcoreapp2.0/Foo2.cs ``` # dotnet --info ``` .NET Command Line Tools (2.1.300-preview2-008293) Product Information: Version: 2.1.300-preview2-008293 Commit SHA-1 hash: 68922e2a51 Runtime Environment: OS Name: ubuntu OS Version: 16.04 OS Platform: Linux RID: ubuntu.16.04-x64 Base Path: /home/jeff/msbuild/artifacts/.dotnet/2.1.300-preview2-008293/sdk/2.1.300-preview2-008293/ Host (useful for support): Version: 2.1.0-preview2-26227-01 Commit: 86d1f92013 .NET Core SDKs installed: 2.1.300-preview2-008293 [/home/jeff/msbuild/artifacts/.dotnet/2.1.300-preview2-008293/sdk] The.NET Core runtimes installed: Microsoft.NETCore.App 2.1.0-preview2-26227-01 [/home/jeff/msbuild/artifacts/.dotnet/2.1.300-preview2-008293/shared] Microsoft.AspNetCore.App 2.1.0-preview2-30171 [/home/jeff/msbuild/artifacts/.dotnet/2.1.300-preview2-008293/shared] Microsoft.AspNetCore.All 2.1.0-preview2-30171 [/home/jeff/msbuild/artifacts/.dotnet/2.1.300-preview2-008293/shared] ```" 27781 area-System.Data Fix the unhandled exception and test validation in manual tests There are two changes in this PR. 1. Handle all the exception thrown by the thread in the thread itself, so that it doesn't crash the tests. 2. Add the check for additional error message that can be thrown if the Command is Canceled. This was causing intermittent test crashes in Manual Test runs. 27783 area-System.Net [Preview2] Make SocketsHttpHandler default Handler We want to switch default HttpClientHandler to SocketsHttpHandler for 2.1 (starting with Preview2). We need to keep the escape route to fall back to WinHttp & LibCurl handlers (when explicitly set). Most relevant code is here: https://github.com/dotnet/corefx/blob/master/src/System.Net.Http/src/System/Net/Http/HttpClientHandler.cs#L17-L37 Part of the task is also to: 1. Verify all CoreFX tests pass (esp. Data which depends on Http stack) - incl. outer loop CI legs 2. Verify that WCF tests pass (please work with Paulo & WCF team to run all their test suites, ideally prior to checkin) 3. Keep testing WinHttp & LibCurl handlers (e.g. change ManagedHandler Http test suite to PlatformHandler Http test suite) cc @geoffkizer 27784 area-System.Net _currentSocket.SafeHandle is invalid assert in System.Net.Http tests ``` 2018-03-06 18:53:48,816: INFO: proc(54): run_and_log_output: Output: Assertion Failed 2018-03-06 18:53:48,816: INFO: proc(54): run_and_log_output: Output: _currentSocket.SafeHandle is invalid 2018-03-06 18:53:48,816: INFO: proc(54): run_and_log_output: Output: 2018-03-06 18:53:48,816: INFO: proc(54): run_and_log_output: Output: at System.Net.Sockets.SocketAsyncEventArgs.AllocateNativeOverlapped() in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Sockets\src\System\Net\Sockets\SocketAsyncEventArgs.Windows.cs:line 64 2018-03-06 18:53:48,816: INFO: proc(54): run_and_log_output: Output: at System.Net.Sockets.SocketAsyncEventArgs.DoOperationReceiveSingleBuffer(SafeCloseSocket handle) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Sockets\src\System\Net\Sockets\SocketAsyncEventArgs.Windows.cs:line 280 2018-03-06 18:53:48,816: INFO: proc(54): run_and_log_output: Output: at System.Net.Sockets.SocketAsyncEventArgs.DoOperationReceive(SafeCloseSocket handle) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Sockets\src\System\Net\Sockets\SocketAsyncEventArgs.Windows.cs:line 268 2018-03-06 18:53:48,816: INFO: proc(54): run_and_log_output: Output: at System.Net.Sockets.Socket.ReceiveAsync(SocketAsyncEventArgs e) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Sockets\src\System\Net\Sockets\Socket.cs:line 4037 2018-03-06 18:53:48,816: INFO: proc(54): run_and_log_output: Output: at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ReceiveAsync(Socket socket) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Sockets\src\System\Net\Sockets\Socket.Tasks.cs:line 881 2018-03-06 18:53:48,816: INFO: proc(54): run_and_log_output: Output: at System.Net.Sockets.Socket.ReceiveAsync(Memory`1 buffer, SocketFlags socketFlags, Boolean fromNetworkStream, CancellationToken cancellationToken) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Sockets\src\System\Net\Sockets\Socket.Tasks.cs:line 204 2018-03-06 18:53:48,816: INFO: proc(54): run_and_log_output: Output: at System.Net.Sockets.NetworkStream.ReadAsync(Memory`1 destination, CancellationToken cancellationToken) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Sockets\src\System\Net\Sockets\NetworkStream.cs:line 762 2018-03-06 18:53:48,832: INFO: proc(54): run_and_log_output: Output: at System.Net.Http.HttpConnection.FillAsync() in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnection.cs:line 1209 2018-03-06 18:53:48,832: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in E:\A\_work\1250\s\src\mscorlib\src\System\Runtime\CompilerServices\AsyncMethodBuilder.cs:line 938 2018-03-06 18:53:48,832: INFO: proc(54): run_and_log_output: Output: at System.Net.Http.HttpConnection.FillAsync() 2018-03-06 18:53:48,832: INFO: proc(54): run_and_log_output: Output: at System.Net.Http.HttpConnection.ReadNextResponseHeaderLineAsync(Boolean foldedHeadersAllowed) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnection.cs:line 1161 2018-03-06 18:53:48,832: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in E:\A\_work\1250\s\src\mscorlib\src\System\Runtime\CompilerServices\AsyncMethodBuilder.cs:line 938 2018-03-06 18:53:48,832: INFO: proc(54): run_and_log_output: Output: at System.Net.Http.HttpConnection.ReadNextResponseHeaderLineAsync(Boolean foldedHeadersAllowed) 2018-03-06 18:53:48,832: INFO: proc(54): run_and_log_output: Output: at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnection.cs:line 471 2018-03-06 18:53:48,832: INFO: proc(54): run_and_log_output: Output: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in E:\A\_work\1250\s\src\mscorlib\shared\System\Threading\ExecutionContext.cs:line 166 2018-03-06 18:53:48,832: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext() in E:\A\_work\1250\s\src\mscorlib\src\System\Runtime\CompilerServices\AsyncMethodBuilder.cs:line 559 2018-03-06 18:53:48,832: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.Task.RunContinuations(Object continuationObject) in E:\A\_work\1250\s\src\mscorlib\src\System\Threading\Tasks\Task.cs:line 3283 2018-03-06 18:53:48,832: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.Task`1.TrySetResult(TResult result) in E:\A\_work\1250\s\src\mscorlib\src\System\Threading\Tasks\future.cs:line 421 2018-03-06 18:53:48,832: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetExistingTaskResult(TResult result) in E:\A\_work\1250\s\src\mscorlib\src\System\Runtime\CompilerServices\AsyncMethodBuilder.cs:line 650 2018-03-06 18:53:48,832: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder`1.SetResult(TResult result) in E:\A\_work\1250\s\src\mscorlib\shared\System\Runtime\CompilerServices\AsyncValueTaskMethodBuilder.cs:line 169 2018-03-06 18:53:48,832: INFO: proc(54): run_and_log_output: Output: at System.Net.Http.HttpConnection.ReadNextResponseHeaderLineAsync(Boolean foldedHeadersAllowed) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnection.cs:line 1163 2018-03-06 18:53:48,832: INFO: proc(54): run_and_log_output: Output: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in E:\A\_work\1250\s\src\mscorlib\shared\System\Threading\ExecutionContext.cs:line 166 2018-03-06 18:53:48,832: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext() in E:\A\_work\1250\s\src\mscorlib\src\System\Runtime\CompilerServices\AsyncMethodBuilder.cs:line 559 2018-03-06 18:53:48,832: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.Task.RunContinuations(Object continuationObject) in E:\A\_work\1250\s\src\mscorlib\src\System\Threading\Tasks\Task.cs:line 3283 2018-03-06 18:53:48,832: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.Task`1.TrySetResult(TResult result) in E:\A\_work\1250\s\src\mscorlib\src\System\Threading\Tasks\future.cs:line 421 2018-03-06 18:53:48,832: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetExistingTaskResult(TResult result) in E:\A\_work\1250\s\src\mscorlib\src\System\Runtime\CompilerServices\AsyncMethodBuilder.cs:line 650 2018-03-06 18:53:48,832: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.SetResult() in E:\A\_work\1250\s\src\mscorlib\src\System\Runtime\CompilerServices\AsyncMethodBuilder.cs:line 254 2018-03-06 18:53:48,832: INFO: proc(54): run_and_log_output: Output: at System.Net.Http.HttpConnection.FillAsync() in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnection.cs:line 1218 2018-03-06 18:53:48,832: INFO: proc(54): run_and_log_output: Output: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in E:\A\_work\1250\s\src\mscorlib\shared\System\Threading\ExecutionContext.cs:line 166 2018-03-06 18:53:48,832: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext() in E:\A\_work\1250\s\src\mscorlib\src\System\Runtime\CompilerServices\AsyncMethodBuilder.cs:line 559 2018-03-06 18:53:48,832: INFO: proc(54): run_and_log_output: Output: at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.InvokeContinuation(Action`1 continuation, Object state, Boolean forceAsync) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Sockets\src\System\Net\Sockets\Socket.Tasks.cs:line 1027 2018-03-06 18:53:48,832: INFO: proc(54): run_and_log_output: Output: at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.<>c.<.cctor>b__27_2(Object s, SocketAsyncEventArgs e) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Sockets\src\System\Net\Sockets\Socket.Tasks.cs:line 829 2018-03-06 18:53:48,832: INFO: proc(54): run_and_log_output: Output: at System.Net.Sockets.SocketAsyncEventArgs.OnCompleted(SocketAsyncEventArgs e) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Sockets\src\System\Net\Sockets\SocketAsyncEventArgs.cs:line 207 2018-03-06 18:53:48,832: INFO: proc(54): run_and_log_output: Output: at System.Net.Sockets.SocketAsyncEventArgs.ExecutionCallback(Object state) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Sockets\src\System\Net\Sockets\SocketAsyncEventArgs.cs:line 427 2018-03-06 18:53:48,832: INFO: proc(54): run_and_log_output: Output: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in E:\A\_work\1250\s\src\mscorlib\shared\System\Threading\ExecutionContext.cs:line 166 2018-03-06 18:53:48,832: INFO: proc(54): run_and_log_output: Output: at System.Net.Sockets.SocketAsyncEventArgs.FinishOperationAsyncSuccess(Int32 bytesTransferred, SocketFlags flags) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Sockets\src\System\Net\Sockets\SocketAsyncEventArgs.cs:line 769 2018-03-06 18:53:48,832: INFO: proc(54): run_and_log_output: Output: at System.Net.Sockets.SocketAsyncEventArgs.<>c.<.cctor>b__173_0(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Sockets\src\System\Net\Sockets\SocketAsyncEventArgs.Windows.cs:line 1169 2018-03-06 18:53:48,832: INFO: proc(54): run_and_log_output: Output: at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP) in E:\A\_work\1250\s\src\mscorlib\src\System\Threading\Overlapped.cs:line 101 ``` 27786 area-Serialization [Perf] XmlSerializer.Deserialize() regression between 2.0 and 2.1 for Linux (around 100%) "I have verified that the initial regression of 30% for Windows (#27636) was fixed by https://github.com/dotnet/coreclr/pull/16654 and https://github.com/dotnet/coreclr/pull/16659 Unfortunately, this is not true for Linux (at least Ubuntu 16.04). `XmlSerializer.Deserialize()` is 100% slower for Linux, when comparing 2.0 and 2.1 You can use following code to reproduce the problem: ```cs using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Runtime.CompilerServices; using System.Xml.Serialization; namespace XmlDeserializationRegression { class Program { static void Main(string[] args) { var serializer = new XmlSerializer(typeof(LoginViewModel)); List<double> results = new List<double>(); using (var memoryStream = new MemoryStream(capacity: short.MaxValue)) { serializer.Serialize(memoryStream, CreateLoginViewModel()); Benchmark(memoryStream, serializer, 1, ""Warmup""); for (int i = 0; i < 10; i++) { results.Add(RealRun(memoryStream, serializer, 1000, ""Actual run"")); } } var coreclrAssemblyInfo = FileVersionInfo.GetVersionInfo(typeof(object).Assembly.Location); var corefxAssemblyInfo = FileVersionInfo.GetVersionInfo(typeof(System.Text.RegularExpressions.Regex).Assembly.Location); Console.WriteLine($""CoreCLR {coreclrAssemblyInfo.FileVersion}, CoreFX {corefxAssemblyInfo.FileVersion}""); Console.WriteLine($""Avg: {results.Average()}, Min: {results.Min()}, Max: {results.Max()}""); } [MethodImpl(MethodImplOptions.NoInlining)] private static double RealRun(Stream stream, XmlSerializer xmlSerializer, int invocationCount, string displayText) => Benchmark(stream, xmlSerializer, invocationCount, displayText); private static double Benchmark(Stream stream, XmlSerializer xmlSerializer, int invocationCount, string displayText) { object deserialized = null; GC.Collect(); GC.WaitForPendingFinalizers(); GC.Collect(); var timer = Stopwatch.StartNew(); for (int i = 0; i < invocationCount; i++) { stream.Position = 0; deserialized = xmlSerializer.Deserialize(stream); } TimeSpan avg = timer.Elapsed / invocationCount; Console.WriteLine($""{displayText}: Average elapsed milliseconds: {avg.TotalMilliseconds}""); GC.KeepAlive(deserialized); return avg.TotalMilliseconds; } private static LoginViewModel CreateLoginViewModel() => new LoginViewModel { Email = ""name.familyname@not.com"", Password = ""abcdefgh123456!@"", RememberMe = true }; } public class LoginViewModel { public string Email { get; set; } public string Password { get; set; } public bool RememberMe { get; set; } } } ```" 27787 area-Infrastructure Updating the package index for UAP and updating buildtools This will update the packageIndex to show the correct data of the packages that we shipped on UAP RS3 and it will also take care of the buildtools update that will get the new NuGet mappings. cc: @weshaggard @ericstj Given that the uap builds are now working on master, this PR will basically replicate the previous PR I created against release/2.1 but on master. I haven't yet merged the other one, and so if this goes in I will just close the release/2.1 one. 27789 area-System.Runtime Add tests to exercise sbyte string constructors with invalid UTF8 Regression test for variant of https://github.com/dotnet/coreclr/issues/16786 Depends on https://github.com/dotnet/coreclr/pull/16749/ that is fixing this bug as side-effect. 27791 area-System.Text Use generic WeakReference and avoid casting in Regex Based on https://github.com/dotnet/corefx/pull/27726, had to create a new PR. @danmosemsft I don't think this change needs perf justification. 27792 area-System.Net Consider some search/spider-based testing for SocketsHttpHandler We could, for example, write a simple client that did some Bing searches and then made requests to the top 1000 results with multiple handlers and validate various things, at a minimum that requests succeed and fail similarly, maybe something about the content if possible, etc. We could also, for example, write a little spider that walked over some sites and did similar validation. 27793 area-System.Diagnostics Fixing disabled ProcessExit_Called test masked by #27426 Fixes #27460 27794 area-System.ComponentModel Fix test failure by returning early from AssertMessage Fixes #27659 27795 area-System.Data SqlBulkCopy: Add hooks to enable retry strategies on batches If SqlBulkCopy encounters any kind of exception as it inserts rows into a table, it fails the entire job. In some scenarios, certain errors might be appropriate to retry - for instance, a deadlock or timeout. While this might be unlikely when doing bulk inserts to a staging table, it is much more likely if the table is also shared by a web application, for instance. For this reason, until now we've instead used Table Valued Parameters. It would be helpful though if SqlBulkCopy gave us a mechanism to apply a retry strategy as appropriate. _If this isn't the appropriate place to post suggestions like this, let me know. If there was interest in the above, I would happily investigate the feasibility of this further._ 27796 area-System.Net Remove faulty assert from SocketAsyncEventArgs AllocateNativeOverlapped asserts that !_currentSocket.SafeHandle.IsValid. This should be a fine assert, except that SafeCloseSocket for some reason overrides IsInvalid to actually be IsClosed || IsInvalid. And so that assert is actually checking whether the SafeHandle is both not invalid and not closed, but disposal could be racing with the operation and the socket could have been closed by the time we get here. Fixes https://github.com/dotnet/corefx/issues/27784 cc: @geoffkizer, @davidsh 27797 area-Microsoft.CSharp [WIP] ignore static target type in restrictions 27800 area-System.Globalization What happens when a new era is added in Japanese Calendar? (moved from https://github.com/dotnet/cli/issues/8733 ) I wonder this might not a suitable repo for this issue. Please let me know the right repo and then I'll move. A new era will be added in Japanese Calendar, which is planned to start at May 1st 2019. I'd like to clarify how Japanese Calendar will be updated. Here are my understanding about a new era. I would appreciate .NET Core team confirm it. I also want a dedicated document explaining a new era and help creating it. - At present Japanese Calendar is the only Calendar which a new era could be added. https://github.com/dotnet/coreclr/blob/v2.0.5/src/mscorlib/shared/System/Globalization/CalendarData.Unix.cs#L269 - For Windows, Japanese era info is obtained from registry. Once registry is updated to the new era, .NET Core on WIndows can get a new era info. https://msdn.microsoft.com/ja-jp/library/windows/desktop/dd317805%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396 - For Unix (Linux and Mac), Japanese era info is obtained from lib-icu. Once a new version of icu is installed to the machine, .NET Core on Unix can get a new era info. https://github.com/dotnet/coreclr/blob/v2.0.5/src/mscorlib/shared/Interop/Unix/System.Globalization.Native/Interop.Calendar.cs - In the case .NET Core can't get a era info from registry on Windows and lib-icu on Unix, .NET Core uses [a hard-coded era info](https://github.com/dotnet/coreclr/blob/v2.0.5/src/mscorlib/shared/System/Globalization/JapaneseCalendar.cs#L97-L120). I'm not sure when this hard-coded era info is used actually. However in this case, upgrading .NET Core CLR is required to update a new era info. Also, if the application is built as a Self Contained Application, I wonder we can't update the a new era info in this application. Are these issues related? https://github.com/dotnet/corefx/issues/27506 https://github.com/dotnet/corefx/pull/27617 27801 area-System.Runtime Fix inconsistent AVX/AVX2 intrinsic names Match mscorlib change https://github.com/dotnet/coreclr/pull/16772 @eerhardt @tannergooding 27802 area-System.Reflection Add MethodDefinition.GetSemantics ```C# namespace System.Reflection.Metadata { public struct MethodDefinition { ... public MethodSemanticsAttributes GetSemantics(); ... } } ``` Use case: ILSpy needs to determine whether a given method is an accessor of a property or event. 27803 area-Serialization Use ReflectionBasedSerializer for all serializers if any of mappings are soap mappings When creating serializers for multiple mappings, if any of mappings are soap mapping, it will use ReflectionBasedSerializer and won't generate the serializer. However during serialization, for non soap mapping, it will try to use the serializer for serialization, which doesn't exist. The fix is to force all serializers using ReflectionBasedSerializer if there's any soap mapping. #25298 @zhenlan @mconnew @yujayee @Lxiamail 27805 area-Infrastructure Update UAP System.Private.CoreLib to unblock UAP builds System.Private.CoreLib is currently in a torn state in CoreCLR vs CoreRT where the signature for `Stream.WriteAsync` has changed. This PR consumes a hand-built targeting pack containing System.Private.CoreLib's pending changes we want to merge into TFS. This should allow us to unblock the uap build and get packages we can consume in TFS. Once that happens, we can merge CoreRT into TFS, and then update with a fixed targeting pack. 27809 area-System.IO Support trimmed paths in FileInfo Some paths are not creatable in Windows without special syntax. Notably paths with trailing spaces and periods. As GetFullPath() (and GetFullPathName()) trim these we would lose the correct file name as we passed the path around. With the enumeration changes we now populate FileInfo correctly- this change allows the other methods to work when wrapped around such a path. Also remove some CAS related comments. cc: @jkotas, @Anipik, @danmosemsft, @pjanotti 27811 area-System.IO Consider adding Scatter/Gather IO on Stream "The Socket class has this already, in the form of Send/Receive operations that take an `IList<ArraySegment<byte>>`. This isn't exposed up through Stream classes, however. One specific scenario where this would be useful is writing chunked-encoded request bodies in SocketsHttpHandler. When the user calls the request Stream's Write[Async] method, we need to first write a chunk header with the chunk length followed by \r\n, then write the chunk contents from the user's buffer to the underlying stream (which is either SslStream or NetworkStream). This requires us to either do two writes (which means two kernel calls and means the chunk header will likely be sent in a separate packet), or to copy into a local buffer so we can do a single write. It would be more performant (and simpler) to do a gather write where we pass two buffers, the first containing the chunk header, the second containing the chunk data, passed directly through. There are various examples in HTTP2 where scatter/gather IO would be useful as well. (Mostly gather, since gather helps deal with the ""framing"" scenario above. Scatter reads are less useful since you don't control the framing yourself.) Proposed API: ```csharp public virtual int Read(IReadOnlyList<Memory<byte>> buffers); public virtual void Write(IReadOnlyList<ReadOnlyMemory<byte>> buffers); public virtual ValueTask<int> ReadAsync(IReadOnlyList<Memory<byte>> buffers, CancellationToken cancellationToken = default); public virtual ValueTask WriteAsync(IReadOnlyList<ReadOnlyMemory<byte>> buffers, CancellationToken cancellationToken = default); ``` The base Stream class would provide default implementations on top of existing Read/Write APIs." 27812 area-System.Security X509Certificate2.GetECDsaPrivateKey does not work with an ECC certificate with private key in TPM I am currently encountering the same problem as reported here: https://github.com/dotnet/corefx/issues/9070. I have an ECC certificate in the certificate store with a private key in 'Trusted Platform Module' (TPM). The certificate with a private key has been generated using a Windows domain. When I try to get the ECDsa instance using the GetECDsaPrivateKey method, I get ArgumentException: 'Keys used with the ECDsaCng algorithm must have an algorithm group of ECDsa'. When I instead use a certificate which has been imported to the certificate store from a PFX file (signing certificate created by OpenSSL), the error does not occur. Operating system: Windows 10 64-bit .NET Framework: 4.7 (the exception also occurs in .NET 4.7.1) 27813 area-System.Data Connection to SQL Server impossible in UWP app "**EDIT**: Nevermind. I found the solution here in a .Net Standard [issue](https://github.com/dotnet/standard/issues/578). Should be stated more clearly that ""Internet (Client & Server) is a required capability in UWP in order to connect... I only had Private Networks (which my network actually is) on. Moreover the exception should be more of a ""PermissionException"" instead of ""Server not found""... We're using SQL server to store sensor data which I need to read and use in an UWP app to visualize the outcome. The writing program is written in WPF and uses the EF6 which is unavailabel in UWP. Whereas I use **System.Data.SqlClient** in the UWP app now. I tried every variation I could find on ConnectionStrings.com and the MSDN. Nothing works. I always get the same exception in the following two cases: **Case 1:** I do not specify an explict port Connection String: `Data Source=tcp:***.***.***.***\\SQLEXPRESS;Initial Catalog=MyDB;Integrated Security=False;User ID=UserName;Password=Password` > System.Data.SqlClient.SqlException: 'A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)' The same goes for an explicit computer name or leaving the _tcp:_-prefix. **Case 2:** I specify an explicit port Equal for computer name, IP and tcp-prefix with or without instance name. > System.Data.SqlClient.SqlException: 'A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - An attempt was made to access a socket in a way forbidden by its access permissions.)' with the internal Win32-exception: > Win32Exception: An attempt was made to access a socket in a way forbidden by its access permissions I tried every variation with and without the `ConnectionStringBuilder`-class. Nothing works. I inititally also got some code 25 errors (I think because I forgot to explicitly set Integrated Security to false). I created a [thread on Stackoverflow ](https://stackoverflow.com/questions/49147124/invalid-connection-string-when-connecting-to-sql-server-express?noredirect=1) where you can find more information. I tried everything possible. The last result is that this must be an issue of the SqlClient library itself. I hope someone can help me out or fix this issue if it's really an issue of CoreFX itself. We got a deadline in less than two weeks and there's no other option to fetch data from the SQL server in .Net ... **EDIT** My configuration is: Universal Windows 10.0.16299.0, Target for latest Windows 10. Build without native tool-chain, for x64. Also used the latest preview of SqlClient. No improvement." 27814 area-System.Net System.Net.Sockets.Socket: No buffer space available when setting SendBufferSize "I am trying to create a socket with an 8MB buffer (8388608 bytes) with the following code. ``` var socket = new Socket(SocketType.Stream, ProtocolType.Tcp); socket.SendBufferSize = Setting.NetworkBufferSize; socket.ReceiveBufferSize = Setting.NetworkBufferSize; socket.NoDelay = true; ``` The code fails on the second line with ""No buffer space available"". ``` System.Net.Sockets.SocketException: ""No buffer space available"" at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName) at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Int32 optionValue, Boolean silent) at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Int32 optionValue) at System.Net.Sockets.Socket.set_SendBufferSize(Int32 value) ``` This code works fine when executing in a Windows environment. Is this behavior expected? " 27816 area-System.IO System.IO.File.Open should open the file with shared write access Hi, following two lines to fail, because OpenRead does not share the write access, even if it does not need/use and configure it beforehand. var stream1 = new FileStream(filename, FileMode.Create, FileAccess.ReadWrite, FileShare.Read); var stream2 = File.OpenRead(filename); Kind regards p.s. I write here, because I do not know a better place. 27817 area-System.Collections LinkedList_Generic_Tests_int.RemoveLast_Tests failed on Windows in CI https://mc.dot.net/#/user/stephentoub/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/35efdbdc1e25f83f216064482479e555425ce3a0/workItem/System.Collections.Tests/analysis/xunit/System.Collections.Tests.LinkedList_Generic_Tests_int~2FRemoveLast_Tests ``` Windows.81.Amd64.Open-Debug-x64 Unhandled Exception of Type Xunit.Sdk.EqualException Message : Assert.Equal() Failure Expected: LinkedListNode`1 { List = [718949278, 815265269, 911581260, 1007897251, 1104213242, ...], Next = LinkedListNode`1 { List = [...], Next = null, Previous = LinkedListNode`1 { ... }, Value = 1296845224 }, Previous = LinkedListNode`1 { List = [...], Next = LinkedListNode`1 { ... }, Previous = LinkedListNode`1 { ... }, Value = 1104213242 }, Value = 1200529233 } Actual: LinkedListNode`1 { List = [718949278, 815265269, 911581260, 1007897251, 1104213242, ...], Next = LinkedListNode`1 { List = [...], Next = null, Previous = LinkedListNode`1 { ... }, Value = 1296845224 }, Previous = LinkedListNode`1 { List = [...], Next = LinkedListNode`1 { ... }, Previous = LinkedListNode`1 { ... }, Value = 1104213242 }, Value = 1200529233 } Stack Trace : at System.Collections.Tests.LinkedList_Generic_Tests`1.VerifyLinkedListNode(LinkedListNode`1 node, T expectedValue, LinkedList`1 expectedList, LinkedListNode`1 expectedPrevious, LinkedListNode`1 expectedNext) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Collections\tests\Generic\LinkedList\LinkedList.Generic.Tests.cs:line 141 at System.Collections.Tests.LinkedList_Generic_Tests`1.VerifyState(LinkedList`1 linkedList, T[] expectedItems) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Collections\tests\Generic\LinkedList\LinkedList.Generic.Tests.cs:line 83 at System.Collections.Tests.LinkedList_Generic_Tests`1.InitialItems_Tests(LinkedList`1 collection, T[] expectedItems) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Collections\tests\Generic\LinkedList\LinkedList.Generic.Tests.cs:line 38 at System.Collections.Tests.LinkedList_Generic_Tests`1.RemoveLast_Tests() in D:\j\workspace\windows-TGrou---74aa877a\src\System.Collections\tests\Generic\LinkedList\LinkedList.Generic.Tests.RemoveLast.cs:line 89 ``` 27818 area-Infrastructure Unable to find corerun when trying to crack dump on Helix machine "Below is an example where a test created a dump file and it says ""unable to find executable corerun"" This comes from tools\runnertemplate.unix.txt. It wants to pass corerun to gdb along with the dump file. @Anipik can you please find out why it can't find corerun? You will want to start with a Linux repro machine, and force a dump to be created during the test run. Is corerun even on the box? ``` 2018-03-07 14:43:09,565: INFO: proc(54): run_and_log_output: Output: /home/helixbot/dotnetbuild/work/b2384be1-704d-4bec-b031-ca5c2d74827c/Work/3827fb45-1b10-44e2-ad56-2cb0253d008f/Unzip/RunTests.sh: line 88: 35000 Aborted (core dumped) $RUNTIME_PATH/dotnet xunit.console.netcore.exe System.Xml.XmlSchema.XmlSchemaValidatorApi.Tests.dll -xml testResults.xml -notrait Benchmark=true -notrait category=nonnetcoreapptests -notrait category=nonlinuxtests -notrait category=OuterLoop -notrait category=failing 2018-03-07 14:43:09,633: INFO: proc(54): run_and_log_output: Output: Dumpling has not been installed yet. Please run ""DumplingHelper.py install_dumpling"" before collect_dumps. 2018-03-07 14:43:09,637: INFO: proc(54): run_and_log_output: Output: ~/dotnetbuild/work/b2384be1-704d-4bec-b031-ca5c2d74827c/Work/3827fb45-1b10-44e2-ad56-2cb0253d008f/Unzip 2018-03-07 14:43:09,639: INFO: proc(54): run_and_log_output: Output: ----- end 14:43:09 ----- exit code 134 ---------------------------------------------------------- 2018-03-07 14:43:09,642: INFO: proc(54): run_and_log_output: Output: Unable to find executable corerun 2018-03-07 14:43:09,645: INFO: proc(54): run_and_log_output: Output: Copying core file core.35000 to /tmp/coredumps 2018-03-07 14:43:09,768: INFO: proc(58): run_and_log_output: Exit Code: 134 2018-03-07 14:43:09,777: ERROR: scriptrunner(91): _main: Error: No exception thrown, but XUnit results not created 2018-03-07 14:43:09,777: ERROR: helix_test_execution(83): report_error: Error running xunit None ```" 27820 area-System.ComponentModel Translate all messages from DataAnnotation "Hello, I am trying to translate the standard messages for the RequiredAttribute, MaxLenghtAttribute and other standard Attributes. Below is the code I have: ``` services.AddMvc().AddRazorOptions(options => { options.AddNavigationBootstrap3Views(); }) .AddDataAnnotationsLocalization(options => { options.DataAnnotationLocalizerProvider = (type, factory) => factory.Create(typeof(Tecnologia.Infrastructure.Presentation.Resources.ModelBindingDefault)); }).AddViewLocalization(); services.Configure<RequestLocalizationOptions>(options => { var supportedCultures = new[] { new CultureInfo(""pt-BR"") }; options.DefaultRequestCulture = new RequestCulture(""pt-BR"", ""pt-BR""); options.SupportedCultures = supportedCultures; options.SupportedUICultures = supportedCultures; }); ``` With this code it is necessary that I pass the key in my attributes [Required(ErrorMessage = ""RequiredAttribute_ValidationError"")] I would like to know if it is possible to use only [Required], I have already verified several issues on the subject, but none has provided a plausible solution for this case. Maybe you have some way to replace Strings.resx with your own resources. I look forward to returning, thank you. image from my .resx file [ModelBindingDefault.resx](http://prntscr.com/io64g6) " 27821 area-System.Net Make SocketsHttpHandler default Handler This PR makes SocketsHttpHandler the default Handler, and will address task 1 & 3 in #27783. 27823 area-System.Diagnostics TestChildProcessCleanupAfterDispose(true) failed in CI on Linux https://mc.dot.net/#/user/stephentoub/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/ed9ac7bd3de570b921d74473ded3a06ba9f2baee/workItem/System.Diagnostics.Process.Tests/analysis/xunit/System.Diagnostics.Tests.ProcessTests~2FTestChildProcessCleanupAfterDispose(shortProcess:%20False,%20enableEvents:%20True) ``` Debian.87.Amd64.Open-Release-x64 Get Repro environment Unhandled Exception of Type Xunit.Sdk.TrueException Message : Assert.True() Failure Expected: True Actual: False ``` cc: @tmds 27824 area-System.Memory Consider SafeHandle semantics for OwnedMemory *ReadOnlyMemory<T>:* https://github.com/dotnet/corefx/blob/5c7f5447f49ff6a7aa935765a993c42c70a1b699/src/Common/src/CoreLib/System/ReadOnlyMemory.cs#L234 *OwnedMemory<T>:* https://github.com/dotnet/corefx/blob/41a2120b233cc02c175f812e4e19e3f058396cb0/src/Common/src/CoreLib/System/Buffers/OwnedMemory.cs#L46 https://github.com/dotnet/corefx/blob/41a2120b233cc02c175f812e4e19e3f058396cb0/src/Common/src/CoreLib/System/Buffers/OwnedMemory.cs#L87 Is it intended that these two types have different usage patterns? It's also not not very clear if a call to `OwnedMemory<T>.Pin()` implies a call to `OwnedMemory<T>.Retain()` or not. <details> <summary>Proposed changes (click to expand)</summary> ```diff namespace System.Buffers { public abstract class OwnedMemory<T> : IDisposable, IRetainable { public abstract int Length { get; } public abstract Span<T> Span { get; } public Memory<T> Memory { get; } - public abstract MemoryHandle Pin(int byteOffset = 0); public void Dispose() protected abstract void Dispose(bool disposing); protected abstract bool IsRetained { get; } public abstract bool IsDisposed { get; } - public abstract void Retain(); + public abstract MemoryHandle Retain(bool pin = false, int byteOffset = 0); - public abstract bool Release(); } } ``` or, less preferably, ```diff namespace System { public readonly struct ReadOnlyMemory<T> { public ReadOnlyMemory(T[] array) public ReadOnlyMemory(T[] array, int start, int length) public static implicit operator ReadOnlyMemory<T>(T[] array) public static implicit operator ReadOnlyMemory<T>(ArraySegment<T> arraySegment) public static ReadOnlyMemory<T> Empty { get; } public int Length { get; } public bool IsEmpty { get; } public override string ToString() public ReadOnlyMemory<T> Slice(int start) public ReadOnlyMemory<T> Slice(int start, int length) public ReadOnlySpan<T> Span { get; } public void CopyTo(Memory<T> destination) public bool TryCopyTo(Memory<T> destination) - public MemoryHandle Retain(bool pin = false) + public MemoryHandle Pin() + public void Retain() + public void Release() public T[] ToArray() public override bool Equals(object obj) public bool Equals(ReadOnlyMemory<T> other) public override int GetHashCode() } } ``` </details> 27826 area-System.IO Named pipe in Unix respects absolute path "This was added for two reasons: 1. Allow users to workaround the hard limit on Unix domain sockets that can be very limiting if the $TMPDIR has a long path; 2. Make easy to make that works both on Unix and Windows without having to check platform, e.g.: ""/tmp/myAppPipe"" works on both platforms." 27827 area-System.IO Dial back `\\?\ ` insertion Only premptively adding for FileSystemInfo if we end in period or space. Long path is taken care of later. Clean up code a little and add test for DirectoryInfo.Move. cc: @danmosemsft, @pjanotti, @Anipik 27828 area-System.Net Renable some TLS callback tests with SocketsHttpHandler The UseCallback_BadCertificate_ExpectedPolicyErrors tests had been disabled when running against SocketsHttpHandler. The reason in the comments was that the tests were not returning the proper SslPolicyErrors. These particular tests use external third party servers (*.badssl.com). Running these tests now against the latest code shows no errors. It's possible this was a problem related to those external servers. Renabling the tests for now. Fixes #23137 27831 area-Infrastructure Update SLNs and projects to be in sync with configurations I've noticed quite a bit of noise when running this lately so I figured I'd get us back up-to-date. /cc @weshaggard @joperezr 27833 area-Infrastructure Update Buildtools & undo unnecessary changes to publish CC @dagood, @weshaggard I'm also undoing my changes from https://github.com/dotnet/corefx/pull/27667 and https://github.com/dotnet/corefx/pull/27749, which will be unnecessary once we update buildtools 27834 area-System.Net Failure in System.Net.Http.Functional.Tests https://ci3.dot.net/job/dotnet_corefx/job/master/job/windows-TGroup_netfx+CGroup_Release+AGroup_x86+TestOuter_false_prtest/9469/consoleFull ``` System.Net.Http.Functional.Tests.HttpClientHandler_MaxConnectionsPerServer_Test.GetAsync_MaxLimited_ConcurrentCallsStillSucceed(maxConnections: 2, numRequests: 2, secure: False) [FAIL] 12:06:05 System.Threading.Tasks.TaskCanceledException : A task was canceled. 12:06:05 Stack Trace: 12:06:05 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 12:06:05 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 12:06:05 at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext() 12:06:05 --- End of stack trace from previous location where exception was thrown --- 12:06:05 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 12:06:05 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 12:06:05 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 12:06:05 at System.Net.Http.Functional.Tests.HttpClientHandler_MaxConnectionsPerServer_Test.<GetAsync_MaxLimited_ConcurrentCallsStillSucceed>d__3.MoveNext() 12:06:05 --- End of stack trace from previous location where exception was thrown --- 12:06:05 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 12:06:05 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 12:06:05 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 12:06:05 --- End of stack trace from previous location where exception was thrown --- 12:06:05 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 12:06:05 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 12:06:05 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 12:06:05 --- End of stack trace from previous location where exception was thrown --- 12:06:05 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 12:06:05 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 12:06:05 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 12:06:05 Finished: System.Net.Http.Functional.Tests ``` 27835 area-System.Net Failure in System.Net.Sockets tests Platform Windows.10.Nano.Amd64.Open-Debug-x64 https://mc.dot.net/#/user/saurabh500/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/04164334d136264666f75ffc51b54c1961bc1f16/workItem/System.Net.Sockets.Tests/analysis/xunit/System.Net.Sockets.Tests.OSSupportTest~2FIOControl_SIOCATMARK_Windows_Success at System.Net.Sockets.Tests.OSSupportTest.IOControl_SIOCATMARK_Windows_Success() in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Sockets\tests\FunctionalTests\OSSupport.cs:line 167 Assert.Equal() Failure Expected: 0 Actual: 1 27837 area-Infrastructure Update BuildTools alone While the other jobs are sorted out, bring the new stack dumping goodness. 27838 area-System.Net Avoid timing issue in IOControl_SIOCATMARK tests This test is sending out of band data, and then checking that it has been received immediately. Depending on timing the check may actually be hit before the data is received, so we need to give it some time. When I updated these tests in PR #27583 I didn't consider that sent data wouldn't be received instantaneously. That was taken into consideration in the original tests and mitigated with `SpinWait.SpinUntil`, but after my update that check was in the wrong spot. This fix moves them to the right place. Fixes: #27835, #27717 27839 area-System.Net Add FileStream and int64 overloads to SendPacketsElement See https://github.com/dotnet/corefx/issues/25354 27840 area-System.Text Add a RegexExpression class and method-based regular expression "I made this proposal to C# repo. https://github.com/dotnet/csharplang/issues/1364 It concerns a LinQ syntax for Regular expressions. Apparently it depends on a RegexExpression Class and some extension methods. RgxExpression calass should have some construcors to allow create an instance based on a regex string, or another RgxExpression instance or expression. This will help define repeated expression, and maje use ofregex language. RgxExpression.ToString() will return the regex string. The RgxExpression can be like this: ``` class RgxExpression { public string Expression {get; set;} } ``` The extenstion methods should be like this: ``` RgxExpression Foo (this RgxExpression exp) { RgxExpression exp1 = ........; return Merge(exp.Expression, exp1); } ``` This is how I represent email regex for example: ``` var smalls = Range(""a"", ""z""); var caps = Range(""A"",""Z"") var L = Any(smalls, cap, Digit, ""."", ""_"", ""-"") var W1 = L.Repeat(1); var W2 = L.Repeat(2, 4); var email = Boundary.W1.Constant(""@"").W1.Constant(""."").W2.Boundary; string rgx = email.ToString(); In the discussion it appears that there are some similar work like: https://github.com/sprache/Sprache https://github.com/VerbalExpressions/CSharpVerbalExpressions. The problem is there are 100,000 NuGets and impossible to explore them all! My question is: why don't you embrace this idea and add a method-based regular expression, to make it easy for programmers to understand and use? Being a part of the language will make it popular than being an infamous NuGet. By the way: Fast growing NuGets should have an online magazine or something to let us know about. This is a huge fortune but not easy to dig out its treasures. " 27841 area-Meta Lots of duplicate *.cs files in corefx I wrote a small script to detect duplicates and it turns out there lots of such files in the repository When I try to re-use some of the following files in mono I am confused which one to pick Also the script detects files with a very small diff (see second group) Is it intentional? ``` ExternDll.cs: src\System.DirectoryServices\src\System\DirectoryServices\ExternDll.cs src\System.DirectoryServices.AccountManagement\src\System\DirectoryServices\AccountManagement\ExternDll.cs Interop.IOErrors.cs: src\Common\src\CoreLib\Interop\Unix\Interop.IOErrors.cs src\Common\src\Interop\Unix\Interop.IOErrors.cs Interop.Close.cs: src\Common\src\CoreLib\Interop\Unix\System.Native\Interop.Close.cs src\Common\src\Interop\Unix\System.Native\Interop.Close.cs Interop.FLock.cs: src\Common\src\CoreLib\Interop\Unix\System.Native\Interop.FLock.cs src\Common\src\Interop\Unix\System.Native\Interop.FLock.cs Interop.FSync.cs: src\Common\src\CoreLib\Interop\Unix\System.Native\Interop.FSync.cs src\Common\src\Interop\Unix\System.Native\Interop.FSync.cs Interop.FTruncate.cs: src\Common\src\CoreLib\Interop\Unix\System.Native\Interop.FTruncate.cs src\Common\src\Interop\Unix\System.Native\Interop.FTruncate.cs Interop.GetCwd.cs: src\Common\src\CoreLib\Interop\Unix\System.Native\Interop.GetCwd.cs src\Common\src\Interop\Unix\System.Native\Interop.GetCwd.cs Interop.LSeek.cs: src\Common\src\CoreLib\Interop\Unix\System.Native\Interop.LSeek.cs src\Common\src\Interop\Unix\System.Native\Interop.LSeek.cs Interop.MksTemps.cs: src\Common\src\CoreLib\Interop\Unix\System.Native\Interop.MksTemps.cs src\Common\src\Interop\Unix\System.Native\Interop.MksTemps.cs Interop.Open.cs: src\Common\src\CoreLib\Interop\Unix\System.Native\Interop.Open.cs src\Common\src\Interop\Unix\System.Native\Interop.Open.cs Interop.OpenFlags.cs: src\Common\src\CoreLib\Interop\Unix\System.Native\Interop.OpenFlags.cs src\Common\src\Interop\Unix\System.Native\Interop.OpenFlags.cs Interop.PathConf.cs: src\Common\src\CoreLib\Interop\Unix\System.Native\Interop.PathConf.cs src\Common\src\Interop\Unix\System.Native\Interop.PathConf.cs Interop.Permissions.cs: src\Common\src\CoreLib\Interop\Unix\System.Native\Interop.Permissions.cs src\Common\src\Interop\Unix\System.Native\Interop.Permissions.cs Interop.PosixFAdvise.cs: src\Common\src\CoreLib\Interop\Unix\System.Native\Interop.PosixFAdvise.cs src\Common\src\Interop\Unix\System.Native\Interop.PosixFAdvise.cs Interop.ReadLink.cs: src\Common\src\CoreLib\Interop\Unix\System.Native\Interop.ReadLink.cs src\Common\src\Interop\Unix\System.Native\Interop.ReadLink.cs Interop.Stat.cs: src\Common\src\CoreLib\Interop\Unix\System.Native\Interop.Stat.cs src\Common\src\Interop\Unix\System.Native\Interop.Stat.cs Interop.SysLog.cs: src\Common\src\CoreLib\Interop\Unix\System.Native\Interop.SysLog.cs src\Common\src\Interop\Unix\System.Native\Interop.SysLog.cs Interop.Unlink.cs: src\Common\src\CoreLib\Interop\Unix\System.Native\Interop.Unlink.cs src\Common\src\Interop\Unix\System.Native\Interop.Unlink.cs Interop.BOOL.cs: src\Common\src\CoreLib\Interop\Windows\Interop.BOOL.cs src\Common\src\Interop\Windows\Interop.BOOL.cs Interop.CancelIoEx.cs: src\Common\src\CoreLib\Interop\Windows\Kernel32\Interop.CancelIoEx.cs src\Common\src\Interop\Windows\kernel32\Interop.CancelIoEx.cs Interop.CloseHandle.cs: src\Common\src\CoreLib\Interop\Windows\Kernel32\Interop.CloseHandle.cs src\Common\src\Interop\Windows\kernel32\Interop.CloseHandle.cs Interop.FileAttributes.cs: src\Common\src\CoreLib\Interop\Windows\Kernel32\Interop.FileAttributes.cs src\Common\src\Interop\Windows\kernel32\Interop.FileAttributes.cs Interop.FindClose.cs: src\Common\src\CoreLib\Interop\Windows\Kernel32\Interop.FindClose.cs src\Common\src\Interop\Windows\kernel32\Interop.FindClose.cs Interop.FlushFileBuffers.cs: src\Common\src\CoreLib\Interop\Windows\Kernel32\Interop.FlushFileBuffers.cs src\Common\src\Interop\Windows\kernel32\Interop.FlushFileBuffers.cs Interop.ReadFile_SafeHandle_IntPtr.cs: src\Common\src\CoreLib\Interop\Windows\Kernel32\Interop.ReadFile_SafeHandle_IntPtr.cs src\Common\src\Interop\Windows\kernel32\Interop.ReadFile_SafeHandle_IntPtr.cs Interop.ReadFile_SafeHandle_NativeOverlapped.cs: src\Common\src\CoreLib\Interop\Windows\Kernel32\Interop.ReadFile_SafeHandle_NativeOverlapped.cs src\Common\src\Interop\Windows\kernel32\Interop.ReadFile_SafeHandle_NativeOverlapped.cs Interop.SecurityOptions.cs: src\Common\src\CoreLib\Interop\Windows\Kernel32\Interop.SecurityOptions.cs src\Common\src\Interop\Windows\kernel32\Interop.SecurityOptions.cs Interop.SetEndOfFile.cs: src\Common\src\CoreLib\Interop\Windows\Kernel32\Interop.SetEndOfFile.cs src\Common\src\Interop\Windows\kernel32\Interop.SetEndOfFile.cs Interop.SetFilePointerEx.cs: src\Common\src\CoreLib\Interop\Windows\Kernel32\Interop.SetFilePointerEx.cs src\Common\src\Interop\Windows\kernel32\Interop.SetFilePointerEx.cs Interop.WriteFile_SafeHandle_IntPtr.cs: src\Common\src\CoreLib\Interop\Windows\Kernel32\Interop.WriteFile_SafeHandle_IntPtr.cs src\Common\src\Interop\Windows\kernel32\Interop.WriteFile_SafeHandle_IntPtr.cs Interop.WriteFile_SafeHandle_NativeOverlapped.cs: src\Common\src\CoreLib\Interop\Windows\Kernel32\Interop.WriteFile_SafeHandle_NativeOverlapped.cs src\Common\src\Interop\Windows\kernel32\Interop.WriteFile_SafeHandle_NativeOverlapped.cs SafeDirectoryHandle.Unix.cs: src\Common\src\CoreLib\Microsoft\Win32\SafeHandles\SafeDirectoryHandle.Unix.cs src\Common\src\Microsoft\Win32\SafeHandles\SafeDirectoryHandle.Unix.cs ICollectionDebugView.cs: src\Common\src\CoreLib\System\Collections\Generic\ICollectionDebugView.cs src\System.Collections\src\System\Collections\Generic\ICollectionDebugView.cs IDictionaryDebugView.cs: src\Common\src\CoreLib\System\Collections\Generic\IDictionaryDebugView.cs src\System.Collections\src\System\Collections\Generic\IDictionaryDebugView.cs DisableMediaInsertionPrompt.cs: src\Common\src\CoreLib\System\IO\DisableMediaInsertionPrompt.cs src\System.IO.FileSystem\src\System\IO\DisableMediaInsertionPrompt.cs StreamHelpers.CopyValidation.cs: src\Common\src\CoreLib\System\IO\StreamHelpers.CopyValidation.cs src\Common\src\System\IO\StreamHelpers.CopyValidation.cs DeferredDisposableLifetime.cs: src\Common\src\CoreLib\System\Threading\DeferredDisposableLifetime.cs src\System.Threading.Overlapped\src\System\Threading\DeferredDisposableLifetime.cs TaskToApm.cs: src\Common\src\CoreLib\System\Threading\Tasks\TaskToApm.cs src\Common\src\System\Threading\Tasks\TaskToApm.cs NetEventSource.Security.Windows.cs: src\Common\src\System\Net\Security\NetEventSource.Security.Windows.cs src\System.Net.Security\src\System\Net\Security\NetEventSource.Security.Windows.cs DisableParallelization.cs: src\Common\tests\System\Xml\DisableParallelization.cs src\System.Private.Xml\tests\Writers\XmlWriterApi\DisableParallelization.cs AppContext.Switch.cs: src\System.AppContext\tests\AppContext.Switch.cs src\System.Runtime\tests\System\AppContext\AppContext.Switch.cs AppContext.Switch.Validation.cs: src\System.AppContext\tests\AppContext.Switch.Validation.cs src\System.Runtime\tests\System\AppContext\AppContext.Switch.Validation.cs KeyValuePairs.cs: src\System.Collections.NonGeneric\src\System\Collections\KeyValuePairs.cs src\System.Runtime.Extensions\src\System\Collections\KeyValuePairs.cs TimeoutTimer.cs: src\System.Data.Odbc\src\Common\System\Data\ProviderBase\TimeoutTimer.cs src\System.Data.SqlClient\src\System\Data\ProviderBase\TimeoutTimer.cs FakeContextAwareResult.cs: src\System.Net.NameResolution\tests\PalTests\Fakes\FakeContextAwareResult.cs src\System.Net.NameResolution\tests\UnitTests\Fakes\FakeContextAwareResult.cs CollectionDataContractAttribute.cs: src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\CollectionDataContractAttribute.cs src\System.Runtime.Serialization.Primitives\src\System\Runtime\Serialization\CollectionDataContractAttribute.cs ContractNamespaceAttribute.cs: src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\ContractNamespaceAttribute.cs src\System.Runtime.Serialization.Primitives\src\System\Runtime\Serialization\ContractNamespaceAttribute.cs DataContractAttribute.cs: src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\DataContractAttribute.cs src\System.Runtime.Serialization.Primitives\src\System\Runtime\Serialization\DataContractAttribute.cs EnumMemberAttribute.cs: src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\EnumMemberAttribute.cs src\System.Runtime.Serialization.Primitives\src\System\Runtime\Serialization\EnumMemberAttribute.cs AssemblyAttributes.cs: src\Common\tests\System\Diagnostics\RemoteExecutorConsoleApp\AssemblyAttributes.cs src\System.Runtime\tests\TestAssembly\AssemblyAttributes.cs src\System.Runtime.Extensions\tests\AssemblyResolveTests\AssemblyAttributes.cs src\System.Runtime.Extensions\tests\TestApp\AssemblyAttributes.cs src\System.Runtime.Extensions\tests\TestAppOutsideOfTPA\AssemblyAttributes.cs src\System.Runtime.Extensions\tests\VoidMainWithExitCodeApp\AssemblyAttributes.cs GlobalSuppressions.cs: src\System.Collections.Immutable\src\GlobalSuppressions.cs src\System.Text.Encodings.Web\src\Properties\GlobalSuppressions.cs XunitTestAssemblyAtrributes.cs: src\System.Net.Http.WinHttpHandler\tests\FunctionalTests\XunitTestAssemblyAtrributes.cs src\System.Net.Http.WinHttpHandler\tests\UnitTests\XunitTestAssemblyAtrributes.cs Serialization.cs: src\System.Net.Primitives\tests\PalTests\Fakes\Serialization.cs src\System.Net.Primitives\tests\UnitTests\Fakes\Serialization.cs ``` ## The following files have a very small diff: ``` Interop.Errors.cs: src\Common\src\CoreLib\Interop\Unix\Interop.Errors.cs src\Common\src\Interop\Unix\Interop.Errors.cs IPv4AddressHelper.cs: src\System.Net.Primitives\src\System\Net\IPv4AddressHelper.cs src\System.Private.Uri\src\System\IPv4AddressHelper.cs Interop.FormatMessage.cs: src\Common\src\CoreLib\Interop\Windows\Kernel32\Interop.FormatMessage.cs src\Common\src\Interop\Windows\kernel32\Interop.FormatMessage.cs TupleExtensions.cs: src\Common\src\CoreLib\System\TupleExtensions.cs src\System.ValueTuple\src\System\ValueTuple\TupleExtensions.cs DriveNotFoundException.cs: src\Common\src\CoreLib\System\IO\DriveNotFoundException.cs src\System.IO.FileSystem.DriveInfo\src\System\IO\DriveNotFoundException.cs XmlRawWriter.cs: src\Common\src\System\Xml\XmlRawWriter.cs src\System.Private.Xml\src\System\Xml\Core\XmlRawWriter.cs IProducerConsumerCollection.cs: src\System.Collections.Concurrent\src\System\Collections\Concurrent\IProducerConsumerCollection.cs src\System.Threading.Tasks.Dataflow\src\Internal\IProducerConsumerCollection.cs InvalidEnumArgumentException.cs: src\System.ComponentModel.Primitives\src\System\ComponentModel\InvalidEnumArgumentException.cs src\System.Drawing.Common\src\misc\InvalidEnumArgumentException.cs DbConnectionClosed.cs: src\System.Data.Odbc\src\Common\System\Data\ProviderBase\DbConnectionClosed.cs src\System.Data.SqlClient\src\System\Data\ProviderBase\DbConnectionClosed.cs DbConnectionFactory.cs: src\System.Data.Odbc\src\Common\System\Data\ProviderBase\DbConnectionFactory.cs src\System.Data.SqlClient\src\System\Data\ProviderBase\DbConnectionFactory.cs DbConnectionPoolGroup.cs: src\System.Data.Odbc\src\Common\System\Data\ProviderBase\DbConnectionPoolGroup.cs src\System.Data.SqlClient\src\System\Data\ProviderBase\DbConnectionPoolGroup.cs DbMetaDataFactory.cs: src\System.Data.Odbc\src\Common\System\Data\ProviderBase\DbMetaDataFactory.cs src\System.Data.SqlClient\src\System\Data\ProviderBase\DbMetaDataFactory.cs DbReferenceCollection.cs: src\System.Data.Odbc\src\Common\System\Data\ProviderBase\DbReferenceCollection.cs src\System.Data.SqlClient\src\System\Data\ProviderBase\DbReferenceCollection.cs DataMemberAttribute.cs: src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\DataMemberAttribute.cs src\System.Runtime.Serialization.Primitives\src\System\Runtime\Serialization\DataMemberAttribute.cs ``` EDIT by @krwq: Similar issue but needs investigation on exact file list: - [ ] https://github.com/dotnet/corefx/issues/28069 27842 area-Infrastructure Mirror changes from dotnet/coreclr This PR contains mirrored changes from dotnet/coreclr **Please REBASE this PR when merging** 27843 area-System.Security Use ArrayPool for temporary buffers in S.S.C.Primitives "CryptoStream ReadAsync, WriteAsync HashAlgorithm.ComputeHash(Stream) All other usages of ""new byte["" appear to be for returned values. Fixes #16622" 27844 area-System.IO Tests for remove relative segments Coreclr PR :- https://github.com/dotnet/coreclr/pull/16829 Remove Relative Segments have been moved to PathIntenal in the coreclr PR. So this pr contaitns the tests for it 27845 area-System.IO "System.IO.Pipes.Tests.NamedPipeTest_UnixDomainSockets failed with ""System.ArgumentOutOfRangeException""" The tests: System.IO.Pipes.Tests.NamedPipeTest_UnixDomainSockets.NamedPipeClient_Connects_With_UnixDomainSocketEndPointServer System.IO.Pipes.Tests.NamedPipeTest_UnixDomainSockets.NamedPipeServer_Connects_With_UnixDomainSocketEndPointClient failed. Details: https://ci.dot.net/job/dotnet_corefx/job/master/job/osx10.12_debug/53/testReport/ Failed configuration: OSX 10.12_debug ~~~ MESSAGE: System.ArgumentOutOfRangeException : The path '/Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_debug/tempHome/pipe-tests-corefx-tvskgzdu.r1u' is of an invalid length for use with domain sockets on this platform. The length must be between 1 and 104 characters, inclusive.\nParameter name: path\nActual value was /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_debug/tempHome/pipe-tests-corefx-tvskgzdu.r1u. STACK TRACE: at System.Net.Sockets.UnixDomainSocketEndPoint..ctor(String path) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_debug/src/System.Net.Sockets/src/System/Net/Sockets/UnixDomainSocketEndPoint.cs:line 56 at System.IO.Pipes.Tests.NamedPipeTest_UnixDomainSockets.NamedPipeClient_Connects_With_UnixDomainSocketEndPointServer() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_debug/src/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.UnixDomainSockets.cs:line 37 --- End of stack trace from previous location where exception was thrown --- ~~~ 27846 area-System.Net [Win7] Test failure: System.Net.WebSockets.Client.Tests.ClientWebSocketOptionsTests / ClientCertificates_ValidCertificate_ServerReceivesCertificateAndConnectAsyncSucceeds ## Type of failure ``` Assert.NotNull() Failure at System.Net.WebSockets.Client.Tests.ClientWebSocketOptionsTests.<>c__DisplayClass8_0.<<ClientCertificates_ValidCertificate_ServerReceivesCertificateAndConnectAsyncSucceeds>b__3>d.MoveNext() in E:\A\_work\63\s\corefx\src\System.Net.WebSockets.Client\tests\ClientWebSocketOptionsTests.cs:line 104 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.AcceptConnectionAsync(Func`2 funcAsync) in E:\A\_work\63\s\corefx\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 117 at System.Net.Test.Common.LoopbackServer.<>c__DisplayClass11_0.<<CreateClientAndServerAsync>b__0>d.MoveNext() in E:\A\_work\63\s\corefx\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 84 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.CreateServerAsync(Func`2 funcAsync, Options options) in E:\A\_work\63\s\corefx\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 67 at System.Net.WebSockets.Client.Tests.ClientWebSocketOptionsTests.ClientCertificates_ValidCertificate_ServerReceivesCertificateAndConnectAsyncSucceeds() in E:\A\_work\63\s\corefx\src\System.Net.WebSockets.Client\tests\ClientWebSocketOptionsTests.cs:line 89 --- End of stack trace from previous location where exception was thrown --- ``` ## History of failure Day | Build | Details -- | -- | -- 3/7 | 20180307.03 | 2x 3/7 | 20180307.04 | 2x 3/7 | 20180307.06 | 2x 3/8 | 20180308.01 | 2x 3/8 | 20180308.02 | 2x 3/8 | 20180308.06 | 2x 3/8 | 20180308.09 | 2x 3/10 | 20180310.01 | 2x 3/10 | 20180310.02 | 2x 3/11 | 20180311.01 | 2x 3/11 | 20180311.02 | 2x 3/12 | 20180312.01 | 2x 3/12 | 20180312.02 | 2x 3/13 | 20180313.01 | 2x 3/13 | 20180313.03 | 2x 3/14 | 20180314.01 | 2x 27847 area-System.IO Test failure: System.IO.Tests.PathTests/GetTempFileName Opened on behalf of @Sunny-pu The test `System.IO.Tests.PathTests/GetTempFileName` has failed. System.IO.FileNotFoundException : Unable to find the specified file. Stack Trace: at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) in /Users/buildagent/agent/_work/20/s/src/mscorlib/shared/Interop/Unix/Interop.IOErrors.cs:line 23 at Interop.CheckIo(Int64 result, String path, Boolean isDirectory, Func`2 errorRewriter) in /Users/buildagent/agent/_work/20/s/src/mscorlib/shared/Interop/Unix/Interop.IOErrors.cs:line 50 at System.IO.Path.GetTempFileName() in /Users/buildagent/agent/_work/20/s/src/mscorlib/shared/System/IO/Path.Unix.cs:line 99 at System.IO.Tests.PathTests.GetTempFileName() in /Users/buildagent/agent/_work/391/s/corefx/src/System.Runtime.Extensions/tests/System/IO/PathTests.cs:line 174 Build : Master - 20180308.02 (Core Tests) Failing configurations: - OSX.1013.Amd64-x64 - Release Details: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180308.02/workItem/System.Runtime.Extensions.Tests/analysis/xunit/System.IO.Tests.PathTests~2FGetTempFileName 27849 area-System.Data DBConnectionStringBuilder doesn't correctly serialize empty strings "`DBConnectionStringBuilder` serializes empty strings as `""key=""` instead of `""key=''""` (or `""key=\""\""""`). This is incorrect as this is the syntax to _remove_ a key from a connection string (e.g. `""key=foo;key=""` will parse as an empty connection string). Demo code: ```csharp var builder = new DbConnectionStringBuilder(); builder.ConnectionString = ""empty=''""; Console.WriteLine(builder.ContainsKey(""empty"")); // true Console.WriteLine(builder.ConnectionString); // prints ""empty="" // re-parse the conn string builder.ConnectionString = builder.ConnectionString; Console.WriteLine(builder.ContainsKey(""empty"")); // false Console.WriteLine(builder.ConnectionString); // prints """" (empty string) ``` Expected outputs when this is fixed would be that the last 2 outputs are the same as the first 2 outputs." 27854 area-System.Runtime If an IAsyncResourceFilter provides a result value by setting the Result property of ResourceExecutingContext to a non-null value, then it cannot call the next filter by invoking ResourceExecutionDelegate. "@ranouf commented on [Tue Mar 06 2018](https://github.com/dotnet/core/issues/1324) Hi, I have this TypeFilterAttribute: ``` [AttributeUsage(AttributeTargets.All, AllowMultiple = false)] public class ApiKeysRequirementAttribute : TypeFilterAttribute { public ApiKeysRequirementAttribute( ) : base(typeof(ApiKeysRequirementAttributeImplentation)) { } [AttributeUsage(AttributeTargets.All, AllowMultiple = false)] private class ApiKeysRequirementAttributeImplentation : Attribute, IAsyncResourceFilter { private readonly bool _showDebugInfo; public ApiKeysRequirementAttributeImplentation(IOptions<ShowDebugInfoAppSettings> settings) { _showDebugInfo = settings.Value.ShowDebugInfo ?? false; } public async Task OnResourceExecutionAsync(ResourceExecutingContext context, ResourceExecutionDelegate next) { IHeaderDictionary headers = context.HttpContext.Request.Headers; // Version 1.0 API if (headers[Constants.ApiVersionKey] != Constants.ApiV1VersionValue || headers[Constants.ApiTokenKey] != Constants.ApiV1TokenValue) { context.Result = new ContentResult { Content = _showDebugInfo ? ""Details"" : ""No details"", StatusCode = (int)HttpStatusCode.Unauthorized }; return; //await context.Result.ExecuteResultAsync(context); } await next(); } } } ``` When I look in Application Insight I have this Exception Message: **System.InvalidOperationException** **If an IAsyncResourceFilter provides a result value by setting the Result property of ResourceExecutingContext to a non-null value, then it cannot call the next filter by invoking ResourceExecutionDelegate.** I looked for this message on Google, I found this: http://www.bvbcode.com/code/8350qcyv-2741116 I expected to see ""Details"" or ""No Details"" as Exception Message. I have Exception Filter too, is there a conflict with the TypeFilterAttribute? I dont know. ``` [System.AttributeUsage(System.AttributeTargets.All, AllowMultiple = false)] public class ApiExceptionFilter : ExceptionFilterAttribute { private readonly ILogger<ApiExceptionFilter> _logger; public ApiExceptionFilter( ILogger<ApiExceptionFilter> logger) { _logger = logger; } public override void OnException(ExceptionContext context) { var ai = new TelemetryClient(); ai.TrackException(context.Exception); ai.Flush(); var apiError = new ApiError(); var message = context.Exception.GetBaseException().Message; _logger.LogError(new EventId(0), context.Exception, message); // Unhandled errors #if !DEBUG apiError.Message = ""An unhandled error occurred.""; apiError.Detail = null; #else apiError.Message = message; apiError.Detail = context.Exception.StackTrace; #endif context.HttpContext.Response.StatusCode = 500; // always return a JSON result context.Result = new JsonResult(apiError); base.OnException(context); } } ``` What do you think? " 27855 area-Infrastructure source.dot.net broken It seems .NET Core data got removed. Can't find any .NET Core types. Not sure whom to tag here... cc @danmosemsft @weshaggard 27857 area-System.Data Conditionally execute IntegratedAuthenticationTest Manual tests runs on Linux are failing as the Integrated Security is not setup. This PR modifies IntegratedAuthenticationTest to conditionally execute based on the value of **TEST_INTEGRATEDSECURITY_SETUP** environment variable. 27858 area-System.Data System.Data.SqlClient.ManualTesting.Tests.TvpTest.TestMain fails on Ubuntu due to different regional date format System.Data.SqlClient.ManualTesting.Tests.**TvpTest.TestMain** fails on Ubuntu due to different regional date format. Most of the failures are due to mismatch in the Year format between the expected and the actual value as seen below, opening this issue to keep track. ```bash ** DIFF at line 341 A : Failed Row[0]Col[5] = 1/1/53 12:00:00 AM: Invalid value for this metadata. E : Failed Row[0]Col[5] = 1/1/1753 12:00:00 AM: Invalid value for this metadata. ** DIFF at line 342 A : Failed Row[1]Col[5] = 1/1/53 12:00:00 AM: Invalid value for this metadata. E : Failed Row[1]Col[5] = 1/1/1753 12:00:00 AM: Invalid value for this metadata. ** DIFF at line 343 A : Failed Row[4]Col[5] = 1/1/53 12:00:00 AM: Invalid value for this metadata. E : Failed Row[4]Col[5] = 1/1/1753 12:00:00 AM: Invalid value for this metadata. ** DIFF at line 344 ``` However, there are a couple of more failures apart from mismatch year format which need to be investigated. ```bash ** DIFF at line 640 A : Value => Expected : Actual == 0 : 631139040000000000 E : Value => Expected : Actual == 0 : 0 ** DIFF at line 641 A : Test SqlDataReader TVP [Data Type][EXPECTED ERROR]: VALUE MISMATCH - [Actual = 1/1/01 12:00:00 AM] [Expected = 1/1/01 12:00:00 AM] E : ** DIFF at line 642 A : E : ------------------------------ TestSqlDataReader_TVP_Variant [type: date value:1/1/0001 00:00:00] ------------------------------ ** DIFF at line 643 A : ------------------------------ TestSqlDataReader_TVP_Variant [type: date value:1/1/01 00:00:00] ------------------------------ E : Type => Expected : Actual == System.DateTime : System.DateTime ** DIFF at line 644 A : Type => Expected : Actual == System.DateTime : System.DateTime E : Base Type => Expected : Actual == date : date ** DIFF at line 645 A : Base Type => Expected : Actual == date : date E : Value => Expected : Actual == 0 : 0 ** DIFF at line 646 A : Value => Expected : Actual == 0 : 631139040000000000 E : ** DIFF at line 647 A : Test SqlDataReader TVP [Variant Type][EXPECTED ERROR]: VALUE MISMATCH - [Actual = 1/1/01 12:00:00 AM] [Expected = 1/1/01 12:00:00 AM] E : ------------------------------ TestSimpleDataReader_Type [type: date value:1/1/0001 00:00:00] ------------------------------ ** DIFF at line 648 A : E : Type => Expected : Actual == System.DateTime : System.DateTime ** DIFF at line 649 A : ------------------------------ TestSimpleDataReader_Type [type: date value:1/1/01 00:00:00] ------------------------------ E : Base Type => Expected : Actual == : ** DIFF at line 650 A : Type => Expected : Actual == System.DateTime : System.DateTime E : Value => Expected : Actual == 0 : 0 ** DIFF at line 651 A : Base Type => Expected : Actual == : E : ** DIFF at line 652 A : Value => Expected : Actual == 0 : 631139040000000000 E : ------------------------------ TestSimpleDataReader_Variant [type: date value:1/1/0001 00:00:00] ------------------------------ ** DIFF at line 653 A : Test Simple Data Reader [Data Type][EXPECTED ERROR]: VALUE MISMATCH - [Actual = 1/1/01 12:00:00 AM] [Expected = 1/1/01 12:00:00 AM] E : Type => Expected : Actual == System.DateTime : System.DateTime ** DIFF at line 654 A : E : Base Type => Expected : Actual == date : date ** DIFF at line 655 A : ------------------------------ TestSimpleDataReader_Variant [type: date value:1/1/01 00:00:00] ------------------------------ E : Value => Expected : Actual == 0 : 0 ** DIFF at line 656 A : Type => Expected : Actual == System.DateTime : System.DateTime E : ** DIFF at line 657 A : Base Type => Expected : Actual == date : date E : ------------------------------ SqlBulkCopySqlDataReader_Type [type: date value:1/1/0001 00:00:00] ------------------------------ ** DIFF at line 658 A : Value => Expected : Actual == 0 : 631139040000000000 E : Type => Expected : Actual == System.DateTime : System.DateTime ** DIFF at line 659 A : Test Simple Data Reader [Variant Type][EXPECTED ERROR]: VALUE MISMATCH - [Actual = 1/1/01 12:00:00 AM] [Expected = 1/1/01 12:00:00 AM] E : Base Type => Expected : Actual == : ** DIFF at line 660 A : E : Value => Expected : Actual == 0 : 0 ** DIFF at line 661 A : ------------------------------ SqlBulkCopySqlDataReader_Type [type: date value:1/1/01 00:00:00] ------------------------------ E : ** DIFF at line 662 A : Type => Expected : Actual == System.DateTime : System.DateTime E : ------------------------------ SqlBulkCopySqlDataReader_Variant [type: date value:1/1/0001 00:00:00] ------------------------------ ``` **Complete Log:** [TvpTest.TestMain.log](https://github.com/dotnet/corefx/files/1794092/TvpTest.TestMain.log) **Expected Result:** [Expected_SqlParameterTest_ReleaseMode.log](https://github.com/dotnet/corefx/files/1794059/Expected_SqlParameterTest_ReleaseMode.log) **Actual Result:** [Actual_SqlParameterTest_Ubuntu.log](https://github.com/dotnet/corefx/files/1794060/Actual_SqlParameterTest_Ubuntu.log) 27859 area-System.Memory Optimize MemoryExtensions SequenceEqual for more T's https://github.com/dotnet/corefx/issues/27487 27860 area-System.Data Skip TvpTest.TestMain due to issue 27858 Skip TvpTest.TestMain due to issue #27858 27861 area-System.Net SocketsHttpHandler/CookieContainer does not accept cookies from Twitter, fails request "I tested ASP.NET's Twitter OAuth handler with the new SocketsHttpHandler (dotnet --version: 2.1.300-preview2-008251) and found that the CookieContainer does not accept cookies from Twitter and it fails the request rather than ignoring them. ``` System.Net.CookieException: An error occurred when parsing the Cookie header for Uri 'https://api.twitter.com/oauth/request_token'. ---> System.Net.CookieException: Cookie format error. at System.Net.CookieContainer.CookieCutter(Uri uri, String headerName, String setCookieHeader, Boolean isThrow) --- End of inner exception stack trace --- at System.Net.CookieContainer.CookieCutter(Uri uri, String headerName, String setCookieHeader, Boolean isThrow) at System.Net.CookieContainer.SetCookies(Uri uri, String cookieHeader) at System.Net.Http.CookieHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.AuthenticateAndRedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) at Microsoft.AspNetCore.Authentication.Twitter.TwitterHandler.ObtainRequestTokenAsync(String callBackUri, AuthenticationProperties properties) in d:\github\AspNet\Security\src\Microsoft.AspNetCore.Authentication.Twitter\TwitterHandler.cs:line 197 at Microsoft.AspNetCore.Authentication.Twitter.TwitterHandler.HandleChallengeAsync(AuthenticationProperties properties) in d:\github\AspNet\Security\src\Microsoft.AspNetCore.Authentication.Twitter\TwitterHandler.cs:line 140 at Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.ChallengeAsync(AuthenticationProperties properties) in d:\github\AspNet\Security\src\Microsoft.AspNetCore.Authentication\AuthenticationHandler.cs:line 227 at Microsoft.AspNetCore.Authentication.AuthenticationService.ChallengeAsync(HttpContext context, String scheme, AuthenticationProperties properties) ``` Reference app: https://github.com/aspnet/Security/blob/4e3e8bb109f3d1b3d95f7af4775a386d291c2b96/samples/SocialSample/Startup.cs#L111 The cookies in question are: ``` set-cookie: guest_id=v1%3A151966890829154034; Expires=Sat, 07 Mar 2020 00:28:24 UTC; Path=/; Domain=.twitter.com set-cookie: personalization_id=""v1_Xfcbmc7S2QFG3YSiebMfA==""; Expires=Sat, 07 Mar 2020 00:28:24 UTC; Path=/; Domain=.twitter.com ``` And it appears to be the UTC time zone that causes it to fail. ``` var cookieContainer = new CookieContainer(); cookieContainer.SetCookies(new Uri(""http://example.com""), ""key=value; Expires=Sat, 07 Mar 2020 00:28:24 UTC""); ``` Where GMT works: ``` cookieContainer.SetCookies(new Uri(""http://example.com""), ""key=value; Expires=Sat, 07 Mar 2020 00:28:24 GMT""); ``` If SocketsHttpHandler becomes the default then this behavior will regress new and existing server apps using Twitter logins. Fix: Unreadable cookie values must at a minimum be ignored. They should not fail the request. I recall this is the behavior of .NET HttpClient/HttpWebRequest, and CookieCutter already has an option for this. Workaround, ignore cookies, they're optional for this flow: ``` .AddTwitter(o => { ... o.BackchannelHttpHandler = new HttpClientHandler() { UseCookies = false }; }) ```" 27865 area-System.Net fix SocketsHttpHandler to ignore invalid Set-Cookie Partial fix for #27861 @Tratcher @stephentoub @davidsh 27866 area-System.Net Fix race condition on Unix pooling canceled Socket operations Fixes https://github.com/dotnet/corefx/issues/26452 (or it at least fixes one cause of the symptom; hopefully that's it) cc: @geoffkizer, @wfurt 27870 area-System.Net curl HttpHandler can only do basic auth to proxy "I have proxy setup with supporting only NTLM authentication and I have simple app fetching given URL through the proxy ```c# static async Task fetch2(String uri) { HttpClientHandler handler = new HttpClientHandler(); handler.PreAuthenticate = false; handler.Proxy = new WebProxy(""clrperftst003:3128""); handler.Proxy.Credentials = new NetworkCredential(""foo"", ""bar"", ""corefx""); var client = new HttpClient(handler); var result1 = await client.GetAsync(uri); Console.WriteLine(result1); } ``` This work when running on Windows but always fails on Ubuntu16. It seems like the code always sends Basic auth when credentials are available. When that fails it never tries again with schema supported by the server. Also note, that the PreAuthenticate has no impact so the client will always leak plaintext password. I tested this with server supporting Digest or NTLM and behavior is identical. Failed request/response from c# > GET http://mytest.com/ HTTP/1.1 > Host: mytest.com > Proxy-Authorization: Basic Y29yZWZ4XGZvbzpiYXI= > Accept: */* > Proxy-Connection: Keep-Alive > > HTTP/1.1 407 Proxy Authentication Required > Server: squid/3.5.12 > Mime-Version: 1.0 > Date: Thu, 08 Mar 2018 21:26:30 GMT > Content-Type: text/html;charset=utf-8 > Content-Length: 3566 > X-Squid-Error: ERR_CACHE_ACCESS_DENIED 0 > Vary: Accept-Language > Content-Language: en > Proxy-Authenticate: NTLM > X-Cache: MISS from CLRPERFTST003 > X-Cache-Lookup: NONE from CLRPERFTST003:3128 > Via: 1.1 CLRPERFTST003 (squid/3.5.12) > Connection: keep-alive > On same system, using same setup, curl can work just fine. (the credentials are different but I did not want to leak my test creds via basic auth) > clruser@CLRPERFTST003:~/Downloads/proxy-test/proxy-test$ curl -v --proxy-ntlm http://mytest.com > * Rebuilt URL to: http://mytest.com/ > * Trying 10.194.114.94... > * Connected to clrperftst003 (10.194.114.94) port 3128 (#0) > * Proxy auth using NTLM with user 'corefx\clradmin' > > GET http://mytest.com/ HTTP/1.1 > > Host: mytest.com > > Proxy-Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= > > User-Agent: curl/7.47.0 > > Accept: */* > > Proxy-Connection: Keep-Alive > > > < HTTP/1.1 407 Proxy Authentication Required > < Server: squid/3.5.12 > < Mime-Version: 1.0 > < Date: Thu, 08 Mar 2018 21:30:40 GMT > < Content-Type: text/html;charset=utf-8 > < Content-Length: 3624 > < X-Squid-Error: ERR_CACHE_ACCESS_DENIED 0 > < Vary: Accept-Language > < Content-Language: en > < Proxy-Authenticate: NTLM TlRMTVNTUAACAAAABgAGADgAAAAGgokC34SGakN19rQAAAAAAAAAAIoAigA+AAAABgEAAAAAAA9DT1JFRlgCAAwAQwBPAFIARQBGAFgAAQAaAEMATABSAFAARQBSAEYAVABTAFQAMAAwADMABAAUAGMAbwByAGUAZgB4AC4AbgBlAHQAAwAwAGMAbAByAHAAZQByAGYAdABzAHQAMAAwADMALgBjAG8AcgBlAGYAeAAuAG4AZQB0AAcACAC4FcK0JLfTAQAAAAA= > < X-Cache: MISS from CLRPERFTST003 > < X-Cache-Lookup: NONE from CLRPERFTST003:3128 > < Via: 1.1 CLRPERFTST003 (squid/3.5.12) > < Connection: keep-alive > < > * Ignoring the response-body > * Connection #0 to host clrperftst003 left intact > * Issue another request to this URL: 'http://mytest.com/' > * Found bundle for host mytest.com: 0x5593227ec670 [can pipeline] > * Re-using existing connection! (#0) with proxy clrperftst003 > * Connected to clrperftst003 (10.194.114.94) port 3128 (#0) > * Proxy auth using NTLM with user 'corefx\clradmin' > > GET http://mytest.com/ HTTP/1.1 > > Host: mytest.com > > Proxy-Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAC6ALoAWAAAAAYABgASAQAACAAIABgBAAANAA0AIAEAAAAAAAAAAAAABoKJAjaw4BUrm5vWknDqlbYDMg3LFocJDoCzj8WVcO2Oe84IffaBmcn049UBAQAAAAAAAABAkbQkt9MByxaHCQ6As48AAAAAAgAMAEMATwBSAEUARgBYAAEAGgBDAEwAUgBQAEUAUgBGAFQAUwBUADAAMAAzAAQAFABjAG8AcgBlAGYAeAAuAG4AZQB0AAMAMABjAGwAcgBwAGUAcgBmAHQAcwB0ADAAMAAzAC4AYwBvAHIAZQBmAHgALgBuAGUAdAAHAAgAuBXCtCS30wEAAAAAAAAAAGNvcmVmeGNscmFkbWluQ0xSUEVSRlRTVDAwMw== > > User-Agent: curl/7.47.0 > > Accept: */* > > Proxy-Connection: Keep-Alive > > > < HTTP/1.1 200 OK > < Date: Thu, 08 Mar 2018 21:30:40 GMT > < Server: Apache > < Content-Length: 271 > < Content-Type: text/html; charset=UTF-8 > < X-Cache: MISS from CLRPERFTST003 > < X-Cache-Lookup: MISS from CLRPERFTST003:3128 > < Via: 1.1 CLRPERFTST003 (squid/3.5.12) > < Connection: keep-alive > < > <html> > <head> > <meta name=""robots"" content=""noarchive"" /> > <meta name=""googlebot"" content=""nosnippet"" /> > </head> > <body> > <div align=center> > <h3>Error. Page cannot be displayed. Please contact your service provider for more details. (5)</h3> > </div> > </body> > * Connection #0 to host clrperftst003 left intact " 27871 area-System.Net SocketHttpHandler is failing to parse properly proxy environment variables with special characters. Consider situation like: export all_proxy='corefx\foo:SecretPass#1@clrperftst003:3128' when using curl or curl handler from c# auth to proxy works as expected. However when I switch to SocketHttpHandler, it fails to parse the string because we use Uri parsing function and that does not like the special characters. With that we fail to instantiate HttpEnvironmentProxy and handler attempts direct connections ignoring proxy setting. Also note, that we only split user and password. That may possibly create troubles with certain authentication schemes. Also note, that curl works properly if the string is URL encoded. SocketHTTPHandler also fails in such case. export all_proxy='corefx%5Cfoo:SecretPass%231@clrperftst003:3128' 27872 area-System.Net SocketHttpHandler is failing NTLM authentication to proxy I essentially use example from #27870 When running on Windows using WinHTTPHandler it works just fine. On Linux I did verify my proxy setup using curl directly. Note, that server expects NTLM directly instead of Negotiate/NTLM > HTTP/1.1 407 Proxy Authentication Required > Server: squid/3.5.12 > Mime-Version: 1.0 > Date: Thu, 08 Mar 2018 21:26:30 GMT > Content-Type: text/html;charset=utf-8 > Content-Length: 3566 > X-Squid-Error: ERR_CACHE_ACCESS_DENIED 0 > Vary: Accept-Language > Content-Language: en > Proxy-Authenticate: NTLM > X-Cache: MISS from CLRPERFTST003 > X-Cache-Lookup: NONE from CLRPERFTST003:3128 > Via: 1.1 CLRPERFTST003 (squid/3.5.12) > Connection: keep-alive > On Linux I tried to force NTLM in TryGetValidAuthenticationChallengeForScheme() and CheckIfProxySupportsConnectionAuth() and I got following trace. > System.ComponentModel.Win32Exception (0x80090020): GSSAPI operation failed with error - An invalid status code was supplied (Unknown error). > at System.Net.Security.NegotiateStreamPal.AcquireCredentialsHandle(String package, Boolean isServer, NetworkCredential credential) in /home/clruser/git/corefx/src/Common/src/System/Net/Security/NegotiateStreamPal.Unix.cs:line 313 > at System.Net.NTAuthentication.Initialize(Boolean isServer, String package, NetworkCredential credential, String spn, ContextFlagsPal requestedContextFlags, ChannelBinding channelBinding) in /home/clruser/git/corefx/src/Common/src/System/Net/NTAuthentication.Common.cs:line 127 > at System.Net.NTAuthentication..ctor(Boolean isServer, String package, NetworkCredential credential, String spn, ContextFlagsPal requestedContextFlags, ChannelBinding channelBinding) in /home/clruser/git/corefx/src/Common/src/System/Net/NTAuthentication.Common.cs:line 98 > at System.Net.Http.AuthenticationHelper.SendWithNtAuthAsync(HttpRequestMessage request, Uri authUri, ICredentials credentials, Boolean isProxyAuth, HttpConnection connection, CancellationToken cancellationToken) in /home/clruser/git/corefx/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/AuthenticationHelper.NtAuth.cs:line 57 > at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken) in /home/clruser/git/corefx/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:line 255 That was somewhat surprising as I did not have Kerberos configured and curl works fine. On Windows I did not dig deeper but I don't see any response to initial 407. 27876 area-System.Net SocketHttpHandler does not work with negotiate/kerberos auth on Linux I have setup where Linux machine joined domain (using MIT krb5) > clruser@CLRPERFTST003:$ kinit > Password for clradmin@COREFX.NET: > clruser@CLRPERFTST003:$ klist > Ticket cache: FILE:/tmp/krb5cc_1000 > Default principal: clradmin@COREFX.NET > > Valid starting Expires Service principal > 2018-03-08 14:16:54 2018-03-09 00:16:54 krbtgt/COREFX.NET@COREFX.NET > renew until 2018-03-09 14:16:48 > 2018-03-08 14:37:52 2018-03-09 00:16:54 HTTP/clrperftst003.corefx.net@COREFX.NET > renew until 2018-03-09 14:16:48 > and I verified that curl can get pages using kerberos authentication: > clruser@CLRPERFTST003:~/Downloads/proxy-test/proxy-test$ curl --proxy-nego --proxy-user ':' --proxy CLRperftst003.corefx.net:3128 -v http://mytest.com/ > > GET http://mytest.com/ HTTP/1.1 > > Host: mytest.com > > Proxy-Authorization: Negotiate YIIFgAYGKwYBBQUCoIIFdDCCBXCgJzAlBgkqhkiG9xIBAgIGBSsFAQUCBgkqhkiC9xIBAgIGBisGAQUCBaKCBUMEggU/YIIFOwYJKoZIhvcSAQICAQBuggUqMIIFJqADAgEFoQMCAQ6iBwMFACAAAACjggQlYYIEITCCBB2gAwIBBaEMGwpDT1JFRlguTkVUoiswKaADAgEDoSIwIBsESFRUUBsYY2xycGVyZnRzdDAwMy5jb3JlZngubmV0o4ID2TCCA9WgAwIBF6EDAgEFooIDxwSCA8O5w6rgIY6bddCzO6I+f0Rke4L137Pv44srNrToc/p3/HhYN8FpjS1uVwKywvekT86iedtMwYEo5TuLs2+1IOMJ+pUjChcqNBvUfwiTMWctTOMHnQN/7FzDBJ0UgZ8336lNx7+OSJLx4td5O1kEDGogUqQZI2A2h0TyOcFfvfDoyhPkMzcmc+3k/7ulgmt72EsoJaYRdnr/HKj8wggsktw5A8EQ2jh3NfSkeMD0Wi/tXEu/45yr3klFCD6JiyGjAIDcNpMTRI4awOPpXSet1J2ET+r7ASXfRRV1FDs1PyExQ3+//2SEdPdBxh96/d3a1ddu3j6Lzk0ybJXe2DMjq8fZmo5zAnZ6iQIzBhgUahtbp2ZSR7s/cMGM9zh0VCZbIkvuj+qogV+uLX3o14XwA7GMvwU9/wlw7AtxYXaMI/I1G7KA5kx+psDouFvEujcQZpuFxEx3sm2voCKuzl0Vr9tETaquXTs7lVuJRBnTmQYg0Erhx5GAaN+09WCR2mZs2mu7CcoeHtgamGxJby1P9Kbht7QWVFZZevuhQLjatbEUWmFUomze52NjcBZD6qjUYbYIHLWTYaJOlRqeSTGSvEDqBTVoEi8DimalFOwfVcUlKyrh5DfaBbDH1WLgLhNxM1XrdFkVvdtH9si68yYays5OnputfmJohaxzRNQza2H8SeoEl3maVD/Tx5Yw3ogkRKXsOhmqK8nNa8DgL1jwgVsLMLRmKZgyl/ysRQVL/pqqMOm5ZVOUDTOcGLMXYAOM/F20Kfy+R/We3cPXL+Jaw/eIGd0Lzrwa3ShNFdImzE6LbHBHwL22IcWWmmVR8ocz7jTX9rIg4HY25CH5Zuv+89V+oyUWKN0x28cS/zjRjlAlvNf0qvJPHcHVZawu5wBanWTWv6CBsPRKQ8QYa/hdllOV8MOD4moNk9QUFJhQndANeMvHKymr8umsRkQgD9gKiN0nxMixHv2CSXrPeBcLmxCiDJerSOHDYw4gGEDMQabfnCmBiRPLZg+sPmZycd49DR1tw/6/HaURnXmPGmyUQ91Sw30VTA+9bQRAYOrrYt0HhPJ6KedBE4OM8DevtrZVzDlNL5SYxbaIElktbdU0r8PxZygDiFYw/lnrW+qTEDB2v+MTHyi1ZK1Fxd+CyDmLIWOqfVbda8vE82kSSbVUJ8tXjWMTp2bSUUFqTZ3xkKyC9HC9BEOODmU/asbdccq5TuGsvhQFTHbfEdl1MI9hQ7vTt1/kOTo5WnGmW7EuLqyIF2yjnjaMnJ1vuLSTN9FsrCHi4+6kgecwgeSgAwIBF6KB3ASB2UEZTU8g7XMA+3tQprxJN7N1Uy80i7fKDpqbnsMUpFj8iQ2go03qzdh/XZQVZKN5bqfSeOVqc3dSHfkyZ+6s+tkDt0hl0KNxGn7AUulUA9LKeGt/ZCQIomooqIbenuq5ioYxpnUJL40pW8HGx6U+NGwHNF+zq5xXenSePW5xXZjhXcOPoJJSbl4e93dD8WWKu7E3gWpoGfOZvIjtTMIXI4e1SpaImE2auRvqqFEBvzx2+7TrSiJL7TurvOM9H6d+y52wFvcz2g9WL827H1O4K0apqtddyNofK70= > > User-Agent: curl/7.47.0 > > Accept: */* > > Proxy-Connection: Keep-Alive > > > < HTTP/1.1 200 OK > < Date: Thu, 08 Mar 2018 22:47:54 GMT > < Server: Apache > < Content-Length: 272 > < Content-Type: text/html; charset=UTF-8 > < X-Cache: MISS from CLRPERFTST003 > < X-Cache-Lookup: MISS from CLRPERFTST003:3128 > < Via: 1.1 CLRPERFTST003 (squid/3.5.12) > < Connection: keep-alive > When I try simple HTTP client app (#27870) , I get following error. I also try it without explicit credentials and handler.UseDefaultCredentials = true and that simply return 407. It is not clear to me what exactly we expect but With UseDefaultCredential I would expect we pick up Default principal. > System.ComponentModel.Win32Exception (0x80090020): GSSAPI operation failed with error - An invalid status code was supplied (Principal in credential cache does not match desired name). > at System.Net.Security.NegotiateStreamPal.AcquireCredentialsHandle(String package, Boolean isServer, NetworkCredential credential) in /home/clruser/git/corefx/src/Common/src/System/Net/Security/NegotiateStreamPal.Unix.cs:line 313 > at System.Net.NTAuthentication.Initialize(Boolean isServer, String package, NetworkCredential credential, String spn, ContextFlagsPal requestedContextFlags, ChannelBinding channelBinding) in /home/clruser/git/corefx/src/Common/src/System/Net/NTAuthentication.Common.cs:line 127 > at System.Net.NTAuthentication..ctor(Boolean isServer, String package, NetworkCredential credential, String spn, ContextFlagsPal requestedContextFlags, ChannelBinding channelBinding) in /home/clruser/git/corefx/src/Common/src/System/Net/NTAuthentication.Common.cs:line 98 > at System.Net.Http.AuthenticationHelper.SendWithNtAuthAsync(HttpRequestMessage request, Uri authUri, ICredentials credentials, Boolean isProxyAuth, HttpConnection connection, CancellationToken cancellationToken) in /home/clruser/git/corefx/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/AuthenticationHelper.NtAuth.cs:line 57 > at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken) in /home/clruser/git/corefx/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:line 255 > at System.Net.Http.AuthenticationHelper.SendWithAuthAsync(HttpRequestMessage request, Uri authUri, ICredentials credentials, Boolean preAuthenticate, Boolean isProxyAuth, Boolean doRequestAuth, HttpConnectionPool pool, CancellationToken cancellationToken) in /home/clruser/git/corefx/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/AuthenticationHelper.cs:line 192 > at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) in /home/clruser/git/corefx/src/System.Net.Http/src/System/Net/Http/HttpClient.cs:line 469 > at proxy_test.Program.fetch2(String uri) in /home/clruser/Downloads/proxy-test/proxy- 27877 area-System.Net Unobserved task exception thrown with new SocketsHttpHandler ``` OnUnobservedTaskException() System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. (Unable to read data from the transport connection: Operation canceled.) ---> System.IO.IOException: Unable to read data from the transport connection: Operation canceled. ---> System.Net.Sockets.SocketException: Operation canceled --- End of inner exception stack trace --- at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error) at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.GetResult(Int16 token) at System.Net.Security.SslStreamInternal.<FillBufferAsync>g__InternalFillBufferAsync|38_0[TReadAdapter](TReadAdapter adap, ValueTask`1 task, Int32 min, Int32 initial) at System.Net.Security.SslStreamInternal.ReadAsyncInternal[TReadAdapter](TReadAdapter adapter, Memory`1 buffer) --- End of inner exception stack trace --- ---> (Inner Exception #0) System.IO.IOException: Unable to read data from the transport connection: Operation canceled. ---> System.Net.Sockets.SocketException: Operation canceled --- End of inner exception stack trace --- at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error) at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.GetResult(Int16 token) at System.Net.Security.SslStreamInternal.<FillBufferAsync>g__InternalFillBufferAsync|38_0[TReadAdapter](TReadAdapter adap, ValueTask`1 task, Int32 min, Int32 initial) at System.Net.Security.SslStreamInternal.ReadAsyncInternal[TReadAdapter](TReadAdapter adapter, Memory`1 buffer)<--- ``` Not a fatal error but it should not be written to `TaskScheduler.UnobservedTaskException`. Thanks! ``` .NET Core SDK (reflecting any global.json): Version: 2.1.300-preview2-008318 Commit: f29118002c Runtime Environment: OS Name: debian OS Version: OS Platform: Linux RID: debian-x64 Base Path: /opt/dotnet/sdk/2.1.300-preview2-008318/ Host (useful for support): Version: 2.1.0-preview2-26308-01 Commit: dd5407cc77 .NET Core SDKs installed: 2.1.300-preview2-008318 [/opt/dotnet/sdk] .NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.0-preview2-30248 [/opt/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.0-preview2-30248 [/opt/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.0-preview2-26308-01 [/opt/dotnet/shared/Microsoft.NETCore.App] ``` 27878 area-System.Text Investigate generating matching strings for test regexes and adding to testbed The regexes we may port in https://github.com/dotnet/corefx/issues/27618 will exercise our parser but not our runner. Experiment with using REX (https://www.microsoft.com/en-us/research/project/rex-regular-expression-exploration/) to generate interesting strings for each of those interesting patterns. Then preserve some of those strings in the tests - so we have a large body of new positive tests for regex matching. We could also generate negative tests, for example by making small changes to the positive matching strings until they did not match, and preserving those also. Those should continue to not-match. @CyrusNajmabadi @ViktorHofer @maryamariyan 27880 area-System.IO Pipe internal state could be damaged by not observing cancellation Test case: ```diff + [Fact] + public async Task AdvanceBetweenGetResultAndOnCompleted() + { + PipeWriter buffer = Pipe.Writer.WriteEmpty(MaximumSizeHigh); + + ValueTaskAwaiter<FlushResult> awaiter = buffer.FlushAsync().GetAwaiter(); + awaiter.OnCompleted(() => { }); + bool awaiterIsCompleted = awaiter.IsCompleted; + Pipe.Writer.CancelPendingFlush(); + bool awaiterIsCompletedAfterCancel = awaiter.IsCompleted; + + var result = await Pipe.Reader.ReadAsync(); + Pipe.Reader.AdvanceTo(result.Buffer.End); + + Pipe.Writer.WriteEmpty(1); + + var flushTask = buffer.FlushAsync(); + + result = await Pipe.Reader.ReadAsync(); + Pipe.Reader.AdvanceTo(result.Buffer.End); + + Assert.True(flushTask == new ValueTask<FlushResult>(flushTask.Result)); + Assert.False(awaiterIsCompleted); + Assert.True(awaiterIsCompletedAfterCancel); + } ``` 27881 area-Infrastructure Enable reverse APICompat for 1:1 libraries This PR fixes up corefx to correctly work for the new reverse APICompat check added via https://github.com/dotnet/buildtools/pull/1949 to address https://github.com/dotnet/corefx/issues/27639. I fixed a few issues but mostly these are just baseline files being added that I will individually tag owners to investigate. For those owners I tag please have a look at the baseline file and see whether or not those APIs are intentionally not in the reference assembly and if so nothing needs to be done but perhaps add a comment in the baseline file. If they should be in the reference assembly or shouldn't be in the implementation assembly then please file a tracking issue to fix. PTAL @ericstj @jkotas FYI @tmat 27883 area-System.Memory Add back reference to corelib files so they are visible in Visual Studio From https://github.com/dotnet/corefx/pull/27831/files#r173342441 cc @ericstj, @eerhardt, @weshaggard, @KrzysztofCwalina 27884 area-System.Net Leaking System.Net.Http.HttpConnectionPool in WCF web socket tests It seems that the new web sockets implementation is leaking objects by leaving them rooted by the timers. Here is the typical GC root: ~~~ 0:080> !gcroot 0000020209eb6650 HandleTable: 000001fe883215f8 (pinned handle) -> 0000020289ea1038 System.Object[] -> 0000020189ea2988 System.Threading.TimerQueue[] -> 0000020189ea2a88 System.Threading.TimerQueue -> 0000020209eb7b30 System.Threading.TimerQueueTimer ... -> 0000020209eb65a0 System.Threading.TimerQueueTimer -> 0000020209eb6280 System.Net.Http.HttpConnectionPoolManager -> 0000020209eb62c0 System.Collections.Concurrent.ConcurrentDictionary`2[[System.Net.Http.HttpConnectionPoolManager+HttpConnectionKey, System.Net.Http],[System.Net.Http.HttpConnectionPool, System.Net.Http]] -> 0000020209eb6548 System.Collections.Concurrent.ConcurrentDictionary`2+Tables[[System.Net.Http.HttpConnectionPoolManager+HttpConnectionKey, System.Net.Http],[System.Net.Http.HttpConnectionPool, System.Net.Http]] -> 0000020209eb6438 System.Collections.Concurrent.ConcurrentDictionary`2+Node[[System.Net.Http.HttpConnectionPoolManager+HttpConnectionKey, System.Net.Http],[System.Net.Http.HttpConnectionPool, System.Net.Http]][] -> 0000020209eb6700 System.Collections.Concurrent.ConcurrentDictionary`2+Node[[System.Net.Http.HttpConnectionPoolManager+HttpConnectionKey, System.Net.Http],[System.Net.Http.HttpConnectionPool, System.Net.Http]] -> 0000020209eb6650 System.Net.Http.HttpConnectionPool ~~~ The leak is especially fast in stress where we get about 100K leaked pools each 10 minutes of stress run. 27885 area-System.IO Getting error on windows => System.PlatformNotSupportedException: 'System.IO.Ports is currently only supported on Windows.' I have a .net standard 2.0 dll (Drivers.CommunicationLocal) which is referencing SerialPort class. When I try to use this from a .Net 4.6.1 console app or a xUnit (.net core 2.0) on windows 10, I get the following exception. Using it from UWP app works fine. > System.PlatformNotSupportedException: System.IO.Ports is currently only supported on Windows. > at System.IO.Ports.SerialPort..ctor(String portName, Int32 baudRate, Parity parity, Int32 dataBits) > at Drivers.CommunicationLocal.CommunicationLayerSerialPortLocal..ctor(SettingSerialPortLocal settings) in C:\Users\abc\Documents\Visual Studio 2017\Projects\experiment\senna\src\Drivers.CommunicationLocal\CommunicationLayerSerialPortLocal.cs:line 24 I am using nuget package `System.IO.Ports`. 27886 area-System.Net SocketsHttpHandler: fix logic to check for Proxy-support header Currently we're looking for this header when we do proxy auth. This is wrong. We should look for this header when we are trying to do regular auth through a proxy. @davidsh @wfurt @stephentoub Fixes #27872 @wfurt can you test and confirm that this fixes #27872? (Windows only) 27887 area-System.IO Change PipeScheduler.Schedule to be non generic This is forcing kestrel to allocate per call to schedule where it didn't before. We don't need it to be generic since we're always passing an object as state in the fast path. We box today when there's a sync context or execution context. /cc @pakrym @halter73 27890 area-System.IO Reverting the generic scheduler changes - This forces allocations on some implementations of schedulers (in particular kestrel) - We never pass a struct to Schedule Fixes #27887 27892 area-System.Net Socket async callbacks on Windows process the callback's ExecutionContext twice We have logic to capture the ExecutionContext and restore it for callbacks in both the IAsyncResult path and the SocketAsyncEventArgs path. However, on Windows, we are already getting dispatched to the correct ExecutionContext by the Overlapped infrastructure, which on .NET Core always handles the execution context capture and dispatch. On Unix, the equivalent infrastructure in SocketAsyncContext.Unix.cs does not handle ExecutionContext, so it's only being handled once. We should add ExecutionContext capture and dispatch to SocketAsyncContext.Unix.cs and then remove it from the higher layers in the Socket stack. The impact here is small, but every bit helps. 27893 area-System.Net Optimize Socket.GetOrAllocateThreadPoolBoundHandle This method isn't getting inlined, presumably because there's just enough logic here between this call and the call to SafeCloseSocket.GetOrAllocateThreadPoolBoundHandle (which does get inlined) to prevent inlining. We should change the logic to simply do a quick check for whether the handle is not null, and then return it; if null, call out to a separate function that does the demand creation. 27894 area-System.Net Ensure SendAsync token source is disposed when handler throws If HttpClient has a non-infinite timeout set, and/or if a cancelable token is passed in, it creates a token source linked to the pending requests token source and the passed in token, and passes that token into base.SendAsync, which in turn just delegates to the wrapped handler's SendAsync. If that wrapped handler throws an exception synchronously that propagates out of SendAsync, we never end up disposing of the linked token, which will end up leaving a reference to it in both the pending requests token source and the provided token's source. cc: @davidsh, @geoffkizer 27895 area-System.Net Allow Socket.GetOrAllocateThreadPoolBoundHandle to fully inline Fixes https://github.com/dotnet/corefx/issues/27893 cc: @geoffkizer 27896 area-System.ComponentModel Deprecate BackgroundWorker.RunWorkerAsync For me, it is very misleading that `BackgroundWorker.RunWorkerAsync` uses the convention with suffix *Async but doesn't return a Task. Please consider deprecating this method and come with a new methodname. The same applies to `CancelAsync` Fixing it would not be possible because it's a breaking change. Or... deprecate BackgroundWorker completely and come with an (better) alternative. For example one with async/await, cancellationtoken support etc. Would that be `Task.Factory.StartNew` or `Task.Run`? 27897 area-System.Net Add ExecutionContext flowing tests for Socket async operations Contributes to https://github.com/dotnet/corefx/issues/27892 cc: @geoffkizer 27898 area-System.Net Eat exceptions from SocketsHttpHandler's readahead task When SocketsHttpHandler puts a connection back into the pool, it issues a pre-emptive asynchronous read on the transport stream. This enables us to check whether any unexpected data has arrived on the connection, whether the connection has been closed, etc., and without polling (which could be done with a NetworkStream but not well with an SslStream). However, when we dispose of a connection from the pool, this task will potentially end up getting faulted, and while it won't crash the application by default, it will end up invoking the TaskScheduler.UnobservedException event. This commit address this by ensuring that we always observe any exceptions that come from the read ahead task when the connection is disposed of (in the rare case where an HttpConnection is instead left for finalization, the event may still be raised, which is arguably a good thing, as the developer should be disposing responses.) (The alternative would be to stop using the read ahead, and instead poll every time we wanted to know if the connection was still valid. That would mean storing the socket in addition to the stream on the connection, and would mean we might miss some errant data that was already pulled from the socket into an SslStream. It would also mean at least one more syscall for each request, as we'd check whether a connection from the pool was valid. For now I'm sticking with the read ahead.) Fixes https://github.com/dotnet/corefx/issues/27877 cc: @geoffkizer 27901 area-System.Xml Can't open XML "Hello. I'm trying to open XML with this code: `XDocument File = XDocument.Load(FileName); //FileName = ""SomeFile.xml""` Unfortunately I am getting an error ArgumentOutOfRangeException: Index and count must refer to a location within the string. What am I doing wrong? P.S. Windows 8 ASP.NET Core 2.0 .NET Framework 4.6.1" 27904 area-System.Net Disposing the SocketsHttpHandler does not abort draining sockets Related to drain timeouts: https://github.com/dotnet/corefx/issues/27685. Version 2.1.0-preview2-26225-03. Reference code: https://github.com/aspnet/HttpSysServer/blob/80345b7f8ffd7a2b623d2e449f6854e3037c1ccc/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/ResponseBodyTests.cs#L602-L615 This code gets the response without buffering, disposes it which starts a background drain that blocks without timeout, and then the client/handler is disposed. The already draining socket is not closed when the handler is disposed, and without the proposed timeout in #27685 it may keep the socket alive indefinitely. @stephentoub 27905 area-System.Memory Optimize Span CompareTo for Ordinal See https://github.com/dotnet/corefx/issues/27379 27906 area-System.Net GetResponseAsync_ServerNameNotInDns_ThrowsWebException() test fails with SocketsHttpHandler Expecting `WebExceptionStatus.NameResolutionFailure` get `UnknownError` instead. Call stack for WinHttpHandler: ``` + ex {System.Net.WebException: An error occurred while sending the request. The server name or address could not be resolved ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.WinHttpException: The server name or address could not be resolved at System.Environment.get_StackTrace() in D:\corefx\src\System.Runtime.Extensions\src\System\Environment.cs:line 146 at System.Runtime.ExceptionServices.ExceptionStackTrace.AddCurrentStack(Exception exception) in D:\corefx\src\Common\src\System\Runtime\ExceptionServices\ExceptionStackTrace.cs:line 23 at System.Net.Http.WinHttpException.CreateExceptionUsingError(Int32 error) in D:\corefx\src\Common\src\System\Net\Http\WinHttpException.cs:line 56 at System.Net.Http.WinHttpRequestCallback.OnRequestError(WinHttpRequestState state, WINHTTP_ASYNC_RESULT asyncResult) in D:\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpRequestCallback.cs:line 324 at System.Net.Http.WinHttpRequestCallback.RequestCallback(IntPtr handle, WinHttpRequestState state, UInt32 internetStatus, IntPtr statusInformation, UInt32 statusInformationLength) in D:\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpRequestCallback.cs:line 104 at System.Net.Http.WinHttpRequestCallback.WinHttpCallback(IntPtr handle, IntPtr context, UInt32 internetStatus, IntPtr statusInformation, UInt32 statusInformationLength) in D:\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpRequestCallback.cs:line 47 --- End of stack trace from AddCurrentStack --- at System.Threading.Tasks.RendezvousAwaitable`1.GetResult() in D:\corefx\src\Common\src\System\Threading\Tasks\RendezvousAwaitable.cs:line 62 at System.Net.Http.WinHttpHandler.StartRequest(WinHttpRequestState state) in D:\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 856 --- End of inner exception stack trace --- at System.Net.Http.DiagnosticsHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in D:\corefx\src\System.Net.Http\src\System\Net\Http\DiagnosticsHandler.cs:line 98 at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) in D:\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 501 at System.Net.HttpWebRequest.SendRequest() in D:\corefx\src\System.Net.Requests\src\System\Net\HttpWebRequest.cs:line 1209 at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) in D:\corefx\src\System.Net.Requests\src\System\Net\HttpWebRequest.cs:line 1259 --- End of inner exception stack trace --- at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) in D:\corefx\src\System.Net.Requests\src\System\Net\HttpWebRequest.cs:line 1263 at System.Net.WebRequest.<>c.<GetResponseAsync>b__68_2(IAsyncResult iar) in D:\corefx\src\System.Net.Requests\src\System\Net\WebRequest.cs:line 550 at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization) in E:\A\_work\1045\s\src\mscorlib\src\System\Threading\Tasks\FutureFactory.cs:line 529 --- End of stack trace from previous location where exception was thrown --- at Xunit.Assert.RecordExceptionAsync(Func`1 testCode) in C:\BuildAgent\work\cb37e9acf085d108\src\xunit.assert\Asserts\Record.cs:line 76} System.Net.WebException ex.Status NameResolutionFailure System.Net.WebExceptionStatus ``` Call stack for SocketsHttpHandler: ``` + ex {System.Net.WebException: No such host is known No such host is known ---> System.Net.Http.HttpRequestException: No such host is known ---> System.Net.Sockets.SocketException: No such host is known at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) in D:\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\ConnectHelper.cs:line 78 --- End of inner exception stack trace --- at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) in D:\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\ConnectHelper.cs:line 98 at System.Threading.Tasks.ValueTask`1.get_Result() in E:\A\_work\1045\s\src\mscorlib\shared\System\Threading\Tasks\ValueTask.cs:line 713 at System.Net.Http.HttpConnectionPool.CreateConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) in D:\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnectionPool.cs:line 309 at System.Threading.Tasks.ValueTask`1.get_Result() in E:\A\_work\1045\s\src\mscorlib\shared\System\Threading\Tasks\ValueTask.cs:line 713 at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync(ValueTask`1 creationTask) in D:\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnectionPool.cs:line 450 at System.Threading.Tasks.ValueTask`1.get_Result() in E:\A\_work\1045\s\src\mscorlib\shared\System\Threading\Tasks\ValueTask.cs:line 713 at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken) in D:\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnectionPool.cs:line 243 at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in D:\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\RedirectHandler.cs:line 30 at System.Net.Http.DiagnosticsHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in D:\corefx\src\System.Net.Http\src\System\Net\Http\DiagnosticsHandler.cs:line 98 at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) in D:\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 501 at System.Net.HttpWebRequest.SendRequest() in D:\corefx\src\System.Net.Requests\src\System\Net\HttpWebRequest.cs:line 1209 at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) in D:\corefx\src\System.Net.Requests\src\System\Net\HttpWebRequest.cs:line 1259 --- End of inner exception stack trace --- at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) in D:\corefx\src\System.Net.Requests\src\System\Net\HttpWebRequest.cs:line 1263 at System.Net.WebRequest.<>c.<GetResponseAsync>b__68_2(IAsyncResult iar) in D:\corefx\src\System.Net.Requests\src\System\Net\WebRequest.cs:line 550 at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization) in E:\A\_work\1045\s\src\mscorlib\src\System\Threading\Tasks\FutureFactory.cs:line 529 --- End of stack trace from previous location where exception was thrown --- at Xunit.Assert.RecordExceptionAsync(Func`1 testCode) in C:\BuildAgent\work\cb37e9acf085d108\src\xunit.assert\Asserts\Record.cs:line 76} System.Net.WebException ex.Status UnknownError System.Net.WebExceptionStatus ``` 27907 area-Infrastructure System.Net.Http not the same types for .Net461 when using System.Threading.Tasks.Extensions "Visual Studio: 2017 Project: .Net4.6.1 Package: ```<package id=""System.Threading.Tasks.Extensions"" version=""4.4.0"" targetFramework=""net461"" />``` ### Problem .NET 4.6.1 doesn't see the System.Net.Http as the same types. I get type exceptions or missing method exceptions when trying to call code from System.Net.Http namespace. It seems to fail in many uses of the System.Net.Http namespace. Once particular example, I have an IHttpClient interface and an HttpClientWrapper class to wrap HttpClient and allow for unit test. My unit tests don't work. ### Workaround The csproj is pointing at the Netstandard2.0 version of the dll, which must have some bug that makes the System.Net stuff look like they are different types. ``` <Reference Include=""System.Threading.Tasks.Extensions, Version=4.1.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL""> <HintPath>..\..\packages\System.Threading.Tasks.Extensions.4.4.0\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath> </Reference> ``` Manually edit the project. Change it to point to the portable-net45+win8+wp8+wpa81. ``` <Reference Include=""System.Threading.Tasks.Extensions, Version=4.1.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL""> <HintPath>..\..\packages\System.Threading.Tasks.Extensions.4.4.0\lib\portable-net45+win8+wp8+wpa81\System.Threading.Tasks.Extensions.dll</HintPath> </Reference> ``` ### Expectation I shouldn't have to manually edit my project every time I update System.Threading.Tasks.Extensions in a NuGet package. I expect referenced dlls to work with .Net461. ### Issues 1. Why does netstandard2.0 not work? Why does it thinks the types are different? I have no idea what the cause of this is or how long it would take to fix. 2. Why does the NuGet package install choose netstandard2.0 over portable-net45+win8+wp8+wpa81 when dlls in the netstandard2.0 don't work and dlls int the portable-net45+win8+wp8+wpa81 do work? My guess is precedence or preference. NuGet is coded to prefer netstandard2.0 dlls over dlls in portable-net45+win8+wp8+wpa81. Is that precedence correct? Probably. 3. Since System.Threading.Tasks.Extensions dlls in the netstandard2.0 folder of the NuGet package do not work, why does the NuGet package not have a net45, net461, or such folder that will take precedence of netstandard2.0? Adding a folder for Net461 with dlls that work takes a few minutes. So until the first issue is fixed, can we get an updated NuGet package that properly points net461 projects to working dll? " 27908 area-System.Net SocketsHttpHandler should process idle disconnect from server promptly For idle connections, we have a _readAheadTask we use to determine if the server sent an EOF to close the connection (or other unexpected data). We don't check this until we either pull the connection out of the pool, or timeout the connection. So often there will be a large delay (10s of seconds) between when we receive the EOF and when we actually close the connection on our side. RFC 7230 says the following: ``` To avoid the TCP reset problem, servers typically close a connection in stages. First, the server performs a half-close by closing only the write side of the read/write connection. The server then continues to read from the connection until it receives a corresponding close by the client, or until the server is reasonably certain that its own TCP stack has received the client's acknowledgement of the packet(s) containing the server's last response. Finally, the server fully closes the connection. ``` https://tools.ietf.org/html/rfc7230#section-6.6 In the interest of being a well-behaved client and trying to make it easier for servers to adhere to the above behavior, we should close the connection promptly when we receive a disconnect from the server. (I hit this originally because I was trying to implement the above logic in LoopbackServer for tests, but it cause large delays on a bunch of tests because the client didn't promptly close its connection.) 27909 area-Infrastructure Add gdb and lldb to test machine dockerfiles and enable dump collection We want to run gdb and lldb on dumps created by tests. The experiments in https://github.com/dotnet/corefx/pull/27899#issuecomment-371901222 show that on some machiens (eg Fedora, OpenSuse) apparently dumps are not enabled. On others (eg some Ubuntu and Debian) dumps are enabled but gdb is not present. We also want lldb so we can do more operations on the dumps. So we need to add install of gdb and lldb to all dockerfiles, and enable dumps with ulimit on all of them. 27910 area-System.Net *NOT TO MERGE* Just to force all tests w/ SocketsHttpHandler Just in case something else depends on Http handler, provides a baseline that @caesar1995 can use for #27821 27911 area-System.Runtime Proposals for Intel HW intrinsic API changes for vNext Writing real code with already implemented HW intrinsics provides very good tests for their usability and quality of design. We start to create implementations which immediately provide direct test of quality of available API surface. I would like to propose to discuss issues and possible change proposals using this issue as an umbrella. 27912 area-System.Net HttpClient POST with content is broken on High-Sierra If you make a POST request with content in the body on High-Sierra to a KestrelHttpServer endpoint the request will fail because the default HttpRequest version has changed to 2 and High-Sierra's libcurl handler will try to upgrade to 2 instead of falling back. Run the client and server in the repro project to reproduce the issue https://github.com/BrennanConroy/ReproProject 27914 area-Infrastructure Update Buildtools in 1.1 branch (DO NOT MERGE) CC @dagood 27915 area-Infrastructure Update Buildtools in 1.0 branch (DO NOT MERGE) CC @dagood 27917 area-System.Memory Move MutableDecimal from System.Memory to Common For context - https://github.com/dotnet/corefx/pull/25078#discussion_r150349963 cc @AtsushiKan, @ericstj 27919 area-Infrastructure Update CoreClr, CoreFx, Standard to stable, servicing-26403-03, servicing-26419-02, respectively (release/2.0.0) 27922 area-System.Net SocketsHttpHandler NTLM doesn't work "Version 2.1.0-preview2-26308-01 Negotiate works, NTLM doesn't. It doesn't even make a second request, it returns the first 401. Repro: ``` public static void Main(string[] args) { var serverTask = RunServer(); Console.WriteLine(""Press any key to send request.""); Console.ReadKey(); var clientTask = RunClient(); Task.WaitAll(serverTask, clientTask); } private static async Task RunServer() { var listener = new HttpListener(); listener.Prefixes.Add(""http://localhost:8080/""); listener.AuthenticationSchemes = System.Net.AuthenticationSchemes.Ntlm; listener.Start(); var context = await listener.GetContextAsync(); context.Response.Close(); } private static async Task RunClient() { Environment.SetEnvironmentVariable(""DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER"", ""true""); var handler = new HttpClientHandler(); handler.UseDefaultCredentials = true; var client = new HttpClient(handler); var response = await client.GetAsync(""http://localhost:8080/""); Console.WriteLine(response); } ``` Expected result: 200 OK ``` Press any key to send request. StatusCode: 200, ReasonPhrase: 'OK', Version: 1.1, Content: System.Net.Http.NoWriteNoSeekStreamContent, Headers: { Date: Fri, 09 Mar 2018 23:49:25 GMT Transfer-Encoding: chunked Server: Microsoft-HTTPAPI/2.0 } ``` Actual: 401 Unauthorized ``` Press any key to send request. StatusCode: 401, ReasonPhrase: 'Unauthorized', Version: 1.1, Content: System.Net.Http.HttpConnection+HttpConnectionResponseContent, Headers: { Server: Microsoft-HTTPAPI/2.0 WWW-Authenticate: NTLM [Token] Date: Fri, 09 Mar 2018 23:48:29 GMT Content-Length: 0 } ```" 27923 area-System.IO Test changes for System.IO.FileSystem - Add new tests for more coverage on enumeration - Re-enable tests cc: @Anipik, @danmosemsft, @pjanotti 27924 area-Infrastructure Fix shim APICompat checks to fail build Update baseline files for netcoreapp and uap. Compat issues complaining about class vs delegate and class vs struct are because of a bug in APICompat tool where the implementation is picking the wrong core assembly. It is picking System.Runtime instead of System.Private.CoreLib, there isn't any straight forward way to fix so baselining. fixes https://github.com/dotnet/corefx/issues/26361 cc @danmosemsft @joperezr 27925 area-Infrastructure Updates for ILLink integration. 1. Update ILLink.Tasks version. 2. Embed ILLinkTrim.xml as an assembly resource. The linker knows how to process embedded xml files. This will ensure that the types, methods, and fields specified in ILLinkTrim.xml won't be removed when customers run ILLink on shipped assemblies. 3. Add --skip-unresolved true so that the linker is tolerant to missing assembly references. 4. Remove the option that hard-coded netstandard by name. 5. ClearInitLocals is now exposed as a parameter of ILLInk task. Use it instead of specifying the plugin option in ILLinkArgs. I verified that the set of things removed by the linker didn't change. 27926 area-Infrastructure Try repro crash from #27737 Related to #27737 (Update BuildToold/CoreCLR PR) 27929 area-System.Runtime Add test for logging for Exception passed to Environment.FailFast() https://github.com/dotnet/coreclr/pull/16622 added logging for Exception object passed to ```Environment.FailFast```. This should be test-protected, as per comments in https://github.com/dotnet/coreclr/issues/15203. 27930 area-System.Linq ParallelEnumerable.GroupJoin/Join output ordering (fixes #1155) The current implementations of ParallelEnumerable.GroupJoin and Join do not preserve the order of right(inner) elements. The common implementation, `HashJoinQueryOperatorEnumerator` currently implements a `QueryOperatorEnumerator` with an order key of the same type as the left(outer) query, thus Join operations are unable to take into account the order of the right elements in their output. It also completely ignores the right order key when building a `HashLookup` of the right elements, so order is not preserved for GroupJoins. The proposed changes attempt to leave the cases where the right query is unordered with a relatively similar performance profile while adding ordering (when appropriate) in the cases where the right query is ordered (fixes #1155). Join with an unordered left and ordered right results in unordered output and right ordering is completely ignored. Join with an ordered left and ordered right results in ordered output ordered first by left order key then by right order key. If collisions exist in the ordering of left elements, then the output will likely not be intuitive, as results with the same left element are not guaranteed (and in fact will probably not be) grouped together. (tests **not** added to confirm the ordering of elements with left collisions...) GroupJoin with an unordered left and ordered right also still produce unordered output. However, the enumerables of right elements are ordered. GroupJoin with an ordered left and ordered right will produce results ordered first by the left element order key, then by the least right element order key. An empty grouping of right elements is treated as less than any non-empty grouping. (tests added to confirm the ordering of elements with left collisions) 27931 area-System.IO Start adding alternate data stream tests Also fill out ExampleTests. We couldn't do this before without `\\?\` due to our path validation. cc: @danmosemsft, @pjanotti, @Anipik 27933 area-System.Runtime System.Runtime.Caching using app/web.config problems "Hi, I'm currently trying to port a few things to .netstandard2.0 using `System.Runtime.Caching` and I'm running into problems using the ""old"" configuration system. To reproduce the problems, I created a blank new netcoreapp2.0 console app and added ``` <PackageReference Include=""System.Configuration.ConfigurationManager"" Version=""4.5.0-preview1-26216-02"" /> <PackageReference Include=""System.Runtime.Caching"" Version=""4.5.0-preview1-26216-02"" /> ``` I'm using ``` dotnet --info .NET-Befehlszeilentools (2.1.4) Product Information: Version: 2.1.4 Commit SHA-1 hash: 5e8add2190 Runtime Environment: OS Name: Windows OS Version: 10.0.16299 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\2.1.4\ Microsoft .NET Core Shared Framework Host Version : 2.0.5 Build : 17373eb129b3b05aa18ece963f8795d65ef8ea54 ``` --- 1. **Using app.config from [examples in documentation](https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/runtime/system-runtime-caching-element-cache-settings#example)** *Minor thing:* According to the docs, the section has the attribute `physicalMemoryPercentage`, but it is now `physicalMemoryLimitPercentage`. Is this an error in the documentation or copy&paste issue? ;) ``` <?xml version=""1.0"" encoding=""utf-8"" ?> <configuration> <system.runtime.caching> <memoryCache> <namedCaches> <add name=""default"" cacheMemoryLimitMegabytes=""69"" physicalMemoryLimitPercentage=""42"" pollingInterval=""00:10:00"" /> </namedCaches> </memoryCache> </system.runtime.caching> </configuration> ``` Running ``` static void Main(string[] args) { var cache = MemoryCache.Default; ``` Will throw an exception ``` System.Configuration.ConfigurationErrorsException: 'Configuration system failed to initialize' ``` because the `system.runtime.caching` section is unknown. 2. **Manually adding the missing section group + section** ``` <?xml version=""1.0"" encoding=""utf-8"" ?> <configuration> <configSections> <sectionGroup name=""system.runtime.caching"" type=""System.Runtime.Caching.Configuration.CachingSectionGroup, System.Runtime.Caching""> <section name=""memoryCache"" type=""System.Runtime.Caching.Configuration.MemoryCacheSection, System.Runtime.Caching"" /> </sectionGroup> </configSections> <system.runtime.caching> <memoryCache> <namedCaches> <add name=""default"" cacheMemoryLimitMegabytes=""69"" physicalMemoryLimitPercentage=""42"" pollingInterval=""00:10:00"" /> </namedCaches> </memoryCache> </system.runtime.caching> </configuration> ``` Now, the code works, **but** the settings for ""default"" are not used by `MemoryCache.Default`. Polling interval for example will be the default of 2 minutes. --- Using a named cache and loading it via `var cache = new MemoryCache(""notdefault"");` actually works and uses the custom settings (only if you add the section group/section manually ofc). Is this the intended behavior? Thanks" 27934 area-System.Net Change CurlHandler to only request HTTP/2 over TLS https://github.com/dotnet/corefx/issues/27912 cc: @geoffkizer 27935 area-System.Console Don't dup stdin & stderr as this can break some std io redicection code _From @TheLastRar on March 10, 2018 13:8_ Consider a program that does the follow; Create pipes and dup2 the write fd onto stdin, stderr, Have a thread continually read the pipes until EOF is reached (at which point the thread will terminate). Use coreclr. ... Restore the original stdin, stderr, Close the write fd of pipes, Wait for the pipe reader thread to terminate. As coreclr dups the fd for stdin & stderr, there is still a write fd for the pipe, meaning the read thread will never receive an EOF and the program to hang at the last step. _Copied from original issue: dotnet/coreclr#16880_ 27936 area-System.Net Broken libcurl dependency on openSUSE Tumbleweed @bwalkenhorst commented on [Thu Mar 08 2018](https://github.com/dotnet/core/issues/1327) # Broken libcurl dependency on openSUSE Tumbleweed Trying to install dotnet core on openSUSE Tumbleweed, following the instructions found here, I get the following error message: ``` [20:06|root@schwarzgeraet:~]# zypper in dotnet-sdk-2.0.0 Loading repository data... Reading installed packages... Resolving package dependencies... Problem: nothing provides libcurl needed by dotnet-runtime-2.0.0-2.0.0-1.x86_64 Solution 1: do not install dotnet-sdk-2.0.0-2.0.0-1.x86_64 Solution 2: break dotnet-runtime-2.0.0-2.0.0-1.x86_64 by ignoring some of its dependencies ``` When I ask the package manager about it, I get the following reply: ``` [20:06|root@schwarzgeraet:~]# zypper se libcurl Loading repository data... Reading installed packages... S | Name | Summary | Type ---+---------------------+----------------------------------------+-------- | libcurl-devel | A Tool for Transferring Data from URLs | package | libcurl-devel-32bit | A Tool for Transferring Data from URLs | package i+ | libcurl4 | Version 4 of cURL shared library | package i | libcurl4-32bit | Version 4 of cURL shared library | package ``` So there is a libcurl, it is just called libcurl4. I am not certain who I should blame here. But I hope that updating the dependencies on dotnet will be less work than getting the openSUSE developers to rename the package. --- @omajid commented on [Thu Mar 08 2018](https://github.com/dotnet/core/issues/1327#issuecomment-371599203) Related to https://github.com/dotnet/core-setup/issues/3791 --- @bwalkenhorst commented on [Thu Mar 08 2018](https://github.com/dotnet/core/issues/1327#issuecomment-371609046) FWIW: I tried `Solution 2: break dotnet-runtime-2.0.0-2.0.0-1.x86_64 by ignoring some of its dependencies` I wasn't all that surprised, but it seems to have worked. MonoDevelop still isn't convinced .Net Core 2.0 is actually installed, but when I try to build and run a simple Hello-World project from the command line, it works 27937 area-System.Net SocketsHttpHandler, support for custom endpoint address resolving Hello. I created my first commit to corefx fork / System.Net.Http project with small improvement to SocketsHttpHandler where user can now have more control over endpoint address resolving. For example user can prefer IPv6 resolving over IPv4 version or even write custom logic which completely overrides system DNS resolve. This feature is optional and should be backwards compatible. Please check if this feature could be generally useful :) @stephentoub @geoffkizer @karelz 27938 area-System.IO PipeCompletionCallbacks shouldn't use ArrayPool for callbacks We should make a few optimizations here - There's hardly more than one callback so we can use the track that tasks use for continuations (store it as an object and then detect the case where we have more than one and allocate an array). - We don't need an the array pool here, we should just store state on the pipe itself and reset that state when Reset is called. /cc @pakrym 27939 area-Infrastructure Bootstrapping & lldb package name @janvorli @weshaggard 27941 area-System.Net Promptly close SocketsHttpHandler pooled connection when receiving EOF Fixes https://github.com/dotnet/corefx/issues/27908 cc: @geoffkizer, @davidsh 27945 area-System.IO Add more alternate data stream tests cc: @danmosemsft, @Anipik, @pjanotti 27947 area-System.Memory Does ReadOnlySequence open write access to ReadOnlyMemory? As I see when `ReadOnlySequence` created with `ReadOnlyMemory`, it extract internal object of `ReadOnlyMemory` (`array`, `string` or `OwnedMemory`) and give access to that object throw GetPosition method. So `ReadOnlySequence` opens access to `array` or `OwnedMemory`. But `array` or `OwnedMemory` are not read only objects and they opens write access to `ReadOnlyMemory`. So any code can get write access to `ReadOnlyMemory` (over `array` or `OwnedMemory`) in safe code by using `ReadOnlySequence`. Am I right? And **is it correct API design?** Also I does not understand benefits of using `ReadOnlySequence` that contains only one segment. If your use only one segment you can use `ReadOnlyMemory` or `string` or `OwnedMemory` directly. So I think that all one segment optimizations are usefulness because they drawback performance for `ReadOnlySequence` with few segments. 27948 area-System.Memory Deriving from OwnedMemory "```csharp public sealed class SafeMemoryHandle : SafeHandle { public static SafeMemoryHandle Alloc(UIntPtr size) => VirtualAlloc(IntPtr.Zero, size, 0x3000, 0x04); private SafeMemoryHandle() : base(IntPtr.Zero, true) { } public override bool IsInvalid => handle == IntPtr.Zero; protected override bool ReleaseHandle() => VirtualFree(handle, UIntPtr.Zero, 0x8000) != 0; [DllImport(""Kernel32.dll"")] private static extern SafeMemoryHandle VirtualAlloc(IntPtr address, UIntPtr size, uint allocationType, uint protect); [DllImport(""Kernel32.dll"")] private static extern int VirtualFree(IntPtr address, UIntPtr size, uint freeType); } ``` A SafeHandle like this has [a number of features](https://msdn.microsoft.com/en-us/library/system.runtime.interopservices.safehandle(v=vs.110).aspx#Does): * it has magic P/Invoke support to avoid leaks, * it is thread-safe, * it does reference counting, and * disposing it doesn't release the handle until the reference count reaches 0. Overall, very similar to OwnedMemory. I would assume that a NativeOwnedMemory implementation should do most (all?) of this as well. The question is: Is it envisioned that there will be implementations of OwnedMemory that are not thread-safe, not reference counting, or not delaying release when they are disposed before the reference count reaches 0? If not, shouldn't OwnedMemory provide the implementations for most of its methods and only leave allocation and release to derived classes (like SafeHandle)? Should NativeOwnedMemory wrap a SafeHandle to get those leak preventing features or is it fine to wrap an IntPtr? Should (Native)OwnedMemory derive from CriticalFinalizerObject? " 27949 area-System.Net Option to have more control when resolving endpoint IP address in SocketsHttpHandler I think it may be useful in some cases to have more control over endpoint address resolving. This would be new optional feature in SocketsHttpHandler implementation. Here is my initial idea. ## Proposed API ``` public sealed class SocketsHttpHandler : HttpMessageHandler { //existing members //... //Proposed API public Func<HttpRequestMessage, string, int, CancellationToken, ValueTask<IPEndPoint>> ResolveEndpointAsync {get;set;} } ``` where delegate inputs are: - HttpRequestMessage -> request details - string -> request.RequestUri.IdnHost - int -> request.RequestUri.Port - CancellationToken and delegate output is: - ValueTask\<IPEndPoint\> -> representing resolved IP address based on given input Similar Func<> pattern is used in WinHttpHandler.ServerCertificateValidationCallback ## Example usage ``` socketsHttpHandlerInstance.ResolveEndpointAsync = async delegate (HttpRequestMessage request, string host, int port, CancellationToken cancellationToken) { var addresses = await Dns.GetHostAddressesAsync(host).ConfigureAwait(false); //resolve hostname to IPv6 var address = addresses.Where(addr => addr.AddressFamily == AddressFamily.InterNetworkV6).FirstOrDefault(); return address != null ? new IPEndPoint(address, port) : null; }; ``` ## Main goals - feature is optional and should not change current behaviour in any way - if feature is not used it should not affect existing performance ## Possible use cases - one could implement ResolveEndpointAsync to use Google DNS or other DNS server for resolving addresses, without changing system settings - one could implement ResolveEndpointAsync to use round-robin for resolving IP Addresses - better control over IPv4/IPv6 resolving - could be used in functional testing to resolve test IP addresses Prototype implementation: https://github.com/AppBeat/corefx Very early PR: https://github.com/dotnet/corefx/pull/27937 Kind regards, Vladimir 27951 area-System.Net Segmentation fault on dotnet [name-of-app].dll on Debian @ChristianHaase commented on [Sun Feb 11 2018](https://github.com/dotnet/core/issues/1266) Getting segmentation fault when running the application. Only on HTTP client request sending to external API. The app start fine and I can navigate fine, but whenever I try to login _(calling external API)_, I'm getting the segfault. Same goes for creating a new user, when calling the external API from my MVC backend. Running the app locally, everything works as expected, and I can login fine, as well as creating a new user. I have a try/catch around the enitre method, but I'm never hitting the catch. The segfault happens instead of the catch. # Technical details dotnet --info .NET Command Line Tools (1.0.4) Product Information Version: 1.0.4 Commit SHA-1 hash: afefd Runtime Environment OS Name: debian OS Version: 9 OS Platform: Linux RID: debian.8-x64 Base Path: /opt/dotnet/sdk/1..4 Is there any fancy way for me te debug, or get some kind of log about what's happenening? --- @Petermarcu commented on [Tue Feb 20 2018](https://github.com/dotnet/core/issues/1266#issuecomment-367186826) @leecow is Debian 9 supported by 1.0? --- @leecow commented on [Wed Feb 21 2018](https://github.com/dotnet/core/issues/1266#issuecomment-367401765) No, Debian 9 is 2.0. https://github.com/dotnet/core/blob/master/os-lifecycle-policy.md. --- @ChristianHaase commented on [Wed Feb 21 2018](https://github.com/dotnet/core/issues/1266#issuecomment-367422860) I suppose that would explain some issues, but the application runs fine on the server. It's only remote HTTP request that causes the segfault? --- @wfurt commented on [Wed Feb 21 2018](https://github.com/dotnet/core/issues/1266#issuecomment-367425295) What version of curl and openssl do you have? This may be same as #24891 and #24552 You can try container with supported OS. That should get you around linkage problems. --- @ChristianHaase commented on [Wed Feb 21 2018](https://github.com/dotnet/core/issues/1266#issuecomment-367429887) @wfurt OpenSSL version: `OpenSSL 1.10f 25 May 2017` curl version: `curl 7.52.1 (x86_64-pc-linux-gnu) libcurl/7.52.1 OpenSSL/1.0.2l zlib/1.2.8 libidn2/0.16 libpsl/0.17.0 (+libidn2/0.16) libssh2/1.7.0 nghttp2/1.18.1 librtmp/2.3` I don't know what issues you are referring to (#24891 and #24552)? --- @wfurt commented on [Wed Feb 21 2018](https://github.com/dotnet/core/issues/1266#issuecomment-367433750) oh, the link did not work ;( https://github.com/dotnet/corefx/issues/24552 and https://github.com/dotnet/corefx/issues/24891 --- @ChristianHaase commented on [Wed Feb 21 2018](https://github.com/dotnet/core/issues/1266#issuecomment-367448529) I'm trying to convert my project to .NET core 2.0, and updating the installed version on my server. I will update my progress here once done. Thanks for the inputs. --- @ChristianHaase commented on [Sat Feb 24 2018](https://github.com/dotnet/core/issues/1266#issuecomment-368251675) I updated the project to 2.0, but it's still a problem. I'll take a look at the links you provided @wfurt --- @ChristianHaase commented on [Sat Feb 24 2018](https://github.com/dotnet/core/issues/1266#issuecomment-368252318) I looked at the installed version of libcurl, and this is what I could find:  Anything I can do here? --- @Petermarcu commented on [Sun Mar 11 2018](https://github.com/dotnet/core/issues/1266#issuecomment-372127397) I'm going to move this to the corefx repo where it will be tracked better. 27952 area-System.Runtime "Segmentation fault with NLog on linux-arm, related to ""Recursive resource lookup bug""?" "I had a dotnet core 2.0 app running fine on a Raspberry Pi 2 (running Raspbian) fine for many months, until the sd card gave up, so setup a new card with a fresh install of Raspbian & deployed an upgraded version (still targeting 2.0) with upgrades to the latest NuGet projects suddenly caused it to fail with the following error: >Assert Failure >Expression: [Recursive resource lookup bug] >Description: Infinite recursion during resource lookup within System.Private.CoreLib. This may be a bug in System.Private.CoreLib, or potentially in certain extensibility points such as assembly resolve events or CultureInfo names. Resource name: ArgumentNull_Generic >Stack Trace: > at System.SR.InternalGetResourceString(String key) > at System.SR.GetResourceString(String resourceKey, String defaultString) > at System.ArgumentNullException..ctor(String paramName) > at System.Runtime.Loader.AssemblyLoadContext.GetLoadContext(Assembly assembly) > at System.Reflection.Assembly.LoadFromResolveHandler(Object sender, ResolveEventArgs args) > at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName) > at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks, IntPtr ptrLoadContextBinder) > at System.Reflection.RuntimeAssembly.InternalGetSatelliteAssembly(String name, CultureInfo culture, Version version, Boolean throwOnFileNotFound, StackCrawlMark& stackMark) at System.Resources.ManifestBasedResourceGroveler.GetSatelliteAssembly(CultureInfo lookForCulture, StackCrawlMark& stackMark) at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark) at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark) at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) at System.Resources.ResourceManager.GetString(String name, CultureInfo culture) at System.SR.InternalGetResourceString(String key) at System.SR.GetResourceString(String resourceKey, String defaultString) at System.ArgumentNullException..ctor(String paramName) at System.Runtime.Loader.AssemblyLoadContext.GetLoadContext(Assembly assembly) at System.Reflection.Assembly.LoadFromResolveHandler(Object sender, ResolveEventArgs args) at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName) at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks, IntPtr ptrLoadContextBinder) at System.Reflection.RuntimeAssembly.InternalGetSatelliteAssembly(String name, CultureInfo culture, Version version, Boolean throwOnFileNotFound, StackCrawlMark& stackMark) at System.Resources.ManifestBasedResourceGroveler.GetSatelliteAssembly(CultureInfo lookForCulture, StackCrawlMark& stackMark) at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark) at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark) at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) at System.Resources.ResourceManager.GetString(String name, CultureInfo culture) at System.SR.InternalGetResourceString(String key) at System.SR.GetResourceString(String resourceKey, String defaultString) at System.SR.get_Arg_ArgumentException() at PowerPi.Program.Main(String[] args) in C:\Users\grant\source\repos\PowerPi\PowerPi\Program.cs:line 22 Segmentation fault This sounded rather similar to https://github.com/dotnet/corefx/issues/23608 (just one of many though), and using it's advice I created a new ArgumetnException() in my main to trigger it faster (as seen above in stacktrace). Whittling things down into a standalone repro... I build a new stand alone project, added a NuGet reference to NLog.Extensions.Logging, added a NLog.config to the project which always copies to output directory, with the following contents: ```<?xml version=""1.0"" encoding=""utf-8"" ?> <nlog xmlns=""http://www.nlog-project.org/schemas/NLog.xsd"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""> <targets> <target name=""console"" xsi:type=""Console"" /> </targets> <rules> <logger name=""*"" minlevel=""Info"" writeTo=""console"" /> </rules> </nlog> ``` Then updated the Program.cs file to be the following: ```using NLog; using System; namespace foo1 { class Program { static Logger logger = LogManager.GetLogger(""GoingToCrash""); static void Main(string[] args) { logger.Info(""Hello World!""); new ArgumentException(); logger.Info(""Boom?""); } } } ``` When I build/publish this demo app with: dotnet publish --runtime linux-arm --configuration Release To my Pi2... it fails with the above stacktrace. If I follow the advice of https://github.com/dotnet/corefx/issues/26292 and add the bolded text to the rather simple csproj: ```<Project Sdk=""Microsoft.NET.Sdk""> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>netcoreapp2.0</TargetFramework> </PropertyGroup> *** <PropertyGroup> <RuntimeFrameworkVersion>2.0.5</RuntimeFrameworkVersion> </PropertyGroup>*** <ItemGroup> <PackageReference Include=""NLog.Extensions.Logging"" Version=""1.0.0-rtm-rc7"" /> </ItemGroup> <ItemGroup> <None Update=""NLog.config""> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> </ItemGroup> </Project> ``` There is a slight improvement... it still suffers from a segmentation fault, only you don't see the stack trace. Attached is the rather simplistic repro, which of course works fine on my Windows 10 machine, but fails on Raspbian GNU/Linux 9 (stretch). Build environment details: ```C:\Users\grant\source\repos\foo1>dotnet --info .NET Command Line Tools (2.1.100) Product Information: Version: 2.1.100 Commit SHA-1 hash: b9e74c6520 Runtime Environment: OS Name: Windows OS Version: 10.0.16299 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\2.1.100\ Microsoft .NET Core Shared Framework Host Version : 2.0.5 Build : 17373eb129b3b05aa18ece963f8795d65ef8ea54 ``` [coreclr-segfault-with-nlog-on-linux-arm.zip](https://github.com/dotnet/corefx/files/1800626/coreclr-segfault-with-nlog-on-linux-arm.zip) " 27953 area-System.Net HttpClient: Bunch of UAP tests disabled with closed issue #20010 There are a bunch of HttpClient tests disabled on UAP with a reference to #20010. However, this issue is closed. We should either change the tests to be disabled with a better issue/explanation, or reenable the tests. 27954 area-System.IO Add tests to cover CurrentUserOnly in Unix when users are actually different. Leveraging sudo to run pipe client as a different user and enforcing expected behavior regarding `PipeOptions.CurrentUserOnly` in such scenario. 27955 area-System.IO More FileSystem tests - Fix #27244 validation - Add more enumerable tests Fixes #27244 cc: @danmosemsft, @Anipik, @pjanotti 27958 area-System.Net fix NTLM auth and add some manually enabled tests Fixes #27922 Handling of authContext.IsCompleted was wrong, which would screw up the NTLM handling (but not Negotiate). Add some manual HttpListener-based tests. These can be enabled by changing the LocalHttpListenerTestsEnabled static to true. For now at least, the HttpListeners keep running until tests complete, since it's not easy to determine when all the HttpListener-based tests have run. This is rather hacky, so I'm open to other suggestions on how to enable this... @stephentoub @davidsh @wfurt @Tratcher 27959 area-System.IO Add a test to validate sensitivity on OSX See #26797 cc: @danmosemsft, @pjanotti 27960 area-System.IO Add more tests for NamedPipe under different users on Windows Since we added tests under different users with CurrentUserOnly in mind I am also adding tests that enforce the behavior that was already shipped when the option is not used. This is a complement to #27954. 27961 area-System.IO "The test System.IO.Pipes.Tests.NamedPipeTest_CurrentUserOnly_Unix.Connection_UnderDifferentUsers_BehavesAsExpected failed with ""System.Diagnostics.RemoteExecutorTestBase+RemoteInvokeHandle+RemoteExecutionException : Remote process failed with an unhandled exception. """ Details: https://ci.dot.net/job/dotnet_corefx/job/master/job/outerloop_netcoreapp_centos7.1_release/337/testReport/System.IO.Pipes.Tests/NamedPipeTest_CurrentUserOnly_Unix/Connection_UnderDifferentUsers_BehavesAsExpected_serverPipeOptions__None__clientPipeOptions__CurrentUserOnly_/ ~~~ MESSAGE: System.Diagnostics.RemoteExecutorTestBase+RemoteInvokeHandle+RemoteExecutionException : Remote process failed with an unhandled exception. +++++++++++++++++++ STACK TRACE: Child exception: Xunit.Sdk.ThrowsException: Assert.Throws() Failure Expected: typeof(System.UnauthorizedAccessException) Actual: (No exception was thrown) at System.IO.Pipes.Tests.NamedPipeTest_CurrentUserOnly_Unix.ConnectClientFromRemoteInvoker(String pipeName, String isCurrentUserOnly) in /mnt/resource/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_centos7.1_release/src/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CurrentUserOnly.netcoreapp.Unix.cs:line 57 Child process: System.IO.Pipes.Tests, Version=4.1.1.0, Culture=neutral, PublicKeyToken=9d77cc7ad39b68eb System.IO.Pipes.Tests.NamedPipeTest_CurrentUserOnly_Unix Int32 ConnectClientFromRemoteInvoker(System.String, System.String) Child arguments: /tmp/lriiefdf.zt4, true ~~~ 27962 area-System.Runtime Mutating a read-only struct passed by-ref with S.R.CS.Unsafe The value of the System.Runtime.CompilerServices.Unsafe class is in that it can do safe things that the compiler however cannot verify. For using Unsafe methods safely, it is essential that their semantics are fully understood. Currently, the methods are a bit under-documented. One thing that seems apparently possible is mutating an instance of a read-only struct if that instance is passed by mutable reference: ```csharp public readonly struct Point { private readonly int x; private readonly int y; public static void Move(ref Point point, int dx, int dy) { Unsafe.AsRef(in point.x) += dx; Unsafe.AsRef(in point.y) += dy; } } ``` On a scale from 1 to 10, how evil is that? 27963 area-System.ComponentModel "Test failure: System.ComponentModel.DataAnnotations.Tests.RangeAttributeTests/DotDecimalExtremaAndValuesInvariantParse(type: typeof(double), min: \""1.0\"", max: \""3.0\"", value: \""2.99999999999999\"")" "Opened on behalf of @Sunny-pu The test `System.ComponentModel.DataAnnotations.Tests.RangeAttributeTests/DotDecimalExtremaAndValuesInvariantParse(type: typeof(double), min: \""1.0\"", max: \""3.0\"", value: \""2.99999999999999\"")` has failed. Assert.Throws() Failure\r Expected: typeof(System.ArgumentException)\r Actual: (No exception was thrown) Stack Trace: at System.ComponentModel.DataAnnotations.Tests.RangeAttributeTests.DotDecimalExtremaAndValuesInvariantParse(Type type, String min, String max, String value) Build : Master - 20180312.01 (UWP F5 Tests) Failing configurations: - Windows.10.Amd64.ClientRS3-x64 - Release Details:https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fuwp~2F/build/20180312.01/workItem/System.ComponentModel.Annotations.Tests/analysis/xunit/System.ComponentModel.DataAnnotations.Tests.RangeAttributeTests~2FDotDecimalExtremaAndValuesInvariantParse(type:%20typeof(double),%20min:%20%5C%221.0%5C%22,%20max:%20%5C%223.0%5C%22,%20value:%20%5C%222.99999999999999%5C%22)" 27964 area-System.Net Test failure: System.Net.Http.Functional.Tests.HttpClientHandlerTest/AllowAutoRedirect_True_PostToGetDoesNotSendTE(statusCode: 300) Opened on behalf of @Sunny-pu The test `System.Net.Http.Functional.Tests.HttpClientHandlerTest/AllowAutoRedirect_True_PostToGetDoesNotSendTE(statusCode: 300)` has failed. System.NullReferenceException : Object reference not set to an instance of an object. Stack Trace: at System.Net.Http.Functional.Tests.HttpClientTestBase.CreateHttpClientHandler(Boolean useSocketsHttpHandler) in E:\A\_work\14\s\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientTestBase.cs:line 39 at System.Net.Http.Functional.Tests.HttpClientHandlerTest.AllowAutoRedirect_True_PostToGetDoesNotSendTE(Int32 statusCode) --- End of stack trace from previous location where exception was thrown --- Build : Master - 20180312.01 (UWP F5 Tests) Failing configurations: - Windows.10.Arm64-arm - Release - Windows.10.Amd64.ClientRS3-x64 - Release - Windows.10.Amd64.ClientRS3-x86 - Release Details: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fuwp~2F/build/20180312.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.HttpClientHandlerTest~2FAllowAutoRedirect_True_PostToGetDoesNotSendTE(statusCode:%20300) 27965 area-Serialization Test failure: System.Runtime.Serialization.Xml.Canonicalization.Tests.XmlCanonicalizationTest/C14NWriterNegativeTests Opened on behalf of @Sunny-pu The test `System.Runtime.Serialization.Xml.Canonicalization.Tests.XmlCanonicalizationTest/C14NWriterNegativeTests` has failed. System.TypeInitializationException : A type initializer threw an exception. To determine which type, inspect the InnerException's StackTrace property.\r ---- System.InvalidOperationException : There is an error in XML document (2, 2).\r -------- System.MissingMethodException : Method 'MemoryExtensions.AsSpan<char>(char[], int, int)' from assembly 'System.Memory' was not included in compilation, but was referenced in NameTable.ComputeHash32(char[], int, int). There may have been a missing assembly, or a dependency on a more recent Windows SDK release. Stack Trace: at System.Runtime.CompilerServices.ClassConstructorRunner.EnsureClassConstructorRun$catch$0() in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\CompilerServices\ClassConstructorRunner.cs:line 114 at System.Runtime.CompilerServices.ClassConstructorRunner.CheckStaticClassConstruction(Void* returnValue, StaticClassConstructionContext* pContext) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\CompilerServices\ClassConstructorRunner.cs:line 37 at System.Runtime.Serialization.Xml.Canonicalization.Tests.XmlCanonicalizationTest.CryptoCanonicalizationTest() in E:\A\_work\4\s\corefx\src\System.Runtime.Serialization.Xml\tests\Canonicalization\XmlCanonicalizationTest.cs:line 15732480 at _$ILCT$.$ILT$ReflectionDynamicInvoke$.InvokeRetV(Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean targetIsThisCall) at System.InvokeUtils.CalliIntrinsics.Call(IntPtr dynamicInvokeHelperMethod, Object thisPtrForDynamicInvokeHelperMethod, Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState) at System.InvokeUtils.CallDynamicInvokeMethod(Object thisPtr, IntPtr methodToCall, Object thisPtrDynamicInvokeMethod, IntPtr dynamicInvokeHelperMethod, IntPtr dynamicInvokeHelperGenericDictionary, Object targetMethodOrDelegate, Object[] parameters, BinderBundle binderBundle, Boolean wrapInTargetInvocationException, Boolean invokeMethodHelperIsThisCall, Boolean methodToCallIsThisCall) in CallDynamicInvokeMethod:line 16707566 at System.Runtime.CompilerServices.ClassConstructorRunner.EnsureClassConstructorRun(StaticClassConstructionContext* pContext) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\CompilerServices\ClassConstructorRunner.cs:line 92 at System.Runtime.CompilerServices.ClassConstructorRunner.CheckStaticClassConstruction(Void* returnValue, StaticClassConstructionContext* pContext) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\CompilerServices\ClassConstructorRunner.cs:line 37 at System.Runtime.Serialization.Xml.Canonicalization.Tests.XmlCanonicalizationTest.C14NWriterNegativeTests() in E:\A\_work\4\s\corefx\src\System.Runtime.Serialization.Xml\tests\Canonicalization\XmlCanonicalizationTest.cs:line 15732480 at _$ILCT$.$ILT$ReflectionDynamicInvoke$.InvokeRetV(Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean targetIsThisCall) at System.InvokeUtils.CalliIntrinsics.Call(IntPtr dynamicInvokeHelperMethod, Object thisPtrForDynamicInvokeHelperMethod, Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState) at System.InvokeUtils.CallDynamicInvokeMethod(Object thisPtr, IntPtr methodToCall, Object thisPtrDynamicInvokeMethod, IntPtr dynamicInvokeHelperMethod, IntPtr dynamicInvokeHelperGenericDictionary, Object targetMethodOrDelegate, Object[] parameters, BinderBundle binderBundle, Boolean wrapInTargetInvocationException, Boolean invokeMethodHelperIsThisCall, Boolean methodToCallIsThisCall) in CallDynamicInvokeMethod:line 16707566 ----- Inner Stack Trace ----- at System.Xml.Serialization.XmlSerializer.Deserialize$catch$1() in E:\A\_work\4\s\corefx\src\System.Private.Xml\src\System\Xml\Serialization\XmlSerializer.cs:line 653 at System.Xml.Serialization.XmlSerializer.Deserialize(Stream stream) in E:\A\_work\4\s\corefx\src\System.Private.Xml\src\System\Xml\Serialization\XmlSerializer.cs:line 539 at TestConfigHelper.LoadAllTests(String path) in E:\A\_work\4\s\corefx\src\System.Runtime.Serialization.Xml\tests\Canonicalization\TestConfigHelper.cs:line 31 at System.Runtime.Serialization.Xml.Canonicalization.Tests.XmlCanonicalizationTest..cctor() in E:\A\_work\4\s\corefx\src\System.Runtime.Serialization.Xml\tests\Canonicalization\XmlCanonicalizationTest.cs:line 18 at System.Runtime.CompilerServices.ClassConstructorRunner.EnsureClassConstructorRun(StaticClassConstructionContext* pContext) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\CompilerServices\ClassConstructorRunner.cs:line 91 ----- Inner Stack Trace ----- at System.Xml.NameTable.Add(Char[] key, Int32 start, Int32 len) in E:\A\_work\4\s\corefx\src\System.Private.Xml\src\System\Xml\NameTable.cs:line 103 at System.Xml.XmlTextReaderImpl.ParseElement() in E:\A\_work\4\s\corefx\src\System.Private.Xml\src\System\Xml\Core\XmlTextReaderImpl.cs:line 4417 at System.Xml.XmlTextReaderImpl.ParseDocumentContent() in E:\A\_work\4\s\corefx\src\System.Private.Xml\src\System\Xml\Core\XmlTextReaderImpl.cs:line 4037 at System.Xml.XmlTextReaderImpl.Read() in E:\A\_work\4\s\corefx\src\System.Private.Xml\src\System\Xml\Core\XmlTextReaderImpl.cs:line 1204 at System.Xml.XmlTextReader.Read() in E:\A\_work\4\s\corefx\src\System.Private.Xml\src\System\Xml\Core\XmlTextReader.cs:line 238 at System.Xml.XmlReader.MoveToContent() in E:\A\_work\4\s\corefx\src\System.Private.Xml\src\System\Xml\Core\XmlReader.cs:line 825 at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read6_testcases(String defaultNamespace) in C:\Users\DotNetTestRunner\AppData\Local\Temp\Ilc931199730\xunit.console.netcore.Sg\System.Xml.XmlSerializer.Generated.cs:line 185 at Microsoft.Xml.Serialization.GeneratedAssembly.TestCasesConfigSerializer.Deserialize($XmlSerializationReader reader) in C:\Users\DotNetTestRunner\AppData\Local\Temp\Ilc931199730\xunit.console.netcore.Sg\System.Xml.XmlSerializer.Generated.cs:line 533 at System.Xml.Serialization.XmlSerializer.Deserialize($XmlReader xmlReader, String encodingStyle, $XmlDeserializationEvents events) in E:\A\_work\4\s\corefx\src\System.Private.Xml\src\System\Xml\Serialization\XmlSerializer.cs:line 626 Build : Master - 20180312.01 (UWP ILC Tests) Failing configurations: - Windows.10.Amd64.ClientRS3-x86 - Release - Windows.10.Amd64.ClientRS3-x64 - Release Details: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Filc~2F/build/20180312.01/workItem/Canonicalization.Tests/analysis/xunit/System.Runtime.Serialization.Xml.Canonicalization.Tests.XmlCanonicalizationTest~2FC14NWriterNegativeTests 27967 area-System.Threading Use a cached canceled task in ValueTask When an IValueTaskSource reports it completed due to cancellation by the time we AsTask it, we can use a cached canceled task if a) this is the netstandard build, or b) this is the netcoreapp build and it reported cancellation but threw an exception other than a cancellation exception. We cache the non-generic one in a readonly static, since there's only one of them, but lazily cache the generic one. Fixes https://github.com/dotnet/coreclr/issues/16886 cc: @kouvel 27969 area-Infrastructure AD0001: CSharpAsAndNullCheckDiagnosticAnalyzer throws NRE This is likely something brought by VS but I didn't investigate to be 100% sure. ``` Analyzer 'Microsoft.CodeAnalysis.CSharp.UsePatternMatching.CSharpAsAndNullCheckDiagnosticAnalyzer' threw an exception of type 'System.NullReferenceException' with message 'Object reference not set to an instance of an object.'. System.IO.Pipes.Tests 1 Active Analyzer 'Microsoft.CodeAnalysis.CSharp.UsePatternMatching.CSharpAsAndNullCheckDiagnosticAnalyzer' threw the following exception: 'Exception occurred with following context: Compilation: System.IO.Pipes.Tests SyntaxTree: C:\s\github\pjanotti\corefx\src\System.IO.Pipes\tests\NamedPipeTests\NamedPipeTest.CurrentUserOnly.netcoreapp.Windows.cs SyntaxNode: return; [ReturnStatementSyntax]@[3603..3610) (80,16)-(80,23) System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.CodeAnalysis.CSharp.UsePatternMatching.CSharpAsAndNullCheckDiagnosticAnalyzer.GetLeftmostCondition(SyntaxNode node) at Microsoft.CodeAnalysis.CSharp.UsePatternMatching.CSharpAsAndNullCheckDiagnosticAnalyzer.SyntaxNodeAction(SyntaxNodeAnalysisContext syntaxContext) at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.<>c__43`1.<ExecuteSyntaxNodeAction>b__43_0(ValueTuple`2 data) at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock[TArg](DiagnosticAnalyzer analyzer, Action`1 analyze, TArg argument, Nullable`1 info) ``` 27970 area-System.Net Web Calls failing with error - An error occurred while sending the request. System.Net.Http.CurlException: Failure when receiving data from the peer at System.Net.Http.CurlHandler.ThrowIfCURLEError(CURLcode error) "Getting failures when making web call- ``` System.Net.WebException: An error occurred while sending the request. Failure when receiving data from the peer ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.CurlException: Failure when receiving data from the peer at System.Net.Http.CurlHandler.ThrowIfCURLEError(CURLcode error) at System.Net.Http.CurlHandler.MultiAgent.FinishRequest(StrongToWeakReference`1 easyWrapper, CURLcode messageResult) --- End of inner exception stack trace --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() at System.Net.Http.HttpClient.<FinishSendAsyncUnbuffered>d__59.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() at System.Net.HttpWebRequest.<SendRequest>d__194.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) --- End of inner exception stack trace --- at Company.Platform.Common.WebRequestConnector.<GetHttpResponseAsync>d__5.MoveNext() in /var/lib/jenkins/workspace/mycompany-product-connector-subsystem/code/subsystem/submodule/productsCommon/platform-common/Company.Platform.Common/WebCaller/WebRequestConnector.cs:line 97 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Company.Platform.Common.WebRequestConnector.<SendAsync>d__4.MoveNext() in /var/lib/jenkins/workspace/mycompany-product-connector-subsystem/code/subsystem/submodule/productsCommon/platform-common/Company.Platform.Common/WebCaller/WebRequestConnector.cs:line 81 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Company.Platform.Common.HttpConnectorFilter.<ApplyAsync>d__2.MoveNext() in /var/lib/jenkins/workspace/mycompany-product-connector-subsystem/code/subsystem/submodule/productsCommon/platform-common/Company.Platform.Common/WebCaller/Internal/HttpConnectorFilter.cs:line 19 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Company.Platform.Common.HttpFilter.<ApplyAsync>d__2.MoveNext() in /var/lib/jenkins/workspace/mycompany-product-connector-subsystem/code/subsystem/submodule/productsCommon/platform-common/Company.Platform.Common/WebCaller/Internal/HttpFilter.cs:line 21 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Company.Connector.products.subsystem.Common.WebCaller.ResponseDataExtractorHttpFilter`2.<ApplyAsync>d__2.MoveNext() in /var/lib/jenkins/workspace/mycompany-product-connector-subsystem/code/subsystem/Company.Connector.products.subsystem/Common/WebCaller/ResponseDataExtractorHttpFilter.cs:line 19 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Company.Platform.Common.HttpFilter.<ApplyAsync>d__2.MoveNext() in /var/lib/jenkins/workspace/mycompany-product-connector-subsystem/code/subsystem/submodule/productsCommon/platform-common/Company.Platform.Common/WebCaller/Internal/HttpFilter.cs:line 21 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Company.Connector.products.subsystem.Common.WebCaller.LoggingHttpFilter.<ApplyAsync>d__4.MoveNext() in /var/lib/jenkins/workspace/mycompany-product-connector-subsystem/code/subsystem/Company.Connector.products.subsystem/Common/WebCaller/LoggingHttpFilter.cs:line 39 ``` We are using following code - ```csharp public class WebRequestConnector : IHttpConnector { private readonly IMemoryStreamPool _memoryStreamPool; private static byte[] EmptyPayload = new byte[0]; public WebRequestConnector(IMemoryStreamPool memoryStreamPool = null) { _memoryStreamPool = memoryStreamPool ?? HttpSettings.Default.MemoryPool; } private HttpWebRequest CreateBasicWebRequest(HttpRequest request) { var webRequest = WebRequest.Create(request.Uri) as HttpWebRequest; if (webRequest == null) return null; webRequest.Headers = new WebHeaderCollection(); webRequest.Method = request.Method; webRequest.ContentType = request.ContentType; // webRequest.ProtocolVersion = new Version(request.ProtocolVersion); // webRequest.ServicePoint.Expect100Continue = false; // webRequest.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate; // webRequest.Timeout = (int)request?.TimeOut.Value.TotalMilliseconds; foreach (var header in request.Headers) webRequest.Headers[header.Key] = header.Value; return webRequest; } public async Task<HttpResponse> SendAsync(HttpRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var webRequest = CreateBasicWebRequest(request); if (request.SendRequestBody == true) { Stream compressionStream = null; request.Payload = request.Payload ?? EmptyPayload; using (var requestStream = await webRequest.GetRequestStreamAsync()) { if (request.IsCompressionEnabled == false) await requestStream.WriteAsync(request.Payload, 0, request.Payload.Length, cancellationToken); else { webRequest.Headers[HeaderNames.ContentEncoding] = request.CompressionType.ToString().ToLower(); if (request.CompressionType == CompressionType.Gzip) compressionStream = new GZipStream(requestStream, CompressionMode.Compress, false); else compressionStream = new DeflateStream(requestStream, CompressionMode.Compress, false); using (compressionStream) { await compressionStream.WriteAsync(request.Payload, 0, request.Payload.Length, cancellationToken); } } } } var timeOut = request.TimeOut.Value; var cts = new CancellationTokenSource(timeOut); var token = cts.Token; var responseTask = GetHttpResponseAsync(request, webRequest, token); await Task.WhenAny(responseTask, Task.Delay(timeOut, token)); if (!responseTask.IsCompleted) throw new CommunicationException(""32"", ""A timeout exception occured"", HttpStatusCode.GatewayTimeout); return await responseTask; } private async Task<HttpResponse> GetHttpResponseAsync(HttpRequest request, HttpWebRequest webRequest, CancellationToken cancellationToken = default(CancellationToken)) { HttpWebResponse webResponse; try { webResponse = await webRequest.GetResponseAsync() as HttpWebResponse; } catch (WebException webException) { webResponse = webException.Response as HttpWebResponse; if (webResponse == null) { throw webException; } } using (var responseStream = webResponse.GetResponseStream()) { Stream streamToCopy = responseStream; using (var memoryStream = await CreateStreamAsync()) { var contentEncodingKey = webResponse.Headers.AllKeys.ToList().FirstOrDefault(h => h.ToLower().Equals(""content-encoding"")); if (!string.IsNullOrEmpty(contentEncodingKey)) { Stream decompressStream = null; if (webResponse.Headers[contentEncodingKey].Contains(""gzip"")) decompressStream = new GZipStream(responseStream, CompressionMode.Decompress, false); else if (webResponse.Headers[contentEncodingKey].Contains(""deflate"")) decompressStream = new DeflateStream(responseStream, CompressionMode.Decompress, false); using (decompressStream) { if (decompressStream != null) await decompressStream.CopyToAsync(memoryStream); else await responseStream.CopyToAsync(memoryStream); } } else await responseStream.CopyToAsync(memoryStream); var payload = memoryStream.ToArray(); var response = new HttpResponse(webResponse.StatusCode, payload, request.Settings); WriteHeaders(webResponse?.Headers, response); return response; } } } private void SetTimeOut(CancellationTokenSource cancellationTokenSource, TimeSpan? timeOut) { if (timeOut != null) { cancellationTokenSource.CancelAfter(timeOut.Value); } } private async Task<MemoryStream> CreateStreamAsync() { if (_memoryStreamPool == null) return new MemoryStream(); else return await _memoryStreamPool.GetMemoryStream(); } private void WriteHeaders(WebHeaderCollection headers, HttpResponse response) { if (headers != null) { foreach (var header in headers.AllKeys) response.Headers[header] = headers[header]; } } } ``` Following are the server configuration - OS - Linux 14.02 Framework - dotnet 2.0 Can someone please help me to fix this issue. " 27971 area-System.Net "Getting error ""System.InvalidOperationException: The stream was already consumed. It cannot be read again."" when using Proxy settings to make a request." "I am making an Http request where the body is a stream. I am getting an error ""System.InvalidOperationException: The stream was already consumed. It cannot be read again."" as a response. The stream in the message body has a CanSeek value set to false. While going through the corefx code base I noticed the line of code here (https://github.com/dotnet/corefx/blob/53be85c2fe473fdea8c001e3d9fd81dd478b858e/src/System.Net.Http/src/System/Net/Http/StreamContent.cs#L88) that is responsible for the error response. I didnt encounter this issue in Net45. Why this change in behavior?" 27974 area-System.Data MatchingRefApiCompat issues with System.Data.SqlClient See baseline file https://github.com/dotnet/corefx/blob/master/src/System.Data.SqlClient/src/MatchingRefApiCompatBaseline.txt We should do one of the following: 1. Expose the APIs publicly in the reference assembly 2. Make the APIs in the implementation internal 3. Add a comment to the baseline file why you cannot do either (1) or (2) and keep them baselined. See PR https://github.com/dotnet/corefx/pull/27881/ for extra context. 27975 area-Infrastructure Publish symbols using Microsoft.SymbolUploader.Build.Task package "Added PB_SymbolExpirationInDays (settable at queue time), PB_MsdlSymbolServerPAT, PB_SymwebSymbolServerPAT variables. Added ""msdl"" (publish symbols to public Microsoft server) and ""symweb"" (publish symbols to symweb) variables to PB_PublishType. There was a little cleanup of the build def variable names between publish and symbol publish and between corefx and coreclr. Issue #27343" 27976 area-System.Drawing MatchingRefApiCompat issues with System.Drawing.Common See baseline file https://github.com/dotnet/corefx/blob/master/src/System.Drawing.Common/src/MatchingRefApiCompatBaseline.txt We should do one of the following: 1. Expose the APIs publicly in the reference assembly 2. Make the APIs in the implementation internal 3. Add a comment to the baseline file why you cannot do either (1) or (2) and keep them baselined. See PR https://github.com/dotnet/corefx/pull/27881/ for extra context. 27977 area-Infrastructure Cannot build on ARM (aarch64) "I tried to build corefx from scratch on my aarch64 box running Fedora 27, but I get the following error: ``` [bkeys@localhost corefx]$ ./build.sh release skiptests Installing dotnet cli... Restoring BuildTools version 2.1.0-preview2-02612-01... /home/bkeys/Devel/dotnet/corefx/init-tools.sh: line 144: /home/bkeys/Devel/dotnet/corefx/Tools/dotnetcli/dotnet: cannot execute binary file: Exec format error ERROR: Could not restore build tools correctly. Please check the detailed log that follows. Running: /home/bkeys/Devel/dotnet/corefx/init-tools.sh Installing 'https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.2/dotnet-sdk-2.1.2-linux-x64.tar.gz' to '/home/bkeys/Devel/dotnet/corefx/Tools/dotnetcli/dotnet.tar' Running: /home/bkeys/Devel/dotnet/corefx/Tools/dotnetcli/dotnet restore ""/home/bkeys/Devel/dotnet/corefx/init-tools.msbuild"" --no-cache --packages /home/bkeys/Devel/dotnet/corefx/packages --source https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json /p:BuildToolsPackageVersion=2.1.0-preview2-02612-01 Using RID linux-x64 for BuildTools native tools Initializing BuildTools... chmod: cannot access '/home/bkeys/Devel/dotnet/corefx/packages/microsoft.dotnet.buildtools/2.1.0-preview2-02612-01/lib/init-tools.sh': No such file or directory /home/bkeys/Devel/dotnet/corefx/init-tools.sh: line 165: /home/bkeys/Devel/dotnet/corefx/packages/microsoft.dotnet.buildtools/2.1.0-preview2-02612-01/lib/init-tools.sh: No such file or directory ERROR: An error occurred when trying to initialize the tools. Please check the detailed log that follows. Running: /home/bkeys/Devel/dotnet/corefx/init-tools.sh Installing 'https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.2/dotnet-sdk-2.1.2-linux-x64.tar.gz' to '/home/bkeys/Devel/dotnet/corefx/Tools/dotnetcli/dotnet.tar' Running: /home/bkeys/Devel/dotnet/corefx/Tools/dotnetcli/dotnet restore ""/home/bkeys/Devel/dotnet/corefx/init-tools.msbuild"" --no-cache --packages /home/bkeys/Devel/dotnet/corefx/packages --source https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json /p:BuildToolsPackageVersion=2.1.0-preview2-02612-01 Running: /home/bkeys/Devel/dotnet/corefx/packages/microsoft.dotnet.buildtools/2.1.0-preview2-02612-01/lib/init-tools.sh /home/bkeys/Devel/dotnet/corefx /home/bkeys/Devel/dotnet/corefx/Tools/dotnetcli/dotnet /home/bkeys/Devel/dotnet/corefx/Tools /home/bkeys/Devel/dotnet/corefx/packages ```" 27978 area-System.IO MatchingRefApiCompat issues in System.IO.* See baseline file https://github.com/dotnet/corefx/blob/master/src/System.IO.FileSystem/src/MatchingRefApiCompatBaseline.txt and https://github.com/dotnet/corefx/blob/master/src/System.IO.IsolatedStorage/src/MatchingRefApiCompatBaseline.txt We should do one of the following: 1. Expose the APIs publicly in the reference assembly 2. Make the APIs in the implementation internal 3. Add a comment to the baseline file why you cannot do either (1) or (2) and keep them baselined. See PR https://github.com/dotnet/corefx/pull/27881/ for extra context. 27979 area-System.Net MatchingRefApiCompat issues in System.Net.* See baseline files https://github.com/dotnet/corefx/blob/master/src/System.Net.Requests/src/MatchingRefApiCompatBaseline.txt https://github.com/dotnet/corefx/blob/master/src/System.Net.Http/src/MatchingRefApiCompatBaseline.uap.txt https://github.com/dotnet/corefx/blob/master/src/System.Net.Primitives/src/MatchingRefApiCompatBaseline.uap.txt https://github.com/dotnet/corefx/blob/master/src/System.Net.Primitives/src/MatchingRefApiCompatBaseline.netcoreapp.txt https://github.com/dotnet/corefx/blob/master/src/System.Net.NameResolution/src/MatchingRefApiCompatBaseline.txt We should do one of the following: 1. Expose the APIs publicly in the reference assembly 2. Make the APIs in the implementation internal 3. Add a comment to the baseline file why you cannot do either (1) or (2) and keep them baselined. See PR https://github.com/dotnet/corefx/pull/27881/ for extra context. 27980 area-System.Runtime MatchingRefApiCompat issues in System.Runtime.Caching See baseline file https://github.com/dotnet/corefx/blob/master/src/System.Runtime.Caching/src/MatchingRefApiCompatBaseline.txt We should do one of the following: 1. Expose the APIs publicly in the reference assembly 2. Make the APIs in the implementation internal 3. Add a comment to the baseline file why you cannot do either (1) or (2) and keep them baselined. See PR https://github.com/dotnet/corefx/pull/27881/ for extra context. 27981 area-Serialization MatchingRefApiCompat issues in Serialization libraries See baseline files https://github.com/dotnet/corefx/blob/master/src/System.Xml.XmlSerializer/src/MatchingRefApiCompatBaseline.uap.txt https://github.com/dotnet/corefx/blob/master/src/System.Xml.XmlSerializer/src/MatchingRefApiCompatBaseline.uapaot.txt https://github.com/dotnet/corefx/blob/master/src/System.Xml.XmlSerializer/src/MatchingRefApiCompatBaseline.netcoreapp.txt https://github.com/dotnet/corefx/blob/master/src/System.Runtime.Serialization.Xml/src/MatchingRefApiCompatBaseline.txt https://github.com/dotnet/corefx/blob/master/src/System.Runtime.Serialization.Formatters/src/MatchingRefApiCompatBaseline.txt We should do one of the following: 1. Expose the APIs publicly in the reference assembly 2. Make the APIs in the implementation internal 3. Add a comment to the baseline file why you cannot do either (1) or (2) and keep them baselined. See PR https://github.com/dotnet/corefx/pull/27881/ for extra context. 27982 area-System.Security MatchingRefApiCompat issues in System.Security.Principal.Windows See baseline file https://github.com/dotnet/corefx/blob/master/src/System.Security.Principal.Windows/src/MatchingRefApiCompatBaseline.txt We should do one of the following: 1. Expose the APIs publicly in the reference assembly 2. Make the APIs in the implementation internal 3. Add a comment to the baseline file why you cannot do either (1) or (2) and keep them baselined. See PR https://github.com/dotnet/corefx/pull/27881/ for extra context. 27985 area-System.Memory Add a _malloca-like API Span<T>.Alloc(int length) "(This is distinct from the proposal at https://github.com/dotnet/corefx/issues/26954, which considers a more powerful API that can give the caller specific information about the current stack. The proposal under consideration here is only for a ""[KISS](https://en.wikipedia.org/wiki/KISS_principle)"" API. Both proposals could exist side-by-side depending on the scenario, and in fact this proposal could depend on the more powerful API if we decide that's the right behavior.) As the pattern `Span<T> span = stackalloc T[len];` becomes more commonplace, we're seeing a rise in incorrect usage where developers are piping through untrusted _len_ values, potentially making their applications susceptible to reliability issues or DoS attacks. The __safe__ language construct is `Span<T> span = ((uint)len <= 128 /* or other const */) ? stackalloc T[len] : new T[len];`. We can't rely on our larger developer audience remembering the safe pattern, and even our more knowledgeable advanced developers can forget the check from time to time. Following are concrete proposals from the security team as to how this can be addressed. First, create a utility method `public static Span<T> Span<T>.Alloc(int length)`. This API will `stackalloc` in the current frame if appropriate; otherwise the method will heap-alloc, similar to the CRT's [_malloca](https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/malloca) API. Adding this method and getting the desired runtime behavior would not require compiler changes, but it would require JIT changes. The implementation of the method would default simply to `new T[length]` if _length_ is negative or is too large. Advanced developers who want to pull from an existing array pool as fallback wouldn't use this API; they'd perform the check manually. Second, once the utility method is in place, the compiler should be smart enough to treat `return Span<T>.Alloc(...);` as a compile-time error, just as it does today for `Span<T> span = stackalloc T[...]; return span;`. This _would_ require a compiler change. Third, the developer should be warned when passing a non-constant and non-bounds-checked value into `stackalloc`, and the warning should direct the developer to use `Span<T>.Alloc` instead. The developer should also be warned when using `stackalloc` or `Span<T>.Alloc` in a loop. (We considered warning on recursive method calls, but that really belongs in a different analyzer.) Making this a proper compiler warning is probably a bit too noisy, so it could be a Roslyn code analyzer instead. This wouldn't require a compiler or JIT change; it'd just be a new version of the analyzers package for developers who run it as part of build. Finally, remember that this is a KISS proposal. It's intended for the majority use case for developers who may want to consume `Span`-based APIs but need a bit of a safety net. Advanced developers could still use the other APIs under consideration or perform their own custom checks as appropriate for their applications." 27988 area-System.Net CurlHandler: Remove Transfer-Encoding on redirect from POST to GET This fix removes the TransferEncoding header from a request when it is redirected from POST to GET. I chose to modify the request for the following reasons: 1. It's consistent with the behavior of WinHttpHandler. 2. At this point the header has already been modified by the code linked below. https://github.com/dotnet/corefx/blob/444e6bb7fd274be680fb3bf4b22258821e77ae2c/src/System.Net.Http/src/System/Net/Http/CurlHandler/CurlHandler.cs#L777-L781 I also tagged the locations where the TransferEncoding header is being modified with an issue tracking removal of those modifications. If anyone feels strongly about not modifying the request (despite the above), I think that it is possible. It's just a much more significant rework. Fixes: #27301 27989 area-System.Data Test System.Data.Tests.SqlTypes.SqlDoubleTest.Conversions fails on non english culture The test is failing on [this line](https://github.com/dotnet/corefx/blob/444e6bb7fd274be680fb3bf4b22258821e77ae2c/src/System.Data.Common/tests/System/Data/SqlTypes/SqlDoubleTest.cs#L408) (and I believe [this will be the same](https://github.com/dotnet/corefx/blob/444e6bb7fd274be680fb3bf4b22258821e77ae2c/src/System.Data.Common/tests/System/Data/SqlTypes/SqlDoubleTest.cs#L413)). Failing message is: > Assert.Equal() Failure > Expected: 6.4E+65 > Actual: 6,4E+65 The value is the same, but notice the **difference in decimal separator**. My Windows' culture is Slovak and we have comma as a decimal separator. The method of `SqlDouble.ToString()` and its conversion to `SqlString` is done without specifying the culture, so it uses the system's one, hence the difference. 27990 area-System.Console Console.CursorLeft and CursorTop always returns 0 when used in Shell-in-a-box "[ShellInABox](https://github.com/shellinabox/shellinabox) enables a shell within a browser. Currently [PowerShell Core 6](https://github.com/powershell/powershell) has an experience problem within ShellInABox because Console.CursorLeft and Console.CursorTop always returns 0. Repro: ```bash # using Ubuntu 16.04 sudo apt install shellinabox xdg-open https://localhost:4200 # Should open browser to a shell window dotnet new console -n test ``` replace program.cs with this: ```csharp using System; namespace contest { class Program { static void Main(string[] args) { Console.Clear(); Console.Write(""Hello World!""); Console.Write(""[left:{0}]"", Console.CursorLeft); Console.WriteLine(""Bye!""); Console.Write(""[Top:{0}]"", Console.CursorTop); Console.SetCursorPosition(20,5); Console.Write(""[20,5]""); } } } ``` ```bash dotnet publish dotnet run ``` Expected: ```none Hello World![left:12]Bye! [Top:1] ``` Actual: ```none Hello World![left:0]Bye! [Top:0] ``` Blocking https://github.com/PowerShell/PowerShell/issues/3849" 27992 area-Infrastructure Add auto-updater for Microsoft.SymbolUploader.Build.Task package On the dotnet/versions side, copy the files from https://github.com/dotnet/versions/tree/master/build-info/dotnet/buildtools/master into a new folder, say, `build-info/dotnet/sym-uploader/master/`, then edit the files to correspond to this single package and its version. In dependenices.props: * Look at https://github.com/dotnet/corefx/commit/18f7ad2ddcfd72c3b6473a4a4a0edd6ab5283f1b for `...CurrentRef` and `RemoteDependencyBuildInfo`. The new CurrentRef needs to point to a commit that has the new `build-info` files merged in. * Look at https://github.com/dotnet/corefx/commit/997fa4b6a9edc8f793a88b2c983ca1322b92b4a8#diff-54339bb49aae3cad78638955e8cda9f7 for the `XmlUpdateStep`. (As of writing, the package isn't added yet--see https://github.com/dotnet/corefx/pull/27975.) 27993 area-System.Net Give WebSocket server time to close connection Per RFC 6455, a websocket client should try to let the server close the connection. I also removed some unnecessary passing of cancellation tokens. cc: @geoffkizer, @mconnew, just FYI @anurse 27994 area-System.Net Use shared SocketsHttpHandler for some ClientWebSocket options Currently we're creating a new SocketsHttpHandler for each ClientWebSocket. This change makes it so that if mostly default options are used (namely no credentials, no proxy, no cookies, and no client certificates), we'll use a shared handler instance. cc: @geoffkizer, @davidsh, @pjanotti 27995 area-Infrastructure System.Resources.Reader/Writer packages needs Xamarin support We've added facades for System.Resources.Reader.dll and System.Resources.Writer.dll inbox so we'd like to add the placeholders for the usual Xamarin platforms to those packages. 27996 area-System.Net System.Net.Tests.HttpRequestStreamTests failures with SocketsHttpHandler "These tests only fail on OSX in `HttpListener` if set SocketsHttpHandler as the default handler: [Read_FullLengthAsynchronous_Success(transferEncodingChunked: False, text: \""Non-Empty\"") Read_FullLengthSynchronous_Success(transferEncodingChunked: False, text: \""Non-Empty\"") Read_NotEnoughThenCloseAsynchronous_Success(transferEncodingChunked: False)](https://mc.dot.net/#/user/caesar1995/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/7e55e2a154087633b5f365bb05310e1700e835a4/workItem/System.Net.HttpListener.Tests) [Read_FullLengthAsynchronous_PadBuffer_Success(transferEncodingChunked: False, text: \""Non-Empty\"") Read_FullLengthAsynchronous_Success(transferEncodingChunked: False, text: \""Non-Empty\"") Read_NotEnoughThenCloseAsynchronous_Success(transferEncodingChunked: False) Read_TooMuchAsynchronous_Success(transferEncodingChunked: False) Read_TooMuchSynchronous_Success(transferEncodingChunked: False)](https://mc.dot.net/#/user/pjanotti/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/fc263ec2f48b14a381d2c5ebbbfb75e3163d3891/workItem/System.Net.HttpListener.Tests) These failures cannot be repro-ed consistently." 27998 area-System.IO Add tilde path tests Related to https://github.com/dotnet/coreclr/pull/16901. Also clean up existing test data a bit. Needs https://github.com/dotnet/coreclr/pull/16901 to pass. Marking as no merge for now. cc: @danmosemsft, @pjanotti, @Anipik 28001 area-System.Memory Proposal: Add support for ROS comparison with specified culture ```csharp namespace System { public static partial class MemoryExtensions { public static int CompareTo(this ReadOnlySpan<char> span, ReadOnlySpan<char> value, CultureInfo culture, CompareOptions options); } } ``` ### Rationale While doing some Span optimizations in Regex I noticed that the current comparison extension methods on ROS don't support comparison with a specific culture: `MemoryExtensions.CompareTo(this ReadOnlySpan<char> span, ReadOnlySpan<char> value, StringComparison comparisonType)`. With string I can do that in different ways either by `string.Compare(string, string, CultureInfo, CompareOptions);` or by `StringComparer.Create(CultureInfo, bool ignoreCase).Compare(string, string)`. Is there a specific reason that we excluded a CultureInfo overload in the extension method? cc @tarekgh @ahsonkhan 28002 area-System.Net HttpClientUsesSslCertEnvironmentVariables() test will fail on Linux with SocketsHttpHandler "The [HttpClientUsesSslCertEnvironmentVariables test](https://github.com/dotnet/corefx/blob/eb892471f8691dad65ff47f5b12ddc8d378ae460/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.ServerCertificates.Unix.cs#L79) will fail on Linux with SocketsHttpHandler for these two test data: `[InlineData(false, false, true, true, true)]` `[InlineData(false, false, true, false, true)]` ```diff [Theory] [PlatformSpecific(~TestPlatforms.OSX)] // Not implemented [InlineData(false, false, false, false, false)] // system -> ok [InlineData(true, true, true, true, true)] // empty dir, empty bundle file -> fail // It is enough to override the bundle, since all tested platforms don't have a default dir: [InlineData(false, false, true, true, true)] // empty bundle -> fail [InlineData(false, false, true, false, true)] // non-existing bundle -> fail public void HttpClientUsesSslCertEnvironmentVariables(bool setSslCertDir, bool createSslCertDir, bool setSslCertFile, bool createSslCertFile, bool expectedFailure) { // This test sets SSL_CERT_DIR and SSL_CERT_FILE to empty/non-existing locations and then // checks the http request fails. // Some platforms will use the system default when not specifying a value, while others // will not use those certificates. Due to these platform differences, we only check specific // combinations that are expected to work the same cross-platform. var psi = new ProcessStartInfo(); if (setSslCertDir) { string sslCertDir = GetTestFilePath(); if (createSslCertDir) { Directory.CreateDirectory(sslCertDir); } psi.Environment.Add(""SSL_CERT_DIR"", sslCertDir); } if (setSslCertFile) { string sslCertFile = GetTestFilePath(); if (createSslCertFile) { File.WriteAllText(sslCertFile, """"); } psi.Environment.Add(""SSL_CERT_FILE"", sslCertFile); } RemoteInvoke(async arg => { bool shouldFail = bool.Parse(arg); const string Url = ""https://www.microsoft.com""; + // Here, if we change to client = CreateHttpClient(useSocketsHttpHandlerBoolString: ""true""), the test will always fail. Test will pass if client = CreateHttpClient(useSocketsHttpHandlerBoolString: ""false""). (Not using SocketsHttpHandler) + using (HttpClient client = new HttpClient()) { if (shouldFail) { await Assert.ThrowsAsync<HttpRequestException>(() => client.GetAsync(Url)); } else { await client.GetAsync(Url); } } return SuccessExitCode; }, expectedFailure.ToString(), new RemoteInvokeOptions { StartInfo = psi }).Dispose(); } ``` Callstack: ``` Unhandled Exception: Xunit.Sdk.ThrowsException: Assert.Throws() Failure 2018-03-12 22:36:11,472: INFO: proc(54): run_and_log_output: Output: Expected: typeof(System.Net.Http.HttpRequestException) 2018-03-12 22:36:11,472: INFO: proc(54): run_and_log_output: Output: Actual: (No exception was thrown) 2018-03-12 22:36:11,472: INFO: proc(54): run_and_log_output: Output: at Xunit.Assert.Throws(Type exceptionType, Exception exception) 2018-03-12 22:36:11,472: INFO: proc(54): run_and_log_output: Output: at Xunit.Assert.ThrowsAsync[T](Func`1 testCode) 2018-03-12 22:36:11,473: INFO: proc(54): run_and_log_output: Output: at System.Net.Http.Functional.Tests.HttpClientHandler_ServerCertificates_Test.<>c.<<HttpClientUsesSslCertEnvironmentVariables>b__29_0>d.MoveNext() in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_true_prtest/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.ServerCertificates.Unix.cs:line 117 2018-03-12 22:36:11,474: INFO: proc(54): run_and_log_output: Output: --- End of stack trace from previous location where exception was thrown --- 2018-03-12 22:36:11,474: INFO: proc(54): run_and_log_output: Output: at RemoteExecutorConsoleApp.Program.Main(String[] args) in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_true_prtest/src/Common/tests/System/Diagnostics/RemoteExecutorConsoleApp/RemoteExecutorConsoleApp.cs:line 63 2018-03-12 22:36:11,475: INFO: proc(54): run_and_log_output: Output: --- End of stack trace from previous location where exception was thrown --- 2018-03-12 22:36:11,475: INFO: proc(54): run_and_log_output: Output: at RemoteExecutorConsoleApp.Program.Main(String[] args) in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_true_prtest/src/Common/tests/System/Diagnostics/RemoteExecutorConsoleApp/RemoteExecutorConsoleApp.cs:line 92 2018-03-12 22:36:12,308: INFO: proc(54): run_and_log_output: Output: System.Net.Http.Functional.Tests.PlatformHandler_HttpClientHandler_ServerCertificates_Test.HttpClientUsesSslCertEnvironmentVariables(setSslCertDir: False, createSslCertDir: False, setSslCertFile: True, createSslCertFile: True, expectedFailure: True) [FAIL] 2018-03-12 22:36:12,310: INFO: proc(54): run_and_log_output: Output: System.Diagnostics.RemoteExecutorTestBase+RemoteInvokeHandle+RemoteExecutionException : Remote process failed with an unhandled exception. 2018-03-12 22:36:12,342: INFO: proc(54): run_and_log_output: Output: Stack Trace: 2018-03-12 22:36:12,767: INFO: proc(54): run_and_log_output: Output: 2018-03-12 22:36:12,768: INFO: proc(54): run_and_log_output: Output: Child exception: 2018-03-12 22:36:12,778: INFO: proc(54): run_and_log_output: Output: Xunit.Sdk.ThrowsException: Assert.Throws() Failure 2018-03-12 22:36:12,779: INFO: proc(54): run_and_log_output: Output: Expected: typeof(System.Net.Http.HttpRequestException) 2018-03-12 22:36:12,779: INFO: proc(54): run_and_log_output: Output: Actual: (No exception was thrown) 2018-03-12 22:36:12,796: INFO: proc(54): run_and_log_output: Output: /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_true_prtest/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.ServerCertificates.Unix.cs(117,0): at System.Net.Http.Functional.Tests.HttpClientHandler_ServerCertificates_Test.<>c.<<HttpClientUsesSslCertEnvironmentVariables>b__29_0>d.MoveNext() 2018-03-12 22:36:12,797: INFO: proc(54): run_and_log_output: Output: --- End of stack trace from previous location where exception was thrown --- 2018-03-12 22:36:12,797: INFO: proc(54): run_and_log_output: Output: /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_true_prtest/src/Common/tests/System/Diagnostics/RemoteExecutorConsoleApp/RemoteExecutorConsoleApp.cs(63,0): at RemoteExecutorConsoleApp.Program.Main(String[] args) 2018-03-12 22:36:12,798: INFO: proc(54): run_and_log_output: Output: 2018-03-12 22:36:12,798: INFO: proc(54): run_and_log_output: Output: Child process: 2018-03-12 22:36:12,798: INFO: proc(54): run_and_log_output: Output: System.Net.Http.Functional.Tests, Version=4.2.1.0, Culture=neutral, PublicKeyToken=9d77cc7ad39b68eb System.Net.Http.Functional.Tests.HttpClientHandler_ServerCertificates_Test+<>c System.Threading.Tasks.Task`1[System.Int32] <HttpClientUsesSslCertEnvironmentVariables>b__29_0(System.String) 2018-03-12 22:36:12,799: INFO: proc(54): run_and_log_output: Output: 2018-03-12 22:36:12,799: INFO: proc(54): run_and_log_output: Output: Child arguments: 2018-03-12 22:36:12,799: INFO: proc(54): run_and_log_output: Output: True 2018-03-12 22:36:12,799: INFO: proc(54): run_and_log_output: Output: ```" 28004 area-System.IO Fix unbounded stackalloc in System.IO.FileSystem 28008 area-System.Net Change behavior of SocketsHttpHandler for redirects When exceeding the max number of redirecs, .NET Framework will not throw an exception. Instead, it will return the 3xx response. This PR changes the behavior of SocketsHttpHandler to match. Fixes #27285 28009 area-System.Text RFC: MARK in Regular Expressions "First of all, I'm hoping that this is the right place to post this. [Here](https://stackoverflow.com/questions/49256716/regex-mark-to-see-which-capture-group-was-matched) is the original StackOverflow post. There's this neat little `MARK` keyword in the PCRE Regex specification: https://pcre.org/current/doc/html/pcre2syntax.html#SEC23 https://3v4l.org/ErCrp ```php <?php $string = 'true'; $matches = []; preg_match('~(?|true(*:1) |false(*:1) |\d+(*:2))~x', $string, $matches); // *MARK:1 stands for a boolean // *MARK:2 stands for a integer literal var_dump($matches); //> array(2) { //> [0]=> string(4) ""true"" //> [""MARK""]=> string(1) ""1"" //> } $token = new Token( $lexeme = $matches[0], $type = $matches['MARK'] ); ``` As you can see, `MARK` allows you to understand which group matched, not just if it was matched. In this example `MARK` would contain the token type which would make tokenizing mind blowingly elegant. Unfortunately, right now I have to create capture groups and then manually check which capture group was matched when. ```csharp var pattern = @""( (?<true>true) |(?<false>false) |(?<integer>\d+) )""; var regexOptions = RegexOptions.ExplicitCapture | RegexOptions.IgnorePatternWhitespace; var regex = new Regex(pattern, regexOptions); var matches = regex.Matches(""true""); foreach (Match match in matches) { int? mark = null; if (match.Groups[""true""].Success || match.Groups[""false""].Success) { mark = 1; } else if (match.Groups[""integer""].Success) { mark = 2; } } ``` I mean, it works. But this will have to be repeated for every symbol, every operator, everything. Since the regex engine already knows what happened it should be able to report it back. Do you see any use in this feature?" 28010 area-System.Runtime [Discussion] Microsoft Security Advisory CVE-2018-0875: Hash Collision can cause Denial of Service # Microsoft Security Advisory CVE-2018-0875: Hash Collision can cause Denial of Service ## Executive Summary Microsoft is releasing this security advisory to provide information about a vulnerability in the public versions of .NET Core 1.0 and 2.0 (including other minor and patch releases). This advisory also provides guidance on what developers can do to update their applications correctly. Microsoft is aware of a security vulnerability in the public versions of .NET Core where a malicious file or web request could cause a denial of service (DoS) attack. System administrators are advised to update their .NET Core runtimes to versions 1.0.10, 1.1.7 or 2.0.6. Developers are advised to update their .NET Core SDK to versions 1.1.8 or 2.1.101. ## Original Announcement The original announcement is located at https://github.com/dotnet/announcements/issues/62 ### Mitigation Factors None ### Affected Software Any application running against .NET Core 1.0.9 or lower versions, 1.1.6 or lower minor versions or 2.0.5 or lower minor versions is affected. ### Advisory FAQ #### How do I know if I am affected? Any application running against .NET Core 1.0.9 or lower versions, 1.1.6 or lower minor versions or 2.0.5 or lower minor versions is affected. A complete list of runtimes can be discovered by performing a directory listing in the install root directories. The default root directories are listed in the following table: | Operating System | Location | |------------------|----------| | Windows | `C:\Program Files\dotnet\shared\Microsoft.NETCore.App\` | | macOS | `/usr/local/share/dotnet/shared/Microsoft.NETCore.App/` | | Supported Linux platforms | `/usr/share/dotnet/shared/Microsoft.NETCore.App/` | Each runtime version is installed in its own directory, where the directory name is the version number. If you don't have a directory for 1.0.10, 1.1.7 and 2.0.6, then any applications targeting the respective major/minor versions, 1.0 or 1.1 or 2.0 of .NET Core are vulnerable. Additionally, if you've deployed self-contained applications targeting any of the impacted versions, these applications are also vulnerable and must be updated to target the updated .NET Core runtime, recompiled and redeployed. #### How do I fix my affected application? Applications can be fixed by installing the latest .NET Core runtimes or SDKs. Typically, application servers only have runtime packages installed and developer machines have the SDKs installed. Installers for the runtimes can be downloaded from the [Runtime and SDK download archive](https://github.com/dotnet/core/blob/master/release-notes/download-archive.md). .NET Core 1.1.8 SDK installs both versions 1.0.10 and 1.1.7 of the .NET Core runtime. If you've built a self-contained application, you must install the new runtime and SDK, update your application to target the updated .NET Core runtime, recompile and redeploy. To update your runtime version edit the `RuntimeFrameworkVersion` property in the project's .csproj file to indicate the desired target version. For example: ```xml <PropertyGroup> <RuntimeFrameworkVersion>2.0.6</RuntimeFrameworkVersion> </PropertyGroup> ``` #### What if the update breaks my application? An application can be pinned to a previous version of the runtime by editing the `{applicationName}.runtimeconfig.json` file for that application., where `{applicationName}` is the name of the executable, for example `example.exe` would have a runtime configuration file titled `example.runtimeconfig.json`. Set the framework version to the desired version and the `rollForward` property to false. These settings should be treated as a temporary measure and the application updated to work with the patched versions of the framework. Since the `{applicationName}.runtimeconfig.json` file is an optional file, you may need to create one for each application and add it alongside the executable. ### Acknowledgments [Ben Adams](https://twitter.com/ben_a_adams) of [Illyriad Games](https://www.illyriad.co.uk/) ### External Links [CVE-2018-0875](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-0875) ### Revisions V1.2 (Mar 26, 2018): Corrected instructions for runtimeconfig.json V1.1 (Mar 14, 2018): Added instructions for self contained application retargetting. V1.0 (Mar 13, 2018): Advisory published. _Version 1.2_ _Last Updated 2018-03-26_ 28011 area-System.Net Expose SocketsHttpHandler.ResponseDrainTimeout Fixes https://github.com/dotnet/corefx/issues/27685 Just renames the internal property, makes it public, and fixes the tests to use it directly rather than via reflection. cc: @geoffkizer 28012 area-System.Drawing Tests System.Drawing.Tests.FontTests failing on CharSet on non English culture These two tests are failing on my system: - [ToLogFont_Invoke_ReturnsExpected](https://github.com/dotnet/corefx/blob/6cd1708e72a863342f6c6b6a7a735cf55ceff048/src/System.Drawing.Common/tests/FontTests.cs#L719) - [ToLogFont_InvokeGraphics_ReturnsExpected](https://github.com/dotnet/corefx/blob/6cd1708e72a863342f6c6b6a7a735cf55ceff048/src/System.Drawing.Common/tests/FontTests.cs#L756) Both are failing on asserting `logFont.lfCharSet`. Expected value is always **1** (once as a constant, once as a property `font.GdiCharSet`), but my value is **238**. I do not know exactly what charset 238 is, but I think, that it is because of my system's culture, which is **Slovak**. 28013 area-System.IO Forward-port the Intel optimizations to Zlib 1.2.11 28014 area-System.IO Upgrade our ZLib version for Windows to 1.2.11 Fixes https://github.com/dotnet/corefx/issues/25844 28015 area-System.Threading "Add official type for ""Void for Generic arguments"" cases (and kill brand new non-generic ""ValueTask"")" "The problem: --- CLR denies to use System.Void in generic arguments. And as a result we have code like that: ```CSharp public struct MyType { } public struct MyType<T>{ } public void DoOperation(MyType p) { } public void DoOperation<T>(MyType<T> p) { } ``` Language/CLR solution: --- This proposal https://github.com/dotnet/csharplang/issues/696 probably would not be implemented at all. Temporary solution: --- We are defining special type internally like System.Void ``` CSharp internal struct MyVoid {} public struct MyType<T>{ } public void DoOperation<T>(MyType<T> p) { } public void UsageExapmle() { DoOperation(new MyType<MyVoid> p); // Why we have no TaskCompletionSource ??? // Becuse it's not so difficult to use: TaskCompletionSource<MyVoid> tcs; // Or TaskCompletionSource<bool> tcs1; } ``` Fresh example: https://github.com/dotnet/corefx/blob/master/src/System.Threading.Channels/src/System/VoidResult.cs Internally many many projects reinventing the wheel again and again. There are many places in CoreCLR, CoreFX, Roslyn, etc. and other 100+ projects Temporary-Permanent Solution: --- 1) Add official ""Void for Generic arguments"" ``` CSharp namespace Sysem { public struct VoidResult {} } ``` 2) Improve Framework-Design guidelines and describe that ""VoidResult"" is a good practice. 3) Kill brand-new non-generic ValueTask, IValueTaskSource classes as a first example of new design principles. UNTIL IT'S NOT TOO LATE! Otherwise please add non-generic TaskCompletionSource class as a ""Logic shugar"". ;) Suggestion: --- With 90% probability proposal https://github.com/dotnet/csharplang/issues/696 will be implemened in a way where ""void"" literals in generic arguments will be replaced to ""VoidResult"" from this proposal." 28017 area-Serialization Updated an error message Fix #27492 @zhenlan @huanwu @mconnew 28020 area-System.Net Constructing an absolute URI from a relative URI sometimes results in an incorrect encoding "When using a relative URI built from `Uri.MakeRelativeUri` to create a new URI with the constructor `Uri(Uri, Uri)`, the resulting URI has a `LocalPath` property that is not escaped properly. ```csharp var baseUri = new Uri(@""C:\test \"", UriKind.Absolute); var absolute = new Uri(@""C:\test \space .txt"", UriKind.Absolute); var relative = new Uri(""space .txt"", UriKind.Relative); var combined = new Uri(baseUri, relative); Uri extracted = baseUri.MakeRelativeUri(absolute); var rebuilt = new Uri(baseUri, extracted); Console.WriteLine(baseUri.LocalPath); // Outputs C:\test \ Console.WriteLine(absolute.LocalPath); // Outputs C:\test \space .txt Console.WriteLine(combined.LocalPath); // Outputs C:\test \space .txt Console.WriteLine(rebuilt.LocalPath); // Outputs C:\test \space%20.txt ``` The user that reported this issue was able to use the following workaround: ```csharp var temp = Uri.UnescapeDataString(extracted.ToString()); var rebuilt = new Uri(baseUri, temp); ``` The use case here is very obscure, so I'm marking this issue as future." 28021 area-System.Globalization ArgumentNullException with StringComparer.CurrentCultureIgnoreCase when GlobalizationMode.Invariant=true "When GlobalizationMode.Invariant=true is in effect (such as on Alpine in the `microsoft/dotnet:2.1-runtime-deps-alpine` image), attempts to use `StringComparer.CurrentCultureIgnoreCase` cause crashes. This appears to have changed between runtime 2.0 and current builds of 2.1. Simple repro: ```c# using System; using System.Collections; namespace hashtable { class Program { static void Main(string[] args) { Hashtable h = new Hashtable(StringComparer.CurrentCultureIgnoreCase); h[""Foo""] = ""bar""; Console.WriteLine(h.ContainsKey(""foo"")); Console.WriteLine(""Hello World!""); } } } ``` Working: ```sh-session raines@raines-z220u:~/src/hashtable$ dotnet --info .NET Command Line Tools (2.1.101) Product Information: Version: 2.1.101 Commit SHA-1 hash: 6c22303bf0 Runtime Environment: OS Name: ubuntu OS Version: 17.10 OS Platform: Linux RID: linux-x64 Base Path: /usr/share/dotnet/sdk/2.1.101/ Microsoft .NET Core Shared Framework Host Version : 2.0.6 Build : 74b1c703813c8910df5b96f304b0f2b78cdf194d raines@raines-z220u:~/src/hashtable$ DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true dotnet exec /home/raines/src/hashtable/bin/Debug/netcoreapp2.0/hashtable.dll True Hello World! ``` Failing: ```sh-session $ dotnet --info .NET Comma$ DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true dotnet exec bin/Debug/netcoreapp2.0/hashtable.dll Unhandled Exception: System.ArgumentNullException: SafeHandle cannot be null. Parameter name: pHandle at System.StubHelpers.StubHelpers.SafeHandleAddRef(SafeHandle pHandle, Boolean& success) at Interop.Globalization.GetSortKey(SafeSortHandle sortHandle, String str, Int32 strLength, Byte* sortKey, Int32 sortKeyLength, CompareOptions options) at System.Globalization.CompareInfo.GetHashCodeOfStringCore(String source, CompareOptions options) at System.Collections.Hashtable.GetHash(Object key) at System.Collections.Hashtable.InitHash(Object key, Int32 hashsize, UInt32& seed, UInt32& incr) at System.Collections.Hashtable.ContainsKey(Object key) at hashtable.Program.Main(String[] args) in /home/raines/src/hashtable/Program.cs:line 12 Aborted (core dumped)nd Line Tools (2.1.300-preview2-008251) Product Information: Version: 2.1.300-preview2-008251 Commit SHA-1 hash: 94fd3fd392 Runtime Environment: OS Name: alpine OS Version: 3.6 OS Platform: Linux RID: alpine.3.6-x64 Base Path: /usr/share/dotnet/sdk/2.1.300-preview2-008251/ Microsoft .NET Core Shared Framework Host Version : 2.1.0-preview2-26131-06 Build : b13a0d5c331f374afd35ded57b9a4b4ab128864c $DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true dotnet exec bin/Debug/netcoreapp2.0/hashta ble.dll Unhandled Exception: System.ArgumentNullException: SafeHandle cannot be null. Parameter name: pHandle at System.StubHelpers.StubHelpers.SafeHandleAddRef(SafeHandle pHandle, Boolean& success) at Interop.Globalization.GetSortKey(SafeSortHandle sortHandle, String str, Int32 strLength, Byte* sortKey, Int32 sortKeyLength, CompareOptions options) at System.Globalization.CompareInfo.GetHashCodeOfStringCore(String source, CompareOptions options) at System.Collections.Hashtable.GetHash(Object key) at System.Collections.Hashtable.InitHash(Object key, Int32 hashsize, UInt32& seed, UInt32& incr) at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add) at System.Collections.Hashtable.set_Item(Object key, Object value) at hashtable.Program.Main(String[] args) in /home/raines/src/hashtable/Program.cs:line 12 Aborted (core dumped) ```" 28024 area-System.Net ClientWebSocket should always use CONNECT tunneling thru a proxy While working on https://github.com/dotnet/corefx/issues/26957, I noticed that WS (websocket non-secure) connections thru a proxy don't use CONNECT tunneling. Instead, they appear to be using just a fully qualified GET request thru the proxy. This differs from .NET Framework and .NET Core 2.0 (originally used WinHTTP). In order to maximize success with websocket connections thru proxies, .NET Framework and other stacks typically always use CONNECT tunneling even if the destination server is not a TLS/SSL connection. Using a test proxy server, I saw the following being sent to/thru the proxy: ``` GET http://corefx-net.cloudapp.net/WebSocket/EchoWebSocket.ashx HTTP/1.1 Connection: Upgrade Upgrade: websocket Sec-WebSocket-Version: 13 Sec-WebSocket-Key: zmboERimu0GSCsWNRKsDZA== Host: corefx-net.cloudapp.net ``` It appears that ClientWebSocket is only using a CONNECT verb to the server when the destination websocket server is using the WSS (secure) connection. In that case, we see the following thru the proxy: ``` CONNECT corefx-net.cloudapp.net:443 HTTP/1.1 Host: corefx-net.cloudapp.net:443 Trying to connect to corefx-net.cloudapp.net Connected to corefx-net.cloudapp.net HTTP/1.1 200 Connection established ``` ClientWebSocket should be fixed to always use CONNECT tunneling for all connections thru a proxy regardless of whether the websocket server is a secure connection. 28025 area-System.Threading Blazing-Fast replacement for the System.Threading.Task.Dataflow (as an extension to System.Threading.Channels) "@dmitriyse commented on [Mon Mar 12 2018](https://github.com/dotnet/corefxlab/issues/2154) The problem. --- When you developing DotNet application that should handle more than 10k+ items/sec on a single ServerNode, You are facing with DotNet framework botlenecks and app architecture bottlenecks. System.Threading.Tasks.Dataflow solves the architecture problems. It's allows to decouple operations from a async/awaits processing chains and balance processing with help of queues between operations blocks. For example if you have 10 processing blocks and wants to have 10k+ items/sec final performance, than the communication speed between each opration block should be greater that 100k+ items/sec and 1M+ items/sec to get framework overhead less than 10%. Unfortunately current CoreFX API was not designed for 1M+ Operation/sec performance and full reimplementation of subsystems is required. When we summarize all overheads: 1) System.Threading.Tasks.Dataflow overheads 2) TPL overheads 3) Synchrnization overheads (lock or Interlocked are cheap but not cost-free and in fully async cases it's called too many times). Even lock-free collections which are based on ""LOCK CMPXCHG"" assmbly instruction eats big amount CPU time (especially in a NUMA environments). 4) Array allocations/ memory copying 5) Async/Await methods state machines overheads 6) etc. Final overhead in the best case allows to handle 10k+ items, but with 100% of framework overhead with no room to application logic. This proposal perfectly fits into the roadmap https://github.com/dotnet/corefxlab/blob/master/docs/roadmap.md When the ""PROCESSING"" block is not empty, DotNet moves down from 10th place to ~50th. The solution approaches. ---- 1) Use batch mode communication between Processing Blocks 2) Avoid memory copying and allocation where it's possible (zero-copy and buffer pooling approaches) 3) Design API with keeping optimization in mind in every method signature 4) Do something with TPL (in CoreCLR 2.1 will already have a new IValueTaskSource approach that reduces TPL overhead) 5) Use Event-loops with TPL API adoption and faster Non-TPL API, (this is separate issue dotnet/corefxlab#2168). Workflows sharded across multiple event-loops can dramatically reduce synchronization performance leaks. The new API proposal. --- CoreFX now has the new API System.Threading.Channels which contains the abstractions and base implementation for async friendly queues as a replacement for synchronous thread-safe BlockingCollection and ConcurrentQueue. Also System.Threading.Channels API is a partial replacement for the System.Threading.Tasks.Dataflow async friendly queues (which is implicitly implemented inside BufferBlock and other blocks). We can extend System.Threading.Channels API to get more feature complete alternative to the System.Threading.Tasks.Dataflow: 1) Replace Task with ValueTask in the ChannelReader/ChannelWriter 2) Make contracts IChannelReader/IChannelWriter as a first-class abstractions (instead of abstract classes ChannelReader/ChannelWriter) 3) Add a rich set of batch mode methods to IChannelReader/IChannelWriter with zero-copy, with copy and with buffer ownership and passthrough of buffers from a writer to a reader as is. 4) Instead of Channel<TReader, TWriter> introduce interfaces IDataFlowSource<T> and IDataFlowTarget<T> 5) Implement common types of Buffers with rich options set (for example read aggregation amount/timeout) 6) Implement some shaper/load balancer solutions that helps to balance the load among executors. 7) Implement new contracts in some other API (probably Pipes) and adaptors to old well-known API IDataFlowConsumer/IDataFlowProducer : ``` CSharp /// <summary> /// The data flow consumer. /// </summary> /// <typeparam name=""T"">Specifies the type of data that may be written to the consumer.</typeparam> public interface IDataFlowConsumer<T> { /// <summary> /// Opens the new writer. /// </summary> /// <remarks> /// Producer can use some load balancing logic between known open writers. You can close a writer through the /// <see cref=""IDisposable""/> interface. /// </remarks> /// <returns>The new writer.</returns> IChannelWriter<T> OpenWriter(); } /// <summary> /// The data flow producer. /// </summary> /// <typeparam name=""T""> /// Specifies the type of data that may be read from the producer. /// </typeparam> public interface IDataFlowProducer<T> { /// <summary> /// Opens the new reader. /// </summary> /// <remarks> /// Producer can use some load balancing logic between known open readers. You can close a reader through the /// <see cref=""IDisposable""/> interface. /// </remarks> /// <returns>The new reader.</returns> IChannelReader<T> OpenReader(); } ``` IChannelWriter: ```CSharp /// <summary> /// Provides a base class for writing to a channel. /// </summary> /// <typeparam name=""T"">Specifies the type of data that may be written to the channel.</typeparam> [NoReorder] public interface IChannelWriter<T>: IDisposable { /// <summary> /// Mark the channel as being complete, meaning no more items will be written to it. /// </summary> /// <param name=""error"">Optional Exception indicating a failure that's causing the channel to complete.</param> /// <exception cref=""InvalidOperationException"">The channel has already been marked as complete.</exception> void Complete(Exception error = null); /// <summary> /// Attempts to mark the channel as being completed, meaning no more data will be written to it. /// </summary> /// <param name=""error""> /// An <see cref=""Exception""/> indicating the failure causing no more data to be written, or /// null for success. /// </param> /// <returns> /// true if this operation successfully completes the channel; otherwise, false if the channel could not be marked for /// completion, /// for example due to having already been marked as such, or due to not supporting completion. /// </returns> bool TryComplete(Exception error = null); /// <summary> /// Attempts to write the specified item to the channel. /// </summary> /// <param name=""item"">The item to write.</param> /// <returns>true if the item was written; otherwise, false if it wasn't written.</returns> bool TryWrite(T item); /// <summary> /// Returns a <see cref=""ValueTask{T}""/> that will complete when space is available to write an /// item. /// </summary> /// <param name=""cancellationToken"">A <see cref=""CancellationToken""/> used to cancel the wait operation.</param> /// <returns> /// A <see cref=""ValueTask{T}""/> that will complete with a <c>true</c> result when space is available to /// write an item /// or with a <c>false</c> result when no further writing will be permitted. /// </returns> ValueTask<bool> WaitToWriteValueTaskAsync(CancellationToken cancellationToken = default); /// <summary>Asynchronously writes an item to the channel.</summary> /// <param name=""item"">The value to write to the channel.</param> /// <param name=""cancellationToken""> /// A <see cref=""CancellationToken""/> used to cancel the write /// operation. /// </param> /// <returns>A <see cref=""ValueTask{T}""/> that represents the asynchronous write operation.</returns> ValueTask<ValueVoid> WriteValueTaskAsync(T item, CancellationToken cancellationToken = default); #region The zero-copy batch mode interface /// <summary> /// Allocates a buffer slice to write to. /// </summary> /// <param name=""count"">The preferred amount of items to write.</param> /// <param name=""slice"">The buffer slice with to write data to.</param> /// <returns> /// <see langword=""true""/> if the buffer slice was allocated; otherwise, <see langword=""false""/> if it wasn't /// allocated. /// </returns> bool TryStartWrite(int count, out ChannelWriterBufferSlice<T> slice); /// <summary> /// Releases a part of previously allocated buffer slice. /// </summary> /// <param name=""newCount"">The number of items to remain allocated.</param> /// <param name=""writeSlice"">The buffer slice.</param> void PartialFree(int newCount, ref ChannelWriterBufferSlice<T> writeSlice); /// <summary> /// Finalizes write operation. /// </summary> /// <param name=""processedCount"">The number of processed items.</param> /// <param name=""writeSlice"">The buffer slice.</param> void CompleteWrite(int processedCount, ref ChannelWriterBufferSlice<T> writeSlice); #endregion #region Copy-based batch mode interface /// <summary> /// Attempts to write the specified item to the channel. /// </summary> /// <param name=""items"">The item to write.</param> /// <param name=""written"">The amount of items written.</param> /// <returns>true if the item was written; otherwise, false if it wasn't written.</returns> bool TryWrite(ReadOnlySpan<T> items, out int written); /// <summary> /// Asynchronously writes an item to the channel. /// </summary> /// <param name=""items"">The value to write to the channel.</param> /// <param name=""cancellationToken""> /// A <see cref=""CancellationToken""/> used to cancel the write /// operation. /// </param> /// <returns>A <see cref=""ValueTask{T}""/> that represents the asynchronous write operation and returns the number of items has been written.</returns> ValueTask<int> WriteAsync(ReadOnlySpan<T> items, CancellationToken cancellationToken = default); #endregion #region Array pass-through interface /// <summary> /// Attempts to write the specified items to the channel and gives ownership of the provided array to the channel. /// </summary> /// <remarks> /// This method allows to pass-through array to be read by the reader without changes to the array and any copying. /// </remarks> /// <param name=""items"">The item to write.</param> /// <returns>true if the items was fully written; otherwise, false if it wasn't fully written.</returns> bool TryWriteWithOwnership(T[] items); /// <summary> /// Asynchronously writes an item to the channel. /// </summary> /// <remarks> /// This method allows to pass-through array to be read by the reader without changes to the array and any copying. /// </remarks> /// <param name=""items"">The value to write to the channel.</param> /// <param name=""cancellationToken""> /// A <see cref=""CancellationToken""/> used to cancel the write /// operation. /// </param> /// <returns>A <see cref=""ValueTask{T}""/> that represents the asynchronous write operation.</returns> ValueTask<ValueVoid> WriteAsyncWithOwnership(T[] items, CancellationToken cancellationToken = default); #endregion } ``` IChannelReader: ```CSharp /// <summary> /// Provides a base contract for reading from a channel. /// </summary> /// <typeparam name=""T""> /// Specifies the type of data that may be read from the channel. /// </typeparam> [NoReorder] public interface IChannelReader<T>: IDisposable { /// <summary> /// Gets a <see cref=""Task""/> that completes when no more data will ever /// be available to be read from this channel. /// </summary> /// <remarks> /// Task is slow, we needs IValueTaskSource everywhere ! /// </remarks> ValueTask<ValueVoid> ValueTaskCompletion { get; } /// <summary> /// Asynchronously reads an item from the channel. /// </summary> /// <param name=""cancellationToken"">A <see cref=""CancellationToken""/> used to cancel the read operation.</param> /// <returns>A <see cref=""ValueTask{T}""/> that represents the asynchronous read operation.</returns> ValueTask<T> ReadAsync(CancellationToken cancellationToken = default); /// <summary> /// Attempts to read an item to the channel. /// </summary> /// <param name=""item"">The read item, or a default value if no item could be read.</param> /// <returns><see langword=""true""/> if an item was read; otherwise, <see langword=""false""/> if no item was read.</returns> bool TryRead(out T item); /// <summary> /// Returns a <see cref=""ValueTask{T}""/> that will complete when data is available to read. /// </summary> /// <param name=""cancellationToken"">A <see cref=""CancellationToken""/> used to cancel the wait operation.</param> /// <returns> /// A <see cref=""ValueTask{T}""/> that will complete with a <c>true</c> result when data is available to /// read /// or with a <c>false</c> result when no further data will ever be available to be read. /// </returns> ValueTask<bool> WaitToReadValueTaskAsync(CancellationToken cancellationToken = default); #region The zero-copy batch mode interface /// <summary> /// Finalizes read operation. /// </summary> /// <param name=""processedCount"">The number of processed items.</param> /// <param name=""slice"">The buffer slice.</param> void CompleteRead(int processedCount, ref ChannelReaderBufferSlice<T> slice); /// <summary> /// Releases a part of previously allocated buffer slice. /// </summary> /// <param name=""newCount"">The number of items to remain allocated.</param> /// <param name=""slice"">The buffer slice.</param> void PartialFree(int newCount, ref ChannelReaderBufferSlice<T> slice); /// <summary> /// Allocates a buffer slice with data. /// </summary> /// <remarks> /// Resulting slice can has less length than requested. /// </remarks> /// <param name=""count"">The preferred amount of items to read.</param> /// <param name=""slice"">The buffer slice with the data.</param> /// <returns> /// <see langword=""true""/> if the buffer slice was allocated; otherwise, <see langword=""false""/> if it wasn't /// allocated. /// </returns> bool TryStartRead(int count, out ChannelReaderBufferSlice<T> slice); #endregion #region The batch mode interface with copying. /// <summary> /// Attempts to read with copying the specified amount of items from the channel. /// </summary> /// <param name=""outBuffer"">The output buffer to read to.</param> /// <param name=""readCount"">The amount of items read (can be less than <see cref=""outBuffer""/> length.</param> /// <returns><see langword=""true""/> if at least one item was read; otherwise, <see langword=""false""/> if no items was read.</returns> bool TryRead(Span<T> outBuffer, out int readCount); /// <summary> /// Attempts to read the specified amount of items to an array. /// </summary> /// <remarks> /// This method allows to pass-through pushed array without changes and copying. /// </remarks> /// <param name=""count"">The number of items to read.</param> /// <param name=""items"">The array with read items. (Array can have less items than has been requested.)</param> /// <returns><see langword=""true""/> if at least one item was read; otherwise, <see langword=""false""/> if no items was read.</returns> bool TryRead(int count, out T[] items); /// <summary> /// Asynchronously reads the specified amount of items from the channel. /// </summary> /// <remarks> /// This method allows to pass-through pushed array without changes and copying. /// </remarks> /// <param name=""count"">The number of items to read.</param> /// <param name=""cancellationToken"">A <see cref=""CancellationToken""/> used to cancel the read operation.</param> /// <returns>A <see cref=""ValueTask{T}""/> that represents the asynchronous read operation.</returns> ValueTask<T[]> ReadAsync(int count, CancellationToken cancellationToken); #endregion } ``` Misc: ```CSharp /// <summary> /// The channel writer allocated buffer slice. /// </summary> /// <remarks> /// Memory can also be encapsulated in this <see langword=""struct""/>. /// </remarks> /// <typeparam name=""T"">Specifies the type of data that may be written to the channel.</typeparam> public struct ChannelWriterBufferSlice<T> { private T[] _array; private int _start; private int _length; private int _id; /// <summary> /// Initializes a new instance of the <see cref=""ChannelWriterBufferSlice{T}""/> class. /// </summary> /// <param name=""array"">The array.</param> /// <param name=""start"">The slice start in the array.</param> /// <param name=""length"">The slice length.</param> /// <param name=""id"">The slice identifier.</param> public ChannelWriterBufferSlice(T[] array, int start, int length, int id) { #if DEBUG // TODO: checks #endif _array = array; _start = start; _length = length; _id = id; } /// <summary> /// The span interface for writing. /// </summary> public Span<T> Span => new Span<T>(_array, _start, _length); /// <summary> /// The slice id. /// </summary> public int Id => _id; /// <summary> /// Decreases slice length. /// </summary> /// <param name=""newLength"">The new length.</param> public void DecreaseLength(int newLength) { _length = newLength; } } /// <summary> /// The channel reader allocated buffer slice. /// </summary> /// <remarks> /// Memory can also be encapsulated in this <see langword=""struct""/>. /// </remarks> /// <typeparam name=""T"">Specifies the type of data that may be read from the channel.</typeparam> public struct ChannelReaderBufferSlice<T> { private T[] _array; private int _start; private int _length; private int _id; /// <summary> /// Initializes a new instance of the <see cref=""ChannelReaderBufferSlice{T}""/> struct. /// </summary> /// <param name=""array"">The array.</param> /// <param name=""start"">The slice start in the array.</param> /// <param name=""length"">The slice length.</param> /// <param name=""id"">The slice identifier.</param> public ChannelReaderBufferSlice(T[] array, int start, int length, int id) { #if DEBUG // TODO: checks #endif _array = array; _start = start; _length = length; _id = id; } /// <summary> /// Decreases slice length. /// </summary> /// <param name=""newLength"">The new length.</param> public void DecreaseLength(int newLength) { _length = newLength; } /// <summary> /// The span interface for reading. /// </summary> public ReadOnlySpan<T> Span => new ReadOnlySpan<T>(_array, _start, _length); /// <summary> /// The slice id. /// </summary> public int Id => _id; } /// <summary> /// Special type that can be used in places where usage of System.Void currently is impossible. /// </summary> /// <remarks> /// See discussion https://github.com/dotnet/csharplang/issues/696. /// </remarks> [StructLayout(LayoutKind.Sequential, Size = 1)] [PublicAPI] public struct ValueVoid : IEquatable<ValueVoid>, IStructuralEquatable { /// <inheritdoc/> public bool Equals(ValueVoid other) { return true; } /// <inheritdoc/> public override bool Equals([CanBeNull] object obj) { return obj is ValueVoid; } bool IStructuralEquatable.Equals([CanBeNull] object other, [CanBeNull] IEqualityComparer comparer) { return other is ValueTuple; } /// <inheritdoc/> public override int GetHashCode() { return 0; } int IStructuralEquatable.GetHashCode([CanBeNull] IEqualityComparer comparer) { return 0; } } ``` --- @ahsonkhan commented on [Mon Mar 12 2018](https://github.com/dotnet/corefxlab/issues/2154#issuecomment-372403391) cc @tarekgh, @stephentoub --- @tarekgh commented on [Mon Mar 12 2018](https://github.com/dotnet/corefxlab/issues/2154#issuecomment-372407034) @stephentoub should we move this request to corefx repo? --- @joshfree commented on [Tue Mar 13 2018](https://github.com/dotnet/corefxlab/issues/2154#issuecomment-372805801) @tarekgh yes please move issues/suggestions related to Channels to dotnet/corefx now that Channels is in corefx and no longer in corefxlab. Thanks. " 28027 area-System.Net ClientWebSocket aborts on closes when going thru a proxy "While working on #26957, I noticed that the following test will fail. There seems to be a problem with the close frame exchange and final TCP socket close when going thru a proxy. Repro test (not yet in repo): ```c# [OuterLoop] // TODO: Issue #11345 [ConditionalTheory(nameof(WebSocketsSupported)), MemberData(nameof(EchoServers))] public async Task Proxy_ConnectThruProxy_Success(Uri server) { IWebProxy proxy = new WebProxy(new Uri(""http://localhost:8080/"")); using (ClientWebSocket cws = await WebSocketHelper.GetConnectedWebSocket( server, TimeOutMilliseconds, _output, default(TimeSpan), proxy)) { var cts = new CancellationTokenSource(TimeOutMilliseconds); Assert.Equal(WebSocketState.Open, cws.State); var closeStatus = WebSocketCloseStatus.NormalClosure; string closeDescription = ""Normal Closure""; await cws.CloseAsync(closeStatus, closeDescription, cts.Token); // Verify a clean close frame handshake. Assert.Equal(WebSocketState.Closed, cws.State); // *** FAILS HERE *** Assert.Equal(closeStatus, cws.CloseStatus); Assert.Equal(closeDescription, cws.CloseStatusDescription); } } ``` Fails with error: ``` System.Net.WebSockets.Client.Tests.ClientWebSocketOptionsTests.Proxy_SecureConnectThruProxy_Success(server: ws://corefx-net.cloudapp.net/WebSocket/EchoWeb Socket.ashx) [FAIL] Assert.Equal() Failure Expected: Closed Actual: Aborted Stack Trace: s:\GitHub\corefx\src\System.Net.WebSockets.Client\tests\ClientWebSocketOptionsTests.cs(90,0): at System.Net.WebSockets.Client.Tests.ClientWebSocketO ptionsTests.Proxy_SecureConnectThruProxy_Success(Uri server) --- End of stack trace from previous location where exception was thrown --- System.Net.WebSockets.Client.Tests.ClientWebSocketOptionsTests.Proxy_SecureConnectThruProxy_Success(server: wss://corefx-net.cloudapp.net/WebSocket/EchoWe bSocket.ashx) [FAIL] Assert.Equal() Failure Expected: Closed Actual: Aborted Stack Trace: s:\GitHub\corefx\src\System.Net.WebSockets.Client\tests\ClientWebSocketOptionsTests.cs(90,0): at System.Net.WebSockets.Client.Tests.ClientWebSocketO ptionsTests.Proxy_SecureConnectThruProxy_Success(Uri server) --- End of stack trace from previous location where exception was thrown --- ```" 28030 area-System.Collections BlockingCollection.TryTake throws ArgumentNullException Per MSDN https://docs.microsoft.com/en-us/dotnet/api/system.collections.concurrent.blockingcollection-1.trytake?view=netframework-4.7.1, BlockingCollection.TryTake should not throw ArgumentNullException, however we found this is not true, which cause unhandled exception. The source code: https://referencesource.microsoft.com/#System/sys/system/collections/concurrent/BlockingCollection.cs,462c00bfa4630957 shows the function will call CheckDisposed() then proceed if it is not disposed, however this is not thread safe because another thread could dispose it once it passes the CheckDispose() check. Is this a known issue? Below is a mini-repro app: class Test { public static async Task Run() { BlockingCollection<int> bd = new BlockingCollection<int>(); bd.Add(0); Task[] tasks = new Task[2]; tasks[0] = Task.Run(() => TakeTask(bd)); tasks[1] = Task.Run(() => DisposeTask(bd)); await Task.WhenAll(tasks).ConfigureAwait(false); } private static void TakeTask(BlockingCollection<int> bd) { try { int unused = 0; bd.TryTake(out unused); } catch (ObjectDisposedException) { //expected, swallow } catch (ArgumentNullException ex) { // UNEXPECTED ArgumentNullException exception Console.WriteLine(ex); } } private static void DisposeTask(BlockingCollection<int> bd) { bd.Dispose(); } } class Program { static void Main(string[] args) { Task.WhenAll(Enumerable.Range(0, 1000).Select(i => Test.Run())).GetAwaiter().GetResult(); } } 28031 area-System.Net Add tests for ClientWebSocket connections thru a proxy Created new tests for verifying ClientWebSocket connections end-to-end thru a proxy. Opened new issues #28024 and #28027 which cause the new tests to fail. Fixes #26957 28033 area-System.Threading Ensuring order in case of exception in System.Threading.Tasks.Dataflow blocks Dataflow blocks shut down in case of an exception, but a few more items may get propagated before actual completion, including items that appeared after the faulty one in the input sequence. I may provide a few lines of code to show this, but looking at the source code it seems this is intended. I don't get the rationale of this behavior: skipping a faulty item but propagating a few subsequent ones seems at odd with the (very useful) ordering guarantee that all blocks provide by default. In my use case, for example, I process items (file lines) with some degree of parallelism in a transform block, linked to a (sequential) action block in charge of storing a kind of 'commit point'. In case of an error I'd like to restart from the previously saved commit point, skipping most of the input lines already processed but still ensuring 'at least once' processing. I think that items following a faulty one should not be propagated. 28035 area-System.Memory Should we add extention method to write ReadOnlySequence to IBufferWriter ? Now `System.Buffers.BuffersExtensions` have method to write ReadOnlySpan to IBufferWriter. Should we add similar method for `ReadOnlySequence`? ```cs public static class BuffersExtensions { public static void Write<T>(this IBufferWriter<T> bufferWriter, ReadOnlySpan<T> source); // new public static void Write<T>(this IBufferWriter<T> bufferWriter, ReadOnlySequence<T> source); } ``` 28036 area-System.Net Update the disabled test with the new bug numbers Close: #27113 28037 area-System.Globalization Add GetHashCode test for invariant mode 28038 area-System.Runtime Adding test for StringBuilder.Clear() making sure Capacity wont grow unboundedly Fixes #27625 Tests for PR dotnet/coreclr#16926 28040 area-System.Memory API Proposal: Helper to get ReadOnlySpan<char> from string with terminator In some cases we want null terminated spans of char (interop for example). There isn't a convenient helper to get a span from a string with the terminator included. ``` diff namespace System { public static partial class MemoryExtensions { public static ReadOnlySpan<char> AsSpan(this string text); + public static ReadOnlySpan<char> AsSpanWithTerminator(this string text); } } ``` This is useful when you want to take a ReadOnlySpan<char> as a parameter that you then need to pass to something (notably a native API) that expects a null terminated string. We can easily validate that we have a null and not have to copy. ``` C# public static void Foo(ReadOnlySpan<char> bar) { if (bar.Length > 0 && bar[bar.Length - 1] == '\0') { NativeFoo(ref MemoryMarshal.GetReference(path)); } else { // make a copy, add a null, and call NativeFoo() } } ``` ** Notes ** - Perhaps this should live in `MemoryMarshal` as it is a little more advanced? It isn't a terribly difficult concept though. - Should also return default if passed null for string. cc: @KrzysztofCwalina, @terrajobst, @ahsonkhan, @jkotas 28042 area-System.Runtime Add SuppressMetaPackage to break circular dependency during package restore See https://github.com/dotnet/corefxlab/pull/2150#issuecomment-372785112 for context (where the issue was manifesting as a VS crash due to stackoverflow). I tested this locally (by building and referencing the System.Threading.Tasks.Extensions/System.IO.Pipelines packages with this fix in a netstandard1.3 class library). cc @weshaggard, @ericstj 28043 area-System.Security System.Security.Cryptography.Rsa.Tests.EncryptDecrypt_Span and System.Security.Cryptography.Rsa.Tests.EncryptDecrypt_Array [FAIL] "tests failed on windows when COMPlus_GCStress=3: 1. System.Security.Cryptography.Rsa.Tests.EncryptDecrypt_Array.RsaDecryptOaepWrongDataLength [FAIL] ```<test name=""System.Security.Cryptography.Rsa.Tests.EncryptDecrypt_Span.RsaDecryptOaepWrongDataLength"" type=""System.Security.Cryptography.Rsa.Tests.EncryptDecrypt_Span"" method=""RsaDecryptOaepWrongDataLength"" time=""0.3193518"" result=""Fail""> <failure exception-type=""Xunit.Sdk.ThrowsException""> <message><![CDATA[Assert.Throws() Failure\r\nExpected: typeof(System.Security.Cryptography.CryptographicException)\r\nActual: (No exception was thrown)]]></message> <stack-trace><![CDATA[ at System.Security.Cryptography.Rsa.Tests.EncryptDecrypt.RsaDecryptOaepWrongDataLength() in c:\Users\vseqa1\corefx\src\Common\tests\System\Security\Cryptography\AlgorithmImplementations\RSA\EncryptDecrypt.cs:line 456]]></stack-trace> </failure> </test> ``` 2. System.Security.Cryptography.Rsa.Tests.EncryptDecrypt_Span.RsaDecryptOaepWrongDataLength [FAIL] ``` <test name=""System.Security.Cryptography.Rsa.Tests.EncryptDecrypt_Array.RsaDecryptOaepWrongDataLength"" type=""System.Security.Cryptography.Rsa.Tests.EncryptDecrypt_Array"" method=""RsaDecryptOaepWrongDataLength"" time=""0.2229951"" result=""Fail""> <failure exception-type=""Xunit.Sdk.ThrowsException""> <message><![CDATA[Assert.Throws() Failure\r\nExpected: typeof(System.Security.Cryptography.CryptographicException)\r\nActual: (No exception was thrown)]]></message> <stack-trace><![CDATA[ at System.Security.Cryptography.Rsa.Tests.EncryptDecrypt.RsaDecryptOaepWrongDataLength() in c:\Users\vseqa1\corefx\src\Common\tests\System\Security\Cryptography\AlgorithmImplementations\RSA\EncryptDecrypt.cs:line 456]]></stack-trace> </failure> </test> ``` Attached the full testResults.txts: [testResults_System.Security.Cryptography.Cng.Tests.txt](https://github.com/dotnet/corefx/files/1809438/testResults_System.Security.Cryptography.Cng.Tests.txt) [testResults_System.Security.Cryptography.Algorithms.Tests.txt](https://github.com/dotnet/corefx/files/1809439/testResults_System.Security.Cryptography.Algorithms.Tests.txt) " 28044 area-System.Memory ReadOnlySequence constructor validation issues `public ReadOnlySequence(ReadOnlySequenceSegment<T> startSegment, int startIndex, ReadOnlySequenceSegment<T> endSegment, int endIndex)` constructor does not validate some issues. I suggest to add next validations: 1. `endSegment.RunningIndex < 0` to validate that endSegment.RunningIndex not negative. 2. `startSegment != endSegment && (ulong)startSegment.RunningIndex > (ulong)endSegment.RunningIndex - startSegment.Memory.Length` to validate that startSegment.RunningIndex not negative and startSegment.RunningIndex + startSegment.Memory.Length <= endSegment.RunningIndex (validate correct order of startSegment and endSegment). 3. Should we check that end is reachable and all `RunningIndex` are correct? 4. Also this constructor throw `ThrowArgumentValidationException` exception without endIndex parameter. `ThrowHelper.ThrowArgumentValidationException(startSegment, startIndex, endSegment);` I think it should be `ThrowHelper.ThrowArgumentValidationException(startSegment, startIndex, endSegment, endIndex);` If so then `ThrowHelper.ThrowArgumentValidationException` message should be changed also. 28045 area-System.Net Need a thread-safe/scalable credential cache for use in System.Net.Http HttpClientHandler implementations supporting preauthenticate currently use a CredentialCache to store credentials, but CredentialCache is not thread-safe, and since requests might be modifying the cache, all access to it needs to be locked. That means when preauthenticate is enabled, every request needs to take the same lock while accessing the cache to see if it contains credentials for use in that request. 28046 area-System.Collections Support struct Enumerator for ConcurrentDictionary ConcurrentDictionary enables enumerating the dictionary while other threads are modifying it, making it very useful in a variety of scenarios. But its GetEnumerator allocates an enumerator object. We can't change the return type of GetEnumerator, but we can at least expose an enumerator struct to enable enumeration without allocating. Proposal: ```C# namespace System.Collections.Concurrent { public class ConcurrentDictionary<TKey, TValue> { public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator(); // existing public struct Enumerator // new { public Enumerator(ConcurrentDictionary<TKey, TValue> dictionary); public bool MoveNext(); public KeyValuePair<TKey, TValue> Current { get; } } } } ``` Example usage: ```C# private static ConcurrentDictionary<string, int> s_dict = new ConcurrentDictionary<string, int>(); ... var enumerator = new ConcurrentDictionary<string, int>.Enumerator(s_dict); while (enumerator.MoveNext()) { Use(enumerator.Current); } ``` 28047 area-System.Net Fix SocketsHttpHandler.PreAuthenticate behavior Previously PreAuthenticate was causing SocketsHttpHandler to always add a basic auth header on every request if a basic credential could be retrieved from the supplied credentials. This is not how PreAuthenticate is supposed to work. Rather, the handler is supposed to track credentials that have previously been used to successfully authenticate, and then on subsequent requests use credentials from that successfully-authenticated cache. Closes https://github.com/dotnet/corefx/issues/27597 cc: @geoffkizer, @davidsh, @mconnew 28048 area-System.Net Improve HTTP proxy tests This is essentially same as #27344 after doing rebase to current master. It also adds test to demonstrate #27870 28049 area-System.Net "Test System.Net.Tests.HttpRequestStreamTests.Read_FullLengthSynchronous_Success failed with ""Assert.Equal() Failure\nExpected: 9\nActual: 6""" "The test: System.Net.Tests.HttpRequestStreamTests.Read_FullLengthSynchronous_Success(transferEncodingChunked: False, text: \""Non-Empty\"") has failed. Details: https://ci.dot.net/job/dotnet_corefx/job/master/job/centos7.1_debug/5762/testReport/System.Net.Tests/HttpRequestStreamTests/Read_FullLengthSynchronous_Success_transferEncodingChunked__False__text____Non_Empty___/ ~~~ MESSAGE: Assert.Equal() Failure\nExpected: 9\nActual: 6 +++++++++++++++++++ STACK TRACE: at System.Net.Tests.HttpRequestStreamTests.Read_FullLengthSynchronous_Success(Boolean transferEncodingChunked, String text) in /mnt/resource/j/workspace/dotnet_corefx/master/centos7.1_debug/src/System.Net.HttpListener/tests/HttpRequestStreamTests.cs:line 157 --- End of stack trace from previous location where exception was thrown --- ~~~" 28050 area-System.Net Test failure: System.Net.Sockets.Tests.SendReceiveSyncForceNonBlocking / SendRecv_Stream_TCP_LargeMultiBufferSends The test `System.Net.Sockets.Tests.SendReceiveSyncForceNonBlocking/SendRecv_Stream_TCP_LargeMultiBufferSends(listenAt: 127.0.0.1)` has failed. ``` Assert.Equal() Failure Expected: 2490258837 Actual: 3446844880 at System.Net.Sockets.Tests.SendReceive`1.SendRecv_Stream_TCP_LargeMultiBufferSends(IPAddress listenAt) in /root/corefx-1474281/src/System.Net.Sockets/tests/FunctionalTests/SendReceive.cs:line 282 --- End of stack trace from previous location where exception was thrown --- ``` ## History of failures Day | Build | OS | Details -- | -- | -- | -- 3/14 | 20180314.01 | Ubuntu14.04 | [link](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180314.01/workItem/System.Net.Sockets.Tests/analysis/xunit/System.Net.Sockets.Tests.SendReceiveSyncForceNonBlocking~2FSendRecv_Stream_TCP_LargeMultiBufferSends(listenAt:%20127.0.0.1)) (history up to 4/3) 28051 area-System.Net System.Net.Internals.SocketExceptionFactory+ExtendedSocketException : No such device or address "tests failed on Ubuntu16.04 when COMPlus_GCStress=3: ``` <test name=""System.Net.NameResolution.Tests.GetHostByNameTest.DnsObsoleteGetHostByName_EmptyString_ReturnsHostName"" type=""System.Net.NameResolution.Tests.GetHostByNameTest"" method=""DnsObsoleteGetHostByName_EmptyString_ReturnsHostName"" time=""0.2165148"" result=""Fail""> <failure exception-type=""System.Net.Internals.SocketExceptionFactory+ExtendedSocketException""> <message><![CDATA[System.Net.Internals.SocketExceptionFactory+ExtendedSocketException : No such device or address]]></message> <stack-trace><![CDATA[ at System.Net.Dns.InternalGetHostByName(String hostName) in /home/gcsuser/corefx/src/System.Net.NameResolution/src/System/Net/DNS.cs:line 65 at System.Net.Dns.GetHostByName(String hostName) in /home/gcsuser/corefx/src/System.Net.NameResolution/src/System/Net/DNS.cs:line 32 at System.Net.NameResolution.Tests.GetHostByNameTest.DnsObsoleteGetHostByName_EmptyString_ReturnsHostName() in /home/gcsuser/corefx/src/System.Net.NameResolution/tests/FunctionalTests/GetHostByNameTest.cs:line 108]]></stack-trace> </failure> </test> <test name=""System.Net.NameResolution.Tests.GetHostByNameTest.DnsObsoleteBeginEndGetHostByName_EmptyString_ReturnsHostName"" type=""System.Net.NameResolution.Tests.GetHostByNameTest"" method=""DnsObsoleteBeginEndGetHostByName_EmptyString_ReturnsHostName"" time=""0.1970667"" result=""Fail""> <failure exception-type=""System.Net.Internals.SocketExceptionFactory+ExtendedSocketException""> <message><![CDATA[System.Net.Internals.SocketExceptionFactory+ExtendedSocketException : No such device or address]]></message> <stack-trace><![CDATA[ at System.Net.Dns.InternalGetHostByName(String hostName) in /home/gcsuser/corefx/src/System.Net.NameResolution/src/System/Net/DNS.cs:line 65 at System.Net.Dns.ResolveCallback(Object context) in /home/gcsuser/corefx/src/System.Net.NameResolution/src/System/Net/DNS.cs:line 208 --- End of stack trace from previous location where exception was thrown --- at System.Net.Dns.HostResolutionEndHelper(IAsyncResult asyncResult) in /home/gcsuser/corefx/src/System.Net.NameResolution/src/System/Net/DNS.cs:line 358 at System.Net.Dns.EndGetHostByName(IAsyncResult asyncResult) in /home/gcsuser/corefx/src/System.Net.NameResolution/src/System/Net/DNS.cs:line 383 at System.Net.NameResolution.Tests.GetHostByNameTest.DnsObsoleteBeginEndGetHostByName_EmptyString_ReturnsHostName() in /home/gcsuser/corefx/src/System.Net.NameResolution/tests/FunctionalTests/GetHostByNameTest.cs:line 117]]></stack-trace> </failure> </test> ```" 28052 area-System.Drawing System.Drawing.Font equality on Linux platform "font family is a singleton on the windows platform, but not on Linux ``` var font1 = new System.Drawing.Font(""Arial"", 9); var font2 = new System.Drawing.Font(""Arial"", 9); Console.WriteLine(font1.Equals(font2)); // false on the Linux platform only ``` may be the Equals method on the Linux platform should be different." 28053 area-System.Text Consider adding a Regex.Split options overload similar to StringSplitOptions "```csharp namespace System.Text.RegularExpressions { public class Regex { public string[] Split(string input, int count, int startat, RegexSplitOptions options); } public enum RegexSplitOptions { None, IgnoreEmptyEntries } } ``` ## Rationale In cases where you want to split by a specified pattern which is a capturing group itself i.e. (\d+) you will get empty entries back for the following inputs: | Input | Output | Desired | | ------ | -------- | ---------- | | ABC123456DEF | ""ABC"", ""123456"", ""DEF"" | ""ABC"", ""123456"", ""DEF"" | | 123456 | """", ""123456"", """" | ""123456"" | | ABC123456 | ""ABC"", ""123456"", """", | ""ABC"", ""123456"" | | 123456DEF | """", ""123456"", ""DEF"" | ""123456"", ""DEF"" | Also see examples in https://msdn.microsoft.com/en-us/library/ze12yx1d(v=vs.110).aspx" 28055 area-System.Xml XAttribute.ToString() on .NET Core produces different DateTime formats compared to .NET Framework and Mono "On .NET Framework and Mono: ``` cs new DateTime(2018, 1, 1, 12, 13, 14, DateTimeKind.Utc).ToString(""o""); // 2018-01-01T12:13:14.0000000Z new XAttribute(""CreatedTime"", new DateTime(2018, 1, 1, 12, 13, 14, DateTimeKind.Utc)).ToString(); // CreatedTime=""2018-01-01T12:13:14Z"" ``` On .NET Core: ``` cs new DateTime(2018, 1, 1, 12, 13, 14, DateTimeKind.Utc).ToString(""o""); // 2018-01-01T12:13:14.0000000Z new XAttribute(""CreatedTime"", new DateTime(2018, 1, 1, 12, 13, 14, DateTimeKind.Utc)).ToString(); // CreatedTime=""2018-01-01T12:13:14.0000000Z"" ``` Note that on .NET Core, the `XAttribute` serialization uses the same format as the [ISO 8601 DateTime format specifier](https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings#Roundtrip). Whereas, on .NET Framework and Mono, the `XAttribute` serialization uses a reduced format where the "".0000000"" are not present. For us this causes issues because it does not make our XML bidirectionally roundtrippable between client and server (client is Mono and server is .NET Core). " 28056 area-System.Text Regex.Split with RegexOptions.RightToLeft implementation/documentation behavior "I wonder if the current Regex.Split implementation when using in combination with RegexOptions.RightToLeft is what a user would expect. See the below example: ```csharp > Regex.Split(""111-a1b2-111"", @""a(\d)b(\d)"") string[4] { ""111-"", ""1"", ""2"", ""-111"" } > Regex.Split(""111-a1b2-111"", @""a(\d)b(\d)"", RegexOptions.RightToLeft) string[4] { ""111-"", ""2"", ""1"", ""-111"" } ``` The only difference is that the capture groups, if some are used are evaluated from right to left, but not the matches themselves. That's because in the implementation the list of string is reversed at the end but the capture groups are added always from left to right (for loop): (https://github.com/dotnet/corefx/blob/master/src/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Regex.Split.cs#L158). The docs state the following (https://docs.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-options#right-to-left-mode) > The RegexOptions.RightToLeft option changes the search direction only; it does not interpret the regular expression pattern from right to left. That could indicate that the current behavior is fine but that with this rule an iterator implementation is not possible because you would already need the last result (the first from left to right) when you just got the first result (the last from left to right). I think the only way to implement an iterator here is to change the behavior to return the results right to left when RegexOptions.RightToLeft is chosen. cc @vancem @danmosemsft @jkotas @stephentoub @terrajobst @joshfree " 28057 area-Infrastructure Use Intermediate path for GenerateReferenceSource After the new reverse APICompat checks we fail the src build if the ref doesn't match so we don't have a great way to regenerate the reference assembly. By using the intermediate path we can still generate the reference assembly without having a successful src build. cc @ericstj 28058 area-System.IO DeflateStream decompression throughput is dependent on size of internal buffer We have an internal buffer in `DeflateStream` and its size has significant impact on the throughput of the API. Currently this buffer is defined by DefaultBufferSize which is [fixed at 8KB](https://github.com/dotnet/corefx/blob/3fca26cedf6c54aabc100e69106fc7e263db7815/src/System.IO.Compression/src/System/IO/Compression/DeflateZLib/DeflateStream.cs#L16) This was brought to my attention by some partner code that re-implemented DeflateStream to get better performance. The primary difference in their implementation was the size of the backing buffer. A simple fix would be to expose our buffer size. Here's a change that does so: https://github.com/ericstj/corefx/commit/423b9bb0644a432ac565ec1382b571a28012ab8b I measured our performance in relation to this using a [benchmark](https://gist.github.com/ericstj/0651461ac37b1420097f285148c59c80) (partner code removed). Here's the result: ``` Method | Mean | Error | StdDev | --------------------- |---------:|----------:|----------:| <partner-stream> | 26.52 ms | 0.5310 ms | 0.9159 ms | DeflateStreamDefault | 42.59 ms | 0.8534 ms | 1.2239 ms | DeflateStream32kb | 27.21 ms | 0.5415 ms | 0.5318 ms | DeflateStream128kb | 24.76 ms | 0.4891 ms | 0.6007 ms | DeflateStream512kb | 22.09 ms | 0.2712 ms | 0.2265 ms | DeflateStream1024kb | 22.86 ms | 0.4036 ms | 0.3775 ms | ``` Now this may not be the only / best solution but it does put control in the hands of the caller. Other things to consider might be some internal heuristic, pipelines, or even exposing the backing DEFLATE alogrithm as [was done with Brotli](https://github.com/dotnet/corefx/issues/25785). 28059 area-System.Runtime Rethrown exception call stack tests Added tests to verify the reported call stack for rethrown exceptions, as specified by dotnet/coreclr#15780. 1. **Exception rethrown in a method different than the method where it was originally thrown:** the stack trace contains both the location in the method where the exception was originally thrown, and the location where the method that threw the exception was called. 2. **Exception is thrown and later rethrown in the same method:** the stack trace only contains the location where the exception was originally thrown and does not include the location where the exception was rethrown. 28060 area-System.Net HttpClientHandler authentication test cases failing (hang) on Framework run "Contributes: #27113 The `HttpClientHandler_Authentication_Succeeds()` test will fail on Framework run with `System.TimeoutException : WhenAllOrAnyFailed timed out after 60000`, for the below four test data: ``` yield return new object[] { ""Digest realm=withoutquotes, nonce=withoutquotes"", false }; yield return new object[] { ""Digest realm=\""testrealm1\"", nonce=\""testnonce1\"" Digest realm=\""testrealm2\"", nonce=\""testnonce2\"""", false }; yield return new object[] { ""Basic something, Digest something"", false }; yield return new object[] { $""Digest realm=\""testrealm\"", nonce=\""testnonce\"", algorithm=MD5 "" + $""Basic realm=\""testrealm\"""", false }; ```" 28061 area-System.Data SqlConnection fails to reliably keep long-running connection open This issue affects applications such as SQL Operations Studio which have long-running connections (e.g. backing a T-SQL Editor) based on the .Net Core stack. On the .Net Full stack, the connection reliably stays open or reports as non-open in the ConnectionState, allowing the application to reopen as needed. However on the .Net Core stack the state is shown as Open but on attempting any command the command will attempt to run for ~60sec, then fail with an error message > A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 35 - An internal exception was caught) This has a high impact on reliability of tools build on top of .Net Core for SqlClient usage. **Related issue:** https://github.com/Microsoft/sqlopsstudio/issues/870. **Diagnosis by @saurabh500 **: Windows impl of SqlClient sets some Keepalive values which Unix stack doesn’t SqlClient should set the keep alive values. **Original issue details**: - SQL Operations Studio Version: Feb release & latest from master Steps to Reproduce: - Use a macOS machine, such as the one owned by @twright-msft. Not all machines will work (mine is super-reliable for instance) - Run a query against any DB - Walk away for 30min - Re-run the query **Expected**: - Query executes 2nd time around **Actual**: - Executing... spins for ~1minute, then we get an error message in the batch stating - Note that even if we could just get a quick failure in a way where we could then close & reopen the connection that'd be OK. It's the lack of reliability plus a long wait that's making this quite bad. > A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 35 - An internal exception was caught) - If you are running 2 batches, you may see another message: > Query failed: BeginExecuteReader requires an open and available Connection. The connection's current state is open. Note that we're actually checking if the connection isn't open but this isn't reliable when it comes to TCP sockets closing. This may well be a driver-side issue, but any fix/workaround we can apply would be good. Here's our code to close & reopen on issues: ```C# private void VerifyConnectionOpen(DbConnection connection) { if (connection == null) { // Ignore this connection return; } if (connection.State != ConnectionState.Open) { // Note: this will fail and throw to the caller if something goes wrong. // This seems the right thing to do but if this causes serviceability issues where stack trace // is unexpected, might consider catching and allowing later code to fail. But given we want to get // an opened connection for any action using this, it seems OK to handle in this manner ClearPool(connection); connection.Open(); } } ``` We can add connection.Close() in this case which _might_ fix issues where connection is in a broken state, but definitely doesn't fix the error all up. 28062 area-System.Memory Test failure: System.MemoryTests.MemoryTests/OwnedMemoryPinLargeArray Opened on behalf of @danmosemsft The test `System.MemoryTests.MemoryTests/OwnedMemoryPinLargeArray` has failed. System.OutOfMemoryException : Array dimensions exceeded supported range. Stack Trace: at System.MemoryTests.MemoryTests.OwnedMemoryPinLargeArray() Build : Master - 20180314.02 (Full Framework Tests) Failing configurations: - Windows.10.Amd64-x86 - Release - Windows.10.Amd64-x64 - Release 28063 area-System.Reflection A callback was made on a garbage collected delegate of type 'System.Reflection.Emit.ILGeneration.Tests!System.Reflection.Emit.Tests.ILGeneratorEmit4+StringReverseCdecl::Invoke'. OSX10.12 https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180314.02/workItem/System.Reflection.Emit.ILGeneration.Tests/wilogs ``` 2018-03-14 06:18:11,331: INFO: proc(54): run_and_log_output: Output: Discovering: System.Reflection.Emit.ILGeneration.Tests 2018-03-14 06:18:11,481: INFO: proc(54): run_and_log_output: Output: Discovered: System.Reflection.Emit.ILGeneration.Tests 2018-03-14 06:18:11,545: INFO: proc(54): run_and_log_output: Output: Starting: System.Reflection.Emit.ILGeneration.Tests 2018-03-14 06:18:11,759: INFO: proc(54): run_and_log_output: Output: FailFast: 2018-03-14 06:18:11,760: INFO: proc(54): run_and_log_output: Output: A callback was made on a garbage collected delegate of type 'System.Reflection.Emit.ILGeneration.Tests!System.Reflection.Emit.Tests.ILGeneratorEmit4+StringReverseCdecl::Invoke'. 2018-03-14 06:18:11,760: INFO: proc(54): run_and_log_output: Output: 2018-03-14 06:18:11,760: INFO: proc(54): run_and_log_output: Output: at T.F(IntPtr, System.String) 2018-03-14 06:18:11,760: INFO: proc(54): run_and_log_output: Output: at System.RuntimeMethodHandle.InvokeMethod(System.Object, System.Object[], System.Signature, Boolean, Boolean) 2018-03-14 06:18:11,761: INFO: proc(54): run_and_log_output: Output: at System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo) 2018-03-14 06:18:11,761: INFO: proc(54): run_and_log_output: Output: at System.Reflection.Emit.Tests.ILGeneratorEmit4.TestEmitCalliNonBlittable() 2018-03-14 06:18:11,761: INFO: proc(54): run_and_log_output: Output: at System.RuntimeMethodHandle.InvokeMethod(System.Object, System.Object[], System.Signature, Boolean, Boolean) 2018-03-14 06:18:11,761: INFO: proc(54): run_and_log_output: Output: at System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo) 2018-03-14 06:18:11,761: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestInvoker`1+<>c__DisplayClass46_1+<<InvokeTestMethodAsync>b__1>d[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext() 2018-03-14 06:18:11,762: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Xunit.Sdk.TestInvoker`1+<>c__DisplayClass46_1+<<InvokeTestMethodAsync>b__1>d[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], xunit.execution.dotnet, Version=2.2.0.3300, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c]](<<InvokeTestMethodAsync>b__1>d<System.__Canon> ByRef) 2018-03-14 06:18:11,762: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.TestInvoker`1+<>c__DisplayClass46_1[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].<InvokeTestMethodAsync>b__1() 2018-03-14 06:18:11,762: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.ExecutionTimer+<AggregateAsync>d__4.MoveNext() 2018-03-14 06:18:11,763: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Xunit.Sdk.ExecutionTimer+<AggregateAsync>d__4, xunit.execution.dotnet, Version=2.2.0.3300, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c]](<AggregateAsync>d__4 ByRef) 2018-03-14 06:18:11,763: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.ExecutionTimer.AggregateAsync(System.Func`1<System.Threading.Tasks.Task>) 2018-03-14 06:18:11,763: INFO: proc(54): run_and_log_output: Output: at Xunit.Sdk.ExceptionAggregator+<RunAsync>d__9.MoveNext() ``` 28064 area-System.Collections Proposal: ImmutableArray.UnsafeFreeze<T>(T[]) Use case: efficiently creating an `ImmutableArray` with a fixed (>4) number of elements. Presently if you need to create an `ImmutableArray<T>` with a known collection of elements, the most efficient way to do so is to create an `ImmutableArray<T>.Builder`, set its `Capacity` to allocate an array of the correct size, fill the `Builder` with repeated calls to `Add`, and then use `MoveToImmutable` to create the `ImmutableArray`. (This strategy can be marginally improved by storing a cached `Builder` in a `ThreadLocal`.) For element counts smaller than 4, there are [overloads of `ImmutableArray.Create`](https://github.com/dotnet/corefx/blob/99d4271b02b4b0408fa0879651d964bebd3c5cf1/src/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray.cs#L85) which are implemented by creating an array and then immediately turning it into an `ImmutableArray`, but for more than 4 `Create` takes a `params[]` and [copies it](https://github.com/dotnet/corefx/blob/99d4271b02b4b0408fa0879651d964bebd3c5cf1/src/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray.cs#L157) into an `ImmutableArray`. There is no way to create an array directly, fill it, and freeze it into an `ImmutableArray` without copying while pinky-promising never to mutate the original array again. I set up a microbenchmark (see below) which uses codegen to call `ImmutableArray<T>`'s private `T[]` constructor, and it's around 4-5 times faster for an array of 1000 `long`s. I found that a library of mine was spending a reasonable chunk of its time creating `ImmutableArray`s, and [implementing this hack](https://github.com/benjamin-hodgson/Eighty/commit/92a84c826b00a61158a5d17a50e88fb8c925c37a) led to a global ~10% speedup in my end-to-end benchmarks. I'm not entirely happy about depending upon private implementation details like that though. I propose adding a officially-supported static method to freeze an array into an `ImmutableArray` without copying it. I suggest calling it `UnsafeFreeze` to emphasise the fact that this method is risky: to use it correctly you have to make sure never to mutate the array that you passed in. (This name may be confusing given that it doesn't have anything to do with C#'s `unsafe`; I'm open to alternative suggestions.) ```csharp public static class ImmutableArray { [EditorBrowsable(EditorBrowsableState.Never)] // might wanna add [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ImmutableArray<T> UnsafeFreeze<T>(T[] array) => new ImmutableArray<T>(array); } ``` There may be a use case for a similar `UnsafeThaw` method which turns an `ImmutableArray<T>` into a `T[]` without copying, but I can't think of one right now. NB. There is precedent in the BCL for APIs which ask you to relinquish ownership of the argument. `ArrayPool.Return` requires you not to continue using the array you returned because it is liable to get handed out to a future caller of `Rent`. ---------- Here's the code for the microbenchmark I mentioned above (using BenchmarkDotNet): ```csharp public class Bench { static readonly ThreadLocal<ImmutableArray<long>.Builder> _cachedBuilder = new ThreadLocal<ImmutableArray<long>.Builder>(ImmutableArray.CreateBuilder<long>); static readonly Func<long[], ImmutableArray<long>> _unsafeFreeze = GetUnsafeFreeze<long>(); [Benchmark(Baseline = true)] public void CachedBuilder() { var builder = _cachedBuilder.Value; builder.Capacity = 1000; for (long i = 0; i < builder.Capacity; i++) { builder.Add(i); } builder.MoveToImmutable(); } [Benchmark] public void UnsafeFreeze() { var array = new long[1000]; for (long i = 0; i < array.Length; i++) { array[i] = i; } _unsafeFreeze(array); } static Func<T[], ImmutableArray<T>> GetUnsafeFreeze<T>() { var ctor = typeof(ImmutableArray<T>) .GetConstructors(BindingFlags.NonPublic | BindingFlags.Instance) .Single(c => c.GetParameters().Count() == 1 && c.GetParameters().Single().ParameterType.Equals(typeof(T[]))); var param = Expression.Parameter(typeof(T[])); var body = Expression.New(ctor, param); var func = Expression.Lambda<Func<T[], ImmutableArray<T>>>(body, param); return func.Compile(); } } ``` And the results: ``` Method | Mean | Error | StdDev | Scaled | ScaledSD | -------------- |---------:|----------:|----------:|-------:|---------:| CachedBuilder | 8.439 us | 0.1667 us | 0.4089 us | 1.00 | 0.00 | UnsafeFreeze | 1.944 us | 0.0399 us | 0.1169 us | 0.23 | 0.02 | ``` 28065 area-System.Net HttpClientHandler authentication test cases failing on WinHttpHandler & CurlHandler "Contributes: #27113 Authentication test cases will fail on CurlHandler with two errors, `Assert.Equal() Failure` & `TimeoutException`. ## For CurlHandler: ### `Assert.Equal() Failure Expected: OK Actual: Unauthorized` for: `HttpClientHandler_Authentication_Succeeds()` test ``` yield return new object[] { $""Digest realm=\""testrealm\"", nonce=\""{Convert.ToBase64String(Encoding.UTF8.GetBytes($""{DateTimeOffset.UtcNow}:XMh;z+$5|`i6Hx}}\"", qop=auth-int, algorithm=MD5""))}\"""", true }; yield return new object[] { ""Digest realm=\""api@example.org\"", qop=\""auth\"", algorithm=MD5-sess, nonce=\""5TsQWLVdgBdmrQ0XsxbDODV+57QdFR34I9HAbC/RVvkK\"", "" + ""opaque=\""HRPCssKJSGjCrkzDg8OhwpzCiGPChXYjwrI2QmXDnsOS\"", charset=UTF-8, userhash=true"", true }; yield return new object[] { ""dIgEsT realm=\""api@example.org\"", qop=\""auth\"", algorithm=MD5-sess, nonce=\""5TsQWLVdgBdmrQ0XsxbDODV+57QdFR34I9HAbC/RVvkK\"", "" + ""opaque=\""HRPCssKJSGjCrkzDg8OhwpzCiGPChXYjwrI2QmXDnsOS\"", charset=UTF-8, userhash=true"", true }; yield return new object[] { $""Basic realm=\""testrealm\"", "" + $""Digest realm=\""testrealm\"", nonce=\""{Convert.ToBase64String(Encoding.UTF8.GetBytes($""{DateTimeOffset.UtcNow}:XMh;z+$5|`i6Hx}}""))}\"", algorithm=MD5"", true }; ``` `HttpClientHandler_MultipleAuthenticateHeaders_WithSameAuth_Succeeds` test ``` [InlineData(""WWW-Authenticate: Digest realm=\""hello\"", nonce=\""hello\"", algorithm=MD5\r\nWWW-Authenticate: Digest realm=\""hello\"", nonce=\""hello\"", algorithm=MD5\r\n"")] [InlineData(""WWW-Authenticate: Digest realm=\""hello1\"", nonce=\""hello\"", algorithm=MD5\r\nWWW-Authenticate: Digest realm=\""hello\"", nonce=\""hello\"", algorithm=MD5\r\n"")] ``` `HttpClientHandler_MultipleAuthenticateHeaders_Succeeds` test ``` [InlineData(""WWW-Authenticate: Basic realm=\""hello\""\r\nWWW-Authenticate: Digest realm=\""hello\"", nonce=\""hello\"", algorithm=MD5\r\n"")] [InlineData(""WWW-Authenticate: Digest realm=\""hello\"", nonce=\""hello\"", algorithm=MD5\r\nWWW-Authenticate: Basic realm=\""hello\""\r\n"")] ``` ### System.TimeoutException : WhenAllOrAnyFailed timed out after 60000, for: `HttpClientHandler_Authentication_Succeeds()` test ``` yield return new object[] { ""Digest realm=\""testrealm\"" nonce=\""testnonce\"""", false }; yield return new object[] { ""Digest realm=withoutquotes, nonce=withoutquotes"", false }; yield return new object[] { ""Digest realm=\""testrealm1\"", nonce=\""testnonce1\"" Digest realm=\""testrealm2\"", nonce=\""testnonce2\"""", false }; ``` [EDIT]: Remove Windows failures that are now tracked in separate issues - rmkerr" 28066 area-System.Net [wcf.stress]: SocketsHttpHandler has worse perf than WinHttpHandler w/ https and HttpClientCredentialType:Windows "[EDIT: Numbers below were obtained with debug build and do not reflect the difference between the release builds] The settings for this issue were: ``` Test:HelloWorld Binding:Https HttpClientCredentialType:Windows BindingSecurityMode:Transport ``` Summary: SocketsHttpHandler: - StressLevel:1, StressRunDuration:8 No IOException, no pool recycle, single work reported 500 - StressLevel:4, StressRunDuration: 8 Various IOException, no pool recycle, each work reported 100 WinHttpHandler: - StressLevel:1, StressRunDuration:8 Few clr exceptions right at start (~20) no more after, 1 pool recycle, single work reported 1900 - StressLevel:4, StressRunDuration: 8 More clr exceptions right at start (seems proportional to the number of workers) no more after, 1 pool recycle, each work reported 600 So roughly WinHttpHandler can perform 4x more work for single worker and 6x more for 4 workers when Binding:Https HttpClientCredentialType:Windows. The IOExceptions mentioned on the second run of SocketsHttpHandler likely are related to the slowness to complete the requests, here is the callstack of such exceptions: ``` CLR exception type: System.IO.IOException ""Unable to read data from the transport connection: The I/O operation has been aborted because of either a thread exit or an application request."" First chance exceptions are reported before any exception handling. This exception may be expected and handled. *** WARNING: Unable to verify checksum for E:\s\wcf-stress-client\publish\coreclr.dll KERNELBASE!RaiseException+0x68: 00007ffa`17154008 488b8c24c0000000 mov rcx,qword ptr [rsp+0C0h] ss:00000056`3dff9610=0000dbfd92f4e02d 0:059> !pe Exception object: 0000017ec8826fb8 Exception type: System.IO.IOException Message: Unable to read data from the transport connection: The I/O operation has been aborted because of either a thread exit or an application request. InnerException: System.Net.Sockets.SocketException, Use !PrintException 0000017ec8762d58 to see more. StackTrace (generated): SP IP Function 000000563DFFDDF0 00007FF97C0BBA1E System_Net_Sockets!System.Net.Sockets.Socket+AwaitableSocketAsyncEventArgs.ThrowException(System.Net.Sockets.SocketError)+0x3e 000000563DFFDE30 00007FF97BE026F3 System_Net_Sockets!System.Net.Sockets.Socket+AwaitableSocketAsyncEventArgs.GetResult(Int16)+0xb3 000000563DFFDE90 00007FF9D1C71308 System_Private_CoreLib!System.Threading.Tasks.ValueTask`1[[System.Int32, System.Private.CoreLib]].get_Result()+0xd8 000000563DFFDF10 00007FF9D1D08BA8 System_Private_CoreLib!System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1+ConfiguredValueTaskAwaiter[[System.Int32, System.Private.CoreLib]].GetResult()+0x28 000000563DFFDF50 00007FF97C055F59 System_Net_Security!System.Net.Security.SslStreamInternal+<<FillBufferAsync>g__InternalFillBufferAsync|38_0>d`1[[System.Net.Security.SslStreamInternal+SslReadAsync, System.Net.Security]].MoveNext()+0x169 StackTraceString: <none> HResult: 80131620 0:059> !CLRStack OS Thread Id: 0x49fc (59) Child SP IP Call Site 000000563dff9ae8 00007ffa17154008 [HelperMethodFrame: 000000563dff9ae8] 000000563dff9df0 00007ff9d1b2ea21 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 000000563dff9e20 00007ff9d1cec431 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task) 000000563dff9ec0 00007ff9d1cec2ab System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task) 000000563dff9f20 00007ff9d1cec1e7 System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(System.Threading.Tasks.Task) 000000563dff9f60 00007ff9d1c712c7 System.Threading.Tasks.ValueTask`1[[System.Int32, System.Private.CoreLib]].get_Result() 000000563dff9fe0 00007ff9d1d08ba8 System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1+ConfiguredValueTaskAwaiter[[System.Int32, System.Private.CoreLib]].GetResult() 000000563dffa020 00007ff97c0547c6 System.Net.Security.SslStreamInternal+d__34`1[[System.Net.Security.SslStreamInternal+SslReadAsync, System.Net.Security]].MoveNext() 000000563dffa3f0 00007ff9d1d6e10e System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1+c[[System.Int32, System.Private.CoreLib],[System.__Canon, System.Private.CoreLib]].b__9_0(System.Object) 000000563dffa440 00007ff9d1a80c4b System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) 000000563dffa570 00007ff9d1d4ac0f System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Int32, System.Private.CoreLib],[System.__Canon, System.Private.CoreLib]].MoveNext() 000000563dffa600 00007ff9d1cee0f7 System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Runtime.CompilerServices.IAsyncStateMachineBox, Boolean) 000000563dffa690 00007ff9d1c67840 System.Threading.Tasks.Task.RunContinuations(System.Object) 000000563dffa890 00007ff9d1c6759f System.Threading.Tasks.Task.FinishContinuations() 000000563dffa900 00007ff9d1c64a17 System.Threading.Tasks.Task.FinishStageThree() 000000563dffa940 00007ff9d1c649ad System.Threading.Tasks.Task.FinishStageTwo() 000000563dffaa10 00007ff9d1c64561 System.Threading.Tasks.Task.FinishSlow(Boolean) 000000563dffaab0 00007ff9d1c644ba System.Threading.Tasks.Task.Finish(Boolean) 000000563dffaaf0 00007ff9d1c6f69e System.Threading.Tasks.Task`1[[System.Int32, System.Private.CoreLib]].TrySetException(System.Object) 000000563dffab40 00007ff9d1d13b79 System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Int32, System.Private.CoreLib]].SetException(System.Exception) 000000563dffabc0 00007ff97c056151 System.Net.Security.SslStreamInternal+g__InternalFillBufferAsync|38_0>d`1[[System.Net.Security.SslStreamInternal+SslReadAsync, System.Net.Security]].MoveNext() 000000563dffdae8 00007ff9d9ed73da [HelperMethodFrame: 000000563dffdae8] 000000563dffddf0 00007ff97c0bba1e System.Net.Sockets.Socket+AwaitableSocketAsyncEventArgs.ThrowException(System.Net.Sockets.SocketError) 000000563dffde30 00007ff97be026f3 System.Net.Sockets.Socket+AwaitableSocketAsyncEventArgs.GetResult(Int16) 000000563dffde90 00007ff9d1c71308 System.Threading.Tasks.ValueTask`1[[System.Int32, System.Private.CoreLib]].get_Result() 000000563dffdf10 00007ff9d1d08ba8 System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1+ConfiguredValueTaskAwaiter[[System.Int32, System.Private.CoreLib]].GetResult() 000000563dffdf50 00007ff97c055f59 System.Net.Security.SslStreamInternal+g__InternalFillBufferAsync|38_0>d`1[[System.Net.Security.SslStreamInternal+SslReadAsync, System.Net.Security]].MoveNext() 000000563dffe050 00007ff9d1d6e10e System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1+c[[System.Int32, System.Private.CoreLib],[System.__Canon, System.Private.CoreLib]].b__9_0(System.Object) 000000563dffe0a0 00007ff9d1a80c4b System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) 000000563dffe1d0 00007ff9d1d4ac0f System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Int32, System.Private.CoreLib],[System.__Canon, System.Private.CoreLib]].MoveNext() 000000563dffe260 00007ff9d1d45f10 System.Runtime.CompilerServices.ValueTaskAwaiter+c.b__11_1(System.Object) 000000563dffe2b0 00007ff97be02613 System.Net.Sockets.Socket+AwaitableSocketAsyncEventArgs.InvokeContinuation(System.Action`1, System.Object, Boolean) 000000563dffe3a0 00007ff97be0222e System.Net.Sockets.Socket+AwaitableSocketAsyncEventArgs+c.b__27_2(System.Object, System.Net.Sockets.SocketAsyncEventArgs) 000000563dffe450 00007ff97bde07da System.Net.Sockets.SocketAsyncEventArgs.OnCompleted(System.Net.Sockets.SocketAsyncEventArgs) 000000563dffe4b0 00007ff97bde0740 System.Net.Sockets.SocketAsyncEventArgs.ExecutionCallback(System.Object) 000000563dffe4f0 00007ff9d1a80c4b System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) 000000563dffe620 00007ff9d1a80a75 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) 000000563dffe660 00007ff97c0bb7af System.Net.Sockets.SocketAsyncEventArgs.FinishOperationAsyncFailure(System.Net.Sockets.SocketError, Int32, System.Net.Sockets.SocketFlags) 000000563dffe6b0 00007ff97c0bb67d System.Net.Sockets.SocketAsyncEventArgs.HandleCompletionPortCallbackError(UInt32, UInt32, System.Threading.NativeOverlapped*) 000000563dffe730 00007ff97bddf602 System.Net.Sockets.SocketAsyncEventArgs+c.b__173_0(UInt32, UInt32, System.Threading.NativeOverlapped*) 000000563dffe790 00007ff9d1d483f4 System.Threading.ThreadPoolBoundHandleOverlapped.CompletionCallback(UInt32, UInt32, System.Threading.NativeOverlapped*) 000000563dffe810 00007ff9d1d84441 System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32, UInt32, System.Threading.NativeOverlapped*) 000000563dffeb68 00007ff9da584fc3 [GCFrame: 000000563dffeb68] 000000563dfff000 00007ff9da584fc3 [DebuggerU2MCatchHandlerFrame: 000000563dfff000] 0:059> !PrintException /d 0000017ec8762d58 Exception object: 0000017ec8762d58 Exception type: System.Net.Sockets.SocketException Message: The I/O operation has been aborted because of either a thread exit or an application request InnerException: <none> StackTrace (generated): <none> StackTraceString: <none> HResult: 80004005 ```" 28067 area-System.Runtime StringBuilder Insert causes suboptimal memory allocation See https://github.com/dotnet/corefx/issues/27625#issuecomment-369791334 for full discussion. https://github.com/dotnet/coreclr/pull/16926 fixes the major problem which is unbounded growth. However in #27625 it's also observed that Insert has a potentially suboptimal chunk use strategy: Insert does not try hard to reuse space (it won't shuffle along more than 32 characters) so it's fairly easy to end up prepending a new block. Those prepended blocks are made only as big as needed but no less than the default of 16. So Inserts of less than 16 leave slack space that will remain unused unless there are more inserts into that chunk no more than 16 from the end of it so that its contents get shuffled along. If there's an insert at the end of that block it will create a new block rather than writing to the dead area. eg given `|0123456789012345|` (where | is block end) inserting `0123456789` leaves us with `|0123456789......|0123456789012345|` . This leaves 6 array entries permanently dead unless there is another insert after the 10th character. Still one could argue it is optimizing for inserting directly after the last insert rather than at the front again. However it doesn't do that either as then inserting `abc` at offset 10 gives us `|0123456789......|abc.............|0123456789012345|` rather than `|0123456789abc..|0123456789012345|` as you might expect. Two potential changes to make here * When insert pre-pends a new first chunk, consider writing the characters to the end of the chunk rather than the start of it since it's probably more likely that a subsequent Insert would be at index 0 rather than index n+1. (As for insert adding interior chunks, I do not know whether the behavior is better one way or the other) * Insert should certainly write to slack space before making a new block. StringBuilder is intentionally heavily optimized for Append not Insert and it's already complex. Any changes to improve Insert must not impair Append nor make the implementation even more complex. 28068 area-System.Xml Fix XAttribute Date Formatting .net core is producing slightly different date format than what the full framework does. This change is fixing that for the compatibility sake. Fixes #28055 28069 area-System.Xml Investigate if there is a duplicate code in the common folder for XmlSchema As @danmosemsft has mentioned in https://github.com/dotnet/corefx/issues/28055 there are two copies of XsdDateTime which might be the same: ``` C:\git\corefx\src\Common\src\System\Xml\Schema\XsdDateTime.cs C:\git\corefx\src\System.Private.Xml\src\System\Xml\Schema\XsdDateTime.cs ``` If that is the case there might be more copies of other files from XmlSchema as well. Investigate and remove any duplicate code. 28073 area-System.Memory Port SequentialEqual() optimizations to ReadOnlySpan overloads 28075 area-System.Net Ensure SocketsHttpHandler throws TaskCanceledExceptions instead of OperationCanceledExceptions To increase compatibility, as other handlers often throw the derived type instead of the base type, as a side-effect of how they were implemented. Depends on https://github.com/dotnet/coreclr/pull/16939 cc: @geoffkizer 28079 area-Infrastructure [1.1] Expand the RID graph, fix clang5 build This ports the change necessary to fix building on clang5 and updates the RID graph to be up-to-date with recent new OSs. Unblocks running on Fedora27, OpenSuse42.3 in particular. 28080 area-System.Memory Use vectorized T=byte implementations to optimize all MemoryExtensions APIs for T != byte Related to https://github.com/dotnet/corefx/issues/27487 and partially addresses https://github.com/dotnet/corefx/issues/27379 Builds on top of https://github.com/dotnet/corefx/pull/27859 / https://github.com/dotnet/corefx/pull/28073 **TODO:** ~Add more unit tests and~ ~measure performance impact~ cc @AtsushiKan, @jkotas, @stephentoub, @KrzysztofCwalina 28082 area-System.Console Test failure: ReadAndWrite/OutputEncodingPreamble Opened on behalf of @Sunny-pu The test `ReadAndWrite/OutputEncodingPreamble` has failed. System.IO.IOException : The parameter is incorrect Stack Trace: at System.ConsolePal.SetConsoleOutputEncoding(Encoding enc) at System.Console.set_OutputEncoding(Encoding value) at ReadAndWrite.OutputEncodingPreamble() Build : 2.0.0 - 20180314.01 (Core Tests) Failing configurations: - windows.10.amd64.iot-x64 - Release Details: https://mc.dot.net/#/product/netcore/200/source/official~2Fcorefx~2Frelease~2F2.0.0~2F/type/test~2Ffunctional~2Fcli~2F/build/20180314.01/workItem/System.Console.Tests/analysis/xunit/ReadAndWrite~2FOutputEncodingPreamble 28083 area-System.Globalization Test failure: System.Globalization.Tests.CalendarHelpers/ToDateTime_Invalid(calendar: JapaneseLunisolarCalendar { AlgorithmType = LunisolarCalendar, Eras = [5, 4, 3], IsReadOnl) Opened on behalf of @Sunny-pu The test `System.Globalization.Tests.CalendarHelpers/ToDateTime_Invalid(calendar: JapaneseLunisolarCalendar { AlgorithmType = LunisolarCalendar, Eras = [5, 4, 3], IsReadOnl)` has failed. Assert.Throws() Failure\r Expected: typeof(System.ArgumentOutOfRangeException)\r Actual: (No exception was thrown) Stack Trace: at System.Globalization.Tests.CalendarHelpers.ToDateTime_Invalid(Calendar calendar) Build : 2.0.0 - 20180314.01 (Core Tests) Failing configurations: - windows.10.amd64.iot-x64 - Release Details:https://mc.dot.net/#/product/netcore/200/source/official~2Fcorefx~2Frelease~2F2.0.0~2F/type/test~2Ffunctional~2Fcli~2F/build/20180314.01/workItem/System.Globalization.Calendars.Tests 28084 area-System.Net Avoid lots of small allocations when parsing Uri with IP address "When using a member like Uri.AbsoluteUri on a Uri created from an IPv4 address string like ""127.0.0.1"", it ends up calling ParseCanonicalName, which boxes four bytes and then allocates an object[] to store them and periods to pass to string.Concat. We can instead just format ourselves onto a span on the stack, avoiding all four boxes and the object[]. cc: @krwq, @ahsonkhan " 28085 area-System.IO Test failure: System.IO.Tests.PathTests/GetInvalidFileNameChars_OtherCharsValid Opened on behalf of @Sunny-pu The test `System.IO.Tests.PathTests/GetInvalidFileNameChars_OtherCharsValid` has failed. Assert.Equal() Failure\r ↓ (pos 3)\r Expected: C:\\data\\helix\\work\\71360258-a4a4-4a3a-806f-b···\r Actual: C:\\Data\\helix\\work\\71360258-a4a4-4a3a-806f-b···\r ↑ (pos 3) Stack Trace: at System.IO.Tests.PathTests.GetInvalidFileNameChars_OtherCharsValid() Build : 2.0.0 - 20180314.01 (Core Tests) Failing configurations: - windows.10.amd64.iot-x64 - Release Details: https://mc.dot.net/#/product/netcore/200/source/official~2Fcorefx~2Frelease~2F2.0.0~2F/type/test~2Ffunctional~2Fcli~2F/build/20180314.01/workItem/System.Runtime.Extensions.Tests/analysis/xunit/System.IO.Tests.PathTests~2FGetInvalidFileNameChars_OtherCharsValid 28086 area-System.Net Avoid allocating long[] in Uri's ParseNonCanonical Avoid the long[] allocated while creating a Uri from an IPv4 address. cc: @krwq, @ahsonkhan 28087 area-System.Threading Test failure: System.Threading.Threads.Tests.ThreadTests/ApartmentStateTest_ChangeBeforeThreadStarted_Windows(getApartmentState: Func`2 { Method = System.Threading.ApartmentState <ApartmentStateTest_MemberData>) Opened on behalf of @Sunny-pu The test `System.Threading.Threads.Tests.ThreadTests/ApartmentStateTest_ChangeBeforeThreadStarted_Windows(getApartmentState: Func`2 { Method = System.Threading.ApartmentState <ApartmentStateTest_MemberData>)` has failed. Assert.Equal() Failure\r Expected: MTA\r Actual: STA Stack Trace: at System.Threading.Threads.Tests.ThreadTests.ApartmentStateTest_ChangeBeforeThreadStarted_Windows(Func`2 getApartmentState, Func`3 setApartmentState, Int32 setType) Build : 2.0.0 - 20180314.01 (Core Tests) Failing configurations: - windows.10.amd64.iot-x64 - Release Details: https://mc.dot.net/#/product/netcore/200/source/official~2Fcorefx~2Frelease~2F2.0.0~2F/type/test~2Ffunctional~2Fcli~2F/build/20180314.01/workItem/System.Threading.Thread.Tests/analysis/xunit/System.Threading.Threads.Tests.ThreadTests~2FApartmentStateTest_ChangeBeforeThreadStarted_Windows(getApartmentState:%20Func%602%20%7B%20Method%20=%20System.Threading.ApartmentState%20%3CApartmentStateTest_MemberData%3E) 28088 area-System.Net improve handling of proxy environmental variables fixes #27871 This change has three improvements: - The special characters in passwords mentioned in linked issue - handling of [xx::xx] IPv6 format - domain\user format I added new test with parametrized execution. 28089 area-System.IO Windows interop fixes for System.Runtime.Extensions - Allow for long paths in GetCurrentDirectory - Use ValueStringBuilder instead of StringBuilder - Handle buffer growth cc: @danmosemsft, @Anipik, @pjanotti, @jkotas, @joperezr, @AlexGhiondea 28093 area-System.IO System.IO.Tests.EnumerableTests/EnumerateDirectories_NonBreakingSpace failing on OSX "``` Assert.Equal() Failure Expected: String[] [\""/tmp/EnumerableTests_zyuc5nbu.hrc/EnumerateDirecto\""..., \""/tmp/EnumerableTests_zyuc5nbu.hrc/EnumerateDirecto\""...] Actual: FileSystemEnumerable<String> [\""/tmp/EnumerableTests_zyuc5nbu.hrc/EnumerateDirecto\""..., \""/tmp/EnumerableTests_zyuc5nbu.hrc/EnumerateDirecto\""...] ``` https://mc.dot.net/#/user/Anipik/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/26b967e2aab520a0da79c316024360f635dc937d/workItem/System.IO.FileSystem.Tests/analysis/xunit/System.IO.Tests.EnumerableTests~2FEnumerateDirectories_NonBreakingSpace cc @JeremyKuhne @danmosemsft " 28094 area-System.IO Fixing NonBreakingSpace test on OSX Fixes https://github.com/dotnet/corefx/issues/28093 28095 area-System.Memory Expanded the CommonReadOnlySequenceTests I expanded the ReadOnlySequence Common Tests and some of them fails. I think this is code issues. 28096 area-System.IO Enumeration.ExampleTests.TestGetFilesWithExtensions failed in CI "https://mc.dot.net/#/user/jkotas/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/a327a1bfaf988ecb8a45dc6b61462ada4f1af52d/workItem/System.IO.FileSystem.Tests/analysis/xunit/System.IO.Tests.Enumeration.ExampleTests~2FTestGetFilesWithExtensions ``` OSX.1012.Amd64.Open-Debug-x64 Unhandled Exception of Type Xunit.Sdk.EqualException Message : Assert.Equal() Failure Expected: SelectIPartitionIterator<String, String> [\""file.one\"", \""file.three\""] Actual: SelectIPartitionIterator<String, String> [\""file.one\"", \""file.three\""] Stack Trace : at System.IO.Tests.FSAssert.EqualWhenOrdered[T](IEnumerable`1 expected, IEnumerable`1 actual) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.IO.FileSystem/tests/FSAssert.cs:line 70 at System.IO.Tests.Enumeration.ExampleTests.TestGetFilesWithExtensions() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.IO.FileSystem/tests/Enumeration/ExampleTests.netcoreapp.cs:line 70 ``` cc: @JeremyKuhne " 28097 area-System.Net Websockets - receiving messages in chunks does not detect message size or properly set EndOfMessage flag see https://stackoverflow.com/questions/49299333/websockets-in-net-core-2-0-receiving-messages-in-chunks This works correctly in .NET 4.6.1 but not in .NET Core. 28098 area-System.Net Avoid recvmsg system call when 0-byte receive completes async This eliminates a system call when user does a zero-byte receive. Zero-bytes receives are used on servers to avoid allocating memory to idle connections. The zero-byte receive returns when the socket becomes readable. When the socket becomes readable, the implementation performs a receive. This is needed to get the result for a non zero-byte receive. For the zero-byte receive, we can eliminate this system call. 28099 area-System.Diagnostics Flaky tests BasicEventSourceTests.TestsWriteEvent/Test_WriteEvent_SelfDescribing_ETW and Test_WriteEvent_Manifest_ETW Opened on behalf of @danmosemsft The test `BasicEventSourceTests.TestsWriteEvent/Test_WriteEvent_SelfDescribing_ETW` has failed. Assert.Equal() Failure\r Expected: \r Actual: x Stack Trace: at BasicEventSourceTests.TestsWriteEvent.<>c__DisplayClass10_1.<Test_WriteEvent>b__31(Event evt) in E:\A\_work\63\s\corefx\src\System.Diagnostics.Tracing\tests\BasicEventSourceTest\TestsWriteEvent.cs:line 351 at BasicEventSourceTests.EventTestHarness.<>c__DisplayClass2_0.<RunTests>b__0(Event data) in E:\A\_work\63\s\corefx\src\System.Diagnostics.Tracing\tests\BasicEventSourceTest\Harness\EventTestHarness.cs:line 82 at BasicEventSourceTests.EtwListener.OnEventHelper(TraceEvent data) in E:\A\_work\63\s\corefx\src\System.Diagnostics.Tracing\tests\BasicEventSourceTest\Harness\Listeners.cs:line 258 at Microsoft.Diagnostics.Tracing.Parsers.DynamicTraceEventData.Dispatch() at Microsoft.Diagnostics.Tracing.TraceEventDispatcher.DoDispatch(TraceEvent anEvent) at Microsoft.Diagnostics.Tracing.TraceEventDispatcher.Dispatch(TraceEvent anEvent) at Microsoft.Diagnostics.Tracing.ETWTraceEventSource.RawDispatch(EVENT_RECORD* rawData) at Microsoft.Diagnostics.Tracing.TraceEventNativeMethods.ProcessTrace(UInt64[] handleArray, UInt32 handleCount, IntPtr StartTime, IntPtr EndTime) at Microsoft.Diagnostics.Tracing.ETWTraceEventSource.ProcessOneFile() at Microsoft.Diagnostics.Tracing.ETWTraceEventSource.Process() at BasicEventSourceTests.EtwListener.Dispose() in E:\A\_work\63\s\corefx\src\System.Diagnostics.Tracing\tests\BasicEventSourceTest\Harness\Listeners.cs:line 238 at BasicEventSourceTests.EventTestHarness.RunTests(List`1 tests, Listener listener, EventSource source, FilteringOptions options) in E:\A\_work\63\s\corefx\src\System.Diagnostics.Tracing\tests\BasicEventSourceTest\Harness\EventTestHarness.cs:line 170 at BasicEventSourceTests.TestsWriteEvent.Test_WriteEvent(Listener listener, Boolean useSelfDescribingEvents) in E:\A\_work\63\s\corefx\src\System.Diagnostics.Tracing\tests\BasicEventSourceTest\TestsWriteEvent.cs:line 430 at BasicEventSourceTests.TestsWriteEvent.Test_WriteEvent_SelfDescribing_ETW() in E:\A\_work\63\s\corefx\src\System.Diagnostics.Tracing\tests\BasicEventSourceTest\TestsWriteEvent.cs:line 79 Build : Master - 20180314.07 (Core Tests) Failing configurations: - Windows.10.Amd64.Core-x86 - Debug - Windows.10.Amd64-x86 - Debug 28100 area-System.Reflection Using System.Reflection.TypeExtensions.GetProperties in .NET Core 2.0 "I am using a Class Library project, whose target frameworks are `net451` and `netstandard1.6`, which dynamically compiles a class in a way similar to the example here (a ""standard"" way to do the compilation): https://github.com/dotnet/roslyn/issues/16211#issuecomment-372998985 but inside a method in `MyClass`, I want to retrieve all public properties like this (the actual code is the string of this, which is passed to `CSharpSyntaxTree.ParseText`: ```csharp using System; public class MyClass { public static void Print() { #if NET451 var props = this.GetType().GetProperties(System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public); #else var props = System.Reflection.TypeExtensions.GetProperties(this.GetType(), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public); #endif //additional code } } ``` Now, the Class Library project is referenced by an ASP.NET Core web app (assume any third party app that I have no control over), which targets `netcore1.1` and as [`System.Reflection.TypeExtensions.GetProperties` is available](https://docs.microsoft.com/en-us/dotnet/api/system.reflection.typeextensions.getproperties?view=netcore-1.1#System_Reflection_TypeExtensions_GetProperties_System_Type_System_Reflection_BindingFlags_), it is working as expected. However, targeting `netcore2.0` throws an error although it looks like the [method should still be available](https://docs.microsoft.com/en-us/dotnet/api/system.reflection.typeextensions.getproperties?view=netcore-2.0#System_Reflection_TypeExtensions_GetProperties_System_Type_System_Reflection_BindingFlags_). The alternative (used for `net451` above): ```csharp var props = this.GetType().GetProperties(System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public); ``` is actually working for `netcore2.0`, but not for `netcore1.0` or `netcore1.1`. Also note that this happens only when compiling the class dynamically - using the `MyClass`s `Print` method definition works OK in both `netcore1.0` and `netcore2.0` without the dynamic compilation. Can you provide more information why this is happening and if it is required for the `netcore2.0` project to ""provide"" the `System.Reflection.TypeExtensions` package?" 28101 area-Serialization Update warning messages Fix #27488 @zhenlan @huanwu @mconnew 28104 area-System.Runtime Changes string constructor ```csharp new String ((sbyte*) null, 0, 0, Encoding.Default) ``` System.ArgumentOutOfRangeException: Pointer startIndex and length do not refer to a valid string. Parameter name: value to throw the same exception as with ```csharp new String ((sbyte*) null, 0, 0, null) ``` Unhandled Exception: System.ArgumentNullException: Value cannot be null. Parameter name: value 28105 area-System.Net WinHttpHandler: Check available credentials when choosing authentication scheme When choosing what authentication scheme to use, WinHttpHandler picks the most secure scheme supported by the server. When the client does not support this scheme it closes the connection. We need to instead pick the most secure scheme offered by the server and supported by the client. The incorrect behavior occurs under the following conditions: - There are at least two authentication schemes enabled on the server. - The user only provides credentials that have an authentication scheme less secure than the most secure option offered by the server. In the conditions described in the original report, the user provides NTLM credentials, but the server supports both NTLM and Negotiate (which is considered more secure). WinHttpHandler erroneously chooses to attempt authentication with Negotiate. When we later detect that there are no credentials in the cache that support Negotiate, we close the connection. The fix is a simple change to `WinHttpAuthHelper`, and an additional test. There is an open issue tracking auth problems with Windows Nano, so depending on the results in CI I may disable the test there. Fixes: #27672 28106 area-System.Net Enable SendReceive_VaryingLengthBuffers_Success test Have run the test 200 times locally on Ubuntu VM, no failure. Will enable the test. Related: #23765 28107 area-System.Net Issue with HttpClient with Client Certificate on Ubuntu 16.04 "Ubuntu 16.04 .net sdk 2.1.4 We have an issue making a Https Request with httpClient in Ubuntu 16.04 Sample code ``` using (var client = new HttpClient()) { var contents = await client.GetStringAsync(""https://mplampla.org/get""); Console.WriteLine(contents); } ``` We get this error ``` Unhandled Exception: System.AggregateException: One or more errors occurred. (An error occurred while sending the request.) ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.CurlException: Problem with the SSL CA cert (path? access rights?) at System.Net.Http.CurlHandler.ThrowIfCURLEError(CURLcode error) at System.Net.Http.CurlHandler.MultiAgent.FinishRequest(StrongToWeakReference`1 easyWrapper, CURLcode messageResult) --- End of inner exception stack trace --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() at System.Net.Http.HttpClient.<FinishSendAsyncUnbuffered>d__59.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() at System.Net.Http.HttpClient.<GetStringAsyncCore>d__27.MoveNext() --- End of inner exception stack trace --- at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification) at tests.Program.Main(String[] args) in /home/user/tests/Program.cs:line 14 ``` In our windows pc works perfectly. This website uses Let'sEncrypt for ssl. Do we have any workaround? We searched the backlog and there are a lot similar issues but no workaround was found. thank you" 28108 area-System.Net Fix WebException to handle SocketsHttpHandler generated errors Now that we are using the new handler within HttpClient, we have to revise the code that maps various exceptions to enum values of the WebExceptionStatus. We have separate versions of this mapping for Windows vs. Linux. But the new handler runs on both. So, added a common helper method. There will probably be additional mappings we need to do here. But for now, this PR fixes the issue. Fixes #27906 28111 area-Infrastructure [1.1] Add packaging for Fedora27, OpenSuse423, Ubuntu1804 Adds packaging for servicing builds for Fedora27, OpenSuse 423, and Ubuntu1804. Requires https://github.com/dotnet/corefx/pull/28079 cc: @weshaggard @ericstj 28113 area-Serialization Area-Serialization Sprint 133 The issue is for tracking issues to be done in sprint 133 (due by 4/6/2018) 28114 area-Meta Announcement: Driving towards zero 2.1 bugs by March 31 (ZBB) "As we are getting closer to .NET Core 2.1 [ship dates](https://github.com/dotnet/core/blob/master/roadmap.md#upcoming-ship-dates), we would like to **drive [2.1.0 bugs](https://github.com/dotnet/corefx/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20milestone%3A2.1.0) close to 0 by March 31** = ZBB (zero bug bounce) date. Note: We will keep fixing 2.1 issues after that, until the final release (exact dates are not announced yet), but hopefully not in large masses. We would like to encourage and ask our contributors to help us drive towards that goal. **Be part of .NET Core 2.1 release!** How can you, the CoreFX contributors, help? 1. If you're picking up issues to work on, **prefer issues marked as [2.1.0 bugs](https://github.com/dotnet/corefx/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20milestone%3A2.1.0)** (some are even [up-for-grabs](https://github.com/dotnet/corefx/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20milestone%3A2.1.0%20label%3Aup-for-grabs)). 2. If you spot something in [Future](https://github.com/dotnet/corefx/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20milestone%3AFuture) milestone that should be part of 2.1, please say so and explain why (loop in @karelz). Conversely if there's something in 2.1 that is not as significant as it seems. * We strive to deliver high-quality product, so **impactful bugs, compatibility, reliability and performance issues** are top priority. We want to be highly compatible with .NET Core 2.0. * Adding additional new APIs, fixing pre-existing bugs or fixing corner-case issues with lower impact and with existing workaround is lower priority, not tracked as 2.1. We will delay such contributions until master branch reopens for post-2.1 work (early April). 3. Issues with [no milestone](https://github.com/dotnet/corefx/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20no%3Amilestone) - we expect to set their milestone by end of week (part of ongoing ""triage""), so if you see something must-have for 2.1 there, please say so and explain why (loop in @karelz). 4. Watch for upcoming official preview announcements (on [.NET blog](https://blogs.msdn.microsoft.com/dotnet/) or on [dotnet/Announcements repo](https://github.com/dotnet/announcements)) to help validate and dogfood the end-to-end .NET Core 2.1 experience before final release. * You can start with [.NET Core 2.1 Preview 1](https://blogs.msdn.microsoft.com/dotnet/2018/02/27/announcing-net-core-2-1-preview-1/) released on Feb 27. * You can also dogfood our daily builds - see [dogfooding steps](https://github.com/dotnet/corefx/blob/master/Documentation/project-docs/dogfooding.md) Not surprisingly, to deliver overall end-to-end .NET Core 2.1 experience, similar ZBB efforts happen in our sister repos like [CoreCLR](https://github.com/dotnet/coreclr), [core-setup](https://github.com/dotnet/core-setup), etc. - we will welcome help in those as well, if you're interested. Twitter announcement: https://twitter.com/ziki_cz/status/974383981436088320" 28115 area-System.Collections Adding a null value to ConcurrentDictionary using System.Collections.IDictionary interface causes exception Fixes #26447 There are quite a lot of changes in `ConcurrentDictionary.cs`, but they are only trailing whitespaces (I have an extension which removes them automatically). The real change is on the line 1580. 28116 area-System.Net System.Net.Http.Functional.Tests are consistently failing in OSX CI Most of the runs are failing with -3 running System.Net.Http.Functional.Tests: https://ci3.dot.net/job/dotnet_corefx/job/master/job/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/ @davidsh, @wfurt 28118 area-System.Memory Improve test coverage of Span.SequenceCompareTo for T != byte We need to add more tests for MemoryExtensions SequenceCompareTo for T = int, long, string, etc. For context - https://github.com/dotnet/corefx/pull/28080#discussion_r174811155 28119 area-System.Net HttpClient can sometime take long time to get response "This was originally reported by @avanderhoorn. According to their telemetry some simple requests are taking more than 30s to complete: > We have an issue where around 2.75% of our Http Client requests to the server are taking longer than 5s and around 1% take longer than 20s. > > Normally this wouldn’t be that hard to track down, but unfortunately in all cases the server is saying that it responded in under 1.5s, 2s at the absolute most (note this finding is consistent between app level and nginx telemetry), yet the client is reporting very different figures. > > Looking at the data, this issue seems to happen statically more on a Mac than it does on windows (data since Thurs): > 5s> > Win 74 machines, 142 hits > Mac 156 machines, 639 hits > 20s > > Win 16 machines, 36 hits > Mac 110 machines, 199 hits > All > Win 1102 machines, 11683 hits > Mac 1130 machines, 16991 hits After some investigation it seems like this is caused by using stalled connection from connection pool. The basic repro is to make HTTP request, wait 5+ minutes and do do another request. When second request goes out write to socket buffer succeeds and client waits Timeout for response. TCP stack keeps retransmitting data and it will eventually fail ~ 30s on OSX. ``` c# using System; using System.Threading; using System.Threading.Tasks; using System.Net.Http; using System.Diagnostics; namespace osx { class Program { static public async Task Run() { var httpClient = new HttpClient() { BaseAddress = new Uri(""https://insiders.liveshare.vsengsaas.visualstudio.com/"") }; var runCount = 1; var timeoutIncrement = 30000; var timeout = 390000; //6.5min while (true) { Console.WriteLine($""Run: {runCount++} ({timeout})""); var timer = Stopwatch.StartNew(); try { var request = new HttpRequestMessage(HttpMethod.Get, $""/api/v0.2/workspace/a{runCount}""); var response = await httpClient.SendAsync(request); Console.WriteLine($""\tStatus: {(int)response.StatusCode} - {response.RequestMessage.RequestUri.AbsoluteUri}""); response = null; } catch (Exception e) { timer.Stop(); Console.WriteLine($""\tError: {timer.ElapsedMilliseconds} - {e.ToString()}""); Console.ReadLine(); } timer.Stop(); Console.WriteLine($""\tCompleted: {timer.ElapsedMilliseconds}""); Thread.Sleep(timeout); timeout += timeoutIncrement; } } static void Main(string[] args) { Console.WriteLine(""Hello World!""); Run().GetAwaiter().GetResult(); Console.WriteLine(""All DONE""); } } } ``` The server uses Azure load-ballancer and it will drop idle connections after while without sending FIN, RST or ICMP. This is similar to behavior of some firewalls. Using code above it is trivial to reproduce on OSX with 2.0 core. 2.1 with curl handler has same issue. On Ubuntu 16 the code above does not repro. Client starts sending keep-alive probes after 75s and connection fails before next attempt happen. (at least with current repro and firewall setting) Note that there may be differences between versions as there is nothing explicit HttpClient does to make it happen. On Windows 10, we seems to drop the connection after being idle for 60s and the delay does not repro. This can be perhaps impacted by version or OS setting. Telemetry show predominant failures on Windows 7. I also tested this with 2.1 and HttpSocketHandler. It does not repro as we retire connection from pool after 2 minutes. I have not seen any attempts for keep-alive and the problem could re-surface if default timeout is increased on pool or if there is more aggressive firewall cleanup. This would probably be good thing to consider. As workaround one can use ""Connection: close"" header or stop reusing connection pooling. " 28121 area-Meta Change csharp_indent_labels from flush_left to one_less_than_current Most of the places where we use goto and labels (that I have come across) use one_less_than_current formatting pattern. I will make the same change in coreclr as well - https://github.com/dotnet/coreclr/pull/16983 cc @jkotas, @danmosemsft, @cod7alex, @karelz, @tannergooding 28122 area-System.Net CI fail in System.Net.Http.Functional.Tests.HttpClientHandler_Authentication_Test.PreAuthenticate_FirstRequestNoHeader_SecondRequestVariousStatusCodes_ThirdRequestPreauthenticates ## Failure details ``` Unhandled Exception of Type System.Net.Http.HttpRequestException Message : System.Net.Http.HttpRequestException : An error occurred while sending the request. ---- System.Net.Http.WinHttpException : The server returned an invalid or unrecognized response at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 479 at System.Net.Http.Functional.Tests.HttpClientHandler_Authentication_Test.<>c__DisplayClass12_0.<<PreAuthenticate_FirstRequestNoHeader_SecondRequestVariousStatusCodes_ThirdRequestPreauthenticates>b__0>d.MoveNext() in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.Authentication.cs:line 307 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.<>c__DisplayClass11_0.<<CreateClientAndServerAsync>b__0>d.MoveNext() in D:\j\workspace\windows-TGrou---74aa877a\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 84 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.CreateServerAsync(Func`2 funcAsync, Options options) in D:\j\workspace\windows-TGrou---74aa877a\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 67 at System.Net.Http.Functional.Tests.HttpClientHandler_Authentication_Test.PreAuthenticate_FirstRequestNoHeader_SecondRequestVariousStatusCodes_ThirdRequestPreauthenticates(HttpStatusCode statusCode) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.Authentication.cs:line 297 --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Environment.get_StackTrace() in D:\j\workspace\windows-TGrou---74aa877a\src\System.Runtime.Extensions\src\System\Environment.cs:line 146 at System.Runtime.ExceptionServices.ExceptionStackTrace.AddCurrentStack(Exception exception) in D:\j\workspace\windows-TGrou---74aa877a\src\Common\src\System\Runtime\ExceptionServices\ExceptionStackTrace.cs:line 23 at System.Net.Http.WinHttpException.CreateExceptionUsingError(Int32 error) in D:\j\workspace\windows-TGrou---74aa877a\src\Common\src\System\Net\Http\WinHttpException.cs:line 56 at System.Net.Http.WinHttpRequestCallback.OnRequestError(WinHttpRequestState state, WINHTTP_ASYNC_RESULT asyncResult) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpRequestCallback.cs:line 324 at System.Net.Http.WinHttpRequestCallback.RequestCallback(IntPtr handle, WinHttpRequestState state, UInt32 internetStatus, IntPtr statusInformation, UInt32 statusInformationLength) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpRequestCallback.cs:line 104 at System.Net.Http.WinHttpRequestCallback.WinHttpCallback(IntPtr handle, IntPtr context, UInt32 internetStatus, IntPtr statusInformation, UInt32 statusInformationLength) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpRequestCallback.cs:line 47 --- End of stack trace from AddCurrentStack --- at System.Threading.Tasks.RendezvousAwaitable`1.GetResult() in D:\j\workspace\windows-TGrou---74aa877a\src\Common\src\System\Threading\Tasks\RendezvousAwaitable.cs:line 62 at System.Net.Http.WinHttpHandler.StartRequest(WinHttpRequestState state) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs:line 856 ``` ## History of failures Date | Build | Details -- | -- | -- 2018/3/15 | de2b82fe34b19d1faa8eb45f0a180f80d932bd3a | [link](https://mc.dot.net/#/user/tarekgh/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/de2b82fe34b19d1faa8eb45f0a180f80d932bd3a/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.PlatformHandler_HttpClientHandler_Authentication_Test~2FPreAuthenticate_FirstRequestNoHeader_SecondRequestVariousStatusCodes_ThirdRequestPreauthenticates(statusCode:%20ResetContent)) 2018/3/17 | b0e34ea8071b37ab68b244c977e0882ed291a821 | [link](https://mc.dot.net/#/user/matekm/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/b0e34ea8071b37ab68b244c977e0882ed291a821/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.PlatformHandler_HttpClientHandler_Authentication_Test~2FPreAuthenticate_FirstRequestNoHeader_SecondRequestVariousStatusCodes_ThirdRequestPreauthenticates(statusCode:%20NoContent)) 28123 area-System.Collections Flag unprotected concurrent dictionary access "`Dictionary<K, V>` is not threadsafe for concurrent access involving writes. If this occurs the datastructure can get corrupted and more and more threads can get ""captured"" inside `FindEntry` or `TryInsert` (or certain other methods), looping continously until the process terminates. `HashSet<T>` has a similar backing datastructure and can similarly ""capture"" threads inside `AddIfNotPresent` (or one of several other methods). [Aside on how these work: lookups in these datastructures use hashing into a `_buckets` array to find an index into the `_entries` array (named `_slots` in `HashSet<T>`). If there is no hash collision that `Entry` (`Slot`) contains the sought after entry. If there is a collision on that hash, it begins a chain, and lookup follows the chain. If the desired entry is not present in the collection then the chain should terminate in an empty entry and the method returns (possibly after adding the entry). When entries are added, they are prepended to this chain and `_buckets` and then `_entries` are fixed up. After removes, unused slots are kept in a free chain with a head is stored in `_freelist` to avoid needing to scan `_entries` for unused slots. Concurrent updates to these chains (or possibly concurrent traverse and write) can lead to loops at which point any read or write can potentially be sucked into a busy loop.] Although this always indicates a bug in the calling code we have now seen this impact several large services and it can cause expensive and growing CPU monopolization until much or all of the host machine is looping endlessly. Given that we should consider whether there is a cheap way that we can flag buggy callers and throw, similar to how we maintain a `version` counter purely to flag buggy callers. @vancem suggested a check could be done only on insert/remove (ie write), so there would be no perf impact on readers." 28124 area-System.IO Check for name surrogates when deleting reparse points Name surrogates are the only type of reparse points that we should be simply detaching. All other reparse points we should be drilling into- this was causing issues for OneDrive cloud files. Fixes #24250 cc: @CAllredMSFT, @pjanotti, @maryamariyan, @danmosemsft Note that I don't have a way to write an automated test for this yet. I'm looking into that. I've manually tested against my personal OneDrive folder to validate the behavior. 28125 area-Infrastructure [1.1] Add OpenSuse423 and Ubuntun1804 to init-tools cli initialization This updates the default tools version for an opensuse platform to 42.3 and adds detection for Ubuntu18.04. This will cause those platforms to explicitly fail unless they have a bootstrap cli version uploaded to blob storage. A similar change will need to go into core-setup, but only after the above step is completed and those cli packages are made available. cc @janvorli 28129 area-System.IO Shortcutting the code path of LongFileTime.ToDateTimeOffset() Shortcutted `LongFileTime.ToDateTimeOffset()` avoiding conversions from UTC to Local back to UTC again. Clearly, I have a lot to improve on my Git-Fu. Sorry for the extraneous commits. 28131 area-System.Net Span Support for Socket SendTo and UdpClient Checking out the new Span based socket apis in 2.1 preview 1, I noticed the api of UdpClient doesn't have span based overloads. Falling back to Socket, it appears there too the SendTo api is missing any overloads for Span and friends. Digging deeper into [SocketPal.Windows](https://github.com/dotnet/corefx/blob/master/src/System.Net.Sockets/src/System/Net/Sockets/SocketPal.Windows.cs#L203-L238), there's no SendTo supporting span there but [SocketPal.Unix](https://github.com/dotnet/corefx/blob/master/src/System.Net.Sockets/src/System/Net/Sockets/SocketPal.Unix.cs#L706-L750) does seem to have some Span support. The corresponding receive methods are also lacking Span support. To add actual non-allocating support, it would also appear that endpoint serialization in these methods would need to be tweaked but that seems to be somewhat the point of [SocketAddress](https://github.com/dotnet/corefx/blob/master/src/Common/src/System/Net/SocketAddress.cs) so maybe calling code would need to pass the SocketAddress instead of the IPEndPoint/EndPoint? Was this an intentional gap in the api or just something that wasn't priority / low use case? 28132 area-System.Runtime Get the .NET Core version number at runtime @IvanFarkas commented on [Sat Jan 27 2018](https://github.com/dotnet/core/issues/1242) Is there a reliable way to get the **.NET Core version number** at runtime that works on **Nano Server** and **Ubuntu** **Docker** containers as well, please? I've seen some hacks deriving it from folder structure that breaks when the app is deployed onto Nano Server and Ubuntu Docker container images. 28133 area-System.Net System.Net.Http.Functional.Tests Assertion Failed - We should only be here if cancellation was requested "From https://github.com/dotnet/corefx/pull/28080 on OSX.1013.Amd64.Open:Debug-x64 https://mc.dot.net/#/user/ahsonkhan/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/be5aaa6aafd5a19086974af807cb66588586e825/workItem/System.Net.Http.Functional.Tests/wilogs ```text 2018-03-15 20:58:52,865: INFO: proc(54): run_and_log_output: Output: System.Net.Http.Functional.Tests.PlatformHandler_HttpClientHandlerTest.Ctor_ExpectedDefaultPropertyValues_UapPlatform [SKIP] 2018-03-15 20:58:52,865: INFO: proc(54): run_and_log_output: Output: Condition(s) not met: \""IsUap\"" 2018-03-15 20:58:53,369: INFO: proc(54): run_and_log_output: Output: Assertion Failed 2018-03-15 20:58:53,369: INFO: proc(54): run_and_log_output: Output: We should only be here if cancellation was requested. 2018-03-15 20:58:53,369: INFO: proc(54): run_and_log_output: Output: 2018-03-15 20:58:53,370: INFO: proc(54): run_and_log_output: Output: at System.Net.Http.CurlHandler.CurlResponseStream.<>c.<ReadAsync>b__30_1(Object s2) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.Http/src/System/Net/Http/CurlHandler/CurlHandler.CurlResponseMessage.cs:line 344 2018-03-15 20:58:53,370: INFO: proc(54): run_and_log_output: Output: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /Users/buildagent/agent/_work/147/s/src/mscorlib/shared/System/Threading/ExecutionContext.cs:line 166 2018-03-15 20:58:53,371: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) in /Users/buildagent/agent/_work/147/s/src/mscorlib/src/System/Threading/Tasks/Task.cs:line 2440 2018-03-15 20:58:53,371: INFO: proc(54): run_and_log_output: Output: at System.Threading.ThreadPoolWorkQueue.Dispatch() in /Users/buildagent/agent/_work/147/s/src/mscorlib/src/System/Threading/ThreadPool.cs:line 588 2018-03-15 20:58:56,769: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/dotnetbuild/work/9bbf5ba5-b5a1-4f68-9dea-4a703567af54/Work/cb238724-1a11-4068-a19a-892967c9bc11/Unzip/RunTests.sh: line 87: 67860 Abort trap: 6 (core dumped) $RUNTIME_PATH/dotnet xunit.console.netcore.exe System.Net.Http.Functional.Tests.dll -xml testResults.xml -notrait Benchmark=true -notrait category=nonnetcoreapptests -notrait category=nonosxtests -notrait category=OuterLoop -notrait category=failing 2018-03-15 21:01:35,012: INFO: proc(54): run_and_log_output: Output: processing dump file /Users/dotnet-bot/dotnetbuild/work/9bbf5ba5-b5a1-4f68-9dea-4a703567af54/Work/cb238724-1a11-4068-a19a-892967c9bc11/Unzip/core.67860 2018-03-15 21:01:35,013: INFO: proc(54): run_and_log_output: Output: creating dumpling dump f8701e01613c9f7a2232ed89cd62ac0334dce3fa ``` @davidsh, @wfurt, @stephentoub " 28134 area-System.Net Remove some low-hanging fruit allocations from SocketsHttpHandler connections Most of these aren't actually in SocketsHttpHandler itself, but rather in System.Net.Security or System.Security.Cryptography.X509Certificates. I took a memory allocation trace of creating a bunch of authenticated connections, and started eliminating some of the easier allocations. https://github.com/dotnet/coreclr/pull/16984 is part of this, as was https://github.com/dotnet/corefx/pull/28086 and https://github.com/dotnet/corefx/pull/28084, and https://github.com/dotnet/coreclr/issues/16982 is showing up as well. There's still _a lot_ more there, but this is a start. Reviewing commit by commit is probably easiest. cc: @geoffkizer, @bartonjs, @JeremyKuhne, @davidsh 28135 area-System.Net Why does HttpClient in Core allow GET requests with bodies, while Framework version does not? "_Opened on behalf of @IanKemp from https://github.com/dotnet/core/issues/1333_ ------- _@IanKemp writes -_ As per the title, the `HttpClient` implementation between Core and Framework differs in this regard. Consider the following example: ```csharp using (var client = new HttpClient()) { var request = new HttpRequestMessage { RequestUri = new Uri(""some url""), Method = HttpMethod.Get, }; request.Content = new ByteArrayContent(Encoding.UTF8.GetBytes(""some json"")); request.Content.Headers.ContentType = new MediaTypeHeaderValue(""application/json""); var result = client.SendAsync(request).Result; result.EnsureSuccessStatusCode(); var responseBody = await result.Content.ReadAsStringAsync().ConfigureAwait(false); } ``` * In .NET Core (tested with 1.0 and 2.0), the above executes successfully. * In .NET framework (tested with 4.7.1, 4.6.1, 4.5), the above throws a `ProtocolViolationException` with the message `Cannot send a content-body with this verb-type` on the `SendAsync` call. While I am very happy that Core allows this (technically correct, but unusual) request type, I am less happy that the Framework does not support it. Why does Core allow this why Framework does not? Is this intentional or an oversight? Is there somewhere where these differences/idiosyncrasies are documented? (For another example of differing HTTP behaviour in Core vs Framework, [see this issue](https://github.com/AngleSharp/AngleSharp/issues/607#issuecomment-345596448).) ----- _@AppBeat writes -_ Interesting. According to this post: https://stackoverflow.com/questions/978061/http-get-with-request-body standard does not explicitly forbid this. GET body should be ignored by server. ----- _@IanKemp writes -_ @AppBeat The server is free to ignore or accept the body; that should not prevent the client from sending a request that the server may ignore. It is ultimately up to the client to determine whether the server accepts requests like this. A popular example of a product (server) that supports GET requests with bodies is Elasticsearch, [specifically their REST query API](https://www.elastic.co/guide/en/elasticsearch/guide/current/_empty_search.html). In particular, the section on that page ""A GET Request with a Body?"" explains their rationale (but note that they do also allow POST as a fallback option for clients that do not support this). ---- _@AppBeat writes -_ I didn't say that this should be removed from .NET Core :) Although this is not common (bad?) practice I think .NET Core version in this case is more correct than .NET Framework implementation. I will try to test this on new managed implementation of SocketsHttpHandler which will probably be prefered HttpHandler in future for more consistent behaviour across all different platforms. https://github.com/dotnet/corefx/tree/master/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler I created new functional test for SocketsHttpHandler and it works as it should: ``` [Fact] public async Task SendAsync_HttpGetWithPayload_Success() { await LoopbackServer.CreateServerAsync(async (server, url) => { string responseBody = ""HTTP/1.1 200 OK\r\n"" + $""Date: {DateTimeOffset.UtcNow:R}\r\n"" + ""Content-Length: 0\r\n"" + ""Connection: close\r\n"" + ""\r\n""; using (HttpClient client = CreateHttpClient()) { var request = new HttpRequestMessage { RequestUri = url, Method = HttpMethod.Get, }; request.Content = new StringContent(""{}"", Encoding.UTF8, ""application/json""); Task<HttpResponseMessage> getResponseTask = client.SendAsync(request); await server.AcceptConnectionAsync(async connection => { Task<List<string>> serverTask = connection.ReadRequestHeaderAndSendCustomResponseAsync(responseBody); await TestHelper.WhenAllCompletedOrAnyFailed(getResponseTask, serverTask); }); Assert.True(getResponseTask.IsCompletedSuccessfully); var result = getResponseTask.Result; Assert.True(result.IsSuccessStatusCode); } }); } ```" 28136 area-Meta Testing netfx fails in 27 tests localy on non english Windows Testing netfx fails in 27 tests localy on non english Windows with next log: ``` C:\Code\corefx2\Tools\tests.targets(492,5): warning : System.ComponentModel.Annotations.Tests Total: 527, Errors: 0, Failed: 1, Skipped: 0, Time: 1,779s [C:\Code\corefx2\src\System.ComponentModel.Annotations\tests\System.ComponentModel.Annotations.Tests.csproj] C:\Code\corefx2\Tools\tests.targets(492,5): warning : System.CodeDom.Tests Total: 2107, Errors: 0, Failed: 6, Skipped: 0, Time: 4,078s [C:\Code\corefx2\src\System.CodeDom\tests\System.CodeDom.Tests.csproj] C:\Code\corefx2\Tools\tests.targets(492,5): warning : System.Diagnostics.TraceSource.Tests Total: 271, Errors: 0, Failed: 2, Skipped: 0, Time: 3,905s [C:\Code\corefx2\src\System.Diagnostics.TraceSource\tests\System.Diagnostics.TraceSource.Tests.csproj] C:\Code\corefx2\Tools\tests.targets(492,5): warning : System.Configuration.ConfigurationManager.Tests Total: 551, Errors: 0, Failed: 3, Skipped: 0, Time: 1,316s [C:\Code\corefx2\src\System.Configuration.ConfigurationManager\tests\System.Configuration.ConfigurationManager.Tests.csproj] C:\Code\corefx2\Tools\tests.targets(492,5): warning : System.DirectoryServices.Tests Total: 250, Errors: 0, Failed: 1, Skipped: 27, Time: 3,777s [C:\Code\corefx2\src\System.DirectoryServices\tests\System.DirectoryServices.Tests.csproj] C:\Code\corefx2\Tools\tests.targets(492,5): warning : System.ComponentModel.TypeConverter.Tests Total: 5725, Errors: 0, Failed: 7, Skipped: 0, Time: 1,738s [C:\Code\corefx2\src\System.ComponentModel.TypeConverter\tests\System.ComponentModel.TypeConverter.Tests.csproj] C:\Code\corefx2\Tools\tests.targets(492,5): warning : System.Data.Common.Tests Total: 1723, Errors: 0, Failed: 25, Skipped: 0, Time: 10,809s [C:\Code\corefx2\src\System.Data.Common\tests\System.Data.Common.Tests.csproj] C:\Code\corefx2\Tools\tests.targets(492,5): warning : System.Diagnostics.EventLog.Tests Total: 61, Errors: 0, Failed: 2, Skipped: 42, Time: 0,598s [C:\Code\corefx2\src\System.Diagnostics.EventLog\tests\System.Diagnostics.EventLog.Tests.csproj] C:\Code\corefx2\Tools\tests.targets(492,5): warning : System.Xml.Linq.xNodeBuilder.Tests Total: 19, Errors: 0, Failed: 3, Skipped: 0, Time: 0,646s [C:\Code\corefx2\src\System.Private.Xml.Linq\tests\xNodeBuilder\System.Xml.Linq.xNodeBuilder.Tests.csproj] C:\Code\corefx2\Tools\tests.targets(492,5): warning : System.Diagnostics.StackTrace.Tests Total: 85, Errors: 0, Failed: 9, Skipped: 0, Time: 1,183s [C:\Code\corefx2\src\System.Diagnostics.StackTrace\tests\System.Diagnostics.StackTrace.Tests.csproj] C:\Code\corefx2\Tools\tests.targets(492,5): warning : System.Linq.Tests Total: 2612, Errors: 0, Failed: 1, Skipped: 6, Time: 11,738s [C:\Code\corefx2\src\System.Linq\tests\System.Linq.Tests.csproj] C:\Code\corefx2\Tools\tests.targets(492,5): warning : System.Runtime.Serialization.Json.ReflectionOnly.Tests Total: 167, Errors: 0, Failed: 2, Skipped: 0, Time: 7,378s [C:\Code\corefx2\src\System.Runtime.Serialization.Json\tests\ReflectionOnly\System.Runtime.Serialization.Json.ReflectionOnly.Tests.csproj] C:\Code\corefx2\Tools\tests.targets(492,5): warning : System.Drawing.Common.Tests Total: 4488, Errors: 0, Failed: 10, Skipped: 0, Time: 48,900s [C:\Code\corefx2\src\System.Drawing.Common\tests\System.Drawing.Common.Tests.csproj] C:\Code\corefx2\Tools\tests.targets(492,5): warning : System.IO.FileSystem.Tests Total: 4450, Errors: 0, Failed: 1, Skipped: 160, Time: 56,357s [C:\Code\corefx2\src\System.IO.FileSystem\tests\System.IO.FileSystem.Tests.csproj] C:\Code\corefx2\Tools\tests.targets(492,5): warning : System.Security.Cryptography.Xml.Tests Total: 524, Errors: 0, Failed: 2, Skipped: 16, Time: 3,766s [C:\Code\corefx2\src\System.Security.Cryptography.Xml\tests\System.Security.Cryptography.Xml.Tests.csproj] C:\Code\corefx2\Tools\tests.targets(492,5): warning : System.DirectoryServices.AccountManagement.Tests Total: 60, Errors: 0, Failed: 1, Skipped: 12, Time: 1,274s [C:\Code\corefx2\src\System.DirectoryServices.AccountManagement\tests\System.DirectoryServices.AccountManagement.Tests.csproj] C:\Code\corefx2\Tools\tests.targets(492,5): warning : System.Text.Encoding.Tests Total: 9742, Errors: 0, Failed: 1, Skipped: 0, Time: 4,804s [C:\Code\corefx2\src\System.Text.Encoding\tests\System.Text.Encoding.Tests.csproj] C:\Code\corefx2\Tools\tests.targets(492,5): warning : System.Threading.Tasks.Tests Total: 577, Errors: 0, Failed: 5, Skipped: 2, Time: 6,944s [C:\Code\corefx2\src\System.Threading.Tasks\tests\System.Threading.Tasks.Tests.csproj] C:\Code\corefx2\Tools\tests.targets(492,5): warning : System.IO.FileSystem.AccessControl.Tests Total: 88, Errors: 0, Failed: 14, Skipped: 0, Time: 0,362s [C:\Code\corefx2\src\System.IO.FileSystem.AccessControl\tests\System.IO.FileSystem.AccessControl.Tests.csproj] C:\Code\corefx2\Tools\tests.targets(492,5): warning : System.Xml.Xsl.XslCompiledTransformApi.Tests Total: 1237, Errors: 0, Failed: 7, Skipped: 0, Time: 29,381s [C:\Code\corefx2\src\System.Private.Xml\tests\Xslt\XslCompiledTransformApi\System.Xml.Xsl.XslCompiledTransformApi.Tests.csproj] C:\Code\corefx2\Tools\tests.targets(492,5): warning : System.Runtime.Extensions.Tests Total: 2167, Errors: 0, Failed: 1, Skipped: 9, Time: 5,727s [C:\Code\corefx2\src\System.Runtime.Extensions\tests\System.Runtime.Extensions.Tests.csproj] C:\Code\corefx2\Tools\tests.targets(492,5): warning : System.Runtime.Serialization.Json.Tests Total: 167, Errors: 0, Failed: 2, Skipped: 0, Time: 3,108s [C:\Code\corefx2\src\System.Runtime.Serialization.Json\tests\System.Runtime.Serialization.Json.Tests.csproj] C:\Code\corefx2\Tools\tests.targets(492,5): warning : System.Net.Mail.Functional.Tests Total: 163, Errors: 0, Failed: 2, Skipped: 0, Time: 303,994s [C:\Code\corefx2\src\System.Net.Mail\tests\Functional\System.Net.Mail.Functional.Tests.csproj] C:\Code\corefx2\Tools\tests.targets(492,5): warning : System.Net.WebSockets.Client.Tests Total: 19, Errors: 0, Failed: 3, Skipped: 0, Time: 0,363s [C:\Code\corefx2\src\System.Net.WebSockets.Client\tests\System.Net.WebSockets.Client.Tests.csproj] C:\Code\corefx2\Tools\tests.targets(492,5): warning : System.Runtime.Serialization.Formatters.Tests Total: 6867, Errors: 0, Failed: 10, Skipped: 0, Time: 17,936s [C:\Code\corefx2\src\System.Runtime.Serialization.Formatters\tests\System.Runtime.Serialization.Formatters.Tests.csproj] C:\Code\corefx2\Tools\tests.targets(492,5): warning : System.Runtime.Tests Total: 12053, Errors: 0, Failed: 2, Skipped: 0, Time: 9,801s [C:\Code\corefx2\src\System.Runtime\tests\System.Runtime.Tests.csproj] C:\Code\corefx2\Tools\tests.targets(492,5): warning : System.Security.Cryptography.Cng.Tests Total: 136, Errors: 0, Failed: 1, Skipped: 1, Time: 2,824s [C:\Code\corefx2\src\System.Security.Cryptography.Cng\tests\System.Security.Cryptography.Cng.Tests.csproj] ``` I can make logs for each failed tests. 28137 area-System.Runtime ConcurrentDictionary is not marked as serializable The following code crashes: ``` var cd = new ConcurrentDictionary<int, int>(); cd[0] = 42; var bf = new BinaryFormatter(); bf.Serialize(new MemoryStream(), cd); ``` with ``` System.Runtime.Serialization.SerializationException : Type 'System.Collections.Concurrent.ConcurrentDictionary`2[[System.Int32, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Int32, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]' in Assembly 'System.Collections.Concurrent, Version=4.0.14.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not marked as serializable. ``` (tested on .net core 2.0, 2.1-preview and master). The regular dictionary serializes just fine. UPD: just found https://github.com/dotnet/corefx/pull/19742 I am wondering will it be fixed or it's by design now? 28138 area-System.Net WebSocketProtocol.CreateFromStream should allow specifying a receive buffer and a send buffer Currently you can specify a receive buffer to the WebSocketProtocol.CreateFromStream API but you cannot control the send buffer. Currently the managed websocket implementation always allocates a pooled array for sends which may not be optimal if the underlying stream is already buffered (it introduces an extra layer of unnecessary buffering). I'd like to propose we change this method to the following: ```C# using System.IO; namespace System.Net.WebSockets { public static class WebSocketProtocol { public static WebSocket CreateFromStream(Stream stream, bool isServer, string subProtocol, TimeSpan keepAliveInterval, int? receiveBufferSize = null, int? sendBufferSize = null) { throw null; } // Existing API: public static WebSocket CreateFromStream(Stream stream, bool isServer, string subProtocol, TimeSpan keepAliveInterval, Memory<byte> buffer = default) { throw null; } } } ``` I'd also like to get this in for 2.1 if possible 😄 A few questions: - Today we allow passing a single buffer to the websocket API for receives but if you use a pooled buffer, you can only return it when the websocket is disposed. That would be the same deal for the sendBuffer. - The existing WebSocket.CreateClient API just lets you specify the size of the internal buffer instead of taking a buffer directly. While this is less flexible, I'm not sure how useful it is to allow passing in the buffer itself to the WebSocket constructor. I might be missing something here. Note: Existing API: https://github.com/dotnet/corefx/blob/cc590fd30b7000458d055164c641461d616ed33c/src/System.Net.WebSockets.WebSocketProtocol/ref/System.Net.WebSockets.WebSocketProtocol.cs#L14 /cc @stephentoub @karelz 28139 area-Infrastructure System.Data.SqlClient cannot be found Hi In a specific scenario, I cannot load `System.Data.SqlClient` using the 2.0.6 runtime. The 2.0.5 runtime works. A small repro : https://github.com/johnkors/sqlclient.runtime.test A build of both runtimes: https://travis-ci.org/johnkors/sqlclient.runtime.test/builds/354338277 In 2.0.5, I can use System.Data.SqlClient (ok, it fails to connect to a unknown db here - but using the dll works). In 2.0.6, I get the FileNotFoundException. >Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'System.Data.SqlClient, Version=4.2.0.2, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. (bumping the the dependency on `System.Data.SqlClient` to 4.4.3 makes it work with both runtimes.) 28140 area-Infrastructure Update cross build-rootfs for modern world As part of building docker image for arm64 cross compiling I spent a lot of time looking at build--rootfs.sh. The following seem like changes which should be done... + Add latest Ubuntu version: Artful and Bionic + Remove unsupported Ubuntu versions: Vivid and Wily + Add latest lldbdev versions: 4.0, 5.0, 6.0 + Update lldb default to 3.9 to be consistent with non-cross build + Drop old lldb versions 3.6 and 3.8 + Add error checking which is present in core-setup version See https://github.com/dotnet/core-setup/issues/3843 @janvorli FYI 28141 area-System.Net Expose ClientWebSocketOptions.RemoteCertificateValidationCallback Fixes https://github.com/dotnet/corefx/issues/12038 cc: @davidsh, @caesar1995 28143 area-System.Reflection Add more test coverage for System.Reflection.Pointer * Test that null object reference is properly converted to a null pointer value (this requires special handling) * Test `Delegate.DynamicInvoke`. This one also uses `System.Reflection.Pointer` and on .NET Native is handled by separate code paths. Currently adding as disabled on UapAot because I'm working on that support right now. We'll unblock it with the rest later. Cc @sergiy-k 28145 area-System.Globalization Culture info ru-BY missed in .NET core 2.0.6 on Windows Server 2012 R2 _From @NGancevich on March 16, 2018 7:16_ I have Localization on my asp.net core 2.0.6 and it's working on local machine. But when I publish to IIS on server 2012 r2 it's throwing an exception Application startup exception: System.Globalization.CultureNotFoundException: Culture is not supported. Parameter name: name ru-by is an invalid culture identifier. at System.Globalization.CultureInfo.InitializeFromName(String name, Boolean useUserOverride) According to the link https://msdn.microsoft.com/en-us/library/cc233982.aspx it's valid culture info. Event microsoft has this localization on site https://www.microsoft.com/ru-by _Copied from original issue: aspnet/Home#2967_ 28150 area-System.Net Make ClientWebSocket always use CONNECT tunneling through a proxy Manually verified with the [Proxy_ConnectThruProxy_Success](https://github.com/dotnet/corefx/blob/02c3892380a392458a4d1f41c53ce2048cb6681d/src/System.Net.WebSockets.Client/tests/ClientWebSocketOptionsTests.cs#L73) test. Here is the output after the fix. For non-secure (WS) connection: ``` Connected: [::1]:59184 CONNECT corefx-net.cloudapp.net:80 HTTP/1.1 Host: corefx-net.cloudapp.net:80 Trying to connect to corefx-net.cloudapp.net Connected to corefx-net.cloudapp.net HTTP/1.1 200 Connection established ``` Fix #28024. 28152 area-System.Runtime Proposal TypeListAttribute # Suggestion: Define a TypeListAttribute tilke this: ``` public class TypeListAttribute : Attribute { public Type[] Types; public TypeListAttribute(params Type[] types) { Types = types; } } ``` This attribute can be used to mark generic classes like this: ``` [TypeList(typeof(int), typeof(float), typeof(byte))] class foo<T> { void DoSomething(T x, T y) { T z = x + y; } } ``` Then C# or VB.NET can use the TypeListAttribute.Types[] to validate the generic class code. The compiler should test the foo<T> for all these types, i.e. foo< int >, foo< float > , foo< byte >. if the code of the foo class is ok in all these cases, then it should compile correctly (i.e doesn't complain about the x + y operation) . # Benefit: This will solve some problems when there is no common interface to use as a constraint. for more details: https://github.com/dotnet/corefx/issues/27167 # Note: I asked also for C# syntax to define the list to avoid the long attribute syntax (https://github.com/dotnet/csharplang/issues/1388). This would be: ``` class foo<T> where T: {int, float, byte} { void DoSomething(T x, T y) { T z = x + y; } } ``` 28156 area-System.Net System.NullReferenceException in System.Net.Http.WinHttpRequestCallback.RequestCallback Couldn't find any issue that seemed to cover the problem. I'm running kestrel in tests, and writing a reverse proxy component. At an unknown point in running the tests, I get the following exception: ``` System.NullReferenceException: Object reference not set to an instance of an object. at System.Net.Http.WinHttpRequestCallback.RequestCallback(IntPtr handle, WinHttpRequestState state, UInt32 internetStatus, IntPtr statusInformation, UInt32 statusInformationLength) at System.Net.Http.WinHttpRequestCallback.WinHttpCallback(IntPtr handle, IntPtr context, UInt32 internetStatus, IntPtr statusInformation, UInt32 statusInformationLength) at Interop.WinHttp.WinHttpCloseHandle(IntPtr handle) at Interop.WinHttp.SafeWinHttpHandle.ReleaseHandle() at System.Runtime.InteropServices.SafeHandle.InternalDispose() at System.Net.Http.WinHttpRequestState.ClearSendRequestState() at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadPoolWorkQueue.Dispatch() ``` Repro: - code: openrasta/openrasta-core@e2b2c5d - tests: https://github.com/openrasta/openrasta-core/blob/1e006fddfd91b14d92177c3948517a809074f553/src/Tests/Plugins.ReverseProxy/errors/proxied_timeout.cs - build failing: https://ci.appveyor.com/project/OpenRasta/openrasta-core/build/2.6.0-preview.1.1298+master It looks like the same stacktrace as in #26278 Note builds and tests succeed on core 2 on libcurl-based http client. I tried not disposing request/response messages from the client, no change. I'm refactoring the code at the moment, so maybe the problem will go away, but i'm pretty confused. 28159 area-System.Reflection System.Reflection.Metadata.Tests frequently hanging OSX CI "Seeing multiple hits for this over the past few days. #27959, #28158, etc. ``` 2018-03-16 19:46:19,493: INFO: proc(54): run_and_log_output: Output: =========================================================================================================== 2018-03-16 19:46:19,493: INFO: proc(54): run_and_log_output: Output: ~/dotnetbuild/work/2692d885-466d-4e4e-afe7-34097847e712/Work/a2747181-713a-4b9a-a434-03a7690bc637/Unzip ~/dotnetbuild/work/2692d885-466d-4e4e-afe7-34097847e712/Work/a2747181-713a-4b9a-a434-03a7690bc637/Unzip 2018-03-16 19:46:19,699: INFO: proc(54): run_and_log_output: Output: Traceback (most recent call last): 2018-03-16 19:46:19,700: INFO: proc(54): run_and_log_output: Output: File ""/Users/dotnet-bot/.dumpling/dumpling.py"", line 33, in <module> 2018-03-16 19:46:19,700: INFO: proc(54): run_and_log_output: Output: import psutil 2018-03-16 19:46:19,700: INFO: proc(54): run_and_log_output: Output: ImportError: No module named psutil 2018-03-16 19:46:19,877: INFO: proc(54): run_and_log_output: Output: xUnit.net console test runner (64-bit .NET Core) 2018-03-16 19:46:19,877: INFO: proc(54): run_and_log_output: Output: Copyright (C) 2014 Outercurve Foundation. 2018-03-16 19:46:19,877: INFO: proc(54): run_and_log_output: Output: 2018-03-16 19:46:19,960: INFO: proc(54): run_and_log_output: Output: Discovering: System.Reflection.Metadata.Tests 2018-03-16 19:46:20,152: INFO: proc(54): run_and_log_output: Output: Discovered: System.Reflection.Metadata.Tests 2018-03-16 19:46:20,277: INFO: proc(54): run_and_log_output: Output: Starting: System.Reflection.Metadata.Tests ```" 28160 area-System.Memory API consistency for System.Memory APIs (argument names) Here is an attempt to keep argument names consistent across the board for all the System.Memory APIs, based on our discussion (see https://github.com/dotnet/apireviews/pull/62). I have split each change into separate commits if that makes things easier to review. **List of changes:** - AsBytes and Cast: Change arg name source -> span - CopyTo: Change arg name array/sequence -> source - Several APIs: Change arg name arraySegment -> segment - Several APIs: Change arg name readOnlyMemory -> memory - BinaryPrimitives and Utf8Formatter: Change arg name buffer -> source or destination - Utf8Parser: Change arg name text -> source - Base64: Change arg name consumed/written -> bytesConsumed/bytesWritten - TryGetOwnedMemory: Change arg name ownedMemory -> owner, index -> start - BuffersExtensions.Write: Change arg name bufferWriter -> writer - Span Compare APIs: Change arg name first -> span, second/value -> other - ROSequence.TryGet & BuffersExtensions: Change arg name data -> memory, sequence -> source - BufferExtensions.Write: Change arg name source -> span - SequencePosition.Equals: Change arg name position -> other cc @KrzysztofCwalina, @joshfree, @terrajobst, @stephentoub, @davidfowl, @pakrym, @benaadams, @jkotas, @JeremyKuhne, @dotnet/corefxlab-contrib, @karelz, @danmosemsft 28161 area-System.IO Use Win32Marshal from CoreLib shared code Fix hr issue caught by Common.Tests. Follow through for https://github.com/dotnet/corefx/pull/28158 cc: @pjanotti, @Anipik 28163 area-System.Net add proxy bypass list processing for windows fixes #23150 This is last chunk for proxy configuration for HttpSocketHandler. The functionality matches code provided by WinHttp team as well as my experiments and testing. The pattern processing can possibly be compiled to single mega-match so we can do parallel processing but it does not seems necessary at the moment. WinHttp does does process entries sequentially. 28167 area-System.ComponentModel Bug fix: Force properties reload Fixes #23127 I think this should be fixed also on [netfx](https://referencesource.microsoft.com/#System/compmod/system/componentmodel/design/DesignerOptionService.cs,156). cc: @safern 28168 area-System.ComponentModel Fixed netfx System.ComponentModel.TypeConverter.Tests-InvariantCulture on non English Windows Fixed netfx System.ComponentModel.TypeConverter.Tests-InvariantCulture on non English Windows See https://github.com/dotnet/corefx/issues/28136 28169 area-System.Net [HttpListener] [GetContext] GetContext method call should unblock after call to Stop "Hello, It looks like there is an issue with HttpListener.GetContext call on windows. It should somehow unblock when HttpListener.Stop is called. However, It hangs on Windows, while on Ubuntu it works fine, i.e. throws HttpListenerException: Listener closed. The code is below: ```c# var listener = new HttpListener(); listener.Prefixes.Add(""http://+:9000/test/""); listener.Start(); var listenerTask = Task.Run(() => { try { var context = listener.GetContext(); } catch(Exception ex) { Console.WriteLine($""Listener exception: {ex.GetType().Name}, {ex.Message}""); } }); Console.WriteLine(""Running""); Console.ReadLine(); listener.Stop(); listener.Close(); ``` By the way, GetContextAsync version works properly on both platforms: it throws ObjectDisposedException [EDIT] Add C# syntax highlighting by @karelz" 28170 area-System.Runtime Inconsistent null parameter handling in IEqualityComparer.GetHashCode(Object) "The [docs](https://docs.microsoft.com/en-us/dotnet/api/system.collections.iequalitycomparer.gethashcode?view=netframework-4.7.1#System_Collections_IEqualityComparer_GetHashCode_System_Object_) state that `IEqualityComparer.GetHashCode(Object)` should throw `ArgumentNullException` when ""The type of `obj` is a reference type and `obj` is `null`"". However, this contract is inconsistently implemented across the framework: 1. `null` parameter leads to `ArgumentNullException` as expected: https://github.com/dotnet/corefx/blob/2b805ce320feab0d7d9b72123767cc017c32948f/src/Common/src/CoreLib/System/StringComparer.cs#L305 1. `null` parameter results in no exception and returns 0: https://github.com/dotnet/corefx/blob/6dd451f51451a7d0ceea6104b51bd17005e9a0e6/src/System.Collections/src/System/Collections/Generic/HashSetEqualityComparer.cs#L34 1. `null` parameter is not checked at all, leading to `NullReferenceException`: https://github.com/dotnet/corefx/blob/1514f1cb419ada9461730b05c1b67caef4aba0e2/src/System.Private.Xml/src/System/Xml/Core/SecureStringHasher.cs#L28" 28171 area-System.Net Removed dead code: SafeWinHttpHandleWithCallback As per discussion in #2501 - this removes the unused SafeWinHttpHandleWithCallback. Fixes #2501 28173 area-System.ComponentModel Bug fix: Add Assembly.LoadFrom() fallback attempt "Fixes #27433 I did a test with https://github.com/superriva/MEF_examples. I don't know if we need to write a ""custom test"" for this(create an assembly on the fly and try to load etc..). I attach ""debug result"". ```csharp var catalog = new DirectoryCatalog(@""D:\JOB\Repos\MEF_examples\MEF1-bug\ExportComponents\Components"", ""*.dll""); ``` Before  After  (the exception on Parts is due to missing interface lib) No more log on debug console. cc: @weshaggard @safern " 28174 area-System.IO Pipelines Rename OnCompleted to Register as per API Review Fixes #27705 renames all tests and the actual methods 28175 area-System.Data Enable OdbcConnection.GetSchema The pull requests primarily enable OdbcConnection.GetSchema() API and its overloads. The following changes were made to address this 1. System.Data.Odbc.OdbcMetaData.xml was added to System.Data.Odbc 2. Refactored the files in System.Data.Odbc and System.Data.SqlClient and moved them to Common/src/System/Data/ProviderBase 2.a Only moved the files needed to make OdbcConnection.GetSchema() work. 2.b Added partial qualifier on some of the classes which had diverged because SqlClient supports TransactionScope. Fixes https://github.com/dotnet/corefx/issues/27260 cc @saurabh500 28177 area-System.Collections Improve inling in ImmutableArray<T>.Builder The issue https://github.com/dotnet/corefx/issues/28064 is about a benchmark whose performance is so bad that a new dangerous method was considered to improve that situation. But almost the same effect can be achieved just by ensuring that the `Add()` method and the indexer setter on `ImmutableArray<T>.Builder` can be inlined (see https://github.com/dotnet/corefx/issues/28064#issuecomment-373950250 for more details). This PR does that. I have only verified that extracting the `throw` is useful for the indexer setter. But the indexer getter and `ItemRef` are very similar, so I assumed it makes sense for them too. Performance results using BenchmarkDotNet ([source](https://github.com/svick/Benchmark/blob/3504a3c/Program.cs)): Before: | Method | Mean | Error | StdDev | Median | |-------- |----------:|----------:|----------:|----------:| | Add | 11.053 us | 0.4281 us | 1.2623 us | 11.004 us | | Indexer | 6.246 us | 0.1827 us | 0.5242 us | 6.063 us | After: | Method | Mean | Error | StdDev | Median | |-------- |---------:|----------:|----------:|---------:| | Add | 5.538 us | 0.1310 us | 0.3863 us | 5.422 us | | Indexer | 3.159 us | 0.0631 us | 0.1138 us | 3.188 us | Relevant portions of JIT dumps: Before: ``` *************** In fgFindBasicBlocks() for Builder[Int64][System.Int64]:Add(long):this weight= 10 : state 3 [ ldarg.0 ] weight= 10 : state 3 [ ldarg.0 ] weight= 79 : state 40 [ call ] weight= 28 : state 24 [ ldc.i4.1 ] weight=-12 : state 76 [ add ] weight= 79 : state 40 [ call ] weight= 31 : state 191 [ ldarg.0 -> ldfld ] weight= 10 : state 3 [ ldarg.0 ] weight= 31 : state 191 [ ldarg.0 -> ldfld ] weight= 20 : state 199 [ stloc.0 -> ldloc.0 ] weight= 28 : state 24 [ ldc.i4.1 ] weight=-12 : state 76 [ add ] weight= 31 : state 111 [ stfld ] weight= 12 : state 7 [ ldloc.0 ] weight= 16 : state 4 [ ldarg.1 ] weight= 65 : state 141 [ stelem ] weight= 19 : state 42 [ ret ] Inline candidate callsite is in a loop. Multiplier increased to 3. calleeNativeSizeEstimate=445 callsiteNativeSizeEstimate=115 benefit multiplier=3 threshold=345 Native estimate for function size exceeds threshold for inlining 44.5 > 34.5 (multiplier = 3) Inline expansion aborted, inline not profitable INLINER: during 'fgInline' result 'failed this call site' reason 'unprofitable inline' for 'Bench:Add():this' calling 'Builder[Int64][System.Int64]:Add(long):this' INLINER: during 'fgInline' result 'failed this call site' reason 'unprofitable inline' … INLINER impTokenLookupContextHandle for Builder[Int64][System.Int64]:set_Item(int,long):this is 0x00007FF8B1B089D1. *************** In fgFindBasicBlocks() for Builder[Int64][System.Int64]:set_Item(int,long):this weight= 16 : state 4 [ ldarg.1 ] weight= 10 : state 3 [ ldarg.0 ] weight= 79 : state 40 [ call ] weight= 28 : state 50 [ blt.s ] weight=227 : state 103 [ newobj ] weight=210 : state 108 [ throw ] weight= 31 : state 191 [ ldarg.0 -> ldfld ] weight= 16 : state 4 [ ldarg.1 ] weight= 35 : state 5 [ ldarg.2 ] weight= 65 : state 141 [ stelem ] weight= 19 : state 42 [ ret ] Inline candidate callsite is in a loop. Multiplier increased to 3. calleeNativeSizeEstimate=736 callsiteNativeSizeEstimate=145 benefit multiplier=3 threshold=435 Native estimate for function size exceeds threshold for inlining 73.6 > 43.5 (multiplier = 3) Inline expansion aborted, inline not profitable INLINER: during 'fgInline' result 'failed this call site' reason 'unprofitable inline' for 'Bench:Indexer():this' calling 'Builder[Int64][System.Int64]:set_Item(int,long):this' INLINER: during 'fgInline' result 'failed this call site' reason 'unprofitable inline' ``` After: ``` INLINER impTokenLookupContextHandle for Builder[Int64][System.Int64]:Add(long):this is 0x00007FF8B8698A39. *************** In fgFindBasicBlocks() for Builder[Int64][System.Int64]:Add(long):this weight= 31 : state 191 [ ldarg.0 -> ldfld ] weight= 28 : state 24 [ ldc.i4.1 ] weight=-12 : state 76 [ add ] weight= 6 : state 11 [ stloc.0 ] weight= 10 : state 3 [ ldarg.0 ] weight= 12 : state 7 [ ldloc.0 ] weight= 79 : state 40 [ call ] weight= 31 : state 191 [ ldarg.0 -> ldfld ] weight= 31 : state 191 [ ldarg.0 -> ldfld ] weight= 16 : state 4 [ ldarg.1 ] weight= 65 : state 141 [ stelem ] weight= 10 : state 3 [ ldarg.0 ] weight= 12 : state 7 [ ldloc.0 ] weight= 31 : state 111 [ stfld ] weight= 19 : state 42 [ ret ] Inline candidate is mostly loads and stores. Multiplier increased to 3. Inline candidate callsite is in a loop. Multiplier increased to 6. calleeNativeSizeEstimate=369 callsiteNativeSizeEstimate=115 benefit multiplier=6 threshold=690 Native estimate for function size is within threshold for inlining 36.9 <= 69 (multiplier = 6) … Successfully inlined Builder[Int64][System.Int64]:Add(long):this (42 IL bytes) (depth 1) [profitable inline] -------------------------------------------------------------------------------------------- INLINER: during 'fgInline' result 'success' reason 'profitable inline' for 'Bench:Add():this' calling 'Builder[Int64][System.Int64]:Add(long):this' INLINER: during 'fgInline' result 'success' reason 'profitable inline' … INLINER impTokenLookupContextHandle for Builder[Int64][System.Int64]:set_Item(int,long):this is 0x00007FF8B8698A39. *************** In fgFindBasicBlocks() for Builder[Int64][System.Int64]:set_Item(int,long):this weight= 16 : state 4 [ ldarg.1 ] weight= 10 : state 3 [ ldarg.0 ] weight= 79 : state 40 [ call ] weight= 28 : state 50 [ blt.s ] weight= 79 : state 40 [ call ] weight= 31 : state 191 [ ldarg.0 -> ldfld ] weight= 16 : state 4 [ ldarg.1 ] weight= 35 : state 5 [ ldarg.2 ] weight= 65 : state 141 [ stelem ] weight= 19 : state 42 [ ret ] Inline candidate callsite is in a loop. Multiplier increased to 3. calleeNativeSizeEstimate=378 callsiteNativeSizeEstimate=145 benefit multiplier=3 threshold=435 Native estimate for function size is within threshold for inlining 37.8 <= 43.5 (multiplier = 3) … Successfully inlined Builder[Int64][System.Int64]:set_Item(int,long):this (28 IL bytes) (depth 1) [profitable inline] -------------------------------------------------------------------------------------------- INLINER: during 'fgInline' result 'success' reason 'profitable inline' for 'Bench:Indexer():this' calling 'Builder[Int64][System.Int64]:set_Item(int,long):this' INLINER: during 'fgInline' result 'success' reason 'profitable inline' ``` 28179 area-System.Memory Fix major System.Memory performance regression on .NET Framework x86 JIT on .NET Framework x86 can do only a limited amount of inlining of NUint operations per method. This caused a major performance regression in `Span.SequenceEqual<byte>` on .NET Framework x86. This change is switching the implementation of `SequenceEqual<byte>` to use pointer-based arithmetic to fix this performance regression. Also included are related performance tweaks like using Unsafe.AddByteOffset instead of Unsafe.Add where possible. 28180 area-System.Memory SequenceEqual is very slow on .NET Framework x86 Performance regression introduced by change #28080. A single call to SequenceEqual expands into 400 bytes of very inefficient code. .NET Framework x86 JIT is not able to optimize out the complex generic code. If there is no way to make the type-specific optimizations work well, we should ifdef them out from the netstandard implementation. The portable System.Memory implementation will be slower, but it has to be fast enough to be usable on .NET Framework x86 because of it is likely going to be the most popular target for it. ``` 04dd1351 8b7dd8 mov edi,dword ptr [ebp-28h] 04dd1354 8d45cc lea eax,[ebp-34h] 04dd1357 8810 mov byte ptr [eax],dl 04dd1359 b9c010a371 mov ecx,offset mscorlib_ni+0x5210c0 (71a310c0) (MT: System.Byte) 04dd135e e88da4686e call clr!JIT_GetRuntimeType (7345b7f0) 04dd1363 8bf0 mov esi,eax 04dd1365 b9c010a371 mov ecx,offset mscorlib_ni+0x5210c0 (71a310c0) (MT: System.Byte) 04dd136a e881a4686e call clr!JIT_GetRuntimeType (7345b7f0) 04dd136f 3bc6 cmp eax,esi 04dd1371 741a je test!My.Main()+0x125 (04dd138d) 04dd1373 b9c010a371 mov ecx,offset mscorlib_ni+0x5210c0 (71a310c0) (MT: System.Byte) 04dd1378 e873a4686e call clr!JIT_GetRuntimeType (7345b7f0) 04dd137d 8bf0 mov esi,eax 04dd137f b910b3a171 mov ecx,offset mscorlib_ni+0x50b310 (71a1b310) (MT: System.SByte) 04dd1384 e867a4686e call clr!JIT_GetRuntimeType (7345b7f0) 04dd1389 3bc6 cmp eax,esi 04dd138b 7511 jne test!My.Main()+0x136 (04dd139e) 04dd138d c745c801000000 mov dword ptr [ebp-38h],1 04dd1394 b801000000 mov eax,1 04dd1399 e9ea000000 jmp test!My.Main()+0x220 (04dd1488) 04dd139e b9c010a371 mov ecx,offset mscorlib_ni+0x5210c0 (71a310c0) (MT: System.Byte) 04dd13a3 e848a4686e call clr!JIT_GetRuntimeType (7345b7f0) 04dd13a8 8bf0 mov esi,eax 04dd13aa b93806a371 mov ecx,offset mscorlib_ni+0x520638 (71a30638) (MT: System.Char) 04dd13af e83ca4686e call clr!JIT_GetRuntimeType (7345b7f0) 04dd13b4 3bc6 cmp eax,esi 04dd13b6 7434 je test!My.Main()+0x184 (04dd13ec) 04dd13b8 b9c010a371 mov ecx,offset mscorlib_ni+0x5210c0 (71a310c0) (MT: System.Byte) 04dd13bd e82ea4686e call clr!JIT_GetRuntimeType (7345b7f0) 04dd13c2 8bf0 mov esi,eax 04dd13c4 b96839a271 mov ecx,offset mscorlib_ni+0x513968 (71a23968) (MT: System.Int16) 04dd13c9 e822a4686e call clr!JIT_GetRuntimeType (7345b7f0) 04dd13ce 3bc6 cmp eax,esi 04dd13d0 741a je test!My.Main()+0x184 (04dd13ec) 04dd13d2 b9c010a371 mov ecx,offset mscorlib_ni+0x5210c0 (71a310c0) (MT: System.Byte) 04dd13d7 e814a4686e call clr!JIT_GetRuntimeType (7345b7f0) 04dd13dc 8bf0 mov esi,eax 04dd13de b9fc43a371 mov ecx,offset mscorlib_ni+0x5243fc (71a343fc) (MT: System.UInt16) 04dd13e3 e808a4686e call clr!JIT_GetRuntimeType (7345b7f0) >>> 04dd13e8 3bc6 cmp eax,esi 04dd13ea 7511 jne test!My.Main()+0x195 (04dd13fd) 04dd13ec c745c802000000 mov dword ptr [ebp-38h],2 04dd13f3 b801000000 mov eax,1 04dd13f8 e98b000000 jmp test!My.Main()+0x220 (04dd1488) 04dd13fd b9c010a371 mov ecx,offset mscorlib_ni+0x5210c0 (71a310c0) (MT: System.Byte) 04dd1402 e8e9a3686e call clr!JIT_GetRuntimeType (7345b7f0) 04dd1407 8bf0 mov esi,eax 04dd1409 b9901aa371 mov ecx,offset mscorlib_ni+0x521a90 (71a31a90) (MT: System.Int32) 04dd140e e8dda3686e call clr!JIT_GetRuntimeType (7345b7f0) 04dd1413 3bc6 cmp eax,esi 04dd1415 741a je test!My.Main()+0x1c9 (04dd1431) 04dd1417 b9c010a371 mov ecx,offset mscorlib_ni+0x5210c0 (71a310c0) (MT: System.Byte) 04dd141c e8cfa3686e call clr!JIT_GetRuntimeType (7345b7f0) 04dd1421 8bf0 mov esi,eax 04dd1423 b9e860a271 mov ecx,offset mscorlib_ni+0x5160e8 (71a260e8) (MT: System.UInt32) 04dd1428 e8c3a3686e call clr!JIT_GetRuntimeType (7345b7f0) 04dd142d 3bc6 cmp eax,esi 04dd142f 750e jne test!My.Main()+0x1d7 (04dd143f) 04dd1431 c745c804000000 mov dword ptr [ebp-38h],4 04dd1438 b801000000 mov eax,1 04dd143d eb49 jmp test!My.Main()+0x220 (04dd1488) 04dd143f b9c010a371 mov ecx,offset mscorlib_ni+0x5210c0 (71a310c0) (MT: System.Byte) 04dd1444 e8a7a3686e call clr!JIT_GetRuntimeType (7345b7f0) 04dd1449 8bf0 mov esi,eax 04dd144b b95cb2a171 mov ecx,offset mscorlib_ni+0x50b25c (71a1b25c) (MT: System.Int64) 04dd1450 e89ba3686e call clr!JIT_GetRuntimeType (7345b7f0) 04dd1455 3bc6 cmp eax,esi 04dd1457 741a je test!My.Main()+0x20b (04dd1473) 04dd1459 b9c010a371 mov ecx,offset mscorlib_ni+0x5210c0 (71a310c0) (MT: System.Byte) 04dd145e e88da3686e call clr!JIT_GetRuntimeType (7345b7f0) 04dd1463 8bf0 mov esi,eax 04dd1465 b9700ba271 mov ecx,offset mscorlib_ni+0x510b70 (71a20b70) (MT: System.UInt64) 04dd146a e881a3686e call clr!JIT_GetRuntimeType (7345b7f0) 04dd146f 3bc6 cmp eax,esi 04dd1471 750e jne test!My.Main()+0x219 (04dd1481) 04dd1473 c745c808000000 mov dword ptr [ebp-38h],8 04dd147a b801000000 mov eax,1 04dd147f eb07 jmp test!My.Main()+0x220 (04dd1488) 04dd1481 33d2 xor edx,edx 04dd1483 8955c8 mov dword ptr [ebp-38h],edx 04dd1486 33c0 xor eax,eax 04dd1488 85c0 test eax,eax 04dd148a 7441 je test!My.Main()+0x265 (04dd14cd) 04dd148c 3b7dc4 cmp edi,dword ptr [ebp-3Ch] 04dd148f 753a jne test!My.Main()+0x263 (04dd14cb) 04dd1491 8d45d0 lea eax,[ebp-30h] 04dd1494 ff7008 push dword ptr [eax+8] 04dd1497 ff7004 push dword ptr [eax+4] 04dd149a ff30 push dword ptr [eax] 04dd149c ff15e4950403 call dword ptr ds:[30495E4h] (System.Runtime.InteropServices.MemoryMarshal.GetReference[[System.Byte, mscorlib]](System.Span`1<Byte>), mdToken: 06000168) 04dd14a2 8bf0 mov esi,eax 04dd14a4 8d45bc lea eax,[ebp-44h] 04dd14a7 ff7008 push dword ptr [eax+8] 04dd14aa ff7004 push dword ptr [eax+4] 04dd14ad ff30 push dword ptr [eax] 04dd14af ff154c960403 call dword ptr ds:[304964Ch] (System.Runtime.InteropServices.MemoryMarshal.GetReference[[System.Byte, mscorlib]](System.ReadOnlySpan`1<Byte>), mdToken: 06000169) 04dd14b5 8bd0 mov edx,eax 04dd14b7 8b45c8 mov eax,dword ptr [ebp-38h] 04dd14ba 8945b8 mov dword ptr [ebp-48h],eax 04dd14bd 0fafc7 imul eax,edi 04dd14c0 50 push eax 04dd14c1 8bce mov ecx,esi 04dd14c3 ff150c810403 call dword ptr ds:[304810Ch] (System.SpanHelpers.SequenceEqual(Byte ByRef, Byte ByRef, System.NUInt), mdToken: 0600011a) ``` 28181 area-System.Data Fixed netfx System.Data.Common.Tests fails on non English Windows Fixed netfx System.Data.Common.Tests fails on non English Windows. See https://github.com/dotnet/corefx/issues/28136. 28182 area-System.Diagnostics Open .dll in new console window on Linux .Net Core "@maroallegro commented on [Tue Dec 19 2017](https://github.com/dotnet/core/issues/1177) I am able to run program.dll in same console window by running: var process = new Process { StartInfo = new ProcessStartInfo { FileName = ""dotnet"", Arguments = ""program.dll"", UseShellExecute = true, RedirectStandardOutput = false, RedirectStandardError = false, CreateNoWindow = false } }; process.Start(); How to open program.dll in new console window on Linux using .NET Core 2.0? Flag `CreateNoWindow = false` do not open new console as on Windows system. Is it a bug? " 28183 area-System.Xml Fixed netfx System.Xml.Linq.xNodeBuilder.Tests fails on non English Windows Fixed netfx System.Xml.Linq.xNodeBuilder.Tests fails on non English Windows. See https://github.com/dotnet/corefx/issues/28136 28184 area-System.Collections ImmutableArray<T>.Builder.Add splitted in fast- and cold-path # Description Based on https://github.com/dotnet/corefx/pull/28177#discussion_r175290368 `Add` is split in a fast-path without resizing the array, and a cold-path that does the resize. On the fast-path the bounds-check for the array-access is also eliminated. # Benchmarks Code for benchmarks is taken from [svick](https://github.com/svick/Benchmark/tree/66aed74) `SimpleAdd` is the original code, i.e. before https://github.com/dotnet/corefx/pull/28177 `TweakedAdd` is code of https://github.com/dotnet/corefx/pull/28177 `SplitAdd` is code of this PR. ## win-x64 ``` ini BenchmarkDotNet=v0.10.11, OS=Windows 10 Redstone 3 [1709, Fall Creators Update] (10.0.16299.309) Processor=Intel Core i7-7700HQ CPU 2.80GHz (Kaby Lake), ProcessorCount=8 Frequency=2742189 Hz, Resolution=364.6722 ns, Timer=TSC .NET Core SDK=2.1.300-preview1-008174 [Host] : .NET Core 2.1.0-preview1-26216-03 (Framework 4.6.26216.04), 64bit RyuJIT DefaultJob : .NET Core 2.1.0-preview1-26216-03 (Framework 4.6.26216.04), 64bit RyuJIT ``` | Method | Mean | Error | StdDev | |----------- |---------:|----------:|----------:| | SimpleAdd | 4.192 us | 0.0240 us | 0.0213 us | | TweakedAdd | 2.178 us | 0.0203 us | 0.0190 us | | SplitAdd | 1.950 us | 0.0140 us | 0.0124 us | ## linux-x64 ``` ini BenchmarkDotNet=v0.10.11, OS=ubuntu 16.04 Processor=Intel Core i7-7700HQ CPU 2.80GHz (Kaby Lake), ProcessorCount=4 .NET Core SDK=2.1.300-preview1-008174 [Host] : .NET Core 2.1.0-preview1-26216-03 (Framework 4.6.26216.04), 64bit RyuJIT DefaultJob : .NET Core 2.1.0-preview1-26216-03 (Framework 4.6.26216.04), 64bit RyuJIT ``` | Method | Mean | Error | StdDev | Median | |----------- |---------:|----------:|----------:|---------:| | SimpleAdd | 4.823 us | 0.0891 us | 0.0790 us | 4.816 us | | TweakedAdd | 2.547 us | 0.0521 us | 0.1318 us | 2.505 us | | SplitAdd | 2.232 us | 0.0434 us | 0.0426 us | 2.228 us | ## linux-x64 (different CPU) ``` ini BenchmarkDotNet=v0.10.11, OS=ubuntu 17.10 Processor=Intel Xeon CPU 2.60GHz, ProcessorCount=2 .NET Core SDK=2.1.4 [Host] : .NET Core 2.0.5 (Framework 4.6.0.0), 64bit RyuJIT DefaultJob : .NET Core 2.0.5 (Framework 4.6.0.0), 64bit RyuJIT ``` | Method | Mean | Error | StdDev | Median | |----------- |---------:|----------:|----------:|---------:| | SimpleAdd | 6.320 us | 0.1574 us | 0.2673 us | 6.182 us | | TweakedAdd | 3.947 us | 0.0767 us | 0.0788 us | 3.933 us | | SplitAdd | 3.439 us | 0.2023 us | 0.2408 us | 3.306 us | # Notes In https://github.com/dotnet/corefx/pull/28177#discussion_r175297033 @svick reports that this change decreases perf on his machine. That's why I tested on three different machines, and all show a perf improvement. [List<T>.Add](https://github.com/dotnet/coreclr/blob/4e1ec7f1dfd70d1a84fcc3282add9bdf3be115e3/src/mscorlib/shared/System/Collections/Generic/List.cs#L238), [Stack<T>.Push](https://github.com/gfoidl/corefx/blob/36ae61031f94c7d92ce8750c088bfa640b5ccb1e/src/System.Collections/src/System/Collections/Generic/Stack.cs#L290) and similar classes use this pattern and all show an improvement. 28186 area-System.Net Re-enable SocketsHttpHandler proxy test Closes https://github.com/dotnet/corefx/issues/23135 Fixed by https://github.com/dotnet/corefx/pull/28047 cc: @pjanotti 28188 area-System.Collections ConcurrentDictionary<,>.IsEmpty is barely faster than checking Count I would assume that a specialist method named `IsEmpty` is significantly faster than simply obtaining the `Count` of a `ConcurrentDictionary<,>`, yet it appears to be just a touch slower. x-ref https://github.com/WiseTechGlobal/WTG.Analyzers/pull/23#issuecomment-374116037 Similar to the benchmark in the linked above, here's a benchmark comparing an empty dictionary to one containing 1,200 items. I would expect `Empty_IsEmpty` to take roughly the same amount of time as `Contents_IsEmpty`, but it appears to scale up similarly to testing against `Count`. ``` // * Summary * BenchmarkDotNet=v0.10.13, OS=Windows 10 Redstone 3 [1709, Fall Creators Update] (10.0.16299.309) Intel Core i5-7600K CPU 3.80GHz (Kaby Lake), 1 CPU, 4 logical cores and 4 physical cores Frequency=3703123 Hz, Resolution=270.0423 ns, Timer=TSC .NET Core SDK=2.1.100-preview-007326 [Host] : .NET Core 2.0.5 (CoreCLR 4.6.26020.03, CoreFX 4.6.26018.01), 64bit RyuJIT DefaultJob : .NET Core 2.0.5 (CoreCLR 4.6.26020.03, CoreFX 4.6.26018.01), 64bit RyuJIT Method | Mean | Error | StdDev | Gen 0 | Allocated | ----------------- |------------:|----------:|----------:|-------:|----------:| Empty_IsEmpty | 67.29 ns | 0.0808 ns | 0.0716 ns | - | 0 B | Empty_Count | 67.49 ns | 0.0255 ns | 0.0199 ns | - | 0 B | Empty_LinqAny | 180.82 ns | 0.1109 ns | 0.0926 ns | 0.0203 | 64 B | Contents_IsEmpty | 3,907.88 ns | 1.8701 ns | 1.7493 ns | - | 0 B | Contents_Count | 4,129.74 ns | 1.5337 ns | 1.3596 ns | - | 0 B | Contents_LinqAny | 42.68 ns | 0.0471 ns | 0.0417 ns | 0.0203 | 64 B | ``` Is `IsEmpty` actually doing anything special or could the implementation just about be replaced with: ```csharp public bool IsEmpty => Count == 0; ``` ? I don't actually see a huge difference in the two implementations. 28189 area-System.Globalization "Test failure: System.Globalization.Tests.NumberFormatInfoCurrencyNegativePattern/CurrencyNegativePattern_Get(locale: \""fa-IR\"")" "Opened on behalf of @Sunny-pu The test `System.Globalization.Tests.NumberFormatInfoCurrencyNegativePattern/CurrencyNegativePattern_Get(locale: \""fa-IR\"")` has failed. Assert.Contains() Failure Not found: 8 In value: Int32[] [1, 0] Stack Trace: null Build : Master - 20180319.01 (Core Tests) Failing configurations: - Alpine.36.Amd64-x64 - Release Details: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180319.01/workItem/System.Globalization.Tests/analysis/xunit/System.Globalization.Tests.NumberFormatInfoCurrencyNegativePattern~2FCurrencyNegativePattern_Get(locale:%20%5C%22fa-IR%5C%22)" 28190 area-System.Globalization "Test failure: System.Globalization.Tests.RegionInfoPropertyTests/MiscTest(lcid: 1037, geoId: 117, currencyEnglishName: \""Israeli New Shekel\"", alternativeCurrencyEnglishName:)" "Opened on behalf of @Sunny-pu The test `System.Globalization.Tests.RegionInfoPropertyTests/MiscTest(lcid: 1037, geoId: 117, currencyEnglishName: \""Israeli New Shekel\"", alternativeCurrencyEnglishName:)` has failed. Assert.Equal() Failure ↓ (pos 1) Expected: ש״ח Actual: שקל חדש ↑ (pos 1) Stack Trace: at System.Globalization.Tests.RegionInfoPropertyTests.MiscTest(Int32 lcid, Int32 geoId, String currencyEnglishName, String alternativeCurrencyEnglishName, String currencyNativeName, String threeLetterISORegionName, String threeLetterWindowsRegionName) in /root/corefx-1490845/src/System.Globalization/tests/RegionInfo/RegionInfoTests.Properties.cs:line 122 Build : Master - 20180319.01 (Core Tests) Failing configurations: - Alpine.36.Amd64-x64 - Release Details: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180319.01/workItem/System.Globalization.Tests/analysis/xunit/System.Globalization.Tests.RegionInfoPropertyTests~2FMiscTest(lcid:%201037,%20geoId:%20117,%20currencyEnglishName:%20%5C%22Israeli%20New%20Shekel%5C%22,%20alternativeCurrencyEnglishName:)" 28191 area-System.IO Test failure: System.IO.Compression.BrotliStreamUnitTests/CopyTo_Roundtrip_OutputMatchesInput(useAsync: True) Opened on behalf of @Sunny-pu The test `System.IO.Compression.BrotliStreamUnitTests/CopyTo_Roundtrip_OutputMatchesInput(useAsync: True)` has failed. System.UnauthorizedAccessException : Access to the path 'C:\\dotnetbuild\\work\\450db565-bf00-4d68-a490-43459d4ec859\\Work\\f82b1636-4c61-452d-b914-af7ef6b8e23c\\Unzip' is denied. Stack Trace: at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle) in E:\A\_work\3090\s\src\mscorlib\shared\System\IO\FileStream.Windows.cs:line 1650 at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options) in E:\A\_work\3090\s\src\mscorlib\shared\System\IO\FileStream.Win32.cs:line 42 at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) in E:\A\_work\3090\s\src\mscorlib\shared\System\IO\FileStream.cs:line 230 at System.IO.File.InternalWriteAllBytes(String path, Byte[] bytes) in E:\A\_work\63\s\corefx\src\System.IO.FileSystem\src\System\IO\File.cs:line 362 at System.IO.File.WriteAllBytes(String path, Byte[] bytes) in E:\A\_work\63\s\corefx\src\System.IO.FileSystem\src\System\IO\File.cs:line 353 at System.IO.Compression.CompressionStreamUnitTestBase.CopyTo_Roundtrip_OutputMatchesInput(Boolean useAsync) in E:\A\_work\63\s\corefx\src\Common\tests\System\IO\Compression\CompressionStreamUnitTestBase.cs:line 1126 --- End of stack trace from previous location where exception was thrown --- Build : Master - 20180319.01 (Core Tests) Failing configurations: - Windows.7.Amd64-x86 - Release Details: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180319.01/workItem/System.IO.Compression.Brotli.Tests/analysis/xunit/System.IO.Compression.BrotliStreamUnitTests~2FCopyTo_Roundtrip_OutputMatchesInput(useAsync:%20True) 28192 area-System.Net Test failure: System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpClientHandlerTest/GetAsync_IPBasedUri_Success(address: ::1) Opened on behalf of @Sunny-pu The test `System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpClientHandlerTest/GetAsync_IPBasedUri_Success(address: ::1)` has failed. System.Net.Sockets.SocketException : Address not available Stack Trace: at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName) in /root/corefx-1490845/src/System.Net.Sockets/src/System/Net/Sockets/Socket.cs:line 5154 at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress) in /root/corefx-1490845/src/System.Net.Sockets/src/System/Net/Sockets/Socket.cs:line 758 at System.Net.Sockets.Socket.Bind(EndPoint localEP) in /root/corefx-1490845/src/System.Net.Sockets/src/System/Net/Sockets/Socket.cs:line 701 at System.Net.Test.Common.LoopbackServer.CreateServerAsync(Func`2 funcAsync, Options options) in /root/corefx-1490845/src/Common/tests/System/Net/Http/LoopbackServer.cs:line 63 at System.Net.Http.Functional.Tests.HttpClientHandlerTest.GetAsync_IPBasedUri_Success(IPAddress address) in /root/corefx-1490845/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.cs:line 380 --- End of stack trace from previous location where exception was thrown --- Build : Master - 20180319.01 (Core Tests) Failing configurations: - Alpine.36.Amd64-x64 - Release Details: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180319.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpClientHandlerTest~2FGetAsync_IPBasedUri_Success(address:%20::1) 28193 area-System.Diagnostics Process.StartTime on Linux - make it deterministic & compatible Process.StartTime on Linux - make it deterministic & compatible with other languages/frameworks, e.g. with Python's psutil.Process.create_time 28194 area-System.Xml Fix UTF32Encoding BOM being emitted by XmlWriter when ByteOrderMark set to false As mentioned in #26544, the BOM is still being emitted by XmlWriter when the supplied UTF32Encoding instance has it disabled by setting ByteOrderMark, in the UTF32Encoding ctor, to false. This is due XmlWriter.Create(...) creating a new Encoding instance (with a FallbackEncoder) from the one supplied in XmlWriterSettings. However, it only uses the CodePage to create the new Encoding instance which initializes with the defaults. The default for ByteOrderMark in the UTF32Encoding class is true. This fixes it by grabbing the BOM before creating a the new Encoding instance. cc: @krwq @pjanotti Resolves #26544 28195 area-System.ComponentModel [Regression] Wrong target type in System.ComponentModel.UInt16Converter.cs The target type on line 18 is wrong. It should be typeof(**ushort**), and not typeof(short) as it is today. Ref https://stackoverflow.com/questions/49361595/why-does-the-formatexception-returned-by-a-typeconverter-for-an-ushort-type-refe 28196 area-System.Net Restore EOF check in UDS test With a previous Windows build, support for Unix domain sockets had some issues regarding connection shutdown that caused Read{Async} to not properly return 0 when the connection was shut down, and so we changed a test to not rely on that. Now that those issues have been fixed, I'm restoring the test to its original intent. cc: @sunilmut, @eerhardt 28197 area-System.Memory More test data for Convert.TryFromBase64Chars() For better code coverage for fix for https://github.com/dotnet/corefx/issues/24897 28198 area-System.Data SqlUDTStorage.GetStaticNullForUdtType accessing shared dictionary without propery synchronization https://github.com/dotnet/corefx/blob/251d65c237aa26b49bc91bac25012340a93e64de/src/System.Data.Common/src/System/Data/Common/SqlUDTStorage.cs#L40-L63 It looks like it was written assuming Dictionary has the same thread-safety characteristics as Hashtable, but it doesn't. Whereas Hashtable is safe for any number of reads to be used concurrently with at most one writer, for a Dictionary a writer must have exclusive access. 28199 area-Microsoft.CSharp Microsoft.CSharp code using unprotected shared dictionaries "I did a search for ""static readonly Dictionary"" across corefx and looked for places where dictionaries were mutated without synchronization. It looks like there are a few in Microsoft.CSharp, e.g. https://github.com/dotnet/corefx/blob/251d65c237aa26b49bc91bac25012340a93e64de/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/SymbolStore.cs#L18 https://github.com/dotnet/corefx/blob/251d65c237aa26b49bc91bac25012340a93e64de/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/TypeArray.cs#L82-L83 https://github.com/dotnet/corefx/blob/251d65c237aa26b49bc91bac25012340a93e64de/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/TypeManager.cs#L18-L19 https://github.com/dotnet/corefx/blob/251d65c237aa26b49bc91bac25012340a93e64de/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/TypeTable.cs#L51-L62 It's possible there's something higher up in the call stacks that's guaranteeing safety, but it's not obvious from a quick code inspection. cc: @VSadov, @JonHanna " 28200 area-Infrastructure All TimeZone related tests failing on Alpine - could not find '/usr/share/zoneinfo/Local'. Opened on behalf of @danmosemsft https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180319.04/workItem/System.Runtime.Tests Example: ``` The test `System.Tests.TimeZoneInfoTests/Equals` has failed. System.TypeInitializationException : The type initializer for 'System.Tests.TimeZoneInfoTests' threw an exception. ---- System.TimeZoneNotFoundException : The time zone ID 'Local' was not found on the local computer. -------- System.IO.DirectoryNotFoundException : Could not find a part of the path '/usr/share/zoneinfo/Local'. Stack Trace: at System.Tests.TimeZoneInfoTests.Equals_TestData()+MoveNext() in /root/corefx-1491859/src/System.Runtime/tests/System/TimeZoneInfoTests.cs:line 1869 at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext() in /root/corefx-1491859/src/System.Linq/src/System/Linq/Select.cs:line 129 ----- Inner Stack Trace ----- at System.TimeZoneInfo.FindSystemTimeZoneById(String id) in /root/coreclr/src/mscorlib/shared/System/TimeZoneInfo.Unix.cs:line 645 at System.Tests.TimeZoneInfoTests..cctor() in /root/corefx-1491859/src/System.Runtime/tests/System/TimeZoneInfoTests.cs:line 39 ----- Inner Stack Trace ----- at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) in /root/coreclr/src/mscorlib/shared/Interop/Unix/Interop.IOErrors.cs:line 23 at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) in /root/coreclr/src/mscorlib/shared/Microsoft/Win32/SafeHandles/SafeFileHandle.Unix.cs:line 78 at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) in /root/coreclr/src/mscorlib/shared/System/IO/FileStream.cs:line 230 at Internal.IO.File.ReadAllBytes(String path) in /root/coreclr/src/mscorlib/shared/Internal/IO/File.cs:line 56 at System.TimeZoneInfo.TryGetTimeZoneFromLocalMachine(String id, TimeZoneInfo& value, Exception& e) in /root/coreclr/src/mscorlib/shared/System/TimeZoneInfo.Unix.cs:line 204 ``` Build : Master - 20180319.04 (Core Tests) Failing configurations: - Alpine.36.Amd64-x64 - Release 28201 area-System.Globalization "Test failure: System.Globalization.Tests.NumberFormatInfoCurrencyNegativePattern/CurrencyNegativePattern_Get(locale: \""fa-IR\"")" "Opened on behalf of @danmosemsft ``` The test `System.Globalization.Tests.NumberFormatInfoCurrencyNegativePattern/CurrencyNegativePattern_Get(locale: \""fa-IR\"")` has failed. Assert.Contains() Failure Not found: 8 In value: Int32[] [1, 0] Stack Trace: null ``` Build : Master - 20180319.04 (Core Tests) Failing configurations: - Alpine.36.Amd64-x64 - Release **Parameters to the Assert are reversed, please fix** ```c# Assert.Contains(format.CurrencyNegativePattern, NumberFormatInfoData.GetCurrencyNegativePatterns(locale)); ``` We see ICU version < 59 so we expect { 1, 0 } but the system is returning 8. Perhaps we are reading the ICU version wrong, or perhaps this ICU version is actually returning 8." 28202 area-System.Net System.Net.Sockets tests cause exception on threadpool thread The assert on src/.System.Net.Sockets/tests/FunctionalTests/Shutdown.cs:line 22 will cause an exception to be thrown on a threadpool thread. When it fires it will take down the whole test library. Consider either marshaling somehow back to the test, or using RemoteInvoke for all tests that lead to this codepath. ```c# private static void OnOperationCompleted(object sender, SocketAsyncEventArgs args) { Assert.Equal(SocketError.Success, args.SocketError); ``` ``` 2018-03-19 13:18:57,213: INFO: proc(54): run_and_log_output: Output: Unhandled Exception: Xunit.Sdk.EqualException: Assert.Equal() Failure 2018-03-19 13:18:57,213: INFO: proc(54): run_and_log_output: Output: Expected: Success 2018-03-19 13:18:57,213: INFO: proc(54): run_and_log_output: Output: Actual: OperationAborted 2018-03-19 13:18:57,214: INFO: proc(54): run_and_log_output: Output: at Xunit.Assert.Equal[T](T expected, T actual, IEqualityComparer`1 comparer) 2018-03-19 13:18:57,214: INFO: proc(54): run_and_log_output: Output: at System.Net.Sockets.Tests.Shutdown.OnOperationCompleted(Object sender, SocketAsyncEventArgs args) in /root/corefx-1491859/src/System.Net.Sockets/tests/FunctionalTests/Shutdown.cs:line 22 2018-03-19 13:18:57,214: INFO: proc(54): run_and_log_output: Output: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /root/coreclr/src/mscorlib/shared/System/Threading/ExecutionContext.cs:line 166 2018-03-19 13:18:57,214: INFO: proc(54): run_and_log_output: Output: --- End of stack trace from previous location where exception was thrown --- 2018-03-19 13:18:57,215: INFO: proc(54): run_and_log_output: Output: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /root/coreclr/src/mscorlib/shared/System/Threading/ExecutionContext.cs:line 166 2018-03-19 13:18:57,215: INFO: proc(54): run_and_log_output: Output: --- End of stack trace from previous location where exception was thrown --- 2018-03-19 13:18:57,215: INFO: proc(54): run_and_log_output: Output: at System.Threading.ThreadPoolWorkQueue.Dispatch() in /root/coreclr/src/mscorlib/src/System/Threading/ThreadPool.cs:line 588 ``` Example - this took out all S.Net.Sockets tests on Alpine. https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180319.04/workItem/System.Net.Sockets.Tests/wilogs 28203 area-System.Net "System.Net.Security.Tests fail on Alpine with ""Address Not Available""" https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180319.04/workItem/System.Net.Security.Tests Example: The test `System.Net.Security.Tests.ClientAsyncAuthenticateTest/ClientAsyncAuthenticate_EachClientUnsupportedProtocol_Fail(protocol: Ssl2)` has failed. Assert.Throws() Failure Expected: typeof(System.NotSupportedException) Actual: typeof(System.Net.Sockets.SocketException): Address not available Stack Trace: at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName) in /root/corefx-1491859/src/System.Net.Sockets/src/System/Net/Sockets/Socket.cs:line 5154 at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress) in /root/corefx-1491859/src/System.Net.Sockets/src/System/Net/Sockets/Socket.cs:line 758 at System.Net.Sockets.Socket.Bind(EndPoint localEP) in /root/corefx-1491859/src/System.Net.Sockets/src/System/Net/Sockets/Socket.cs:line 701 at System.Net.Sockets.TcpListener.Start(Int32 backlog) in /root/corefx-1491859/src/System.Net.Sockets/src/System/Net/Sockets/TCPListener.cs:line 142 at System.Net.Security.Tests.DummyTcpServer.StartListener(IPEndPoint endPoint) in /root/corefx-1491859/src/System.Net.Security/tests/FunctionalTests/DummyTcpServer.cs:line 38 at System.Net.Security.Tests.DummyTcpServer..ctor(IPEndPoint endPoint, Nullable`1 sslEncryptionPolicy) in /root/corefx-1491859/src/System.Net.Security/tests/FunctionalTests/DummyTcpServer.cs:line 58 at System.Net.Security.Tests.ClientAsyncAuthenticateTest.ClientAsyncSslHelper(EncryptionPolicy encryptionPolicy, SslProtocols clientSslProtocols, SslProtocols serverSslProtocols) in /root/corefx-1491859/src/System.Net.Security/tests/FunctionalTests/ClientAsyncAuthenticateTest.cs:line 152 Build : Master - 20180319.04 (Core Tests) Failing configurations: - Alpine.36.Amd64-x64 - Release 28204 area-System.Net "System.Net.NetworkInformation Ping tests fail with ""permission denied"" on Alpine" Eg https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180319.04/workItem/System.Net.Ping.Functional.Tests/analysis/xunit/System.Net.NetworkInformation.Tests.UnixPingUtilityTests~2FPacketSizeIsRespected(payloadSize:%200) ``` The test `System.Net.NetworkInformation.Tests.UnixPingUtilityTests/PacketSizeIsRespected(payloadSize: 0)` has failed. System.Exception : [/bin/ping6 -c 1 -s 16 ::1] process exit code is 1. StdOut:[PING ::1 (::1): 16 data bytes ] StdErr:[ping6: permission denied (are you root?) ] Stack Trace: at System.Net.NetworkInformation.Tests.UnixPingUtilityTests.PacketSizeIsRespected(Int32 payloadSize) --- End of stack trace from previous location where exception was thrown --- ``` Build : Master - 20180319.04 (Core Tests) Failing configurations: - Alpine.36.Amd64-x64 - Release https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180319.04/workItem/System.Net.Ping.Functional.Tests 28205 area-System.Memory Test failure: System.MemoryTests.MemoryTests/OwnedMemoryPinLargeArray The test `System.MemoryTests.MemoryTests/OwnedMemoryPinLargeArray` has failed. System.OutOfMemoryException : Exception of type 'System.OutOfMemoryException' was thrown. Stack Trace: at System.MemoryTests.MemoryTests.OwnedMemoryPinLargeArray() in E:\A\_work\63\s\corefx\src\System.Memory\tests\Memory\OwnedMemory.cs:line 125 Build : Master - 20180319.04 (Core Tests) Failing configurations: - Windows.81.Amd64-x86 - Release - Windows.7.Amd64-x86 - Release - Windows.10.Amd64.Core-x86 - Release - Windows.10.Amd64-x86 - Release Unlike the failure a few days ago, this is on .NET Core. @grabyourpitchforks 28206 area-System.Net Test failure: System.Net.Http.Functional.Tests.PlatformHandler_HttpClientHandler_ResponseDrain_Test/GetAsyncWithMaxConnections_DisposeBeforeReadingToEnd_DrainsRequestsAndReusesConnection(totalSize: 10000, readSize: 9500, mode: BytePerChunk) The test `System.Net.Http.Functional.Tests.PlatformHandler_HttpClientHandler_ResponseDrain_Test/GetAsyncWithMaxConnections_DisposeBeforeReadingToEnd_DrainsRequestsAndReusesConnection(totalSize: 10000, readSize: 9500, mode: BytePerChunk)` has failed. This is on .NET Framework. System.IO.IOException : Unable to write data to the transport connection: An established connection was aborted by the software in your host machine.\r ---- System.Net.Sockets.SocketException : An established connection was aborted by the software in your host machine Stack Trace: at System.Net.Sockets.NetworkStream.BeginWrite(Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state) at System.IO.Stream.<>c.<BeginEndWriteAsync>b__53_0(Stream stream, ReadWriteParameters args, AsyncCallback callback, Object state) at System.Threading.Tasks.TaskFactory`1.FromAsyncTrim[TInstance,TArgs](TInstance thisRef, TArgs args, Func`5 beginMethod, Func`3 endMethod) at System.IO.Stream.BeginEndWriteAsync(Byte[] buffer, Int32 offset, Int32 count) at System.IO.Stream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) at System.IO.Stream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count) at System.IO.StreamWriter.<FlushAsyncInternal>d__68.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.IO.StreamWriter.<WriteAsyncInternal>d__53.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.Http.Functional.Tests.HttpClientHandler_ResponseDrain_Test.<>c__DisplayClass4_1.<<GetAsyncWithMaxConnections_DisposeBeforeReadingToEnd_DrainsRequestsAndReusesConnection>b__2>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.Test.Common.LoopbackServer.<AcceptConnectionAsync>d__12.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.Http.Functional.Tests.HttpClientHandler_ResponseDrain_Test.<>c__DisplayClass4_0.<<GetAsyncWithMaxConnections_DisposeBeforeReadingToEnd_DrainsRequestsAndReusesConnection>b__1>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.Test.Common.LoopbackServer.<>c__DisplayClass11_0.<<CreateClientAndServerAsync>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.Test.Common.LoopbackServer.<CreateServerAsync>d__9.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.Http.Functional.Tests.HttpClientHandler_ResponseDrain_Test.<GetAsyncWithMaxConnections_DisposeBeforeReadingToEnd_DrainsRequestsAndReusesConnection>d__4.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) ----- Inner Stack Trace ----- at System.Net.Sockets.Socket.BeginSend(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags, AsyncCallback callback, Object state) at System.Net.Sockets.NetworkStream.BeginWrite(Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state) Build : Master - 20180319.04 (Full Framework Tests) Failing configurations: - Windows.10.Amd64-x86 - Release 28208 area-System.Net HttpContent.ReadAsStreamAsync is over-allocating memory In order to reduce memory overhead, we make webrequests return when the headers have been read using: `HttpClient.GetAsync(uri, HttpCompletionOption.ResponseHeadersRead);` The idea is that afterwards you'll be reading the bytes from the returned stream as they trickle in from the network. Or at least that's what I had hoped. But looking at the implementation, the moment you try and get the stream from the HttpContent, the entire stream is loaded into memory: https://github.com/dotnet/corefx/blob/master/src/System.Net.Http/src/System/Net/Http/HttpContent.cs#L253 If these responses are very large, it could exhaust the application for memory. Instead the ReadAsStreamAsync should return a buffer immediately and have it get filled as the bytes gets downloaded. The HttpCompletionOption doesn't really make much sense without doing this (apart from rejecting the response all-together based on the headers). 28209 area-System.Collections Apply hang protection to HashSet<T> that we added to Dictionary<K,V> HashSet is likely prone to the same expensive hang as it uses essentially the same datastructures. We should port dotnet/coreclr#16991 to Hashset. cc @benaadams 28210 area-System.Net add proxy bypass list processing for windows fixes #23150 This is last chunk for proxy configuration for HttpSocketHandler. The functionality matches code provided by WinHttp team as well as my experiments and testing. The pattern processing can possibly be compiled to single mega-match so we can do parallel processing but it does not seems necessary at the moment. WinHttp does does process entries sequentially. 28213 area-System.Net Fix sporadic WinHttpHandler failures with cookie tests Hopefully fixes https://github.com/dotnet/corefx/issues/27390 Hopefully fixes https://github.com/dotnet/corefx/issues/27374 Contributes to https://github.com/dotnet/corefx/issues/26092 cc: @davidsh 28214 area-Microsoft.CSharp Add comments around static dictionaries in the Csharp Runtime Binder Fixes #28199 28217 area-Infrastructure Restore ProjectN package consistency check Re-enable validation that ProjectN compiler and targeting pack are the same version. This was disabled while we worked to update System.Private.CoreLib with breaking public API changes. Resolves https://github.com/dotnet/corefx/issues/27619 28218 area-System.Runtime Adding tests for randomized hashing Adding tests for randomized hashing Testing that hash code returned from GetHashCode() is randomized on String, StringComparer and CultureInfo classes. Fixes #24466 cc: @danmosemsft @stephentoub 28219 area-Serialization DataContractSerializer omits properties when elements are not in alphabetical order "When attempting to read an xml document using the DataContractSerializer a property may not be populated if the element name is alphabetically before the first element. It is expected that element order should not affect deserialization. ViewModel [DataContract] public class ViewModel { [DataMember] public string Beta { get; set; } [DataMember] public string Alpha { get; set; } } example xml: <ViewModel xmlns=""http://schemas.datacontract.org/2004/07/ExampleProg""> <Beta>Beta</Beta> <Alpha>Alpha</Alpha> </ViewModel> After reading the xml to a stream and passing it to `DataContractSerializer.ReadObject` the resulting ViewModel will be set to Beta = ""Beta"", Alpha = """". If instead, the Alpha element is first, both properties are then set." 28220 area-System.IO Use FileSystemName in FileSystemWatcher "- Uses newer spanified version in FileSystemName - Doesn't allow extended match chars `<`, `>`, `""` as these are legal in Unix cc: @pjanotti, @danmosemsft Note that there are a lot of spanification opportunities here that I'll be creating issues to follow up on. " 28221 area-System.Console Can Console class tell us if it IsTty? Reading this code https://github.com/Microsoft/msbuild/blob/6851538897f5d7b08024a6d8435bc44be5869e53/src/Deprecated/Engine/Logging/BaseConsoleLogger.cs#L411-L426, it looks like information whether the console is redirected is useful for such scenarios. Other utilities written in .NET would could also utilitize this property to control colored output. Might be trickier to distinguish if it is a pseudo-tty (https://github.com/PowerShell/PowerShell/issues/6427). For now, perhaps `public bool IsTty { get; }` addition to Console could be considered? @rainersigwald 28223 area-System.Net HttpClient design and multiple proxies Hi, Many articles I have read recommend to only use one instance of HttpClient in an application but I am not sure how to use this class in the following scenario: - Server App (ASP.NET Core) - Heavy usage of HttpClient for outgoing requests (Http dependencies) - A different proxy has to be used for each outgoing request (round robin proxy with thousands of entries) Should I have one instance of HttpClient per proxy that will be used (meaning thousands of HttpClient-s allocated)? Or is it better in this scenario to use a different HttpClient instance for each request? Thanks! 28224 area-Meta Fix area owners for System.Data (no SqlClient) @karelz I believe @ajcvickers and I should be listed for System.Data. Let me know if you have any questions. 28225 area-System.Collections Break hangs on HashSet when a loop is formed on entries due to a concurrent operation Fixes: https://github.com/dotnet/corefx/issues/28209 cc: @danmosemsft @vancem @jkotas @stephentoub 28226 area-System.Net Fix sporadically failing PreAuthenticate test on WinHttpHandler The PreAuthenticate_FirstRequestNoHeader_SecondRequestVariousStatusCodes_ThirdRequestPreauthenticates tests a bunch of status codes, some of which are sporadically failing in CI with WinHttpHandler. According to the RFC, several of these status codes require that there not be a response body, but the test is sending one, and it would seem there are then race conditions that are causing WinHttp to fail here and there for these status codes, e.g. 204 and 304. This just fixes the test to not send a body. Fixes https://github.com/dotnet/corefx/issues/28122 cc: @davidsh, @geoffkizer 28227 area-System.Memory Add stress tests for Span<T> APIs From https://github.com/dotnet/corefxlab/issues/1313 - Tests with multiple threads to confirm that Span<T> APIs are stateless and thread safe - Tests with lots of GC allocations to confirm that when GC moves addresses around, the use of Span is still correct 28229 area-System.Net Fix ParseRoundTripTime() breaks on some cultures Using Ping.Ping().Send() and reading the RoundTripTime property breaks on some cultures (e.g. fr_FR) or returns wrong results (e.g. on de_DE). Fix adds InvariantCulture to the parse methode responsible for converting the round trip time to the double type. 28230 area-System.Net Using SslStream to make an ALPN connection - confusion over parameters to use. "@bobuva commented on [Mon Mar 19 2018](https://github.com/dotnet/core/issues/1361) I've updated to the .NET Core 2.1 preview in order to make an SSL connection. Our server requires an ALPN negotiation to occur. As I understand it, the preview is the first version of .NET Core to support ALPN. Here is essentially what I'm doing: ``` TcpClient tcpClient = new TcpClient(); tcpClient.Connect(ProxyClient.TestUbuntuHost, ProxyClient.TestUbuntuPort); var stream = tcpClient.GetStream(); SslStream sslStream = new SslStream(stream, false, new RemoteCertificateValidationCallback(ValidateServerCertificate)); X509Certificate2 certificate = new X509Certificate2(@""<a filename provided>); X509Certificate2Collection certColl = new X509Certificate2Collection(certificate); sslStream.AuthenticateAsClient( ProxyClient.TestUbuntuHost, certColl, SslProtocols.Tls11 | SslProtocols.Tls12, false); ``` The `ValidateServerCertificate` looks like this: ``` public static bool ValidateServerCertificate( object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { if (sslPolicyErrors == SslPolicyErrors.None) return true; Console.WriteLine(""Certificate error: {0}"", sslPolicyErrors); // Do not allow this client to communicate with unauthenticated servers. return false; } ``` I get this error: ` System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.` whether or not I pass that 3rd param to the `SslStream` constructor. Can you shed some light on whether I need to do something else to enforce the ALPN negotiation? Thanks, Bob " 28232 area-System.Data Improve Integrated Auth Failure message with SQL Server When an integrated auth failure occurs, then an error message pointing to running kinit is shown. Based on the experiences of Sql Ops Studio users, it seems like lot of customers don't have an SPN registered for the SQL Server to which they are trying to connect to, hence a Kerberos token for Sql Server cannot be generated correctly from the KDC and the authentication cannot be performed correctly. The error message should hint the users to check for both kinit command on the client side and to check the server configuration to make sure that an SPN is registered. Fixes https://github.com/dotnet/corefx/issues/25328 28233 area-System.Globalization Fix Globalization tests on Alpine Fixes #28189 and #28190 28234 area-Infrastructure Share common props file for manual shims Share common props file for the manual shims. Add GenFacadesForceZeroVersionSeeds=true so that the assembly references for the shims are set to 0.0.0.0 so that they will correctly unify up and support multiple versions of OOB packages like SqlClient. cc @ericstj Fixes https://github.com/dotnet/corefx/issues/28139 depends on BuildTools update change https://github.com/dotnet/buildtools/pull/1970 28235 area-System.Net Improve support for URIs without hosts This change fixes a regression in `System.Uri` involving URIs that have no host. The change primarily impacts implicit file URIs and URIs with unknown schemes. Behavior will change if both of the following are true: - The URI contains Unicode characters - The URI is an implicit file URI, or has an unknown scheme and no host The change is just to revert #9542 and port a fix for the same issue from .NET Framework. Fixes: #25632 28236 area-System.Memory Rename string-like Span.Equals method to SequenceEqual "We have the following string-like extension method for `ReadOnlySpan<char>`: ```C# public static bool Equals(this ReadOnlySpan<char> span, ReadOnlySpan<char> other, StringComparison comparisonType) ``` However, due to its name, we are unable to leverage the implicit cast from string to `ReadOnlySpan<char>`. The following code throws a compiler error since it fails to match the correct overload. ```C# string test = ""Hello World!""; ReadOnlySpan<char> span = new char[100]; bool result = span.Equals(test, StringComparison.Ordinal); // Current workarounds - specify the type explicitly or call AsSpan: // bool result = span.Equals((ReadOnlySpan<char>)test, StringComparison.Ordinal); // bool result = span.Equals(test.AsSpan(), StringComparison.Ordinal); // bool result = MemoryExtensions.Equals(span, test, StringComparison.Ordinal); ``` Error CS0176 Member 'object.Equals(object, object)' cannot be accessed with an instance reference; qualify it with a type name instead Should we rename the method to SequenceEqual instead? We already have a SequenceEqual method (which only takes a single argument), which means, we would end up with a non-generic overload, specific to `ReadOnlySpan<char>`. ```C# public static bool SequenceEqual<T>(this ReadOnlySpan<T> span, ReadOnlySpan<T> other) where T : System.IEquatable<T> {} public static bool SequenceEqual<T>(this Span<T> span, ReadOnlySpan<T> other) where T : System.IEquatable<T> {} // ADD: public static bool SequenceEqual(this ReadOnlySpan<char> span, ReadOnlySpan<char> other, StringComparison comparisonType) {} ``` The alternative of adding an Equals overload that takes `string` as the argument will not work in resolving the overload matching issue. Other alternatives for names: - EqualsTo cc @KrzysztofCwalina, @terrajobst, @VSadov " 28237 area-System.Memory Don't run LargeArray test on 32 bit platforms. Fixes https://github.com/dotnet/corefx/issues/28205. 28238 area-System.Memory Consolidate the string and span tests for the string-like APIs See https://github.com/dotnet/corefx/pull/27319#discussion_r170049466 for additional details and context. This way, all the tests will be in one place making it easier to maintain, rather than duplicated between assemblies. Consider moving them to Common as well and reference from System.Memory.csproj so that running System.Memory tests will run all the span related tests. cc @tarekgh 28239 area-System.Memory Optimize the string-like Span APIs for OrdinalIgnoreCase (portable Span) Resolves https://github.com/dotnet/corefx/issues/27379 cc @KrzysztofCwalina, @jkotas, @tarekgh I was considering the following relatively naiive implementation of IndexOf for OrdinalIgnoreCase which performs better than allocating a string, in most cases, but could regress perf by up to 50% in the worst case: `'aaa...aaa'.IndexOf('aaa...aaa€', StringComparison.OrdinalIgnoreCase)` which adds overhead without incrementing `i` ```C# private static unsafe int IndexOfOrdinalIgnoreCase(ReadOnlySpan<char> span, ReadOnlySpan<char> value) { if (value.Length == 0) return 0; // Assuming changing case doesn't affect length if (value.Length > span.Length) return -1; int count = span.Length - value.Length + 1; int i = 0; uint charB = value[0]; if (charB > 0x7F) goto StringAllocation; if ((charB - 'a') <= 'z' - 'a') charB -= 0x20; for (; i < count; i++) { uint charA = span[i]; if (charA > 0x7F) goto StringAllocation; if ((charA - 'a') <= 'z' - 'a') charA -= 0x20; if (charA == charB) { int j = 1; for (; j < value.Length; j++) { charA = span[i + j]; charB = value[j]; if (charA > 0x7F || charB > 0x7F) goto StringAllocation; if (charA == charB) continue; // uppercase both chars if ((charA - 'a') <= 'z' - 'a') charA -= 0x20; if ((charB - 'a') <= 'z' - 'a') charB -= 0x20; if (charA != charB) break; } if (j == value.Length) return i; } } if (i == count) return -1; StringAllocation: int result = span.Slice(i).ToString().IndexOf(value.ToString(), StringComparison.OrdinalIgnoreCase); return result == -1 ? result : result + i; } ``` 28241 area-System.Net Memory leak in HttpClient using ASP.NET Core "I encounter a memory leak problem when using HttpClient to access an HTTPS URL. Code running on ASP.NET Core + Linux server(AWS AMI). After about 1000,000 requests, RAM occupation (RES in top) will grows to about 1GB and not release after all requests are done. If I send more requests, ram will eventually occupy all avaliable system ram and stop responding. Testing environment: AWS c4.xlarge , Linux AMI, Dotnetcore 2.0.6 Runtime Testing method: ab -n 1000000 -c 100 http://127.0.0.1:5000/ Testing code: ```csharp static HttpClient client = new HttpClient(); public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { app.Run(async (context) => { string content = """"; using (var response = await client.GetAsync(""https://some.site.com/hello"")) // Only leak with HTTPS URLS { content = await response.Content.ReadAsStringAsync(); } await context.Response.WriteAsync(content); }); } ``` If use a HttpClient pool with some fixed number HttpClient that HttpClient only request https one at a time, the RAM will be fine(no leakage found). Am I using HttpClient wrong? static instance vs pooled httpclient?" 28242 area-System.IO WIP: Enable TimesIncludeMillisecondPart on selected filesystems only Use filesystem name to suppress the test failure 28243 area-Meta Move to optimized shared Marvin implementation in corefx 28245 area-Infrastructure Attempt to fix Ubuntu arm64 legs Per @MichaelSimons' comment: https://github.com/dotnet/corefx/pull/28211#issuecomment-374622252 cc: @sdmaclea 28247 area-Infrastructure CI Build step 'Execute shell' marked build as failure 09:35:37 [ubuntu16.04_arm64_cross_debug_prtest] $ /bin/sh -xe /tmp/jenkins6999066973616382871.sh 09:35:37 + tar -czf bin/build.tar.gz --directory=bin/runtime/netcoreapp-Linux-Debug-arm64 . 09:35:37 tar: bin/runtime/netcoreapp-Linux-Debug-arm64: Cannot open: No such file or directory 09:35:37 tar: Error is not recoverable: exiting now 09:35:37 Build step 'Execute shell' marked build as failure https://ci.dot.net/job/dotnet_corefx/job/master/job/ubuntu16.04_arm64_cross_debug_prtest/11/consoleFull#-8536224876a086b3e-df04-41d2-bc4d-43e8f9406d07 28248 area-System.Data Fix dictionary access in SqlUDTStorage Fixes https://github.com/dotnet/corefx/issues/28198 cc: @saurabh500 28249 area-System.Security Create an API to manipulate PKCS12 objects "https://tools.ietf.org/html/rfc7292 * Allow enumeration of contents by type (KeyBag, PKCS8ShroudedKeyBag, CertBag, CRLBag, SecretBag) * SafeContents is a recursive node, so maybe it needs to be part of the enumerator and not an enumeratable thing. Or maybe it should also be enumeratable because maybe someone wants to indicate ""these belong together"" for its contents. * Should allow the authenticity and integrity passwords to be different (in password mode) * Technically, the integrity mode can also be disabled. * P2: Support for public-key modes * P3: Support for { public key integrity, password authenticity } and { password integrity, public key authenticity } * Virtuous: A method which, given an X509Certificate2 where HasPrivateKey=true adds the key and the cert and used an automatic cert/key relationship identifier. * Windows-style would be to add the key to a shrouded key bag, the cert to be added to a CertBag which gets encrypted, and the key identifier to be a sequence number. * Windows also would carry the persisted key name (as ""friendly name"") and an indicator of the CSP/KSP, and (if appropriate) an indication if the key was a machine key or user key. * Need to decide what parts of these to do by default * Each added item needs to be capable of having properties defined on it. (And each enumerated item capable of having the properties inspected) Gotchas: * The spec allows for keys to be ""shrouded"" (PKCS8 encrypted), unencrypted KeyBag, or encrypted KeyBag. Need a way to distinguish user intent. * The spec allows for unencrypted and encrypted CertBags. So we need a way to distinguish user intent. * Technically speaking, all other bags have this same conundrum. Only private keys are tri-state, though. Algorithms: * Windows 7 only supports the legacy PBES1 options. * We definitely need to allow user expression of algorithm. Should we require it? Or have a default of ""What Windows 7 does""? Design: * Maybe ""build"" and ""read"" don't need to be the same class? * If builder is separate, does it need ""append""? * For a separate builder, it might be easiest to require the passwords/keys at construction time, and then have an API which is AddEncryptedContents(SafeBag) and AddUnencryptedContents(SafeBag). * Or maybe SafeBags should have a property of whether they are (reader) or should-be (builder) encrypted." 28250 area-Infrastructure [Arm64] Fix CI tar path @stephentoub PTAL Fixes #28247 Built in the docker image, and tested the tar path. Matches tar path used for x86 below. 28251 area-System.IO ReadOnlySequence's Enumerator returns different results for same struct. Repro: I am using Pipelines to obtain a ReadOnlySequence from a PipeReader. I am then iterating over the number of chunks in the buffer to count the buffer size, and then iterating again to add them into an array. Something like: ```C# var pipe = new Pipe(new SlabMemoryPool()); ... var readResult = pipe.Reader.ReadAsync(); var readOnlySequence = readResult.Buffer; var nChunks = 0; for (var memory in readOnlySequence) { nChunks++; } var handles = new MemoryHandle[nChunks]; var currentChunk = 0; for (var memory in readOnlySequence) { handles[currentChunk] = new MemoryHandle(); currentChunk++; } ``` The writer to the pipe is writing and flushing memory in a loop: ```c# pipe.Writer.Write(buffer); pipe.Writer.FlushAsync(); ``` My hypothesis is that the enumerator is skipping empty segments somehow. cc/ @pakrym @davidfowl 28252 area-Infrastructure Cross compile legs have machine affinity set to 'Ubuntu14.04' 'arm-cross-latest' Since these jobs are using docker there doesn't seem to be a technical reason for this. @mmitche Suggested this be dropped. Opening an issue to track 28253 area-System.ComponentModel Fix wrong target type in UInt16Converter Fixes https://github.com/dotnet/corefx/issues/28195 @AlexGhiondea, I added a test for this specific case, but I'd suggest subsequently we refactor the tests to move most of the [Fact]s to the (abstract) base class, such that this test can be made to apply to other derived test classes as well, and other tests moved down as well to avoid the duplication. The derived types would override various properties to customize how the base tests behave (e.g. what converter to use, the target type, etc.) 28254 area-Infrastructure [release/2.0.0] Share common props file for manual shim Share common props file for the manual shims. Add GenFacadesForceZeroVersionSeeds=true so that the assembly references for the shims are set to 0.0.0.0 so that they will correctly unify up and support multiple versions of OOB packages like SqlClient. cc @ericstj Fixes https://github.com/dotnet/corefx/issues/28139 in release/2.0.0 branch. 28255 area-System.IO Add Path.TryGetTempPath() From API proposal #27418. Need to add: ``` C# namespace System.IO { public static class Path { public static bool TryGetTempPath(Span<char> destination, out int charsWritten); } } ``` Returns false if the destination isn't large enough to fit the full path into. 28256 area-System.IO Add Path.TryGetRandomFileName() From API proposal #27418. Need to add: ``` C# namespace System.IO { public static class Path { public static bool TryGetRandomFileName(Span<char> destination, out int charsWritten); } } ``` Returns false if the destination isn't large enough to fit the full path into. 28257 area-System.IO Add Path.TryGetRelativePath() From API proposal #27418. Need to add: ``` C# namespace System.IO { public static class Path { public static bool TryGetRelativePath(ReadOnlySpan<char> relativeTo, ReadOnlySpan<char> path, Span<char> destination, out int charsWritten); } } ``` Returns false if the destination isn't large enough to fit the full path into. 28258 area-System.IO Add Path.TryGetFullPath() From API proposal #27418. Need to add: ``` C# namespace System.IO { public static class Path { public static bool TryGetFullPath(ReadOnlySpan<char> path, Span<char> destination, out int charsWritten); public static bool TryGetFullPath(ReadOnlySpan<char> path, ReadOnlySpan<char> basePath, Span<char> destination, out int charsWritten); } } ``` Returns false if the destination isn't large enough to fit the full path into. 28261 area-System.Memory ROS: Don't skip blocks passed end Seen in https://github.com/dotnet/corefx/pull/28095#discussion_r175247253 /cc @AlexRadch @pakrym @davidfowl @ahsonkhan 28265 area-Infrastructure CI Drop PR trigger for Ubuntu16.04 arm64 Debug Build leg Due to CI capacity, it would be better to not run these on every PR. @weshaggard Please assign to me. I'll take care of it after #28250 merges. @eerhardt I'll also take care of sharing more code as you suggested. 28266 area-System.Memory Fix skipping last segment logic in ROS.TryGet https://github.com/dotnet/corefx/issues/28251 28267 area-System.Net Could not load file or assembly System.Net.Http Version=4.0.0.0 in .net core app "I've got this issue in .net core 2.0, just to give you more idea about what I'm trying to achieve. I'm trying to connect to VSTS and update the test status ""Passed"" or ""Failed"" based on my unit tests I run of this ""Could not load file or assembly System.Net.Http Version=4.0.0.0"" issue where the code is trying to open a connection to vsts. var connection = new VssConnection(""https://.visualstudio.com"", credentials);" 28268 area-Infrastructure 200 to uwp6.1 @HollyAM @karelz @nattress @weshaggard PTAL This ports servicing changes from release/2.0.0 to UWP 6.1. I made some judgement calls on what should and shouldn't be ported, so there may be some needed changes to this PR. PTAL if anything stands out. 28270 area-System.Data System.Data.SqlClient.TdsParser performance improvement I've done a little research and it looks like we do a lot of unnecessary allocations in the 'TryReadSqlDateTime' method. For each call of the method we allocate the array of bytes (`` byte[] datetimeBuffer = new byte[length];``) instead of allocating it once and then reuse existing array. Let's imagine that we read 1 million DateTime values from database. Using existing implementation of TdsParser we will have 1 million allocations of byte[] what causes unnecessary memory traffic and isn't so good for GC. So, if nobody minds, I'd make the described changes and then estimate benefits. 28271 area-System.Threading Microsoft.Tpl.Dataflow does not contain assembly reference for .NET version 4 Hi, I am in need of a version of dataflow that targets .net version 4. This is the error I get when I try to install Microsoft.Tpl.Dataflow or System.Threading.Tasks.Dataflow. ``` Could not install package 'Microsoft.Tpl.Dataflow 4.5.8'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.``` 28274 area-System.Memory Running Unit Tests fail with .net Core 2.1 when using System.Memory 4.5.0-preview3 package "I have a very simple case: - A .net Core 2.1 (Preview 2) library project containing the library to test. Referencing the System.Memory NuGet Package (4.5.0-preview3) - A .net Core 2.1 (Preview 2) library project for the unit test, referencing the first library. I've tried, xUnit, nUnit frameworks and `dotnet test`, Visual Studio Runner (15.7 Preview 1) and Resharper Runner (2018.1 EAP 3) and I can't get my unit test executed. I've used `""Microsoft.NET.Test.Sdk"" Version=""15.6.1""` and `""Microsoft.NET.Test.Sdk"" Version=""15.7.0-preview20180307""`. I have this error: ``` Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: Testhost process exited with error: Unhandled Exception: System.TypeLoadException: Could not load type 'System.MemoryExtensions' from assembly 'System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. at System.Net.IPAddress.Parse(String ipString) at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.TcpClientExtensions.GetIPEndPoint(String value) at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.SocketClient.Start(String endPoint) at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.TestRequestHandler.InitializeCommunication() at Microsoft.VisualStudio.TestPlatform.TestHost.DefaultEngineInvoker.Invoke(IDictionary`2 argsDictionary) at Microsoft.VisualStudio.TestPlatform.TestHost.Program.Main(String[] args) at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources, CancellationToken cancellationToken) at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyExecutionManager.StartTestRun(TestRunCriteria testRunCriteria, ITestRunEventsHandler eventHandler) Test Run Aborted. ``` Apparently the Microsoft.NET.Test.Sdk doesn't get along well with the System.Memory NuGet package (System.Memory 4.5.0-preview3-26318-03) that I use in my tested library because it can't load `type 'System.MemoryExtensions' from assembly 'System.Memory, Version=4.0.1.0` Any idea?" 28275 area-System.Numerics System.Numerics give System.IndexOutOfRangeException when I try to process a vector with 2 items. The exceptions do not really help me figure out the issue "the most basic implementation did not work for me. Vector constructor gives me System.IndexOutOfRangeException: 'Index was outside the bounds of the array.' a thread on stackoverflow says there is a lower limit on the array size but it should be implemented inside the class ```c# using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Numerics; class Program { static void Main(string[] args) { float[] f1 = new float[] { 1, 2 }; float[] f2 = new float[] { 1, 2 }; Vector<float> v1 = new Vector<float>(f1); Vector<float> v2 = new Vector<float>(f2); Vector<float> v3; v3 = Vector.Add<float>(v1, v2); for (int i = 0; i <= 1; i++) { Console.WriteLine(""Item "" + i.ToString() + "": "" + v3[i].ToString()); } Console.ReadKey(); } } ``` [EDIT] Format code snipper into readable form by @karelz" 28278 area-System.Net Add server-side SNI support Related issue: https://github.com/dotnet/corefx/issues/24553 This is for overview only so that it is easier to discuss the API shape. Changes to original proposal: - delegate is defined in the namespace and not in the SslStream (to match others) - name has changed to ServerCertificateSelectionCallback - removed X509CertificateCollection from return values as currently do not see what it would be used for (if other implementations require it will change it) Left: - https://github.com/dotnet/corefx/issues/28585 client on windows does not seem to be IDN mapping before sending. current version supports both but need to revalidate with the spec - document what is known during the callback cc @Drawaes 28281 area-System.Memory Port over non-redundant Span tests from corefxlab From https://github.com/dotnet/corefxlab/issues/1403 Add span-based tests from corefxlab that are non-redundant and are testing interesting scenarios. From a cursory view, here are some examples: https://github.com/dotnet/corefxlab/blob/5b2bbc602833e4fac9a2cfe05ddfafe612dd9e86/tests/System.Buffers.Primitives.Tests/BasicUnitTests.cs#L332 https://github.com/dotnet/corefxlab/blob/5b2bbc602833e4fac9a2cfe05ddfafe612dd9e86/tests/System.Buffers.Primitives.Tests/CastTests.cs#L54 https://github.com/dotnet/corefxlab/blob/5b2bbc602833e4fac9a2cfe05ddfafe612dd9e86/tests/System.Buffers.Primitives.Tests/CastTests.cs#L90 https://github.com/dotnet/corefxlab/blob/5b2bbc602833e4fac9a2cfe05ddfafe612dd9e86/tests/System.Buffers.Primitives.Tests/CastTests.cs#L126 https://github.com/dotnet/corefxlab/blob/5b2bbc602833e4fac9a2cfe05ddfafe612dd9e86/tests/System.Buffers.Primitives.Tests/OverflowTests.cs#L27 28282 area-System.Memory Memory<T> should implement IReadOnlyList<T> "Migrating corefxlab issue https://github.com/dotnet/corefxlab/issues/903 on behalf of @smmalis37 now that Span/Memory have moved to the corefx repo for .NET Core 2.1: > Essentially we're constructing a list of objects in C++ code and then accessing this list on the C# side. Since we don't want to duplicate all of these objects (as the lists can be quite large and memory consumption is a concern) we've created a type that acts similarly to the unsafe constructor on Span to access the items without duplicating them and handle type safety. There are some other lists we create on the C# side, and so to make consumption of our API simpler we just expose everything as an IReadOnlyList (since users shouldn't be modifying what we expose). **I'd love to be able to replace our type with Span for simplicity and for ""official"" support.** " 28283 area-System.Memory Productize NativeOwnedMemory Tracking issue original from https://github.com/dotnet/corefxlab/issues/1924 ```c# namespace System.Buffers { public sealed class NativeOwnedMemory<T> : OwnedMemory<T> { public NativeOwnedMemory(void* pointer, int length); ... } } ``` 28285 area-Meta Some enhancements for existing classes Since there is many enhancements in the framework these days, I suggest to review all existing classes and update them to benefit from new features, such as: - methods that receive objects and/or return objects can use generics. - methods that have out parameters can have overloads that return ValueTuples - All properties and parameters that only deal with positive numbers like Lengths, widths, heights, can be modified to use uint instead of int (same for other signed types). This will eliminate the need checks for raising exceptions for negative values, because the compiler can discover this in design time, or the cast will raise an exception in runtime. Also, Unsigned types have a double range than signed types. - Add some Deconstructors to classes. - The Math.Min and Math.Max can have a param array to allow compare three or more elements. Perhaps you can add some more math functions like factorial, sum, avg..... etc. - and so on…. and so on. I think most of these changes will not break any code. But I don't see any problem in breaking changes as long as they are for the best. Besides, one can always choose to run old projects on old frameworks version. 28289 area-Infrastructure [Arm64/Ubuntu] Rework official build flow to support bootstrapping @mmitche @weshaggard @janvorli @stephentoub PTAL I was concerned the `buildpipeline/DotNet-CoreFx-Trusted-Linux-Crossbuild.json` wouldn't work for arm64. I took a detailed look and I think I understood it enough to be certain it wouldn't work for arm64. I manually built arm64 corefx packages. Using this process so it should be close. The primary impact of this patch is that ``` ./build.sh $(PB_BuildArguments) ``` becomes ``` ./build-native.sh $(PB_BuildNativeArguments) ./build-managed.sh $(PB_BuildManagedArguments) ./build-packages.sh $(PB_BuildPackagesArguments) ``` This allows cross bootstrapped builds by allowing the managed build to be built against x64. The original draft of the patch added a new file `DotNet-CoreFx-Trusted-Linux-Crossbuild-Bootstrap.json`, but this shared approach seemed better. I will also update #28280 to use a similar flow and build all the way to packages. 28292 area-System.IO test enabled on redhat6 28294 area-System.Memory Don't skip blocks passed end and simplify the Seek implementation. Borrows the tests from https://github.com/dotnet/corefx/pull/28261 by @benaadams and builds on top of it. - Ignore the formatting/clean up changes. - The most important change is to the Seek and SeekMultiSegment methods. With this simplification, the fix in https://github.com/dotnet/corefx/pull/28261 is no longer necessary, since this PR supersedes it. - This change greatly simplifies the implementation (and the disassembly shrinks, i.e. this will almost certainly help performance). The loop body shrinks to 14 instructions, from 23. **Before (loop highlighted):**  **After (loop highlighted):**  cc @AlexRadch, @pakrym, @davidfowl, @joshfree, @benaadams 28296 area-System.Memory Move Span APIs that allow skipping visibility checks to MemoryMarshal Resolves https://github.com/dotnet/corefx/issues/27094 **TODO:** Remove AsBytes extension method once all calls have been changed to MemoryMarshal Depends on the PR from coreclr (along with the mirror PR) - https://github.com/dotnet/coreclr/pull/17087 / https://github.com/dotnet/coreclr/pull/17106. It will fail CI until then. cc @jkotas, @KrzysztofCwalina, @dotnet/corefxlab-contrib 28299 area-System.Xml Test failure: System.Xml.Tests.XmlWriterTests_Encoding/WriteWithUtf32EncodingNoBom Opened on behalf of @Sunny-pu The test `System.Xml.Tests.XmlWriterTests_Encoding/WriteWithUtf32EncodingNoBom` has failed. System.PlatformNotSupportedException : Compilation of XSLT is not supported on this platform. Stack Trace: at System.Xml.Xsl.XslCompiledTransform.CompileQilToMsil(XsltSettings settings) in E:\A\_work\14\s\corefx\src\System.Private.Xml\src\System\Xml\Xslt\XslCompiledTransform.cs:line 204 at System.Xml.Xsl.XslCompiledTransform.LoadInternal(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver) in E:\A\_work\14\s\corefx\src\System.Private.Xml\src\System\Xml\Xslt\XslCompiledTransform.cs:line 172 at System.Xml.Xsl.XslCompiledTransform.Load(XmlReader stylesheet) in E:\A\_work\14\s\corefx\src\System.Private.Xml\src\System\Xml\Xslt\XslCompiledTransform.cs:line 107 at System.Xml.Tests.XmlWriterTests_Encoding.WriteWithUtf32EncodingNoBom() in E:\A\_work\14\s\corefx\src\System.Private.Xml\tests\XmlWriter\WriteWithEncoding.cs:line 69 Build : ProdCon - Master - 20180321.01 (UWP F5 Tests) Failing configurations: - Windows.10.Arm64-arm - Release - Windows.10.Amd64.ClientRS3-x64 - Release - Windows.10.Amd64.ClientRS3-x86 - Release Details: https://mc.dot.net/#/product/netcore/prodconmaster/source/prodcon~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fuwp~2F/build/20180321.01/workItem/System.Xml.RW.XmlWriter.Tests/analysis/xunit/System.Xml.Tests.XmlWriterTests_Encoding~2FWriteWithUtf32EncodingNoBom 28301 area-System.Diagnostics Question - What is the Difference between Debug Type Full & Pdb "Hi, I have a question regarding the build output when setting the Debug Type Full or Pdb-Only in project properties on .NET Core. As far as I could see the assemblies produced are the same? I also don't see any difference in the pdb files which are produced... but maybe am missing something. In full framework there is definitely a difference and it could have perf impact on resulting code, should we have the same concerns on .NET Core? or is it a non-issue. _""One difference between -debug:pdbonly and -debug:full is that with -debug:full the compiler emits a DebuggableAttribute, which is used to tell the JIT compiler that debug information is available. Therefore, you will get an error if your code contains the DebuggableAttribute set to false if you use -debug:full. "" - https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/debug-compiler-option Thanks" 28303 area-System.Security Support exporting cryptographic keys to PEM format. It would be very helpful to add the functionality to most of the asymmetric cryptographic algorithm implementations to add an explicit method to both import and export the cryptographic keys to the PEM file format. We already have ```ToXmlString``` and ```FromXmlString``` on the [AsymmetricAlgorithm](https://github.com/dotnet/corefx/blob/master/src/System.Security.Cryptography.Primitives/src/System/Security/Cryptography/AsymmetricAlgorithm.cs) base class so adding a ```ToPemString``` and ```FromPemString``` would make sense to me at least. I realize PEM is not exactly a standard format but it is being used extensively as format for encryption/signature keys in many utilities (like openssl) so supporting it for at least most common algorithms (RSA, ECDsa, X509, DSA, PKCS7, PKCS8) seems like a logical thing to do with .NET now being cross-platform. The current format is mostly dictated by [RFC 7468](https://tools.ietf.org/html/rfc7468) as well as [OpenSSL's PEM handling](https://github.com/openssl/openssl/blob/master/include/openssl/pem.h). 28304 area-Serialization Netfx System.Runtime.Serialization.Json.ReflectionOnly.Tests fails 2 tests at Tomsk time zone "Netfx System.Runtime.Serialization.Json.ReflectionOnly.Tests fails 2 tests at Tomsk time zone with next log: ``` Starting: System.Runtime.Serialization.Json.ReflectionOnly.Tests DataContractJsonSerializerTests.DCJS_EnumerableCollection [FAIL] strings differ at index 23 [expected]:84800000+0600)\/"",""\/Date(9467 [actual ]:84800000+0700)\/"",""\/Date(9467 [Expected (with length=91)]: [""\/Date(946684800000+0600)\/"",""\/Date(946771200000+0600)\/"",""\/Date(946857600000+0600)\/""] [Actual (with length=91)]: [""\/Date(946684800000+0700)\/"",""\/Date(946771200000+0700)\/"",""\/Date(946857600000+0700)\/""] Test failed for input: SerializationTypes.EnumerableCollection Expected: [""\/Date(946684800000+0600)\/"",""\/Date(946771200000+0600)\/"",""\/Date(946857600000+0600)\/""] Actual: [""\/Date(946684800000+0700)\/"",""\/Date(946771200000+0700)\/"",""\/Date(946857600000+0700)\/""] Expected: True Actual: False Stack Trace: в Xunit.Assert.True(Nullable`1 condition, String userMessage) в C:\BuildAgent\work\cb37e9acf085d108\src\xunit.assert\Asserts\BooleanAsserts.cs:строка 90 в DataContractJsonSerializerTests.SerializeAndDeserialize[T](T value, String baseline, DataContractJsonSerializerSettings settings, Func`1 serializerFactory, Boolean skipStringCompare) в DataContractJsonSerializerTests.DCJS_EnumerableCollection() DataContractJsonSerializerTests.DCJS_VerifyDateTimeForFormatStringDCJsonSerSetting [FAIL] strings differ at index 23 [expected]:40000000+0600)\/"" [actual ]:40000000+0700)\/"" [Expected (with length=30)]: ""\/Date(1291140000000+0600)\/"" [Actual (with length=30)]: ""\/Date(1291140000000+0700)\/"" Test failed for input: 01.12.2010 0:00:00 Expected: ""\/Date(1291140000000+0600)\/"" Actual: ""\/Date(1291140000000+0700)\/"" Expected: True Actual: False Stack Trace: в Xunit.Assert.True(Nullable`1 condition, String userMessage) в C:\BuildAgent\work\cb37e9acf085d108\src\xunit.assert\Asserts\BooleanAsserts.cs:строка 90 в DataContractJsonSerializerTests.SerializeAndDeserialize[T](T value, String baseline, DataContractJsonSerializerSettings settings, Func`1 serializerFactory, Boolean skipStringCompare) в DataContractJsonSerializerTests.DCJS_VerifyDateTimeForFormatStringDCJsonSerSetting() Finished: System.Runtime.Serialization.Json.ReflectionOnly.Tests ``` To reproduce setup Tomsk time zone and test with netfx framework. Tomsk time zone is complex becauze some time ago 1. It was +0700 with daylight saving time 2. then it was +0600 with and without daylight saving time 3. Now it is +0700 without daylight saving time. Test use +0600 offset that was at 2000 year but serialization use +0700 offset that is now. So I think this is serialization issue for complex tome zones. " 28305 area-System.Net Linux/OSX - setting ExclusiveAddressUse or DontLinger not supported Operation not supported exception when [using SetSocketOption](https://github.com/graffen/NLog.Targets.Syslog/blob/v5.0.0-beta-02/src/NLog.Targets.Syslog/MessageSend/Tcp.cs#L82-L86) to set ExclusiveAddressUse or DontLinger: ```csharp tcp.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ExclusiveAddressUse, true); tcp.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.DontLinger, false); tcp.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Linger, new LingerOption(true, 0)); tcp.Client.IOControl(IOControlCode.KeepAliveValues, keepAlive.ToByteArray(), null); ``` Please look at https://github.com/graffen/NLog.Targets.Syslog/issues/119 for more info 28306 area-System.Net Linux/OSX PlatformNotSupportedException calling Socket.IOControl PlatformNotSupportedException when [using IOControl](https://github.com/graffen/NLog.Targets.Syslog/blob/v5.0.0-beta-02/src/NLog.Targets.Syslog/MessageSend/Tcp.cs#L86) to set keepAlive ```csharp tcp.Client.IOControl(IOControlCode.KeepAliveValues, keepAlive.ToByteArray(), null); ``` Please look at https://github.com/graffen/NLog.Targets.Syslog/issues/119 for more info 28309 area-System.Reflection PEReaderTests.GetSectionData_Loaded failed in CI https://mc.dot.net/#/user/dotnet-maestro-bot/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/ee4cab88df3d975a6f9cee26cd2c7b916d3b450e/workItem/System.Reflection.Metadata.Tests/analysis/xunit/System.Reflection.PortableExecutable.Tests.PEReaderTests~2FGetSectionData_Loaded ``` Windows.7.Amd64.Open-x86-Release Unhandled Exception of Type Xunit.Sdk.TrueException Message : Assert.True() Failure Expected: True Actual: False Stack Trace : at System.Reflection.Metadata.Tests.LoaderUtilities.LoadPEAndValidate(Byte[] peImage, Action`1 validator, Boolean useStream) in D:\j\workspace\windows-TGrou---f8ac6754\src\System.Reflection.Metadata\tests\TestUtilities\LoaderUtilities.cs:line 25 at System.Reflection.PortableExecutable.Tests.PEReaderTests.GetSectionData_Loaded() in D:\j\workspace\windows-TGrou---f8ac6754\src\System.Reflection.Metadata\tests\PortableExecutable\PEReaderTests.cs:line 237 ``` 28310 area-Infrastructure Opening .sln after building with CoreCLROverridePath hangs Repro: git clean -xdf build.cmd -- /p:CoreCLROverridePath:c:\path\to\coreclr\release\build\ cd src\System.Runtime System.Runtime.sln Visual Studio opens and then sits with a progress dialog for a very long time. After an hour the first time and a half hour the second time, I terminated the devenv process. When I think cleaned and built without a custom runtime, the solution opened and became usable in seconds. 28311 area-System.Drawing System.Drawing.Common.Tests fails some tests on netfx framework locally "System.Drawing.Common.Tests fails some tests on netfx framework locally with next log: ``` System.Drawing.Imaging.Tests.MetafileTests.Ctor_RectangleFEmpty_Success(description: ""description"") [FAIL] System.Runtime.InteropServices.ExternalException : В GDI+ возникла ошибка общего вида. Stack Trace: в System.Drawing.Imaging.Metafile..ctor(String fileName, IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit, EmfType type, String description) в System.Drawing.Imaging.Tests.MetafileTests.Ctor_RectangleFEmpty_Success(String description) System.Drawing.Imaging.Tests.MetafileTests.Ctor_StringIntPtrEmfType_Success(emfType: EmfOnly) [FAIL] System.Runtime.InteropServices.ExternalException : В GDI+ возникла ошибка общего вида. Stack Trace: в System.Drawing.Imaging.Metafile..ctor(String fileName, IntPtr referenceHdc, EmfType type, String description) в System.Drawing.Imaging.Metafile..ctor(String fileName, IntPtr referenceHdc, EmfType type) в System.Drawing.Imaging.Tests.MetafileTests.Ctor_StringIntPtrEmfType_Success(EmfType emfType) System.Drawing.Imaging.Tests.MetafileTests.Ctor_StringIntPtrEmfType_Success(emfType: EmfPlusDual) [FAIL] System.Runtime.InteropServices.ExternalException : В GDI+ возникла ошибка общего вида. Stack Trace: в System.Drawing.Imaging.Metafile..ctor(String fileName, IntPtr referenceHdc, EmfType type, String description) в System.Drawing.Imaging.Metafile..ctor(String fileName, IntPtr referenceHdc, EmfType type) в System.Drawing.Imaging.Tests.MetafileTests.Ctor_StringIntPtrEmfType_Success(EmfType emfType) System.Drawing.Imaging.Tests.MetafileTests.Ctor_StringIntPtrEmfType_Success(emfType: EmfPlusOnly) [FAIL] System.Runtime.InteropServices.ExternalException : В GDI+ возникла ошибка общего вида. Stack Trace: в System.Drawing.Imaging.Metafile..ctor(String fileName, IntPtr referenceHdc, EmfType type, String description) в System.Drawing.Imaging.Metafile..ctor(String fileName, IntPtr referenceHdc, EmfType type) в System.Drawing.Imaging.Tests.MetafileTests.Ctor_StringIntPtrEmfType_Success(EmfType emfType) System.Drawing.Imaging.Tests.MetafileTests.Ctor_StringIntPtrEmfType_Success(description: null) [FAIL] System.Runtime.InteropServices.ExternalException : В GDI+ возникла ошибка общего вида. Stack Trace: в System.Drawing.Imaging.Metafile..ctor(String fileName, IntPtr referenceHdc, EmfType type, String description) в System.Drawing.Imaging.Tests.MetafileTests.Ctor_StringIntPtrEmfType_Success(String description) System.Drawing.Imaging.Tests.MetafileTests.Ctor_StringIntPtrEmfType_Success(description: ""description"") [FAIL] System.Runtime.InteropServices.ExternalException : В GDI+ возникла ошибка общего вида. Stack Trace: в System.Drawing.Imaging.Metafile..ctor(String fileName, IntPtr referenceHdc, EmfType type, String description) в System.Drawing.Imaging.Tests.MetafileTests.Ctor_StringIntPtrEmfType_Success(String description) ``` 'В GDI+ возникла ошибка общего вида.' is 'A generic error occurred in GDI+' on English. " 28312 area-System.Net CurlHandler: set ssl options to match X509 machine store certificates Fixes https://github.com/dotnet/corefx/issues/28002 CC @caesar1995 @stephentoub @bartonjs @wfurt @karelz 28313 area-System.IO Fixed netfx System.IO.FileSystem.Tests fails on non-English Windows Fixed netfx System.IO.FileSystem.Tests fails on non-English Windows. See https://github.com/dotnet/corefx/issues/28136 28314 area-System.Collections Allow custom equality comparer on ConcurrentDictionary TryUpdate The method `TryUpdate` from `ConcurrentDictionary` should allow to set a custom equality comparer for the value. ## Rationale and Usage A custom equality comparer for `TryUpdate` can target three problems. ### Ahead Of Time On some platforms is demanded static compilation ahead of time. On those platforms code generation is not allowed. When the method `TryUpdate` use `EqualityComparer<T>.Default` for value type comparison, it attempts to use Reflection to instantiate a new type which implements the `IEqualityComparer<T>` interface. That operation is not allowed on AOT compiled code. ### Performance Currently the method `TryUpdate` uses the equality comparer instance from `EqualityComparer<T>.Default` which not be the most optimized comparison for the case. ### Custom comparison For external types not controlled by the user that does not implement the intended comparison it is needed to create a wrapper to overcome the lack of a proper comparison. The same is true if a qualified comparison is needed for specific `TryUpdate` call. ### Usage Given those types: ```csharp readonly struct Person : IEquatable<Person> { public long Id { get; } public string Name { get; } public string Email { get; } public int Version { get; } public Person(int version) { Id = default; Name = default; Email = default; Version = version; } public bool Equals(Person other) => Id == other.Id && Name == other.Name && Email == other.Email && Version == other.Version; public override bool Equals(object obj) => obj is Person other && Equals(other); public override int GetHashCode() => Id.GetHashCode(); } sealed class VersioningComparer : IEqualityComparer<Person> { public bool Equals(Person first, Person second) => first.Version == second.Version; public int GetHashCode(Person obj) => obj.Version; } ``` Can be used as: ```csharp private readonly ConcurrentDictionary<long, Person> personDictionary; private readonly VersioningComparer versionComparer; // ... public bool UpdatePerson(Person value) { Person previousVersion = new Person(value.Version - 1); return personDictionary.TryUpdate(value.Id, value, previousVersion, versionComparer); } ``` ## Proposed API ```csharp public class ConcurrentDictionary<TKey, TValue> { // ... public bool TryUpdate(TKey key, TValue newValue, TValue comparisonValue); public bool TryUpdate(TKey key, TValue newValue, TValue comparisonValue, System.Collections.Generic.IEqualityComparer<TValue> comparer); // ... } ``` ## Pull Request A PR with the proposed changes is available: #28142 28315 area-System.Runtime "Add more DateTime{Offset} ""r"" and ""o"" formatting tests" "Add some tests for ""r"" and ""o"" DateTime and DateTimeOffset formatting. cc: @danmosemsft " 28316 area-System.Security Fixed netfx System.Security.Cryptography.Xml.Tests fails on non-English Windows Fixed netfx System.Security.Cryptography.Xml.Tests fails on non-English Windows. See https://github.com/dotnet/corefx/issues/28136 28317 area-System.Security Make WindowsPrincipalIsInRoleNeg pass when a domain client is offline Fixes #16511. At least, it fixed it for my machine when I unplugged my office from corpnet. But since it's the same message as the various versions of the issue have reported it seems like the right fix. 28319 area-Infrastructure chmod: cannot access '/root/corefx-1502077/bin/testhost/netcoreapp-Linux-Debug-arm64/dotnet': No such file or directory Opened on behalf of @jcagme Warnings: 2 Status Message: failed Build : Master - 20180321.05 (Product Build) Failing configurations: - Linux - arm64 [Mission Control Build Info](https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/build~2Fproduct~2F/build/20180321.05/workItem/Orchestration/analysis/external/Link) 28320 area-System.Memory Added Span.SequenceCompareTo tests for types bool, char, int, long and string This PR resolves #28118 by adding more unit tests for the MemoryExtensions.SequenceCompareTo function. It includes new tests for the following types : bool, char, int, long and string. Hope this first PR will match your expectations 😄 28321 area-Serialization NaN test fails on IL and reflection based serializer. When a double or single property or field is attributed to say the default value is NaN, the IL and reflection based serializers still serialize the NaN value. It is expected that when a field or property has the same value as the attributed default value, that the value is not serialized. This issue is caused by the fact that the expression `double.NaN != double.NaN` will return true. These serializers need to be modified to use the `Equals` method on double/single as that accounts for the NaN value. 28324 area-System.Net Re-enable hostname resolution test on Linux, but skip under certain conditions "This test assumed that the host name can always be resolved, which isn't guaranteed on Unix. In the interest of ""testing as much as we can"" I'm going to enable the test, but pass it if we get the specific error that indicates we haven't been able to resolve the localhost on Unix. That way we'll hopefully still see failures if things go wrong somewhere else. The logic to skip the test is taken from another test in the same file: https://github.com/dotnet/corefx/blob/643bccc7f2c24a897cc15c42486d4184e1f931eb/src/System.Net.NameResolution/tests/PalTests/NameResolutionPalTests.cs#L89-L104 Fixes: #20245" 28325 area-System.Net Fix WebSockets receiving messages in chunks does not detect correct message size Fix: #28097 It's a bug in `WebScoketBuffer`, we forget to decrease the _bufferedPayloadReceiveResult.Count. Framework [doesn't has this problem.](https://github.com/Microsoft/referencesource/blob/4fe4349175f4c5091d972a7e56ea12012f1e7170/System/net/System/Net/WebSockets/WebSocketReceiveResult.cs#L45) Verified with the repro provided by customer. 28326 area-Infrastructure Windows.Compatibility fails restore due to downgrades "Create the project: ```xml <Project Sdk=""Microsoft.NET.Sdk""> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>netcoreapp2.1</TargetFramework> <RestoreSources>https://dotnet.myget.org/F/dotnet-core/api/v3/index.json</RestoreSources> </PropertyGroup> <ItemGroup> <PackageReference Include=""Microsoft.Windows.Compatibility"" Version=""2.0.0-preview3-26319-04"" /> </ItemGroup> </Project> ``` Restore it. Observe failure: ``` C:\test\winCompat.csproj : error NU1605: winCompat -> Microsoft.Windows.Compatibility 2.0.0-preview3-26319-04 -> System.Security.Cryptography.Pkcs 4.5.0-preview3-26319-04 -> System.Security.Cryptography.Cng (>= 4.5.0-preview3-26319-04) C:\test\winCompat.csproj : error NU1605: winCompat -> Microsoft.Windows.Compatibility 2.0.0-preview3-26319-04 -> System.Security.Cryptography.Cng (>= 4.4.0) ``` This is beceause PKCS is listed as a `PrereleaseLibraryPackage` but Cng is a *stable* `LibraryPackage`. This results in the downgrade. /cc @safern @weshaggard " 28328 area-System.Collections Adding EnsureCapacity and TrimExcess APIs to SortedSet We want to add the EnsureCapacity and TrimExcess APIs to SortedSet. The following APIs were approved earlier by @terrajobst at https://github.com/dotnet/corefx/issues/24445#issuecomment-352869027 ```csharp public int EnsureCapacity(int capacity); public void TrimExcess(); // Calls the other passing Count public void TrimExcess(int capacity); ``` cc: @terrajobst @danmosemsft 28332 area-System.Net Fix assert race condition in CurlResponseMessage If cancellation is requested between the earlier check in the method and the call to Register, Register will return a default registration, and then the callback will end up seeing a default token rather than the original token. That will not only trigger the assert we've been seeing, but will also result in the wrong token being stored into the task. Fixes https://github.com/dotnet/corefx/issues/28133 cc: @geoffkizer, @davidsh 28333 area-Infrastructure [Arm64/Linux] Framework packaging is not quite correct "I just took a look at ``` ./bin/packages/Debug/reports/runtime.linux-arm64.Microsoft.Private.CoreFx.NETCoreApp.json ``` Looks like things are OK for v2.1 ``` "".NETCoreApp,Version=v2.1/linux-arm64"": { ""Framework"": "".NETCoreApp,Version=v2.1"", ""RuntimeID"": ""linux-arm64"", ""CompileAssets"": [ { ""LocalPath"": ""/home/sdmaclea/git/corefx/Tools/_._"", ""PackagePath"": ""ref/netstandard/_._"" } ], ""RuntimeAssets"": [ { ""LocalPath"": ""/home/sdmaclea/git/corefx/bin/AnyOS.AnyCPU.Debug/Microsoft.CSharp/netstandard/Microsoft.CSharp.dll"", ""PackagePath"": ""runtimes/linux-arm64/lib/netcoreapp2.1/Microsoft.CSharp.dll"", ""TargetFramework"": "".NETCoreApp,Version=v2.1"", ""Version"": ""4.0.4.0"" }, ``` But arm64 support is not mentioned as supported in earlier versions. @jkotas " 28334 area-System.Reflection Fix System.Reflection.Metadata nuspec "Corrects SCI dependency version in nuspec. Currently it's 1.4.0 for Profile7, but should be 1.5.0-* ``` <dependencies> <group targetFramework="".NETCoreApp2.1"" /> <group targetFramework="".NETStandard1.1""> <dependency id=""NETStandard.Library"" version=""1.6.1"" /> <dependency id=""System.Collections.Immutable"" version=""1.5.0-preview3-26319-04"" /> </group> <group targetFramework="".NETStandard2.0""> <dependency id=""System.Collections.Immutable"" version=""1.5.0-preview3-26319-04"" /> </group> <group targetFramework="".NETPortable0.0-Profile7""> <dependency id=""System.Collections.Immutable"" version=""1.4.0"" /> </group> <group targetFramework="".NETPortable4.5-Profile111""> <dependency id=""System.Collections.Immutable"" version=""1.5.0-preview3-26319-04"" /> </group> <group targetFramework=""UAP10.0.16299"" /> <group targetFramework=""WindowsPhoneApp8.1""> <dependency id=""System.Collections.Immutable"" version=""1.5.0-preview3-26319-04"" /> </group> </dependencies> ```" 28335 area-System.Data SqlDateTime.MinValue returns year 1953 instead of 1753 on netcoreapp2.0 "`SqlDateTime.MinValue` returns year 1953 instead of 1753 on `netcoreapp2.0`. I get the correct year on `net471` (date 1/1/1753). ``` public static class DateTimeExtension { /// <summary> /// Min value for Sql datetime to save in sql db. /// </summary> public static readonly DateTime SqlDateTimeMinUtc = DateTime.SpecifyKind( DateTime.Parse(SqlDateTime.MinValue.ToString()), DateTimeKind.Utc ); /// <summary> /// Gets the min value for Sql datetime. /// </summary> public static DateTime ToSqlDateTimeMinUtc(this DateTime date) { return SqlDateTimeMinUtc; } } [Test] public void ToSqlDateTimeMinUtc01() { var date = new DateTime().ToSqlDateTimeMinUtc(); Assert.AreEqual(DateTimeKind.Utc, date.Kind); Assert.AreEqual(""1/1/1753 12:00:00 AM"", date.ToString(CompareDateFormat)); } ``` Below is the travis-ci log snippet and here is [full travis-ci log link](https://travis-ci.org/rmandvikar/csharp-extensions/builds/356540020#L692-L696). ``` Failed ToSqlDateTimeMinUtc01 Error Message: String lengths are both 20. Strings differ at index 5. Expected: ""1/1/1753 12:00:00 AM"" But was: ""1/1/1953 12:00:00 AM"" ----------------^ ``` " 28336 area-System.Memory Consider optimizing Span IndexOf for OrdinalIgnoreCase (portable span) This is specific to portable span (and not fast span). We do not necessarily need to allocate and call the string APIs when StringComparison is OrdinalIgnoreCase for IndexOf. See https://github.com/dotnet/corefx/pull/28239#issue-176098021 for details and a proposed implementation of IndexOfOrdinalIgnoreCase as a starting point. We would need to test and measure to make sure there isn't significant regression for certain cases as part of the optimization for the common/general case. 28337 area-System.Net Setting keepalivetime and keepaliveinterval on Linux Sockets This question is in regards to #28061 and as per diagnosis by @saurabh500 : > Windows impl of SqlClient sets some Keepalive values which Unix stack doesn’t > SqlClient should set the keep alive values. I was able to successfully set the `SocketOption` `KeepAlive` to Use Keep-Alives via `SetSocketOption` method `_socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive, true);` However I am having trouble setting `keepalivetime` and `keepaliveinterval` values. It is my understanding that using `Socket.IOControl` method with `IOControlCode.KeepAliveValues` would be the correct method to set the above mentioned values. However, the comment in the IOControl method below seems the suggest that IOControl is used for Windows-specific IOCTL operations. https://github.com/dotnet/corefx/blob/master/src/System.Net.Sockets/src/System/Net/Sockets/Socket.cs#L1763 If that is indeed the case then: - Is it possible to set `keepalivetime` and `keepaliveinterval` values on Linux - If yes, then what would the correct format of struct to use on Linux Regards, Keerat 28339 area-System.Memory Fix MemorExtensions.Portable Equals to use the correct argument name See https://github.com/dotnet/corefx/pull/28239#issuecomment-375108404, where mismatch of argument names was introduced. Also fixing the incomplete renaming from https://github.com/dotnet/corefx/pull/28160/commits/cbb1e6b892f79626370c020f81894eb0fce10838 which introduced discrepency between MemorExtensions.Fast and MemorExtensions.Portable. cc @stephentoub 28341 area-System.Runtime StringFormat curly brace escaping error 28342 area-System.IO TimesIncludeMillisecondPart_Linux test failing in CI on Ubuntu From https://github.com/dotnet/corefx/pull/28294 System.IO.Tests.FileInfo_GetSetTimes/TimesIncludeMillisecondPart_Linux https://mc.dot.net/#/user/ahsonkhan/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/a319af0f981c27fd4bd680b6a545d44dc42fbbbc/workItem/System.IO.FileSystem.Tests/analysis/xunit/System.IO.Tests.FileInfo_GetSetTimes~2FTimesIncludeMillisecondPart_Linux Ubuntu.1404.Amd64.Open-x64-Release ```text Unhandled Exception of Type Xunit.Sdk.AllException Message : Assert.All() Failure: 1 out of 6 items in the collection did not pass. [1]: Xunit.Sdk.NotEqualException: Assert.NotEqual() Failure Expected: Not 0 Actual: 0 at Xunit.Assert.NotEqual[T](T expected, T actual, IEqualityComparer`1 comparer) at System.IO.Tests.BaseGetSetTimes`1.<>c__DisplayClass9_0.<TimesIncludeMillisecondPart_Linux>b__0(TimeFunction function) in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/src/System.IO.FileSystem/tests/Base/BaseGetSetTimes.cs:line 108 at Xunit.Assert.All[T](IEnumerable`1 collection, Action`1 action) ``` cc @JeremyKuhne 28343 area-System.IO Linux - FileStream.Length, FileStream.Seek & File.ReadAllBytes misbehaves with files in procfs "I did the following experiment: ``` using System; using System.IO; namespace TestProcStatFile { class Program { static void Main(string[] args) { const string procStat = ""/proc/stat""; using (var file = File.OpenRead(procStat)) { Console.WriteLine($""Stream length: {file.Length}""); Console.WriteLine($""Actual length (via File.ReadAllBytes): {File.ReadAllBytes(procStat).Length}""); Console.WriteLine($""Actual length (via File.ReadAllText): {File.ReadAllText(procStat).Length}""); Console.WriteLine($""Can seek: {file.CanSeek}""); Console.WriteLine($""Seek(8192), Position: {file.Seek(8192, SeekOrigin.Begin)}""); try { file.Seek(0, SeekOrigin.End); } catch (Exception e) { Console.WriteLine($""Seek from end: {e}""); } } } } } ``` Which reports the following: ``` Stream length: 0 Actual length (via File.ReadAllBytes): 0 Actual length (via File.ReadAllText): 5085 Can seek: True Seek(8192), Position: 8192 Seek from end: System.IO.IOException: Invalid argument at System.IO.FileStream.CheckFileCall(Int64 result, Boolean ignoreNotSupported) at System.IO.FileStream.Seek(Int64 offset, SeekOrigin origin) at TestProcStatFile.Program.Main(String[] args) in /home/netem/RiderProjects/TestProcStatFile/Program.cs:line 21 ``` https://github.com/dotnet/corefx/blob/a8cfc6a498f0455c59b0030f74cba4dabeee86e1/src/System.IO.FileSystem/src/System/IO/File.cs#L320 This guy relays on FileStream.Length. I'm thinking if FileStream.Length should actually throw for files in procfs and CanSeek should return false for them and File.ReadAllBytes should check CanSeek and if it is false then don't pre-allocate buffer of the final size but allocate it dynamically while reading" 28344 area-System.Net Port being stripped off Host header in HttpRequestMessage constructed by HttpWebRequest Following investigations into restsharp/RestSharp#1085, it appears that the Host header `HttpRequestMessage` constructed by `HttpWebRequest.SendRequest()` is being stripped of the port. This is evident [here](https://github.com/dotnet/corefx/blob/3dc80d215591fca7b4991ed3e60fc4ddb8e0d460/src/System.Net.Requests/src/System/Net/HttpWebRequest.cs#L1166) where only the Host of the URI is used, regardless whether or not the port is populated on the URI. This goes against the [HTTP spec](https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.23) which respects the use of ports in the host header. 28347 area-System.Memory Leverage existing string API tests to improve coverage of span-based APIs Partially resolves https://github.com/dotnet/corefx/issues/28238. **Leftover for future:** - Remove redundant span tests from System.Memory that were initially ported over from StringTests. - Refactor the StringTests.cs to isolate these newly added span-based tests into a separate file (possibly moving them to Common) and reference them from System.Memory.Tests.csproj so that we can execute all relevant Span tests when running msbuild on S.M.T, rather than having to run tests from several places. - This will likely result in some code duplication. These tests won't pass until we get a new CoreCLR build with these changes: https://github.com/dotnet/coreclr/pull/17115 (along with the mirror PR). cc @KrzysztofCwalina, @jkotas, @tarekgh, @stephentoub, @joshfree 28352 area-System.Drawing System.Drawing.Common and RTL support "Currently `System.Drawing.Common` version ""4.5.0-preview1-26216-02"" doesn't support RTL on operating systems other than Windows. Here is a sample to demonstrate this issue: `SystemDrawingCommonRtlTest.csproj` file ```xml <Project Sdk=""Microsoft.NET.Sdk""> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>netcoreapp2.0</TargetFramework> </PropertyGroup> <ItemGroup> <PackageReference Include=""System.Drawing.Common"" Version=""4.5.0-preview1-26216-02"" /> </ItemGroup> </Project> ``` `Program.cs` file ```csharp using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; using System.Drawing.Text; using System.Runtime.InteropServices; namespace SystemDrawingCommonRtlTest { class Program { static void Main(string[] args) { var text = ""آزمايش""; // = Test var tahomaFont = new Font(""Tahoma"", 40, FontStyle.Regular, GraphicsUnit.Pixel); var (height, width) = getImageSize(text, tahomaFont); using (var pic = new Bitmap(width, height)) { using (var graphics = Graphics.FromImage(pic)) { graphics.SmoothingMode = SmoothingMode.AntiAlias; graphics.SmoothingMode = SmoothingMode.HighQuality; graphics.CompositingQuality = CompositingQuality.HighQuality; graphics.InterpolationMode = InterpolationMode.High; graphics.TextRenderingHint = TextRenderingHint.AntiAlias; using (var font = tahomaFont) { using (var format = new StringFormat()) { format.FormatFlags = StringFormatFlags.DirectionRightToLeft; graphics.DrawString( text, font, new SolidBrush(Color.Black), new Rectangle(0, 0, width, height), format); pic.Save($""rtl-text-{RuntimeInformation.OSDescription}.png"", ImageFormat.Png); } } } } } private static (int Height, int Width) getImageSize(string text, Font font) { SizeF size; using (var bmp = new Bitmap(1, 1)) { using (var g = Graphics.FromImage(bmp)) { size = g.MeasureString(text, font); } } const int margin = 8; return ((int)size.Height + margin, (int)size.Width + margin); } } } ``` And here are its output On Windows 10: It works correctly  On Linux (Ubuntu): Characters are separated and rotated " 28353 area-System.Net Consider removing hard dependency on libcurl "(https://github.com/dotnet/corefx/issues/27783#issuecomment-375096678) For build (everything) [from source](https://github.com/dotnet/source-build), dependency on libcurl can be made optional, such that if the project was compiled in the absence of libcurl, this line instead of throwing fatal error: https://github.com/dotnet/corefx/blob/9a2e5d8f0e7f816f983bce75f5bba22811df4994/src/Native/Unix/System.Net.Http.Native/CMakeLists.txt#L4-L6 will show a message. Then the `PAL_` methods that deal with curl will be `#ifdef`'d out. On managed side, unsetting `DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLE` or setting it to `false` will continue to use SocketHttpSocketHandler and emit (per-initialization?) EventSource warning log (https://github.com/dotnet/corefx/issues/2500) to notify ""CurlHandler is not present in this build, continue using SocketHttpSocketHandler ""." 28354 area-System.Data System.Data.Tests.DataTableTest3/XmlSchemaTest3 failing in CI with UnauthorizedAccessException From https://github.com/dotnet/corefx/pull/28350 https://mc.dot.net/#/user/dotnet-maestro-bot/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/f1982993db81bc168e62e059516816b78af59bb7/workItem/System.Data.Common.Tests/analysis/xunit/System.Data.Tests.DataTableTest3~2FXmlSchemaTest3 Windows.10.Amd64.Open-x64-Debug ```text Unhandled Exception of Type System.AggregateException Message : System.AggregateException : One or more errors occurred. (Could not find a part of the path 'C:\\Users\\'.) (Access to the path 'C:\\Users\\' is denied.) ---- System.IO.DirectoryNotFoundException : Could not find a part of the path 'C:\\Users\\'. ---- System.UnauthorizedAccessException : Access to the path 'C:\\Users\\' is denied. Stack Trace : ----- Inner Stack Trace #1 (System.IO.DirectoryNotFoundException) ----- at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle) in E:\A\_work\942\s\src\mscorlib\shared\System\IO\FileStream.Windows.cs:line 1650 at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options) in E:\A\_work\942\s\src\mscorlib\shared\System\IO\FileStream.Win32.cs:line 42 at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) in E:\A\_work\942\s\src\mscorlib\shared\System\IO\FileStream.cs:line 230 at System.IO.FileStream..ctor(String path, FileMode mode) in E:\A\_work\942\s\src\mscorlib\shared\System\IO\FileStream.cs:line 164 at System.Data.Tests.DataTableTest3.XmlSchemaTest3() in D:\j\workspace\windows-TGrou---74aa877a\src\System.Data.Common\tests\System\Data\DataTableTest3.cs:line 512 ----- Inner Stack Trace #2 (System.UnauthorizedAccessException) ----- at System.IO.FileSystem.DeleteFile(String fullPath) in D:\j\workspace\windows-TGrou---74aa877a\src\System.IO.FileSystem\src\System\IO\FileSystem.Windows.cs:line 170 at System.IO.File.Delete(String path) in D:\j\workspace\windows-TGrou---74aa877a\src\System.IO.FileSystem\src\System\IO\File.cs:line 102 at System.Data.Tests.DataTableTest3.Dispose() in D:\j\workspace\windows-TGrou---74aa877a\src\System.Data.Common\tests\System\Data\DataTableTest3.cs:line 48 at ReflectionAbstractionExtensions.DisposeTestClass(ITest test, Object testClass, IMessageBus messageBus, ExecutionTimer timer, CancellationTokenSource cancellationTokenSource) in C:\BuildAgent\work\cb37e9acf085d108\src\xunit.execution\Extensions\ReflectionAbstractionExtensions.cs:line 76 ``` Also System.Data.Tests.DataTableTest3/XmlSchemaTest7 https://mc.dot.net/#/user/dotnet-maestro-bot/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/f1982993db81bc168e62e059516816b78af59bb7/workItem/System.Data.Common.Tests/analysis/xunit/System.Data.Tests.DataTableTest3~2FXmlSchemaTest7 ```text Unhandled Exception of Type System.UnauthorizedAccessException Message : System.UnauthorizedAccessException : Access to the path 'C:\\Users\\DotNetTestRunner\\AppData\\' is denied. Stack Trace : at System.IO.FileSystem.DeleteFile(String fullPath) in D:\j\workspace\windows-TGrou---74aa877a\src\System.IO.FileSystem\src\System\IO\FileSystem.Windows.cs:line 170 at System.IO.File.Delete(String path) in D:\j\workspace\windows-TGrou---74aa877a\src\System.IO.FileSystem\src\System\IO\File.cs:line 102 at System.Data.Tests.DataTableTest3.Dispose() in D:\j\workspace\windows-TGrou---74aa877a\src\System.Data.Common\tests\System\Data\DataTableTest3.cs:line 48 at ReflectionAbstractionExtensions.DisposeTestClass(ITest test, Object testClass, IMessageBus messageBus, ExecutionTimer timer, CancellationTokenSource cancellationTokenSource) in C:\BuildAgent\work\cb37e9acf085d108\src\xunit.execution\Extensions\ReflectionAbstractionExtensions.cs:line 76 ``` cc @divega, @saurabh500, @stephentoub 28355 area-Infrastructure Debugging on Unix doesn't load symbols When trying to debug any corefx test in a Unix system the debugger is not able to load symbols. The only symbol that is correctly loaded is System.Private.Corelib one. All the symbols are present and the debugger output's is: ``` Loaded '/home/usr/corefx/bin/testhost/netcoreapp-Linux-Debug-x64/shared/Microsoft.NETCore.App/9.9.9/System.Reflection.Emit.ILGeneration.dll'. Module was built without symbols. Loaded '/home/usr/corefx/bin/testhost/netcoreapp-Linux-Debug-x64/shared/Microsoft.NETCore.App/9.9.9/System.Reflection.Primitives.dll'. Module was built without symbols. Loaded '/home/usr/corefx/bin/testhost/netcoreapp-Linux-Debug-x64/shared/Microsoft.NETCore.App/9.9.9/System.Buffers.dll'. Module was built without symbols. ``` and this for all the loaded assemblies. Note that all the pdbs in corefx live next to the dlls. I remember this used to work before. This is happening with both VSCode and with Visual Studio using Remote Debugging. The symbols are found, but they are not loaded saying `Binary was not built with debug information`  The weird thing is that the System.Private.Corelib symbols are loaded correctly, so maybe this is happening because of the way we're building the unix pdbs in corefx? cc: @danmosemsft @weshaggard @jkotas @ericstj 28356 area-System.Runtime Environment.SpecialFolder should expose FOLDERID_Downloads and FOLDERID_Public values "`Environment.SpecialFolder` is the rough .NET equivalent of the [Known Folder](https://msdn.microsoft.com/en-us/library/windows/desktop/bb776911(v=vs.85).aspx) API, but it is lacking the corresponding values of `FOLDERID_Downloads` and `FOLDERID_Public`. ## Rationale Other known folders like documents, pictures, videos, etc. are exposed, but those two (among others) are missing. This seems to create confusion and misguided attempts [1](https://stackoverflow.com/questions/10667012/getting-downloads-folder-in-c) [2](https://stackoverflow.com/questions/3795023/how-to-programmatically-derive-windows-downloads-folder-userprofile-downloads) [3](https://social.msdn.microsoft.com/Forums/sqlserver/en-US/b344b1dd-d751-4e0e-9025-a391edd1949a/how-do-i-determine-the-windows-download-folder-path-using-the-knownfolders-class?forum=vbgeneral) to compute the paths to these folders by taking an existing value from `Environment.SpecialFolder`, dropping its last directory and appending ""Downloads"" to it. This is very error-prone, as the folder has not only different names based on the user locale, but also can be manually changed by users. ## Changes Two values are added to the `SpecialFolder` enum: ```diff MyComputer = SpecialFolderValues.CSIDL_DRIVES, + Downloads = SpecialFolderValues.CSIDL_DOWNLOADS, MyMusic = SpecialFolderValues.CSIDL_MYMUSIC, MyPictures = SpecialFolderValues.CSIDL_MYPICTURES, MyVideos = SpecialFolderValues.CSIDL_MYVIDEO, + Public = SpecialFolderValues.CSIDL_PUBLIC, Recent = SpecialFolderValues.CSIDL_RECENT, ``` If this is desired, I'm happy to provide a pull request." 28358 area-System.Xml Strange messages in System.Xml.Xsl.XslCompiledTransformApi.Tests log System.Xml.Xsl.XslCompiledTransformApi.Tests log contains next messages in log: ``` Starting: System.Xml.Xsl.XslCompiledTransformApi.Tests Message #2 Message #4 <Message>Message #6</Message> <Message>Message #8</Message> Finished: System.Xml.Xsl.XslCompiledTransformApi.Tests ``` 28359 area-System.Collections Test failure: System.Collections.Tests.SortedDictionary_IDictionary_NonGeneric_Tests/IDictionary_NonGeneric_Add_NullValueWhenDefaultTValueIsNonNull(count: 0) Opened on behalf of @Sunny-pu The test `System.Collections.Tests.SortedDictionary_IDictionary_NonGeneric_Tests/IDictionary_NonGeneric_Add_NullValueWhenDefaultTValueIsNonNull(count: 0)` has failed. System.OutOfMemoryException : Exception of type 'System.OutOfMemoryException' was thrown. Stack Trace: at System.Collections.Tests.SortedDictionary_IDictionary_NonGeneric_Tests.IDictionary_NonGeneric_Add_NullValueWhenDefaultTValueIsNonNull(Int32 count) Build : 2.0.0 - 20180321.02 (Core Tests) Failing configurations: - windows.10.amd64.iot-x64 - Release Details: https://mc.dot.net/#/product/netcore/200/source/official~2Fcorefx~2Frelease~2F2.0.0~2F/type/test~2Ffunctional~2Fcli~2F/build/20180321.02/workItem/System.Collections.Tests/analysis/xunit/System.Collections.Tests.SortedDictionary_IDictionary_NonGeneric_Tests~2FIDictionary_NonGeneric_Add_NullValueWhenDefaultTValueIsNonNull(count:%200) 28360 area-System.Runtime Test failure: System.Tests.EnvironmentTests/CurrentDirectory_SetToValidOtherDirectory Opened on behalf of @Sunny-pu The test `System.Tests.EnvironmentTests/CurrentDirectory_SetToValidOtherDirectory` has failed. Timed out after 60000ms waiting for remote process 25015 Expected: True Actual: False Stack Trace: at System.Diagnostics.RemoteExecutorTestBase.RemoteInvokeHandle.Dispose() in /Users/buildagent/agent/_work/74/s/corefx/src/Common/tests/System/Diagnostics/RemoteExecutorTestBase.cs:line 208 Build : 2.0.0 - 20180321.02 (Core Tests) Failing configurations: - OSX.1013.Amd64-x64 - Release Details: https://mc.dot.net/#/product/netcore/200/source/official~2Fcorefx~2Frelease~2F2.0.0~2F/type/test~2Ffunctional~2Fcli~2F/build/20180321.02/workItem/System.Runtime.Extensions.Tests/analysis/xunit/System.Tests.EnvironmentTests~2FCurrentDirectory_SetToValidOtherDirectory 28363 area-System.Runtime Enable AVX2, SSE42 HW intrinsics: remove unimplemented API surface and mark ISAs as fully implemented Decision to disable not fully implemented Intel HW intrinsics was made due to the fact that corefx already exposed full ISA API while RyuJIT only partially supported them what would interfere with proper use of `ISA.IsSupported` check see issue: https://github.com/dotnet/coreclr/issues/14930 and PR resolving it https://github.com/dotnet/coreclr/pull/15514. AVX2 and SSE42 intrinsics are partially implemented with many useful instructions already exposed. IMO it would be very helpful if we would expose in `System.Runtime.Intrinsics.Experimental` assembly all already supported intrinsics including partially implemented ISAs. To avoid false negative reporting by `ISA.IsSupported` check we should remove all unimplemented APIs and mark AVX2 and SSE42 ISAs as fully implemented. In future APIs could be expanded as new functionality is added to RyuJIT. @CarolEidt @eerhardt @fiigii @jkotas @tannergooding 28365 area-System.Net SSL TLS protocol mis-match not handled cleanly on Linux "Hello, I had a situation where I specified `SslProtocls.Tls` and tried to talk to a server with `Tls` (aka `Tlsv1`) but the server was configured to not speak that protocol. Understandably, the handshake failed, but the exception stack trace I got was pretty opaque and it took me a while to debug. This is on Linux. Not sure if there is more information that we can use to improve the error message, but regardless, filing an issue at least so that if someone else hits the same thing they know that it is an error in protocol negotiation. Setting `SslProtocols` to `SslProtocols.None` (aka ""use system defaults"") fixed it for me. Detailed trace: ``` Unhandled Exception: System.AggregateException: One or more errors occurred. (WebSocket connection failure.) ---> System.Net.WebSockets.WebSocketException: WebSocket connection failure. ---> System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception. ---> Interop+OpenSsl+SslException: SSL Handshake failed with OpenSSL error - SSL_ERROR_SSL. ---> System.Security.Cryptography.CryptographicException: Error occurred during a cryptographic operation. --- End of inner exception stack trace --- at Interop.OpenSsl.DoSslHandshake(SafeSslHandle context, Byte[] recvBuf, Int32 recvOffset, Int32 recvCount, Byte[]& sendBuf, Int32& sendCount) at System.Net.Security.SslStreamPal.HandshakeInternal(SafeFreeCredentials credential, SafeDeleteContext& context, SecurityBuffer inputBuffer, SecurityBuffer outputBuffer, SslAuthenticationOptions sslAuthenticationOptions) --- End of inner exception stack trace --- at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, ExceptionDispatchInfo exception) at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.PartialFrameCallback(AsyncProtocolRequest asyncRequest) --- End of stack trace from previous location where exception was thrown --- at System.Net.Security.SslState.InternalEndProcessAuthentication(LazyAsyncResult lazyResult) at System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult result) at System.Net.Security.SslStream.EndAuthenticateAsClient(IAsyncResult asyncResult) at System.Net.Security.SslStream.<>c.<AuthenticateAsClientAsync>b__43_2(IAsyncResult iar) at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization) --- End of stack trace from previous location where exception was thrown --- ``` " 28366 area-System.Security System.Security.Cryptography.Algorithms has reference on the .net4.6.3 Hi, I'm tried to include to the project that targets .net462 **System.Security.Cryptography.Algorithms** 4.3.1 nuget package using nuget package manager and I was surprised when found the reference on the ***.NETFramework4.6.3*** instead of ***.NETFramework4.6.2***, and that package manager added to the project the corresponding assembly for ***.NETFramework4.6.1.*** Does it a small mistake? 28367 area-System.Net Fix WinHttpHandler error handling "This PR addresses some error handling problems in WinHttpHandler as well as improves the error messages generated for WinHttpException. This was root caused to a bug in WinHttp where it can't do a GET request with a request body using chunked encoding. However, this exception was masked due to an error handling bug caused by an inconsistency in how WinHttp associates context values for callbacks during the WinHttpSendRequest API call. This PR now fixes the error handling around synchronous errors being returned from WinHttpSendRequest. The root WinHttp bug itself can't be fixed. So, doing a GET request will still throw an exception, but it will be a catchable HttpRequestException. Another bug was discovered while investigating #26278. WinHttpCloseHandle should only be called once and should never race between threads. This is normally protected when the request handle is closed via SafeHandle Dispose(). But there was a place in the callback method where we called WinHttpCloseHandle directly against the raw handle. Finally, the error messages for WinHttpExceptions have been improved to show the error number and the probable WinHttp API call that generated the error. This will save diagnostic time. Example: Original WinHttpException message: ""The parameter is incorrect"" New WinHttpException message: ""Error 87 calling WinHttpSendRequest, 'The parameter is incorrect'."" I also moved the WinHttpException source code back from Common. It was originally shared between WinHttpHandler and ClientWebSocket. But then ClientWebSocket moved away from WinHttp implementation. So, it makes more sense for this class to be under WinHttpHandler. Closes #28156 Contributes to #26278" 28368 area-System.Net wrap Read in loop as it can return less bytes than asked for fixes #27996 As described in the issue, new socket handler uses small buffers to provoke conditions like this and test was failing assuming it can always read all data at one. 28369 area-System.Data Fix MatchingRefApiCompat issues This fix is for https://github.com/dotnet/corefx/issues/27974 There are API miss match issues with contract. https://github.com/dotnet/corefx/blob/2169709020cb51c95aedf66f3db7c41d7d54a725/src/System.Data.SqlClient/src/MatchingRefApiCompatBaseline.txt#L1-L5 This fix resolve the issue. 28370 area-System.Runtime StringComparers should return 0 rather than throwing for GetHashCode(null) `EqualityComparer<string>.Default.GetHashCode` returns `0` when provided with null. The various `StringComparer`s, however, throw `ArgumentNullException`. This is frustrating because it means you can't always swap in something like `StringComparer.OrdinalIgnoreCase` for the default comparer. Additionally, it feels inconsistent for `StringComparer`s to throw on null for `GetHashCode` because all other methods are null-safe: ``` StringComparer.Ordinal.Equals(default(string), default(string)) => true StringComparer.Ordinal.Compare(default(string), default(string)) => 0 ``` Therefore, I think we should consider changing the behavior of `GetHashCode` to be consistent with everything else. 28371 area-System.IO NamedPipeServerStream throws UnauthorizedException when creating multiple server streams on windows with PipeOptions.CurrentUserOnly "Repro: ```c# static void Main(string[] args) { const int PipeBufferSize = 0x10000; var pipeName = Guid.NewGuid().ToString(); // This will throw an exception after the first loop. Remove ""PipeOptions.CurrentUserOnly"" to make this work. for (var i = 0; i < 5; i++) { var server = new NamedPipeServerStream( pipeName, PipeDirection.InOut, NamedPipeServerStream.MaxAllowedServerInstances, PipeTransmissionMode.Byte, PipeOptions.Asynchronous | PipeOptions.CurrentUserOnly | PipeOptions.WriteThrough, PipeBufferSize, PipeBufferSize); using (var client = new NamedPipeClientStream(""."", pipeName, PipeDirection.InOut, PipeOptions.Asynchronous | PipeOptions.CurrentUserOnly)) { client.Connect(); Console.WriteLine(""Connected!""); } } } ``` cc @pjanotti @rynowak " 28373 area-System.Net Fixed netfx System.Net.Mail.Functional.Tests fails on non-English Windows See https://github.com/dotnet/corefx/issues/28136 28374 area-System.IO CurrentUserOnly should allow multiple servers on Windows Fix #28371 28375 area-System.Net Fix missing port number in HttpRequestMessage constructed by HttpWebRequest Fix #28344. 28378 area-System.Net SocketsHttpHandler will attempt digest authentication with an empty nonce The nonce is an important part of the digest authentication protocol, and we should not attempt to authenticate without one. We currently have some incorrect test cases demonstrating this issue that pass only on SocketsHttpHandler: https://github.com/dotnet/corefx/blob/ce4ebdfbf2080a38855ab8df5c9bb553db8724af/src/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs#L561-L565 Without a nonce digest authentication is vulnerable to [replay attacks](https://security.stackexchange.com/questions/3001/what-is-the-use-of-a-client-nonce/3024#3024). For this to actually occur the server requesting authentication would have to fail to send the nonce in the first place, but this is still an insecure scenario that we should not support. Since it also requires insecure behavior from the server requesting authentication I think we can probably put this issue off until after 2.1, but I'd like to hear what others think first. 28379 area-Meta API Proposal: Add a ValueStringBuilder "We should consider making a value based StringBuilder to allow low allocation building of strings. While Span allows you to provide a writable buffer, in many scenarios we have a need to get or build strings and we don't know precisely how much space will be needed ahead of time. Having an abstraction that can grow beyond a given initial buffer is particularly useful as it doesn't require looping with `Try*` APIs- which can be both complicated and have negative performance implications. We currently use `ValueStringBuilder` for this purpose internally. It starts with an optional initial buffer (which we often stackalloc) and will grow using ArrayPool<char> if needed. ## Design Goals 1. Allow safe usage of stack memory 2. Use pooled memory when needed to reduce GC pressure 3. Allow dynamic and explicit capacity growth 4. Facilitate interop scenarios (i.e. passing as `char* szValue`) 5. Follow API semantics of StringBuilder & string where possible 6. Be stack allocated ## API Here is the proposed API: ``` C# namespace System.Text { public ref struct ValueStringBuilder { public ValueStringBuilder(Span<char> initialBuffer); // The logical length of the builder (end of the ""string"") public int Length { get; set; } // Available space in chars public int Capacity { get; } // Ensure there is at least this amount of space public void EnsureCapacity(int capacity); // Get a pinnable reference to the builder. ""terminate"" ensures the builder has a null char after Length in the buffer. public ref char GetPinnableReference(bool terminate = false); // Indexer, allows setting/getting individual chars public ref char this[int index] { get; } // Returns a string based off of the current position public override string ToString(); // Returns a span around the contents of the builder. ""terminate"" ensures the builder has a null char after Length in the buffer. public ReadOnlySpan<char> AsSpan(bool terminate); // To ensure inlining perf, we have a separate overload for terminate public ReadOnlySpan<char> AsSpan(); public bool TryCopyTo(Span<char> destination, out int charsWritten); public void Insert(int index, char value, int count = 1); public void Insert(int index, ReadOnlySpan<char> value, int count = 1); public void Append(char c, int count = 1); public void Append(ReadOnlySpan<char> value); // This gives you an appended span that you can write to public Span<char> AppendSpan(int length); // Returns any ArrayPool buffer that may have been rented public void Dispose() } } ``` This is the current shape of our internal [`ValueStringBuilder`](https://github.com/dotnet/coreclr/blob/bb0e771d2d08fedce8fc598e620c5d66b361e9e7/src/mscorlib/shared/System/Text/ValueStringBuilder.cs): ``` C# namespace System.Text { internal ref struct ValueStringBuilder { public ValueStringBuilder(Span<char> initialBuffer); public int Length { get; set; } public int Capacity { get; } public void EnsureCapacity(int capacity); /// <summary> /// Get a pinnable reference to the builder. /// </summary> /// <param name=""terminate"">Ensures that the builder has a null char after <see cref=""Length""/></param> public ref char GetPinnableReference(bool terminate = false); public ref char this[int index] { get; } // Returns a string based off of the current position public override string ToString(); /// <summary> /// Returns a span around the contents of the builder. /// </summary> /// <param name=""terminate"">Ensures that the builder has a null char after <see cref=""Length""/></param> public ReadOnlySpan<char> AsSpan(bool terminate); // To ensure inlining perf, we have a separate overload for terminate public ReadOnlySpan<char> AsSpan(); public bool TryCopyTo(Span<char> destination, out int charsWritten); public void Insert(int index, char value, int count); public void Append(char c); public void Append(string s); public void Append(char c, int count); public unsafe void Append(char* value, int length); public void Append(ReadOnlySpan<char> value); // This gives you an appended span that you can write to public Span<char> AppendSpan(int length); // Returns any ArrayPool buffer that may have been rented public void Dispose() } } ``` ## Sample Code Here is a common pattern on an API that could theoretically be made public if ValueStringBuilder was public: (Although we would call this one GetFullUserName or something like that.) https://github.com/dotnet/corefx/blob/050bc33738887d9d8fcc9bc5965b7d9ca65bc7f4/src/System.Runtime.Extensions/src/System/Environment.Win32.cs#L40-L56 The caller is above this method: https://github.com/dotnet/corefx/blob/050bc33738887d9d8fcc9bc5965b7d9ca65bc7f4/src/System.Runtime.Extensions/src/System/Environment.Win32.cs#L13-L38 Usage of AppendSpan: https://github.com/dotnet/corefx/blob/3538128fa1fb2b77a81026934d61cd370a0fd7f5/src/System.Runtime.Numerics/src/System/Numerics/BigNumber.cs#L550-L560 I'll add more usage details and possible API surface area. ## Notes - Does using this remove the need for having a `bool TryGet*(Span)` overload? (see https://github.com/dotnet/coreclr/pull/17097/files#r176560435) - Should we allow you to make it non-growable? (So we can avoid TryGet above?) - Can we get C# to allow using ref structs that have a `Dispose()` in a `using` statement? (https://github.com/dotnet/csharplang/issues/93) - Do we care about `AppendFormat` overloads? - `AppendSpan()` is a little tricky to grok- is there a better term/pattern?" 28380 area-System.Net Fixed netfx System.Net.WebSockets.Client.Tests fails on non-English Windows See https://github.com/dotnet/corefx/issues/28136 28382 area-Infrastructure perf.groovy should be archiving ETL Right now we appear to be only archiving test results, but we have never archived perf traces https://github.com/dotnet/corefx/blob/master/perf.groovy#L132 28390 area-System.Net Test failed: System.Net.NetworkInformation.Tests.PingTest / SendPingAsyncWithHostAndTimeoutAndBuffer_Unix From https://github.com/dotnet/corefx/pull/28320 OSX.1012.Amd64.Open-x64-Debug System.Net.NetworkInformation.Tests.PingTest/SendPingAsyncWithHostAndTimeoutAndBuffer_Unix https://mc.dot.net/#/user/sputier/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/aed8e7936300a0290bb29844f967876525ca9ffb/workItem/System.Net.Ping.Functional.Tests/analysis/xunit/System.Net.NetworkInformation.Tests.PingTest~2FSendPingAsyncWithHostAndTimeoutAndBuffer_Unix ```text Unhandled Exception of Type System.Net.NetworkInformation.PingException Message : System.Net.NetworkInformation.PingException : An exception occurred during a Ping request. ---- System.Net.NetworkInformation.PingException : An exception occurred during a Ping request. Stack Trace : at System.Net.NetworkInformation.Ping.GetAddressAndSendAsync(String hostNameOrAddress, Int32 timeout, Byte[] buffer, PingOptions options) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.Ping/src/System/Net/NetworkInformation/Ping.cs:line 364 at System.Net.NetworkInformation.Tests.PingTest.SendPingAsync(Func`2 sendPing, Action`1 pingResultValidator) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.Ping/tests/FunctionalTests/PingTest.cs:line 464 at System.Net.NetworkInformation.Tests.PingTest.SendPingAsyncWithHostAndTimeoutAndBuffer_Unix() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.Ping/tests/FunctionalTests/PingTest.cs:line 278 --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Net.NetworkInformation.Ping.SendWithPingUtility(IPAddress address, Byte[] buffer, Int32 timeout, PingOptions options) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.Ping/src/System/Net/NetworkInformation/Ping.Unix.cs:line 210 at System.Net.NetworkInformation.Ping.SendPingAsyncCore(IPAddress address, Byte[] buffer, Int32 timeout, PingOptions options) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.Ping/src/System/Net/NetworkInformation/Ping.Unix.cs:line 31 at System.Net.NetworkInformation.Ping.GetAddressAndSendAsync(String hostNameOrAddress, Int32 timeout, Byte[] buffer, PingOptions options) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.Ping/src/System/Net/NetworkInformation/Ping.cs:line 353 ``` 28392 area-Meta Inconsistent compile behavior for out parameters @marce155 commented on [Thu Mar 22 2018](https://github.com/dotnet/core/issues/1373) When declaring an out parameter on a method I’m used to having to assign the parameter a value before leaving the method: ``` public bool TryGet(string foo, out TimeSpan bar){ bar = TimeSpan.FromSeconds(1); return true; } ``` Today I encountered a behavior which was at least unexpected and feels inconsistent. When I’m targeting netcoreapp2.0 there are some cases where the program will compile and work even if the out parameter has not been assigned. To be exact this is the case for TimeSpan or structs containing (only) a TimeSpan (that is as far as I tested). The same code will fail to compile for .NET 4.6. ``` class Program { public static void Main() { TimeSpan timeSpan; Foo foo; Bar bar; //Baz baz; TryTimeSpan(out timeSpan); TryFoo(out foo); TryBar(out bar); //TryBaz(out baz); Console.WriteLine(timeSpan); Console.WriteLine(foo); Console.WriteLine(bar); } private static bool TryTimeSpan(out TimeSpan timeSpan) { // no compile error - unexpected return false; } private static bool TryFoo(out Foo foo) { // empty struct works with target net461 as well return false; } private static bool TryBar(out Bar bar) { // no compile error - unexpected return false; } /* private static bool TryBaz(out Baz baz) { // compile error, baz not assigned for all targets - expected return false; } */ } struct Foo { } struct Bar { public TimeSpan TimeSpan { get; set; } } struct Baz { public int Int { get; set; } } ``` I assume that somehow proper defaults are assigned, yet it still feels a little strange. Could you please clarify if this is expected behavior and what causes it? --- @danstur commented on [Thu Mar 22 2018](https://github.com/dotnet/core/issues/1373#issuecomment-375337998) This definitely seems to violate the [specification](https://github.com/dotnet/csharplang/blob/master/spec/classes.md#output-parameters): > Every output parameter of a method must be definitely assigned before the method returns. 28393 area-Infrastructure Can not load UnloadableAssembly in System.Runtime.Tests When I run System.Runtime.Tests, the log contains `System.BadImageFormatException` exception with messages that UnloadableAssembly can non be loaded. Is it issue? 28398 area-System.ComponentModel LoadedFiles_NonStaticallyReferencedAssembly fails in CI with NotEmptyException From https://github.com/dotnet/corefx/pull/28320 OSX.1012.Amd64.Open-x64-Debug https://mc.dot.net/#/user/sputier/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/47503888725962aaad41a7b1384de12938aae16c/workItem/System.ComponentModel.Composition.Tests/analysis/xunit/System.ComponentModel.Composition.DirectoryCatalogTests~2FLoadedFiles_NonStaticallyReferencedAssembly ```text Unhandled Exception of Type Xunit.Sdk.NotEmptyException Message : Assert.NotEmpty() Failure Stack Trace : at System.ComponentModel.Composition.DirectoryCatalogTests.LoadedFiles_NonStaticallyReferencedAssembly() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Hosting/DirectoryCatalogTests.cs:line 356 ``` 28400 area-System.Runtime Test failure: System.Tests.StringGetHashCodeTests/GetHashCodeWithStringComparer_UseSameStringInTwoProcesses_ReturnsDifferentHashCodes(getHashCodeIndex: 0) Opened on behalf of @Sunny-pu The test `System.Tests.StringGetHashCodeTests/GetHashCodeWithStringComparer_UseSameStringInTwoProcesses_ReturnsDifferentHashCodes(getHashCodeIndex: 0)` has failed. System.NullReferenceException : Object reference not set to an instance of an object. Stack Trace: at System.Tests.StringGetHashCodeTests.GetHashCodeWithStringComparer_UseSameStringInTwoProcesses_ReturnsDifferentHashCodes(Int32 getHashCodeIndex) in E:\A\_work\5\s\corefx\src\System.Runtime\tests\System\StringGetHashCodeTests.cs:line 32 Build : Master - 20180323.01 (UWP F5 Tests) Failing configurations: - Windows.10.Amd64.ClientRS3-x64 - Release - Windows.10.Arm64-arm - Release - Windows.10.Amd64.ClientRS3-x86 - Release Details: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fuwp~2F/build/20180323.01/workItem/System.Runtime.Tests/analysis/xunit/System.Tests.StringGetHashCodeTests~2FGetHashCodeWithStringComparer_UseSameStringInTwoProcesses_ReturnsDifferentHashCodes(getHashCodeIndex:%200) 28402 area-Serialization default XmlDictionaryReader.Close implementation causes a stack overflow with an open reader in XmlReader: public void Dispose() { Dispose(true); } protected virtual void Dispose(bool disposing) { if (disposing && ReadState != ReadState.Closed) { Close(); } } in XmlDictionaryReader: public override void Close() { base.Dispose(); } = stack overflow This causes issues with ported code as in the .NET framework implementation XmlDictionaryReader's Close does not call the base class. A trivial sample that reproduces the issue: [XmlDictionaryReaderBug.zip](https://github.com/dotnet/corefx/files/1840539/XmlDictionaryReaderBug.zip) 28403 area-System.Reflection When the System.Reflection.DispatchProxy subclass's access modifier is not public it throw Access is denied The repo is [here](https://github.com/Mutuduxf/DispatchProxyDemo) ``` System.TypeLoadException: Access is denied: 'DynamicProxy+InvokeProxy`1[IService]'. at System.Reflection.Emit.TypeBuilder.TermCreateClass(RuntimeModule module, Int32 tk, ObjectHandleOnStack type) at System.Reflection.Emit.TypeBuilder.CreateTypeNoLock() at System.Reflection.Emit.TypeBuilder.CreateTypeInfo() at System.Reflection.DispatchProxyGenerator.ProxyBuilder.CreateType() at System.Reflection.DispatchProxyGenerator.GenerateProxyType(Type baseType, Type interfaceType) at System.Reflection.DispatchProxyGenerator.GetProxyType(Type baseType, Type interfaceType) at System.Reflection.DispatchProxyGenerator.CreateProxyInstance(Type baseType, Type interfaceType) at System.Reflection.DispatchProxy.Create[T,TProxy]() at DispatchProxyDemo.DynamicProxy.Proxy[T]() in C:\Users\aeond\Desktop\GitHub\DispatchProxyDemo\DispatchProxyDemo\DynamicProxy.cs:line 9 at DispatchProxyDemo.Program.Main(String[] args) in C:\Users\aeond\Desktop\GitHub\DispatchProxyDemo\DispatchProxyDemo\Program.cs:line 11 ``` [EDIT] Format exception + add exception line by @karelz 28404 area-System.Diagnostics Process: avoid performing operations on a different process with recycled pid "With recent changes to the Process class, we know when our child processes have exited. We can use this information to ensure a process instance doesn't start hitting a different process with a recycled pid. Requires https://github.com/dotnet/corefx/pull/27763 Example code: ```C# var processes = new Dictionary<int, Process>(); for (int i = 0; i < 1_000_000; i++) { if (i % 100 == 0) { Console.Write("".""); } var process = new Process(); process.StartInfo.FileName = ""/usr/bin/sleep""; process.StartInfo.Arguments = ""5""; process.EnableRaisingEvents = true; process.Start(); Process recycled; if (processes.TryGetValue(process.Id, out recycled)) { Console.WriteLine(""Killing recycled""); recycled.Kill(); recycled.WaitForExit(); Console.WriteLine(""New process exited? "" + process.HasExited); return; } else { processes.Add(process.Id, process); } process.Kill(); process.WaitForExit(); } ``` This code will throw when the Kill operation targets a recycled pid: ``` System.InvalidOperationException: Cannot process request because the process (12993) has exited. ``` CC @stephentoub @danmosemsft @wfurt " 28405 area-System.IO Fixed System.IO.FileSystem.AccessControl.Tests fails on non-English Windows See https://github.com/dotnet/corefx/issues/27629 28406 area-System.Net [Desktop] Uri(Uri, String) throws NullReferenceException for certain relativeUri values "Short reproduction from C# interactive in Visual Studio 2017 15.6.4 on Windows 10 1709 (I'd assume this runs under .NET 4.7.1): ```csharp var baseUri = new Uri(""http://example.com""); var relativeUri = ""ftp:%c3%b6""; new Uri(baseUri, relativeUri); ``` ``` Object reference not set to an instance of an object. + System.Uri.CreateUriInfo(System.Uri.Flags) + System.Uri.EnsureUriInfo() + System.Uri.ParseRemaining() + System.Uri.EnsureParseRemaining() + System.Uri.CreateThis(string, bool, System.UriKind) + System.Uri.CreateUri(System.Uri, string, bool) ``` The exception type is unexpected, I would expect a `UriFormatException` to be thrown. * Changing `:` to `%3a` works fine * Changing `%c3%b6` to `a` yields a better exception: `System.UriFormatException: Invalid URI: The Authority/Host could not be parsed.` So there seems to be something going on with the UTF-8 decoding combined with special case when a protocol is at start of the string. (The problem is the same under mono 5.4.1.6 on macOS) [EDIT] Update code formatting by @karelz" 28409 area-System.Numerics Formating of double to string using G29 format sometimes returns wrong result "@Eneuman commented on [Fri Mar 23 2018](https://github.com/dotnet/core/issues/1376) # Issue Title Formating of double to string using G29 format sometimes returns wrong result. # General Using .Net core 2.0 latest, Windows 10 Pro, Swedish Version Running this ``` var test1 = double.Parse(""1,5"").ToString(""G29""); var test2 = double.Parse(""1,6"").ToString(""G29""); var test3 = double.Parse(""1,7"").ToString(""G29""); ``` results in this: ``` test1 = ""1,5"" test2 = ""1,6000000000000001"" test3 = ""1,7"" ``` I was expecting this: ``` test1 = ""1,5"" test2 = ""1,6"" test3 = ""1,7"" ``` " 28410 area-System.Text Regex Match, Split and Matches should support RegexOptions.AnyNewLine as (?=[\r\n]|\z) From [MSDN](https://docs.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-options#Multiline): > By default, $ matches only the end of the input string. If you specify the RegexOptions.Multiline option, it matches either the newline character (\n) or the end of the input string. It does not, however, match the carriage return/line feed character combination. To successfully match them, use the subexpression \r?$ instead of just $. This is by far one of the biggest gotchas with using .NET Regex class. I suggest adding a RegexOptions.AnyNewLine which treats $ as matching _both_ Windows' Environment.NewLine and UNIX' Environment.NewLine, regardless of the Environment running corefx. *Portability concerns* According to Wikipedia, there are a ton of different operating systems, all with different line ending settings. The current implementation hardcodes Unix line-ending style. RegexOptions.AnyNewLine, defined as (?=[\r\n]|\z), would add support for Windows line-ending style. The advise written in the current docs is actually not portable on Unix, which is becoming a more popular option. As it is suggested, \r?$ will capture one or two lines on Unix, and one on Windows. If you try running Windows assemblies with this hack on Linux, you will change the semantics of programs. *Backward compatibility concerns* Fully backward compatible: This RegexOptions enum extension would not be a default, and so it would not break any clients with reasonably written code. The only existing code that might display different behavior would be reflection code that sets every option on RegexOptions enum variable. I really can't envision anyone doing this on purpose. Here is Petr Onderka (@svick)'s summary: OS | Line-ending style | Current | Environment.NewLine | AnyNewLine -- | -- | -- | -- | -- Windows | Windows | ✗ | ✓ | ✓ Windows | Unix | ✓ | ✗ | ✓ Unix | Windows | ✗ | ✗ | ✓ Unix | Unix | ✓ | ✓ | ✓ 28411 area-System.IO Test failure: System.IO.Tests.Perf_Directory/RecursiveCreateDirectory(depth: 1000, times: 1) All RecursiveCreateDirectory tests are failing https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180323.06/workItem/System.IO.FileSystem.Performance.Tests The test `System.IO.Tests.Perf_Directory/RecursiveCreateDirectory(depth: 1000, times: 1)` has failed. System.Exception : Benchmark did not execute any iterations. Please use one of the iteration methods in Microsoft.Xunit.Performance.Benchmark Stack Trace: at Microsoft.Xunit.Performance.BenchmarkTestInvoker.<>c__DisplayClass1_0.<<CallTestMethod>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.Xunit.Performance.Internal.BenchmarkIterator.RunAsync(Func`1 testMethod) --- End of stack trace from previous location where exception was thrown --- Build : Master - 20180323.06 (Core Tests) Failing configurations: - OSX.1013.Amd64-x64 - Release - OSX.1012.Amd64-x64 - Release - Alpine.36.Amd64-x64 - Release - RedHat.69.Amd64-x64 - Release - Fedora.27.Amd64-x64 - Release - Fedora.26.Amd64-x64 - Release - SLES.12.Amd64-x64 - Release - OpenSuse.423.Amd64-x64 - Release - Ubuntu.1804.Amd64-x64 - Release - Ubuntu.1710.Amd64-x64 - Release - Ubuntu.1604.Amd64-x64 - Release - Ubuntu.1404.Amd64-x64 - Release - Debian.90.Amd64-x64 - Release - Debian.87.Amd64-x64 - Release - RedHat.74.Amd64-x64 - Release - RedHat.73.Amd64-x64 - Release - Centos.74.Amd64-x64 - Release - Centos.73.Amd64-x64 - Release 28413 area-System.Runtime Skipping test on uap because retrieving info about processes not supported Fixes #28400 cc: @danmosemsft 28414 area-System.IO Test failure: System.IO.Tests.Perf_Directory/RecursiveCreateDirectory(depth: 100, times: 10) @anipik please disable RecursiveCreateDirectory perf test for .NET Framework, as it hits path limit. The test `System.IO.Tests.Perf_Directory/RecursiveCreateDirectory(depth: 100, times: 10)` has failed. System.IO.PathTooLongException : The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. Stack Trace: at System.IO.PathHelper.GetFullPathName() at System.IO.Path.LegacyNormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths) at System.IO.Path.GetFullPathInternal(String path) at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost) at System.IO.Tests.Perf_Directory.RecursiveCreateDirectory(Int32 depth, Int32 times) Build : Master - 20180323.06 (Full Framework Tests) Failing configurations: - Windows.10.Amd64-x64 - Release - Windows.10.Amd64-x86 - Release 28415 area-System.IO WIP - initial serial port support for Linux related to #18012 This still needs some work and testing but I would like to get early feedback. I can do simple serial IO now on Linux. This is first minimal set of changes. - PAL uses POSIX + few BSD extensions. It builds on Linux and OSX. FreeBSD should be probably OK. - I tested only simple test program on Ubuntu with RS-232 and USB-Serial IOgear adapter - on Raspberry ttyAMA0 should be detected but I don't currently have gear to test actual transfer. - no async event notifications 28416 area-System.Runtime grapheme enumeration "ported from https://github.com/dotnet/corefx/issues/24093#issuecomment-375585062 [A document of `TextElementEnumerator `](https://msdn.microsoft.com/en-us/library/system.globalization.textelementenumerator(v=vs.110).aspx) says that the .NET Framework defines a text element as a grapheme. However, what exactly does this ""grapheme"" means? Should the grapheme be the same as defined in [""Grapheme Cluster Boundaries"" in UAX #29](http://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries)? ```cs using System; using System.Globalization; class Program { static void Main() { var e = StringInfo.GetTextElementEnumerator(""👩🏻👦🏼👨🏽👦🏾👦🏿👩🏼👨🏽👦🏼👧🏽👩🏻👩🏿👧🏼👧🏾""); while (e.MoveNext()) { Console.WriteLine(e.GetTextElement()); } } } ``` expected result: 👩🏻👦🏼 👨🏽👦🏾👦🏿 👩🏼👨🏽👦🏼👧🏽 👩🏻👩🏿👧🏼👧🏾 actual result: 👩 🏻 👦 🏼 👨 🏽 👦 🏾 👦 🏿 👩 🏼 👨 🏽 👦 🏼 👧 🏽 👩 🏻 👩 🏿 👧 🏼 👧 🏾 " 28417 area-System.Net Unify HTTP Authentication Tests "Most of these were failing due to issues in the loopback authentication server that were fixed by @wfurt. I'll explain the other changes one by one below: Original: ```csharp yield return new object[] { ""Basic realm=\""testrealm1\"" basic realm=\""testrealm1\"""", true }; ``` Updated: ```csharp yield return new object[] { ""Basic realm=\""testrealm1\"" basic realm=\""testrealm1\"""", true }; yield return new object[] { ""Basic realm=\""testrealm1\"", basic realm=\""testrealm1\"""", true }; ``` The first is an invalid case, but actually does work with WinHttpHandler. This test was failing just because of the loopback server. I added a valid version of this test, but left the original in to pin our current behavior. Original (removed): ```csharp yield return new object[] { ""Basic something digest something"", true }; ``` The second change is to remove an invalid test case. This case highlights a minor behavior difference between WinHttpHandler and SocketsHttpHandler. Since there is no comma following the first scheme, all handlers will view this as a header requesting basic auth. The difference is that WinHttpHandler will refuse to authenticate when there are unknown tokens following the scheme. SocketsHttpHandler will just ignore the extra information. The correct behavior here isn't clear -- the only token allowed after basic auth is the realm, so either behavior sounds reasonable. I don't know if this is something we'd like to unify. Fixes: #28065 " 28418 area-System.Net Segmentation fault (core dumped) with microsoft/dotnet:2.0-runtime-stretch-arm32v7 "@Zuendelmeister commented on [Fri Mar 23 2018](https://github.com/dotnet/dotnet-docker/issues/443) ## Steps to reproduce the issue 1. Install docker ce on a raspberry pi 3 2. Start microsoft/dotnet:2.0-runtime-stretch-arm32v7 container with dotnet core code. Code uses http client that sends via post to a rest endpoint several times. 3. Code: ```c# var request = new HttpRequestMessage { RequestUri = new Uri(_url), Method = HttpMethod.Post, Headers ={ {HttpRequestHeader.Authorization.ToString(),_auth}, {HttpRequestHeader.ContentType.ToString(),""application/json""} }, Content = new StringContent(messageData) }; using (var handler = new HttpClientHandler { ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => true, UseProxy = false }) { using (var httpClient = new HttpClient(handler) { BaseAddress = new Uri(_url) }) { Console.WriteLine(""start sending...""); var response = await httpClient.SendAsync(request); //This is where the problem occurs!!! Console.WriteLine($""Sending done: StatusCode: {response?.StatusCode}""); } } ``` ## Expected behavior The code should just send data to the rest endpoint. ## Actual behavior It sends messages for a while (like 100) to the endpoint and dies with the error Segmentation fault (core dumped). This cannot be catched. ## Additional information (e.g. issue happens only occasionally) On raspberry pi 3 with the docker base-image microsoft/dotnet:2.0-runtime-stretch-arm32v7. I changed the baseimage and it works, so it's pretty save, that this issue is due to this one. Unfortunately I don't have any idea why. ## Output of `docker version` ``` Client: Version: 18.03.0-ce API version: 1.37 Go version: go1.9.4 Git commit: 0520e24 Built: Wed Mar 21 23:18:23 2018 OS/Arch: linux/arm Experimental: false Orchestrator: swarm Server: Engine: Version: 18.03.0-ce API version: 1.37 (minimum version 1.12) Go version: go1.9.4 Git commit: 0520e24 Built: Wed Mar 21 23:14:29 2018 OS/Arch: linux/arm Experimental: false ``` ## Output of `docker info` ``` Containers: 2 Running: 0 Paused: 0 Stopped: 2 Images: 3 Server Version: 18.03.0-ce Storage Driver: overlay2 Backing Filesystem: extfs Supports d_type: true Native Overlay Diff: false Logging Driver: json-file Cgroup Driver: cgroupfs Plugins: Volume: local Network: bridge host macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog Swarm: inactive Runtimes: runc Default Runtime: runc Init Binary: docker-init containerd version: cfd04396dc68220d1cecbe686a6cc3aa5ce3667c runc version: 4fc53a81fb7c994640722ac585fa9ca548971871 init version: 949e6fa Security Options: apparmor seccomp Profile: default Kernel Version: 4.4.0-1009-raspi2 Operating System: Ubuntu 16.04 LTS OSType: linux Architecture: armv7l CPUs: 4 Total Memory: 920.1MiB Name: ID: UUUL:DQMQ:S7ES:WMO6:QEWB:E7UW:FQEO:QG3S:AZO7:NBK4:B2OT:D7SI Docker Root Dir: /var/lib/docker Debug Mode (client): false Debug Mode (server): false Registry: https://index.docker.io/v1/ Labels: Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false ``` [EDIT] Add C# syntax highlighting by @karelz" 28423 area-System.Net PlatformHandler_HttpProtocolTests.GetAsync_Chunked_VaryingSizeChunks_ReceivedCorrectly fails "Discovered this while running System.Net.Http Outerloop tests: ``` System.Net.Http.Functional.Tests.PlatformHandler_HttpProtocolTests.GetAsync_Chunked_VaryingSizeChunks_ReceivedCorrectly(maxChunkSize: 1, lineEnding: \""\\r \\n\"", useCopyToAsync: True) [FAIL] System.IO.IOException : The read operation failed, see inner exception. ---- System.Net.Http.WinHttpException : Error 12030 calling WinHttpQueryDataAvailable, 'The connection with the server was terminated abnormally'. Stack Trace: ```" 28424 area-System.Net PlatformHandler_HttpClientHandler_ResponseDrain_Test.GetAsyncWithMaxConnections_DisposeBeforeReadingToEnd_KillsConnection fails Discovered this while running System.Net.Http Outerloop tests: ``` System.Net.Http.Functional.Tests.PlatformHandler_HttpClientHandler_ResponseDrain_Test.GetAsyncWithMaxConnections_DisposeBeforeReadingToEnd_KillsConnection (totalSize: 2000000, readSize: 0, mode: BytePerChunk) [FAIL] System.IO.IOException : Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---- System.Net.Sockets.SocketException : An existing connection was forcibly closed by the remote host Stack Trace: s:\GitHub\corefx\src\System.Net.Sockets\src\System\Net\Sockets\Socket.Tasks.cs(1087,0): at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.T hrowException(SocketError error) s:\GitHub\corefx\src\System.Net.Sockets\src\System\Net\Sockets\Socket.Tasks.cs(1079,0): at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.S ystem.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token) E:\A\_work\104\s\src\mscorlib\shared\System\IO\StreamWriter.cs(979,0): at System.IO.StreamWriter.FlushAsyncInternal(StreamWriter _this, Boolean flus hStream, Boolean flushEncoder, Char[] charBuffer, Int32 charPos, Boolean haveWrittenPreamble, Encoding encoding, Encoder encoder, Byte[] byteBuffer, Stream s tream, CancellationToken cancellationToken) E:\A\_work\104\s\src\mscorlib\shared\System\IO\StreamWriter.cs(586,0): at System.IO.StreamWriter.WriteAsyncInternal(StreamWriter _this, String value , Char[] charBuffer, Int32 charPos, Int32 charLen, Char[] coreNewLine, Boolean autoFlush, Boolean appendNewLine) s:\GitHub\corefx\src\Common\tests\System\Net\Http\LoopbackServer.cs(389,0): at System.Net.Test.Common.LoopbackServer.Connection.ReadRequestHeaderAnd SendCustomResponseAsync(String response) s:\GitHub\corefx\src\Common\tests\System\Net\Http\LoopbackServer.cs(130,0): at System.Net.Test.Common.LoopbackServer.<>c__DisplayClass13_0.<<AcceptC onnectionSendCustomResponseAndCloseAsync>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- s:\GitHub\corefx\src\Common\tests\System\Net\Http\LoopbackServer.cs(117,0): at System.Net.Test.Common.LoopbackServer.AcceptConnectionAsync(Func`2 fu ncAsync) s:\GitHub\corefx\src\Common\tests\System\Net\Http\LoopbackServer.cs(128,0): at System.Net.Test.Common.LoopbackServer.AcceptConnectionSendCustomRespo nseAndCloseAsync(String response) s:\GitHub\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.ResponseDrain.cs(255,0): at System.Net.Http.Functional.Tests.HttpCl ientHandler_ResponseDrain_Test.<>c__DisplayClass6_1.<<GetAsyncWithMaxConnections_DisposeBeforeReadingToEnd_KillsConnection>b__2>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- s:\GitHub\corefx\src\Common\tests\System\Net\Http\LoopbackServer.cs(117,0): at System.Net.Test.Common.LoopbackServer.AcceptConnectionAsync(Func`2 fu ncAsync) s:\GitHub\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.ResponseDrain.cs(246,0): at System.Net.Http.Functional.Tests.HttpCl ientHandler_ResponseDrain_Test.<>c__DisplayClass6_0.<<GetAsyncWithMaxConnections_DisposeBeforeReadingToEnd_KillsConnection>b__1>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- s:\GitHub\corefx\src\Common\tests\System\Net\Http\LoopbackServer.cs(84,0): at System.Net.Test.Common.LoopbackServer.<>c__DisplayClass11_0.<<CreateCl ientAndServerAsync>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- s:\GitHub\corefx\src\Common\tests\System\Net\Http\LoopbackServer.cs(67,0): at System.Net.Test.Common.LoopbackServer.CreateServerAsync(Func`2 funcAsy nc, Options options) s:\GitHub\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.ResponseDrain.cs(216,0): at System.Net.Http.Functional.Tests.HttpCl ientHandler_ResponseDrain_Test.GetAsyncWithMaxConnections_DisposeBeforeReadingToEnd_KillsConnection(Int32 totalSize, Int32 readSize, ContentMode mode) --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- ``` And after getting this exception, the test hangs due to some await problem regarding the loopback server response. It looks like a loopback server bug or a place where a SocketException needs to be handled better. ## Failures history Build | OS | Details -- | -- | -- 20180225.01 | Win7 | SocketException: An existing connection was forcibly closed by the remote host 20180301.04 | Win7 | SocketException: An existing connection was forcibly closed by the remote host 20180302.06 | Win7 | SocketException: An existing connection was forcibly closed by the remote host 20180303.03 | Win7 | WinHttpException: The operation has been canceled 20180303.03 | Win7 | SocketException: An existing connection was forcibly closed by the remote host 20180304.02 | Win7 | SocketException: An existing connection was forcibly closed by the remote host 20180304.03 | Win7 | WinHttpException: The operation has been canceled 20180308.02 | Win8.1 | WinHttpException: The operation has been canceled 20180308.06 | Win7 | WinHttpException: The operation has been canceled 20180314.02 | Win10 | WinHttpException: The operation has been canceled 20180314.05 | Win7 | TaskCanceledException: A task was canceled. 20180314.05 | Win7 | WinHttpException: The handle is invalid 20180316.03 | Win7 | SocketException: An existing connection was forcibly closed by the remote host 20180318.01 | Win7 | SocketException: An existing connection was forcibly closed by the remote host 28425 area-System.Net Disable some failing/hanging HTTP tests Opened some issues #28423 #28424. These tests are failing/hanging on my dev box all the time. 28426 area-System.Drawing TypeConverters for System.Drawing "Closes #21129 Added converters `FontConverter`, `IconConverter`, `ImageConverter `and `ImageFormatConverter` and tests. What I changed against original files from Mono: - Changed variable and other names to suit coding style. - Used resource for `(none)` string and throwing exception using base `GetConvertFromException()`. - [ImageConverter](https://github.com/mono/mono/blob/master/mcs/class/System.Drawing/System.Drawing/ImageConverter.cs#L80) returned string `(none)` always, even if destination type was not string. Changed it only for string destination type. - In [Icon](https://github.com/mono/mono/blob/master/mcs/class/System.Drawing/System.Drawing/IconConverter.cs#L83) and [Image](https://github.com/mono/mono/blob/master/mcs/class/System.Drawing/System.Drawing/ImageConverter.cs#L86) converter they called `CanConvertTo` with a comment that destination is a `byte[]`. I changed it to simple type check. - Tests for exception with `try-catch` replaced with `Assert.Throws()`. - Tests `Assert.True(!...)` replaced with `Assert.False(...)`. - Cryptic messages (e.g. `""CCF#9""`) in assertions replaced with meaningful ones. - In the tests, there are `Assert.Equal()` checks. In the original files in Mono they had message (`Assert.AreEqual()`), so specific assertion could be found when test fails. In XUnit, this assertion does not have a message." 28428 area-Infrastructure Fix compat pack dependencies to be live pre-release and harvest System.Buffers ref to previously shipped version Fixes: https://github.com/dotnet/corefx/issues/28326 System.Security.Cryptography.Cng pre-release needs to be included in the compat pack since System.Security.Cryptography.Xml is now taking a dependency on it and we haven't shipped it stable, so if we depend on the Cng stable version it will fail because there will be a downgrade on that dependency. Also this freezes the implementation for netstandard2.0 for System.Buffers to not take a reference to System.Private.CoreLib in an OOB package. Also I'm updating the compat pack publish script to be able to generate the netcoreapp2.1 ApiCatalog layout from the live everyday build. cc: @ericstj @weshaggard @danmosemsft @joperezr @terrajobst 28430 area-Meta Last API review nits for 2.1 Aside from the regularlization of span related parameters completed recently by @Anipik , there were some other nits identified in new APIs that we want to fix before release. These are described here https://github.com/dotnet/apireviews/pull/63 The line numbers in the comments reference this API list https://raw.githubusercontent.com/terrajobst/apireviews/a1671f88d1219d2a16e0abfc47e79e3d4c7ed82f/2018/NetCore20-vs-NetCore21-Diff/README.md @maryamariyan can you please make these tweaks? They are in various areas but can simply be all done at once. cc @terrajobst 28433 area-System.Numerics System.Numerics.Vectors and Span<T> Please think about implementing this operator: Vector3.CopyTo(Span<T> span) Since the span can be a stackallocated Array the performance gain should be huge! Also Vertical Operators are missing from Vector<T> like T Min(Vector<T> vector) 28434 area-System.Data Fix SQL Server version-related failures in manual SqlCredentialTest. "1. Fixed failures due to drop user commands, since the ""DROP _ IF EXISTS"" syntax is only supported starting in SQL Server 2016. 2. Set CHECK_POLICY to off for created test logins, since a minimum password age policy can cause test failures when trying to change the test user's password." 28435 area-System.Globalization [Arm64] System.Globalization.Tests.InvariantModeTests 79 tests are failing "``` xUnit.net console test runner (64-bit .NET Core) Copyright (C) 2014 Outercurve Foundation. Discovering: Invariant.Tests Discovered: Invariant.Tests Starting: Invariant.Tests ``` 7 x ``` System.Globalization.Tests.InvariantModeTests.TestIndexOf(source: \""Hi\"", value: \""I\"", startIndex: 0, count: 2, options: IgnoreCase, result: 1) [FAIL] Assert.Equal() Failure Expected: 1 Actual: -1 Stack Trace: /home/vmjenkins/workspace/Dotnet/build_corefx/src/System.Globalization/tests/Invariant/InvariantMode.cs(656,0): at System.Globalization.Tests.InvariantModeTests.TestIndexOf(String source, String value, Int32 startIndex, Int32 count, CompareOptions options, Int32 result) ``` 1x ``` System.Globalization.Tests.InvariantModeTests.TestEnum [FAIL] Assert.Equal() Failure Expected: CultureInfo[] [] Actual: CultureInfo[] [, af, af-NA, af-ZA, agq, ...] ``` 5x ``` System.Globalization.Tests.InvariantModeTests.TestCultureData(cultureName: \""en-US\"") [FAIL] Assert.Equal() Failure ↓ (pos 1) Expected: AD Actual: A ↑ (pos 1) Stack Trace: /home/vmjenkins/workspace/Dotnet/build_corefx/src/System.Globalization/tests/Invariant/InvariantMode.cs(492,0): at System.Globalization.Tests.InvariantModeTests.TestCultureData(String cultureName) ``` 5x ``` System.Globalization.Tests.InvariantModeTests.TestSortVersion(cultureName: \""en-US\"") [FAIL] Assert.Equal() Failure Expected: SortVersion { FullVersion = 0, SortId = 00000000-0000-0000-0000-00000000007f } Actual: SortVersion { FullVersion = 14489, SortId = 00003899-0000-0000-0000-000000000409 } ``` 8x ``` System.Globalization.Tests.InvariantModeTests.TestNormalization(s: \""fi\"", form: FormKC) [FAIL] Assert.True() Failure Expected: True Actual: False Stack Trace: /home/vmjenkins/workspace/Dotnet/build_corefx/src/System.Globalization/tests/Invariant/InvariantMode.cs(753,0): at System.Globalization.Tests.InvariantModeTests.TestNormalization(String s, NormalizationForm form) ``` 5x ``` System.Globalization.Tests.InvariantModeTests.TestToLower(upper: \""THIS IS A LONGER TEST CASE\"", lower: \""this is a longer test case\"", result: True) [FAIL] Assert.Equal() Failure Expected: True Actual: False Stack Trace: /home/vmjenkins/workspace/Dotnet/build_corefx/src/System.Globalization/tests/Invariant/InvariantMode.cs(719,0): at System.Globalization.Tests.InvariantModeTests.TestToLower(String upper, String lower, Boolean result) ``` 5x ``` System.Globalization.Tests.InvariantModeTests.TestToUpper(lower: \""this is a longer test case\"", upper: \""THIS IS A LONGER TEST CASE\"", result: True) [FAIL] Assert.Equal() Failure Expected: True Actual: False Stack Trace: /home/vmjenkins/workspace/Dotnet/build_corefx/src/System.Globalization/tests/Invariant/InvariantMode.cs(730,0): at System.Globalization.Tests.InvariantModeTests.TestToUpper(String lower, String upper, Boolean result) ``` ..." 28436 area-System.IO System.IO.Pipes.TestsAnonymousPipeTest_Specific.Linux_BufferSizeRoundtrips needs elevated priviledges to pass ``` xUnit.net console test runner (64-bit .NET Core) Copyright (C) 2014 Outercurve Foundation. Discovering: System.IO.Pipes.Tests Discovered: System.IO.Pipes.Tests Starting: System.IO.Pipes.Tests System.IO.Pipes.Tests.AnonymousPipeTest_Specific.Linux_BufferSizeRoundtrips [FAIL] System.UnauthorizedAccessException : Access to the path is denied. ---- System.IO.IOException : Operation not permitted Stack Trace: /home/vmjenkins/workspace/Dotnet/build_corefx/src/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Unix.cs(435,0): at System.IO.Pipes.PipeStream.CheckPipeCall(Int32 result) /home/vmjenkins/workspace/Dotnet/build_corefx/src/System.IO.Pipes/src/System/IO/Pipes/AnonymousPipeServerStream.Unix.cs(31,0): at System.IO.Pipes.AnonymousPipeServerStream.Create(PipeDirection direction, HandleInheritability inheritability, Int32 bufferSize) /home/vmjenkins/workspace/Dotnet/build_corefx/src/System.IO.Pipes/tests/AnonymousPipeTests/AnonymousPipeTest.Specific.cs(96,0): at System.IO.Pipes.Tests.AnonymousPipeTest_Specific.Linux_BufferSizeRoundtrips() ----- Inner Stack Trace ----- Finished: System.IO.Pipes.Tests === TEST EXECUTION SUMMARY === System.IO.Pipes.Tests Total: 505, Errors: 0, Failed: 1, Skipped: 0, Time: 20.753s ``` Passes if run as sudo. @jkotas 28437 area-System.Net System.Net.Tests.HttpWebRequestTest.KeepAlive_CorrectConnectionHeaderSent "Looks like should be marked Conditional on `LocalServerAvailable` ``` xUnit.net console test runner (64-bit .NET Core) Copyright (C) 2014 Outercurve Foundation. Discovering: System.Net.Requests.Tests Discovered: System.Net.Requests.Tests Starting: System.Net.Requests.Tests System.Net.Tests.FtpWebRequestTest.Ftp_RenameFileSubDir_Success [SKIP] Condition(s) not met: \""LocalServerAvailable\"" System.Net.Tests.FtpWebRequestTest.Ftp_LargeFile [SKIP] Condition(s) not met: \""LocalServerAvailable\"" System.Net.Tests.FtpWebRequestTest.Ftp_CreateAndDelete [SKIP] Condition(s) not met: \""LocalServerAvailable\"" System.Net.Tests.FtpWebRequestTest.Ftp_RenameFile [SKIP] Condition(s) not met: \""LocalServerAvailable\"" System.Net.Tests.FtpWebRequestTest.Ftp_MakeAndRemoveDir_Success [SKIP] Condition(s) not met: \""LocalServerAvailable\"" System.Net.Tests.FtpWebRequestTest.Ftp_AppendFile [SKIP] Condition(s) not met: \""LocalServerAvailable\"" System.Net.Tests.HttpWebRequestTest.KeepAlive_CorrectConnectionHeaderSent(keepAlive: False) [FAIL] Assert.Contains() Failure Not found: ""Connection"": ""close"" In value: {""Method"":""GET"",""Url"":""/Echo.ashx"",""Headers"": { ""Connection"": ""Keep-Alive"", ""Via"": ""1.1 10.38.1.212 (McAfee Web Gateway 7.6.2.8.0.22994)"", ""Host"": ""corefx-net.cloudapp.net"", ""X-Forwarded-For"": ""10.228.198.226"" }, ""Cookies"": {}, ""BodyContent"": """", ""BodyLength"": 0, ""SecureConnection"": false, ""ClientCertificatePresent"": false, ""ClientCertificate"": null } Stack Trace: /home/vmjenkins/workspace/Dotnet/build_corefx/src/System.Net.Requests/tests/HttpWebRequestTest.cs(457,0): at System.Net.Tests.HttpWebRequestTest.KeepAlive_CorrectConnectionHeaderSent(Nullable`1 keepAlive) Finished: System.Net.Requests.Tests ```" 28438 area-System.Text [Arm64] System.Text.Tests.EncodingTest.TestRoundtrippingSpecificCodepageEncoding fails "``` xUnit.net console test runner (64-bit .NET Core) Copyright (C) 2014 Outercurve Foundation. Discovering: System.Text.Encoding.CodePages.Tests Discovered: System.Text.Encoding.CodePages.Tests Starting: System.Text.Encoding.CodePages.Tests System.Text.Tests.EncodingTest.TestRoundtrippingSpecificCodepageEncoding(encodingName: \""GB18030\"", bytes: [129, 48, 137, 55, 129, ...], expected: \""Þßàáâã\"") [FAIL] Assert.Equal() Failure Expected: Byte[] [129, 48, 137, 55, 129, ...] Actual: Byte[] [129, 48, 137, 55, 129, ...] Stack Trace: /home/vmjenkins/workspace/Dotnet/build_corefx/src/System.Text.Encoding.CodePages/tests/EncodingCodePages.cs(535,0): at System.Text.Tests.EncodingTest.TestRoundtrippingSpecificCodepageEncoding(String encodingName, Byte[] bytes, String expected) Finished: System.Text.Encoding.CodePages.Tests === TEST EXECUTION SUMMARY === System.Text.Encoding.CodePages.Tests Total: 740, Errors: 0, Failed: 1, Skipped: 0, Time: 5.775s ```" 28439 area-Serialization Sgen parameter conversion change: replace colon with space in arguments #26902 @huanwu @zhenlan @mconnew See #27332 for more information. 28442 area-System.Threading Fix some monitor tests, add one for lock wait paths - The monitor tests were not running because it was not a public class, fixed - Fixed some tests, for instance some argument exceptions could be improved to include parameter name (this issue exists elsewhere too), for now I have just changed the tests to reflect current coreclr/desktop behavior - Added a test to hit spinning/waiting paths for thin lock and aware lock 28445 area-System.Net ManagedWebSocket implementation doesn't efficiently support reading when small buffer size used The end to end scenario is to allocate as little memory as possible for idle websockets since it's possible to have more concurrent websockets if we don't burn memory if there's no data (http://goroutines.com/10m). Today, the websocket implementation has an internal buffer that can be controlled during creation of the websocket. This buffer can be 14 bytes minimally (size of the largest websocket header) so specifying a buffer of that size would be ideal. The plan is to do it at both layers. Using libuv this is already the case and we're now trying to add it to the socket transport https://github.com/aspnet/KestrelHttpServer/pull/2393. SignalR also has to do it at the websocket layer https://github.com/aspnet/SignalR/pull/1603. The chain looks like this: ``` WebSocket.ReceiveAsync(0) HttpUpgradeStream.ReceiveAsync(14) // This is the internal buffer for the websocket header RequestBodyPipeReader.ReadAsync() // This is waiting on data to be written to the transport input Transport.Input.ReadAsync() // This is waiting on data to be read out of the socket. socket.ReceiveAsync(0) ``` Turns out there's an issue with the existing implementation where it tries to read up the internal buffer size per read size regardless of the buffer that was passed into ReceiveAsync: https://github.com/dotnet/corefx/blob/23165cee77ae4dd7a7645b7927872948bb27a73e/src/Common/src/System/Net/WebSockets/ManagedWebSocket.cs#L696-L702 This means we'll get data in 14 byte chunks even if we pass a 4K buffer in to fill. /cc @stephentoub @BrennanConroy 28447 area-System.Threading Dequeue growth method optimizations The [Grow()](https://github.com/dotnet/corefx/blob/master/src/System.Threading.Channels/src/System/Collections/Generic/Dequeue.cs#L94) method some peculiarities that could potentially help with reading or optimizations. First off `Debug.Assert(_size == _array.Length);` guarantees that these two values are synonymous. Instead of a mix and match of using `_array.Length` in some areas and `_size` in others, just use `_size`. Another is this part ```c# const int MinimumGrow = 4; int capacity = (int)(_array.Length * 2L); if (capacity < _array.Length + MinimumGrow) { capacity = _array.Length + MinimumGrow; } T[] newArray = new T[capacity]; ``` `_array` starts off as an empty array `private T[] _array = Array.Empty<T>();`. This means it is a length of zero. The only time `if (capacity < _array.Length + MinimumGrow)` will ever be true is when the array is empty or 0. If I incorporate the first idea along with this one, it could be re-written as this: ```c# const int MinimumGrow = 4; int capacity = _size == 0 ? MinimumGrow : _size * 2; T[] newArray = new T[capacity]; ``` or if you want to assume the typical condition to be `true` ```c# const int MinimumGrow = 4; int capacity = _size > 0 ? _size * 2: MinimumGrow ; T[] newArray = new T[capacity]; ``` 28448 area-System.Net NamedPipeServerStream.EndWaitForConnection throws SocketException on x86/Linux I've been running the same code one multiple platforms (amd64/Win 10, amd64/Debian 9, arm64/Rasbian, and x86/Debian 9). In every case making a call to NamedPipeServerStream.Dispose will cause EndWaitForConnection to throw ObjectDisposedException. However when I move the same dll to x86/Debian 9 it throws System.Net.Sockets.SocketException. Unexpected exception in background thread caused a crash. > Unhandled Exception: System.Net.Sockets.SocketException: Operation canceled > at System.IO.Pipes.NamedPipeServerStream.<<WaitForConnectionAsync>g__WaitForConnectionAsyncCore|23_0>d.MoveNext() in /home/nick/Documents/builds/branches/corefx/src/System.IO.Pipes/src/System/IO/Pipes/NamedPipeServerStream.Unix.cs:line 80 > at System.Threading.Tasks.TaskToApm.End(IAsyncResult asyncResult) in /home/nick/Documents/builds/branches/corefx/src/Common/src/System/Threading/Tasks/TaskToApm.cs:line 87 > at System.IO.Pipes.NamedPipeServerStream.EndWaitForConnection(IAsyncResult asyncResult) in /home/nick/Documents/builds/branches/corefx/src/System.IO.Pipes/src/System/IO/Pipes/NamedPipeServerStream.cs:line 155 I built from the v2.1-preview1 branch for x86/Linux using the process outlined here. https://github.com/liserdarts/dotnetcore-build-x86-Linux 28450 area-System.Collections ConcurrentStack PushRange idea [ConcurrentStack](https://github.com/dotnet/corefx/blob/master/src/System.Collections.Concurrent/src/System/Collections/Concurrent/ConcurrentStack.cs) has a `PushRange` method that takes in an array/set of items. ```c# public void PushRange(T[] items); public void PushRange(T[] items, int startIndex, int count); ``` `PushRange` has a very useful optimization in that it creates a pre-made linked list, then attaches the tale to the current head, which makes it very efficient at adding the entire set **with a single successful CAS**(compare and swap). I think limiting `PushRange` to only arrays may encourage bad usage or force the user to using arrays. I was wondering about some other signatures that could help facilitate the bulk adding of items without having to work with arrays or calling 'ToArray' on your favorite set object. ```c# public void PushRange(T[] items); public void PushRange(T[] items, int startIndex, int count); public void PushRange(IList<T> items); public void PushRange(IList<T> items, int startIndex, int count); public void PushRange(IEnumerable<T> items); ``` I get this feeling that people are just doing, because it's easy enough ```c# foreach(var i in items) stack.Push(i); ``` in lieu of a bulk push method for other set types. But this will result in many more CAS operations, increasing contention. fyi, T[] implements IList<T>, so you could just redirect `PushRange(T[] items...)` to `PushRange(IList<T> items...)` 28454 area-System.Security ClaimTypes.Sid has a different behaviour than the other ClaimTypes "Hi, I m using the namespace System.Security.Claims to generate a new JWT ``` var tokenDescriptor = new SecurityTokenDescriptor { Issuer = authSettings.Issuer, Audience = authSettings.Audience, NotBefore = DateTime.UtcNow, IssuedAt = DateTime.UtcNow, Subject = new ClaimsIdentity(new Claim[] { new Claim(ClaimTypes.Sid, user.Id.ToString()), new Claim(ClaimTypes.GivenName, user.Firstname), new Claim(ClaimTypes.Surname, user.Lastname), new Claim(ClaimTypes.Email, user.Email), new Claim(ClaimTypes.Role, role.Name), }), Expires = token.ExpirationDate, SigningCredentials = GenerateSigningCredentials(authSettings.SecretKey) }; ``` When I decode the JWT (for exemple on https://jwt.io/) I can see: ``` { **""http://schemas.xmlsoap.org/ws/2005/05/identity/claims/sid""**: ""37cf7320-5669-4dbb-767f-08d58ddd8d0b"", ""given_name"": ""XX"", ""family_name"": ""XX"", ""email"": ""XX@XX.com"", ""role"": ""XX"", ""nbf"": 1521957359, ""exp"": 1522562150, ""iat"": 1521957359, ""iss"": ""XX"", ""aud"": ""http://localhost:9334/"" } ``` Is there a specific reason to encode *http://schemas.xmlsoap.org/ws/2005/05/identity/claims/sid* in the JWT instead of *sid*? In my opinion, the behaviour must the same for all the ClaimsType. Can you fix that? " 28457 area-System.Numerics System.Numerics.Vectors missing intrinsics There are 100s of Vector<T> commands that would map to a single AVX or SSE instruction that are not present in System.Numerics.Vector. Also there are no Vertical Operators except Dot and BiggerThanAll. Here are all: https://software.intel.com/sites/landingpage/IntrinsicsGuide/# Would help performance if some Vertical Operators would be supported. Like Max, Min, Sum, ``` public static float Vector<float> Max() public static float Vector<float> Min() public static float Vector<float> Sum() //Max: movhlps xmm1,xmm0 ; Move top two floats to lower part of xmm1 maxps xmm0,xmm1 ; Get maximum of the two sets of floats pshufd xmm1,xmm0,$55 ; Move second float to lower part of xmm1 maxps xmm0,xmm1 ; Get minimum of the two remaining floats ``` Vector could also be a special type in C# like Span<T> to support 0 copy operations and casts. 28460 area-System.Memory Update uses of AsBytes to use MemoryMarshal.AsBytes Part of https://github.com/dotnet/corefx/issues/27094 Related PR: https://github.com/dotnet/corefx/pull/28296 28464 area-System.Memory Vectorize {RO}Span.IndexOf for T = char, similar to T = byte. See https://github.com/aspnet/Common/pull/324#issuecomment-375997102 cc @gfoidl, @jkotas, @benaadams, @AndyAyersMS, @davidfowl, @AtsushiKan, @eerhardt 28465 area-System.Collections Improve test coverage over List.AddRange and List.InsertRange Resolves #13970. I really wanted to wait for #23588 to be resolved so this can be verified more easily, but it is unclear when that will be done. cc: @karelz @danmosemsft 28466 area-System.IO [Desktop] FileStream.ReadAsync() fails with System.IO.IOException: The media is write protected. This occurs sporadically when copying files from an SD card whose write protect tab is not engaged. The FileStream is the only handle opened on the file and is created using new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.Read, 1024 * 1024, FileOptions.Asynchronous | FileOptions.SequentialScan) .NET 4.7.1, Windows 10 Fall Creators Update, Lenovo T440s built in Realtek PCI-E SD card reader with driver version 10.0.10125.21277. Some investigation shows the SD card is mounted read only in these cases, which is not expected and may signal an issue in Realtek's driver, but this doesn't explain why operations on a read only handle are failing because write permission is unavailable. There is a second concurrent task writing the data read to another file on an SSD but, for both tasks, the FileStreams are local. new FileStream(filePath, FileMode.Create, FileAccess.Write, FileShare.None, 1024 * 1024, FileOptions.Asynchronous | FileOptions.SequentialScan | FileOptions.WriteThrough); The underlying native API is [SetFilePointerEx()](https://msdn.microsoft.com/en-us/library/windows/desktop/aa365542.aspx). Since the two handles in use are distinct and used single threaded I don't see any obvious races in code review. It's possible the issue may be in native code under .NET and therefore external, but filing this for a look anyway. Workaround: Copy files manually using FileExplorer. This issue also fails to reproduce with File.Copy(). System.IO.IOException: The media is write protected. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.SeekCore(Int64 offset, SeekOrigin origin) at System.IO.FileStream.BeginReadCore(Byte[] bytes, Int32 offset, Int32 numBytes, AsyncCallback userCallback, Object stateObject, Int32 numBufferedBytesRead) at System.IO.FileStream.BeginReadAsync(Byte[] array, Int32 offset, Int32 numBytes, AsyncCallback userCallback, Object stateObject) at System.IO.FileStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) at System.IO.Stream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count) at CritterShell.Images.FileCopy.<>c__DisplayClass7_0.<<StreamAsync>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at CritterShell.Images.FileCopy.<StreamAsync>d__7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at CritterShell.CopyCameraFiles.<>c__DisplayClass26_0.<ProcessRecord>b__1(String inputSubdirectoryPath, ParallelLoopState loopState) at System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1() at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask) at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object ) --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally) at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IEnumerable`1 source, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally) at System.Threading.Tasks.Parallel.ForEach[TSource](IEnumerable`1 source, ParallelOptions parallelOptions, Action`2 body) at CritterShell.CopyCameraFiles.<>c__DisplayClass26_0.<ProcessRecord>b__0() at System.Threading.Tasks.Task.Execute() ---> (Inner Exception #0) System.IO.IOException: The media is write protected. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.SeekCore(Int64 offset, SeekOrigin origin) at System.IO.FileStream.BeginReadCore(Byte[] bytes, Int32 offset, Int32 numBytes, AsyncCallback userCallback, Object stateObject, Int32 numBufferedBytesRead) at System.IO.FileStream.BeginReadAsync(Byte[] array, Int32 offset, Int32 numBytes, AsyncCallback userCallback, Object stateObject) at System.IO.FileStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) at System.IO.Stream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count) at CritterShell.Images.FileCopy.<>c__DisplayClass7_0.<<StreamAsync>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at CritterShell.Images.FileCopy.<StreamAsync>d__7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at CritterShell.CopyCameraFiles.<>c__DisplayClass26_0.<ProcessRecord>b__1(String inputSubdirectoryPath, ParallelLoopState loopState) 28468 area-System.IO Test failure: System.IO.Tests.DirectoryInfo_GetFiles_str/SearchPatternWithTrailingStar "Opened on behalf of @Sunny-pu The test `System.IO.Tests.DirectoryInfo_GetFiles_str/SearchPatternWithTrailingStar` has failed. Assert.Contains() Failure Not found: /tmp/DirectoryInfo_GetFiles_str_zl3nq3px.5uf/SearchPatternWithTrailingStar_75_30e9b6fc/Test1Dir2 In value: String[] [\""/tmp/DirectoryInfo_GetFiles_str_zl3nq3px.5uf/Searc\""...] Stack Trace: at System.IO.Tests.Directory_GetFileSystemEntries_str_str.SearchPatternWithTrailingStar() in /Users/buildagent/agent/_work/433/s/corefx/src/System.IO.FileSystem/tests/Directory/GetFileSystemEntries_str_str.cs:line 85 Build : Master - 20180326.02 (Core Tests) Failing configurations: - OSX.1012.Amd64-x64 - Release Details: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180326.02/workItem/System.IO.FileSystem.Tests/analysis/xunit/System.IO.Tests.DirectoryInfo_GetFiles_str~2FSearchPatternWithTrailingStar" 28469 area-System.Net Add readonly to s_gzipHeaderValue and s_deflateHeaderValue Add readonly to s_gzipHeaderValue and s_deflateHeaderValue 28472 area-System.Linq Check for IReadOnlyCollection ... as well as ICollection, to avoid IEnumerator loop. 28475 area-System.Xml Add a test to prevent regression when XmlUriResolver uses Uri.LocalPath Fixes #25820 There is small logic in XmlUriResolver so this is more of an indirect test of Uri.LocalPath, anyway, users seem to find issues via Xml usage so adding this test in an attempt to prevent regressions in this regard. 28477 area-Infrastructure Archive generated performance files for investigation. Performance runs have not been archiving their logs, which made impossible review generated lab results. These changes sets the days to keep the archive to 30 days, and the number of artifacts to 200 (currently set to the same defaults than the coreclr repo, and we can adjust as needed). 28479 area-System.Diagnostics Test failure: System.Diagnostics.Tests.ProcessTests/TestProcessStartTime Opened on behalf of @danmosemsft The test `System.Diagnostics.Tests.ProcessTests/TestProcessStartTime` has failed. Assert.InRange() Failure\r Range: (3/26/18 12:54:34 PM - 3/26/18 12:54:36 PM)\r Actual: 3/26/18 12:54:34 PM Stack Trace: at System.Diagnostics.Tests.ProcessTests.TestProcessStartTime() in /root/corefx-1520178/src/System.Diagnostics.Process/tests/ProcessTests.cs:line 716 Build : Master - 20180326.03 (Core Tests) Failing configurations: - RedHat.73.Amd64-x64 - Release This used to be 3 seconds, Could you please bump it up again. It looks like we were <500msec too low. ```c# [Fact] public void TestProcessStartTime() { TimeSpan allowedWindow = TimeSpan.FromSeconds(1); ``` 28480 area-System.Net Add test to visit sites with SocketsHttpHandler Adds a small test to visit a list of sites using SocketsHttpHandler and allow easy debugging and comparison with platform handlers in case one needs to investigate. The tests are disabled by default and are controlled by Xunit traits. Closes #27792 28481 area-System.Net Enable CloseAsync_Cancel_Success test Have run the test locally and in CI many times, no failure. Enable the test. Closes: #27211 28482 area-System.Net Test failure: System.Net.Sockets.Tests.ExecutionContextFlowTest / ExecutionContext_FlowsOnlyOnceAcrossAsyncOperations Seen in https://github.com/dotnet/corefx/pull/28225#issuecomment-376299061 Fedora.26.Amd64.Open-x64-Debug ``` System.Net.Sockets.Tests System.Net.Sockets.Tests.ExecutionContextFlowTest/ ExecutionContext_FlowsOnlyOnceAcrossAsyncOperations ``` ``` Assert.InRange() Failure Range: (1 - 60) Actual: 117 ``` ``` at System.Net.Sockets.Tests.ExecutionContextFlowTest.<>c.<<ExecutionContext_FlowsOnlyOnceAcrossAsyncOperations>b__11_0>d.MoveNext() in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.Sockets/tests/FunctionalTests/ExecutionContextFlowTest.netcoreapp.cs:line 47 --- End of stack trace from previous location where exception was thrown --- --- End of stack trace from previous location where exception was thrown --- ``` /cc @stephentoub ## History of failures Day | Build | OS | Details -- | -- | -- | -- 3/14 | 20180314.05 | Centos.74 | Actual: 99 3/26 | ? | Fedora.26 | https://github.com/dotnet/corefx/pull/28225#issuecomment-376299061 - Actual: 117 28483 area-System.ComponentModel Using System.ComponentModel.Composition vs. System.Composition to get exports "Adding test shows getting exports on interface with complex ""where"" clause: `IResponder<T,U> where T: U {}` works properly when using System.ComponentModel.Composition. System.Composition seems to have regressed behavior since 1.0.31 and as of PR submission #10219 which fixes a TypeLoadException. Related to #23607 cc: @weshaggard @ViktorHofer " 28485 area-System.Net [Regression] System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpClientHandler_SslProtocols_Test / GetAsync_UnsupportedSSLVersion_Throws ## Failure type ### GetAsync_UnsupportedSSLVersion_Throws - The operation was canceled ``` Assert.Throws() Failure Expected: typeof(System.Net.Http.HttpRequestException) Actual: typeof(System.OperationCanceledException): The operation was canceled. at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken) in E:\A\_work\36\s\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\ConnectHelper.cs:line 154 at System.Net.Http.HttpConnectionPool.CreateConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) in E:\A\_work\36\s\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnectionPool.cs:line 348 at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync(ValueTask`1 creationTask) in E:\A\_work\36\s\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnectionPool.cs:line 467 at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken) in E:\A\_work\36\s\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnectionPool.cs:line 258 at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in E:\A\_work\36\s\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\RedirectHandler.cs:line 30 at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) in E:\A\_work\36\s\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs:line 479 at System.Net.Test.Common.RemoteServerQuery.Run[TResult](Func`1 testCode, Func`2 remoteExceptionWrapper, String serverName) ``` ## Failure history Day | Build | OS | Details -- | -- | -- | -- 3/1 | 20180301.04 | Win10 | 2x 3/2 | 20180302.04 | Win10 | 3/3 | 20180303.03 | Win10 | 2x 3/4 | 20180303.04 | Win10 | 3/11 | 20180311.02 | Win10 | 3/12 | 20180312.02 | Win10 | 2x 3/15 | 20180315.04 | Win10 | 2x 3/23 | 20180323.01 | Win10 | 28486 area-System.Net Uri.LocalPath in Unix when path contains '#' "During #28475 2 failures on Unix were detected: ``` System.Xml.Tests.XmlUriResolverTests.Resolving_LocalPath_Ok(baseUri: file:///home/pc/s/corefx/bin/tests/System.Xml.Misc.Tests/netcoreapp-Linux-Debug-x64/, path: \""/f#/t/ë/t#st.xml\"") [FAIL] Assert.Equal() Failure ↓ (pos 2) Expected: /f#/t/ë/t#st.xml Actual: /f ↑ (pos 2) Stack Trace: /home/pc/s/corefx/src/System.Private.Xml/tests/Misc/XmlUrlResolverTests.cs(29,0): at System.Xml.Tests.XmlUriResolverTests.Resolving_LocalPath_Ok(Uri baseUri, String path) System.Xml.Tests.XmlUriResolverTests.Resolving_LocalPath_Ok(baseUri: file:///home/pc/s/corefx/bin/tests/System.Xml.Misc.Tests/netcoreapp-Linux-Debug-x64/, path: \""/f#/ã/ë/tëst.xml\"") [FAIL] Assert.Equal() Failure ↓ (pos 2) Expected: /f#/ã/ë/tëst.xml Actual: /f ↑ (pos 2) Stack Trace: /home/pc/s/corefx/src/System.Private.Xml/tests/Misc/XmlUrlResolverTests.cs(29,0): at System.Xml.Tests.XmlUriResolverTests.Resolving_LocalPath_Ok(Uri baseUri, String path) Finished: System.Xml.Misc.Tests ``` See https://github.com/dotnet/corefx/pull/28475/files#r177095732 for more info" 28488 area-System.Net httpclient requests to dns address that resolves to self causes authentication error Scenario: I am using httpclient to send log events that are generated in website A to website B. both website A and B are using net core 2.0.6 and on the SAME IIS instance. When sending https requests from website A to website B using defaultcredentials the client FAILS to authenticate. I have windows authentication enabled and verified that its working. If I change one of the websites to be on a different iis instance, the authentication works and the request succeeds. 28490 area-System.Diagnostics Increasing AllowedWindow time This Process test would sometimes fail on RedHat7.3 by getting slightly out of the allowed window time. So I am increasing 1s to 3s to make sure it passes all the time. Fixes #28479 cc: @danmosemsft @joperezr 28491 area-System.ComponentModel DataAnnotation exposes readonly Dictionary on ValidationContext "https://github.com/dotnet/corefx/blob/2242e106f7695578ccaa1dcc35e438a14f9be1f1/src/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/ValidationContext.cs#L32 `ValidationContext` exposes the readonly dictionary as `IDictionary Items`. Should this property be changed from `IDictionary` to `IReadOnlyDictionary`? https://github.com/dotnet/corefx/blob/2242e106f7695578ccaa1dcc35e438a14f9be1f1/src/System.ComponentModel.Annotations/tests/ValidationContextTests.cs#L54-L66 The above test will fail at L63 if the following code is added between L61 and L62. validationContext.Items.Add(""testKey3"", ""testValue3""); " 28492 area-System.IO Unexpected behavior with canceled CancellationToken passed to PipeWriter.FlushAsync "The program below never terminates. It's passing a canceled CancellationToken in to `FlushAsync`, catching the exception, and then completing the pipe. However, the `ReadAsync` call on the other end is never completed. If you comment out the cancellation, the pipe is completed properly and the `ReadAsync` completes. I wouldn't have expected the pipe to be un-completable after cancelling an action on it. cc @pakrym @davidfowl ```csharp using System; using System.IO.Pipelines; using System.Threading; using System.Threading.Tasks; namespace PipeCancelFlushBlug { class Program { static void Main(string[] args) { var pipe = new Pipe(); var receiver = Receiver(pipe.Reader); var sender = Sender(pipe.Writer); Task.WaitAll(sender, receiver); } private static async Task Sender(PipeWriter pipeWriter) { var cts = new CancellationTokenSource(); cts.Cancel(); // Comment this line out to fix everything. try { Console.WriteLine(""Flushing""); await pipeWriter.FlushAsync(cts.Token); } catch (OperationCanceledException) { Console.WriteLine(""Flush Cancelled""); } finally { Console.WriteLine(""Completing pipe""); pipeWriter.Complete(); Console.WriteLine(""Completed pipe""); } } private static async Task Receiver(PipeReader pipeReader) { Console.WriteLine(""Reading...""); var result = await pipeReader.ReadAsync(); Console.WriteLine(""Receiver complete""); } } } ``` cc @davidfowl @pakrym ### Versions: * `System.IO.Pipelines`: 4.5.0-preview2-26313-01 * SDK: 2.1.300-preview2-008367 * .NET Core Runtime: 2.1.0-preview2-26313-01 (I realize these versions are exactly aligned" 28494 area-System.Net Add test for SocketsHttpHandler Brotli response SocketsHttpHandler doesn't currently automatically decode Brotli responses, but add tests to validate we can at least do so manually. cc: @ianhays, @joshfree, @geoffkizer 28495 area-Infrastructure [no merge] Just testing CI 28496 area-System.Text Test System.Text.RegularExpressions.Tests.RegexGroupTests failed in CI. Test System.Text.RegularExpressions.Tests.RegexGroupTests failed. details: https://ci.dot.net/job/dotnet_corefx/job/master/job/osx10.12_release/417/testReport/System.Text.RegularExpressions.Tests/RegexGroupTests/GroupsBasic/ MESSAGE: Exit code was 32899 but it should have been 42\nExpected: True\nActual: False +++++++++++++++++++ STACK TRACE: at System.Diagnostics.RemoteExecutorTestBase.RemoteInvokeHandle.Dispose(Boolean disposing) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_release/src/CoreFx.Private.TestUtilities/src/System/Diagnostics/RemoteExecutorTestBase.cs:line 252 28497 area-System.Diagnostics Test System.Threading.Threads.Tests.ThreadTests.ApartmentState_AttributePresent failed in CI. Test System.Threading.Threads.Tests.ThreadTests.ApartmentState_AttributePresent failed. Details: https://ci.dot.net/job/dotnet_corefx/job/master/job/osx10.12_release/417/testReport/System.Threading.Threads.Tests/ThreadTests/ApartmentState_AttributePresent_AppName____STAMain_exe____mode____GetApartmentState___/ MESSAGE: Assert.Equal() Failure\nExpected: 2\nActual: 32899 +++++++++++++++++++ STACK TRACE: at System.Threading.Threads.Tests.ThreadTests.ApartmentState_AttributePresent(String AppName, String mode) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_release/src/System.Threading.Thread/tests/ThreadTests.cs:line 169 28499 area-System.Numerics System.Numerics.Vector4 calculates incorrect in some inlining situations. Sample Code ```csharp using System; using System.Numerics; namespace DotNetNumericTest { class Program { static void Main(string[] args) { var rect = new Vector4(10, 20, 100, 30); var v = Test(rect, new Vector2(100, 100)); Console.WriteLine(v); Console.ReadLine(); } public static Vector4 Test(Vector4 v, Vector2 off) { v.X += off.X; v.Y += off.Y; return v; } } ``` Excepted output: `<110, 120, 100, 30>` Incorrect output: `<10, 20, 100, 30>` using release build. After attatching `MethodImplOptions.NoInlining` to the method Test(), it prints right answer. It seems like the operator '+=' affects the result. Test on .netcore 2.1.103, windows. 28501 area-System.ComponentModel EmailAddressAttribute behaves differently in .NET Core vs. NetFx "It behaves differently for the following Unit Tests and I think both behaviours are not 100% correct: Just for reference: https://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.emailaddressattribute(v=vs.110).aspx ```csharp public class UnitTest1 { private static EmailAddressAttribute AddressAttribute = new EmailAddressAttribute(); [Theory] [InlineData(""test@test.com"", true)] [InlineData(""test@test.co.uk"", true)] [InlineData(""test+t@test.co.uk"", true)] [InlineData(""test"", false)] [InlineData(""test.com"", false)] [InlineData(""test@test"", false)] [InlineData(""test@test."", false)] public void EmailValidity(string email, bool result) { Assert.Equal(result, AddressAttribute.IsValid(email)); } } ``` In NetFX 4.7 all tests succeed. In NetCore 1.0/2.0 the tests for ""test@test"" and ""test@test."" fail. In #25129 @PeterSmithRedmond said that atleast test@test is a valid email, but as far as i understand the spec test@test. (notice the dot) is not, the domain part is called dot-atom in the spec https://tools.ietf.org/html/rfc2822#section-3.2.4 and has either no dot or dot and other valid symbols after the dot. If I'm correct there are bugs in both implementations, in netfx the test for ""test@test"" should fail (because it's a valid address) and in net core the test for ""test@test."" should succeed, because it's not a valid address. Repro: [EmailAddressAttributeRepro.zip](https://github.com/dotnet/corefx/files/1850894/EmailAddressAttributeRepro.zip) Just run it with the different test frameworks." 28502 area-System.Runtime Build failing with 'CancellationTokenRegistration' does not contain a definition for 'TryDeregister' From https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_build?_a=summary&buildId=1524090 System\Threading\Tasks\AsyncInfoToTaskBridge.CoreCLR.cs(73,29): error CS1061: 'CancellationTokenRegistration' does not contain a definition for 'TryDeregister' and no extension method 'TryDeregister' accepting a first argument of type 'CancellationTokenRegistration' could be found (are you missing a using directive or an assembly reference?) [E:\A\_work\4\s\corefx\src\System.Runtime.WindowsRuntime\src\System.Runtime.WindowsRuntime.csproj] Looks like it is related to https://github.com/dotnet/corefx/pull/28471 cc @stephentoub, @danmosemsft, @AntonLapounov, @jkotas 28504 area-System.Security System.Security.Cryptography.Pkcs '1.2.840.113549.1.1.5' is not a known hash algorithm. "i'm trying to compute a cms SHA1RSA using the pre release version(4.5.0-preview1-26216-02) of System.Security.Cryptography.Pkcs. Oid.FromFriendlyName(""SHA1RSA"",OidGroup.SignatureAlgorithm) returns the corect digest algorithem, but upon calling encode, i get the exception that i,m not using any known hash algorithm. Is there any short term plan to incorporate it? Encoding snippet:---------- protected byte[] GenerateSignature(byte[] fileContent) { CmsSigner signer = new CmsSigner(SubjectIdentifierType.IssuerAndSerialNumber, ClientCert); SignedCms signedCms = new SignedCms(new ContentInfo(fileContent), false); signer = new CmsSigner(SubjectIdentifierType.IssuerAndSerialNumber, ClientCert); signer.DigestAlgorithm = Oid.FromFriendlyName(""SHA1RSA"",OidGroup.SignatureAlgorithm); signedCms.ComputeSignature(signer, false); var signature = signedCms.Encode(); return signature; }" 28508 area-System.Text Improve exception handling in RegexParser Related to https://github.com/dotnet/corefx/issues/27618 Currently RegexParser always throws ArgumentExceptions with a custom text when something's going wrong. Do differentiate error cases (in tests) and make other uses cases like TryParse or Validate possible we should refactor the current exception handling. I'm thinking about the following options: a) Introduce a RegexParseException which inherits from ArgumentException to not break existing code that contains an enum status code that tells the parse error code. From this we can then build the existing error messages. This options doesn't support TryParse / Validate scenarios. b) Return a RegexParseEnum that tells what went wrong. Ultimately this will be wrapped inside an ArgumentException to not break existing code. TryParse / Validate scenarios can either return this enum or return the error message from it. c) Keep everything as it is and only tests if ArgumentExceptions are thrown during negative tests. cc @stephentoub @danmosemsft @CyrusNajmabadi 28509 area-Infrastructure Wire up lldb into Unix test run scripts Similar to wiring up of GDB in https://github.com/dotnet/buildtools/pull/1948 we want LLDB to be wired up It's being added to test images in https://github.com/dotnet/core-eng/issues/2998 and it already exists on some machines. You can install it locally on your Linux box to test your change, of course. LLDB should be scripted to open the dump, do `clrstack -all` and probably `pe -nested` , and quit. cc @stephentoub @maririos @mikem8361 28511 area-System.Collections Dictionary_ContainsValue_String* regressed 112% Dictionary_ContainsValue_Int* dropped 42% but the various string ones rose ~100%. https://benchview/trendline?build_selector=latest&count=2000&aggregate=arithmeticMean&filterTail=one&filterVal=100&interval=INTERVAL_MIN_MAX&rtids=[957]&archids=[23]&mpids=[1292]&cfgids=[2706]&testids=[59909,59910,59911,59939,59915,59916,59918,59917,59928,59929,59930,59900,59901,59902,59894,59895,59896,59903,59904,59905,59940,59941,59942,59912,59913,59914,59891,59892,59893,59925,59926,59927,59936,59937,59938,59932,59922,59923,59924,59933,59934,59935,59931,59919,59920,59921,59906,59907,59908,59897,59898,59899]&jobid=94205& In this range of changes https://github.com/dotnet/corefx/compare/a2cb15caef95911a0c6a118c62bb447cd65c6563...dotnet:59f6987b7fc919a438060f6c502c3c9cf7c8af29 the following are most likely culprits 02b5689 @benaadams Improve Dictionary FindEntry CQ … c340cd3 @benaadams Improve Dictionary TryInsert CQ … 5cad7a5 @benaadams Use EqualityComparer<TKey>.Default Intrinsic … 926183e @benaadams 1-base Dictionary buckets to reduce initalization … e12a5ec  28512 area-System.IO Change Linux buffer size test to force small value. /cc @sdmaclea @wfurt @stephentoub It seems that on linux-arm64, per @sdmaclea traces, the buffer size is being created as 1MB. This PR tries to ensure that the test will pass by starting with a smaller value, there is a risk that some systems may have a minimum higher than 4KB, I want to use this PR to validate the various Linux distros, and will correct as needed. 28515 area-System.Memory Revert the API Compat changes for UAPAOT. Last part of https://github.com/dotnet/corefx/issues/27094 28516 area-System.ComponentModel [NO MERGE] Implement System.ComponentModel.VersionConverter VersionConverter is a new System.ComponentModel.TypeConverter subclass that handle conversions between string and System.Version. 28517 area-System.Memory Add Memory.Pin() to eventually replace Memory.Retain(bool) Depends on: https://github.com/dotnet/coreclr/pull/17269 cc @KrzysztofCwalina, @jkotas, @davidfowl, @stephentoub, @dotnet/corefxlab-contrib 28518 area-System.Runtime Delete workaround for ComImport types on Unix Depends on a new CoreCLR build. 28521 area-System.Net WinHttpHandler does not authenticate when unknown parameters are present with basic auth "The [RFC](https://tools.ietf.org/html/rfc7617#section-2 ) for Basic authentication states that unknown parameters must be ignored: >No other authentication parameters are defined -- unknown parameters MUST be ignored by recipients, and new parameters can only be defined by revising this specification. There are two cases that test this which are failing on `WinHttpHandler`: ```csharp yield return new object[] { ""Basic realm=\""testrealm1\"" basic realm=\""testrealm1\"""", true }; yield return new object[] { ""Basic something digest something"", true }; ``` The above cases look like additional auth schemes, but since they are not comma separated, they are considered additional parameters. On `WinHttpHandler` these headers are rejected, when the extra parameters should really just be ignored. `WinHttpHandler` is depending on WinHttp to parse the `WWW-Authenticate` header, so I see this as an issue we are unlikely to fix without customer reports. With that in mind I'm moving this to future." 28522 area-System.Net Digest authentication resubmit differences between WinHttpHandler & SocketsHttpHandler This behavior difference causes a hang in the HTTP authentication tests. I'll summarize the issue here, with my thoughts at the bottom. I've been wrong about this particular failure before, so I'll try to stick to just the facts :) In two of the `WWW-Authenticate` header test cases, an invalid `Digest` scheme will cause `WinHttpHandler` to resubmit the original request. `SocketsHttpHandler` will instead close the connection and return the 401 response immediately. The Wireshark traces below demonstrate both cases, with `SocketsHttpHandler` on the left. Digest with an unsupported algorithm:  Digest with no realm or nonce:  The extra newline in the SocketsHttpHandler case is added by wireshark and is not a part of the actual message. Note that I modified the test slightly while getting these screenshots -- I stopped the loopback server from closing the connection immediately after the 401, which was causing a hang in `WinHttpHandler` when it sent the second get request and got no response. The test case is still the same for both handlers. The re submission happening in WinHttpHandler is primarily caused by WinHttp. We make the following call to query supported auth schemes: https://github.com/dotnet/corefx/blob/b458c89b34ba2a84858312a487066bdc2ba350e3/src/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpAuthHelper.cs#L90-L95 In both cases WinHttp returns the value `WINHTTP_AUTH_SCHEME_DIGEST`, indicating that digest authentication is the only supported scheme. We then set the credentials, but when the request is sent WinHttp has not included them. **Opinions below:** I think that the `SocketsHttpHandler` behavior is correct, and that the `WinHttpHandler` behavior should be considered a (minor) bug. Since we rely on WinHttp to determine what auth schemes are available, I would tentatively call this a WinHttp bug. For the time being, I'd like to modify the test to support both cases. I'd like to hear what others think though. 28523 area-System.Net Digest parsing on SocketsHttpHandler is not as robust as on WinHttpHandler In one of the `WWW-Authenticate` header test cases, unquoted digest parameters are successfully parsed by `WinHttpHandler`, but not by `SocketsHttpHandler`. The test case was written to expect a `401` response, but failed on WinHttpHandler when the request successfully authenticated. https://github.com/dotnet/corefx/blob/00547db7233076da50db7b4d6e1a8e7ff1710ed0/src/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs#L571 The Wireshark traces below demonstrate the issue, with `SocketsHttpHandler` on the left and `WinHttpHandler` on the right.  This case isn't technically legal as per the spec, since realm and nonce are required to be quoted. I think we should fix it eventually since it is a regression from WinHttpHandler, but I'm not sure how to prioritize it. @karelz do you have any thoughts? 28524 area-System.Memory Created ReadOnlySequence tests and fixed issues 28526 area-System.Security Add .NET 4.5 functionality and API to WindowsIdentity This change exposes the DeviceClaims and UserClaims properties on WindowsIdentity and WindowsPrincipal which were added in net45. The existing (uncallable) API for these in .NET Core was missing the Windows 8 token information, so that has been added (with sanity tests) in this change. Aside for Interop style and detecting Win8 by feature use vs OS version, this is a simple port from netfx. Fixes #27982. Addresses some of #18073 and #17164 28527 area-Infrastructure Sync init-tools scripts with what is in source-build cc @dagood @dseefeld 28528 area-Infrastructure [release/2.1] Sync init-tools scripts with what is in source-build cc @dagood @dseefeld 28529 area-System.Memory Fixing naming inconsistency between System.Runtime and System.Memory refs Related to recent changes - https://github.com/dotnet/corefx/pull/28160 The subset of types from System.Memory ref that are in System.Runtime ref should be identical: https://github.com/dotnet/corefx/blob/master/src/System.Memory/ref/System.Memory.cs https://github.com/dotnet/corefx/blob/master/src/System.Runtime/ref/System.Runtime.cs cc @weshaggard, @KrzysztofCwalina, @stephentoub, @terrajobst, @davidfowl 28530 area-Serialization Use DataContractSerializer to serialize Lazy<T> object "When serialize Lazy<T> object, the output xml is not as expected. `var value = new Lazy<int>(() => 1); DataContractSerializer dcs = new DataContractSerializer(typeof(Lazy<int>)); using (MemoryStream ms = new MemoryStream()) { Console.WriteLine(value.Value); //1 Console.WriteLine(value.IsValueCreated); //true dcs.WriteObject(ms, value); ms.Position = 0; string actualOutput = new StreamReader(ms).ReadToEnd(); Console.WriteLine(actualOutput); //< LazyOfint xmlns = ""http://schemas.datacontract.org/2004/07/System"" xmlns:i = ""http://www.w3.org/2001/XMLSchema-instance"" /> ms.Position = 0; var deserialized = (Lazy<int>)dcs.ReadObject(ms); Console.WriteLine(deserialized.IsValueCreated); //false Console.WriteLine(deserialized.Value); //0 Console.WriteLine(deserialized.IsValueCreated); //true Console.WriteLine(deserialized.Value); //0 }` Tried same code on full framework, got the following exception: > System.Runtime.Serialization.SerializationException: 'Type 'System.Lazy`1+Boxed[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' with data contract name 'Lazy.BoxedOfintk9wYX3t0:http://schemas.datacontract.org/2004/07/System' is not expected. Consider using a DataContractResolver if you are using DataContractSerializer or add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to the serializer.' " 28533 area-Infrastructure Updating CoreClr dependencies to stable 28534 area-Infrastructure Mirror changes from dotnet/coreclr This PR contains mirrored changes from dotnet/coreclr **Please REBASE this PR when merging** 28535 area-Infrastructure Update CoreClr, CoreFx to servicing-26417-01, servicing-26423-01, respectively (release/1.1.0) 28537 area-System.Net ProxyExplicitlyProvided_DefaultCredentials_Ignored failed in CI https://mc.dot.net/#/user/stephentoub/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/11a515405be4fbf1cfe81c881b2ed702594ed40c/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.PlatformHandler_HttpClientHandler_DefaultProxyCredentials_Test~2FProxyExplicitlyProvided_DefaultCredentials_Ignored ``` Windows.10.Amd64.Open-x64-Debug Unhandled Exception of Type System.Exception Message : System.Exception : Unexpected EOF trying to read request header Stack Trace : at System.Net.Test.Common.LoopbackServer.Connection.ReadRequestHeaderAsync() in D:\j\workspace\windows-TGrou---74aa877a\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 378 at System.Net.Http.Functional.Tests.HttpClientHandler_DefaultProxyCredentials_Test.<>c__DisplayClass2_1.<<ProxyExplicitlyProvided_DefaultCredentials_Ignored>b__1>d.MoveNext() in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.DefaultProxyCredentials.cs:line 74 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.AcceptConnectionAsync(Func`2 funcAsync) in D:\j\workspace\windows-TGrou---74aa877a\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 117 at System.Net.Http.Functional.Tests.HttpClientHandler_DefaultProxyCredentials_Test.<>c__DisplayClass2_0.<<ProxyExplicitlyProvided_DefaultCredentials_Ignored>b__0>d.MoveNext() in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.DefaultProxyCredentials.cs:line 66 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.CreateServerAsync(Func`2 funcAsync, Options options) in D:\j\workspace\windows-TGrou---74aa877a\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 67 at System.Net.Http.Functional.Tests.HttpClientHandler_DefaultProxyCredentials_Test.ProxyExplicitlyProvided_DefaultCredentials_Ignored() in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.DefaultProxyCredentials.cs:line 55 --- End of stack trace from previous location where exception was thrown --- ``` cc: @wfurt 28538 area-Infrastructure Mega-solution needed As a newbie to this repo, I find it very difficult to figure out where anything is. And when I do finally find what I need, I then have to try finding out where the test classes are. I'm sure it makes sense once you get it, but I don't get it. Beyond just finding classes, I'd love to able to navigate from project to project using F12 and Shift-F12, to see where the member was defined or what other members access it. I think a solution that contained all the projects and all the test projects would be immensely beneficial. I couldn't find an issue here on this topic, but I have seen other baffled developers on the forums. Thoughts? 28539 area-System.Runtime GetTaskSchedulersForDebugger_ReturnsDefaultScheduler tests failing in CI with NullReferenceException for Unix From https://github.com/dotnet/corefx/pull/28536 System.Threading.Tasks.Tests.TaskSchedulerTests/GetTaskSchedulersForDebugger_ReturnsDefaultScheduler OSX.1013.Amd64.Open-x64-Debug Ubuntu.1604.Amd64.Open-x64-Release ... Centos.74.Amd64.Open-x64-Release https://mc.dot.net/#/user/dotnet-maestro-bot/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/2c74aa99ae6f5bcb1048ef1450dc9894a924c562/workItem/System.Threading.Tasks.Tests/analysis/xunit/System.Threading.Tasks.Tests.TaskSchedulerTests~2FGetTaskSchedulersForDebugger_ReturnsDefaultScheduler ```text Unhandled Exception of Type System.NullReferenceException Message : System.NullReferenceException : Object reference not set to an instance of an object. Stack Trace : at System.Threading.Tasks.Tests.TaskSchedulerTests.GetTaskSchedulersForDebugger_ReturnsDefaultScheduler() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Threading.Tasks/tests/TaskScheduler/TaskSchedulerTests.cs:line 298 ``` cc @tarekgh, @danmosemsft 28540 area-Meta Nit changes in API diff between .NET Core 2.0 and .NET Core 2.1 Refer to dotnet/apireviews#63 This shows changes made in ref and some optional changes in test. Relevant changes to src is provided in PR dotnet/coreclr#17288 cc: @terrajobst @danmosemsft @ahsonkhan 28541 area-System.Net Replace custom date parsing for HttpDateParse "fixes #12513 Added exploratory tests, then modified those tests into what DateTime(Offset).Parse can handle. Also fixes the following bugs in the original: - considered ANSI dates to be local (to the _receiver_, no less), instead of UTC/GMT like the spec says. - accepted offset values (ie, `+05:00`), but didn't actually use them. - would throw `ArrayIndexOutOfBoundsException` if a string token didn't have enough distinguishing characters (ie, `'S'` throws, because it needs to check the next character for `'a'`/`'u'` for Saturday/Sunday) Retains case insensitivity of the original. Drops ability to use partially matching day-of-week/month strings (ie, the original parses `""Surprise""` as `""Sunday""`). Drops ability to use non-matching date/day-of-week strings (ie `""Sat, 25 Mar 2018 16:33:01 GMT""` - the 25th was actually a Sunday) Drops ability to use arbitrary characters as separators. Now allows arbitrary amounts of whitespace between tokens. Attempting to retain any of the previous compatibility changes would require changes to `DateTime.Parse`, which I am somewhat loathe to do. I'm going to assume these changes represent a performance regression, given the previous implementation was highly optimized (if somewhat buggy). Additionally, the way the previous code was written makes me think it was pulled from C/C++ somewhere - I don't know whether that should be looked into. " 28542 area-Meta same project dotnet build -c release on linux is fail "same project . on linux  on windows  but on linux ,run "" dotnet build -c release "" is fail  on windows it's run  why?" 28543 area-System.Net Fix perf hit from WinHttpGetProxyForUrl The recent addition of calling WinHttpGetProxyForUrl by default for each SocketsHttpHandler request on Windows is adding non-trivial overhead, at least 5% to each request in a local measurement. We should avoid that. For example, by using WinHttpDetectAutoProxyConfigUrl to see if there's an autoproxy, and if there isn't, caching that knowledge and then skipping WinHttpGetProxyForUrl for all subsequent requests. We may also need/want to query WinHttpGetIEProxyConfigForCurrentUser in that case, again caching the results, similar to what's done on Unix. cc: @karelz, @wfurt, @geoffkizer 28544 area-System.Net Test failure: System.Net.Http.Functional.Tests.PlatformHandler_HttpClientHandlerTest/PostAsync_CallMethod_EmptyContent(remoteServer: https://corefx-net.cloudapp.net/Echo.ashx) Opened on behalf of @Sunny-pu The test `System.Net.Http.Functional.Tests.PlatformHandler_HttpClientHandlerTest/PostAsync_CallMethod_EmptyContent(remoteServer: https://corefx-net.cloudapp.net/Echo.ashx)` has failed. Assert.Equal() Failure\r Expected: (null)\r Actual: Byte[] [172, 187, 137, 202, 24, ...] Stack Trace: at System.Net.Http.Functional.Tests.TestHelper.VerifyResponseBody(String responseContent, Byte[] expectedMD5Hash, Boolean chunkedUpload, String requestBody) at System.Net.Http.Functional.Tests.HttpClientHandlerTest.<PostAsync_CallMethod_EmptyContent>d__87.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) Build : Master - 20180328.01 (Full Framework Tests) Failing configurations: - Windows.10.Amd64-x86 - Release Details: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fdesktop~2Fcli~2F/build/20180328.01/workItem/System.Net.Http.Functional.Tests/analysis/xunit/System.Net.Http.Functional.Tests.PlatformHandler_HttpClientHandlerTest~2FPostAsync_CallMethod_EmptyContent(remoteServer:%20https:~2F~2Fcorefx-net.cloudapp.net~2FEcho.ashx) 28545 area-System.Net Test failure: System.Net.Security.Tests.ServerAsyncAuthenticateTest/ServerAsyncAuthenticate_EachServerUnsupportedProtocol_Fail(protocol: Ssl3) Opened on behalf of @Sunny-pu The test `System.Net.Security.Tests.ServerAsyncAuthenticateTest/ServerAsyncAuthenticate_EachServerUnsupportedProtocol_Fail(protocol: Ssl3)` has failed. Assert.Throws() Failure Expected: typeof(System.NotSupportedException) Actual: typeof(System.TimeoutException): Task timed out after 240000 Stack Trace: at System.Threading.Tasks.TaskTimeoutExtensions.TimeoutAfter(Task task, Int32 millisecondsTimeout) at System.Net.Security.Tests.ServerAsyncAuthenticateTest.ServerAsyncSslHelper(SslProtocols clientSslProtocols, SslProtocols serverSslProtocols, Boolean expectedToFail) in /Users/buildagent/agent/_work/391/s/corefx/src/System.Net.Security/tests/FunctionalTests/ServerAsyncAuthenticateTest.cs:line 137 Build : Master - 20180328.01 (Core Tests) Failing configurations: - OSX.1012.Amd64-x64 - Release Details: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180328.01/workItem/System.Net.Security.Tests/analysis/xunit/System.Net.Security.Tests.ServerAsyncAuthenticateTest~2FServerAsyncAuthenticate_EachServerUnsupportedProtocol_Fail(protocol:%20Ssl3) 28546 area-System.Threading ValueTask<T> and ValueTask should implement the same common interface Both class could implement an interface like this one ```csharp public interface IValueTask { bool IsCanceled { get; } bool IsCompleted { get; } bool IsCompletedSuccessfully { get; } bool IsFaulted { get; } } ``` Another method could be added to the interface to access the underlying Task, returning a `Task` object which is possible as `Task<T>` derived from `Task`. ```csharp Task UnderlyingTask(): // For a lack of a better name... ``` This way we could store `IValueTask` fields in our custom types that would address either `ValueTask` or any kind of `ValueTask<T>` I'm aware this would introduce Boxing to define IValueTask members, but maybe it is an acceptable choice when the alternative would be to store many members because of many different `<T>`... 28547 area-System.Net IPEndPoint.Port as UInt16 A Port is a unsigned integer of 16 bits, so it have sense to define it internaly as a UInt16 28548 area-System.Runtime BitConverter - Select Endianness Add a way to set the Endianness of the methods. Something like: ```csharp public static ushort ToUInt16(byte[] value, int startIndex, Endianness endianness=Endianness.BigEndian); ``` Where the default parameter points to the system default endianness 28549 area-Meta (Out)dated JS escaping rules in JsonValue.cs "https://github.com/dotnet/corefx/blob/master/src/System.Json/src/System/Json/JsonValue.cs Edge, Chrome, Firefox: Input: JSON.stringify(""</script>"") Result: """"</script>"""" I can't verify that U+2028 (LINE SEPARATOR), U+2029 (PARAGRAPH SEPARATOR) needs to be escaped either. Only Firefox does that at the moment." 28550 area-System.IO Do not resume reader on 0-byte FlushAsync https://github.com/dotnet/corefx/issues/27732 28551 area-Infrastructure Packages which suppress NETStandard.Library reference cause downgrades when installed in `netcoreapp1.0` "This is true for both the 2.1 packages we're building now as well as the 2.0 packages we shipped prior. This manifests as `NU1605` errors. As an example, install System.Buffers 4.4.0 in a `netcoreapp1.0` project. For example: ``` error NU1605: Detected package downgrade: System.IO.FileSystem.Primitives from 4.3.0 to 4.0.1. Reference the package directly from the project to select a different version. error NU1605: project -> Microsoft.NETCore.App 1.0.5 -> NETStandard.Library 1.6.0 -> System.Console 4.0.0 -> runtime.unix.System.Console 4.3.0 -> System.IO.FileSystem.Primitives (>= 4.3.0) error NU1605: project -> Microsoft.NETCore.App 1.0.5 -> NETStandard.Library 1.6.0 -> System.IO.FileSystem.Primitives (>= 4.0.1) ``` The downgrade isn't caused by the common ancestor (`NETStandard.Library`) as the warning might lead you to believe. Instead it's occurring because of the following dependency: System.Buffers 4.4.0 -> System.Diagnostics.Debug 4.3.0 -> Microsoft.NETCore.Platforms 1.1.0 (runtime.json). They are hitting this NuGet issue: https://github.com/NuGet/Home/issues/3541. The set of packages impacted in the 2.1 release are the following: - System.Buffers - System.Diagnostics.DiagnosticSource - System.Reflection.TypeExtensions - System.Runtime.CompilerServices.Unsafe - System.Security.Cryptography.Cng - System.Security.Cryptography.OpenSsl - System.Security.Principal.Windows - System.Threading.Tasks.Extensions They are only impacted on `.NETCoreApp1.0`. If we wanted to fix this we could re-baseline to the 1.0 era packages: potentially breaking where folks counted on us bringing in the 1.1 version of packages in other TFMs. Special case the dependencies only on NETCoreApp1.0 could limit this, but is still potentially breaking if folks even on NETCoreApp1.0 depended on a fix or API added in a 1.1 version of a package. In the realm of workarounds, folks can suppress the warning on NETCoreApp1.0 with `<NoWarn>$(NoWarn);NU1605</NoWarn>`, however this can result in real downgrades sneaking through. Alternatively you can lift up all of `NETStandard.Library` with `<PackageReference Include=""NETStandard.Library"" Version=""1.6.1"" />`, this bypasses the NuGet bug by lifting up every package to the 1.1 version which may be undesirable since you end up running on a mixed state. /cc @joperezr @weshaggard " 28552 area-Serialization Fix MatchingRefApiCompat issues in Serialization libraries Fixes #27981 @mconnew @huanwu @zhenlan 28553 area-System.Security Crypo transforms should truncate long initialization vectors for compatibility "TripleDESCryptoServiceProvider expects a 24 byte key and 8 byte initialization vector. In .NET Framework, if an IV longer than the algorithm's block size (8 bytes) was used, [it would be truncated](https://referencesource.microsoft.com/#mscorlib/system/security/cryptography/tripledescryptoserviceprovider.cs,101). In .NET Core, though, [an exception is thrown](https://github.com/dotnet/corefx/blob/1ce37dfb5a03e5decdb25ee67ef765f89424ceb1/src/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/TripleDesImplementation.cs#L64). This makes .NET Framework-targeted libraries that would otherwise be usable from .NET Core fail. It would be good to truncate the IV for compatibility's sake. Repro ------ Create a .NET Framework-targeted library using a too-long IV: ```CSharp public class CryptoHelper { public static string Encrypt(string input) { var key = new byte[24] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, }; // This should only be 8 bytes var iv = new byte[24] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, }; var des = new TripleDESCryptoServiceProvider(); var encryptor = des.CreateEncryptor(key, iv); var data = Encoding.UTF8.GetBytes(input); return Convert.ToBase64String(encryptor.TransformFinalBlock(data, 0 , data.Length)); } } ``` Use the library from a .NET Core application: ```CSharp Console.WriteLine(CryptoHelper.Encrypt(""Hello world!"")); ``` This results in the following exception: ``` Unhandled Exception: System.ArgumentException: Specified initialization vector (IV) does not match the block size for this algorithm. Parameter name: rgbIV at Internal.Cryptography.TripleDesImplementation.CreateTransform(Byte[] rgbKey, Byte[] rgbIV, Boolean encrypting) at Internal.Cryptography.TripleDesImplementation.CreateEncryptor(Byte[] rgbKey, Byte[] rgbIV) at System.Security.Cryptography.TripleDESCryptoServiceProvider.CreateEncryptor(Byte[] rgbKey, Byte[] rgbIV) at CryptoHelper.Encrypt(String input) at console.Program.Main(String[] args) in C:\temp\console\Program.cs:line 12 ``` If the .NET Core app targets net461 instead, however, it works! ``` C:\temp\console>type console.csproj <Project Sdk=""Microsoft.NET.Sdk""> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>net461</TargetFramework> </PropertyGroup> <ItemGroup> <Reference Include=""CryptoHelper""> <HintPath>CryptoHelper.dll</HintPath> </Reference> </ItemGroup> </Project> C:\temp\console>dotnet run jOr/uvaiDXmJ/aKNevYkgQ== ```" 28554 area-Infrastructure alpine build should be built with /p:PortableBuild=true This issue spans both `dotnet/corefx` and `dotnet/coreclr`. In order to support our runtime on musl-based distros that are not alpine, we should be building our runtime with `/p:PortableBuild=true`. This will enable loading the correct libicu and libssl that are on the distro. See - https://github.com/dotnet/corefx/blob/master/buildpipeline/pipeline.json#L52 - https://github.com/dotnet/coreclr/blob/master/buildpipeline/pipelines.json#L50 This is a follow up to: https://github.com/dotnet/core-setup/issues/3817 28556 area-System.Net Test failure: System.Net.Security.Tests / ServerAsyncAuthenticate_AllClientVsIndividualServerSupportedProtocols_Success From https://github.com/dotnet/corefx/pull/28536 OSX.1012.Amd64.Open-x64-Debug ServerAsyncAuthenticate_AllClientVsIndividualServerSupportedProtocols_Success https://mc.dot.net/#/user/dotnet-maestro-bot/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/ba6b4d98a37a5a76991d7f3a27320924081a7b24/workItem/System.Net.Security.Tests/analysis/xunit/System.Net.Security.Tests.ServerAsyncAuthenticateTest~2FServerAsyncAuthenticate_AllClientVsIndividualServerSupportedProtocols_Success(serverProtocol:%20Tls11) ```text Unhandled Exception of Type System.TimeoutException Message : System.TimeoutException : Task timed out after 240000 Stack Trace : at System.Threading.Tasks.TaskTimeoutExtensions.TimeoutAfter(Task task, Int32 millisecondsTimeout) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs:line 23 at System.Net.Security.Tests.ServerAsyncAuthenticateTest.ServerAsyncSslHelper(SslProtocols clientSslProtocols, SslProtocols serverSslProtocols, Boolean expectedToFail) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.Security/tests/FunctionalTests/ServerAsyncAuthenticateTest.cs:line 134 at System.Net.Security.Tests.ServerAsyncAuthenticateTest.ServerAsyncAuthenticate_AllClientVsIndividualServerSupportedProtocols_Success(SslProtocols serverProtocol) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.Security/tests/FunctionalTests/ServerAsyncAuthenticateTest.cs:line 95 --- End of stack trace from previous location where exception was thrown --- ``` cc @davidsh 28557 area-System.Net IPv6 addresses not correctly formatted in Host headers "The new SocketsHttpHandler does not correctly format IPv6 addresses in host headers. Repro: ``` var client = new HttpClient(); var response = await client.GetAsync(""http://[::1]:5001""); ``` Actual output: ``` GET / HTTP/1.1 Host: ::1:5001 ``` Expected output: `Host: [::1]:5001` Always include the brackets, even if there isn't a port. Code: https://github.com/dotnet/corefx/blob/f14366baaa80a893e53934b98e9786dac54c136f/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs#L124 https://github.com/dotnet/corefx/blob/f14366baaa80a893e53934b98e9786dac54c136f/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPoolManager.cs#L191-L195 Found by ASP.NET Core Kestrel functional tests. https://github.com/aspnet/KestrelHttpServer/issues/2406 Priority: Not preview blocking, but RTM blocking. @karelz " 28558 area-System.Net System.Net.Mail.Tests.SmtpClientTest.Send_SpecifiedPickupDirectory path issue The failing test case below creates a directory in the /tmp filesystem with a hard coded name. If the directory is owned by another user, the test will fails as shown in the log below. ``` xUnit.net console test runner (64-bit .NET Core) Copyright (C) 2014 Outercurve Foundation. Discovering: System.Net.Mail.Functional.Tests Discovered: System.Net.Mail.Functional.Tests Starting: System.Net.Mail.Functional.Tests System.Net.Mail.Tests.SmtpClientTest.Send_SpecifiedPickupDirectory [FAIL] System.UnauthorizedAccessException : Access to the path '/tmp/System.Net.Mail.Tests.SmtpClientTest/865ed06b-19de-41fe-a054-3c7f23bbbb1b' is denied. ---- System.IO.IOException : Permission denied Stack Trace: at System.IO.FileSystem.CreateDirectory(String fullPath) at System.IO.Directory.CreateDirectory(String path) /home/vmjenkins/workspace/Dotnet/build_corefx/src/System.Net.Mail/tests/Functional/SmtpClientTest.cs(41,0): at System.Net.Mail.Tests.SmtpClientTest.get_TempFolder() /home/vmjenkins/workspace/Dotnet/build_corefx/src/System.Net.Mail/tests/Functional/SmtpClientTest.cs(235,0): at System.Net.Mail.Tests.SmtpClientTest.Send_SpecifiedPickupDirectory() ----- Inner Stack Trace ----- Finished: System.Net.Mail.Functional.Tests === TEST EXECUTION SUMMARY === System.Net.Mail.Functional.Tests Total: 170, Errors: 0, Failed: 1, Skipped: 0, Time: 20.193s ``` 28559 area-System.Xml System.Xml.Xsl.XslTransformApi.Tests UnauthorizedAccessException System.Xml.Xsl.XslTransformApi.Tests uses the hardcoded path `/tmp/XslTransformApi` After the test has been run in an account with different privilege, the test will fail with UnauthorizedAccessException. For example see partial log below. ``` xUnit.net console test runner (64-bit .NET Core) Copyright (C) 2014 Outercurve Foundation. Discovering: System.Xml.Xsl.XslTransformApi.Tests Discovered: System.Xml.Xsl.XslTransformApi.Tests Starting: System.Xml.Xsl.XslTransformApi.Tests System.Xml.Tests.CXmlResolverTest.TC_AbsolutePath_Transform(inputType: Reader, readerType: XmlValidatingReader, transformType: Reader, docType: XPathDocument) [FAIL] System.UnauthorizedAccessException : Access to the path '/tmp/XslTransformApi/xmlResolver_document_function.xml' is denied. ---- System.IO.IOException : Permission denied Stack Trace: /home/vmjenkins/workspace/Dotnet/build_and_test/src/mscorlib/shared/Interop/Unix/Interop.IOErrors.cs(23,0): at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) /home/vmjenkins/workspace/Dotnet/build_and_test/src/mscorlib/shared/Microsoft/Win32/SafeHandles/SafeFileHandle.Unix.cs(41,0): at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) /home/vmjenkins/workspace/Dotnet/build_and_test/src/mscorlib/shared/System/IO/FileStream.cs(230,0): at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.IO.FileSystem.CopyFile(String sourceFullPath, String destFullPath, Boolean overwrite) /home/vmjenkins/workspace/Dotnet/build_corefx/src/System.Private.Xml/tests/Xslt/XslTransformApi/XSLTransform.cs(113,0): at System.Xml.Tests.XsltApiTestCaseBase.TestUsingTemporaryCopyOfResolverDocument(Action testAction) ----- Inner Stack Trace ----- System.Xml.Tests.CXmlResolverTest.TC_AbsolutePath_Transform(inputType: Reader, readerType: XmlValidatingReader, transformType: Stream, docType: XPathDocument) [FAIL] System.UnauthorizedAccessException : Access to the path '/tmp/XslTransformApi/xmlResolver_document_function.xml' is denied. ---- System.IO.IOException : Permission denied Stack Trace: /home/vmjenkins/workspace/Dotnet/build_and_test/src/mscorlib/shared/Interop/Unix/Interop.IOErrors.cs(23,0): at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) /home/vmjenkins/workspace/Dotnet/build_and_test/src/mscorlib/shared/Microsoft/Win32/SafeHandles/SafeFileHandle.Unix.cs(41,0): at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) /home/vmjenkins/workspace/Dotnet/build_and_test/src/mscorlib/shared/System/IO/FileStream.cs(230,0): at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.IO.FileSystem.CopyFile(String sourceFullPath, String destFullPath, Boolean overwrite) /home/vmjenkins/workspace/Dotnet/build_corefx/src/System.Private.Xml/tests/Xslt/XslTransformApi/XSLTransform.cs(113,0): at System.Xml.Tests.XsltApiTestCaseBase.TestUsingTemporaryCopyOfResolverDocument(Action testAction) ----- Inner Stack Trace ----- System.Xml.Tests.CXmlResolverTest.TC_AbsolutePath_Transform(inputType: Reader, readerType: XmlValidatingReader, transformType: Writer, docType: XPathDocument) [FAIL] System.UnauthorizedAccessException : Access to the path '/tmp/XslTransformApi/xmlResolver_document_function.xml' is denied. ---- System.IO.IOException : Permission denied Stack Trace: /home/vmjenkins/workspace/Dotnet/build_and_test/src/mscorlib/shared/Interop/Unix/Interop.IOErrors.cs(23,0): at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) /home/vmjenkins/workspace/Dotnet/build_and_test/src/mscorlib/shared/Microsoft/Win32/SafeHandles/SafeFileHandle.Unix.cs(41,0): at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) /home/vmjenkins/workspace/Dotnet/build_and_test/src/mscorlib/shared/System/IO/FileStream.cs(230,0): at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.IO.FileSystem.CopyFile(String sourceFullPath, String destFullPath, Boolean overwrite) /home/vmjenkins/workspace/Dotnet/build_corefx/src/System.Private.Xml/tests/Xslt/XslTransformApi/XSLTransform.cs(113,0): at System.Xml.Tests.XsltApiTestCaseBase.TestUsingTemporaryCopyOfResolverDocument(Action testAction) ----- Inner Stack Trace ----- ``` 28560 area-Infrastructure Support musl-libc based linux RIDs - Add `linux-musl` RID - Set `alpine`'s parent to `linux-musl` - Add `alpine.3.7` to the graph - Fix up `android` to inherit from `unix` while we are here Fixes https://github.com/dotnet/core-setup/issues/3817 QUESTION: Is `linux-musl` the correct name for this RID? Do we like the order of the two words? Is using a hyphen to separate them acceptable? /cc @Petermarcu 28562 area-Infrastructure Produce Windows PDBs when building for netfx and in a Windows OS From: https://github.com/dotnet/corefx/pull/28059/files When testing in NETFX we need to produce Windows PDBs to get detailed stack traces with file name and line numbers. cc: @weshaggard @danmosemsft 28563 area-System.Net Several minor sockets tweaks As part of investigating a race condition, noticed a few things to be slightly improved or commented. cc: @geoffkizer 28564 area-System.Threading Re-enable GetTaskSchedulersForDebugger test Fixes #28539 28566 area-Infrastructure Nuget Microsoft.AspNetCore.Mvc.Core detected package downgrade "_From @mcm-ham on March 22, 2018 11:33_ I have a library project called WebApp.Auth.Sso.Abstractions with this as the csproj: ``` <Project Sdk=""Microsoft.NET.Sdk""> <PropertyGroup> <TargetFramework>netstandard2.0</TargetFramework> </PropertyGroup> <ItemGroup> <PackageReference Include=""Microsoft.AspNetCore.Mvc.Core"" Version=""2.0.3"" /> </ItemGroup> </Project> ``` And when I run `dotnet restore` it works but when I run `dotnet restore -r win81-x64` I get this error: ``` Error NU1605 Detected package downgrade: System.IO.FileSystem.Primitives from 4.3.0 to 4.0.1. Reference the package directly from the project to select a different version. WebApp.Auth.Sso.Abstractions -> Microsoft.AspNetCore.Mvc.Core 2.0.3 -> Microsoft.Extensions.DependencyModel 2.0.3 -> Microsoft.DotNet.PlatformAbstractions 2.0.3 -> System.IO.FileSystem 4.0.1 -> runtime.win.System.IO.FileSystem 4.3.0 -> System.IO.FileSystem.Primitives (>= 4.3.0) WebApp.Auth.Sso.Abstractions -> Microsoft.AspNetCore.Mvc.Core 2.0.3 -> Microsoft.Extensions.DependencyModel 2.0.3 -> Microsoft.DotNet.PlatformAbstractions 2.0.3 -> System.IO.FileSystem 4.0.1 -> System.IO.FileSystem.Primitives (>= 4.0.1) ``` _Copied from original issue: aspnet/Mvc#7527_" 28568 area-Infrastructure Update SDK to 2.1.300-preview2-008530 28571 area-System.Net Enable digest test runs on CurlHandler. Now that the authentication test failures have been diagnosed, re-enable most of the Digest authentication test cases on CurlHandler. Two additional cases had to be moved to the SocketsHttpHandler only tests, since they fail on CurlHandler and do not have fixes yet. The digest test cases have to use credentials without a domain when run against CurlHandler. This is because Curl does not allow us to set the realm parameter used to send the domain along with a digest authorization header. We could alternatively try to use the down level login name as the username, but it appears that there is a bug in the Curl escaping logic that causes backslashes in the username to be duplicated. I plan to open an issue in the Curl repo once things are a bit less busy. All of the test cases that are SocketsHttpHandler only are now tracked by individual issues, so I think with this we can close #28065. 28572 area-Infrastructure Update netfx queues to use rs3 machines with .net471 installed This updates the official build target queue for netfx tests to use the RS3 queue that just recently got upgraded to .net471 This also changes the NETFX CI leg to use Helix queues to run tests instead of running them in the CI machine, this for the same purpose, to have upgraded net471 machines. Related to: https://github.com/dotnet/core-eng/issues/2745 cc: @MattGal @weshaggard @danmosemsft @stephentoub @mmitche 28573 area-Infrastructure Prevent CMake 2.8 tests failing for unused variable (causing millisec to be dropped from stat calls) "Fix https://github.com/dotnet/corefx/issues/27662 which only reproduced with bits built from official build machines. The millisecond part of the stat structs can appear in several forms or possibly not be available so we probe for it with CMake's such: ```c check_struct_has_member( ""struct stat"" st_atim ""sys/types.h;sys/stat.h"" HAVE_STAT_TIM) ``` This was failing on the official build machines even though st_atim is present in the struct. The cause can be found in `corefx/bin/obj/Linux.x64.Debug/native/CMakeFiles/CMakeError.log` ``` Building C object CMakeFiles/cmTryCompileExec161514853.dir/src.c.o /usr/local/bin/clang-3.9 -std=gnu99 -D_GNU_SOURCE -DHAVE_STAT_TIM -Werror -o CMakeFiles/cmTryCompileExec161514853.dir/src.c.o -c /root/corefx/bin/obj/Linux.x64.Debug/native/CMakeFiles/CMakeTmp/src.c /root/corefx/bin/obj/Linux.x64.Debug/native/CMakeFiles/CMakeTmp/src.c:8:9: error: expression result unused [-Werror,-Wunused-value] tmp->st_atim; ~~~ ^~~~~~~ 1 error generated. gmake[1]: *** [CMakeFiles/cmTryCompileExec161514853.dir/src.c.o] Error 1 ``` This is because the test code is like this: ```c #include <sys/types.h> #include <sys/stat.h> int main() { struct stat* tmp; tmp->st_atim; return 0; } ``` In later versions of CMake it looks like this which avoids the warning/error. ```c int main() { (void)sizeof(((struct stat *)0)->st_atim); return 0; } ``` The fix is to specifically disable warning as error for this diagnostic. I verified this fixes it on the build machine: ``` -- Performing Test HAVE_STAT_TIM -- Performing Test HAVE_STAT_TIM - Success ``` The main reason this took some time to root cause (other than it not reproing locally or in CI) was that I did not realize the official builds build in docker containers in order to achieve a portable build on Centos 7. So when I built on the official build boxes, I was picking up cmake version 3.5.1 rather than 2.8.12.2." 28574 area-Infrastructure code coverage runs timing out 3 hour time limit being exceeded now eg in https://ci.dot.net/job/dotnet_corefx/job/master/job/code_coverage_windows/507/consoleFull#-11168565952d31e50d-1517-49fc-92b3-2ca637122019 09:43:41 tests start 12:34:14 timeout These two are the worst offenders 09:49:02 Starting: System.Collections.Performance.Tests 10:41:47 Finished: System.Collections.Performance.Tests 11:51:09 Starting: System.Numerics.Vectors.Performance.Tests 12:10:01 Finished: System.Numerics.Vectors.Performance.Tests We need to disable perf tests from code coverage runs. @safern can you please do this? Is there a trait? cc @stephentoub @benaadams as they have flagged this before 28575 area-Infrastructure Updating CoreFx dependencies to servicing-26329-01 28577 area-System.Net Reduce buffering in ManagedWebSocket.ReceiveAsync Today we use a big-ish receive buffer (4K) in ManagedWebSocket, reading all data into the receive buffer and then copying from there into the caller-provided destination buffer. With this change, we assume that the underlying stream is providing the desired level of buffering, and thus only use a 125-byte buffer, just big enough to handle message headers and control payloads (the latter for simplicity, as no caller-supplied buffer is available there). Fixes https://github.com/dotnet/corefx/issues/28445 cc: @davidfowl, @geoffkizer, @anurse 28578 area-System.Net Fix ipv6 address format in Host header Per discussion in #28557. If this change looks ok, I will fix the WinHttp as well. Fix: #28557 28580 area-Infrastructure Getting build error in VS for Microsoft.CSharp "I did a pull, a full build via the command line, and then opened Microsoft.CSharp. Actually, I may have run build.sh and build.cmd, which is pretty much the same, right? I opened the solution in VS and tried to build, but this is the error I am getting: > The target ""Build"" does not exist in the project." 28582 area-System.Numerics Improve Quaternion test failure messages From https://github.com/dotnet/corefx/pull/25510 28584 area-System.Security TestKeyAgreesRecipientIdType_RoundTrip failing in CI with WindowsCryptographicException on Win7 From https://github.com/dotnet/corefx/pull/28582 Windows.7.Amd64.Open-x64-Debug https://mc.dot.net/#/user/benaadams/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/55bf1b5b0f691c9d6f223c60cbeb2fc46bf746cc/workItem/System.Security.Cryptography.Pkcs.Tests/analysis/xunit/System.Security.Cryptography.Pkcs.EnvelopedCmsTests.Tests.KeyAgreeRecipientInfoTests~2FTestKeyAgreesRecipientIdType_RoundTrip ```text Unhandled Exception of Type Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException Message : Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException : An internal error occurred Stack Trace : at Internal.Cryptography.Pal.Windows.PkcsPalWindows.EncodeHelpers.CreateCryptMsgHandleToEncode(CmsRecipientCollection recipients, Oid innerContentType, AlgorithmIdentifier contentEncryptionAlgorithm, X509Certificate2Collection originatorCerts, CryptographicAttributeObjectCollection unprotectedAttributes) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Security.Cryptography.Pkcs\src\Internal\Cryptography\Pal\Windows\PkcsPalWindows.Encrypt.cs:line 80 at Internal.Cryptography.Pal.Windows.PkcsPalWindows.Encrypt(CmsRecipientCollection recipients, ContentInfo contentInfo, AlgorithmIdentifier contentEncryptionAlgorithm, X509Certificate2Collection originatorCerts, CryptographicAttributeObjectCollection unprotectedAttributes) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Security.Cryptography.Pkcs\src\Internal\Cryptography\Pal\Windows\PkcsPalWindows.Encrypt.cs:line 25 at System.Security.Cryptography.Pkcs.EnvelopedCms.Encrypt(CmsRecipientCollection recipients) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Security.Cryptography.Pkcs\src\System\Security\Cryptography\Pkcs\EnvelopedCms.cs:line 109 at System.Security.Cryptography.Pkcs.EnvelopedCms.Encrypt(CmsRecipient recipient) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Security.Cryptography.Pkcs\src\System\Security\Cryptography\Pkcs\EnvelopedCms.cs:line 92 at System.Security.Cryptography.Pkcs.EnvelopedCmsTests.Tests.KeyAgreeRecipientInfoTests.EncodeKeyAgreel(SubjectIdentifierType type) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Security.Cryptography.Pkcs\tests\EnvelopedCms\KeyAgreeRecipientInfoTests.cs:line 361 at System.Security.Cryptography.Pkcs.EnvelopedCmsTests.Tests.KeyAgreeRecipientInfoTests.TestKeyAgreesRecipientIdType_RoundTrip() in D:\j\workspace\windows-TGrou---74aa877a\src\System.Security.Cryptography.Pkcs\tests\EnvelopedCms\KeyAgreeRecipientInfoTests.cs:line 66 ``` cc @bartonjs 28585 area-System.Net Investigate IDN mapping rules when parsing/writing server name SslStream Windows implementation does not map special characters when sending host name in the client hello extension and sends utf-8 characters instead. Note: This does not affect HttpClient scenario which does IDN mapping higher up the stack, only SslStream scenario is affected. SSL protocol recommends that host name should be send by a client. Host name should be send using one of the client hello extensions. Recommended data flow is following: ``` [CLIENT] ---> Possibly non-ASCII string --- IDN MAPPING ---> ASCII string ---> UTF8 BYTES ---> ASCII string --- IDN UNMAPPING ---> Possibly non-ASCII string ---> [SERVER logic] ``` Current windows Implementation seems to be skipping IDN mapping and does following instead: ``` [CLIENT] ---> Possibly non-ASCII string ---> UTF8 BYTES ---> ASCII string --- IDN UNMAPPING ---> Possibly non-ASCII string ---> [SERVER logic] ``` Recently merged server logic implementation (https://github.com/dotnet/corefx/pull/28278) does following to mitigate the problem: ``` UTF8 BYTES ---> Possibly non-ASCII string or IDN mapped string ---> IDN UNMAPPING ---> Succeeded? ---> Possibly non-ASCII string ---> [SERVER logic] | | ^ | (See: SniHelper.DecodeString) | NO | +---------------------------------------------->-------------------+ ``` To sum up: - [ ] client on Windows does not seem to be doing IDN mapping before sending (investigate if this is correct and if not fix) - [ ] investigate if described above fallback is ok or if it should return null instead (with the current client implementation no fallback means we can't roundrip non-ascii characters) Related test case (passes with the fallback): https://github.com/dotnet/corefx/pull/28278/files#diff-dbaea2525913714cf555096c8af14a03R21 with following test data: https://github.com/dotnet/corefx/pull/28278/files#diff-dbaea2525913714cf555096c8af14a03R132 On the OpenSSL side we do the conversion explicitly: https://github.com/dotnet/corefx/blob/c533892f2e57940ec9e66616288bf340b75a9217/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSsl.cs#L129 while on Windows we seem to be passing directly: https://github.com/dotnet/corefx/blob/c533892f2e57940ec9e66616288bf340b75a9217/src/Common/src/Interop/Windows/sspicli/SecuritySafeHandles.cs#L595 2.0.0 code also does the same thing: https://github.com/dotnet/corefx/blob/release/2.0.0/src/Common/src/Interop/Windows/sspicli/SecuritySafeHandles.cs#L596 Windows documentation doesn't seem to be specifying if it does the conversion for you or not (https://msdn.microsoft.com/en-us/library/windows/desktop/aa375924(v=vs.85).aspx): ``` pszTargetName [in, optional] A pointer to a null-terminated string that uniquely identifies the target server. Schannel uses this value to verify the server certificate. Schannel also uses this value to locate the session in the session cache when reestablishing a connection. The cached session is used only if all of the following conditions are met: The target name is the same. The cache entry has not expired. The application process that calls the function is the same. The logon session is the same. The credential handle is the same. ``` 28587 area-System.Net CurlHandler is deadlocking like WinHttpHandler This repros consistently for Release on High Sierra. Issue #27746 already tracks it. Issue tracking the hanging in macOS is #28116 28588 area-System.Net enable tcp keep-alive on curl handler "fixes #28119 This is outcome of investigation not originally reported on github. Patch was provided to customer and we verified that it fixes observed issue. Observed delay is caused by retransmits and timeout in cases when upstream Azure firewall cuts connection without sending FIN or RST. curl on OSX is build agains ressl and in that case we create singleton under the cover. Because of that, normal tricks to dispose and recycle HttpHandler or HttpClinet don't work and curl was using connections even after very long idle time. When tested on Ubuntu, the keep-alive message were sent because of enabled by OS. This change is currently not OSX specific - it would make all NIX system consistent - either with keep-alive enable by OS or by curl handler it self. All that is handled as OS level and it will not impact any of our I/O operations. Also note that this will happen only on idle connection so that should not be really impact under ""normal"" use. " 28590 area-System.Diagnostics ProcessStartInfo.WorkingDirectory is not working We have an application which starts several processes (all .NET Core 2.0 console app). We set the `ProcessStartInfo.WorkingDirectory` to ensure that the current directory is the one of the started executable but it does not work: the `GetCurrentDirectory` remains the one of the application that invokes the `Process.Start()`. We do a `Directory.SetCurrentDirectory` in the started application as a workaround. .NET Core 2.1.101 28591 area-System.Runtime DllImport and current directory "We need to start several processes from a single application (all .NET Core 2.0 console app) using `Process.Start` and `ProcessStartInfo`. First, we found this [issue](https://github.com/dotnet/corefx/issues/28590) about `ProcessStartInfo.WorkingDirectory` which seems to not work. Now that we use `Directory.SetCurrentDirectory` in the started application, .NET assemblies are well resolved/loaded but we have another error with a `DllImport` which cannot load the native dll: `System.DllNotFoundException: Unable to load DLL '***' : The specified module could not be found. (Exception from HRESULT: 0x8007007E)` The dll is of course in the same directory as its executable. I have tried to add a `SetCurrentDirectory` + `SetDllDirectory` in the Main method w/o any effects. And also added the directory in the PATH. Of course, everything ""works on my machine"" (windows 10, .NET Core SDK 2.1.103) and it only happens in the staging env (windows server 2016 .NET Core SDK 2.1.101). So to summarize: - If the app is started from the CLI using `dotnet ***.dll`, it _works from any directory_ - If the app is started the same way from another process using `Process.Start()`, it **fails** - If the app is published as an executable, it _works using the CLI from its current directory_ But it **fails from the parent directory** and of course, also using `Process.Start()` (which is the excpected use case) Last detail: the DllImport is done in the context of an `Activator.CreateInstance` (using Windsor)" 28593 area-Meta Replace identical files with CoreLib mirror "contributes to #27841 Thank's to @EgorBo i removed 100% identical files from Common folder with CoreLib mirror. ---RESOLVED--- Anyway there is one file left out: `corefx\src\Common\src\System\Threading\Tasks\TaskToApm.cs` in `corefx\src\System.Net.Http\src\System.Net.Http.csproj` if i try to substitute with ``` c# <Compile Include=""$(CommonPath)\CoreLib\System\Threading\Tasks\TaskToApm.cs""> <Link>Common\CoreLib\System\Threading\Tasks\TaskToApm.cs</Link> </Compile> ``` i get this error when compile: ``` CSC : error CS2001: Source file '...\corefx\src\Common\src\System\Threading\Tasks\TaskToApm.cs' could not be found. [...\corefx\src\System.Net.Http\src\System.Net.Http.csproj] ``` @karelz what i'm missing? ---RESOLVED--- cc: @danmosemsft Tested on Win/Ubuntu " 28594 area-System.ComponentModel Proposal: new System.ComponentModel.VersionConverter class "## Rationale and Usage Converting between `System.Version` and `string` is currently not supported using a `System.ComponentModel.TypeConverter`. Many system types are supported out of the box (System.DateTimeOffset, System.Guid, System.TimeSpan, System.Uri etc.) so I think System.Version would be a welcome addition. I was expecting this to work, but converting from string actually throws `NotSupportedException`: TypeConverter cannot convert from System.String. ```csharp using System.ComponentModel; using System.Diagnostics; TypeConverter versionConverter = TypeDescriptor.GetConverter(typeof(Version)); Version version = versionConverter.ConvertFromString(""1.2.3.4"") as Version; Trace.Assert(version.Major == 1); Trace.Assert(version.Minor == 2); Trace.Assert(version.Build == 3); Trace.Assert(version.Revision == 4); ``` ## Proposed API ```csharp public partial class VersionConverter : System.ComponentModel.TypeConverter { public VersionConverter(); public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type sourceType); public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType); public override object ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value); public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType); public override bool IsValid(System.ComponentModel.ITypeDescriptorContext context, object value); } ``` ## Details Converting between `string` and `System.Version` is very straightforward, implementation would be very similar to `GuidConverter` or `UriTypeConverter`. ## Open Questions * What exception should be thrown when the string to convert is not valid, for example `""1""`? Other converters just let the constructor of the type throw the exception. ```csharp var uriConverter = System.ComponentModel.TypeDescriptor.GetConverter(typeof(Uri)); uriConverter.ConvertFromString(""mailto:User@""); // throws UriFormatException ``` ```csharp var guidConverter = System.ComponentModel.TypeDescriptor.GetConverter(typeof(Guid)); guidConverter.ConvertFromString(""xxxx""); // throws FormatException ``` For `System.Version`, that would mean throwing an `ArgumentException` which is less descriptive than a `FormatException`. * Should the converter be registered with other `IntrinsicTypeConverters` (is System.Version an intrinsic type?) or should the converter be registered with the `TypeConverterAttribute` on the `System.Version` class? ## Pull Request A pull request with the proposed changes is available: #28516 " 28595 area-System.Collections Move Hashtable & friends to shared parition Depends on https://github.com/dotnet/coreclr/pull/17316 for HashHelpers convergance. cc @ianhays @safern as area owners. 28597 area-Infrastructure Build fails with System.Threading.Tasks.Extensions.4.4.0 "I attached simple sample project - just empty class library with one dependency `System.Threading.Tasks.Extensions.4.4.0`. Build from Visual Studio works fine, but if you try to build solution via msbuild (Build.bat near solution file) then build fails. ``` ""c:\Projects\ClassLibrary1\ClassLibrary1\ClassLibrary1.csproj"" (Rebuild target) (2) -> (ImplicitlyExpandNETStandardFacades target) -> C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\Micro soft.NET.Build.Extensions.NETFramework.targets(65,5): error MSB4062: The ""NETBuildExtensionsError"" task could not be lo aded from the assembly C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\Microsoft.NET.B uild.Extensions\\tools\net46\Microsoft.NET.Build.Extensions.Tasks.dll. Confirm that the <UsingTask> declaration is cor rect, that the assembly and all its dependencies are available, and that the task contains a public class that implemen ts Microsoft.Build.Framework.ITask. [c:\Projects\ClassLibrary1\ClassLibrary1\ClassLibrary1.csproj] ``` The issue is not reproduced with System.Threading.Tasks.Extensions.4.3.0 [ClassLibrary1.zip](https://github.com/dotnet/corefx/files/1860435/ClassLibrary1.zip) " 28598 area-System.Drawing Reenable SetHdevmode_IntPtr_Success test "https://github.com/dotnet/corefx/issues/26637 This test normally passes unless the machine's default printer is set to something that doesn't support multiple copies (or duplex or collate settings.) In that case, the printer serves up a DEVMODE structure whose ""dmFields"" flags indicate the absence of those fields and thus, the meaningless property does not get populated in the DEVMODE. Given that 1. this is the existing NETFX behavior. 2. there's no other obvious value to put in these properties when the printer doesn't support them. Perhaps these properties should have been nullable properties but that horse has long left the barn. 3. The purpose of the Hdevmode_IntPtr apis is not cloning PrinterSettings (PrinterSettings explicitly supports a Clone() method for that purpose.) The test is just using it that way as a way of validating the HDevMode_IntPtr apis in the best way it can in a generic unit test run on uncontrolled machines. I'm just changing the test to use a known printer type that works rather than trusting the default." 28600 area-Infrastructure Fix package testing infrastructure and fix issues. This gets the package validation testing running again and fixes all current issues. Best reviewed commit-by-commit. 28602 area-Infrastructure Error when creating nuget [packed | lib] package. System.IO.FileNotFoundException: File not found Opened on behalf of @jcagme Warnings: 2 Status Message: failed Build : Master - 20180329.06 (Product Build) Failing configurations: - Windows - PortableBuild-Checked-x86 - PortableBuild-Checked-arm - PortableBuild-Release-x64 [Mission Control Build Info](https://mc.dot.net/#/product/netcore/master/source/official~2Fcoreclr~2Fmaster~2F/type/build~2Fproduct~2F/build/20180329.06/workItem/Orchestration/analysis/external/Link) 28603 area-System.Net SocketsHttpHandler not debuggable As I've been troubleshooting various issues with the new SocketsHttpHandler the largest barrier has been the lack of diagnostic visibility into what's going on while it processes requests. There is a DiagnosticHandler, but it's a wrapper around SocketsHttpHandler, it doesn't give visibility into the internal operations or final output. https://github.com/dotnet/corefx/blob/45fb8a627e727df337580291b45317ee5e66b5a5/src/System.Net.Http/src/System/Net/Http/HttpClientHandler.Windows.cs#L481 Nor does SocketsHttpHandler work with Fiddler. Is this an issue with auto-proxy detection? Or is there an issue with bypassing proxies on localhost? This is a significant development blocker. Being able to see the requests as they're emitted to the wire can help troubleshoot formatting issues, redirects, auth, etc.. The hoops I had to jump through to capture the output for https://github.com/dotnet/corefx/issues/28557 were excessive. Similar diagnostic deficiencies are hindering the evaluation of a new issue https://github.com/aspnet/HttpSysServer/issues/439. With net4x HttpWebRequest by comparison I could enable full logging of every byte output to a Socket, before or after SSL, as well as HTTP level logs about overall protocol flow. Microsoft Message Analyzer is the next best option for capturing localhost traffic, though their current installer appears to be broken, and it's less than ideal for SSL scenarios. @karelz @geoffkizer 28604 area-System.Net WIP: Checking status of Large Payload 307 test failure Not to merge just to get updated callstacks for failures of this test (see #23768) 28605 area-System.Net PlatformNotSupported thrown by SystemWebProxy I know this is obviously intentional but is poor and should be reconsidered for alternatives such as returning a marker instead of throwing and catching an exception. > System.PlatformNotSupportedExceptio > HResult=0x80131539 > Message=Operation is not supported on this platform. > Source=System.Net.Requests > StackTrace: > at System.Net.SystemWebProxy.GetProxy(Uri destination) https://github.com/dotnet/corefx/blob/master/src/System.Net.Requests/src/System/Net/SystemWebProxy.cs#L50-L53 ```c# public Uri GetProxy(Uri destination) { throw new PlatformNotSupportedException(); } ``` [EDIT] Fix link by @karelz 28606 area-Meta Insertion of master to CLI is failing "https://github.com/dotnet/cli/pull/8901 stack trace: ``` D:\j\workspace\debug_windows---8a02d2bd\build\BundledDotnetTools.proj(24,5): error MSB4018: The ""DotNetRestore"" task failed unexpectedly. [D:\j\workspace\debug_windows---8a02d2bd\build.proj] 23:12:07 D:\j\workspace\debug_windows---8a02d2bd\build\BundledDotnetTools.proj(24,5): error MSB4018: System.IndexOutOfRangeException: Index was outside the bounds of the array. [D:\j\workspace\debug_windows---8a02d2bd\build.proj] 23:12:07 D:\j\workspace\debug_windows---8a02d2bd\build\BundledDotnetTools.proj(24,5): error MSB4018: at System.Collections.Generic.Dictionary`2.KeyCollection.CopyTo(TKey[] array, Int32 index) [D:\j\workspace\debug_windows---8a02d2bd\build.proj] 23:12:07 D:\j\workspace\debug_windows---8a02d2bd\build\BundledDotnetTools.proj(24,5): error MSB4018: at System.Diagnostics.Process.GetEnvironmentVariablesBlock(IDictionary`2 sd) [D:\j\workspace\debug_windows---8a02d2bd\build.proj] 23:12:07 D:\j\workspace\debug_windows---8a02d2bd\build\BundledDotnetTools.proj(24,5): error MSB4018: at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) [D:\j\workspace\debug_windows---8a02d2bd\build.proj] 23:12:07 D:\j\workspace\debug_windows---8a02d2bd\build\BundledDotnetTools.proj(24,5): error MSB4018: at System.Diagnostics.Process.Start() [D:\j\workspace\debug_windows---8a02d2bd\build.proj] 23:12:07 D:\j\workspace\debug_windows---8a02d2bd\build\BundledDotnetTools.proj(24,5): error MSB4018: at Microsoft.Build.Utilities.ToolTask.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [D:\j\workspace\debug_windows---8a02d2bd\build.proj] 23:12:07 D:\j\workspace\debug_windows---8a02d2bd\build\BundledDotnetTools.proj(24,5): error MSB4018: at Microsoft.Build.Utilities.ToolTask.Execute() [D:\j\workspace\debug_windows---8a02d2bd\build.proj] ```" 28609 area-System.Net SocketsHttpHandler: Proxied IPv6 requests have incorrectly formatted host/port in request line "On WinHttpHandler, we will append [] around the IPv6 address. ""GET http://[::1234]/ HTTP/1.1"", ""Proxy-Connection: Keep-Alive"", ""Host: [::1234]"" On SocketsHttpHandler, currently we don't: ""GET http://::1234/ HTTP/1.1"", ""Host: [::1234]"" Also, if we specify a port number, SocketsHttpHandler will strip that in the uri send to the proxy as well. WinHttpHandler: In value: List<String> [""GET http://[::1234]:8080/ HTTP/1.1"", ""Proxy-Connection: Keep-Alive"", ""Host: [::1234]:8080""] SocketsHttpHandler: In value: List<String> [""GET http://::1234/ HTTP/1.1"", ""Host: [::1234]:8080""]" 28610 area-System.Net Make it clear that the default proxy cannot by set via environment variable on Windows This test was tagged with an active issue disabling it on Windows, but the behavior is actually by design. Quoting @davidsh: > The default for .NET Framework is to use WinINET-style (IE registry setttings) to find the default proxy. There has never been a concept for using environment variables on Windows. It might be an interesting idea to add environment variables which could override the WinINET-style proxy settings. But that seems like a new feature for .NET Core. We would want to have those variables be appropriately named. In some ways, this would provide the ability for easier machine-wide proxy settings which has been requested by users in the past. WinINET-style settings are only available for interactive user accounts on Windows, i.e. those accounts with those registry settings. Background service accounts like those used in NT-style services don't have those settings by default. So, adding environment variables might be a useful thing. I agree that we should look into adding support for default proxies set via environment variable, but for now I think we should just make it clear this isn't a bug. Fixes: #25640 28611 area-System.Globalization en_us.POSIX locale environment for .NET Core on Linux "Does .NET Core support Linux in en_us.POSIX locale environment? Based on [this commit](https://github.com/dotnet/corefx/commit/513efd86d5fb290098d6823b7b847cf50dd01951), which adds a regression test for a bug fix and it invokes CultureInfo(""en-US-POSIX""). However, my team has run into a fundamental problem running .NET Core tests in Linux with en_us.POSIX locale. We have no issue with the en_us.UTF8 locale. For example, string.Compare() does not work properly in case-sensitive comparison. - string.Compare(""C03DATE"", ""C03DATE"", true) return zero, which is expected - string.Compare(""c03DATE"", ""C03DATE"", true) return non-zero, which is not expected because it is case-insensitive comparison. Third parameter is true. In other locales, this method returns zero. Thanks to @divega for providing some initial help on this question." 28612 area-Meta Consume the new C# 7.3 constraints if/where possible C# 7.3 is adding support for three new constraints: * `unmanaged` * `Delegate`/`MulticastDelegate` * `Enum` There are several APIs in CoreFX/CoreCLR which are emulating these constraints via runtime checks. If possible (since it would be a compile time breaking change), it would be nice to update these methods to use the proper constraints where appropriate. A simple `git grep TDelegate` and `git grep TEnum` will display the majority of these APIs. 28613 area-System.Threading Fix thread constructor test on newer kernels Works around and closes https://github.com/dotnet/coreclr/issues/17170 - Works around an issue on linux-arm64 where pthread_create appears to reserve less stack space than requested without failing, and limits the max reserved stack size to the ulimit-configued value, leading to seg fault when the requested size of stack space is attempted to be used - Fixed to write every page in the stack region that is being checked, to guarantee hitting the guard page in case of failure. The JIT's stack probe for stackalloc should cover this, https://github.com/dotnet/coreclr/issues/16827 details why that was not happening, in any case this test is not intended to test stack probing behavior, so this change makes the test a bit stronger in what it actually intends to test. @sdmaclea @janvorli 28614 area-System.Runtime AppDomain SetPrincipalPolicy not implemented corefx/src/System.Runtime.Extensions/src/System/AppDomain.cs public void SetPrincipalPolicy(PrincipalPolicy policy) { } This is clearly unimplemented. Maybe [ObsoleteAttribute] could be added to spare people frustration. 28620 area-Infrastructure CoreFx test utility depends on Microsoft.DotNet.PlatformAbstractions @krwq @tarekgh @eerhardt added a dependency on Microsoft.DotNet.PlatformAbstractions to CoreFx.TestUtilities in https://github.com/dotnet/corefx/pull/24531. That cause a cycle in our build-from-source efforts so we have to figure out a solution to break that cycle. For now I'm going to break the cycle by pinning to an existing version but we cannot do that in general because it requires us to have an existing binary which is bad for new-distro bring-up. @eerhardt what is your thoughts on bring Microsoft.DotNet.PlatformAbstractions into corefx? 28621 area-Infrastructure These definitions have been deprecated by the vsts maintenance jobs. Related to issue: https://github.com/dotnet/core-eng/issues/2964 28622 area-Infrastructure These definitions have been deprecated by the vsts maintenance jobs. Related to issue: https://github.com/dotnet/core-eng/issues/2964 28625 area-System.Security RsaDecryptPkcs1WrongDataLength failing in CI with Assert.Throws() Failure on Debian From https://github.com/dotnet/corefx/pull/28615 Debian.87.Amd64.Open-x64-Release https://mc.dot.net/#/user/dotnet-bot/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/a9913ea9b9bd68f11ca8707204b7d20a6ab98cf9/workItem/System.Security.Cryptography.Csp.Tests/analysis/xunit/System.Security.Cryptography.Rsa.Tests.EncryptDecrypt_Span~2FRsaDecryptPkcs1WrongDataLength ```text Unhandled Exception of Type Xunit.Sdk.ThrowsException Message : Assert.Throws() Failure Expected: typeof(System.Security.Cryptography.CryptographicException) Actual: (No exception was thrown) Stack Trace : at System.Security.Cryptography.Rsa.Tests.EncryptDecrypt.RsaDecryptPkcs1WrongDataLength() in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/src/Common/tests/System/Security/Cryptography/AlgorithmImplementations/RSA/EncryptDecrypt.cs:line 489 ``` cc @bartonjs 28626 area-System.Security Make TripleDESCryptoServiceProvider CreateTransform behave like netfx .NET Framework's TripleDESCryptoServiceProvider rejects small inputs, but accepts oversized IVs (effectively truncating them to the block size). This change makes the .NET Core type behave the same way, and adds a test to codify all of the oversized IV relationships with the CryptoServiceProvider compat types. (DES and RC2 apparently already allowed it) Fixes #28553. 28630 area-System.Diagnostics Test failure: System.Diagnostics.Process.Tests "(I'm new, so maybe I'm totally missing something, but I'm following the instructions as best I can and I keep getting test errors.) So I (successfully) ran the build, made some changes to some libraries and started experiencing some issues. I wanted to get back to a good state, so I did > git checkout master > clean -all > build-tests.cmd # Failed with lots of errors, cause I should have run build first. > build.cmd # Success > build-tests.cmd Error: > D:\Repos\dotnet\corefx\dir.traversal.targets(77,5): error : (No message specified) [D:\Repos\dotnet\corefx\src\tests.builds] > > Build FAILED. > > D:\Repos\dotnet\corefx\Tools\tests.targets(492,5): warning : System.Diagnostics.Process.Tests Total: 254, Errors: 0, Failed: 1, Skipped: 2, Time: 68.485s [D:\Repos\dotnet\corefx\src\System.Diagn > ostics.Process\tests\System.Diagnostics.Process.Tests.csproj] > D:\Repos\dotnet\corefx\Tools\tests.targets(492,5): warning MSB3073: The command ""D:\Repos\dotnet\corefx\bin/tests/System.Diagnostics.Process.Tests/netcoreapp-Windows_NT-Debug-x64//RunTests.cmd D:\Re > pos\dotnet\corefx\bin/testhost/netcoreapp-Windows_NT-Debug-x64/"" exited with code 1. [D:\Repos\dotnet\corefx\src\System.Diagnostics.Process\tests\System.Diagnostics.Process.Tests.csproj] > D:\Repos\dotnet\corefx\Tools\tests.targets(500,5): error : One or more tests failed while running tests from 'System.Diagnostics.Process.Tests' please check D:\Repos\dotnet\corefx\bin/tests/System.D > iagnostics.Process.Tests/netcoreapp-Windows_NT-Debug-x64/testResults.xml for details! [D:\Repos\dotnet\corefx\src\System.Diagnostics.Process\tests\System.Diagnostics.Process.Tests.csproj] > D:\Repos\dotnet\corefx\dir.traversal.targets(77,5): error : (No message specified) [D:\Repos\dotnet\corefx\src\tests.builds] > 2 Warning(s) > 2 Error(s) ""testResults.xml"" does not exist in the specified location. With build.cmd taking 8 minutes and build-tests.cmd taking 14 minutes, debugging this blindly just isn't going to work. (On a Quad-core, 16 GB RAM, SSD) I'm currently on > commit 22d053f88c619199b38da4a098e47a087cf98c56 (HEAD -> master, origin/master, origin/HEAD) > Author: Jan Kotas <jkotas@microsoft.com> > Date: Wed Mar 28 15:46:00 2018 -0700 > > Delete workaround for ComImport types on Unix (#28518) > > https://github.com/dotnet/coreclr/issues/16804 is fixed. We do not need the workaround anymore. Ideas? In the meantime, I'll pull the latest and then run clean (do I need to do this?), build and build-tests again." 28631 area-System.Security CI tests failing with WindowsCryptographicException on Windows10 https://mc.dot.net/#/user/dotnet-bot/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/a9913ea9b9bd68f11ca8707204b7d20a6ab98cf9/workItem/System.Net.Http.WinHttpHandler.Unit.Tests Windows.10.Amd64.Open-x64-Debug ```text Unhandled Exception of Type Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException Message : Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException : The profile for the user is a temporary profile Stack Trace : at Internal.Cryptography.Pal.CertificatePal.FilterPFXStore(Byte[] rawData, SafePasswordHandle password, PfxCertStoreFlags pfxCertStoreFlags) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Security.Cryptography.X509Certificates\src\Internal\Cryptography\Pal.Windows\CertificatePal.Import.cs:line 153 at Internal.Cryptography.Pal.CertificatePal.FromBlobOrFile(Byte[] rawData, String fileName, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Security.Cryptography.X509Certificates\src\Internal\Cryptography\Pal.Windows\CertificatePal.Import.cs:line 88 at Internal.Cryptography.Pal.CertificatePal.FromBlob(Byte[] rawData, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Security.Cryptography.X509Certificates\src\Internal\Cryptography\Pal.Windows\CertificatePal.Import.cs:line 21 at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(Byte[] rawData, String password, X509KeyStorageFlags keyStorageFlags) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X509Certificate.cs:line 81 at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(Byte[] rawData, String password) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X509Certificate.cs:line 62 at System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(Byte[] rawData, String password) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X509Certificate2.cs:line 51 at System.Net.Http.WinHttpHandlerUnitTests.ClientCertificateHelper..ctor() in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http.WinHttpHandler\tests\UnitTests\ClientCertificateHelper.cs:line 14 at System.Net.Http.WinHttpHandlerUnitTests.ClientCertificateScenarioTest.get_ValidClientCertificates() in D:\j\workspace\windows-TGrou---74aa877a\src\System.Net.Http.WinHttpHandler\tests\UnitTests\ClientCertificateScenarioTest.cs:line 18 ``` cc @davidsh, @wfurt, @karelz, @danmosemsft 28637 area-System.Net Fix race condition on read ahead task in SocketsHttpHandler We're supposed to only use a ValueTask<int> once. But there's a race condition where we may not only use one more than once, we might do so concurrently, resulting in a variety of different exceptions depending on how the race condition manifests. When we take a connection out of the connection pool, we want to check whether it's still valid for use. We could poll, but since the request/response is going to need to issue at least one read anyway, we just do so preemptively, then checking whether the read completed synchronously (if it did, we can't use the connection). This gets stored in a field on the HttpConnection that can later be read. However, we may also create the read ahead task in another situation, which is if we're unable to easily fish out the underlying socket used by the connection (as happens with tunneling), when the pool periodically scavenges and looks for dead connections, rather than polling it just issues that read even earlier. Doing so, however, means that we'll have kicked off tasks that are likely to complete with an exception if the connection is terminated in an unfriendly manner. To avoid such exceptions spamming TaskScheduler.UnobservedTaskException, we check this stored task when disposing the connection. That, however, creates the race condition. If the connection is disposed (e.g. due to cancellation) at just the wrong time, the request/response may be in the process of working with that initial read just as the disposal goes to interact with that same read ahead task. Badness results. The fix is to add a tiny amount of synchronization, such that just one call site can take ownership of the read ahead task. cc: @geoffkizer, @davidfowl 28638 area-System.Net Some more allocation reduction in SocketsHttpHandler - Pool SocketAsyncEventArgs used for establishing connections. Today we create a new SocketAsyncEventArgs for each new connection, and it's used only for the ConnectAsync. This establishes a bounded pool of them, such that they can be reused. To do this, I moved the nested ConcurrentQueue.Segment type into a partial file so that we could use that directly, as it supports bounding (we can use it as a public type if/when https://github.com/dotnet/corefx/issues/24365 is addressed). FYI, @kouvel. - Zero pool lifetimes. If the PooledConnectionIdleTimeout is zero or if the PooledConnectionLifetime is zero, then no connection will ever actually be usuable from the pool. In such a situation we can a) avoid creating the cleaning timer, and b) dispose of the connection as it's being returned to the pool, rather than waiting for it to be scavenged. - CookieContainer string allocation. Its ctor is allocating a string that can instead be constructed once and used across all CookieContainers. cc: @geoffkizer 28639 area-System.Net Stop blocking explicit opt-in to old SslProtocols in SslStream and HttpClient By default, .NET Core defaults to allowing TLSv1, TLSv1.1, and TLSv1.2. However, whereas .NET Framework allows a developer to opt-in to SSLv2/SSLv3, .NET Core currently blocks it. This means developers are unable to use .NET Core when they need to communicate with an endpoint they don't control and that's unfortunately limited to one of these protocols, which blocks adoption of .NET Core. This commit stops blocking these protocols. They're still disabled by default, and compiling against them still results in a deprecation warning, but if a developer chooses to ignore the warning and explicitly sets SslProtocols, they are at least able to use the protocols, subject to whatever the underlying operating system allows (e.g. Windows stops supporting SSLv2 as of v1607). Fixes https://github.com/dotnet/corefx/issues/15661 cc: @bartonjs, @GrabYourPitchforks, @davidsh (Note I'm expecting when mission control comes back up I'll still have a handful of test failures to investigate. I also should call out that some of the impacted tests are previously ActiveIssue'd, so as part of testing this I temporarily commented out the ActiveIssue, but I reverted that commenting for the PR.) 28640 area-System.Memory Split OwnedMemory into MemoryManager and IMemoryOwner Depends on CoreCLR PR https://github.com/dotnet/coreclr/pull/17340 (along with the mirror PR). **TODO:** - ~Get the repo (source) building~ - ~Fix MemoryPool impl and tests~ (cc @AtsushiKan) - ~Fix implementation of ReadOnlySequence and related types and adjust tests~ (cc @pakrym) - ~Consume the changed types in Pipelines and fix~ (cc @pakrym, @halter73) - ~Get existing tests to compile and pass~ ~System.Memory tests are passing now. I have disabled the few Pipelines tests that are failing (temporarily) until I can figure out the necessary fix.~ - ~Remove the files from src/Common/src/CoreLib/* since they will get mirrorred automatically once the coreclr PR gets merged.~ - Add more tests in System.Memory for IMemoryOwner/etc. (non-blocking, will be done in the future, outside this PR) **Changes:** - IRetainable is IPinnable (Release is Unpin) - OwnedMemory is split into MemoryManager and IMemoryOwner - Reorder the arguments in the ctor of MemoryHandle - Add a static method CreateFromPinnedArray and use the high bit on length for pre-pinned arrays - Make the internal ctor that took OwnedMemory public (now takes MemoryManager) and add argument validation - Reset index, length if TryGetMemoryManager returns false (cc @benaadams) - Updated the reference assembly for System.Memory, System.IO.Pipelines, and System.Runtime (cc @weshaggard) cc @joshfree, @GrabYourPitchforks, @KrzysztofCwalina, @pakrym, @davidfowl, @jkotas, @stephentoub 28641 area-System.Threading Awit use delay Windows server 2012 R2 @a641545621 commented on [Tue Mar 27 2018](https://github.com/dotnet/core/issues/1389) Response response = _client.Execute(request).Result; Response response = awit _client.Execute(request); When using Awit to get results, there is no problem with the Win10 system, but when using Windows Server 2012 R2, occasionally it takes more than 20 seconds or more to wait. If you use .Result directly, you will not wait for a long time. 28642 area-System.Net WebRequest.DefaultWebProxy in .net core for corss platform @nQuantPlatforms commented on [Sat Mar 24 2018](https://github.com/dotnet/core/issues/1381) # Issue Title WebRequest.DefaultWebProxy in .net core for corss platform # General <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>netcoreapp2.0</TargetFramework> </PropertyGroup> <PropertyGroup> <RuntimeIdentifiers>win10-x64;osx-x64;linux-x64;</RuntimeIdentifiers> </PropertyGroup> Using above RID and running on Win 10 gives me platform not supported exception. My app need to read proxy from Win, OSX and Linux platform. Whats the best way to get proxy in Core app without having to create separate platform specific library ? 28644 area-System.Runtime Added test for logging exception details on calls to Environment.FailFast "Test for https://github.com/dotnet/coreclr/pull/16622, which added the details of exception object passed in calls to ```Environment.FailFast(""msg"", ex)```. Resolves issue #27929 " 28645 area-System.Net Make AuthenticationException message less platform-specific SSPI is a Windows thing. cc: @davidsh, @bartonjs 28646 area-System.Net [2.1] Add server-side SNI support 2.1 squashed port of https://github.com/dotnet/corefx/pull/28278 Seems like CI is hanging on master but we can still send a port PR cc: @karelz @Tratcher 28648 area-System.Net Bad request created when a 401 is received after a Negotiate login "If SocketsHttpHandler is used to login using Negotiate and a 401 is received after a successful login then an additional, invalid login request is sent and a 400 Bad Request response is received. ``` GET / HTTP/1.1 Host: localhost:8080 HTTP/1.1 401 Unauthorized Content-Length: 0 Server: Microsoft-HTTPAPI/2.0 WWW-Authenticate: Negotiate Date: Fri, 30 Mar 2018 16:49:38 GMT GET / HTTP/1.1 Authorization: Negotiate YIGABgYrBgEFBQKgdjB0oDAwLgYKKwYBBAGCNwICCgYJKoZIgvcSAQICBgkqhkiG9xIBAgIGCisGAQQBgjcCAh6iQAQ+TlRMTVNTUAABAAAAl7II4gcABwA3AAAADwAPACgAAAAKAKs/AAAAD0NIUlJPU1MtQ09SRURFVlJFRE1PTkQ= Host: localhost:8080 HTTP/1.1 401 Unauthorized Content-Type: text/html; charset=us-ascii Server: Microsoft-HTTPAPI/2.0 WWW-Authenticate: Negotiate oYIBYTCCAV2gAwoBAaEMBgorBgEEAYI3AgIKooIBRgSCAUJOVExNU1NQAAIAAAAOAA4AOAAAABXCieIfmaZR3PbepYBHaZ8DAgAA/AD8AEYAAAAKAKs/AAAAD1IARQBEAE0ATwBOAEQAAgAOAFIARQBEAE0ATwBOAEQAAQAeAEMASABSAFIATwBTAFMALQBDAE8AUgBFAEQARQBWAAQANAByAGUAZABtAG8AbgBkAC4AYwBvAHIAcAAuAG0AaQBjAHIAbwBzAG8AZgB0AC4AYwBvAG0AAwBUAGMAaAByAHIAbwBzAHMALQBjAG8AcgBlAGQAZQB2AC4AcgBlAGQAbQBvAG4AZAAuAGMAbwByAHAALgBtAGkAYwByAG8AcwBvAGYAdAAuAGMAbwBtAAUAJABjAG8AcgBwAC4AbQBpAGMAcgBvAHMAbwBmAHQALgBjAG8AbQAHAAgAKkqVF0fI0wEAAAAA Date: Fri, 30 Mar 2018 16:49:38 GMT Content-Length: 341 <!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.01//EN""""http://www.w3.org/TR/html4/strict.dtd""> <HTML><HEAD><TITLE>Not Authorized</TITLE> <META HTTP-EQUIV=""Content-Type"" Content=""text/html; charset=us-ascii""></HEAD> <BODY><h2>Not Authorized</h2> <hr><p>HTTP Error 401. The requested resource requires user authentication.</p> </BODY></HTML> GET / HTTP/1.1 Authorization: Negotiate oXcwdaADCgEBoloEWE5UTE1TU1AAAwAAAAAAAABYAAAAAAAAAFgAAAAAAAAAWAAAAAAAAABYAAAAAAAAAFgAAAAAAAAAWAAAABXCiOIKAKs/AAAADzMP5MXS4HO3vFJ7cVAlnlCjEgQQAQAAAO5XoSQnQjpiAAAAAA== Host: localhost:8080 // The login was successful, but the server still decided to decline the user. HTTP/1.1 401 Unauthorized Content-Length: 0 Server: Microsoft-HTTPAPI/2.0 WWW-Authenticate: Negotiate Date: Fri, 30 Mar 2018 16:49:38 GMT // An extra invalid request is submitted, auth should have terminated, not sent Negotiate without a parameter. GET / HTTP/1.1 Authorization: Negotiate Host: localhost:8080 HTTP/1.1 400 Bad Request Content-Type: text/html; charset=us-ascii Server: Microsoft-HTTPAPI/2.0 Date: Fri, 30 Mar 2018 16:49:38 GMT Connection: close Content-Length: 311 <!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.01//EN""""http://www.w3.org/TR/html4/strict.dtd""> <HTML><HEAD><TITLE>Bad Request</TITLE> <META HTTP-EQUIV=""Content-Type"" Content=""text/html; charset=us-ascii""></HEAD> <BODY><h2>Bad Request</h2> <hr><p>HTTP Error 400. The request is badly formed.</p> </BODY></HTML> ``` This loop needs to terminate if there's no auth parameter to send: https://github.com/dotnet/corefx/blob/06aa6f0ce4cdf78985f029f218007a7d55f8965f/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/AuthenticationHelper.NtAuth.cs#L62-L75 Repro code: ``` public static void Main(string[] args) { var serverTask = RunServer(); Console.WriteLine(""Press any key to send request.""); Console.ReadKey(); var clientTask = RunClient(); Task.WaitAll(serverTask, clientTask); } private static async Task RunServer() { var host = new WebHostBuilder() .ConfigureLogging(factory => factory.AddConsole()) .Configure(app => { app.Run(context => { context.Response.StatusCode = 401; return Task.CompletedTask; }); }) .UseHttpSys(options => { options.UrlPrefixes.Add(""http://localhost:8080""); options.Authentication.Schemes = AuthenticationSchemes.Negotiate; options.Authentication.AllowAnonymous = true; }) .Build(); await host.RunAsync(); } private static async Task RunClient() { Environment.SetEnvironmentVariable(""DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER"", ""true""); var handler = new HttpClientHandler(); handler.UseDefaultCredentials = true; var client = new HttpClient(handler); var response = await client.GetAsync(""http://localhost:8080/""); Console.WriteLine(response); } ``` Note I wasn't able to repro this with HttpListener due to invalid response header formatting such as https://github.com/dotnet/corefx/pull/27755 `WWW-Authenticate: oRswGaADCgEAoxIEEAEAAAAZb0U9WuqA3QAAAAA=,Negotiate` Found by ASP.NET Core HttpSys functional tests: https://github.com/aspnet/HttpSysServer/issues/439 Priority: Not blocking @geoffkizer " 28649 area-System.Net Remove buffer argument from WebSocket.CreateFromStream Fixes https://github.com/dotnet/corefx/issues/28138 cc: @davidfowl, @pakrym, @karelz 28650 area-System.Drawing FontFamily.Equals in Linux use .Name instead of NativeFamily pointer which is not a singleton Fixes: https://github.com/dotnet/corefx/issues/28052 In linux FontFamily objects are not treated as singleton so their NativeFamily pointers can change from object to object. However, when getting the FontFamily.Name from the native pointer we would get the same value if the FontFamily is the same. However since we depend on the different font families across operative systems and Linux distros, we can have results where 2 fonts in linux are part of the same font family and in windows they are part of different families. cc: @danmosemsft @qmfrederik 28652 area-System.Security SqlClient CryptographicException is back on High Sierra 10.13.4 My issue today seems the same as this: https://github.com/dotnet/corefx/issues/22453 Yesterday (on High Sierra 10.13.3) my .net core 2.0 web project ran fine, connecting to SQL Server. Last night my machine was updated to 10.13.4, and now this morning when I run the project I get this error: ``` An unhandled exception was thrown by the application. System.TypeInitializationException: The type initializer for 'XXX' threw an exception. ---> System.Data.SqlClient.SqlException: A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 31 - Encryption(ssl/tls) handshake failed) ---> System.Security.Cryptography.CryptographicException: Error occurred during a cryptographic operation. ``` Anyone else on 10.13.4 able to successfully connect to SQL Server this morning? 28655 area-System.Linq ParallelEnumerable.Aggregate XML documentation appears to be incorrect. The [summary documentation](https://github.com/dotnet/corefx/blob/a38c5000be0d4b98445ef43d642614d0e8d8f82d/src/System.Linq.Parallel/src/System/Linq/ParallelEnumerable.cs#L1655) for the `ParallelEnumerable.Aggregate` method says: > Applies in parallel an accumulator function over a sequence. The implementation, however, delegates to the `PerformSequentialAggregation` method, which applies the accumulator function sequentially. Unless there is something I'm missing, the documentation is discrepant and would more accurately say this: > Applies an accumulator function sequentially over a sequence. 28656 area-Serialization Remove empty baseline files #28552 Just deleted empty baseline files. @weshaggard @mconnew 28657 area-System.Net SslStream mutates state of Client/ServerAuthenticationOptions Comment from @stephentoub in https://github.com/dotnet/corefx/pull/28278 has pointed to the issue we have in SslStream where we mutate Options object. The problem with mutating the object is that sharing the same Options across different SslStream instance can cause races and make different than expected callback be called. Examples of mutating state: https://github.com/krwq/corefx/blob/705e95f02d179cccc6a290e5cf9f05fbd9873ed3/src/System.Net.Security/src/System/Net/Security/SslStream.cs#L252 https://github.com/krwq/corefx/blob/705e95f02d179cccc6a290e5cf9f05fbd9873ed3/src/System.Net.Security/src/System/Net/Security/SslStream.cs#L323 https://github.com/krwq/corefx/blob/705e95f02d179cccc6a290e5cf9f05fbd9873ed3/src/System.Net.Security/src/System/Net/Security/SslStream.cs#L360 28658 area-System.Diagnostics NETFX x86 Release Build not running a set of tests "Can't workout which ones, but open any recent PR and in the logs will be ``` xUnit.net Console Runner (64-bit Desktop .NET 4.0.30319.42000) Copyright (C) .NET Foundation. usage: xunit.console <assemblyFile> [configFile] [assemblyFile [configFile]...] [options] [reporter] [resultFormat filename [...]] Note: Configuration files must end in .json (for JSON) or .config (for XML) Valid options: -nologo : do not show the copyright message -nocolor : do not output results with colors -noappdomain : do not use app domains to run test code -failskips : convert skipped tests into failures -parallel option : set parallelization based on option : none - turn off all parallelization : collections - only parallelize collections : assemblies - only parallelize assemblies : all - parallelize assemblies & collections -maxthreads count : maximum thread count for collection parallelization : default - run with default (1 thread per CPU thread) : unlimited - run with unbounded thread count : (number) - limit task thread pool size to 'count' -noshadow : do not shadow copy assemblies -wait : wait for input after completion -diagnostics : enable diagnostics messages for all test assemblies -internaldiagnostics : enable internal diagnostics messages for all test assemblies -debug : launch the debugger to debug the tests -serialize : serialize all test cases (for diagnostic purposes only) -trait ""name=value"" : only run tests with matching name/value traits : if specified more than once, acts as an OR operation -notrait ""name=value"" : do not run tests with matching name/value traits : if specified more than once, acts as an AND operation -method ""name"" : run a given test method (should be fully specified; : i.e., 'MyNamespace.MyClass.MyTestMethod') : if specified more than once, acts as an OR operation xUnit.net Console Runner (64-bit Desktop .NET 4.0.30319.42000) -class ""name"" : run all methods in a given test class (should be fully : specified; i.e., 'MyNamespace.MyClass') : if specified more than once, acts as an OR operation -namespace ""name"" : run all methods in a given namespace (i.e., : 'MyNamespace.MySubNamespace') : if specified more than once, acts as an OR operation -noautoreporters : do not allow reporters to be auto-enabled by environment : (for example, auto-detecting TeamCity or AppVeyor) Result formats: (optional, choose one or more) -xml <filename> : output results to xUnit.net v2 XML file -xmlv1 <filename> : output results to xUnit.net v1 XML file -html <filename> : output results to HTML file -nunit <filename> : output results to NUnit v2.5 XML file ``` So its outputting the usage rather than running" 28660 area-Infrastructure [master] Change esrp signing flag to legacy signing 28661 area-Infrastructure [release/2.1] Change esrp signing flag to legacy signing 28662 area-System.Net [CentOS] Failure to load Microsoft.Win32.Primitives causes restore failing frequently "This is blocking CLI PR https://github.com/dotnet/cli/pull/8893 https://ci.dot.net/job/dotnet_cli/job/release_2.1.3xx/job/debug_centos7.1_x64_prtest/181/testReport/(root)/(empty)/Microsoft_DotNet_New_Tests_GivenThatIWantANewAppWithSpecifiedType_TemplateRestoresAndBuildsWithoutWarnings_language___C____projectType___mvc___skipSpaWebpackSteps__False_/ ``` Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Win32.Primitives, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot open the file. (Exception from HRESULT: 0x80070004) at System.Net.Sockets.MultipleConnectAsync.InternalConnectCallback(Object sender, SocketAsyncEventArgs args) at System.Net.Sockets.SocketAsyncEventArgs.OnCompleted(SocketAsyncEventArgs e) at System.Net.Sockets.SocketAsyncEventArgs.ExecutionCallback(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location where exception was thrown --- at System.Net.Sockets.SocketAsyncEventArgs.FinishOperationAsyncFailure(SocketError socketError, Int32 bytesTransferred, SocketFlags flags) at System.Net.Sockets.SocketAsyncEventArgs.CompletionCallback(Int32 bytesTransferred, SocketFlags flags, SocketError socketError) at System.Net.Sockets.SocketAsyncEventArgs.ConnectCompletionCallback(SocketError socketError) at System.Net.Sockets.SocketAsyncContext.ConnectOperation.InvokeCallback(Boolean allowPooling) at System.Net.Sockets.SocketAsyncContext.OperationQueue`1.ProcessQueue(SocketAsyncContext context) at System.Net.Sockets.SocketAsyncContext.OperationQueue`1.<>c.<.cctor>b__15_1(Object o) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location where exception was thrown --- at System.Threading.ThreadPoolWorkQueue.Dispatch() ``` Full: ``` MESSAGE: Expected command to pass but it did not. File Name: /mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/2/linux-x64/dotnet/dotnet Arguments: restore WorkingDir:: /mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/3/linux-x64/test/dotnet-new.Tests/TemplateRestoresAndBuildsWithoutWarningsC#_mvc/temp Exit Code: 134 StdOut: Restoring packages for /mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/3/linux-x64/test/dotnet-new.Tests/TemplateRestoresAndBuildsWithoutWarningsC#_mvc/temp/temp.csproj... Retrying 'FindPackagesByIdAsync' for source 'https://dotnetmyget.blob.core.windows.net/artifacts/nuget-build/nuget/v3/flatcontainer/microsoft.extensions.hosting/index.json'. Could not load file or assembly 'Microsoft.Win32.Primitives, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot open the file. (Exception from HRESULT: 0x80070004) Retrying 'FindPackagesByIdAsync' for source 'https://dotnetmyget.blob.core.windows.net/artifacts/aspnetcore-release/nuget/v3/flatcontainer/microsoft.extensions.caching.sqlserver/index.json'. Too many open files Retrying 'FindPackagesByIdAsync' for source 'https://www.myget.org/F/container-tools-for-visual-studio/api/v3/flatcontainer/microsoft.extensions.hosting/index.json'. Could not load file or assembly 'Microsoft.Win32.Primitives, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot open the file. (Exception from HRESULT: 0x80070004) Retrying 'FindPackagesByIdAsync' for source 'https://www.myget.org/F/container-tools-for-visual-studio/api/v3/flatcontainer/microsoft.extensions.hosting/index.json'. Could not load file or assembly 'Microsoft.Win32.Primitives, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot open the file. (Exception from HRESULT: 0x80070004) Retrying 'FindPackagesByIdAsync' for source 'https://api.nuget.org/v3-flatcontainer/microsoft.extensions.hosting.abstractions/index.json'. Could not load file or assembly 'Microsoft.Win32.Primitives, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot open the file. (Exception from HRESULT: 0x80070004) Retrying 'FindPackagesByIdAsync' for source 'https://dotnetfeed.blob.core.windows.net/dotnet-core/flatcontainer/system.buffers/index.json'. Too many open files Retrying 'FindPackagesByIdAsync' for source 'https://dotnetmyget.blob.core.windows.net/artifacts/nuget-build/nuget/v3/flatcontainer/microsoft.extensions.identity.core/index.json'. Could not load file or assembly 'Microsoft.Win32.Primitives, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot open the file. (Exception from HRESULT: 0x80070004) Retrying 'FindPackagesByIdAsync' for source 'https://dotnetmyget.blob.core.windows.net/artifacts/nuget-build/nuget/v3/flatcontainer/microsoft.extensions.identity.core/index.json'. Could not load file or assembly 'Microsoft.Win32.Primitives, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot open the file. (Exception from HRESULT: 0x80070004) Retrying 'FindPackagesByIdAsync' for source 'https://www.myget.org/F/container-tools-for-visual-studio/api/v3/flatcontainer/microsoft.extensions.identity.core/index.json'. Could not load file or assembly 'Microsoft.Win32.Primitives, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot open the file. (Exception from HRESULT: 0x80070004) Retrying 'FindPackagesByIdAsync' for source 'https://www.myget.org/F/container-tools-for-visual-studio/api/v3/flatcontainer/microsoft.extensions.identity.core/index.json'. Could not load file or assembly 'Microsoft.Win32.Primitives, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot open the file. (Exception from HRESULT: 0x80070004) Retrying 'FindPackagesByIdAsync' for source 'https://dotnetmyget.blob.core.windows.net/artifacts/msbuild/nuget/v3/flatcontainer/microsoft.extensions.identity.core/index.json'. Could not load file or assembly 'Microsoft.Win32.Primitives, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot open the file. (Exception from HRESULT: 0x80070004) Retrying 'FindPackagesByIdAsync' for source 'https://dotnetmyget.blob.core.windows.net/artifacts/msbuild/nuget/v3/flatcontainer/microsoft.extensions.identity.core/index.json'. Could not load file or assembly 'Microsoft.Win32.Primitives, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot open the file. (Exception from HRESULT: 0x80070004) Retrying 'FindPackagesByIdAsync' for source 'https://dotnet.myget.org/F/templating/api/v3/flatcontainer/microsoft.extensions.logging/index.json'. Could not load file or assembly 'Microsoft.Win32.Primitives, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot open the file. (Exception from HRESULT: 0x80070004) Retrying 'FindPackagesByIdAsync' for source 'https://dotnetmyget.blob.core.windows.net/artifacts/msbuild/nuget/v3/flatcontainer/newtonsoft.json.bson/index.json'. Could not load file or assembly 'Microsoft.Win32.Primitives, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot open the file. (Exception from HRESULT: 0x80070004) Retrying 'FindPackagesByIdAsync' for source 'https://dotnetmyget.blob.core.windows.net/artifacts/msbuild/nuget/v3/flatcontainer/newtonsoft.json.bson/index.json'. Could not load file or assembly 'Microsoft.Win32.Primitives, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot open the file. (Exception from HRESULT: 0x80070004) Retrying 'FindPackagesByIdAsync' for source 'https://dotnet.myget.org/F/templating/api/v3/flatcontainer/microsoft.extensions.logging/index.json'. Could not load file or assembly 'Microsoft.Win32.Primitives, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot open the file. (Exception from HRESULT: 0x80070004) Retrying 'FindPackagesByIdAsync' for source 'https://myget-2e16.kxcdn.com/artifacts/xunit/nuget/v3/flatcontainer/microsoft.extensions.logging/index.json'. Could not load file or assembly 'Microsoft.Win32.Primitives, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot open the file. (Exception from HRESULT: 0x80070004) Retrying 'FindPackagesByIdAsync' for source 'https://myget-2e16.kxcdn.com/artifacts/xunit/nuget/v3/flatcontainer/microsoft.extensions.logging/index.json'. Could not load file or assembly 'Microsoft.Win32.Primitives, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot open the file. (Exception from HRESULT: 0x80070004) Retrying 'FindPackagesByIdAsync' for source 'https://dotnetmyget.blob.core.windows.net/artifacts/msbuild/nuget/v3/flatcontainer/microsoft.extensions.logging/index.json'. Could not load file or assembly 'Microsoft.Win32.Primitives, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot open the file. (Exception from HRESULT: 0x80070004) Retrying 'FindPackagesByIdAsync' for source 'https://dotnetmyget.blob.core.windows.net/artifacts/msbuild/nuget/v3/flatcontainer/microsoft.extensions.logging/index.json'. Could not load file or assembly 'Microsoft.Win32.Primitives, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot open the file. (Exception from HRESULT: 0x80070004) Retrying 'FindPackagesByIdAsync' for source 'https://dotnetfeed.blob.core.windows.net/dotnet-core/flatcontainer/microsoft.aspnetcore.authentication/index.json'. Too many open files Failed to download package 'Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions.2.1.0-preview2-30475' from 'https://dotnetmyget.blob.core.windows.net/artifacts/aspnetcore-release/nuget/v3/flatcontainer/microsoft.aspnetcore.server.kestrel.transport.abstractions/2.1.0-preview2-30475/microsoft.aspnetcore.server.kestrel.transport.abstractions.2.1.0-preview2-30475.nupkg'. Too many open files Retrying 'FindPackagesByIdAsync' for source 'https://dotnetmyget.blob.core.windows.net/artifacts/aspnetcore-release/nuget/v3/flatcontainer/microsoft.extensions.configuration.environmentvariables/index.json'. Too many open files Retrying 'FindPackagesByIdAsync' for source 'https://myget-2e16.kxcdn.com/artifacts/xunit/nuget/v3/flatcontainer/microsoft.extensions.options.configurationextensions/index.json'. Could not load file or assembly 'Microsoft.Win32.Primitives, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot open the file. (Exception from HRESULT: 0x80070004) Retrying 'FindPackagesByIdAsync' for source 'https://myget-2e16.kxcdn.com/artifacts/xunit/nuget/v3/flatcontainer/microsoft.extensions.options.configurationextensions/index.json'. Could not load file or assembly 'Microsoft.Win32.Primitives, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot open the file. (Exception from HRESULT: 0x80070004) Failed to download package 'Microsoft.EntityFrameworkCore.2.1.0-preview2-30475' from 'https://dotnetmyget.blob.core.windows.net/artifacts/aspnetcore-release/nuget/v3/flatcontainer/microsoft.entityframeworkcore/2.1.0-preview2-30475/microsoft.entityframeworkcore.2.1.0-preview2-30475.nupkg'. Too many open files Retrying 'FindPackagesByIdAsync' for source 'https://dotnetfeed.blob.core.windows.net/dotnet-core/flatcontainer/microsoft.extensions.configuration.commandline/index.json'. Too many open files Retrying 'FindPackagesByIdAsync' for source 'https://www.myget.org/F/container-tools-for-visual-studio/api/v3/flatcontainer/microsoft.extensions.options.configurationextensions/index.json'. Could not load file or assembly 'Microsoft.Win32.Primitives, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot open the file. (Exception from HRESULT: 0x80070004) Retrying 'FindPackagesByIdAsync' for source 'https://dotnetfeed.blob.core.windows.net/dotnet-core/flatcontainer/microsoft.net.http.headers/index.json'. Could not load file or assembly 'Microsoft.Win32.Primitives, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot open the file. (Exception from HRESULT: 0x80070004) /mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/2/linux-x64/dotnet/sdk/2.1.300-preview2-008509/NuGet.targets(114,5): error : Too many open files [/mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/3/linux-x64/test/dotnet-new.Tests/TemplateRestoresAndBuildsWithoutWarningsC#_mvc/temp/temp.csproj] Retrying 'FindPackagesByIdAsync' for source 'https://dotnetmyget.blob.core.windows.net/artifacts/msbuild/nuget/v3/flatcontainer/microsoft.net.http.headers/index.json'. Could not load file or assembly 'Microsoft.Win32.Primitives, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot open the file. (Exception from HRESULT: 0x80070004) Retrying 'FindPackagesByIdAsync' for source 'https://dotnetmyget.blob.core.windows.net/artifacts/msbuild/nuget/v3/flatcontainer/microsoft.net.http.headers/index.json'. Could not load file or assembly 'Microsoft.Win32.Primitives, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot open the file. (Exception from HRESULT: 0x80070004) /mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/2/linux-x64/dotnet/sdk/2.1.300-preview2-008509/NuGet.targets(114,5): error MSB4018: The ""RestoreTask"" task failed unexpectedly. [/mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/3/linux-x64/test/dotnet-new.Tests/TemplateRestoresAndBuildsWithoutWarningsC#_mvc/temp/temp.csproj] /mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/2/linux-x64/dotnet/sdk/2.1.300-preview2-008509/NuGet.targets(114,5): error MSB4018: System.IO.FileLoadException: Could not load file or assembly 'System.Diagnostics.Debug, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot open the file. [/mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/3/linux-x64/test/dotnet-new.Tests/TemplateRestoresAndBuildsWithoutWarningsC#_mvc/temp/temp.csproj] /mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/2/linux-x64/dotnet/sdk/2.1.300-preview2-008509/NuGet.targets(114,5): error MSB4018: (Exception from HRESULT: 0x80070004) [/mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/3/linux-x64/test/dotnet-new.Tests/TemplateRestoresAndBuildsWithoutWarningsC#_mvc/temp/temp.csproj] /mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/2/linux-x64/dotnet/sdk/2.1.300-preview2-008509/NuGet.targets(114,5): error MSB4018: File name: 'System.Diagnostics.Debug, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' [/mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/3/linux-x64/test/dotnet-new.Tests/TemplateRestoresAndBuildsWithoutWarningsC#_mvc/temp/temp.csproj] /mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/2/linux-x64/dotnet/sdk/2.1.300-preview2-008509/NuGet.targets(114,5): error MSB4018: at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type) [/mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/3/linux-x64/test/dotnet-new.Tests/TemplateRestoresAndBuildsWithoutWarningsC#_mvc/temp/temp.csproj] /mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/2/linux-x64/dotnet/sdk/2.1.300-preview2-008509/NuGet.targets(114,5): error MSB4018: at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) [/mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/3/linux-x64/test/dotnet-new.Tests/TemplateRestoresAndBuildsWithoutWarningsC#_mvc/temp/temp.csproj] /mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/2/linux-x64/dotnet/sdk/2.1.300-preview2-008509/NuGet.targets(114,5): error MSB4018: at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments) [/mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/3/linux-x64/test/dotnet-new.Tests/TemplateRestoresAndBuildsWithoutWarningsC#_mvc/temp/temp.csproj] /mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/2/linux-x64/dotnet/sdk/2.1.300-preview2-008509/NuGet.targets(114,5): error MSB4018: at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg) [/mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/3/linux-x64/test/dotnet-new.Tests/TemplateRestoresAndBuildsWithoutWarningsC#_mvc/temp/temp.csproj] /mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/2/linux-x64/dotnet/sdk/2.1.300-preview2-008509/NuGet.targets(114,5): error MSB4018: at System.Reflection.CustomAttribute.IsCustomAttributeDefined(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Int32 attributeCtorToken, Boolean mustBeInheritable) [/mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/3/linux-x64/test/dotnet-new.Tests/TemplateRestoresAndBuildsWithoutWarningsC#_mvc/temp/temp.csproj] /mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/2/linux-x64/dotnet/sdk/2.1.300-preview2-008509/NuGet.targets(114,5): error MSB4018: at System.Reflection.CustomAttribute.IsDefined(RuntimeType type, RuntimeType caType, Boolean inherit) [/mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/3/linux-x64/test/dotnet-new.Tests/TemplateRestoresAndBuildsWithoutWarningsC#_mvc/temp/temp.csproj] /mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/2/linux-x64/dotnet/sdk/2.1.300-preview2-008509/NuGet.targets(114,5): error MSB4018: at System.Diagnostics.StackTrace.ShowInStackTrace(MethodBase mb) [/mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/3/linux-x64/test/dotnet-new.Tests/TemplateRestoresAndBuildsWithoutWarningsC#_mvc/temp/temp.csproj] /mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/2/linux-x64/dotnet/sdk/2.1.300-preview2-008509/NuGet.targets(114,5): error MSB4018: at System.Diagnostics.StackTrace.ToString(TraceFormat traceFormat) [/mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/3/linux-x64/test/dotnet-new.Tests/TemplateRestoresAndBuildsWithoutWarningsC#_mvc/temp/temp.csproj] /mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/2/linux-x64/dotnet/sdk/2.1.300-preview2-008509/NuGet.targets(114,5): error MSB4018: at System.Exception.GetStackTrace(Boolean needFileInfo) [/mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/3/linux-x64/test/dotnet-new.Tests/TemplateRestoresAndBuildsWithoutWarningsC#_mvc/temp/temp.csproj] /mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/2/linux-x64/dotnet/sdk/2.1.300-preview2-008509/NuGet.targets(114,5): error MSB4018: at System.Exception.ToString(Boolean needFileLineInfo, Boolean needMessage) [/mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/3/linux-x64/test/dotnet-new.Tests/TemplateRestoresAndBuildsWithoutWarningsC#_mvc/temp/temp.csproj] /mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/2/linux-x64/dotnet/sdk/2.1.300-preview2-008509/NuGet.targets(114,5): error MSB4018: at NuGet.Common.ExceptionUtilities.LogException(Exception ex, ILogger logger, Boolean logStackAsError) [/mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/3/linux-x64/test/dotnet-new.Tests/TemplateRestoresAndBuildsWithoutWarningsC#_mvc/temp/temp.csproj] /mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/2/linux-x64/dotnet/sdk/2.1.300-preview2-008509/NuGet.targets(114,5): error MSB4018: at NuGet.Common.ExceptionUtilities.LogException(Exception ex, ILogger logger) [/mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/3/linux-x64/test/dotnet-new.Tests/TemplateRestoresAndBuildsWithoutWarningsC#_mvc/temp/temp.csproj] /mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/2/linux-x64/dotnet/sdk/2.1.300-preview2-008509/NuGet.targets(114,5): error MSB4018: at NuGet.Build.Tasks.RestoreTask.Execute() [/mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/3/linux-x64/test/dotnet-new.Tests/TemplateRestoresAndBuildsWithoutWarningsC#_mvc/temp/temp.csproj] /mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/2/linux-x64/dotnet/sdk/2.1.300-preview2-008509/NuGet.targets(114,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/3/linux-x64/test/dotnet-new.Tests/TemplateRestoresAndBuildsWithoutWarningsC#_mvc/temp/temp.csproj] /mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/2/linux-x64/dotnet/sdk/2.1.300-preview2-008509/NuGet.targets(114,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [/mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/3/linux-x64/test/dotnet-new.Tests/TemplateRestoresAndBuildsWithoutWarningsC#_mvc/temp/temp.csproj] /mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/2/linux-x64/dotnet/sdk/2.1.300-preview2-008509/NuGet.targets(114,5): error MSB4018: [/mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/3/linux-x64/test/dotnet-new.Tests/TemplateRestoresAndBuildsWithoutWarningsC#_mvc/temp/temp.csproj] /mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/2/linux-x64/dotnet/sdk/2.1.300-preview2-008509/NuGet.targets(114,5): error MSB4018: [/mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/bin/3/linux-x64/test/dotnet-new.Tests/TemplateRestoresAndBuildsWithoutWarningsC#_mvc/temp/temp.csproj] StdErr: Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Win32.Primitives, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot open the file. (Exception from HRESULT: 0x80070004) at System.Net.Sockets.MultipleConnectAsync.InternalConnectCallback(Object sender, SocketAsyncEventArgs args) at System.Net.Sockets.SocketAsyncEventArgs.OnCompleted(SocketAsyncEventArgs e) at System.Net.Sockets.SocketAsyncEventArgs.ExecutionCallback(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location where exception was thrown --- at System.Net.Sockets.SocketAsyncEventArgs.FinishOperationAsyncFailure(SocketError socketError, Int32 bytesTransferred, SocketFlags flags) at System.Net.Sockets.SocketAsyncEventArgs.CompletionCallback(Int32 bytesTransferred, SocketFlags flags, SocketError socketError) at System.Net.Sockets.SocketAsyncEventArgs.ConnectCompletionCallback(SocketError socketError) at System.Net.Sockets.SocketAsyncContext.ConnectOperation.InvokeCallback(Boolean allowPooling) at System.Net.Sockets.SocketAsyncContext.OperationQueue`1.ProcessQueue(SocketAsyncContext context) at System.Net.Sockets.SocketAsyncContext.OperationQueue`1.<>c.<.cctor>b__15_1(Object o) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location where exception was thrown --- at System.Threading.ThreadPoolWorkQueue.Dispatch() +++++++++++++++++++ STACK TRACE: at FluentAssertions.Execution.XUnit2TestFramework.Throw(String message) at FluentAssertions.Execution.AssertionScope.FailWith(String message, Object[] args) at Microsoft.DotNet.Tools.Test.Utilities.CommandResultAssertions.Pass() in /mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/test/Microsoft.DotNet.Tools.Tests.Utilities/Assertions/CommandResultAssertions.cs:line 30 at Microsoft.DotNet.New.Tests.GivenThatIWantANewAppWithSpecifiedType.TemplateRestoresAndBuildsWithoutWarnings(String language, String projectType, Boolean skipSpaWebpackSteps) in /mnt/resource/j/workspace/dotnet_cli/release_2.1.3xx/debug_centos7.1_x64_prtest/test/dotnet-new.Tests/GivenThatIWantANewAppWithSpecifiedType.cs:line 60 ```" 28664 area-Microsoft.CSharp When a new binder is exactly the same as existing one, just use the old instance instead. "When a new binder is exactly the same as existing one, just use the old instance instead. The reason is that DLR associates L2 cache with binder instances. The older binder, while equivalent, may already have some bindings in its cache. It makes sense to reuse them. This is the whole point of L2 cache. I.E. If the second callsite happens to bind the same operation (say a dynamic addition that turns out to be adding ints), it can simply reuse the results of the previous binding - as long as these ""+"" callsites use the same binder instance. Dynamic binding is a relatively expensive reflection-heavy operation. It is nice to be able to reuse the results." 28666 area-System.Net SslStream mutates state of options Fixes: https://github.com/dotnet/corefx/issues/28657 <s>Marking as WIP because I still investigate if there are more options which might be modified</s> not seeing anything else f72796c is an unrelated rename which I missed in my SNI PR 28667 area-Microsoft.CSharp NamedArgumentTests.cs in src/Microsoft.CSharp/tests doesn't reset Console.Out Tests in that file are setting Console.Out to a custom stream but don't reset it at the end: https://github.com/dotnet/corefx/blob/e3694f9b8a69d21d1cb0e30412b7e52079ae69d6/src/Microsoft.CSharp/tests/NamedArgumentTests.cs#L369-L370 This results in the following output when running the tests: ``` xUnit.net console test runner (32-bit .NET Core) Copyright (C) 2014 Outercurve Foundation. Discovering: Microsoft.CSharp.Tests Discovered: Microsoft.CSharp.Tests Starting: Microsoft.CSharp.Tests ``` Note that the `Finished: Microsoft.CSharp.Tests` or the Test Result Summary isn't visible. The tests should have a finally that resets Console.Out to the original value, like other corefx tests are doing: https://github.com/dotnet/corefx/blob/e3694f9b8a69d21d1cb0e30412b7e52079ae69d6/src/System.Console/tests/Helpers.cs#L55-L64. 28668 area-System.Diagnostics "Test failure: System.Diagnostics.Tests.ProcessTests/ProcessStart_OpenFileOnLinux_UsesSpecifiedProgram(programToOpenWith: \""nano\"")" "Opened on behalf of @danmosemsft The test `System.Diagnostics.Tests.ProcessTests/ProcessStart_OpenFileOnLinux_UsesSpecifiedProgram(programToOpenWith: \""nano\"")` has failed. System.ComponentModel.Win32Exception : No such process Stack Trace: at System.Diagnostics.Process.Kill() in /root/corefx-1541111/src/System.Diagnostics.Process/src/System/Diagnostics/Process.Unix.cs:line 62 at System.Diagnostics.Tests.ProcessTests.ProcessStart_OpenFileOnLinux_UsesSpecifiedProgram(String programToOpenWith) in /root/corefx-1541111/src/System.Diagnostics.Process/tests/ProcessTests.Unix.cs:line 171 Build : Master - 20180330.09 (Core Tests) Failing configurations: - Centos.73.Amd64-x64 - Release " 28671 area-System.Net Improve parsing of WinINet default proxy strings in SocketsHttpHandler "WinINet default proxy strings consist of a semicolon or whitespace separated list of proxies, each with the following format: ``` ([<scheme>=][<scheme>""://""]<server>["":""<port>]) ``` For example: ``` http=127.0.0.1:8888;https=127.0.0.1:8888 ``` Our current implementation can only handle a single proxy in the list, and expects that ""://"" will be used instead of ""="". This breaks proxies for users with valid proxy configurations, and applications that configure multiple default proxies (such as Fiddler). In making the fix I tried to write the code to make as few allocations as possible, since the default proxy is checked frequently. Let me know if I should go back to the easy to read fix involving String.Split :) I made the following assumptions when writing this fix: - SocketsHttpHandler only supports http proxies. - When a user provides multiple proxies with the same scheme, we can choose to use the first. This PR also significantly increases the number of test cases for the relevant code. See #28603 for more info." 28673 area-System.Security React to X509Chain changes in macOS 10.13.4 "10.13.4 changed some of the detail codes for building the X509ChainStatusFlag values. ""ValidLeaf"" (etc) => ""TemporalValidity"" ""WeakLeaf"" (etc) => ""WeakKeySize"" new ""MissingIntermediate"" when the chain didn't complete instead of ""AnchorTrusted"" lower down. We'll need to port this to release/2.0.0 as well. Addresses #28652 (for vNext)." 28674 area-System.Memory Add tests for calling Span APIs via reflection to verify graceful failures. Partially resolves https://github.com/dotnet/coreclr/issues/17296 cc @jkotas, @AtsushiKan, @KrzysztofCwalina 28675 area-System.Security [2.0] React to X509Chain changes in macOS 10.13.4 "10.13.4 changed some of the detail codes for building the X509ChainStatusFlag values. ""ValidLeaf"" (etc) => ""TemporalValidity"" ""WeakLeaf"" (etc) => ""WeakKeySize"" new ""MissingIntermediate"" when the chain didn't complete instead of ""AnchorTrusted"" lower down. Port #28673 to release/2.0.0" 28679 area-System.Xml Marking tests affected by 27740 in XmlSchemaValidatorApi as active issue The root cause of #27740 does not seem to be in the tests themselves but in my Ubuntu VM the 2 tests hitting it are being disabled in this PR. Later I will provide the crashing stacks but I want to test the other exit code 134 before doing that. 28680 area-System.Net [2.1-preview1-final] - Socket related exceptions in azure with COMPlus_UseManagedHttpClientHandler=true "cc @karelz @stephentoub I upgraded exceptionless to 2.1 preview 1 (tried nightlies but couldn't get it to work and filed bugs in vs report a problem) via https://github.com/exceptionless/Exceptionless/tree/feature/aspnet21 and deployed to azure using the azure site extensions for dotnet core... I noticed that I'm getting the following exceptions even while the site is idle in test so load doesn't seem to be a factor of frequency as far as I can tell All of these were caught via the UnobservedTaskException handlers... ```json { ""Application Name"": ""Exceptionless.Web"", ""Runtime Framework"": "".NETCoreApp,Version=v2.1"", ""Application Base Path"": ""D:\\home\\site\\wwwroot\\bin\\"", ""Framework Description"": "".NET Core 4.6.26216.04"", ""Process Architecture"": ""X86"" } ``` # 1  ``` System.IO.IOException: Unable to transfer data on the transport connection: The I/O operation has been aborted because of either a thread exit or an application request. ---> System.Net.Sockets.SocketException: The I/O operation has been aborted because of either a thread exit or an application request ``` # 2  ``` System.IO.IOException: Unable to transfer data on the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at offset 12 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task task) at offset 39 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task task) at offset 40 at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() at System.Net.Security.SslStreamInternal.<<FillBufferAsync>g__InternalFillBufferAsync|36_0>d`1.MoveNext() at offset 114 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at offset 12 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task task) at offset 39 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task task) at offset 40 at System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1.ConfiguredValueTaskAwaiter.GetResult() at offset 30 at System.Net.Security.SslStreamInternal.<ReadAsyncInternal>d__32`1.MoveNext() at offset 903 ```" 28682 area-System.Security Confusing message when block padding did not conform to the specified mode "_From @coderfox on March 31, 2018 9:28_ With the following code: ```csharp using System; using System.IO; using System.Text; namespace Bang.CustomClient { public static class ApiCipher { public static byte[] key = Encoding.ASCII.GetBytes(""1234123412341234""); public static byte[] iv = Encoding.ASCII.GetBytes(""1234123412341234""); public static byte[] decrypt(byte[] ciphertext) { using (var aes = Aes.Create()) { Debug.Assert(aes != null, nameof(aes) + "" != null""); aes.Key = key; aes.IV = iv; aes.Padding = PaddingMode.None; using (var decryptor = aes.CreateDecryptor(aes.Key, aes.IV)) { var result = decryptor.TransformFinalBlock(ciphertext, 0, ciphertext.Length); return result; } } } } class Program { static void Main(string[] args) { var bin = File.ReadAllBytes(""http""); var dec = ApiCipher.decrypt(bin); Console.Write(Encoding.ASCII.GetString(dec)); } } } ``` If I comment `aes.Padding = PaddingMode.None;` (i.e. use PKCS7 padding), the program will throw: ``` Unhandled Exception: System.Security.Cryptography.CryptographicException: Specified padding mode is not valid for this algorithm. at Internal.Cryptography.UniversalCryptoDecryptor.DepadBlock(Byte[] block, Int32 offset, Int32 count) at Internal.Cryptography.UniversalCryptoDecryptor.UncheckedTransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount) at Internal.Cryptography.UniversalCryptoTransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount) at Bang.CustomClient.ApiCipher.decrypt(Byte[] ciphertext) in /Users/coderfox/Dev/Projects/BanGDreamHack/Bang.CustomClient/ApiCipher.cs:line 36 at Bang.CustomClient.Program.Main(String[] args) in /Users/coderfox/Dev/Projects/BanGDreamHack/Bang.CustomClient/Program.cs:line 12 ``` But if I uncomment the line, the program works. Besides, I have validated the input file with python, and it successfully decrypts. I am using dotnet-sdk `2.1.103` on macOS `10.13.1 (17B48)`. File `http` in `base64` is: ``` aeqsmc3eMswgJkz34BACmqZSo96E61H43Q5oK9NqXzM= ``` _Copied from original issue: dotnet/coreclr#17373_" 28683 area-System.Security ASN.1 Deserialize fails with SequenceOf strings "Let me preface this with the statement that I fully understand this is an internal-only API (for now at least). Nevertheless, this is a fairly important test case. Suppose an ASN.1 of ``` kdc-req ::= SEQUENCE { ... sname [3] PrincipalName OPTIONAL, ... } PrincipalName ::= SEQUENCE { name-type [0] Int32, name-string [1] SEQUENCE OF KerberosString } KerberosString ::= GeneralString (IA5String) ``` There are two issues here. 1. GeneralString is not actually supported. You cannot futz your way through by decorating the struct field to think it's an IA5String. I had to add a new attribute and modified the deserializer to treat it the same as IA5String. 2. SequenceOf GeneralString/IA5String cannot parse correctly *when there are multiple values in the sequence*. It decodes the array as a struct and throws because there's extra data. There's no way it can move on to the next element in the sequence. Conversely, you can't coerce the deserializer to operate against string[] because it can't be a SequenceOf and GeneralizedString/IA5String at the same time. ### Sample This will throw when it finishes reading the first string of `sname`. It'll complete the pass over the struct fields, but there's more data in the sequence. I think it would be helpful if you could decorate a `SequenceOf` as a specialized type, e.g. `GeneralizedString`. ```c# var asReq = ""3081d3a103020105a20302010aa31530133011a10402020080a20904073005a0030101ffa481af30"" + ""81aca00703050040810010a1153013a003020101a10c300a1b087374737966756873a2091b07524"" + ""5444d4f4e44a31c301aa003020102a11330111b066b72627467741b075245444d4f4e44a511180f3"" + ""2303337303931333032343830355aa611180f32303337303931333032343830355aa70502036875"" + ""0da81530130201120201110201170201180202ff79020103a91d301b3019a003020114a11204104"" + ""d494e494e542d364a49454842472020""; var req = AsnSerializer.Deserialize<KdcReq>(StringToByteArray(asReq), AsnEncodingRules.DER); [StructLayout(LayoutKind.Sequential)] public struct KdcReq { /* AS-REQ ::= [APPLICATION 10] KDC-REQ TGS-REQ ::= [APPLICATION 12] KDC-REQ KDC-REQ ::= SEQUENCE { -- NOTE: first tag is [1], not [0] pvno [1] INTEGER (5) , msg-type [2] INTEGER (10 -- AS -- | 12 -- TGS --), padata [3] SEQUENCE OF PA-DATA OPTIONAL -- NOTE: not empty --, req-body [4] KDC-REQ-BODY }*/ [ExpectedTag(1, ExplicitTag = true)] public int pvno; [ExpectedTag(2, ExplicitTag = true)] public int msgType; [ExpectedTag(3, ExplicitTag = true)] public PaData[] PaData; [ExpectedTag(4, ExplicitTag = true)] public KdcReqBody reqBody; } [StructLayout(LayoutKind.Sequential)] public struct PaData { // padata-type[1] Int32, // padata-value[2] OCTET STRING -- might be encoded AP-REQ [ExpectedTag(1, ExplicitTag = true)] public int paDataType; [ExpectedTag(2, ExplicitTag = true), OctetString] public ReadOnlyMemory<byte> paDataValue; } [StructLayout(LayoutKind.Sequential)] public struct KdcReqBody { /* kdc-options [0] KDCOptions, cname [1] PrincipalName OPTIONAL -- Used only in AS-REQ --, realm [2] Realm -- Server's realm -- Also client's in AS-REQ --, sname [3] PrincipalName OPTIONAL, from [4] KerberosTime OPTIONAL, till [5] KerberosTime, rtime [6] KerberosTime OPTIONAL, nonce [7] UInt32, etype [8] SEQUENCE OF Int32 -- EncryptionType -- in preference order --, addresses [9] HostAddresses OPTIONAL, enc-authorization-data [10] EncryptedData OPTIONAL -- AuthorizationData --, additional-tickets [11] SEQUENCE OF Ticket OPTIONAL -- NOTE: not empty */ [ExpectedTag(0, ExplicitTag = true), BitString] public ReadOnlyMemory<byte> kdcOptions; [ExpectedTag(1, ExplicitTag = true), OptionalValue] public PrincipalName? cname; [ExpectedTag(2)] public KerberosString realm; [ExpectedTag(3, ExplicitTag = true), OptionalValue] public PrincipalName? sname; [ExpectedTag(4, ExplicitTag = true), GeneralizedTime, OptionalValue] public DateTimeOffset? from; [ExpectedTag(5, ExplicitTag = true), GeneralizedTime] public DateTimeOffset till; [ExpectedTag(6, ExplicitTag = true), GeneralizedTime, OptionalValue] public DateTimeOffset? rtime; [ExpectedTag(7, ExplicitTag = true)] public uint nonce; [ExpectedTag(8, ExplicitTag = true)] public int[] etype; [ExpectedTag(9, ExplicitTag = true)] public HostAddress[] addresses; [ExpectedTag(10, ExplicitTag = true), OptionalValue] public EncryptedData? encAuthorizationData; [ExpectedTag(11, ExplicitTag = true), OptionalValue] public Ticket[] additionalTickets; } [StructLayout(LayoutKind.Sequential)] public struct PrincipalName { // name-type[0] Int32, // name-string[1] SEQUENCE OF KerberosString [ExpectedTag(0, ExplicitTag = true)] public int nameType; [ExpectedTag(1)] public KerberosString[] nameString; // this does not work either // [ExpectedTag(1), GeneralizedString] // public string[] nameString; } [StructLayout(LayoutKind.Sequential)] public struct KerberosString { [GeneralizedString] public string name; } [StructLayout(LayoutKind.Sequential)] public struct HostAddress { // addr-type[0] Int32, // address[1] OCTET STRING [ExpectedTag(0, ExplicitTag = true)] public int addrType; [ExpectedTag(1, ExplicitTag = true), OctetString] public ReadOnlyMemory<byte> address; } [StructLayout(LayoutKind.Sequential)] public struct EncryptedData { // EncryptedData::= SEQUENCE { // etype[0] Int32 -- EncryptionType --, // kvno[1] UInt32 OPTIONAL, // cipher[2] OCTET STRING -- ciphertext // } [ExpectedTag(0, ExplicitTag = true)] public int etype; [ExpectedTag(1, ExplicitTag = true), OptionalValue] public int kvno; [ExpectedTag(2, ExplicitTag = true), OctetString] public ReadOnlyMemory<byte> cipher; } [StructLayout(LayoutKind.Sequential)] public struct AuthorizationData { [ExpectedTag(0, ExplicitTag = true)] public int adType; [ExpectedTag(1, ExplicitTag = true), OctetString] public ReadOnlyMemory<byte> adData; } [StructLayout(LayoutKind.Sequential)] public struct Ticket { } ```" 28686 area-System.Linq Possible bug with S.L.Expression: cannot generate assign expression for ref returning properties Relatively recently, ref returning properties were added to c#. I use them from time to time and i have serialization library that relied on ILGenerator but converted to S.L.Expression. There is problem: ref return properties have `CanWrite` set to false preventing easy generation of assign expressions! I use 4.7.1 Desktop framework for now with future plans to move to Core. Is this by design or overlooked? Is there some hack around this issue? 28692 area-System.IO Fix intermittent crashes on FileSystemEnumeration on Unix The code uses a leased byte[] to call readdir_r and the native struct (dirent) is stored in this array. The DirectoryEntry struct then points to the name of the file in the middle of the array. If the array is moved by GC before the struct is used it starts to point to a bogus name. Fixes #27740 Fixes #27504 Fixes #27038 28694 area-System.Console Console ReadKey echo escapes "@devel0 commented on [Sat Mar 31 2018](https://github.com/dotnet/core/issues/1398) Using Console.ReadKey(true) should not echo control keys but in linux terminal I got `^[OC` echos. ## version - **dotnet version** : 2.1.101 - **os** : ubuntu 17.10 ## repro ``` Console.ReadKey(true); ``` - press ""right arrow"" key ### expected - no echoes ### current behavior - echoed `^[OC` to the console " 28695 area-System.Net OSX: System.Net.Internals.SocketExceptionFactory+ExtendedSocketException "https://github.com/dotnet/corefx/pull/28643#issuecomment-377766657 ``` OSX.1012.Amd64.Open-x64-Debug System.Net.Tests.HttpListenerRequestTests ContentLength_GetProperty_ReturnsExpected(method: \""PUT\"", contentLengthString: \""Content-Length: 1\"", expected: 1, hasEntityBody: True) Unhandled Exception of Type System.Net.Internals.SocketExceptionFactory+ExtendedSocketException Message : System.Net.Internals.SocketExceptionFactory+ExtendedSocketException : Connection refused 127.0.0.1:1330 Stack Trace : at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.Sockets/src/System/Net/Sockets/Socket.cs:line 4421 at System.Net.Sockets.Socket.Connect(EndPoint remoteEP) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.Sockets/src/System/Net/Sockets/Socket.cs:line 832 at System.Net.Sockets.Socket.Connect(IPAddress[] addresses, Int32 port) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.Sockets/src/System/Net/Sockets/Socket.cs:line 947 --- End of stack trace from previous location where exception was thrown --- at System.Net.Sockets.Socket.Connect(IPAddress[] addresses, Int32 port) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.Sockets/src/System/Net/Sockets/Socket.cs:line 958 at System.Net.Sockets.Socket.Connect(String host, Int32 port) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.Sockets/src/System/Net/Sockets/Socket.cs:line 902 at System.Net.Tests.HttpListenerFactory.GetConnectedSocket() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.HttpListener/tests/HttpListenerFactory.cs:line 155 at System.Net.Tests.HttpListenerRequestTests..ctor() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.HttpListener/tests/HttpListenerRequestTests.cs:line 23 at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, Boolean wrapExceptions) in /Users/buildagent/agent/_work/482/s/src/mscorlib/src/System/RtType.cs:line 4833 ```" 28696 area-System.Net Test failure: System.Net.Http.Functional.Tests.PlatformHandler_HttpClientHandlerTest / ProxyAuth_Digest_Succeeds https://github.com/dotnet/corefx/pull/28643#issuecomment-377766657 ``` Windows.10.Amd64.Open-x86-Release ProxyAuth_Digest_Succeeds System.Net.Http.Functional.Tests.PlatformHandler_HttpClientHandlerTest Unhandled Exception of Type System.TimeoutException Message : System.TimeoutException : WhenAllOrAnyFailed timed out after 60000 Stack Trace : at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks, Int32 millisecondsTimeout) in D:\j\workspace\windows-TGrou---f8ac6754\src\Common\tests\System\Threading\Tasks\TaskTimeoutExtensions.cs:line 53 at System.Net.Http.Functional.Tests.HttpClientHandlerTest.<>c__DisplayClass114_0.<<ProxyAuth_Digest_Succeeds>b__0>d.MoveNext() in D:\j\workspace\windows-TGrou---f8ac6754\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.cs:line 3014 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.CreateServerAsync(Func`2 funcAsync, Options options) in D:\j\workspace\windows-TGrou---f8ac6754\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 67 at System.Net.Http.Functional.Tests.HttpClientHandlerTest.ProxyAuth_Digest_Succeeds() in D:\j\workspace\windows-TGrou---f8ac6754\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.cs:line 3000 --- End of stack trace from previous location where exception was thrown --- ``` 28697 area-System.Diagnostics Bug: DelimitedListTraceListener Class strange output "I think there is something wrong with the DelimitedListTraceListener class. I used this code: ``` var Listener = new DelimitedListTraceListener(""test.txt""); Listener.Delimiter = "",""; Trace.Listeners.Add(Listener); Trace.Write(""x""); Trace.WriteLine(""y""); Trace.TraceError(""z""); Trace.TraceInformation(""w""); Trace.Flush(); ``` And this is what I found written in the file: > xy ""WindowsFormsApp8.exe"",Error,0,""z"",,,,,,, ""WindowsFormsApp8.exe"",Information,0,""w"",,,,,,, Is this right? And if it is, what does it mean? Why doesn't the write method add the delimiter, and what are those too many delimiters added by the TraceError and TraceInformation methods? By the way: I suggest to add Write(string[]) and Write(object[]) overloads to write the array elements separated by the delimiter. " 28700 area-System.Data DataTable serialisation is broken between 2.1 and previous versions or .NET framework The fix #27286 broke DataTable serialization between the previous versions and 2.1 version netcore. It fails with the following error when deserializing data stored using the previous version on netcore 2.1. ``` System.Runtime.Serialization.SerializationException : Member 'DataTable.DataColumn_0.DataType_AssemblyQualifiedName' was not found. ``` 28702 area-System.Memory Created tests for default and empty ReadOnlySequence I created tests for default and empty ReadOnlySequence. Also I fixed issues with new tests. 28703 area-System.Net CurlHandler: catastrophic failure with GetAsync_SecureAndNonSecureIPBasedUri_CorrectlyFormatted test The test consistently cause catastrophic failure on Centos, Fedora, RedHat, and Ubuntu 1804, while passing on other distros. It could be different CurlHandler version causing the issue. (Since Windows run is green every time). 28704 area-System.Net SocketsHttpHandler: if server sends invalid NT auth challenge, don't continue processing Fixes #28648 @Tratcher @stephentoub @davidsh @dotnet/ncl 28707 area-System.Net Investigate perf improvements to Uri for SocketsHttpHandler usage For simple requests, SocketsHttpHandler ends up spending a fair amount of CPU retrieving info from Uri (e.g. Uri.IdnHost and similar). This also causes a fair amount of allocation in some cases. Ideally we could reduce both CPU and allocation by using `ReadOnlySpan<char>` to retrieve the info we need. In common cases where no escaping/encoding is necessary, this should help significantly. 28708 area-System.Net SocketsHttpHandler: Proxied IP address (IPv4 & IPv6) requests missing `Proxy-Connection: Keep-Alive` header "Example: WinHttpHandler & Framework: `In value: List<String> [""GET http://321.123.456.789/ HTTP/1.1"", ""Proxy-Connection: Keep-Alive"", ""Host: 321.123.456.789""]` `In value: List<String> [""GET http://[::1234]/ HTTP/1.1"", ""Host: [::1234]"", ""Proxy-Connection: Keep-Alive""]` SocketsHttpHandler: `In value: List<String> [""GET http://321.123.456.789/ HTTP/1.1"", ""Host: 321.123.456.789""]` `In value: List<String> [""GET http://::1234/ HTTP/1.1"", ""Host: [::1234]""]` `Proxy-Connection: Keep-Alive` header is missing in both cases. " 28709 area-System.Net Test failure: System.Net.Security.Tests.ApmSslStreamSystemDefaultTest / ClientAndServer_OneUsesDefault_OtherUsesLowerProtocol_Fails Tests: System.Net.Security.Tests.ApmSslStreamSystemDefaultTest.ClientAndServer_OneUsesDefault_OtherUsesLowerProtocol_Fails System.Net.Security.Tests.AsyncSslStreamSystemDefaultTest.ClientAndServer_OneUsesDefault_OtherUsesLowerProtocol_Fails System.Net.Security.Tests.SyncSslStreamSystemDefaultTest.ClientAndServer_OneUsesDefault_OtherUsesLowerProtocol_Fails had failed with Assert.Throws() Failure\nExpected: typeof(System.Exception)\nActual: (No exception was thrown) Details: https://ci.dot.net/job/dotnet_corefx/job/master/job/centos7.1_debug/6051/testReport/ ~~~ MESSAGE: Assert.Throws() Failure\nExpected: typeof(System.Exception)\nActual: (No exception was thrown) +++++++++++++++++++ STACK TRACE: at System.Net.Security.Tests.SslStreamSystemDefaultTest.ClientAndServer_OneUsesDefault_OtherUsesLowerProtocol_Fails(Nullable`1 clientProtocols, Nullable`1 serverProtocols) in /mnt/resource/j/workspace/dotnet_corefx/master/centos7.1_debug/src/System.Net.Security/tests/FunctionalTests/SslStreamSystemDefaultsTest.cs:line 95 --- End of stack trace from previous location where exception was thrown --- ~~~ 28711 area-Infrastructure Getting warning with some packages when I build I updated my .net library to 4.7.1. It successfully builds but I get some warnings:  I removed the packages and reinstalled them, rebuild, but still the same warnings. 28712 area-System.Threading Increase iteration counts in threading perf tests Relevant to https://github.com/dotnet/coreclr/issues/17345 ``` Before: System.Threading.Performance.Tests.dll | Metric | Unit | Iterations | Average | STDEV.S | Min | Max :------------------------------------------------------------ |:-------- |:----:|:----------:| -------:| ----------:| -----:| -----: System.Threading.Tests.Perf_EventWaitHandle.Set_Reset | Duration | msec | 1000 | 0.006 | 0.003 | 0.005 | 0.053 System.Threading.Tests.Perf_Interlocked.Add_int | Duration | msec | 100 | 0.007 | 1.856E-004 | 0.007 | 0.008 System.Threading.Tests.Perf_Interlocked.Add_long | Duration | msec | 100 | 0.007 | 0.003 | 0.006 | 0.026 System.Threading.Tests.Perf_Interlocked.CompareExchange_int | Duration | msec | 100 | 0.004 | 0.003 | 0.004 | 0.021 System.Threading.Tests.Perf_Interlocked.CompareExchange_long | Duration | msec | 100 | 0.004 | 0.002 | 0.004 | 0.021 System.Threading.Tests.Perf_Interlocked.Decrement_int | Duration | msec | 100 | 0.007 | 1.495E-004 | 0.007 | 0.007 System.Threading.Tests.Perf_Interlocked.Decrement_long | Duration | msec | 100 | 0.008 | 0.005 | 0.006 | 0.049 System.Threading.Tests.Perf_Interlocked.Exchange_int | Duration | msec | 100 | 0.007 | 0.002 | 0.007 | 0.023 System.Threading.Tests.Perf_Interlocked.Exchange_long | Duration | msec | 100 | 0.007 | 2.119E-004 | 0.007 | 0.009 System.Threading.Tests.Perf_Interlocked.Increment_int | Duration | msec | 100 | 0.007 | 1.134E-004 | 0.007 | 0.007 System.Threading.Tests.Perf_Interlocked.Increment_long | Duration | msec | 100 | 0.007 | 0.002 | 0.007 | 0.025 System.Threading.Tests.Perf_Lock.ReaderWriterLockSlimPerf | Duration | msec | 100 | 0.003 | 1.681E-004 | 0.003 | 0.004 System.Threading.Tests.Perf_Monitor.EnterExit | Duration | msec | 100 | 0.005 | 0.002 | 0.005 | 0.021 System.Threading.Tests.Perf_Monitor.TryEnterExit | Duration | msec | 100 | 0.002 | 2.455E-004 | 0.002 | 0.004 System.Threading.Tests.Perf_SpinLock.EnterExit | Duration | msec | 100 | 0.010 | 0.006 | 0.008 | 0.048 System.Threading.Tests.Perf_SpinLock.TryEnterExit | Duration | msec | 100 | 0.008 | 0.003 | 0.008 | 0.026 System.Threading.Tests.Perf_Volatile.Read_double | Duration | msec | 100 | 0.002 | 0.002 | 0.001 | 0.018 System.Threading.Tests.Perf_Volatile.Write_double | Duration | msec | 100 | 0.002 | 2.533E-004 | 0.002 | 0.004 After: System.Threading.Performance.Tests.dll | Metric | Unit | Iterations | Average | STDEV.S | Min | Max :------------------------------------------------------------ |:-------- |:----:|:----------:| -------:| -------:| ------:| ------: System.Threading.Tests.Perf_EventWaitHandle.Set_Reset | Duration | msec | 100 | 61.277 | 0.771 | 60.692 | 66.405 System.Threading.Tests.Perf_Interlocked.Add_int | Duration | msec | 100 | 63.767 | 1.554 | 63.182 | 77.342 System.Threading.Tests.Perf_Interlocked.Add_long | Duration | msec | 100 | 63.669 | 1.059 | 63.160 | 70.719 System.Threading.Tests.Perf_Interlocked.CompareExchange_int | Duration | msec | 100 | 63.805 | 1.669 | 63.180 | 74.795 System.Threading.Tests.Perf_Interlocked.CompareExchange_long | Duration | msec | 100 | 63.465 | 0.169 | 63.182 | 63.934 System.Threading.Tests.Perf_Interlocked.Decrement_int | Duration | msec | 100 | 66.444 | 3.587 | 63.206 | 77.222 System.Threading.Tests.Perf_Interlocked.Decrement_long | Duration | msec | 100 | 63.867 | 2.026 | 63.178 | 77.969 System.Threading.Tests.Perf_Interlocked.Exchange_int | Duration | msec | 100 | 68.325 | 3.153 | 59.724 | 79.176 System.Threading.Tests.Perf_Interlocked.Exchange_long | Duration | msec | 100 | 63.486 | 0.439 | 63.100 | 66.889 System.Threading.Tests.Perf_Interlocked.Increment_int | Duration | msec | 100 | 63.503 | 0.334 | 63.175 | 64.845 System.Threading.Tests.Perf_Interlocked.Increment_long | Duration | msec | 100 | 63.544 | 0.400 | 63.204 | 65.800 System.Threading.Tests.Perf_Lock.ReaderWriterLockSlimPerf | Duration | msec | 100 | 55.961 | 0.338 | 55.576 | 57.365 System.Threading.Tests.Perf_Monitor.EnterExit | Duration | msec | 100 | 67.236 | 0.462 | 66.876 | 71.239 System.Threading.Tests.Perf_Monitor.TryEnterExit | Duration | msec | 100 | 67.323 | 0.441 | 66.852 | 69.791 System.Threading.Tests.Perf_SpinLock.EnterExit | Duration | msec | 100 | 72.317 | 2.919 | 71.308 | 91.634 System.Threading.Tests.Perf_SpinLock.TryEnterExit | Duration | msec | 100 | 71.845 | 0.978 | 71.207 | 78.743 System.Threading.Tests.Perf_Volatile.Read_double | Duration | msec | 100 | 37.493 | 0.524 | 37.116 | 40.922 System.Threading.Tests.Perf_Volatile.Write_double | Duration | msec | 100 | 50.883 | 0.284 | 50.519 | 52.009 ``` 28713 area-System.IO Directory.Exists returns false with drive's device path name "Hi, Code like `Directory.Exists(""\\\\?\\C:\\"")` always returns false, even the drive does exist. `Directory.Exists(""\\\\?\\C:\\Folder\\"")` can get directory's existence correct. This behavior is different with the one in .Net Framework. Could anyone help to take a look? [EDIT] Add proper code formatting by @karelz" 28714 area-System.Diagnostics TraceSource indent bug "TraceSource is affected by the indent set before the calling output methods for the first time. After that changing the indent doesn't affect the TraceSource output. ``` var mySource = new TraceSource(""Test"", SourceLevels.All); Trace.IndentLevel = 2; mySource.TraceEvent(TraceEventType.Error, 1, ""TraceSource1""); Trace.WriteLine(""Trace1""); Trace.IndentLevel = 1; mySource.TraceEvent(TraceEventType.Error, 2, ""TraceSource2""); Trace.WriteLine(""Trace2""); mySource.TraceEvent(TraceEventType.Error, 3, ""TraceSource3""); ``` This is the output: > Test Error: 1 : TraceSource1 > Trace1 > Test Error: 2 : TraceSource2 > Trace2 > Test Error: 3 : TraceSource3 The only way to solve this is to creat a new instance of the TraceSource class before changing the indent.. This code will work as expected: ``` var mySource = new TraceSource(""Test"", SourceLevels.All); Trace.IndentLevel = 2; mySource.TraceEvent(TraceEventType.Error, 1, ""TraceSource1""); Trace.WriteLine(""Trace1""); mySource = new TraceSource(""Test"", SourceLevels.All); Trace.IndentLevel = 1; mySource.TraceEvent(TraceEventType.Error, 2, ""TraceSource2""); Trace.WriteLine(""Trace2""); mySource.TraceEvent(TraceEventType.Error, 3, ""TraceSource3""); ``` This is the output: > Test Error: 1 : TraceSource1 > Trace1 > Test Error: 2 : TraceSource2 > Trace2 > Test Error: 3 : TraceSource3 Note: I reported another 2 bugs related to System.Diagnostics here: https://github.com/dotnet/corefx/issues/28697 " 28715 area-Infrastructure Fix cmake toolchain compile flags loop - fix https://github.com/dotnet/corert/issues/5093 - cmake toolchain refactoring [EDIT] Fix formatting - link the hyperlink by @karelz 28716 area-System.Numerics Make decimal API more complete (number of decimal digits, equality, negative zero) "@GSPP commented on [Mon Apr 02 2018](https://github.com/dotnet/coreclr/issues/17378) 1. It is currently not possible to query the number of decimal digits in a decimal value. Note, that decimal can store trailing zeroes. 1m != 1.0m != 1.00m. There are methods to find out but they are nasty (https://stackoverflow.com/questions/13477689/find-number-of-decimal-places-in-decimal-value-regardless-of-culture). A fundamental type such as decimal should make this easier. `GetBits` causes an expensive allocation. 2. All Framework provided decimal equality comparisons treat trailing zeros as irrelevant. All of the following are true: `1.0m == 1.00m`, `1.0m.Equals(1.00m)`, `1.0m.GetHashCode() == 1.00m.GetHashCode()`. This is correct but there also should be a way to compare while being sensitive to trailing zeroes. There need to be equality and hash code APIs observing trailing zeroes. 3. Be able to reflect over negative zero. There are multiple representations for zero in decimal (https://stackoverflow.com/a/3139783). `decimal.GetBits(0.0m) != decimal.GetBits(-0.0m)` and `-0.0m == 0.0m`. There should be an `IsNegative` property. Note, that `(-0.0m).ToString() == ""0.0""`. This means that the sign cannot even be found out from the string representation. 4. Maybe there should be more helper APIs around trailing zeroes. For example, an API to set the number of decimal places. This API would add or remove trailing zeroes. I believe the `Round` methods only remove but do not add zeroes. These API requests are motivated by my work on a financial application. Different 3rd party data sources needed to be interpreted and combined in awkward ways. Dealing with these issue should not be that hard. The internet is full of people trying to solve these various decimal issues. There should be obvious and simple framework methods. Using code from the web (Stack Overflow) to address any of this is very risky because the code might be faulty. --- @RussKeldorph commented on [Mon Apr 02 2018](https://github.com/dotnet/coreclr/issues/17378#issuecomment-377962550) @danmosemsft --- @danmosemsft commented on [Mon Apr 02 2018](https://github.com/dotnet/coreclr/issues/17378#issuecomment-377974800) @tannergooding any thoughts? --- @danmosemsft commented on [Mon Apr 02 2018](https://github.com/dotnet/coreclr/issues/17378#issuecomment-377974886) Since this includes API requests. moving to corefx. " 28717 area-System.Security Fix the message for Cryptography_InvalidPadding "Also audited all usages of this string to ensure they had the ""the padding is wrong"" semantic instead of the ""I don't know how to do this padding"" semantic. Only one usage was seemingly wrong, and while it's in a Debug.Fail block it got fixed anyways. Fixes #28682. .NET Core `Cryptography_InvalidPadding` now matches .NET Framework `Cryptography_PKCS7_InvalidPadding` (which was used for padding other than PKCS7). .NET Framework had no `Cryptography_InvalidPadding`." 28719 area-System.Net System.Net.Http.Functional.Tests.PlatformHandler_HttpRetryProtocolTests/GetAsync_RetryOnConnectionClosed_Success CI failure OSX.1013.Amd64.Open-x64-Debug ``` System.Exception : Unexpected EOF trying to read request header at System.Net.Test.Common.LoopbackServer.Connection.ReadRequestHeaderAsync() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/Common/tests/System/Net/Http/LoopbackServer.cs:line 378 at System.Net.Http.Functional.Tests.HttpRetryProtocolTests.<>c.<<GetAsync_RetryOnConnectionClosed_Success>b__3_2>d.MoveNext() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.Http/tests/FunctionalTests/HttpRetryProtocolTests.cs:line 56 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.AcceptConnectionAsync(Func`2 funcAsync) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/Common/tests/System/Net/Http/LoopbackServer.cs:line 117 at System.Net.Http.Functional.Tests.HttpRetryProtocolTests.<>c.<<GetAsync_RetryOnConnectionClosed_Success>b__3_1>d.MoveNext() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.Http/tests/FunctionalTests/HttpRetryProtocolTests.cs:line 50 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.<>c__DisplayClass11_0.<<CreateClientAndServerAsync>b__0>d.MoveNext() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/Common/tests/System/Net/Http/LoopbackServer.cs:line 84 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.CreateServerAsync(Func`2 funcAsync, Options options) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/Common/tests/System/Net/Http/LoopbackServer.cs:line 67 at System.Net.Http.Functional.Tests.HttpRetryProtocolTests.GetAsync_RetryOnConnectionClosed_Success() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.Http/tests/FunctionalTests/HttpRetryProtocolTests.cs:line 31 --- End of stack trace from previous location where exception was thrown --- ``` 28720 area-System.Text Fix allocated Encoding memory initialization Fixes #28438 We allocate native memory using GlobalHAlloc which usually doesn’t zero out the allocated memory and that causes a problem when using this memory. We fixed a similar issue before in SBCS but looks we missed the DBCS one. 28721 area-System.Drawing Two System.Drawing Test failues > System.Drawing.Tests.BitmapTests.MakeTransparent_GrayscalePixelFormat_ThrowsArgumentException [FAIL] > Assert.Throws() Failure > Expected: typeof(System.Runtime.InteropServices.ExternalException) > Actual: (No exception was thrown) > Stack Trace: > C:\Users\diosloco\Documents\Repos\corefx\src\System.Drawing.Common\tests\BitmapTests.cs(964,0): at System.Drawing.Tests.BitmapTests.MakeTransparent_GrayscalePixelFormat_ThrowsArgumentException() > System.Drawing.Imaging.Tests.MetafileTests.Ctor_RectangleFEmpty_Success(description: null) [FAIL] > System.Runtime.InteropServices.ExternalException : A generic error occurred in GDI+. > Stack Trace: > C:\Users\diosloco\Documents\Repos\corefx\src\System.Drawing.Common\src\System\Drawing\Imaging\Metafile.Windows.cs(325,0): at System.Drawing.Imaging.Metafile..ctor(String fileName, IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit, EmfType type, String description) > C:\Users\diosloco\Documents\Repos\corefx\src\System.Drawing.Common\tests\Imaging\MetafileTests.cs(571,0): at System.Drawing.Imaging.Tests.MetafileTests.Ctor_RectangleFEmpty_Success(String description) I'm at commit 54d131f4174491bc2a7f5d6e4b0b8b725d299a8f. 28722 area-System.Net WinHttp should accept Uri.IdnHost for WinHttpConnect() For WinHttpHandler, we directly pass `Host` for `WinHttpConnect` instead of `idnHost`. We need to change it to `Uri.IdnHost` instead. See: https://github.com/dotnet/corefx/issues/28557#issuecomment-377085162: > Passing in Uri.Host will potentially pass in Unicode host names to the WinHTTP API. And that API can't accept that. Unfortunately, we have no tests around this. https://github.com/dotnet/corefx/blob/9e8d443ff78c4f0a9a6bedf7f95961cf96ceff0a/src/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpHandler.cs#L786-L790 28724 area-System.Security SslStream with CRL checking enabled throws CryptographicException on Linux upon upgrade of server certificates "**Overview** A Linux application speaking to a server using SslStream will no longer be able to connect if the server upgrades its certificates such that it contains a new CRL distribution point (e.g. a different URL). After this upgrade, SslStream will throw a CryptographicException (error code 44) from Internal.Cryptography.Pal.OpenSslX509ChainProcessor.MapVerifyErrorToChainStatus. Error code 44 maps to X509_V_ERR_DIFFERENT_CRL_SCOPE (see https://github.com/openssl/openssl/blob/3bb0f989b53c59c6d4527a0b5077dbb7fabe14b7/include/openssl/x509_vfy.h#L144). **Workaround** Clearing the cached CRL at ~/.dotnet/corefx/cryptography/crls prior to the certificate upgrade will allow the application to connect without any downtime, assuming that the application doesn't reacquire another copy of the old CRL (e.g. due to a disconnect/reconnect). The filename will be the hashed issuer's name. (see https://github.com/dotnet/corefx/blob/722d50c8957297009dbce771f3ea317cccf457be/src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Unix/CrlCache.cs#L139-L162) **Hypothesis** The exception is likely thrown because even though the new certificate specifies a new CRL distribution point, the issuer name has not changed, so the cache thinks it contains a valid CRL for the new certificate and does not download the new CRL even though the distribution point has changed. However, when the interop library calls OpenSSL to verify the certificate stores, the error code 44 is generated and an exception is later thrown from Internal.Cryptography.Pal.OpenSslX509ChainProcessor.MapVerifyErrorToChainStatus. I believe this error code is generated due to the mismatch between the cached CRL's distribution point and the distribution point specified in the new certificate. **Possible fix** Using the hash of the CRL distribution point string as the filename for the cached CRL should prevent this problem. However, I am uncertain if there are OpenSSL interop implications if a different filename is used for the cached CRL. There does seem to be precedent in OpenSSL for using the hash of the issuer name as the file name for cached copy of CRL (see https://www.openssl.org/docs/manmaster/man3/X509_LOOKUP_file.html) **Reproduction** Create a chain of certificates that mimics certificates issued by DigiCert SHA2 Secure Server CA. The final server certificates ""A"" and ""B"" should be issued for the same FQDN but with different distribution points (simulating an upgrade of the server certificate). My apologies if these steps are already self-evident for those with more SSL experience, but these are the steps I used: 1. Create a self signed root CA such that ""X509v3 Key Usage: Digital Signature, Certificate Sign, CRL Sign"". 2. Generate a CRL for the root CA, taking care that the CRL does _not_ have a X509v3 Issuing Distribution Point (IDP). 3. Create an intermediate certificate authority with the same key usage as the root CA and with an X509v3 IDP pointing to the CRL generated in step 2. 4. Generate a CRL for the intermediate CA. This CRL should contain an X509v3 IDP. 5. Create the server certificate ""A"" signed by the intermediate CA. This certificate should have an X509v3 IDP that matches the IDP for the CRL generated in step 4. 6. Generate another CRL for the intermediate CA with a different filename from the one in (4). This CRL also should have an X509v3 IDP. 7. Create the server certificate ""B"", signed by the intermediate CA. This certificate should have an X509v3 IDP that matches the IDP of the CRL generated in step 6. 8. Install the root CA by copying the certificate to its own directory under /usr/local/share/ca-certificates/, setting the permissions to 644, and running update-ca-certificates. 9. Host a test server using openssl s_server: ""openssl s_server -port 44330 -key keyA.pem -cert certA.pem -CAfile intermediatecert.pem"". 10. Create a test app that connects to the OpenSSL s_server using SslStream, calling AuthenticateAsClient with checkCertificateRevocation: true. After it connects successfully, bring down the test server and re-host it using B's certs and key. The test app should now throw the CryptographicException. I’ve included my test app (targeting netcoreapp2.0) and stack trace. I’ve successfully reproduced this in a Debian Stretch Docker container (.NET Core SDK 2.1.101, .NET Core runtime: 2.0.5, OpenSSL 1.0.2k-fips) as well as in an Ubuntu 16.04.4 LTS instance (.NET Core SDK 2.1.300-preview1-008174, .NET Core runtime: 2.1.0-preview1-26216-03, OpenSSL 1.0.2g). ``` Unhandled Exception: System.Security.Cryptography.CryptographicException: Error occurred during a cryptographic operation. at Internal.Cryptography.Pal.OpenSslX509ChainProcessor.MapVerifyErrorToChainStatus(X509VerifyStatusCode code) at Internal.Cryptography.Pal.OpenSslX509ChainProcessor.AddElementStatus(X509VerifyStatusCode errorCode, List`1 elementStatus, List`1 overallStatus) at Internal.Cryptography.Pal.OpenSslX509ChainProcessor.AddElementStatus(List`1 errorCodes, List`1 elementStatus, List`1 overallStatus) at Internal.Cryptography.Pal.OpenSslX509ChainProcessor.BuildChain(X509Certificate2 leaf, HashSet`1 candidates, HashSet`1 systemTrusted, OidCollection applicationPolicy, OidCollection certificatePolicy, X509RevocationMode revocationMode, X509RevocationFlag revocationFlag, DateTime verificationTime, TimeSpan& remainingDownloadTime) at Internal.Cryptography.Pal.ChainPal.BuildChain(Boolean useMachineContext, ICertificatePal cert, X509Certificate2Collection extraStore, OidCollection applicationPolicy, OidCollection certificatePolicy, X509RevocationMode revocationMode, X509RevocationFlag revocationFlag, DateTime verificationTime, TimeSpan timeout) at System.Security.Cryptography.X509Certificates.X509Chain.Build(X509Certificate2 certificate, Boolean throwOnException) at System.Security.Cryptography.X509Certificates.X509Chain.Build(X509Certificate2 certificate) at System.Net.Security.CertificateValidation.BuildChainAndVerifyProperties(X509Chain chain, X509Certificate2 remoteCertificate, Boolean checkCertName, String hostName) at System.Net.Security.SecureChannel.VerifyRemoteCertificate(RemoteCertValidationCallback remoteCertValidationCallback, ProtocolToken& alertToken) at System.Net.Security.SslState.CompleteHandshake(ProtocolToken& alertToken) at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.PartialFrameCallback(AsyncProtocolRequest asyncRequest) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Net.Security.SslState.InternalEndProcessAuthentication(LazyAsyncResult lazyResult) at System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult result) at System.Net.Security.SslStream.EndAuthenticateAsClient(IAsyncResult asyncResult) at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Ssl.SslTcpClient.RunClient(String machineName, String serverName) in /home/vincent/cached-crl-test-app/Ssl/SslTcpClient.cs:line 51 at cached_crl_test_app.Program.Main(String[] args) in /home/vincent/cached-crl-test-app/cached-crl-test-app/Program.cs:line 42 ``` ```c# // Program.cs using System; namespace cached_crl_test_app { class Program { static void Main(string[] args) { string serverCertificateName = ""tyche""; string machineName = ""tyche""; while (true) { Console.WriteLine(""Press enter to connect and send a message.""); Console.ReadLine(); Console.WriteLine(""Attempting to connect...""); SslTcpClient.RunClient(machineName, serverCertificateName); } } } } // SslTcpClient.cs using System; using System.IO; using System.Linq; using System.Net.Security; using System.Net.Sockets; using System.Security.Authentication; using System.Security.Cryptography.X509Certificates; using System.Text; namespace Ssl { public class SslTcpClient { // Purely for debugging purposes, not needed public static bool ValidateServerCertificate( object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { var errors = chain.ChainStatus.Aggregate("""", (str, x) => str + "","" + x.Status); Console.WriteLine($""SslPolicyError: {sslPolicyErrors} {errors}""); foreach (var item in chain.ChainElements) foreach (var elemStatus in item.ChainElementStatus) Console.WriteLine(item.Certificate.Subject + ""->"" + elemStatus.StatusInformation); return true; } public static void RunClient(string machineName, string serverName) { var socket = new Socket(SocketType.Stream, ProtocolType.Tcp); socket.Connect(serverName, 44330); Console.WriteLine(""Client connected.""); using (var stream = new NetworkStream(socket)) { var sslStream = new SslStream(innerStream: stream, leaveInnerStreamOpen: false, userCertificateValidationCallback: ValidateServerCertificate); try { sslStream.AuthenticateAsClientAsync(serverName, new X509Certificate2Collection(), SslProtocols.Tls12, checkCertificateRevocation: true).GetAwaiter().GetResult(); } catch (AuthenticationException e) { Console.WriteLine(""Exception: {0}"", e.Message); if (e.InnerException != null) Console.WriteLine(""Inner exception: {0}"", e.InnerException.Message); Console.WriteLine(""Authentication failed - closing the connection.""); return; } var w = new StreamWriter(sslStream); w.WriteLine(""Hello from the client.""); w.Flush(); var serverMessage = ReadLine(new StreamReader(sslStream)); Console.WriteLine(""Server says: {0}"", serverMessage); Console.WriteLine(""Press enter to close the connection.""); Console.ReadLine(); } socket.Dispose(); Console.WriteLine(""Client closed.""); } static string ReadLine(StreamReader reader) => reader.ReadLine(); static void SendMessage(SslStream sslStream, string s=""Hello from the client."") => sslStream.Write(Encoding.UTF8.GetBytes(s)); } } ``` [edit: clarity, formatting, syntax highlighting, and typos] " 28725 area-System.Net SslStream IDN mapping host name on Windows Fixes https://github.com/dotnet/corefx/issues/28585 Adding IDN mapping as we do on OpenSsl implementation: https://github.com/dotnet/corefx/blob/c533892f2e57940ec9e66616288bf340b75a9217/src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSsl.cs#L129 First run (commit) was testing if SNI tests will work correctly with the fallback in SniHelper.DecodeString removed (fallback to utf-8 string in case idn unmapping failed) 28727 area-Infrastructure Investigate disabled tests which are already fixed - [x] Find tests marked as ActiveIssue which are no longer active - [x] <s>Re-enable issues</s> Send e-mails to owners/ping/reopen issue cc: @karelz 28728 area-System.Threading Switch threading perf tests to use constant instead of Benchmark.InnerIteration Followup to https://github.com/dotnet/corefx/pull/28712 28729 area-Infrastructure Add CI leg for non ENU Windows Roslyn has successfully added such a leg based on es-ES Please add a CI leg for corefx following this pattern: https://github.com/dotnet/roslyn/commit/b282a6486f1a7f09ceee7fcd9ed5d24d67cc4af7 It should be optional at first until we get it clean. When in place this should avoid introducing many of the kinds of issues @AlexRadch has recently been working through 28730 area-Infrastructure Adding Begin.ps1 and End.ps1 tasks definitions 28733 area-System.Net Regression: HTTPS defaults to older TLS version for Win7 "On Win7/2008R2 the new SocketsHttpHandler uses older defaults for TLS versions than the WinHttpHandler it's replacing. SocketsHttpHandler defaults to TLS 1.0 while WinHttpHandler supports TLS 1.2, 1.1, and 1.0. This is a regression for updating apps. ASP.NET Core's Kestrel server defaults to TLS 1.1 and 1.2 so the new client can't connect to it using the default settings. Example: Github.com as removed TLS 1.0 support ``` Environment.SetEnvironmentVariable(""DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER"", ""true""); var handler = new HttpClientHandler(); // handler.SslProtocols = SslProtocols.Tls12; // Workaround var client = new HttpClient(handler); var response = await client.GetAsync(""https://github.com/""); Console.WriteLine(response); ``` Workaround: Override the protocol versions on the client. Found in ASP.NET Core's WebSocket Autobahn tests @geoffkizer @karelz " 28739 area-System.Text Speed up regex FindFirstChar when there are exactly 2 possible match start characters "Regex-Redux spends much of its time scanning its huge input string to find the first character of a match ([see perf analysis here](https://github.com/dotnet/corefx/issues/27124) - this is the 20% or more time noted in CharInClassInternal) This scan is the job of FindFirstChar(). In general character classes are complicated objects because they must store possibly several valid ranges, which may be character classes, as well as some options such as negating. They are packed objects and a binary search is used to check whether a candidate character matches the class. See http://www.moserware.com/2009/03/how-net-regular-expressions-really-work.html for a breakdown of how they work. We do some optimizations to avoid this binary search for every character. First is Boyer-Moore which helps for long fixed prefix. Second is [IsSingleton](https://github.com/dotnet/corefx/blob/master/src/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexInterpreter.cs#L420), which special cases for positive match of a single specific character. RegexRedux doesn't benefit much from either of these. It has no long prefix and in many cases there are several possible first characters. For example [here](https://github.com/dotnet/corefx/blob/master/src/System.Text.RegularExpressions/tests/Performance/Perf.RegexRedux.cs#L56) in `""agggt[cgt]aa|tt[acg]accct""` much of the time it is scanning for either `a` or `t`. In some cases there are some more options for example in `""agggtaa[cgt]|[acg]ttaccct""` it would start looking for `a`, `c` or `g` to begin the match. However two characters is the key case. At this point we are looking for localized low risk changes. Firstly I made a small speedup to the binary search by replacing `(min + max) / 2` with ` (min & max) + ((min ^ max) >> 1)` (apparently from Knuth .. it can be intuitively seen that halving the sum will retain all the bits they have in common, and half of all the bits they do not have in common). It is nice that it avoids overflow but that is not relevant in this case. This gave only a small improvement: I measured ~1% on an artificial test case and within noise on the full test. Nevertheless it is low harm so I retained it and used it in the other two binary searches in the file. Secondly I special cased the ""two possible characters"" as IsDoubleton in the same pattern as existing IsSingleton. This gave a larger benefit, with no measureable hit on the generic test case: ## before two runs: System.Text.RegularExpressions.Performance.Tests.dll | Metric | Unit | Iterations | Average | STDEV.S | Min | Max :--------------------------------------------------------------------------------- |:-------------- |:-----:|:----------:| ----------:| ---------:| ----------:| ----------: System.Text.RegularExpressions.Tests.Perf_Regex.Match | Duration | msec | 44 | 229.951 | 11.146 | 219.932 | 258.559 System.Text.RegularExpressions.Tests.Perf_Regex.Match | GC Allocations | bytes | 44 | 1.871E+008 | 48478.158 | 1.870E+008 | 1.872E+008 System.Text.RegularExpressions.Tests.RegexRedux.RegexReduxMini(options: Compiled) | Duration | msec | 27 | 377.521 | 20.081 | 335.727 | 419.947 System.Text.RegularExpressions.Tests.RegexRedux.RegexReduxMini(options: None) | Duration | msec | 15 | 709.439 | 31.986 | 655.717 | 765.097 System.Text.RegularExpressions.Performance.Tests.dll | Metric | Unit | Iterations | Average | STDEV.S | Min | Max :--------------------------------------------------------------------------------- |:-------------- |:-----:|:----------:| ----------:| ---------:| ----------:| ----------: System.Text.RegularExpressions.Tests.Perf_Regex.Match | Duration | msec | 45 | 226.408 | 13.236 | 212.146 | 262.963 System.Text.RegularExpressions.Tests.Perf_Regex.Match | GC Allocations | bytes | 45 | 1.871E+008 | 46358.265 | 1.869E+008 | 1.872E+008 System.Text.RegularExpressions.Tests.RegexRedux.RegexReduxMini(options: Compiled) | Duration | msec | 28 | 366.970 | 17.217 | 337.323 | 407.299 System.Text.RegularExpressions.Tests.RegexRedux.RegexReduxMini(options: None) | Duration | msec | 15 | 700.781 | 35.247 | 653.294 | 790.779 ## after two runs: System.Text.RegularExpressions.Performance.Tests.dll | Metric | Unit | Iterations | Average | STDEV.S | Min | Max :--------------------------------------------------------------------------------- |:-------------- |:-----:|:----------:| ----------:| ---------:| ----------:| ----------: System.Text.RegularExpressions.Tests.Perf_Regex.Match | Duration | msec | 46 | 220.359 | 7.715 | 213.496 | 247.767 System.Text.RegularExpressions.Tests.Perf_Regex.Match | GC Allocations | bytes | 46 | 1.871E+008 | 48166.588 | 1.870E+008 | 1.872E+008 System.Text.RegularExpressions.Tests.RegexRedux.RegexReduxMini(options: Compiled) | Duration | msec | 29 | 345.858 | 22.669 | 318.472 | 412.110 System.Text.RegularExpressions.Tests.RegexRedux.RegexReduxMini(options: None) | Duration | msec | 15 | 667.597 | 33.483 | 624.545 | 745.706 System.Text.RegularExpressions.Performance.Tests.dll | Metric | Unit | Iterations | Average | STDEV.S | Min | Max :--------------------------------------------------------------------------------- |:-------------- |:-----:|:----------:| ----------:| ---------:| ----------:| ----------: System.Text.RegularExpressions.Tests.Perf_Regex.Match | Duration | msec | 45 | 226.161 | 15.460 | 212.438 | 300.492 System.Text.RegularExpressions.Tests.Perf_Regex.Match | GC Allocations | bytes | 45 | 1.871E+008 | 59941.718 | 1.869E+008 | 1.872E+008 System.Text.RegularExpressions.Tests.RegexRedux.RegexReduxMini(options: Compiled) | Duration | msec | 29 | 354.753 | 22.682 | 310.074 | 390.565 System.Text.RegularExpressions.Tests.RegexRedux.RegexReduxMini(options: None) | Duration | msec | 15 | 666.738 | 30.583 | 621.243 | 709.226 The RegexReduxMini not compiled improves by 6% (a little better than 1 std dev). Compiled improves by about 6% but this is within noise: I would only expect the division to help and then slightly. The regular Match case also remains the same within noise. At this point I only made the change in the interpreted mode. I annotated the relevant compiled mode code which demonstrates it is not a simple transliteration into IL. That is future work. Meantime I believe the risk of this change diverging behavior is low because it is an extension of existing singleton behavior. " 28740 area-System.Net Fix proxied ipv6 address request formatting and fix port handling for proxied IP address on SocketsHttpHandler 1. Fix IPv6 missing `[]` in proxied request. 2. Fix missing port number in the request. If default ports 80 (for http connection) and 443 (for https connection) are specified for proxied request, 80 will be stripped off, while 443 will not. Because for https scheme, it will try to tunnel through the proxy (`CONNECT`), and port will not be stripped off. Tests are added to document the behavior. Fix: #28609 28741 area-System.Memory Created performance tests for ReadOnlySequence.First property Created performance tests for ReadOnlySequence.First property. Also I suggest more clear code for GetFirstBuffer method. Performance tests show the same performance at my computer. I can add performance logs for before and after. 28743 area-Infrastructure Fail the build when there are errors in main tasks "There are cases where there are errors in ""main"" tasks but we don't fail the build and go on causing other random/weird errors which are not as straight forward to find. A good example is what is referenced in dotnet/corefx#28602 where build.cmd failed since Python was not installed in an agent but the build continued failing while trying to build the packages which were not there since building them failed." 28744 area-Infrastructure Add new Debian.9.Amd64 queue "Debian's Azure versioning is unusual, so this queue represents ""newest available"". (All Azure images are 9.0.Date, which is tricky if you want a specific minor version) @ianhays , @Petermarcu FYI" 28745 area-Infrastructure [1.1] Move cmake cxx tag check to cmakelists Makes the check actually work :) 28746 area-System.Net SocketAsyncEventArgs ends up rooting itself until it's Dispose'd "This issue is for both .NET Framework and .NET Core. A SocketAsyncEventArgs ends up rooting itself in a cycle involving an async pinning handle. When the SAEA is first used, it creates an overlapped object that in turn creates a NativeOverlapped* that creates a pinning handle, and that overlapped/pinning handle reference the SAEA, leading to a cycle where the SAEA will remain rooted until it's Dispose'd. Repro: ```C# using System; using System.Net; using System.Net.Sockets; using System.Threading; class Program { static void Main() { for (int i = 0; i < 100; i++) DoWork(); Console.WriteLine(""Waiting for finalizers...""); while (true) { GC.Collect(); GC.WaitForPendingFinalizers(); } } static void DoWork() { var d = new DerivedSocketAsyncEventArgs(); using (Socket listener = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) { listener.Bind(new IPEndPoint(IPAddress.Loopback, 0)); listener.Listen(1); using (Socket client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) { d.RemoteEndPoint = listener.LocalEndPoint; var mres = new ManualResetEventSlim(); d.Completed += (s, e) => mres.Set(); if (client.ConnectAsync(d)) mres.Wait(); // Uncomment this line to see finalizers run } } } } class DerivedSocketAsyncEventArgs : SocketAsyncEventArgs { ~DerivedSocketAsyncEventArgs() => Console.WriteLine(""finalized""); } ```" 28747 area-System.Diagnostics DelimitedListTraceListener Constructor strange behavior "I tested this code : ``` var Listener = new DelimitedListTraceListener(""test.txt""); Listener.Delimiter = "",""; Trace.Listeners.Add(Listener); Trace.Write(""x""); Trace.WriteLine(""y""); Trace.TraceError(""z""); Trace.TraceInformation(""w""); Trace.Flush(); ``` It workes in windows forms app, but in a .net Core console app, it didn't create the file, and after I manually created the file it didn't write any thing to it! I had to modify the code to create the file myself and then close it: ``` var s = File.Open (""test.txt"", FileMode.OpenOrCreate); var Listener = new DelimitedListTraceListener(s); Listener.Delimiter = "",""; Trace.Listeners.Add(Listener); Trace.Write(""x""); Trace.WriteLine(""y""); Trace.TraceError(""z""); Trace.TraceInformation(""w""); Trace.Flush(); s.Close(); ``` This worked but gave strange results regaring the delimiters as I showed here: https://github.com/dotnet/corefx/issues/28697 It seems that the constructor that accepts the file path doesn't work in .NET core, but works in .NET framework! " 28749 area-System.Net [Regression] Test failure: System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpClientHandlerTest / GetAsync_IPv6LinkLocalAddressUri_Success ## Types of failure `System.Net.Http.Functional.Tests` / `SocketsHttpHandler_HttpClientHandlerTest.GetAsync_IPv6LinkLocalAddressUri_Success` Linux: ``` System.Net.Http.HttpRequestException : Invalid argument ---- System.Net.Sockets.SocketException : Invalid argument ``` OSX - [details](https://ci.dot.net/job/dotnet_corefx/job/master/job/outerloop_netcoreapp_osx_debug/390/testReport/System.Net.Http.Functional.Tests/SocketsHttpHandler_HttpClientHandlerTest/GetAsync_IPv6LinkLocalAddressUri_Success/ ) ``` System.Net.Http.HttpRequestException : No route to host ---- System.Net.Sockets.SocketException : No route to host at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_osx_debug/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ConnectHelper.cs:line 86 at System.Threading.Tasks.ValueTask`1.get_Result() in /Users/buildagent/agent/_work/482/s/src/mscorlib/shared/System/Threading/Tasks/ValueTask.cs:line 723 at System.Net.Http.HttpConnectionPool.CreateConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_osx_debug/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:line 325 at System.Threading.Tasks.ValueTask`1.get_Result() in /Users/buildagent/agent/_work/482/s/src/mscorlib/shared/System/Threading/Tasks/ValueTask.cs:line 723 at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync(ValueTask`1 creationTask) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_osx_debug/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:line 467 at System.Threading.Tasks.ValueTask`1.get_Result() in /Users/buildagent/agent/_work/482/s/src/mscorlib/shared/System/Threading/Tasks/ValueTask.cs:line 723 at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_osx_debug/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:line 258 at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_osx_debug/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/RedirectHandler.cs:line 30 at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_osx_debug/src/System.Net.Http/src/System/Net/Http/HttpClient.cs:line 479 at System.Net.Http.Functional.Tests.HttpClientHandlerTest.<>c__DisplayClass34_0.<<GetAsync_IPv6LinkLocalAddressUri_Success>b__0>d.MoveNext() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_osx_debug/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.cs:line 365 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.CreateServerAsync(Func`2 funcAsync, Options options) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_osx_debug/src/Common/tests/System/Net/Http/LoopbackServer.cs:line 67 at System.Net.Http.Functional.Tests.HttpClientHandlerTest.GetAsync_IPv6LinkLocalAddressUri_Success() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_osx_debug/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.cs:line 362 --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_osx_debug/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ConnectHelper.cs:line 76 ``` ## History of failures Day | Build | Details -- | -- | -- 4/3 | 20180403.01 | 2x OSX & 15x Linux 4/3 | 20180403.04 | 2x OSX & 14x Linux 28750 area-System.Memory Should we provide direct ReadOnlySequence constructors for MemoryManager? Early ReadOnlySequence has constructors to create it with OwnedMemory. Now OwnedMemory is replaced by MemoryManager and constructors was removed. Now it is possible to create ReadOnlySequence with MemoryManager by using MemoryManager.Memory property. But it seems strange that we convert MemoryManager to ReadOnlyMemory and then ReadOnlySequence convert it back to MemoryManager by using marshaling. Should we provide direct ReadOnlySequence constructors for MemoryManager as it was for OwnedMemory? 28751 area-System.Memory Remove .Length from MemoryManager<T> It adds no utility; and only gives scope to implementors to get `Memory` and `Length` properties out of sync. Suggested change: ```diff public readonly partial struct Memory<T> { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal Memory(MemoryManager<T> manager, int length) + { + Debug.Assert(manager != null); + + if (length < 0) + ThrowHelper.ThrowArgumentOutOfRangeException(); + + _object = manager; + _index = (1 << 31); // Mark as MemoryManager type + // Before using _index, check if _index < 0, then 'and' it with RemoveFlagsBitMask + _length = length; + } - public Memory(MemoryManager<T> manager, int start, int length) - { - // ... - } } public abstract partial class MemoryManager<T> { - public virtual int Length => GetSpan().Length; - public virtual Memory<T> Memory => new Memory<T>(this, 0, Length); + public virtual Memory<T> Memory => CreateMemory(this, GetSpan().Length); + protected Memory<T> CreateMemory(int length) => new Memory<T>(this, length); + // Convenience api for non-zero offsets + protected Memory<T> CreateMemory(int start, int length) => CreateMemory(length).Slice(start); } ``` If an implementor wants to go faster than `GetSpan().Length` rather than having a choice on overriding either `Length` or `Memory` or both; it is now clear they only need to override `Memory` as there is no alternate path. A common usage is checking `Memory.Length` (as `.Length` isn't exposed up stream via `IMemoryOwner`) so if overriding `.Length` were the path chosen; then that's an interface call to `Memory`, which then makes a virtual call to `.Length`(then the Memory .ctor makes a further 2 virtual calls to `.Length` O_o) so its a bad path anyway. Overriding `Memory` with this change on the other hand is would be a single interface call; then you're done, so its the better path. e.g. the second should be chosen over the first below for performance in its common usage pattern ```diff public class OwnedArray<T> : MemoryManager<T> { T[] _array; int _referenceCount; - public override int Length => _array.Length; + public override Memory<T> Memory => CreateMemory(_array.Length) ``` Additionally currently there is the confusion of which choice to make of the two properties to override. The `Memory` override also provide greater utility as the `offset` can be changed. cc @GrabYourPitchforks, @davidfowl, @pakrym, @davidfowl @KrzysztofCwalina 28752 area-System.Memory I suggest to add ReadOnlySequence constructor for ArraySegment "I suggest to add ReadOnlySequence constructor for ArraySegment. # Proposed API ```cs public readonly partial struct ReadOnlySequence<T> { /// <summary> /// Creates an instance of <see cref=""ReadOnlySequence{T}""/> from the <see cref=""ArraySegment{T}""/>. /// </summary> public ReadOnlySequence(ArraySegment<T> arraySegment); } ``` # Details Implementation is like for `ReadOnlySequence(T[] array, int start, int length)` constructor." 28754 area-Microsoft.CSharp Reset Console in src/Microsoft.CSharp/tests/NamedArgumentTests.cs (Fixes #28667) Add Helpers::OverrideConsoleAndRun that will set StringWriter as out and run received command. After running the command it will reset the out to whatever it was set before running tests Fixes #28667 28755 area-System.Net Test failed: System.Net.WebSockets.Client.Tests.ArraySegmentSendReceiveTest / ZeroByteReceive_CompletesWhenDataAvailable (server: ws://corefx-net.cloudapp.net/WebSocket/EchoWebSocket.ashx) Opened on behalf of @Sunny-pu The test `System.Net.WebSockets.Client.Tests.ArraySegmentSendReceiveTest/ZeroByteReceive_CompletesWhenDataAvailable(server: ws://corefx-net.cloudapp.net/WebSocket/EchoWebSocket.ashx)` has failed. System.Net.WebSockets.WebSocketException : An exception caused the WebSocket to enter the Aborted state. Please see the InnerException, if present, for more details.\r ---- System.ArgumentException : The specified buffer index is not within the buffer capacity. Stack Trace: at System.Net.WebSockets.WinRTWebSocket.ReceiveAsync(ArraySegment`1 buffer, CancellationToken cancellationToken) in E:\A\_work\36\s\corefx\src\System.Net.WebSockets.Client\src\System\Net\WebSockets\WinRTWebSocket.cs:line 330 at System.Net.WebSockets.Client.Tests.SendReceiveTest.ZeroByteReceive_CompletesWhenDataAvailable(Uri server) in E:\A\_work\36\s\corefx\src\System.Net.WebSockets.Client\tests\SendReceiveTest.cs:line 461 --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeBufferExtensions.CopyTo(IBuffer source, UInt32 sourceIndex, Byte[] destination, Int32 destinationIndex, Int32 count) in E:\A\_work\36\s\corefx\src\System.Runtime.WindowsRuntime\src\System\Runtime\InteropServices\WindowsRuntime\WindowsRuntimeBufferExtensions.cs:line 182 at System.Net.WebSockets.WinRTWebSocket.OnMessageReceived(MessageWebSocket sender, MessageWebSocketMessageReceivedEventArgs args) in E:\A\_work\36\s\corefx\src\System.Net.WebSockets.Client\src\System\Net\WebSockets\WinRTWebSocket.cs:line 385 Build : Master - 20180403.01 (UWP F5 Tests) Failing configurations: - Windows.10.Arm64-arm - Release - Windows.10.Amd64.ClientRS3-x86 - Release - Windows.10.Amd64.ClientRS3-x64 - Release Details: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fuwp~2F/build/20180403.01/workItem/System.Net.WebSockets.Client.Tests/analysis/xunit/System.Net.WebSockets.Client.Tests.ArraySegmentSendReceiveTest~2FZeroByteReceive_CompletesWhenDataAvailable(server:%20ws:~2F~2Fcorefx-net.cloudapp.net~2FWebSocket~2FEchoWebSocket.ashx) 28757 area-System.IO "Test failure: System.IO.Tests.DirectoryInfo_EnumDir_str_str/PatternTests_DosStarOddSpace(pattern: \""*.\"", sourceFiles: [\""foo. \"", \""foo. \"", \""foo..\"", \""foo. t\""], expected: [\""foo. \"", )" "Opened on behalf of @Sunny-pu The test `System.IO.Tests.DirectoryInfo_EnumDir_str_str/PatternTests_DosStarOddSpace(pattern: \""*.\"", sourceFiles: [\""foo. \"", \""foo. \"", \""foo..\"", \""foo. t\""], expected: [\""foo. \"", )` has failed. Assert.Equal() Failure\r Expected: OrderedEnumerable<String, String> [\""foo. \"", \""foo. \"", \""foo..\""]\r Actual: OrderedEnumerable<String, String> [\""foo..\""] Stack Trace: null Build : 2.0.0 - 20180403.03 (Core Tests) Failing configurations: - windows.10.amd64.iot-x64 - Release Details: https://mc.dot.net/#/product/netcore/200/source/official~2Fcorefx~2Frelease~2F2.0.0~2F/type/test~2Ffunctional~2Fcli~2F/build/20180403.03/workItem/System.IO.FileSystem.Tests/analysis/xunit/System.IO.Tests.DirectoryInfo_EnumDir_str_str~2FPatternTests_DosStarOddSpace(pattern:%20%5C%22*.%5C%22,%20sourceFiles:%20%5B%5C%22foo.%20%5C%22,%20%5C%22foo.%20%20%5C%22,%20%5C%22foo..%5C%22,%20%5C%22foo.%20t%5C%22%5D,%20expected:%20%5B%5C%22foo.%20%5C%22,%20)" 28758 area-System.Net Test failure: System.Net.NetworkInformation.Tests.PingTest / SendPingAsyncWithHostAndTimeoutAndBufferAndPingOptions_Unix Opened on behalf of @Sunny-pu The test `System.Net.NetworkInformation.Tests.PingTest/SendPingAsyncWithHostAndTimeoutAndBufferAndPingOptions_Unix` has failed. Assert.Equal() Failure Expected: Success Actual: TimedOut Stack Trace: at System.Net.NetworkInformation.Tests.PingTest.<>c__DisplayClass14_0.<SendPingAsyncWithHostAndTimeoutAndBufferAndPingOptions_Unix>b__1(PingReply pingReply) in /Users/buildagent/agent/_work/447/s/corefx/src/System.Net.Ping/tests/FunctionalTests/PingTest.cs:line 315 at System.Net.NetworkInformation.Tests.PingTest.<SendPingAsync>d__23.MoveNext() in /Users/buildagent/agent/_work/447/s/corefx/src/System.Net.Ping/tests/FunctionalTests/PingTest.cs:line 453 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.NetworkInformation.Tests.PingTest.<SendPingAsyncWithHostAndTimeoutAndBufferAndPingOptions_Unix>d__14.MoveNext() in /Users/buildagent/agent/_work/447/s/corefx/src/System.Net.Ping/tests/FunctionalTests/PingTest.cs:line 311 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) Build : 2.0.0 - 20180403.03 (Core Tests) Failing configurations: - OSX.1012.Amd64-x64 - Debug Details: https://mc.dot.net/#/product/netcore/200/source/official~2Fcorefx~2Frelease~2F2.0.0~2F/type/test~2Ffunctional~2Fcli~2F/build/20180403.03/workItem/System.Net.Ping.Functional.Tests/analysis/xunit/System.Net.NetworkInformation.Tests.PingTest~2FSendPingAsyncWithHostAndTimeoutAndBufferAndPingOptions_Unix 28759 area-System.Net SafeDeleteSslContext.WriteToConnection throws System.ArgumentNullException Hard to reproduce but our CI tests sporadically fail with: ``` Unhandled Exception: System.ArgumentNullException: Value cannot be null. at System.Threading.Monitor.ReliableEnter(Object obj, Boolean& lockTaken) at System.Net.SafeDeleteSslContext.WriteToConnection(Void* connection, Byte* data, Void** dataLength) at Interop.AppleCrypto.SslHandshake(SafeSslHandle sslHandle) at System.Net.Security.SslStreamPal.PerformHandshake(SafeSslHandle sslHandle) at System.Net.Security.SslStreamPal.HandshakeInternal(SafeFreeCredentials credential, SafeDeleteContext& context, SecurityBuffer inputBuffer, SecurityBuffer outputBuffer, Boolean isServer, Boolean remoteCertRequired, String targetName) ``` The dotnet process crashes after this. This occurs with a test where a client opens an SSL connection asynchronously and then closes it -- possibly while the handshake is still in progress. The crash dump showing the stacks: [stacks.txt](https://github.com/dotnet/corefx/files/1870746/stacks.txt) This occurs with both .NET Core Runtime 2.0.6 and 2.1-preview. 28760 area-System.Memory Created performance tests for ROS First and TryGet methods I created performance tests for ROS First and TryGet methods. Also I suggest more clear and fast code for TryGetBuffer and GetFirstBuffer methods. 28761 area-Infrastructure build-native.sh fails when using uname to determine arch "In src/Native/build-native.sh, the following logic fails when the processor type info contains spaces. ``` CPUName=$(uname -p) # Some Linux platforms report unknown for platform, but the arch for machine. if [ $CPUName == ""unknown"" ]; then CPUName=$(uname -m) fi if [ $CPUName == ""i686"" ]; then __BuildArch=x86 fi ``` ```uname -p``` does not return the 'platform' as the comment seems to imply but rather the 'processor' type. While it appears some distros do return the architecture, others provide the processor type information correctly if available. Examples: ``` > uname -p Intel(R) Core(TM) i5-3230M CPU @ 2.60GHz > uname -p Intel(R) Core(TM)2 Duo CPU E6750 @ 2.66GHz ``` Note that the returned data can contain spaces. This causes the conditional checks above to fail with the following error as they don't quote the variable when referencing it. ``` source-build/src/corefx/src/Native/build-native.sh: line 178: [: too many arguments source-build/src/corefx/src/Native/build-native.sh: line 182: [: too many arguments ```" 28763 area-System.Collections Extra test should be added for Dictionary "This code should work ```csharp var d = new Dictionary<string,string>(); d.Add(""a"", ""b""); d.Add(""c"", ""d""); foreach (var e in d) { if (d.Remove(e.Key + ""Sibling"")) break; } ``` From https://github.com/dotnet/coreclr/pull/17196#issuecomment-377360621 /cc @danmosemsft Just so it doesn't fall off the radar" 28764 area-System.Xml Is there any way to localize validation error messages when checking xml by xsd scheme? Is there any way to localize validation error messages when checking xml by xsd scheme? I could not find any information about it. In netframework this problem was solved by language packs. There is a way to overload resources System.Private.Xml.dll so that messages are taken from the current culture ? 28767 area-System.Net Stop artificially rooting SocketAsyncEventArgs SocketAsyncEventArgs creates an overlapped object that references the SAEA. That overlapped object creates an async pinning handle in the runtime, which roots the SocketAsyncEventArgs. The cycle from SAEA->Overlapped->handle->SAEA involving the root means that a dropped SAEA that's not Dispose'd will end up leaking. This commit fixes that by adding a level of indirection between the handle and the SAEA. Rather than wrapping the SAEA directly, the handle is given an intermediate object that references the SAEA, and the SAEA then stores itself as a reference into that object only while an active operation is in progress. Once the operation completes, the reference in that object is nulled out, and the SAEA will no longer be kept alive by the pinning handle. Fixes https://github.com/dotnet/corefx/issues/28746 cc: @geoffkizer, @davidsh, @halter73 28768 area-Meta Fix build with xcode 9.3 on OSX The c_static_assert definition is causing build problems on OSX. The compiler complains about the typedef we use to implement the c_static_assert: `declaration shadows a typedef in the global scope [-Werror,-Wshadow]` This is due to multiple static asserts To fix it, I have modified the c_static_assert to use _Static_assert C feature that's available in clang. 28769 area-System.Data Add a fast and convenient deserialization API to ADO.NET "When using ADO.NET to read rows the deserialization cost can be very significant. This is important in scenarios where a lot of data is streamed. Here is directly executable code to demonstrate this: ``` static class Program { static void Main() { DeserializationBenchmark.Run(); } public static class DeserializationBenchmark { public static void Run() { using (var connection = new SqlConnection(""Data Source=(local); Integrated Security=True; Initial Catalog=master;"")) { connection.Open(); PrepareTestData(connection); RunBenchmarkLoop(); } } static void PrepareTestData(SqlConnection connection) { using (var command = new SqlCommand(@""SELECT o1.object_id value1, o1.object_id value2, o1.object_id value3, o1.object_id value4, o1.object_id value5 INTO ##BenchmarkRows FROM sys.all_objects o1 cross join (select top 100 * from sys.all_objects o2) o2"", connection)) { command.ExecuteNonQuery(); } } static void RunBenchmarkLoop() { long count = 0; while (true) { ReadData(); count++; if (count % 10 == 0) Console.WriteLine($""Completed {count} iterations.""); } } static void ReadData() { using (var connection = new SqlConnection(""Data Source=(local); Integrated Security=True; Initial Catalog=master;"")) { connection.Open(); using (var transaction = connection.BeginTransaction(System.Data.IsolationLevel.ReadCommitted)) { using (var command = new SqlCommand(@""SELECT * FROM ##BenchmarkRows"", connection, transaction)) using (var reader = command.ExecuteReader()) { while (reader.Read()) { var value1 = reader.GetInt32(0); var value2 = reader.GetInt32(1); var value3 = reader.GetInt32(2); var value4 = reader.GetInt32(3); var value5 = reader.GetInt32(4); } } transaction.Commit(); } } } } } ``` This code simply deserializes a table of a few thousand rows. There are 5 int columns. The benchmark is designed to demonstrate the issue but it's not unrealistic. I also used ADO.NET best practices.  I might be mistaken but **it seems that a lot of the time is spent calling chatty APIs on SqlDataReader**. It looks like there is a lot of API overhead and comparatively little work actually parsing the network protocol. The console process uses 100% of one CPU core. SQL Server uses only about 1/3 of one CPU core. This is further (heuristic) evidence that the client is less efficient than the server. There is no way to avoid this cost at the moment. The code is as fast as it gets. **I suggest the following enhancement**: Provide an API that directly deserializes into a user-provided type. Old: ``` IDataReader reader = command.ExecuteReader(); while (reader.MoveNext()) { //Read all fields individually } ``` New: ``` IEnumerable<MyDTO> resultRows = command.ExecuteObjects<MyDTO>(); ``` This API could be made extremely fast because: * It is less chatty. ADO.NET can access it's internal buffers more directly. * Metadata overhead has to be incurred only once for the whole result set. Many per-row and per-field metadata accesses and validations can be eliminated. * ADO.NET can compile a lambda expression dynamically that pulls data from the internal byte buffers and pushes it into the user-provided type. To illustrate the point: The expression could look like this: `new MyDTO() { Field1 = internalReader.GetNextFieldAsInt32(), Field2 = internalReader.GetNextFieldAsString(), ... }`. * The lambda can be cached internally. Alternatively an API consumer would use a factory to create a ""fast reader"" and cache the reader. * The entire row can be read in one go. I believe this makes it faster to parse the TDS protocol. * If async is in use there will be less async overhead because the APIs are less chatty. <hr> Possible extensions of this idea would be: * Allow structs as well as classes * Allow invoking a constructor * Allow sequences of the form `IEnumerable<object[]>` where all field values are provided as objects. * Add a pull-style API. Very rough API idea: `readerObject.GetNextObject<MyDTO>()`. * Add a way to provide and reuse preallocated objects e.g. `readerObject.GetNextObject<MyDTO>(existingObject)`. * Async support (`IAsyncEnumerable` or other suitable mechanisms). * Maybe there can be a parallel mode that hands our a `ParallelQuery`. I'm *not* optimistic this can be done. * Allow sequences of the form `IEnumerable<MyDTO[]>`. Here, ADO.NET would hand out rows in chunks. The chunk size would be chosen optimally. Probably, ADO.NET would convert each network buffer into a chunk. This would make the API even less chatty. I understand that this proposal is a bit raw. The API that I proposed is a straw man that clearly has some flaws. I think an API in this spirit could improve efficiency a lot. It also would be very convenient. The existing pattern is extremely awkward to use. People are using light-weight wrappers like Dapper which look just like this API proposal. <hr> The API should be so that ORMs such as Entity Framework can use it as well. This might not be trivial depending on what Entity Framework does. Here's an idea on how to support arbitrary object instantiation: Instead of making ADO.NET figure out how to construct the `new MyDTO()...` part of the expression tree, let the user provide that. ADO.NET provides one `Expression` for each field to be deserialized. It could look like this: ``` var fastReader = FastReader.Create<MyDTO>( columnDescriptions /* contains the type and order of columns */, (Expression[] columnValueExpressions) => Expression.New(typeof(MyDTO), columnValueExpressions) //Create new MyDTO(...) expression }); //cache fastReader IEnumerable<MyDTO> objects = fastReader.Read(mySqlDataReader); ``` In this example, the API caller can create an arbitrary deserialization expression that uses the ADO.NET provided column values in `columnValueExpressions`. `columnValueExpressions[0]` would correspond to `internalReader.GetNextFieldAsInt32()` in the code further above. Entity Framework could construct an expression tree that does anything it wants including creating multiple objects, calling factory methods and calling into the object state manager. All of this processing would be very close to obtaining the actual column values from internal ADO.NET data structures. No chattyness. " 28770 area-System.Net Fix ProxyExplicitlyProvided_DefaultCredentials_Ignored test I couldn't get it to fail locally, but I believe the issue was that sporadically WinHttpHandler would not reuse the original connection, in which case it would either not close the first and the test would hang (and then the client would timeout) because nothing was accepting the second connection, or it would close the first and fail because the server was expecting a second request on the connection. This fixes it by using Connection: close on the first response so that the client won't reuse the same connection. Fixes https://github.com/dotnet/corefx/issues/28537 Fixes https://github.com/dotnet/corefx/issues/25983 cc: @wfurt, @rmkerr 28771 area-System.ComponentModel PropertyDescriptor - MemberDescriptor.Attributes Port the change #26756 into 2.0 Fixes #26600 PropertyDescriptor - MemberDescriptor.Attributes returns base attribute instead of ancestor's attribute 28772 area-System.Net "PlatformHandler_HttpClientHandlerTest.AllowAutoRedirect_True_ValidateNewMethodUsedOnRedirection(statusCode: 307, oldMethod: ""GET"", newMethod: ""GET"") failed on NETFX CI leg" "Failed on NETFX CI leg: ``` System.Net.Http.Functional.Tests.PlatformHandler_HttpClientHandlerTest.AllowAutoRedirect_True_ValidateNewMethodUsedOnRedirection(statusCode: 307, oldMethod: ""GET"", newMethod: ""GET"") [FAIL] Canceled: Expected: False Actual: True Stack Trace: at System.Net.Http.Functional.Tests.HttpClientHandlerTest.<>c__DisplayClass50_2.<<AllowAutoRedirect_True_ValidateNewMethodUsedOnRedirection>b__1>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.Test.Common.LoopbackServer.<CreateServerAsync>d__9.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.Http.Functional.Tests.HttpClientHandlerTest.<>c__DisplayClass50_1.<<AllowAutoRedirect_True_ValidateNewMethodUsedOnRedirection>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.Test.Common.LoopbackServer.<CreateServerAsync>d__9.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.Http.Functional.Tests.HttpClientHandlerTest.<AllowAutoRedirect_True_ValidateNewMethodUsedOnRedirection>d__50.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) ```" 28773 area-System.Net PlatformHandler_HttpClientHandler_Authentication_Test.PreAuthenticate_FirstRequestNoHeader_SecondRequestVariousStatusCodes_ThirdRequestPreauthenticates(statusCode: 510) failed on NETFX CI leg "Failed on NETFX CI leg: ``` System.Net.Http.Functional.Tests.PlatformHandler_HttpClientHandler_Authentication_Test.PreAuthenticate_FirstRequestNoHeader_SecondRequestVariousStatusCodes_ThirdRequestPreauthenticates(statusCode: 510) [FAIL] Assert.Contains() Failure Not found: (filter expression) In value: List<String> [""GET / HTTP/1.1"", ""Host: 127.0.0.1:51635"", ""Connection: Keep-Alive""] Stack Trace: at System.Net.Http.Functional.Tests.HttpClientHandler_Authentication_Test.<>c__DisplayClass14_0.<<PreAuthenticate_FirstRequestNoHeader_SecondRequestVariousStatusCodes_ThirdRequestPreauthenticates>b__1>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.Test.Common.LoopbackServer.<>c__DisplayClass11_0.<<CreateClientAndServerAsync>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.Test.Common.LoopbackServer.<CreateServerAsync>d__9.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.Http.Functional.Tests.HttpClientHandler_Authentication_Test.<PreAuthenticate_FirstRequestNoHeader_SecondRequestVariousStatusCodes_ThirdRequestPreauthenticates>d__14.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) Finished: System.Net.Mail.Functional.Tests ```" 28774 area-System.Net Test failed: System.Net.Tests.HttpListenerContextTests / AcceptWebSocketAsync_InvalidSubProtocol_ThrowsArgumentException Failed on OSX10.12 CI leg https://mc.dot.net/#/user/danmosemsft/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/a5b501ec67fe3962d9861ad29e761487792b9080/workItem/System.Net.HttpListener.Tests/analysis/xunit/System.Net.Tests.HttpListenerContextTests~2FAcceptWebSocketAsync_InvalidSubProtocol_ThrowsArgumentException(subProtocol:%20%5C%22random%7Btext%5C%22) ``` System.Net.WebSockets.WebSocketException : Unable to connect to the remote server ---- System.Net.Http.HttpRequestException : Connection refused -------- System.Net.Sockets.SocketException : Connection refused Stack Trace : at System.Net.WebSockets.WebSocketHandle.ConnectAsyncCore(Uri uri, CancellationToken cancellationToken, ClientWebSocketOptions options) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.WebSockets.Client/src/System/Net/WebSockets/WebSocketHandle.Managed.cs:line 230 at System.Net.WebSockets.ClientWebSocket.ConnectAsyncCore(Uri uri, CancellationToken cancellationToken) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.WebSockets.Client/src/System/Net/WebSockets/ClientWebSocket.cs:line 152 at System.Net.Tests.HttpListenerContextTests.GetWebSocketContext(String[] subProtocols) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.HttpListener/tests/HttpListenerContextTests.cs:line 270 at System.Net.Tests.HttpListenerContextTests.AcceptWebSocketAsync_InvalidSubProtocol_ThrowsArgumentException(String subProtocol) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.HttpListener/tests/HttpListenerContextTests.cs:line 176 --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ConnectHelper.cs:line 86 at System.Threading.Tasks.ValueTask`1.get_Result() in /Users/buildagent/agent/_work/482/s/src/mscorlib/shared/System/Threading/Tasks/ValueTask.cs:line 723 at System.Net.Http.HttpConnectionPool.CreateConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:line 325 at System.Threading.Tasks.ValueTask`1.get_Result() in /Users/buildagent/agent/_work/482/s/src/mscorlib/shared/System/Threading/Tasks/ValueTask.cs:line 723 at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync(ValueTask`1 creationTask) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:line 467 at System.Threading.Tasks.ValueTask`1.get_Result() in /Users/buildagent/agent/_work/482/s/src/mscorlib/shared/System/Threading/Tasks/ValueTask.cs:line 723 at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:line 258 at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/RedirectHandler.cs:line 30 at System.Net.WebSockets.WebSocketHandle.ConnectAsyncCore(Uri uri, CancellationToken cancellationToken, ClientWebSocketOptions options) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.WebSockets.Client/src/System/Net/WebSockets/WebSocketHandle.Managed.cs:line 171 ----- Inner Stack Trace ----- at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ConnectHelper.cs:line 67 ``` 28775 area-System.Net System.Net.Security.Tests.CertificateValidationClientServer/CertificateValidationClientServer_EndToEnd_Ok(useClientSelectionCallback: True) failed on OSX10.12 CI leg ``` System.Net.Internals.SocketExceptionFactory+ExtendedSocketException : Operation timed out [::1]:50724 Stack Trace : at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.Sockets/src/System/Net/Sockets/Socket.cs:line 2430 at System.Net.Sockets.TcpClient.EndConnect(IAsyncResult asyncResult) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.Sockets/src/System/Net/Sockets/TCPClient.cs:line 334 at System.Net.Sockets.TcpClient.<>c.<ConnectAsync>b__27_1(IAsyncResult asyncResult) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.Sockets/src/System/Net/Sockets/TCPClient.cs:line 278 at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization) in /Users/buildagent/agent/_work/482/s/src/mscorlib/src/System/Threading/Tasks/FutureFactory.cs:line 533 --- End of stack trace from previous location where exception was thrown --- at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks, Int32 millisecondsTimeout) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs:line 49 at System.Net.Security.Tests.CertificateValidationClientServer.CertificateValidationClientServer_EndToEnd_Ok(Boolean useClientSelectionCallback) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.Security/tests/FunctionalTests/CertificateValidationClientServer.cs:line 73 --- End of stack trace from previous location where exception was thrown --- ``` 28776 area-System.Net Small throughput improvement in Uri construction "Some low-hanging fruit; the main win here comes from inlining helpers invoked for every character while checking domain names. These functions each only have two call sites, so there's little bloating, and the net win here is ~7-10% for the various URIs I tried, e.g. `new Uri(""http://microsoft.com"")`. cc: @rmkerr, @davidsh, @geoffkizer " 28777 area-System.Net Test failure: System.Net.WebSockets.Client.Tests.CancelTest/CloseAsync_Cancel_Success(server: wss://corefx-net.cloudapp.net/WebSocket/EchoWebSocket.ashx) The test `System.Net.WebSockets.Client.Tests.CancelTest/CloseAsync_Cancel_Success(server: wss://corefx-net.cloudapp.net/WebSocket/EchoWebSocket.ashx)` has failed. ``` System.InvalidOperationException : This operation is only allowed using a successfully authenticated context. Stack Trace: at System.Net.Security.SslState.CheckThrow(Boolean authSuccessCheck, Boolean shutdownCheck) at System.Net.Security.SslState.get_SecureStream() at System.Net.TlsStream.EndRead(IAsyncResult asyncResult) at System.Threading.Tasks.TaskFactory`1.FromAsyncTrimPromise`1.Complete(TInstance thisRef, Func`3 endMethod, IAsyncResult asyncResult, Boolean requiresSynchronization) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.WebSockets.WebSocketConnectionStream.<ReadAsync>d__21.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.WebSockets.WebSocketBase.WebSocketOperation.<Process>d__19.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.WebSockets.WebSocketBase.<CloseAsyncCore>d__56.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.WebSockets.Client.Tests.CancelTest.<>c.<<CloseAsync_Cancel_Success>b__4_0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.WebSockets.Client.Tests.ClientWebSocketTestBase.<TestCancellation>d__8.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.WebSockets.Client.Tests.CancelTest.<CloseAsync_Cancel_Success>d__4.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) Build : ProdCon - Master - 20180403.02 (Full Framework Tests) Failing configurations: - Windows.10.Amd64-x86 - Release ``` 28780 area-System.Net Default Proxy issues "# Default Proxy issues Our organisation has a proxy and in previous versions on .NET (.net full framework), you can add the following to the web.config and the application will use your system's default proxy. ```XML <system.net> <defaultProxy useDefaultCredentials=""true"" /> </system.net> ``` I have tried a lot of different options but just cant seem to get anything to work. ```csharp string username = ""test""; string password = ""test""; WebProxy proxy = new WebProxy($""http://{username}:{password}@bluecoat.domain.gov.uk"", 8080) { Address = new Uri(""http://{username}:{password}@bluecoat.domain.gov.uk:8080""), Credentials = new NetworkCredential(username, password) }; HttpClientHandler clientHandler = new HttpClientHandler { Proxy = proxy, UseProxy = true, Credentials = new NetworkCredential(username, password) }; var httpClient = new HttpClient(clientHandler); ``` Any help would be greatly appreciated." 28781 area-Infrastructure Running UpdatePackageIndex Target should produce sorted results currently, this target doesn't sort the produced results inside the JSON file. please look at the https://github.com/dotnet/corefx/pull/28720#issuecomment-378320967 for more info. 28782 area-System.Collections Difference in code and documentation of BlockingCollection.BoundedCapacity @nerai commented on [Tue Apr 03 2018](https://github.com/dotnet/coreclr/issues/17395) [.NET framework reference source of `BlockingCollection.BoundedCapacity`](https://referencesource.microsoft.com/#System/sys/system/collections/concurrent/BlockingCollection.cs,72) says: > ... The bounded capacity of this collection, or int.MaxValue if no bound was supplied. However, if no capacity is supplied in the ctor, it is called: Initialize(collection, NON_BOUNDED, collection.Count); with private const int NON_BOUNDED = -1; So the BoundedCapacity of an unbounded instance is -1, not int.MaxValue. To verify: var a = new BlockingCollection<int> (); Console.WriteLine (a.BoundedCapacity); // prints -1 Console.WriteLine (int.MaxValue); // prints 2147483647 --- @RussKeldorph commented on [Tue Apr 03 2018](https://github.com/dotnet/coreclr/issues/17395#issuecomment-378327059) @danmosemsft 28787 area-System.Net Investigate redundant IdnMapping calls https://github.com/dotnet/corefx/pull/28725 is adding IdnMapping call in SslStream which have made IdnMapping call in HttpClient (SocketsHttpHandler) redundant. cc: @davidsh 28788 area-System.Net Make default SocketsHttpHandler SslProtocols include Tls11/12 on Win7/2008R2 Windows 7 and Windows 2008 R2 support TLS 1.1 and 1.2, but for legacy reasons by default those protocols are not enabled when a developer elects to use the system default. However, in .NET Core 2.0 and earlier, HttpClientHandler would enable them, due to being a wrapper for WinHTTP, which enabled them. Both for compatibility and because we prefer those higher protocols whenever possible, SocketsHttpHandler also pretends they're part of the default when running on Win7/2008R2. Fixes https://github.com/dotnet/corefx/issues/28733 cc: @davidsh, @Tratcher, @geoffkizer 28789 area-System.Net Disable GetAsync_IPv6LinkLocalAddressUri_Success Disabled test tracked in #28749. @dotnet-bot test Outerloop Windows x64 Debug Build @dotnet-bot test Outerloop Linux x64 Debug Build 28790 area-System.Net [Regression][RedHat69] System.Net.Http.Functional.Tests.PlatformHandler_HttpClientHandler_SslProtocols_Test / GetAsync_AllowedSSLVersion_Succeeds ## Type of failures Test case: `acceptedProtocol: Ssl3, requestOnlyThisProtocol: True` ``` System.Net.Http.HttpRequestException: An error occurred while sending the request. ---- System.Net.Http.CurlException : SSL connect error at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) in /root/corefx-1549868/src/System.Net.Http/src/System/Net/Http/HttpClient.cs:line 479 at System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test.<>c__DisplayClass4_0.<<GetAsync_AllowedSSLVersion_Succeeds>b__0>d.MoveNext() in /root/corefx-1549868/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.SslProtocols.cs:line 126 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.CreateServerAsync(Func`2 funcAsync, Options options) in /root/corefx-1549868/src/Common/tests/System/Net/Http/LoopbackServer.cs:line 67 at System.Net.Http.Functional.Tests.HttpClientHandler_SslProtocols_Test.GetAsync_AllowedSSLVersion_Succeeds(SslProtocols acceptedProtocol, Boolean requestOnlyThisProtocol) in /root/corefx-1549868/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.SslProtocols.cs:line 124 --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- at System.Net.Http.CurlHandler.ThrowIfCURLEError(CURLcode error) in /root/corefx-1549868/src/System.Net.Http/src/System/Net/Http/CurlHandler/CurlHandler.cs:line 660 at System.Net.Http.CurlHandler.MultiAgent.FinishRequest(StrongToWeakReference`1 easyWrapper, CURLcode messageResult) in /root/corefx-1549868/src/System.Net.Http/src/System/Net/Http/CurlHandler/CurlHandler.MultiAgent.cs:line 883 ``` ## History of failures Day | Build | Details -- | -- | -- 3/31 | 20180331.05 | 4/1 | 20180401.01 | 4/1 | 20180401.02 | 4/2 | 20180402.01 | 4/2 | 20180402.02 | 4/2 | 20180402.05 | 4/3 | 20180403.01 | 4/3 | 20180403.04 | All test cases are `acceptedProtocol: Ssl3, requestOnlyThisProtocol: True` 28791 area-System.IO NamedPipeClientStream.Connect(int) does not respect timeout on UNIX domain sockets On Windows, if you connect to a `NamedPipeServerStream` that was created with `maxNumberOfServerInstances=1` from one process, and attempt to connect to it from another process with `NamedPipeClientStream.Connect(timeout: 0)`, it throws. On .NET Core 2.1 on Linux, the call to `Connect` hangs indefinitely instead. Internally, it's successfully called `connect()` and is waiting on `recvmsg()`. Repro project: [dotnet-pipe-server.zip](https://github.com/dotnet/corefx/files/1873538/dotnet-pipe-server.zip) On running `repro.sh`, you should get a stack dump from the second client process, since I didn't handle any exceptions from `Connect`. But instead it just waits. Doing the equivalent manually on Windows does throw, just like full framework .NET. 28792 area-System.Linq Enable faster invoke in interpreter The change follows up on several TODOs and commented out unfinished implementation. In cases where it is possible, we can avoid expensive calls via reflection and use more efficient delegate-based thunks. These are also the most common scenarios. When optimized invocations are not possible (too many arguments, byref arguments, etc..) we still use reflection. For the cases where we create thunks, there are small caches to hold the recently used ones - just to opportunistically avoid costs of creating thunk delegates again. That is particularly important when the thunks are created via Ref.Emit. - [x] enable fast invoke pass - [x] enable caching on reverse invoke (at the entry points to the interpreter lambdas) - [x] enable fast invoker creation 28793 area-System.Net [Regression] Test failure: System.Net.Http.Functional.Tests.PlatformHandler_HttpClientHandler_ResponseDrain_Test / GetAsync_DisposeBeforeReadingToEnd_DrainsRequestsAndReusesConnection ## Type of failures OSX failures: ``` System.Exception : Unexpected EOF trying to read request header at System.Net.Test.Common.LoopbackServer.Connection.ReadRequestHeaderAsync() at System.Net.Test.Common.LoopbackServer.Connection.ReadRequestHeaderAndSendCustomResponseAsync(String response) in /Users/buildagent/agent/_work/391/s/corefx/src/Common/tests/System/Net/Http/LoopbackServer.cs:line 388 at System.Net.Http.Functional.Tests.HttpClientHandler_ResponseDrain_Test.<>c__DisplayClass3_0.<<GetAsync_DisposeBeforeReadingToEnd_DrainsRequestsAndReusesConnection>b__2>d.MoveNext() in /Users/buildagent/agent/_work/391/s/corefx/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.ResponseDrain.cs:line 87 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.AcceptConnectionAsync(Func`2 funcAsync) in /Users/buildagent/agent/_work/391/s/corefx/src/Common/tests/System/Net/Http/LoopbackServer.cs:line 117 at System.Net.Http.Functional.Tests.HttpClientHandler_ResponseDrain_Test.<>c__DisplayClass3_0.<<GetAsync_DisposeBeforeReadingToEnd_DrainsRequestsAndReusesConnection>b__1>d.MoveNext() in /Users/buildagent/agent/_work/391/s/corefx/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.ResponseDrain.cs:line 83 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.<>c__DisplayClass11_0.<<CreateClientAndServerAsync>b__0>d.MoveNext() in /Users/buildagent/agent/_work/391/s/corefx/src/Common/tests/System/Net/Http/LoopbackServer.cs:line 84 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.CreateServerAsync(Func`2 funcAsync, Options options) in /Users/buildagent/agent/_work/391/s/corefx/src/Common/tests/System/Net/Http/LoopbackServer.cs:line 67 at System.Net.Http.Functional.Tests.HttpClientHandler_ResponseDrain_Test.GetAsync_DisposeBeforeReadingToEnd_DrainsRequestsAndReusesConnection(ContentMode mode) in /Users/buildagent/agent/_work/391/s/corefx/src/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.ResponseDrain.cs:line 56 --- End of stack trace from previous location where exception was thrown --- ``` ## History of failures Day | Build | OS -- | -- | -- 3/14 | 20180314.05 | OSX10.13 3/14 | 20180314.07 | OSX10.13 3/23 | 20180323.01 | OSX10.13 3/24 | 20180324.03 | OSX10.13 3/26 | 20180326.01 | OSX10.13 3/27 | 20180327.01 | OSX10.13 3/27 | 20180327.04 | OSX10.13 3/29 | 20180329.05 | OSX10.13 3/30 | 20180330.01 | OSX10.13 3/30 | 20180330.06 | OSX10.13 3/31 | 20180331.02 | OSX10.13 3/31 | 20180331.03 | OSX10.13 3/31 | 20180331.05 | OSX10.13 28794 area-System.Security Throw the same exception for data too big and data too small in RSA Decrypt "A previous change brought the Cryptography_Padding_DecDataTooBig exception condition and message from .NET Framework to make sure that all platforms/providers were throwing in the same cases. That change left the ""data too small"" error up to the individual provider libraries. Windows reported NTE_BAD_DATA (""Bad data."") except for when it reported ERROR_INVALID_PARAMETER (""The parameter is incorrect."") macOS reported an AppleCryptographicException wrapping a CFError whose message had a CSSM error const complaining about the size. Linux (RSAOpenSsl) just tried the decryption and reported a padding failure, except for when the padding worked out and it returned... something. With this change all platforms will reject incorrectly sized data with a unified string. The data is now reported as not valid for the size of the key whether it was too big or too small, and now reports consistently across the different platforms and providers. Fixes #28625." 28795 area-Microsoft.CSharp Clean dead code for System.CSharp #17905 28796 area-System.IO Test failures in System.IO.FileSystem System.IO.Tests.Directory_Exists.ExtendedDriveAsPath [FAIL] Assert.All() Failure: 2 out of 4 items in the collection did not pass. [3]: Xunit.Sdk.TrueException: Assert.True() Failure Expected: True Actual: False at Xunit.Assert.True(Nullable`1 condition, String userMessage) in C:\BuildAgent\work\cb37e9acf085d108\src\xunit.assert\Asserts\BooleanAsserts.cs:line 90 at System.IO.Tests.Directory_Exists.<ExtendedDriveAsPath>b__33_0(String drive) in d:\Repos\corefx\src\System.IO.FileSystem\tests\Directory\Exists.cs:line 391 at Xunit.Assert.All[T](IEnumerable`1 collection, Action`1 action) in C:\BuildAgent\work\cb37e9acf085d108\src\xunit.assert\Asserts\CollectionAsserts.cs:line 31 [2]: Xunit.Sdk.TrueException: Assert.True() Failure Expected: True Actual: False at Xunit.Assert.True(Nullable`1 condition, String userMessage) in C:\BuildAgent\work\cb37e9acf085d108\src\xunit.assert\Asserts\BooleanAsserts.cs:line 90 at System.IO.Tests.Directory_Exists.<ExtendedDriveAsPath>b__33_0(String drive) in d:\Repos\corefx\src\System.IO.FileSystem\tests\Directory\Exists.cs:line 391 at Xunit.Assert.All[T](IEnumerable`1 collection, Action`1 action) in C:\BuildAgent\work\cb37e9acf085d108\src\xunit.assert\Asserts\CollectionAsserts.cs:line 31 Stack Trace: d:\Repos\corefx\src\System.IO.FileSystem\tests\Directory\Exists.cs(391,0): at System.IO.Tests.Directory_Exists.ExtendedDriveAsPath() System.IO.Tests.Directory_Exists.DriveAsPath [FAIL] Assert.All() Failure: 2 out of 4 items in the collection did not pass. [3]: Xunit.Sdk.TrueException: Assert.True() Failure Expected: True Actual: False at Xunit.Assert.True(Nullable`1 condition, String userMessage) in C:\BuildAgent\work\cb37e9acf085d108\src\xunit.assert\Asserts\BooleanAsserts.cs:line 90 at System.IO.Tests.Directory_Exists.<DriveAsPath>b__32_0(String drive) in d:\Repos\corefx\src\System.IO.FileSystem\tests\Directory\Exists.cs:line 383 at Xunit.Assert.All[T](IEnumerable`1 collection, Action`1 action) in C:\BuildAgent\work\cb37e9acf085d108\src\xunit.assert\Asserts\CollectionAsserts.cs:line 31 [2]: Xunit.Sdk.TrueException: Assert.True() Failure Expected: True Actual: False at Xunit.Assert.True(Nullable`1 condition, String userMessage) in C:\BuildAgent\work\cb37e9acf085d108\src\xunit.assert\Asserts\BooleanAsserts.cs:line 90 at System.IO.Tests.Directory_Exists.<DriveAsPath>b__32_0(String drive) in d:\Repos\corefx\src\System.IO.FileSystem\tests\Directory\Exists.cs:line 383 at Xunit.Assert.All[T](IEnumerable`1 collection, Action`1 action) in C:\BuildAgent\work\cb37e9acf085d108\src\xunit.assert\Asserts\CollectionAsserts.cs:line 31 Stack Trace: d:\Repos\corefx\src\System.IO.FileSystem\tests\Directory\Exists.cs(383,0): at System.IO.Tests.Directory_Exists.DriveAsPath() 28798 area-System.Security Test failure in System.Security.Principal.Windows WindowsPrincipalTests.CheckUserClaims [FAIL] System.ObjectDisposedException : Safe handle has been closed Stack Trace: at System.Runtime.InteropServices.SafeHandle.DangerousAddRef(Boolean& success) E:\A\_work\10\s\src\mscorlib\src\System\StubHelpers.cs(1639,0): at System.StubHelpers.StubHelpers.SafeHandleAddRef(SafeHandle pHandle, Boolean& success) at Interop.Advapi32.LsaLookupSids(SafeLsaPolicyHandle handle, Int32 count, IntPtr[] sids, SafeLsaMemoryHandle& referencedDomains, SafeLsaMemoryHandle& names) d:\Repos\corefx\src\System.Security.Principal.Windows\src\System\Security\Principal\SID.cs(1075,0): at System.Security.Principal.SecurityIdentifier.TranslateToNTAccounts(IdentityReferenceCollection sourceSids, Boolean& someFailed) d:\Repos\corefx\src\System.Security.Principal.Windows\src\System\Security\Principal\SID.cs(1218,0): at System.Security.Principal.SecurityIdentifier.Translate(IdentityReferenceCollection sourceSids, Type targetType, Boolean& someFailed) d:\Repos\corefx\src\System.Security.Principal.Windows\src\System\Security\Principal\SID.cs(1188,0): at System.Security.Principal.SecurityIdentifier.Translate(IdentityReferenceCollection sourceSids, Type targetType, Boolean forceSuccess) d:\Repos\corefx\src\System.Security.Principal.Windows\src\System\Security\Principal\SID.cs(903,0): at System.Security.Principal.SecurityIdentifier.Translate(Type targetType) d:\Repos\corefx\src\System.Security.Principal.Windows\src\System\Security\Principal\WindowsIdentity.cs(490,0): at System.Security.Principal.WindowsIdentity.<GetName>b__46_0() d:\Repos\corefx\src\System.Security.Principal.Windows\src\System\Security\Principal\WindowsIdentity.cs(669,0): at System.Security.Principal.WindowsIdentity.<>c__DisplayClass62_0.<RunImpersonatedInternal>b__0(Object <p0>) E:\A\_work\10\s\src\mscorlib\shared\System\Threading\ExecutionContext.cs(167,0): at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location where exception was thrown --- d:\Repos\corefx\src\System.Security.Principal.Windows\src\System\Security\Principal\WindowsIdentity.cs(655,0): at System.Security.Principal.WindowsIdentity.RunImpersonatedInternal(SafeAccessTokenHandle token, Action action) d:\Repos\corefx\src\System.Security.Principal.Windows\src\System\Security\Principal\WindowsIdentity.cs(603,0): at System.Security.Principal.WindowsIdentity.RunImpersonated(SafeAccessTokenHandle safeAccessTokenHandle, Action action) d:\Repos\corefx\src\System.Security.Principal.Windows\src\System\Security\Principal\WindowsIdentity.cs(488,0): at System.Security.Principal.WindowsIdentity.GetName() d:\Repos\corefx\src\System.Security.Principal.Windows\src\System\Security\Principal\WindowsIdentity.cs(475,0): at System.Security.Principal.WindowsIdentity.get_Name() d:\Repos\corefx\src\System.Security.Principal.Windows\src\System\Security\Principal\WindowsIdentity.cs(940,0): at System.Security.Principal.WindowsIdentity.InitializeClaims() d:\Repos\corefx\src\System.Security.Principal.Windows\src\System\Security\Principal\WindowsIdentity.cs(911,0): at System.Security.Principal.WindowsIdentity.get_Claims()+MoveNext() d:\Repos\corefx\src\System.Security.Claims\src\System\Security\Claims\ClaimsPrincipal.cs(234,0): at System.Security.Claims.ClaimsPrincipal.get_Claims()+MoveNext() d:\Repos\corefx\src\Common\src\System\Collections\Generic\LargeArrayBuilder.cs(172,0): at System.Collections.Generic.LargeArrayBuilder`1.AddRange(IEnumerable`1 items) d:\Repos\corefx\src\Common\src\System\Collections\Generic\EnumerableHelpers.cs(84,0): at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source) d:\Repos\corefx\src\System.Linq\src\System\Linq\ToCollection.cs(18,0): at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source) d:\Repos\corefx\src\System.Security.Principal.Windows\tests\WindowsPrincipalTests.cs(59,0): at WindowsPrincipalTests.CheckUserClaims() 28799 area-Infrastructure Build failed requiring cmake, but cmake seems to be present I am having a little trouble getting corefx to build. I ran the VS 2017 updater and freshly cloned master, then ran the sync script. Cmake 3.11.0 was installed and I verified that its bin directory is listed when running the PATH command. Yet, there is an error `CMake is a pre-requisite to build this repository but it was not found on the path. Please install CMake...` followed by `Failed to generate native component build project! Command execution failed with exit code 1.` I would be glad for a pointer how this could be fixed. I noticed a `toolSetDir=c:\tools\clr` in the log. I'm not sure what this means, but this directory does not exist. ``` C:\dev\pub\dotnet\corefx>git clean -xdf Removing Tools/ Removing bin/ Removing binclash.log Removing init-tools.log Removing msbuild.err Removing msbuild.log Removing msbuild.wrn Removing packages/ Removing sync.log C:\dev\pub\dotnet\corefx>build ********************************************************************** ** Visual Studio 2017 Developer Command Prompt v15.6.4 ** Copyright (c) 2017 Microsoft Corporation ********************************************************************** Installing dotnet cli... Restoring BuildTools version 2.1.0-preview3-02631-01... Initializing BuildTools... Done initializing tools. Running: C:\dev\pub\dotnet\corefx\src\Native\build-native.cmd x64 Debug Windows_NT --numproc 4 -portable toolSetDir=c:\tools\clr Tools are already initialized. Running: C:\dev\pub\dotnet\corefx\Tools\msbuild.cmd /nologo /verbosity:minimal /clp:Summary /maxcpucount /nodeReuse:false /l:BinClashLogger,Tools\net46\Microsof t.DotNet.Build.Tasks.dll;LogFile=binclash.log /p:ConfigurationGroup=Debug /p:BuildPackages=false /p:GenerateNativeVersionInfo=true /flp:v=normal /flp2:warning sonly;logfile=msbuild.wrn /flp3:errorsonly;logfile=msbuild.err C:\dev\pub\dotnet\corefx\src\Native\..\../build.proj /t:GenerateVersionHeader Build succeeded. 0 Warning(s) 0 Error(s) Time Elapsed 00:00:00.56 Command execution succeeded. ********************************************************************** ** Visual Studio 2017 Developer Command Prompt v15.6.4 ** Copyright (c) 2017 Microsoft Corporation ********************************************************************** [vcvarsall.bat] Environment initialized for: 'x86_x64' Commencing build of native components CMake is a pre-requisite to build this repository but it was not found on the path. Please install CMake from http://www.cmake.org/download/ and ensure it is on your path. Failed to generate native component build project! Command execution failed with exit code 1. C:\dev\pub\dotnet\corefx>cmake Usage cmake [options] <path-to-source> cmake [options] <path-to-existing-build> Specify a source directory to (re-)generate a build system for it in the current working directory. Specify an existing build directory to re-generate its build system. Run 'cmake --help' for more information. ``` 28805 area-System.Net Test failure: System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpClientHandler_Cancellation_Test / GetAsync_CancelDuringResponseBodyReceived_Buffered_TaskCanceledQuickly Test System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpClientHandler_Cancellation_Test.GetAsync_CancelDuringResponseBodyReceived_Buffered_TaskCanceledQuickly has failed. MESSAGE: Elapsed time 00:00:31.6655081 should be less than 30 seconds, was 31.6655081\r\nExpected: True\r\nActual: False ~~~ STACK TRACE: at System.Net.Http.Functional.Tests.HttpClientHandler_Cancellation_Test.ValidateClientCancellationAsync(Func`1 clientBodyAsync) in D:\j\workspace\outerloop_net---92764178\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.Cancellation.cs:line 372 at System.Net.Http.Functional.Tests.HttpClientHandler_Cancellation_Test.<>c__DisplayClass2_2.<<GetAsync_CancelDuringResponseBodyReceived_Buffered_TaskCanceledQuickly>b__0>d.MoveNext() in D:\j\workspace\outerloop_net---92764178\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.Cancellation.cs:line 128 --- End of stack trace from previous location where exception was thrown --- at System.Net.Test.Common.LoopbackServer.CreateServerAsync(Func`2 funcAsync, Options options) in D:\j\workspace\outerloop_net---92764178\src\Common\tests\System\Net\Http\LoopbackServer.cs:line 67 at System.Net.Http.Functional.Tests.HttpClientHandler_Cancellation_Test.GetAsync_CancelDuringResponseBodyReceived_Buffered_TaskCanceledQuickly(Boolean chunkedTransfer, Boolean connectionClose, CancellationMode mode) in D:\j\workspace\outerloop_net---92764178\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.Cancellation.cs:line 110 --- End of stack trace from previous location where exception was thrown --- ~~~ Details: https://ci.dot.net/job/dotnet_corefx/job/master/job/outerloop_netcoreapp_win7_debug/456/testReport/System.Net.Http.Functional.Tests/SocketsHttpHandler_HttpClientHandler_Cancellation_Test/GetAsync_CancelDuringResponseBodyReceived_Buffered_TaskCanceledQuickly_chunkedTransfer__True__connectionClose__False__mode__Token__CancelPendingRequests_/ 28806 area-System.Collections Add ItemRef and ValueRef to List/Dict (C# 7.2 constructs) Requires https://github.com/dotnet/coreclr/pull/17405 Contributes to https://github.com/dotnet/corefx/issues/25189 Resolves https://github.com/dotnet/corefx/issues/20684 * Adds ItemRef() to `List<T>` * Adds ValueRef() to `Dictionary<TKey, TValue>` As per https://github.com/dotnet/corefx/pull/25738 28808 area-System.Globalization Calender.GetWeekOfYear is not compatible with ISO 8601 and date Unix utility "`System.Threading.Thread.CurrentThread.CurrentCulture.Calendar.GetWeekOfYear()` return values that are not compatible with ISO 8601 and `date` Unix utility in some edge cases. ISO related [link](https://en.wikipedia.org/wiki/ISO_week_date#Relation_with_the_Gregorian_calendar) The issue was discovered in PowerShell repo https://github.com/PowerShell/PowerShell/pull/6542 (You should use the build if you want tests with PowerShell Core `Get-Date` cmdlet). - See 'First week' in https://en.wikipedia.org/wiki/ISO_week_date#Relation_with_the_Gregorian_calendar > If it is on a Sunday, it is part of week 52 of the previous year. \#'2017-01-01' is 'Sunday, January 1, 2017 12:00:00 AM' date -d 2017-01-01 +%V #return 52 - right Get-date 2017-01-01 -UFormat ""%V"" #return 1 - bug - See 'Last week' in https://en.wikipedia.org/wiki/ISO_week_date#Relation_with_the_Gregorian_calendar > If 31 December is on a Monday, Tuesday or Wednesday, it is in week 01 of the next year. \#'2007-12-31' is 'Monday, December 31, 2007 12:00:00 AM' date -d 2011-12-31 +%V #return 01 - right Get-date 2011-12-31 -UFormat ""%V"" #return 53 - bug " 28810 area-Meta memory reported by lldb does not match memory reported by `top` "We have memory issue with a .net core 2.0.5 service that runs in a linux container. The service consumes too much memory. After some struggling, I was able to create a memory dump using the following commands: ``` echo ""kernel.yama.ptrace_scope=0"" | tee -a /etc/sysctl.conf sysctl -p gcore -o /tmp/memory_dump 1 ``` Where `1` is the PID of the process that consumes too much memory. I also executed the `top` and `htop` commands before generating this dump. Here's what it looked like:   If I understand properly the output of `top`, the application uses about 1.47 GB of memory. This is also what [prometheus](https://prometheus.io/) reports. I then loaded my dump file in LLDB 3.6. Surprisingly, it reports that only 47 **MB** are used. Here's a partial output of `sos EEHeap`: ``` (lldb) sos EEHeap Loader Heap: -------------------------------------- System Domain: 00007f33b3160ce0 LowFrequencyHeap: 00007F3338EC0000(3000:3000) 00007F333B410000(10000:10000) 00007F333D5C0000(10000:10000) 00007F333D610000(10000:10000) 00007F333FD40000(10000:10000) 00007F3341F70000(10000:10000) Size: 0x53000 (339968) bytes. HighFrequencyHeap: 00007F3338EC6000(7000:7000) 00007F333B360000(10000:10000) 00007F333D5A0000(10000:10000) 00007F333D5B0000(10000:10000) 00007F333D5F0000(10000:10000) 00007F333D750000(10000:10000) 00007F333EC90000(10000:10000) 00007F333F1D0000(10000:10000) 00007F333FEA0000(10000:10000) 00007F33413A0000(10000:10000) 00007F3341AA0000(10000:10000) 00007F33421A0000(10000:10000) Size: 0xb7000 (749568) bytes. StubHeap: 00007F3338ECD000(3000:3000) Size: 0x3000 (12288) bytes. Virtual Call Stub Heap: IndcellHeap: 00007F3338F70000(6000:6000) Size: 0x6000 (24576) bytes. LookupHeap: 00007F3338F7C000(4000:4000) Size: 0x4000 (16384) bytes. ResolveHeap: 00007F3338FA6000(3a000:3a000) Size: 0x3a000 (237568) bytes. DispatchHeap: 00007F3338F80000(26000:26000) Size: 0x26000 (155648) bytes. CacheEntryHeap: 00007F3338F76000(6000:6000) Size: 0x6000 (24576) bytes. Total size: Size: 0x17d000 (1560576) bytes. -------------------------------------- ... -------------------------------------- Total LoaderHeap size: Size: 0x24db000 (38645760) bytes. ======================================= Number of GC Heaps: 1 generation 0 starts at 0x00007F331615CB28 generation 1 starts at 0x00007F3315FA4488 generation 2 starts at 0x00007F3313FFF000 ephemeral segment allocation context: none segment begin allocated size 00007F3313FFE000 00007F3313FFF000 00007F33167BC4F8 0x27bd4f8(41669880) Large object heap starts at 0x00007F3323FFF000 segment begin allocated size 00007F3323FFE000 00007F3323FFF000 00007F33247708E0 0x7718e0(7805152) Total Size: Size: 0x2f2edd8 (49475032) bytes. ------------------------------ GC Heap Size: Size: 0x2f2edd8 (49475032) bytes. ``` In a similar way if I do `sos DumpHeap -stat` and I sum the output of the `TotalSize` column, I get a total of 49045050 bytes which is pretty similar to the output of `sos EEHeap`. **So here's my question:** how is it possible to have such a big difference in memory consumption with `top` and `lldb`? Could it be possible that lldb only analyzes the managed memory which could point to a possible unmanaged memory leak? Any other theories are welcomed ;)" 28813 area-System.IO Cannot connect named pipe in UWP "##### Environment OS: Windows 10 Pro 17133.1 SDK: 16299 used; 17110 installed Microsoft.NETCore.UniversalWindowsPlatform 6.0.8 ##### Code Mostly copied from [NamedPipeTest](https://github.com/dotnet/corefx/blob/master/src/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Read.cs) ```csharp using (var serverPipe = new NamedPipeServerStream(""LOCAL\\Test"", PipeDirection.Out, 1, PipeTransmissionMode.Byte, PipeOptions.Asynchronous) using (var clientPipe = new NamedPipeClientStream(""."", ""LOCAL\\Test"", PipeDirection.In, PipeOptions.Asynchronous) { var clientTask = clientPipe.ConnectAsync(); serverPipe.WaitForConnection(); clientTask.Wait(); } ``` ##### Symptom Get `IOException` that ""pipe is closing"" in `serverPipe.WaitForConnection` If parameters except pipe name are removed, will get `IOException` that ""not supported in app container"" in `clientTask.Wait`. As the test has UWP specific handling (adding `\LOCAL`), I suppose the api to be available for UWP." 28814 area-System.Net Disable draining test on CurlHandler Fixes https://github.com/dotnet/corefx/issues/28793 cc: @geoffkizer, @wfurt, @pjanotti 28816 area-System.Runtime [NetFX] System.Runtime.Serialization.Formatters.Tests.BinaryFormatterTests/ValidateAgainstBlobs fails when running on .NET 4.7.1 We just upgraded our Helix machines to have .NET 4.7.1 and updating netfx alias in corefx to target .NET 4.7.1 as well, when trying to update the CI queues to use these machines, this test is failing: ``` Message : Assert.True() Failure Expected: True Actual: False Stack Trace : at System.Runtime.Serialization.Formatters.Tests.EqualityExtensions.CheckEquals(Object objA, Object objB, Boolean isSamePlatform) in E:\repos\corefxCopy\corefx\src\System.Runtime.Serialization.Formatters\tests\EqualityExtensions.cs:line 96 at System.Runtime.Serialization.Formatters.Tests.BinaryFormatterTests.ValidateAndRoundtrip(Object obj, TypeSerializableValue[] blobs, Boolean isEqualityComparer) in E:\repos\corefxCopy\corefx\src\System.Runtime.Serialization.Formatters\tests\BinaryFormatterTests.cs:line 104 at System.Runtime.Serialization.Formatters.Tests.BinaryFormatterTests.ValidateAgainstBlobs(Object obj, TypeSerializableValue[] blobs) in E:\repos\corefxCopy\corefx\src\System.Runtime.Serialization.Formatters\tests\BinaryFormatterTests.cs:line 54 ``` I can't get a local repro, but using the repro tool I did. https://mc.dot.net/#/user/safern/pr~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fdesktop~2Fcli/20180402.5433/workItem/System.Runtime.Serialization.Formatters.Tests/analysis/xunit/System.Runtime.Serialization.Formatters.Tests.BinaryFormatterTests~2FValidateAgainstBlobs(obj:%20CultureAwareComparer%20%7B%20%7D,%20blobs:%20%5BSystem.Runtime.Serialization.Formatters.Tests.TypeSerializabl) I will disable this test for NETFX. cc: @ViktorHofer @danmosemsft 28818 area-System.Net Pass Uri.IdnHost to WinHttpConnect fixes #28722 28819 area-System.Security SslStream.AuthenticateAsClientAsync sometimes throws an UnauthorizedAccessException on Linux SslStream.AuthenticateAsClientAsync sometimes throws an UnauthorizedAccessException on Linux. See aspnet/KestrelHttpServer#2456. ``` System.UnauthorizedAccessException : Access to the path '/home/aspnetagent/.dotnet/corefx/cryptography/x509stores/my' is denied. ---- System.IO.IOException : Bad file descriptor at System.IO.Enumeration.FileSystemEnumerator`1.FindNextEntry() at System.IO.Enumeration.FileSystemEnumerator`1.MoveNext() at Internal.Cryptography.Pal.DirectoryBasedStoreProvider.CloneTo(X509Certificate2Collection collection) at System.Security.Cryptography.X509Certificates.X509Store.get_Certificates() at Internal.Cryptography.Pal.OpenSslX509ChainProcessor.FindCandidates(X509Certificate2 leaf, X509Certificate2Collection extraStore, HashSet`1 downloaded, HashSet`1 systemTrusted, TimeSpan& remainingDownloadTime) at Internal.Cryptography.Pal.ChainPal.BuildChain(Boolean useMachineContext, ICertificatePal cert, X509Certificate2Collection extraStore, OidCollection applicationPolicy, OidCollection certificatePolicy, X509RevocationMode revocationMode, X509RevocationFlag revocationFlag, DateTime verificationTime, TimeSpan timeout) at System.Security.Cryptography.X509Certificates.X509Chain.Build(X509Certificate2 certificate, Boolean throwOnException) at System.Security.Cryptography.X509Certificates.X509Chain.Build(X509Certificate2 certificate) at System.Net.Security.CertificateValidation.BuildChainAndVerifyProperties(X509Chain chain, X509Certificate2 remoteCertificate, Boolean checkCertName, String hostName) at System.Net.Security.SecureChannel.VerifyRemoteCertificate(RemoteCertValidationCallback remoteCertValidationCallback, ProtocolToken& alertToken) at System.Net.Security.SslState.CompleteHandshake(ProtocolToken& alertToken) at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.PartialFrameCallback(AsyncProtocolRequest asyncRequest) --- End of stack trace from previous location where exception was thrown --- at System.Net.Security.SslState.InternalEndProcessAuthentication(LazyAsyncResult lazyResult) at System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult result) at System.Net.Security.SslStream.EndAuthenticateAsClient(IAsyncResult asyncResult) at System.Net.Security.SslStream.<>c.<AuthenticateAsClientAsync>b__43_2(IAsyncResult iar) at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization) --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Server.Kestrel.FunctionalTests.HttpsConnectionAdapterTests.ValidationFailureRejectsConnection(ClientCertificateMode mode) in /_/test/Kestrel.FunctionalTests/HttpsConnectionAdapterTests.cs:line 303 --- End of stack trace from previous location where exception was thrown --- ----- Inner Stack Trace ----- ``` This is the call that sometimes fails: https://github.com/aspnet/KestrelHttpServer/blob/70ce0447781bfca57f6945e6a5f056045073e6ec/test/Kestrel.FunctionalTests/HttpsConnectionAdapterTests.cs#L303 At first I thought this might be caused by concurrent access to our testCert.pfx file, but it access to `~/.dotnet/corefx/cryptography/x509stores/my` that's being denied. I suspect there are other tests using SslStream running in parallel though. 28823 area-System.Threading Port System.Threading perf tests to release/2.0.0 So that we can get a baseline for comparison against 2.0. https://github.com/dotnet/corefx/pull/28712 28824 area-System.Threading Enable a thread pool bound handle test on uap The test was failing sometimes, some debugging info was added as part of https://github.com/dotnet/corefx/issues/18058 to help with failure investigation. The test remained disabled though. Closes https://github.com/dotnet/corefx/issues/18058 until another failure occurs 28825 area-Infrastructure AllConfigurations leg failing with race condition "It has happened twice on my PR now. ``` 12:12:06 Build FAILED. 12:12:06 12:12:06 D:\j\workspace\windows-TGrou---0d2c9ac4\bin\testPkg\packageTest.targets(104,5): error MSB3371: The file ""obj\Debug\\.testComplete"" cannot be created. The process cannot access the file 'D:\j\workspace\windows-TGrou---0d2c9ac4\bin\testPkg\projects\System.Composition.Hosting\netcore451\obj\Debug\.testComplete' because it is being used by another process. [D:\j\workspace\windows-TGrou---0d2c9ac4\bin\testPkg\projects\System.Composition.Hosting\netcore451\project.csproj] [D:\j\workspace\windows-TGrou---0d2c9ac4\pkg\test\testPackages.proj] 12:12:06 D:\j\workspace\windows-TGrou---0d2c9ac4\pkg\test\testPackages.proj(177,5): error MSB3073: The command ""D:\j\workspace\windows-TGrou---0d2c9ac4\bin/testPkg/tools//dotnet msbuild /t:Test ""D:\j\workspace\windows-TGrou---0d2c9ac4\bin/testPkg/test.msbuild"" /p:TestPackages=System.Composition.Hosting"" exited with code 1. ``` https://ci3.dot.net/job/dotnet_corefx/job/master/job/windows-TGroup_all+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/10842/console cc: @ericstj @joperezr " 28828 area-System.Net Re-enable PostAsync_RedirectWith307_LargePayload Fixes #23768 28830 area-System.Net Perf regression on Linux SSL (ASP.NET plaintext) As seen on this KPI from 785K RPS before the regression:  Between `2.1.0-preview3-26330.03` and `2.1.0-preview3-26331-01` as shown on this graph:  The regression only occurs on Linux, and has been replicated on local environment and also on azure. 28831 area-System.Diagnostics Failure in Debian on System.Diagnostics.Tests.ProcessThreadTests/TestStartTimeProperty Debian.87.Amd64.Open-x64-Release - probably just outside the 1 sec window this test allows ```c# // Now add a thread, and from that thread, while it's still alive, verify // that there's at least one thread greater than the current time we previously grabbed. await Task.Factory.StartNew(() => { p.Refresh(); try { Assert.Contains(p.Threads.Cast<ProcessThread>(), t => t.StartTime.ToUniversalTime() >= curTime - allowedWindow); } catch (InvalidOperationException) { // A thread may have gone away between our getting its info and attempting to access its StartTime } ``` ``` Assert.Contains() Failure Not found: (filter expression) In value: <CastIterator>d__34<ProcessThread> [System.Diagnostics.ProcessThread, System.Diagnostics.ProcessThread, System.Diagnostics.ProcessThread, System.Diagnostics.ProcessThread, System.Diagnostics.ProcessThread, ...] Stack Trace : at System.Diagnostics.Tests.ProcessThreadTests.<>c__DisplayClass3_2.<TestStartTimeProperty>b__0() in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/src/System.Diagnostics.Process/tests/ProcessThreadTests.cs:line 129 at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /root/coreclr/src/mscorlib/shared/System/Threading/ExecutionContext.cs:line 167 --- End of stack trace from previous location where exception was thrown --- at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) in /root/coreclr/src/mscorlib/src/System/Threading/Tasks/Task.cs:line 2440 --- End of stack trace from previous location where exception was thrown --- at System.Diagnostics.Tests.ProcessThreadTests.TestStartTimeProperty() in /mnt/j/workspace/dotnet_corefx/master/linux-TGroup_netcoreapp+CGroup_Release+AGroup_x64+TestOuter_false_prtest/src/System.Diagnostics.Process/tests/ProcessThreadTests.cs:line 127 --- End of stack trace from previous location where exception was thrown --- ``` 28833 area-Infrastructure Problems with ASP.NET projects when consuming .NET Standard assets It has been reported by users that if you are building an ASP.NET web app which consumes an asset that is .NET Standard-based, the app may encounter errors at runtime given that it can't find assemblies. This is an example of the errors one might get when hitting this issue: ``` System.IO.FileNotFoundException occurred HResult=0x80070002 Message=Could not load file or assembly 'System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. ``` One other symptom of this is that your project will complain that it needs some binding redirects added to your web.config, which you will have to add by double-clicking the warning from the error list in VS. The reason behind what is happening is that because of [this known issue](https://github.com/Microsoft/dotnet/blob/master/releases/net471/KnownIssues/514195-Targeting%20.NET%20Framework%204.7.1%20copies%20extra%20files%20to%20your%20bin%20directory.md) we end up requiring a few extra assemblies to be loaded in order to be able to run a .NET Standard-based component on .NET Framework. Because of how ASP.NET handles deployments, in some scenarios these extra files won't be copied over to the application directory, causing most of the issues. This issue is created so that we can track the problem separate from issue #25773 as it was dicussed on this comment: https://github.com/dotnet/corefx/issues/25773#issuecomment-378341475 cc: @AlexGhiondea 28834 area-Meta Regression impacting ASP.NET MVC Testing on a fixed aspnet version and varying dotnet runtime, we see a 6% regression on the MVC Plaintext scenario between these versions: `2.1.0-preview2-26324-02` https://github.com/dotnet/corefx/tree/23165cee77ae4dd7a7645b7927872948bb27a73e and `2.1.0-preview2-26316-06` https://github.com/dotnet/corefx/tree/8130620b542457ca4e72eb2bc81c3eae50192a33  A diff on perfview traces for these two versions resulted in this:  The two full traces are available if necessary. 28835 area-System.IO Remove Relative Segments with valueStringBuilder Related Issue:- https://github.com/dotnet/corefx/issues/28258 Related Coreclr Pr:- https://github.com/dotnet/coreclr/pull/17429 Relateed Corefx PR:- https://github.com/dotnet/corefx/pull/28837 28837 area-System.IO Tests for TryGetFullPath [WIP] Fixes:- dotnet/corefx#28258 Implementation:- PR https://github.com/dotnet/coreclr/pull/17429 RemoveRelativeSegments:- dotnet/corefx#28835 28840 area-System.Collections Clean up dead code for System.Collections* #17905 28841 area-System.Net WinHttpHandler perf optimization for ClientCertificates, ServerCertificateValidationCallback In a larger server app, there may be scenarios where different parts of the code need to use different client certificates on a per-request basis. Same with ServerCertificateValidationCallback. The native WinHttp library lets you efficiently pool connections across a session, and set client certificates and perform custom certificate validation on a per-request basis within that session, but the managed library forces you to share these settings across all requests in a session. People often use ServerCertificateValidationCallback as an instance delegate on some object that has a much shorter lifetime than the session. It would be good if the managed library just let you set these on a per-request basis. It's really hard to get good perf otherwise. 28842 area-System.Net Enable connection pooling for requests that use different client certificates… Enable connection pooling for requests that use different client certificates or server certificate callbacks. This allows setting these options on a per-request basis, which has much better perf for scenarios that want to share a session between requests that use different options for these. #28841 28843 area-System.Net Consolidate http date parsing "Fixes #12513 Followup to #28541 Fixes the following bugs for Http date parsing in System.Net.Requests: - considered ANSI dates to be local (to the _receiver_, no less), instead of UTC/GMT like the spec says. - accepted offset values (ie, `+05:00`), but didn't actually use them. - would throw `ArrayIndexOutOfBoundsException` if a string token didn't have enough distinguishing characters (ie, `'S'` throws, because it needs to check the next character for `'a'`/`'u'` for Saturday/Sunday) - would throw `ArgumentOutOfRangeException` for dates like `""Sun, 31 Nov 2018 16:33:01 GMT""` (there are only 30 days in November). For System.Net.Requests, with respect to the original behavior: - Retains case insensitivity of the original (mostly - UTC/GMT must now be uppercase). - Drops ability to use partially matching day-of-week/month strings (ie, the original parses `""Surprise""` as `""Sunday""`). - Drops ability to use non-matching date/day-of-week strings (ie `""Sat, 25 Mar 2018 16:33:01 GMT""` - the 25th was actually a Sunday) - Drops ability to use arbitrary characters as separators. - Now allows arbitrary amounts of whitespace between tokens. cc: @stephentoub @geoffkizer @karelz @rmkerr @davidsh @caesar1995 @wfurt " 28846 area-Meta Move/create authorization classes in .Net Core The Microsoft.AspNetCore.Authorization namespace contains classes that are useful in .Net Core and is not dependent on ASP.Net Core, please make them available in a .Net Core namespace. Ref. [Make Authorization available outside of ASP.NET Core](https://github.com/aspnet/Security/issues/1480) 28847 area-System.Net HttpClientHandler.UseDefaultCredentials does not work on Unix platforms When this this is set to True, we should use identity of currently logged user for authentication to HTTP(s) severs or proxies. Note, that on Windows this works only for NTLM and NEGOTIATE as there is no way how to extract clear text password for Basic or Digest authentication. On Unix, there is typically not centralized identity management nor strong cryptographic ID. However when Kerberos is configured, curl is able to use default principal from ticket if user previously authenticated using kinit. > build@toweinfu-ubu17:~/github/corefx/src$ klist > Ticket cache: FILE:/tmp/krb5cc_1000 > Default principal: testuser@TEST.NET > > Valid starting Expires Service principal > 04/05/2018 06:12:30 04/05/2018 16:12:30 krbtgt/TEST.NET@TEST.NET > renew until 04/06/2018 06:12:24 > This does not work neither for CurlHandler nor for SocketsHttpHandler. Further more, ,many Unix utilities (wget, curl, git, ftp, ...) can read credentials from .netrc file. That is not great but it is still better than hardcoding secrets in code or passing them via environmental variable. If we choose to, this could be also source of default credentials (basic support tracked by #23313) 28848 area-System.Collections [Proposal] Use Bitmapped Vector Tries for ImmutableList I'm wondering why aren't we using bitmapped Vector Tries for ImmutableList? Forgive me if this question has been asked. As far as I know, this data structure is used in Closure's PersistentVector, and ImmutableJS's List. I have a preliminary implementation and it shows that it's faster than the current implementation of the current ImmutableList. For getting sequential or random elements in the list, the trie is about 4 times faster, and for adding elements, it about 3 times faster. Of course, these numbers are the preliminary findings. For those who don't know what Bitmapped Vector Tries is: [Understanding Clojure's Persistent Vectors](https://hypirion.com/musings/understanding-persistent-vector-pt-1) [Immutable.js](https://facebook.github.io/immutable-js/) 28849 area-System.Net Pass Uri.IdnHost to WinHttpConnect fixes #28722 replace PR #28818 cc: @davidsh @rmkerr @caesar1995 28850 area-Infrastructure [Linux] Build tests part hangs corefx release version 2.0 dotnet-cli version 2.0.0-preview1-002111 When I try to build managed part, it's successfully complete: `./build-managed.sh -release -RuntimeOS=ubuntu.14.04 -- /p:BinPlaceNETCoreAppPackage=true` But when I run: `./build-tests.sh -release -Outerloop -SkipTests` it hangs. I waited a few hours, no result. Logs: ``` ./build-tests.sh -Release -Outerloop -SkipTests Tools are already initialized Running: corefx-2.0.0.22710/Tools/msbuild.sh /nologo /verbosity:minimal /clp:Summary /maxcpucount /l:BinClashLogger,Tools/Microsoft.DotNet.Build.Tasks.dll;LogFile=binclash.log /p:ConfigurationGroup=Release /p:SkipTests=true /p:BuildPackages=false /p:Outerloop=true /flp:v=normal;LogFile=build-tests.log /flp2:warningsonly;logfile=msbuild.wrn /flp3:errorsonly;logfile=msbuild.err src/tests.builds Common.Tests -> corefx-2.0.0.22710/bin/Unix.AnyCPU.Release/Common.Tests/netstandard/Common.Tests.dll System.Runtime.InteropServices.RuntimeInformation.Tests -> corefx-2.0.0.22710/bin/Unix.AnyCPU.Release/System.Runtime.InteropServices.RuntimeInformation.Tests/netstandard/System.Runtime.InteropServices.RuntimeInformation.Tests.dll System.Data.Odbc.Tests -> corefx-2.0.0.22710/bin/Unix.AnyCPU.Release/System.Data.Odbc.Tests/netstandard/System.Data.Odbc.Tests.dll System.Security.Cryptography.Encoding.Tests -> corefx-2.0.0.22710/bin/Unix.AnyCPU.Release/System.Security.Cryptography.Encoding.Tests/netstandard/System.Security.Cryptography.Encoding.Tests.dll System.Net.NameResolution.Functional.Tests -> corefx-2.0.0.22710/bin/Unix.AnyCPU.Release/System.Net.NameResolution.Functional.Tests/netstandard/System.Net.NameResolution.Functional.Tests.dll System.Net.Security.Unit.Tests -> corefx-2.0.0.22710/bin/Unix.AnyCPU.Release/System.Net.Security.Unit.Tests/netstandard/System.Net.Security.Unit.Tests.dll System.Net.WebSockets.Client.Tests -> corefx-2.0.0.22710/bin/Unix.AnyCPU.Release/System.Net.WebSockets.Client.Tests/netstandard/System.Net.WebSockets.Client.Tests.dll System.Diagnostics.TraceSource.Tests -> corefx-2.0.0.22710/bin/Unix.AnyCPU.Release/System.Diagnostics.TraceSource.Tests/netstandard/System.Diagnostics.TraceSource.Tests.dll System.Net.Ping.Functional.Tests -> corefx-2.0.0.22710/bin/Unix.AnyCPU.Release/System.Net.Ping.Functional.Tests/netstandard/System.Net.Ping.Functional.Tests.dll System.IO.FileSystem.DriveInfo.Tests -> corefx-2.0.0.22710/bin/Unix.AnyCPU.Release/System.IO.FileSystem.DriveInfo.Tests/netstandard/System.IO.FileSystem.DriveInfo.Tests.dll PerfRunner -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/PerfRunner/netstandard/PerfRunner.exe RemoteExecutorConsoleApp -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/RemoteExecutorConsoleApp/netstandard/RemoteExecutorConsoleApp.exe System.Diagnostics.FileVersionInfo.TestAssembly -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Diagnostics.FileVersionInfo.TestAssembly/netstandard/System.Diagnostics.FileVersionInfo.TestAssembly.dll IMonitorLoader -> corefx-2.0.0.22710/bin/Unix.AnyCPU.Release/IMonitorLoader/netstandard/Monitoring.dll TDS -> corefx-2.0.0.22710/bin/Unix.AnyCPU.Release/TDS/netstandard/Microsoft.SqlServer.TDS.dll System.Net.Primitives.Performance.Tests -> corefx-2.0.0.22710/bin/Unix.AnyCPU.Release/System.Net.Primitives.Performance.Tests/netstandard/System.Net.Primitives.Performance.Tests.dll System.Diagnostics.Process.Tests -> corefx-2.0.0.22710/bin/Unix.AnyCPU.Release/System.Diagnostics.Process.Tests/netstandard/System.Diagnostics.Process.Tests.dll System.Net.Sockets.Async.Performance.Tests -> corefx-2.0.0.22710/bin/Unix.AnyCPU.Release/System.Net.Sockets.Async.Performance.Tests/netstandard/System.Net.Sockets.Async.Performance.Tests.dll System.IO.Pipes.Tests -> corefx-2.0.0.22710/bin/Unix.AnyCPU.Release/System.IO.Pipes.Tests/netstandard/System.IO.Pipes.Tests.dll System.IO.MemoryMappedFiles.Tests -> corefx-2.0.0.22710/bin/Unix.AnyCPU.Release/System.IO.MemoryMappedFiles.Tests/netstandard/System.IO.MemoryMappedFiles.Tests.dll System.Net.Primitives.Functional.Tests -> corefx-2.0.0.22710/bin/Unix.AnyCPU.Release/System.Net.Primitives.Functional.Tests/netstandard/System.Net.Primitives.Functional.Tests.dll System.IO.MemoryMappedFiles.Performance.Tests -> corefx-2.0.0.22710/bin/Unix.AnyCPU.Release/System.IO.MemoryMappedFiles.Performance.Tests/netstandard/System.IO.MemoryMappedFiles.Performance.Tests.dll System.Data.StressRunner -> corefx-2.0.0.22710/bin/Unix.AnyCPU.Release/System.Data.StressRunner/netstandard/System.Data.StressRunner.exe TDS.EndPoint -> corefx-2.0.0.22710/bin/Unix.AnyCPU.Release/TDS.EndPoint/netstandard/Microsoft.SqlServer.TDS.EndPoint.dll System.Diagnostics.FileVersionInfo.Tests -> corefx-2.0.0.22710/bin/Unix.AnyCPU.Release/System.Diagnostics.FileVersionInfo.Tests/netstandard/System.Diagnostics.FileVersionInfo.Tests.dll System.Data.StressFramework -> corefx-2.0.0.22710/bin/Unix.AnyCPU.Release/System.Data.StressFramework/netstandard/System.Data.StressFramework.dll TDS.Servers -> corefx-2.0.0.22710/bin/Unix.AnyCPU.Release/TDS.Servers/netstandard/Microsoft.SqlServer.TDS.Servers.dll System.Data.SqlClient.Stress.Tests -> corefx-2.0.0.22710/bin/Unix.AnyCPU.Release/System.Data.SqlClient.Stress.Tests/netstandard/System.Data.SqlClient.Stress.Tests.dll System.Data.SqlClient.Tests -> corefx-2.0.0.22710/bin/Unix.AnyCPU.Release/System.Data.SqlClient.Tests/netstandard/System.Data.SqlClient.Tests.dll Microsoft.XmlSerializer.Generator -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/Microsoft.XmlSerializer.Generator/netstandard/Microsoft.XmlSerializer.Generator.dll System.CodeDom.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.CodeDom.Tests/netstandard/System.CodeDom.Tests.dll Microsoft.CSharp.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/Microsoft.CSharp.Tests/netstandard/Microsoft.CSharp.Tests.dll System.ComponentModel.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.ComponentModel.Tests/netstandard/System.ComponentModel.Tests.dll System.Configuration.ConfigurationManager.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Configuration.ConfigurationManager.Tests/netstandard/System.Configuration.ConfigurationManager.Tests.dll System.ComponentModel.EventBasedAsync.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.ComponentModel.EventBasedAsync.Tests/netstandard/System.ComponentModel.EventBasedAsync.Tests.dll System.AppContext.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.AppContext.Tests/netstandard/System.AppContext.Tests.dll System.ComponentModel.Annotations.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.ComponentModel.Annotations.Tests/netstandard/System.ComponentModel.Annotations.Tests.dll System.Collections.NonGeneric.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Collections.NonGeneric.Tests/netstandard/System.Collections.NonGeneric.Tests.dll System.Diagnostics.Contracts.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Diagnostics.Contracts.Tests/netstandard/System.Diagnostics.Contracts.Tests.dll System.Data.Common.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Data.Common.Tests/netstandard/System.Data.Common.Tests.dll Microsoft.VisualBasic.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/Microsoft.VisualBasic.Tests/netstandard/Microsoft.VisualBasic.Tests.dll System.ComponentModel.Primitives.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.ComponentModel.Primitives.Tests/netstandard/System.ComponentModel.Primitives.Tests.dll Microsoft.Win32.Primitives.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/Microsoft.Win32.Primitives.Tests/netstandard/Microsoft.Win32.Primitives.Tests.dll System.Buffers.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Buffers.Tests/netstandard/System.Buffers.Tests.dll System.Collections.Specialized.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Collections.Specialized.Tests/netstandard/System.Collections.Specialized.Tests.dll System.Data.SqlClient.ManualTesting.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Data.SqlClient.ManualTesting.Tests/netstandard/System.Data.SqlClient.ManualTesting.Tests.dll System.Reflection.Context.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Reflection.Context.Tests/netstandard/System.Reflection.Context.Tests.dll System.IO.FileSystem.Primitives.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.IO.FileSystem.Primitives.Tests/netstandard/System.IO.FileSystem.Primitives.Tests.dll System.Diagnostics.TextWriterTraceListener.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Diagnostics.TextWriterTraceListener.Tests/netstandard/System.Diagnostics.TextWriterTraceListener.Tests.dll System.Private.Uri.Functional.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Private.Uri.Functional.Tests/netstandard/System.Private.Uri.Functional.Tests.dll System.IO.Packaging.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.IO.Packaging.Tests/netstandard/System.IO.Packaging.Tests.dll System.Xml.XmlSerializer.ReflectionOnly.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Xml.XmlSerializer.ReflectionOnly.Tests/netstandard/System.Xml.XmlSerializer.ReflectionOnly.Tests.dll System.Net.WebProxy.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Net.WebProxy.Tests/netstandard/System.Net.WebProxy.Tests.dll System.Reflection.Extensions.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Reflection.Extensions.Tests/netstandard/System.Reflection.Extensions.Tests.dll System.Globalization.Extensions.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Globalization.Extensions.Tests/netstandard/System.Globalization.Extensions.Tests.dll System.Diagnostics.Tools.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Diagnostics.Tools.Tests/netstandard/System.Diagnostics.Tools.Tests.dll System.IO.UnmanagedMemoryStream.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.IO.UnmanagedMemoryStream.Tests/netstandard/System.IO.UnmanagedMemoryStream.Tests.dll System.Private.Uri.Unit.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Private.Uri.Unit.Tests/netstandard/System.Private.Uri.Unit.Tests.dll System.Net.WebHeaderCollection.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Net.WebHeaderCollection.Tests/netstandard/System.Net.WebHeaderCollection.Tests.dll System.Private.Uri.ExtendedFunctional.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Private.Uri.ExtendedFunctional.Tests/netstandard/System.Private.Uri.ExtendedFunctional.Tests.dll System.Resources.Reader.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Resources.Reader.Tests/netstandard/System.Resources.Reader.Tests.dll System.Xml.XmlSerializer.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Xml.XmlSerializer.Tests/netstandard/System.Xml.XmlSerializer.Tests.dll System.Net.HttpListener.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Net.HttpListener.Tests/netstandard/System.Net.HttpListener.Tests.dll System.Dynamic.Runtime.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Dynamic.Runtime.Tests/netstandard/System.Dynamic.Runtime.Tests.dll System.Net.WebClient.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Net.WebClient.Tests/netstandard/System.Net.WebClient.Tests.dll System.Runtime.Numerics.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Runtime.Numerics.Tests/netstandard/System.Runtime.Numerics.Tests.dll System.Globalization.Calendars.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Globalization.Calendars.Tests/netstandard/System.Globalization.Calendars.Tests.dll System.Resources.Writer.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Resources.Writer.Tests/netstandard/System.Resources.Writer.Tests.dll System.Net.NetworkInformation.Functional.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Net.NetworkInformation.Functional.Tests/netstandard/System.Net.NetworkInformation.Functional.Tests.dll System.Runtime.Handles.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Runtime.Handles.Tests/netstandard/System.Runtime.Handles.Tests.dll System.Reflection.TestExe -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Reflection.TestExe/netstandard/System.Reflection.TestExe.exe System.Resources.ResourceManager.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Resources.ResourceManager.Tests/netstandard/System.Resources.ResourceManager.Tests.dll Microsoft.Composition.Demos.ExtendedCollectionImports -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/Microsoft.Composition.Demos.ExtendedCollectionImports/netstandard/Microsoft.Composition.Demos.ExtendedCollectionImports.dll System.Runtime.Serialization.Json.ReflectionOnly.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Runtime.Serialization.Json.ReflectionOnly.Tests/netstandard/System.Runtime.Serialization.Json.ReflectionOnly.Tests.dll ModuleCore -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/ModuleCore/netstandard/ModuleCore.dll XDocument.Test.ModuleCore -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/XDocument.Test.ModuleCore/netstandard/XDocument.Test.ModuleCore.dll Microsoft.XmlSerializer.Generator.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/Microsoft.XmlSerializer.Generator.Tests/netstandard/Microsoft.XmlSerializer.Generator.Tests.dll System.Runtime.Serialization.Xml.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Runtime.Serialization.Xml.Tests/netstandard/System.Runtime.Serialization.Xml.Tests.dll System.Security.SecureString.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Security.SecureString.Tests/netstandard/System.Security.SecureString.Tests.dll System.Security.Permissions.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Security.Permissions.Tests/netstandard/System.Security.Permissions.Tests.dll System.Runtime.Serialization.Xml.ReflectionOnly.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Runtime.Serialization.Xml.ReflectionOnly.Tests/netstandard/System.Runtime.Serialization.Xml.ReflectionOnly.Tests.dll System.Threading.Tasks.Parallel.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Threading.Tasks.Parallel.Tests/netstandard/System.Threading.Tasks.Parallel.Tests.dll System.Threading.Thread.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Threading.Thread.Tests/netstandard/System.Threading.Thread.Tests.dll System.Runtime.Serialization.Json.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Runtime.Serialization.Json.Tests/netstandard/System.Runtime.Serialization.Json.Tests.dll System.Security.Cryptography.Xml.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Security.Cryptography.Xml.Tests/netstandard/System.Security.Cryptography.Xml.Tests.dll System.Text.Encodings.Web.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Text.Encodings.Web.Tests/netstandard/System.Text.Encodings.Web.Tests.dll System.Threading.Overlapped.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Threading.Overlapped.Tests/netstandard/System.Threading.Overlapped.Tests.dll System.Text.Encoding.CodePages.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Text.Encoding.CodePages.Tests/netstandard/System.Text.Encoding.CodePages.Tests.dll System.Security.Claims.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Security.Claims.Tests/netstandard/System.Security.Claims.Tests.dll System.Text.Encoding.Extensions.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Text.Encoding.Extensions.Tests/netstandard/System.Text.Encoding.Extensions.Tests.dll Canonicalization.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/Canonicalization.Tests/netstandard/Canonicalization.Tests.dll System.Threading.ThreadPool.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Threading.ThreadPool.Tests/netstandard/System.Threading.ThreadPool.Tests.dll System.Threading.Tasks.Dataflow.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Threading.Tasks.Dataflow.Tests/netstandard/System.Threading.Tasks.Dataflow.Tests.dll System.Threading.Timer.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Threading.Timer.Tests/netstandard/System.Threading.Timer.Tests.dll System.Net.Mail.Functional.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Net.Mail.Functional.Tests/netstandard/System.Net.Mail.Functional.Tests.dll System.Net.Requests.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Net.Requests.Tests/netstandard/System.Net.Requests.Tests.dll System.Console.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Console.Tests/netstandard/System.Console.Tests.dll System.Transactions.Local.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Transactions.Local.Tests/netstandard/System.Transactions.Local.Tests.dll TestLibrary -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/TestLibrary/netstandard/TestLibrary.dll System.Web.HttpUtility.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Web.HttpUtility.Tests/netstandard/System.Web.HttpUtility.Tests.dll System.Net.Sockets.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Net.Sockets.Tests/netstandard/System.Net.Sockets.Tests.dll System.Runtime.Serialization.Formatters.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Runtime.Serialization.Formatters.Tests/netstandard/System.Runtime.Serialization.Formatters.Tests.dll XmlDiff -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/XmlDiff/netstandard/XmlDiff.dll System.IO.FileSystem.Performance.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.IO.FileSystem.Performance.Tests/netstandard/System.IO.FileSystem.Performance.Tests.dll System.IO.Pipes.Performance.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.IO.Pipes.Performance.Tests/netstandard/System.IO.Pipes.Performance.Tests.dll System.Reflection.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Reflection.Tests/netstandard/System.Reflection.Tests.dll System.Composition.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Composition.Tests/netstandard/System.Composition.Tests.dll System.Globalization.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Globalization.Tests/netstandard/System.Globalization.Tests.dll XmlCoreTest -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/XmlCoreTest/netstandard/XmlCoreTest.dll System.Xml.Xsl.XslTransformApi.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Xml.Xsl.XslTransformApi.Tests/netstandard/System.Xml.Xsl.XslTransformApi.Tests.dll XDocument.Common -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/XDocument.Common/netstandard/XDocument.Common.dll System.Xml.Linq.Events.Tests -> corefx-2.0.0.22710/bin/AnyOS.AnyCPU.Release/System.Xml.Linq.Events.Tests/netstandard/System.Xml.Linq.Events.Tests.dll ``` Does anyone know how to solve this problem? It seems like it's trying to download nuget packages and hangs. But then the question - why does timeout not work? This issue occurs rarely, once a day. Therefore, it's difficult to catch. 28851 area-System.Net Fix getting shortname of file for Attachment class The shortname for a file path is incorrectly calculated on non-Windows systems as the seperators are NTFS specific. Fix is to use System.IO.Path::GetFileName() instead of custom method. Fixes https://github.com/PowerShell/PowerShell/issues/6564 28853 area-System.Diagnostics GetILOffset() returning 0 on NETFX " ``` System.Diagnostics.Tests.StackFrameTests/Ctor_Filename_LineNumber(fileName: \""FileName\"", lineNumber: 1) ubwAnalysisIndex Xunit.Sdk.TrueException Windows.10.Amd64.ClientRS2.Open-x86-Release Get Repro environment Unhandled Exception of Type Xunit.Sdk.TrueException Message : Expected GetILOffset() 0 for Ctor_Filename_LineNumber at offset 46 in file:line:column FileName:1:0 to be greater than zero. Expected: True Actual: False Stack Trace : at System.Diagnostics.Tests.StackFrameTests.VerifyStackFrameSkipFrames(StackFrame stackFrame, Boolean isFileConstructor, Int32 skipFrames, MethodInfo expectedMethod, Boolean isCurrentFrame) in D:\j\workspace\windows-TGrou---2a8f9c29\src\System.Diagnostics.StackTrace\tests\StackFrameTests.cs:line 177 at System.Diagnostics.Tests.StackFrameTests.Ctor_Filename_LineNumber(String fileName, Int32 lineNumber) in D:\j\workspace\windows-TGrou---2a8f9c29\src\System.Diagnostics.StackTrace\tests\StackFrameTests.cs:line 96 ``` All these are failing ``` Ctor_Filename_LineNumber(fileName: \""\"", lineNumber: 0) Ctor_Filename_LineNumber(fileName: \""FileName\"", lineNumber: 1) Ctor_Filename_LineNumber(fileName: null, lineNumber: -1) Ctor_Filename_LineNumber_ColNumber(fileName: \""\"", lineNumber: 0, columnNumber: -1) Ctor_Filename_LineNumber_ColNumber(fileName: \""FileName\"", lineNumber: 1, columnNumber: 2) Ctor_Filename_LineNumber_ColNumber(fileName: null, lineNumber: -1, columnNumber: 0) ‐ " 28857 area-System.Memory ReadOnlySequence.ToString() and debug view https://github.com/dotnet/corefx/issues/27434  Also cleanup duplicated code in sequence factory and add another variation for tests. 28858 area-System.IO Some FileSystemSecurityTests still fail in non en-US ``` RemoveAccessRuleAll_Succeeds RemoveAuditRuleAll_Succeeds RemoveAuditRuleSpecific_Succeeds SetAccessRule_IgnoreExistingRule_Succeeds SetAuditRule_Succeeds ``` need the same fix as applied in 56f02f35235606415c8773be6d8c26e41653c767 ``` System.Security.Principal.IdentityNotMappedException : Some or all identity references could not be translated. Stack Trace : at System.Security.Principal.NTAccount.Translate(IdentityReferenceCollection sourceAccounts, Type targetType, Boolean forceSuccess) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Security.Principal.Windows\src\System\Security\Principal\NTAccount.cs:line 177 at System.Security.Principal.NTAccount.Translate(Type targetType) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Security.Principal.Windows\src\System\Security\Principal\NTAccount.cs:line 130 at System.Security.AccessControl.CommonObjectSecurity.ModifyAccess(AccessControlModification modification, AccessRule rule, Boolean& modified) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Security.AccessControl\src\System\Security\AccessControl\CommonObjectSecurity.cs:line 251 at System.Security.AccessControl.CommonObjectSecurity.AddAccessRule(AccessRule rule) in D:\j\workspace\windows-TGrou---74aa877a\src\System.Security.AccessControl\src\System\Security\AccessControl\CommonObjectSecurity.cs:line 450 at System.Security.AccessControl.FileSystemSecurity.AddAccessRule(FileSystemAccessRule rule) in D:\j\workspace\windows-TGrou---74aa877a\src\System.IO.FileSystem.AccessControl\src\System\Security\AccessControl\FileSecurity.cs:line 462 at System.IO.FileSystemSecurityTests.RemoveAccessRuleAll_Succeeds() in D:\j\workspace\windows-TGrou---74aa877a\src\System.IO.FileSystem.AccessControl\tests\FileSystemSecurityTests.cs:line 251 ``` cc @AlexRadch @Anipik 28859 area-System.Net Fix perf hit from WinHttpGetProxyForUrl This PR optimizes some scenarios which we need to call `WinHttpGetProxyForUrl`. 1. Introduce the `WinHttpDetectAutoProxyConfigUrl` function, which implements a subset of the WPAD protocol: it attempts to auto-detect the URL for the proxy auto-config file, without downloading or executing the PAC file. - If not able to find the script location. It is possible that there is no proxy auto-configuration file because the client has a direct Internet connection, and does not need a proxy server. Or a proxy server may be required, but the local network may not support WPAD. In both cases, the proxy configuration has to be obtained from the user or found somewhere on the client machine. We will use the information from calling into `WinHttpGetIEProxyConfigForCurrentUser` to see whether a proxy server is listed in Internet Explorer's settings. Cache the information. - If able to find the script location, the AutoDetect setting has precedence over the other settings. So if there is already a automatic configuration script location (from `WinHttpGetIEProxyConfigForCurrentUser`), this value will be overridden. We will cache the related information and provide it to `WinHttpGetProxyForUrl`. 2. If there is no proxy, the information has been cached from the above procedures, we will stop calling into `WinHttpGetProxyForUrl`. We have exhaustive test cases verifying behaviors with different proxy settings. Please let me know if there are special cases we care about, and I will add tests for them. https://github.com/dotnet/corefx/blob/85062446c4e5af0c205f646e0ae720e160b20e85/src/System.Net.Http.WinHttpHandler/tests/UnitTests/WinHttpHandlerTest.cs#L641-L832 Fix: #28543 28860 area-System.Security Loading a X509Certificate2 causes a CGI exception on Azure App Service "_From @ricklove on October 19, 2016 14:39_ I am trying to load a .p12 file into a X509Certificate2 object. **The code runs fine on my local machine.** Whenever, I run the following line **on Azure, it crashes the asp.net process with a CGI error**: `var certificate = new X509Certificate2(fileBytes, ""notasecret"", X509KeyStorageFlags.Exportable);` The following line does **not** crash: `var cert = new X509Certificate2();` Also, **if the password is incorrect, the server gives a normal exception** explaining that the password is incorrect: `var certificate = new X509Certificate2(fileBytes, ""wrong"");` I upgraded to 1.0.1 hoping it would solve the problem, but it **occured on both 1.0.0 and 1.0.1**. So, to be clear: - Only crashes on Azure App Site (with CGI error) - Only happens when the cert file password is correct Here is the full code: `````` ``` var log = """"; var keyFileServerPath = _env.ContentRootPath + @""\GACert.p12""; log += ""\r\n"" + ""Got File Path""; var cert = new X509Certificate2(); log += ""\r\n"" + ""Created Empty Cert""; var fileExists = System.IO.File.Exists(keyFileServerPath); log += ""\r\n"" + ""File Exists? ="" + fileExists; var fileBytes = System.IO.File.ReadAllBytes(keyFileServerPath); log += ""\r\n"" + ""File Bytes.Length="" + fileBytes.Length; //// WRONG PASSWORD - Causes a normal Exception (so password is OK) //var certificate = new X509Certificate2(fileBytes, ""wrong""); //log += ""\r\n"" + ""Created Cert Using Bytes""; //// FAILED - CGI Error (Crashing the Asp.Net Process) //var certificate = new X509Certificate2(fileBytes, ""notasecret"", X509KeyStorageFlags.Exportable); //log += ""\r\n"" + ""Created Cert Using Bytes""; `````` ``` ``` _Copied from original issue: aspnet/Home#1791_" 28861 area-Infrastructure Microsoft.Windows.Compatibility: Problem loading NetStandard 2.0 Library with net462 AppDomain and Assembly.Load "Project Setup: 1: `netstandard2.0` ClassLibrary used for `netcoreapp2.0` and `net462` 2: `net462` Project, Console App in my case. The netstandard2.0 class uses the `Microsoft.Windows.Compatibility` Package for Image processing `System.Drawing.Image.FromStream`. The net462 App loads the `netstandard2.0` Lib at runtime in a separated AppDomain. This works without problem for `netstandard2.0` but `Microsoft.Windows.Compatibility` returns an exception `System.Drawing is not supported on this platform.`. But normaly it should no problem to use System.Drawing on full framework on windows. If i reference the netstandard2.0 Lib to the net462 Project and call the Method, it works without problems. To Reproduce: 1: `netstandard2.0` Class: `TestClass.cs` ```C# using System; using System.Drawing; using System.IO; using System.Net; namespace StandardLib { public class TestClass { public void DoImageStuff() { using (var webClient = new WebClient()) { var data = webClient.DownloadData(""https://www.google.de/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png""); using (var memoryStream = new MemoryStream(data)) { using (var img = Image.FromStream(memoryStream)) { var x = img.Height; var y = img.Width; Console.WriteLine($""Image: {x}x{y}""); } } } } } } ``` `StandardLib.csproj` ```xml <Project Sdk=""Microsoft.NET.Sdk""> <PropertyGroup> <TargetFramework>netstandard2.0</TargetFramework> <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> <!-- CopyLocalLockFileAssemblies needed to get `System.Drawing.Common.dll` in bin folder as part of the build output, not needed, but needs dotnet deploy and not works with simple VS build --> </PropertyGroup> <ItemGroup> <PackageReference Include=""Microsoft.Windows.Compatibility"" Version=""2.0.0-preview1-25914-04"" /> </ItemGroup> </Project> ``` 2: `net462` Console App ```C# using System; using System.Reflection; using System.Security.Policy; namespace DllLoadingTest { class Program { static void Main(string[] args) { //this works if ProjectReference is added //new TestClass().DoImageStuff(); var appDomainSetup = new AppDomainSetup { ApplicationName = ""NAME"" }; var appDomain = AppDomain.CreateDomain(appDomainSetup.ApplicationName, new Evidence(), appDomainSetup); var wrapper = (AssemblyWrapper)appDomain.CreateInstanceAndUnwrap(typeof(AssemblyWrapper).Assembly.FullName, typeof(AssemblyWrapper).FullName ?? string.Empty); wrapper.LoadAssembly(@""..\..\..\..\StandardLib\bin\Debug\netstandard2.0\StandardLib.dll""); Console.WriteLine(""Loading OK!""); Console.ReadKey(); } public class AssemblyWrapper : MarshalByRefObject { public override object InitializeLifetimeService() { return null; } public void LoadAssembly(string libraryPath) { var assemblyName = AssemblyName.GetAssemblyName(libraryPath); var assembly = Assembly.Load(assemblyName); var type = assembly.GetType(""StandardLib.TestClass""); //just a hack to use dynamic, with reflection or common udes interfaces the problem still exists dynamic instance = Activator.CreateInstance(type); instance.DoImageStuff(); } } } } ``` `DllLoadingTest.csproj` ```xml <Project Sdk=""Microsoft.NET.Sdk""> <PropertyGroup> <TargetFramework>net462</TargetFramework> <OutputType>Exe</OutputType> </PropertyGroup> <ItemGroup> <Reference Include=""System.Configuration.Install"" /> <Reference Include=""System.ServiceProcess"" /> <Reference Include=""System"" /> <Reference Include=""Microsoft.CSharp"" /> </ItemGroup> </Project> ```" 28862 area-System.Security [WIP] *NO MERGE* Mitigate the known case of missing SSL error clean up [EDIT to reflect current content of PR] *NO MERGE* I will be using this PR to run CI but will separate the product changes on their own PR. This PR covers the following: 1. Fixes locations that were leaving errors on the SSL error queue: 1.1. Calls to SslShutdown in [src/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Ssl.cs](https://github.com/dotnet/corefx/pull/28862/files#diff-f0513c093f14a9bf143efbacf9e57c47) 1.2. Calls to X509StoreAddCrl in [src/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Unix/CrlCache.cs](https://github.com/dotnet/corefx/pull/28862/files#diff-b5488457ea972ce8d66f60d2e319d9b9) 1.3. Calls to MultiDestroy and MultiRemoveHandle for CurlHandler were calling SSL_shutdown, cleaned up the SSL error queue after those calls 2. Separate the tests of PlatformHandler and SocketsHttpHandler because there is some indication that the former can leave errors in the SSL error queue, this is also in line with what our customers will be using (either PlatformHandler or SocketsHttpHandler, not both on the same process). There is no actual change to test sources. 3. Add custom build variable to help find other issues in which the SSL error queue is not being cleared. This is to be used locally at this point. Some follow-up still required that are not part of this review yet: * Add a config setting to turn the optimization on/off * Keep investigating the possible workarounds (e.g.: [interpret error](https://github.com/dotnet/corefx/pull/28862/commits/f565614ce0d9f3cb76b99d2d64b5211ce8063585#diff-8e59f86b12ee01ddf687a1e3c5c34dbdR248)) Fixes #25676 28863 area-System.Net Uri - fix IPv6 address format Here are the issues in Uri with IPv6 address we may want to fix: 1. `Uri.IdnHost` should include `[]` around IPv6 address. * Currently it returns `::1234`, it should return `[::1234]`. 2. `Uri.Host` LLA (Link-local address) IPv6 address doesn't contain `%number` part. * Currently it returns `[fe80::e077:c9a3:eeba:b8e9]`, it should return `[fe80::e077:c9a3:eeba:b8e9%18]`. * Note: `Uri.IdnHost` correctly contains the `%number` part. If we choose to fix these problems, we can undo workarounds in #28740, #28578, #28849 and #28971. /cc: @dotnet/ncl 28864 area-Serialization Area-Serialization Sprint 134 The issue is for tracking issues to be done in sprint 134 (due by 4/27/2018) 28868 area-System.Numerics Feature Request: Math.Pow for uint It would often be pretty neat to have an overload of Math.Pow for (int x, uint pow) that returns x^pow. That could be implemented as follows: ``` static int Pow(int x, uint pow) { int ret = 1; while ( pow != 0 ) { if ( (pow & 1) == 1 ) ret *= x; x *= x; pow >>= 1; } return ret; } ``` Credit to [Vilx-](https://stackoverflow.com/users/41360/vilx) for the [original code](https://stackoverflow.com/a/383596/6730162) 28870 area-System.Memory Add a dummy int field in the reference assembly for Span (and other structs containing private fields) > we need to update the reference assembly tool to keep a dummy int field if there are any valuetype fields and not collapse it with the dummy object field if there is one We need to update the logic in buildtools (within IsOrContainsReferenceType) and regenerate the reference assemblies: https://github.com/dotnet/buildtools/blob/master/src/Microsoft.Cci.Extensions/Extensions/CSharp/CSharpCciExtensions.cs#L114 **Update to the ref assembly generation rules:** - If a struct contains any private field, a dummy valuetype field needs to be created. - If a struct contains any reference type field, a dummy object field must also be created. This is required since the [compiler will not catch bugs](https://github.com/dotnet/roslyn/pull/25886/files) in user code going against the definite assignment rules (specifically for structs). For example: https://stackoverflow.com/questions/49653151/spant-does-not-require-local-variable-assignment-is-that-a-feature cc @weshaggard, @joshfree, @jaredpar, @bartonjs, @nguerrera, @agocke, @gafter 28872 area-System.Data Data.Common tests fixed for non english windows Fixes https://github.com/dotnet/corefx/issues/27626 28874 area-Infrastructure Update CoreFx, ProjectNTfs, ProjectNTfsTestILC, Standard to uwp61-26409-01, rel-26406-00, rel-26406-00, preview1-26409-01, respectively (release/uwp6.1) 28875 area-System.Memory Code cleanup and formatting for System.Memory src and test Each set of changes is a separate commit. Related PR on the coreclr side: https://github.com/dotnet/coreclr/pull/17451 cc @dotnet/corefxlab-contrib, @stephentoub, @jkotas 28876 area-System.Runtime Fix the test gap in StringTests for IndexOf, LastIndexOf when string is empty cc @stephentoub, @jkotas, @tarekgh 28877 area-System.Memory Add tests for Span.Overlaps extension method (just like ReadOnlySpan.Overlaps) API added in https://github.com/dotnet/corefx/pull/24980. Improving code coverage (copy/paste and modified the existing tests on ReadOnlySpan). cc @ektrah, @dotnet/corefxlab-contrib 28878 area-System.Diagnostics System.Diagnostics.PerformanceCounter tests fail on Windows 10 https://mc.dot.net/#/user/Anipik/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/c9dded080a169148f306c0310c1a7e14d520f63b/workItem/System.Diagnostics.PerformanceCounter.Tests The assertion fail is same for all the tests ``` Assert.NotEqual() Failure Expected: Not 0 Actual: 0 ``` The tests affected are InstanceDataCollectionCollection_Contains_Valid InstanceDataCollectionCollection_Contains_inValid InstanceDataCollectionCollection_CopyTo InstanceDataCollectionCollection_GetItem_Invalid InstanceDataCollectionCollection_GetKeys InstanceDataCollectionCollection_GetValues InstanceDataCollection_GetItem_ExistingCounter InstanceDataCollection_GetKeys InstanceDataCollection_GetValues InstanceDataCollection_NullTest cc @danmosemsft 28879 area-System.Runtime System.Runtime.Extensions.Performance.Tests failed on spanish Windows 10 (Non English CI) ``` System.FormatException : String '12/31/1999 11:59:59 PM' was not recognized as a valid DateTime. Stack Trace : at System.DateTimeParse.Parse(ReadOnlySpan`1 s, DateTimeFormatInfo dtfi, DateTimeStyles styles) in E:\A\_work\104\s\src\mscorlib\shared\System\Globalization\DateTimeParse.cs:line 2438 at System.Convert.ToDateTime(String value) in E:\A\_work\104\s\src\mscorlib\shared\System\Convert.cs:line 1922 at System.Perf_Convert.ToDateTime_String(String value) in D:\j\workspace\windows-TGrou---6368dffa\src\Sys System.FormatException : String '12/31/1999' was not recognized as a valid DateTime. Stack Trace : at System.DateTimeParse.Parse(ReadOnlySpan`1 s, DateTimeFormatInfo dtfi, DateTimeStyles styles) in E:\A\_work\104\s\src\mscorlib\shared\System\Globalization\DateTimeParse.cs:line 2438 at System.Convert.ToDateTime(String value) in E:\A\_work\104\s\src\mscorlib\shared\System\Convert.cs:line 1922 at System.Perf_Convert.ToDateTime_String(String value) in D:\j\workspace\windows-TGrou---6368dffa\src\System.Runtime.Extension ``` Couple of failures ocur on new spanish windows 10 CI leg cc @danmosemsft 28880 area-System.Memory Fix MemoryManager ctor, add unit and perf tests, and improve performance - Check for manager == null in the constructor - ~Add and use Span.DangerousCreate in the Memory.Span property getter (to remove unnecessary bounds checks).~ - Add unit and performance tests. !~[image](https://user-images.githubusercontent.com/6527137/38406289-26920f14-3929-11e8-865e-4f0ecaf05acf.png)~ Depends on coreclr PR to go through for CI to be green: https://github.com/dotnet/coreclr/pull/17452 cc @dotnet/corefxlab-contrib, @jkotas, @pakrym, @davidfowl, @stephentoub 28882 area-System.Net System.Net.Http.Functional and System.Net.Sockets tests fail on NETFX when running on .NET 4.7.1 There are 12 total failures under this test projects when running this tests on .NET 4.7.1 (installed on machine when running them). Note that this is a combination of Outerloop and Innerloop failures. When running Innerloop tests only System.Net.Http.Functional.Tests fail, with 7 failures (all of them present in the Outerloop run). I will disable this tests to have a clean CI and official builds but they need to be investigated to understand what is wrong. Link to Outerloop run: https://mc.dot.net/#/user/safern/pr~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fdesktop~2Fcli~2F/20180405.1512 cc: @karelz @davidsh @danmosemsft EDIT by @krwq: Repro: ``` git fetch github pull/28883/head:pull_28883 git checkout pull_28883 build -framework:netfx cd src\System.Net.Sockets\tests\FunctionalTests msbuild /t:RebuildAndTest /p:TargetGroup=netfx /p:Outerloop=true ``` Adding `disabled-test` tag since @safern is disabling them in his PR (need to reenable to repro) 28883 area-Infrastructure Update netfx alias to target .NET 4.7.1 This updates the netfx alias to now target .NET 4.7.1 instead of .NET 4.6.1 Note that a lot of projects' package configurations needed to be updated since the package supports net461 and we still want to build them on the vertical and run tests for them. cc: @davidsh for the disabled tests on System.Net.* related to issue: https://github.com/dotnet/corefx/issues/28882 Build All Configurations leg will fail with a related error that it can't find System.ValueTuple (https://github.com/dotnet/corefx/pull/28866), this needs to be fixed on buildtools and I'm working on it), but I wanted to start getting feedback @ericstj @weshaggard could you please take a look? FYI: @AlexGhiondea @joperezr @danmosemsft @stephentoub 28884 area-System.Threading SemaphoreSlim and Wait(0) "Hi, I am very new with C# so I apologise in advance if this is dumb. I read a lot of docs and conversation threads and it is pretty clear that the ""wait(0)"" is supposed to return immediately with either true or false. Problem is that when I make basic test, I can see that the ""wait"" calls can take a lot of time (multiple seconds) to return. Might just be the way I run the multiple threads test, but still, if someone could confirm the behavior? In theory in the following test the time difference between ""Enter"" log and ""Wait"" log should be very small, but as explained when I run it (with a lot of threads) I get large difference, like 10 seconds. ``` static SemaphoreSlim s = new SemaphoreSlim(1, 1); static void Test(object x) { Console.Write(""Enter"" + x + "" "" + System.DateTime.Now + ""\n""); bool b = s.Wait(0); Console.Write(""Wait"" + x + "" "" + System.DateTime.Now + ""\n""); if (b) { try { Console.Write(b + "" "" + x + ""\n""); for (long i = 1; i <= 5000000000; i++) { // } } finally { Console.Write(""Exit"" + x + "" "" + System.DateTime.Now + ""\n""); s.Release(); } } else { Console.Write(b + "" "" + x + ""\n""); Console.Write(""Exit False "" + x + "" "" + System.DateTime.Now + ""\n""); } } ``` Thank you for your time. " 28885 area-Infrastructure Improve CMake detection on Windows when not in PATH Equivalent to https://github.com/dotnet/coreclr/pull/16328 In CMake v10.2, the key `hklm:\SOFTWARE\Kitware` returns: ```powershell Hive: HKEY_LOCAL_MACHINE\SOFTWARE\Kitware Name Property ---- -------- CMake InstallDir : C:\Program Files\CMake\ ``` with no space after `CMake` and property name `InstallDir`, instead of `'(default)'`. Fix #28799 28886 area-Infrastructure System.Drawing.Common 4.5.0 isn't added to references in a Xamarin.Android project while adding the package from nuget.org "I tried to add one package to a Xamarin.Android application. This package has System.Drawing.Common 4.5.0 in its dependencies. After that, the project compilation is stopped with an error: ``` Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'System.Drawing.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. Perhaps it doesn't exist in the Mono for Android profile? error : File name: 'System.Drawing.Common.dll' ``` The packages.config file contains the correct record: ``` <package id=""System.Drawing.Common"" version=""4.5.0-preview1-26216-02"" targetFramework=""monoandroid81"" /> ``` But **System.Drawing.Common** is absent in the reference list. It seems that **Visual Studio** tries to get **System.Drawing.Common.dll** for **Xamarin.Android** runtime, because the package contains the **MonoAndroid10** folder. It can't do this, because this folder doesn't contain any DLL-files, but the stub file with the '\_.\_' name.  If I find System.Drawing.Common.dll for **.NET Standard 2.0** and manually add it to references, the project operates correctly. **Steps to reproduce:** - Run Visual Studio Professional 2017 Version 15.6.5 - Create new Android -> Blank App (Android) - Add System.Drawing.Common 4.5.0 via Manage Nuget Packages... **Current result:** System.Drawing.Common.dll isn't in references. **Expected result:** System.Drawing.Common.dll is in references. **Additional information:** Microsoft Visual Studio Professional 2017 Version 15.6.5 VisualStudio.15.Release/15.6.5+27428.2027 Microsoft .NET Framework Version 4.7.02556 Installed Version: Professional NuGet Package Manager 4.6.0 NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/. VisualStudio.Mac 1.0 Mac Extension for Visual Studio Xamarin 4.9.0.753 (f0f46392f) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android. Xamarin Designer 4.10.96 (a702a9ceb) Visual Studio extension to enable Xamarin Designer tools in Visual Studio. Xamarin.Android SDK 8.2.0.16 (HEAD/a78295902) Xamarin.Android Reference Assemblies and MSBuild support. Xamarin.iOS and Xamarin.Mac SDK 11.9.1.24 (f62de47) Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support." 28889 area-System.Net Stop nulling out fields in SafeDeleteSslContext dispose Nulling out these fields in SafeDeleteSslContext.Dispose causes occasional difficult to reproduce exceptions in CI: ``` Unhandled Exception: System.ArgumentNullException: Value cannot be null. at System.Threading.Monitor.ReliableEnter(Object obj, Boolean& lockTaken) at System.Net.SafeDeleteSslContext.WriteToConnection(Void* connection, Byte* data, Void** dataLength) at Interop.AppleCrypto.SslHandshake(SafeSslHandle sslHandle) at System.Net.Security.SslStreamPal.PerformHandshake(SafeSslHandle sslHandle) at System.Net.Security.SslStreamPal.HandshakeInternal(SafeFreeCredentials credential, SafeDeleteContext& context, SecurityBuffer inputBuffer, SecurityBuffer outputBuffer, Boolean isServer, Boolean remoteCertRequired, String targetName) ``` The fix is to stop nulling out these fields in the dispose method, and to allow the garbage collector to take care of them instead. Fixes: #28759 28890 area-System.Runtime Environment.ExpandEnvironmentVariables on Linux has Windows behavior "`Environment.ExpandEnvironmentVariables()` on Linux expands variables in `%VAR_NAME%` format rather than `$VAR_NAME`. SDK version: 2.1.4 OS: Ubuntu 16.04 A simple test: Environment.ExpandEnvironmentVariables(""$HOME/test""); Expected value: `/home/{user}/test` Actual value: `$HOME/test` However running: Environment.ExpandEnvironmentVariables(""%HOME%/test""); gives expanded result `/home/{user}/test`." 28891 area-System.Collections Adding test for Remove when entries do not exist. Should not throw. Fixes #28763 cc: @danmosemsft @benaadams 28892 area-System.Net Port/improve Mono's managed Dns implementation? @migueldeicaza highlighted to me today that Mono has a managed DNS implementation: https://github.com/mono/mono/tree/0bcbe39b148bb498742fc68416f8293ccd350fb6/mcs/class/System/Mono.Net.Dns We should look into whether it would make sense to port and improve upon that, so as to be able to avoid depending on the DNS resolution capabilities built into specific OSes (e.g. we rely on Windows for its overlapped I/O support, but an equivalent doesn't exist built-in on Linux, and so there our async support is based on queueing work items that in turn invoke the synchronous APIs). cc: @migueldeicaza, @geoffkizer 28896 area-System.Memory Add {ReadOnly}Memory.Span tests when memory contains invalid values Related to https://github.com/dotnet/coreclr/pull/17452#discussion_r179748571 cc: @ahsonkhan, @jkotas 28897 area-System.Text Native UTF16 in regex The note under https://en.wikipedia.org/wiki/Comparison_of_regular_expression_engines#API_features says:  Any chance to extend regex support from UCS2's 64K to UTF16's 1,112,064 chars in .NET Core? 28898 area-System.Net HttpClient.GetAsync/PostAsync sets different error code on SocketException on Windows 7 when host could not be resolved "On all platforms except Windows 7 when host name could not be resolved we get `HttpRequestException` with inner `SocketException` with `SocketException.SocketErrorCode` set to `SocketError.HostNotFound` while on Windows 7 we get `SocketErrorCode.NoData`. This is problematic in Wcf scenarios where they wrap our exception and would like to throw `System.ServiceModel.EndpointNotFoundException` but the inconsistency makes it more difficult. Simple repro is (PostAsync has identical result): ```csharp var r = (new HttpClient()).GetAsync(""http://nonexistenthostname/foo/bar"").Result; ``` <details> <summary>Here is the exact exception being thrown on Windows7</summary> ``` System.AggregateException : One or more errors occurred. (The requested name is valid, but no data of the requested type was found) ---- System.Net.Http.HttpRequestException : The requested name is valid, but no data of the requested type was found -------- System.Net.Sockets.SocketException : The requested name is valid, but no data of the requested type was found Stack Trace: E:\A\_work\104\s\src\mscorlib\src\System\Threading\Tasks\future.cs(493,0): at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification) C:\Users\dotnet-bot\Desktop\src\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.cs(3180,0): at System.Net.Http.Functional.Tests.HttpClientHandlerTest.HttpClientNonExistingHostnameTest() ----- Inner Stack Trace ----- C:\Users\dotnet-bot\Desktop\src\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\ConnectHelper.cs(86,0): at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) E:\A\_work\104\s\src\mscorlib\shared\System\Threading\Tasks\ValueTask.cs(723,0): at System.Threading.Tasks.ValueTask`1.get_Result() C:\Users\dotnet-bot\Desktop\src\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnectionPool.cs(338,0): at System.Net.Http.HttpConnectionPool.CreateConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) E:\A\_work\104\s\src\mscorlib\shared\System\Threading\Tasks\ValueTask.cs(723,0): at System.Threading.Tasks.ValueTask`1.get_Result() C:\Users\dotnet-bot\Desktop\src\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnectionPool.cs(480,0): at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync(ValueTask`1 creationTask) E:\A\_work\104\s\src\mscorlib\shared\System\Threading\Tasks\ValueTask.cs(723,0): at System.Threading.Tasks.ValueTask`1.get_Result() C:\Users\dotnet-bot\Desktop\src\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnectionPool.cs(271,0): at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken) C:\Users\dotnet-bot\Desktop\src\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\RedirectHandler.cs(30,0): at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) C:\Users\dotnet-bot\Desktop\src\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs(479,0): at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) ----- Inner Stack Trace ----- C:\Users\dotnet-bot\Desktop\src\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\ConnectHelper.cs(67,0): at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) ``` </details> cc: @mconnew @stephentoub @davidsh @karelz" 28899 area-Infrastructure System.Buffers: XML doc in NuGet package (version 4.4.0 and later) differs from source code XML doc **TL;DR:** Something appears to be wrong with the XML documentation included in the `System.Buffers` NuGet package, versions 4.4.0 and later. (4.4.0-preview2-25405-01 and earlier appear to have been fine*.) It doesn't match the XML documentation in the source code files. ---- I was reading the documentation for parameter `clearArray` of the method `ArrayPool<T>.Return(T[] array, bool clearArray)`. It goes as follows (formatting and emphasis by me): > Indicates whether the contents of the buffer should be cleared before reuse. **If bufferLength is set to true** [...]. **If bufferLength is set to false** [...]. The reference to `bufferLength` doesn't make any sense. There's nothing public called `bufferLength` in this class. Here's a screenshot of the documentation showing the same text:  Note that I'm using the latest package version, `4.5.0-preview1-26216-02`. The file `C:\Users\stakx\.nuget\packages\system.buffers\4.5.0-preview1-26216-02\version.txt` contains the hash `00490982c7952e96a1089818467caa6fd07541b2`, which I assume is a SHA-1 commit hash in this project's Git repository. Looking at that commit's version of `ArrayPool.cs`, this is what the documentation should read: https://github.com/dotnet/corefx/blob/00490982c7952e96a1089818467caa6fd07541b2/src/System.Buffers/src/System/Buffers/ArrayPool.cs#L103-L108 No mention of `bufferLength` here, and this is the XML documentation you get with `System.Buffers` before version 4.4.0. Looking at the version history of that file, there was never any `bufferLength` bit here as far as I can tell. So what went wrong with the XML documentation starting with package version 4.4.0? Where does the `bufferLength` bit come from? ---- **(*)** XML docs in package versions before 4.4.0 were fine only in the sense that the documentation matched with that from the source code... but there were other, probably unrelated problems: The XML documentation file was either named incorrectly (just `.xml`) or missing (not in the `lib\` directory, but in the `ref\` directory), so one wouldn't get any documentation in VS IntelliSense. 28902 area-Infrastructure Disable Tizen CI runs Still allows them to be run when explicitly requested, but they will no longer be run per-pr or on push related: https://github.com/dotnet/corefx/issues/28901 28905 area-System.Console Clean up GetConsoleTitle The Windows interop code for GetConsoleTitle was way more convoluted than it needed to be. It also isn't accurate and overallocates. I've removed things that date back to 9x and allowed for a case that showed up in RS2. 28906 area-Infrastructure Update the System.Runtime and System.Memory ref based on new buildtools Fixes https://github.com/dotnet/corefx/issues/28870 Based on changes in https://github.com/dotnet/buildtools/pull/2003. cc @weshaggard, @nguerrera, @joshfree, @bartonjs, @agocke, @jaredpar, @gafter, @terrajobst, @jcouv, @MadsTorgersen 28907 area-System.ComponentModel Clean code for System.ComponentModel* #17905 28909 area-System.Security "How to use ""RSA/ECB/PKCS1Padding"" and ""RSA/ECB/OAEPPadding""" I need to use these two algorithms but I don't know how to use the .net core help me!!! 28911 area-System.Memory Hover Text for Span<T>/Memory<T> in Visual Studio ignores 'Hexadecimal Display' setting. Not sure if this is a Visual Studio bug (if so, not sure where to submit that) - but, this issue seems to be happening with at least `System.Memory.Span<T>` and `System.Memory.Memory<T>` from what I can tell. (Might have to do with #27338 / #16450 ?) When hovering over one of these objects in Visual Studio the hover text ignores the User's Setting of 'Hexadecimal Display' and always displays the size of the array segment in decimal format. The attached photo has Visual Studio in 'Hexadecimal Display' with a normal `byte[]` ({byte[0x00010000]}) alongside a `Memory<byte>`'s hovertext ({Byte[1535]}). I feel it's fairly common to work in this Hex mode when dealing with memory, and this not working the same could lead to issues, or overlooking bugs (which happened to me a couple times before I caught on). System.Memory Nuget Version: 4.5.0-preview1-26216-02 Visual Studio: 15.6.5  28912 area-System.Diagnostics What API should I use to consume ETW? What API souuld I use to consume ETW: 1. System.Diagnostics.Tracing.EventSource (BCL) 2. Microsoft.Diagnostics.Tracing.EventSource (NuGet) 3. Microsoft.Diagnostics.Tracing.TraceEvent (NuGet) 4. krabsetw (NuGet) ? And where Microsoft.Diagnostics.Tracing.Logging fits in? I read this at https://blogs.technet.microsoft.com/office365security/hidden-treasure-intrusion-detection-with-etw-part-2/: > TraceEvent is a library used by the PerfView tool and has the benefits of being a well-designed .NET API. Unfortunately, it doesn’t perform well for scenarios where we want to keep memory usage to a minimum. System.Diagnostics.Tracing has the advantage of being part of the .NET BCL but we’ve observed intermittent exceptions and unexpected behavior in the past. Additionally, it suffers from the same memory consumption issue that TraceEvent does. > In response to these challenges, Office 365 Security chose to implement our own API with three primary goals: > •Intuitive and flexible API > •High performance – filtering events in the native layer > •Available both in .NET and native C++ > The result of this work is krabsetw, a library we’ve open-sourced under the MIT license. It contains both a native C++ API as well as a .NET API. This library is used in production today across Office 365 workloads on more than 100,000 machines. With filtering, we’re able to process more than more than 500 billion events per day, generating more than 7TB of data per day across the machines. > Is this still true?.. It is written one year ago (May 9, 2017), and other API's have updates since. I want to know what API I can depend on, if not now, at least in upcoming updates. Another question: Do I have to use these NuGets too? Microsoft.Diagnostics.Tracing.TraceEvent.SupportFiles Microsoft.Diagnostics.Tracing.EventRegister 28915 area-System.Text Support for enumerating non-default code pages added with RegisterProvider (System.Text.Encoding) The [documentation for `System.Text.Encoding.GetEncodings()`](https://docs.microsoft.com/en-us/dotnet/api/system.text.encoding.getencodings?view=netframework-4.7.1#System_Text_Encoding_GetEncodings) tells us (emphasis added): > The list of supported encodings returned by the GetEncodings method **does not include any > additional encodings made available by any EncodingProvider implementations that** were registered by calls to the RegisterProvider method. Is there no way to enumerate these additional encodings? Unfortunately, [`System.Text.CodePagesEncodingProvider.Instance`](https://docs.microsoft.com/en-us/dotnet/api/system.text.codepagesencodingprovider.instance?view=netcore-2.0#System_Text_CodePagesEncodingProvider_Instance) lacks a method for enumerating them. 28916 area-System.Memory Fix typo 'segement' to 'segment' 28919 area-Infrastructure Enable native build with Clang 6.0 "Three kinds of warnings were reported as errors with Clang 6.0: ``` [ 35%] Building C object System.Native/CMakeFiles/System.Native-Static.dir/pal_networking.c.o /corefx/src/Native/Unix/System.Native/pal_networking.c:2048:19: error: implicit conversion changes signedness: 'enum SocketEvents' to 'int32_t' (aka 'int') [-Werror,-Wsign-conversion] sae->Events = GetSocketEvents(events); ~ ^~~~~~~~~~~~~~~~~~~~~~~ ``` ``` [ 37%] Building CXX object System.Native/CMakeFiles/System.Native.dir/pal_process.cpp.o /corefx/src/Native/Unix/System.Native/pal_process.cpp:370:38: error: result of comparison 'uint64_t' (aka 'unsigned long') > 18446744073709551615 is always false [-Werror,-Wtautological-type-limit-compare] if (value == UINT64_MAX || value > std::numeric_limits<rlim_t>::max()) ~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` ``` [ 68%] Building CXX object System.Net.Http.Native/CMakeFiles/System.Net.Http.Native-Static.dir/pal_easy.cpp.o /corefx/src/Native/Unix/System.Net.Http.Native/pal_easy.cpp:11:38: error: comparison of two values with different enumeration types ('PAL_CURLoption' and 'CURLoption') [-Werror,-Wenum-compare] static_assert(PAL_CURLOPT_INFILESIZE == CURLOPT_INFILESIZE, """"); ~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~ (and lots of these) ``` With this fix, CoreFX builds with Clang 6.0. Tested on Ubuntu 18.04." 28920 area-System.Memory Use of Unsafe.As in ReadOnlySequence can result in breaking type safety In multiple places, the ReadOnlySequence struct checks a flag set in one field and then uses that to determine how to cast an object in another field, using Unsafe.As, e.g. https://github.com/dotnet/corefx/blob/da1322d90a1412290a82a5ace157da4cc58dabf4/src/System.Memory/src/System/Buffers/ReadOnlySequence_helpers.cs#L39-L42 If the ReadOnlySequence suffers a torn read/write, we could end up with the type information from one instance conflated with the object from another, such that we'd then use Unsafe.As to perform the wrong cast, and violate type safety. cc: @jkotas, @davidfowl, @pakrym, @ahsonkhan, @GrabYourPitchforks 28921 area-Serialization "Test System.Data.Tests.SqlTypes.SqlInt64Test.ReadWriteXmlTest failed with ""System.NullReferenceException : Object reference not set to an instance of an object.""" Test System.Data.Tests.SqlTypes.SqlInt64Test.ReadWriteXmlTest has failed. MESSAGE: System.NullReferenceException : Object reference not set to an instance of an object. ~~~ STACK TRACE: at System.Collections.Generic.Dictionary`2.FindEntry(TKey key) in /root/coreclr/src/mscorlib/shared/System/Collections/Generic/Dictionary.cs:line 410 at System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value) in /root/coreclr/src/mscorlib/shared/System/Collections/Generic/Dictionary.cs:line 873 at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace) in /mnt/resource/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_centos7.1_release/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializer.cs:line 267 at System.Data.Tests.SqlTypes.SqlInt64Test.ReadWriteXmlTestInternal(String xml, Int64 testval, String unit_test_id) in /mnt/resource/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_centos7.1_release/src/System.Data.Common/tests/System/Data/SqlTypes/SqlInt64Test.cs:line 724 at System.Data.Tests.SqlTypes.SqlInt64Test.ReadWriteXmlTest() in /mnt/resource/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_centos7.1_release/src/System.Data.Common/tests/System/Data/SqlTypes/SqlInt64Test.cs:line 750 ~~~ Details: https://ci.dot.net/job/dotnet_corefx/job/master/job/outerloop_netcoreapp_centos7.1_release/364/testReport/System.Data.Tests.SqlTypes/SqlInt64Test/ReadWriteXmlTest/ 28922 area-System.Data "Test System.Data.Tests.DataSetTest/SqlTypes failed with ""Exit code was 32899 but it should have been 42\nExpected: True\nActual: False""" Tests failure: System.Data.Tests.DataSetTest2.DataSetSpecificCulture (from (empty)) System.Data.Tests.AppDomainsAndFormatInfo.Bug82109 System.Data.Tests.DataSetTest.WriteXmlSchema (from (empty)) System.Data.Tests.DataSetTest.WriteXmlModeSchema1 System.Data.Tests.SqlTypes.SqlStringTest.Properties System.Data.Tests.DataSetReadXmlSchemaTest.LocaleOnRootWithoutIsDataSet System.Data.Tests.DataTableTest.PropertyExceptions (from (empty)) MESSAGE: Exit code was 32899 but it should have been 42\nExpected: True\nActual: False ~~~ STACK TRACE: at System.Diagnostics.RemoteExecutorTestBase.RemoteInvokeHandle.Dispose(Boolean disposing) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_debug/src/CoreFx.Private.TestUtilities/src/System/Diagnostics/RemoteExecutorTestBase.cs:line 254 at System.Diagnostics.RemoteExecutorTestBase.RemoteInvokeHandle.Dispose() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_debug/src/CoreFx.Private.TestUtilities/src/System/Diagnostics/RemoteExecutorTestBase.cs:line 228 at System.Data.Tests.DataSetTest.WriteXmlModeSchema1() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx10.12_debug/src/System.Data.Common/tests/System/Data/DataSetTest.cs:line 1568 ~~~ Details: https://ci.dot.net/job/dotnet_corefx/job/master/job/osx10.12_debug/471/testReport/ 28924 area-Infrastructure Installation guidance for Ubuntu 18.04 Ubuntu 18 is listed as supported, but there doesn't seem to be any apt feed or deb package download link for it. I've tried taking the 17.10 links/feeds and replacing version numbers / os codenames, but they all 404. Please provide download links/install instructions for Ubuntu 18. 28925 area-System.Net update of nuget packages like System.Net.WebSockets.Client Hi, I din't found any documentation what is your policy of updating these kind of nuget packages. @stephentoub has added some days ago the import feature of RemoteCertificateValidationCallback as connect option and I like to understand when I can expect a new nuget packege. bye Konrad 28927 area-System.Memory Created performance tests for ReadOnlySequence I created performance tests for ReadOnlySequence next methods: Enumerator, First, GetPosition, Slice, TryGet. 28928 area-System.Memory Aggressive Inline fast-path of BuffersExtensions split methods Methods are split into a fast-path inline part and a slower non-inline part. Aggressively inline the fast-path. from https://github.com/aspnet/SignalR/pull/1907#issuecomment-379589824 /cc @ahsonkhan @pakrym @davidfowl @JamesNK 28929 area-System.Threading Unbound channel + calling complete with zero items written = poor performance SignalR is using an unbound channel in a benchmark and we have noticed odd performance. Writing one item and then calling complete is significantly faster than writing zero items and calling complete. ``` Method | Mean | Error | StdDev | Op/s | Gen 0 | Gen 1 | Allocated | ---------------------------------- |-----------:|----------:|----------:|----------:|--------:|-------:|----------:| StreamChannelReaderCount_Zero | 69.397 us | 2.8020 us | 2.7519 us | 14,409.9 | 0.1221 | - | 4135 B | StreamChannelReaderCount_One | 8.040 us | 0.4524 us | 0.4443 us | 124,384.6 | 0.0153 | - | 4012 B | ``` Code: https://github.com/aspnet/SignalR/blob/bd78785f8d36be6e650ac60813b8d9c1ca9983d3/benchmarks/Microsoft.AspNetCore.SignalR.Microbenchmarks/DefaultHubDispatcherBenchmark.cs#L144-L158 ``` DefaultHubDispatcherBenchmark benchmark = new DefaultHubDispatcherBenchmark(); benchmark.GlobalSetup(); for (int i = 0; i < 100000; i++) { benchmark.StreamChannelReaderCount_Zero().GetAwaiter().GetResult(); } ``` Additional investigation: https://github.com/aspnet/SignalR/issues/1811#issuecomment-379601460 28930 area-System.Runtime Implicit conversion between KeyValuePair and Tuple "Please add implicit conversion from Tuple to KeyValuePair Should be able to ```C# KeyValuePair<string,int> kvp = ("""",0); ``` I'm also not sure that `Deconstruct` also work on `Linq.Cast<(key,value)>()` or not, if not I think implicit conversion from KeyValuePair to Tuple also needed" 28931 area-System.Net Fix regression on OpenSsl exception message Managed code relies on SSL error queue to give proper error information. PAL layer was clearing up the error queue and the exception messages were not precise. This changes returns to the state before in which the managed side was in charge of cleaning up the queue (basically we care only about the last error). Perhaps in the future we should look in changing the PAL signature and doing all at once in the same place, but, as it is the fix gets us to where we were before. Removing the error queue clean up is not a concern in light of the investigation of #25676 and as it is the managed will clean up the queue whenever necessary. Fixes #28365 (Separating this PR from the one for #25676 since that one can take more time, but it will have the same fix and I've been testing it on the PR already). 28932 area-System.Linq `Linq.Enumerable.Any` should return false on null For `Any` function on collection, we should treat null collection as empty And I think `predicate` should be `null` as default parameter It could be another similar name for compatibility catch but please contain it within corefx ```C# public static bool IsAny<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate = null) { if (source == null) { return false; } if (predicate == null) { using (IEnumerator<TSource> e = source.GetEnumerator()) { return e.MoveNext(); } } foreach (TSource element in source) { if (predicate(element)) { return true; } } return false; } ``` 28933 area-System.Globalization Add GetISOWeekOfYear() ## Rationale .Net don't implement [ISO 8601 standard](https://en.wikipedia.org/wiki/ISO_week_date#Relation_with_the_Gregorian_calendar) - it have alternative scheme in: ```c# System.Globalization.Calendar.GetWeekOfYear(DateTime time, CalendarWeekRule rule, DayOfWeek firstDayOfWeek); ``` Unix `date` utility implements ISO 8601: ``` date +%V ``` In [PowerShell repo ](https://github.com/PowerShell/PowerShell/pull/6542) we use workaround described [here](https://blogs.msdn.microsoft.com/shawnste/2006/01/24/iso-8601-week-of-year-format-in-microsoft-net/) (see Keno's comment) for: ```powershell Get-Date -UFormat %V ``` .Net should have parity and native implementation. ISO 8601 is culture-independent so we can use static methods. If we are going in the direction I believe it make sense consider all ISO8601 objects and compatibility with Unix `date` utility. https://en.wikipedia.org/wiki/ISO_week_date#Relation_with_the_Gregorian_calendar - first week - last week - weeks per year http://man7.org/linux/man-pages/man1/date.1.html - `%g` last two digits of year of ISO week number (see %G) - `%G` year of ISO week number (see %V); normally useful only with %V - `%V` ISO week number, with Monday as first day of week (01..53) ### Proposed API ```c# namespace System.Globalization { public abstract class Calendar : ICloneable { public static class ISO { // All ISO 8601 objects (https://en.wikipedia.org/wiki/ISO_week_date#Relation_with_the_Gregorian_calendar) public static int GetWeekOfYear(DateTime time); public static int GetFirstWeekOfYear(DateTime time); public static int GetLastWeekOfYear(DateTime time); public static int GetWeeksPerYear(DateTime time); // Compatibility with Unix date utility (http://man7.org/linux/man-pages/man1/date.1.html) // %G year of ISO week number (see %V); normally useful only with %V public static int GetYearOfWeek(DateTime time); } } ``` Please note that the proposed API is a static and not instance member. The reason is ISO week is culture and calendar independent. ### Alternative Design ```C# namespace System.Globalization { public abstract class Calendar : ICloneable { // All ISO 8601 objects (https://en.wikipedia.org/wiki/ISO_week_date#Relation_with_the_Gregorian_calendar) public static int GetISOWeekOfYear(DateTime time); public static int GetISOFirstWeekOfYear(DateTime time); public static int GetISOLastWeekOfYear(DateTime time); public static int GetISOWeeksPerYear(DateTime time); // Compatibility with Unix date utility (http://man7.org/linux/man-pages/man1/date.1.html) // %G year of ISO week number (see %V); normally useful only with %V public static int GetISOYearOfISOWeek(DateTime time); } } ``` 28934 area-System.Net Some problems in ping API Related https://github.com/dotnet/corefx/issues/9350 In PowerShell repo we port [TestConnection cmdlet](https://github.com/PowerShell/PowerShell/blob/master/src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs) and catch some problems in the ping API. The problems documented in the [cmdlet tests](https://github.com/PowerShell/PowerShell/blob/master/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Connection.Tests.ps1) - see comments and `if (!isWindows)` blocks. Below short list: 1. Dontfragment doesn't work on Unixes This definitely should work on Linux and on [MacOs too](http://www.hackaapl.com/mazimum-transmission-unit-mtu-frame-size-in-os-x/) 2. `PingReply.Buffer` is empty on Unix. Expected - a buffer we send. 3. Ping unreachable host returns ErrorCode 6 (Handle is invalid) on Unix. Expected (as on Windows) - 11001 (Host not found). 4. API always returns Options based on default PingOptions() constructor (Ttl=128, DontFragment = false). PingReply.Options.DontFragment: - on Windows always returns false. Expected - real value from ping request. - on Unix always returns null. Expected - real value from ping request (or false if not implemented). PingReply.Options.Ttl - always 128. Expected - real value from ping request. PingReply.Options.Status - always Success (if we expect 'TtlExpired'). Expected - real status. 5. PingReply doesn't return ScopeId in IPAddress 28935 area-System.Runtime Add Time value type in System # Rationale Today, we have a `DateTime` struct in System that represents a specific date and time, which supports time zones. We also have a `TimeSpan` object that represents a duration (for example the time between two `DateTime`). I feel that we are missing a simple `Time` object that represents a time of day, without it being linked to a particular day. There are a lot of reasons for representing time without dates. Alarms of an alarm clock, work shifts in a company, etc. T-Sql has a [time](https://docs.microsoft.com/en-us/sql/t-sql/data-types/time-transact-sql) type that cannot today be mapped to a type in .Net. `DateTime.TimeOfDay` today returns a `TimeSpan`, but it feels out of place, `TimeSpan` represents a duration and not a specific time of day. ## Implementation Implementation would be pretty simple, it would have properties Hours, Minutes, Seconds, Milliseconds, Ticks and a few comparison / transformation methods. `DateTime.TimeOfDay` would return this new `Time` struct instead of the current `TimeSpan`. 28936 area-Infrastructure Add WebAssembly build architecture Adds a WebAssembly build architecture (and matching OS) based on using the Emscripten SDK. For the most part, this flavor is similar to Unix (but can be built by any OS). While the current changes are focused on the CoreRT WebAssembly implementation, they will most likely be useful for Mono as well. This change includes: * Adding the ```wasm``` architecture and ```WebAssembly``` OS * Changes to run emscripten for wasm on Windows (building on Mac/Linux can be done in a future change). This also includes compensating for emscripten's tendency to return true for check_function_exists for functions it doesn't actually have. * Fixes for building System.Native (other native libraries are disabled for now as they have larger dependencies that may not map as well) The managed build doesn't work yet as contracts need to target the .NET Native System.Private.Corelib, but breaking changes in the Memory class prevent them from compiling. Fixes #26107 28941 area-System.Net HttpWebResponse.LastModified no longer throws "Discovered during the work for #28843 (System.Net.Request) [`HttpWebResponse.LastModified`](https://github.com/dotnet/corefx/blob/master/src/System.Net.Requests/src/System/Net/HttpWebResponse.cs#L143-L157) no longer throws `ProtocolViolationException`: ```csharp public DateTime LastModified { get { CheckDisposed(); string lastmodHeaderValue = Headers[""Last-Modified""]; if (string.IsNullOrEmpty(lastmodHeaderValue)) { return DateTime.Now; } DateTime dtOut; HttpDateParse.ParseHttpDate(lastmodHeaderValue, out dtOut); return dtOut; } } ``` It looks like this occurred during the port, as [the file containing the original code was split](https://referencesource.microsoft.com/#System/net/System/Net/Internal.cs,1975), and the code throwing the exception didn't make it. Contrast this with `HttpWebRequest.IfModifiedSince`/`Date`, [where the exception did make it through](https://github.com/dotnet/corefx/commit/9090df761a1a067c869e43066ba32fd39a26f516#diff-c70c98d319d6fa28c754b26a04324f2eR1444) cc @davidsh " 28942 area-System.Threading Add tests for ValueTask type safety cc: @tarekgh, @kouvel Fixes https://github.com/dotnet/coreclr/issues/17470 Depends on https://github.com/dotnet/coreclr/pull/17471 (likely to fail until that's consumed) 28943 area-System.Net Add more logging to SocketsHttpHandler As part of looking at the usability of .NET Core network logging (compared to .NET Framework), I did a walkthru of the current logging in SocketsHttpHandler. I noticed some inconsistencies in how the NetEventSource logging is being used. For the 2.1 release, I wanted to at least add more logging to some key areas including places where we ignore errors/exceptions. There is still more work to do to improve the logging to make it useful for developers. This includes doing a better job at logging for System.Net.Sockets as well as looking into other tool options besides PerfView to look at the traces. I also fixed the sample script for using starting the traces using Windows logman. The default log buffer size is too small even for for simple traces. Now, using PerfView on all the System.Net.* traces no longer shows an error about traces being dropped. 28944 area-System.Text Add a GetEncodings method to System.Text.EncodingProvider to support enumerating available character encodings This API proposal arose out of #28915. ## Rationale and Use Cases As of this writing: * [`System.Text.Encoding.GetEncodings()`](https://docs.microsoft.com/en-us/dotnet/api/system.text.encoding.getencodings?view=netcore-2.1#System_Text_Encoding_GetEncodings) only ever enumerates the _default_ encodings available. * [`System.Text.CodePagesEncodingProvider.Instance`](https://docs.microsoft.com/en-us/dotnet/api/system.text.codepagesencodingprovider.instance?view=netcore-2.1#System_Text_CodePagesEncodingProvider_Instance) lacks a method for enumerating _additional_ encodings registered via [`System.Text.Encoding.RegisterProvider(EncodingProvider)`](https://docs.microsoft.com/en-us/dotnet/api/system.text.encoding.registerprovider?view=netcore-2.1), which - via a call to `System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance)` - makes the [Windows code-page character encodings](https://msdn.microsoft.com/en-us/library/dd317756(v=vs.85).aspx) available to .NET Core. However, **it is desirable to have the ability to enumerate _all_ available encodings**: * Even in the abstract it seems like an awkward omission not to be able to reflect on the available encodings; more concretely, consider the following use cases, both related to [PowerShell Core](https://github.com/PowerShell/PowerShell): * PowerShell Core commands such as `Get-Content` for reading text files support an `-Encoding` parameter that directly accepts `System.Text.Encoding` instances, so users expect to be able to _discover_ all available encodings and/or be assisted in selecting a specific encoding with _tab completion_: ```powershell Get-Content file.txt -Encoding <tab-keypress> # should show all available encodings ``` * Similarly, a [green-lighted, but not yet implemented](https://github.com/PowerShell/PowerShell/issues/6201) `Convert-TextFile` command will allow conversion between all available character encodings, so their discovery / ease of selection is important there too. ## Proposed API Add a `GetEncodings()` method to abstract class [`System.Text.EncodingProvider`](https://github.com/dotnet/corefx/blob/103639b6ff5aa6ab6097f70732530e411817f09b/src/Common/src/CoreLib/System/Text/EncodingProvider.cs): ```csharp namespace System.Text { public abstract class EncodingProvider { // ... // New virtual method, analogous to System.Text.Encoding.GetEncodings() public virtual System.Text.EncodingInfo[] GetEncodings (); // ... ``` And [`System.Text.CodePagesEncodingProvider`](https://github.com/dotnet/corefx/blob/master/src/System.Text.Encoding.CodePages/src/System/Text/CodePagesEncodingProvider.Default.cs) would then implement that method to return the encodings it provides. Specifically, a call to `System.Text.CodePagesEncodingProvider.Instance.GetEncodings()` would then return the array of `System.Text.EncodingInfo` instances representing that provider's encodings. As with `System.Text.Encodings.GetEncodings()`, no particular enumeration order is guaranteed. --- ### Integration into `System.Text.Encodings.GetEncodings()` Once `System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance)` has been called, `System.Text.Encodings.GetEncodings()` will enumerate the additional encodings too, using the newly introduced method on the provider _if_ registered. In other words: `System.Text.Encodings.GetEncodings()` will return whatever encodings are _currently available_ - whether just the default set by default or the _union_ of the default set and the additional encodings after provider registration. As with the existing enumeration, the encodings (`EncodingInfo` instances) are returned in no guaranteed order. If there is more than one registered provider that supports a given encoding, the returned list will contain only one entry for it. ## Updates (most recent ones first) * Clarification re returning only distinct encodings. * Return behavior clarified again - no particular enumeration order is guaranteed * Made new `GetEncodings` method `virtual` rather than `abstract`. * Open question removed in favor of unconditionally outputting all then-available encodings. * Return behavior clarified (ordering). 28945 area-System.Runtime Stable test for both type of dateStyles. (dd\MM\yyyy and MM\dd\yyyy) Fixes https://github.com/dotnet/corefx/issues/28879 28947 area-System.Net Fix ROM Content Test to use IMemoryOwner instead of MemoryManager Leftover test cleanup from https://github.com/dotnet/corefx/pull/28640 cc @GrabYourPitchforks, @stephentoub Should I mark this as netfx-port-consider, just like https://github.com/dotnet/corefx/pull/24006? 28948 area-Infrastructure Local building issues on Windows I am trying to build corefx by using `clean.cmd` and then `build.cmd` on Windows. Local building on Windows returns next warnings in `msbuild.wrn` file: ``` 8:2>C:\Code\corefx\Tools\Symbols.targets(515,7): warning : Downloading https://dotnet.myget.org/F/dotnet-core/symbols/runtime.win-x64.Microsoft.NETCore.Runtime.CoreCLR/2.1.0-preview3-26409-06/ failed with exception: [C:\Code\corefx\external\runtime\runtime.depproj] 8:2>C:\Code\corefx\Tools\Symbols.targets(515,7): warning : Код состояния ответа не указывает на успешное выполнение: 404 (Not Found). [C:\Code\corefx\external\runtime\runtime.depproj] C:\Code\corefx\Tools\Symbols.targets(515,7): warning : в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) [C:\Code\corefx\external\runtime\runtime.depproj] C:\Code\corefx\Tools\Symbols.targets(515,7): warning : в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) [C:\Code\corefx\external\runtime\runtime.depproj] C:\Code\corefx\Tools\Symbols.targets(515,7): warning : в Microsoft.DotNet.Build.Tasks.DownloadFilesFromUrl.<ExecuteAsync>d__17.MoveNext() [C:\Code\corefx\external\runtime\runtime.depproj] 8:2>C:\Code\corefx\external\runtime\runtime.depproj(103,7): warning : Failed to download CoreCLR symbols ``` 28949 area-System.Security Clear SSL error queue after SSL_shutdown calls Part 1 of separating PR #28862 into smaller parts. This one covers the calls to SSL_shutdown explicitly made in CoreFx sources. The other location of [SSL_shutdown call](https://github.com/dotnet/corefx/blob/275752f322defe4e4d0d6e9ccb4330df146d57f1/src/System.Net.Security/src/System/Net/Security/SslStreamPal.Unix.cs#L242-261) is already covered by the SSL_ERROR_SSL case. 28950 area-System.Data SqlClient SqlConnectionBasicTests failures in 2.0.x CI Tracking issue for flaky test failure. Is there a surgical improvement that can be backported from master to /release/2.0.0 to improve CI reliability for that queue? https://github.com/dotnet/corefx/pull/27919 https://mc.dot.net/#/user/dotnet-maestro-bot/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Frelease~2F2.0.0~2F/test~2Ffunctional~2Fcli~2F/7aa45b89ca5ae46cb15fce46921f40dd925d736b/workItem/System.Data.SqlClient.Tests/analysis/xunit/System.Data.SqlClient.Tests.SqlConnectionBasicTests~2FConnectionTimeoutTestWithThread ``` at System.Data.SqlClient.Tests.SqlConnectionBasicTests.ConnectionTimeoutTestWithThread() Assert.True() Failure Expected: True Actual: False ``` /cc @saurabh500 @corivera 28951 area-System.Net "SocketsHttpHandler mangling ""User-Agent"" header" "When testing a .NET Core application against the 2.1 preview with the new `SocketsHttpHandler` using the latest build of the .NET Core SDK (info output from CLI listed below), requests sent through an `HttpClient` to a local HTTP echo or capture service shows the new implementation of the `HttpMessageHandler` / `HttpClientHandler` is modifying the ""User-Agent"" agent header value before sending (or otherwise failing to recompose it correctly after parsing). Here is an outline of the code: ```csharp var user_agent = ""Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.18 Safari/537.36""; using (var handler = new HttpClientHandler()) using (var client = new HttpClient(handler)) { var message = new HttpRequestMessage(HttpMethod.Post, ""http://lvh.me:8000/yboe63yb""); message.Headers.TryAddWithoutValidation(""User-Agent"", user_agent); message.Content = new StringContent(RuntimeInformation.FrameworkDescription, Encoding.UTF8); await client.SendAsync(message); } ``` After completion of the request, here is the capture according to a local instance of [requestbin](https://github.com/Runscope/requestbin), but this has also been validated against other echoing services: ``` POST /yboe63yb HTTP/1.1 Content-Length: 22 Accept-Language: en-US, en; q=0.8 Accept-Encoding: gzip, deflate, br Host: lvh.me:8000 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng*/*;q=0.8 User-Agent: Mozilla/5.0, (Macintosh; Intel Mac OS X 10_11_3), AppleWebKit/537.36, (KHTML, like Gecko), Chrome/63.0.3239.18, Safari/537.36 Connection: keep-alive Content-Type: text/plain; charset=utf-8 .NET Core 4.6.26310.01 ``` In that output you will see that it appears to be treating that header as a collection of header value entries and is inserting "", "" between all the components. That line should read: ``` User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.18 Safari/537.36 ``` Explicitly disabling the now-`true`-by-default `AppContext` switch for `UseSocketsHttpHandler` returns the header to its original, expected behavior on both Windows (WinHTTP) and Linux (libcurl): ```csharp AppContext.SetSwitch(""System.Net.Http.UseSocketsHttpHandler"", false); ``` As promised, here is the primary host information from `dotnet` CLI: ``` >dotnet --info .NET Core SDK (reflecting any global.json): Version: 2.1.300-preview3-008433 Commit: 6b240926a3 Runtime Environment: OS Name: Windows OS Version: 10.0.16299 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\2.1.300-preview3-008433\ Host (useful for support): Version: 2.1.0-preview2-26314-02 Commit: 8ac5f4fa22 .NET Core SDKs installed: 2.0.3 [C:\Program Files\dotnet\sdk] 2.1.2 [C:\Program Files\dotnet\sdk] 2.1.4 [C:\Program Files\dotnet\sdk] 2.1.100 [C:\Program Files\dotnet\sdk] 2.1.102 [C:\Program Files\dotnet\sdk] 2.1.103 [C:\Program Files\dotnet\sdk] 2.1.200-preview-007474 [C:\Program Files\dotnet\sdk] 2.1.300-preview1-008174 [C:\Program Files\dotnet\sdk] 2.1.300-preview3-008433 [C:\Program Files\dotnet\sdk] .NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.0-preview1-final [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.0-preview2-30431 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.0-preview1-final [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.0-preview2-30431 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.0-preview1-26216-03 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.0-preview2-26314-02 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] ```" 28953 area-System.Diagnostics StartInfo_TextFile_ShellExecute test failing for spanish windows (Non English CI) ``` Could not start C:\\Users\\runner\\AppData\\Local\\Temp\\ProcessStartInfoTests_q0umvtb5.dh2\\StartInfo_TextFile_ShellExecute_994_2372eb4f.txt UseShellExecute=True Association details for '.txt' ------------------------------ Open command: C:\\Windows\\system32\\NOTEPAD.EXE %1 ProgID: txtfile Expected: True Actual: False ``` 28954 area-System.Memory Make CreateFromPinnedArray visible and move it to MemoryMarshal Marking the method has `EditorBrowsableState.Never` hurts usability for users (like ASP.NET) who want to [use the API](https://github.com/aspnet/Common/blob/7fd3a209704efe9eb4303fce99062ac2f71d5c6c/shared/Microsoft.Extensions.Buffers.Sources/MemoryPoolBlock.Release.cs#L28). Since the developer needs to be careful with the use of this API (it can be considered unsafe, for instance, if someone calls it on an array that isn't already pre-pinned), we should consider moving it to MemoryMarshal instead, but not hide it. ```diff namespace System { public readonly partial struct Memory<T> { - [EditorBrowsable(EditorBrowsableState.Never)] - public static Memory<T> CreateFromPinnedArray(T[] array, int start, int length) { throw null; } } } namespace System.Runtime.InteropServices { public static partial class MemoryMarshal { + public static Memory<T> CreateFromPinnedArray(T[] array, int start, int length) { throw null; } } } ``` cc @davidfowl, @GrabYourPitchforks, @stephentoub, @KrzysztofCwalina, @pakrym, @benaadams 28956 area-Infrastructure [1.1] Use Portable Linux for new distros and unknown distro cc: @janvorli 28959 area-System.Memory Remove SequenceMarshal.TryGetMemoryManager for ReadOnlySequence This API was added as part of https://github.com/dotnet/corefx/issues/27097 when we had a ReadOnlySequence ctor that takes a MemoryManager. Based on the `Memory<T>` [usage guidelines](https://gist.github.com/GrabYourPitchforks/4c3e1935fd4d9fa2831dbfcab35dffc6), ReadOnlySequence is a consumer of Memory and not an owner. Therefore, we removed that ctor, when we split OwnedMemory into MemoryManager and IMemoryOwner, here (https://github.com/dotnet/corefx/pull/28640). There is no longer a need to have an API that requires a MemoryManager from a ReadOnlySequence. **There are no calls to this method in corefx/ASP.NET and it is no longer relevant.** We already have a method on MemoryMarshal to get MemoryManager from a ReadOnlyMemory, which should be sufficient for any meaningful scenarios. ```C# public static bool TryGetMemoryManager<T, TManager>(ReadOnlyMemory<T> memory, out TManager manager) where TManager : MemoryManager<T> { throw null; } ``` ```diff namespace System.Runtime.InteropServices { public static partial class SequenceMarshal { - public static bool TryGetMemoryManager<T>(ReadOnlySequence<T> sequence, out MemoryManager<T> manager, out int start, out int length) { throw null; } } } ``` cc @davidfowl, @pakrym, @GrabYourPitchforks, @KrzysztofCwalina, @terrajobst, @benaadams 28960 area-System.Xml DataSet ReadXmlSchema Error when uri filename contain special character When running .net core on mac was unable to pass string with special character to ReadXmlSchema, specifically a '#'. The error return path not found stopping the given path before the special character. Workaround using %23 works, but using '#' on windows system works fine. Attempted to use %23 on windows system and was unable to resolve path. Appears to be error coming from XmlTextReaderImpl or XmlResolver. Using uri and tostring method returns correct path, '#' is converted to %23. 28961 area-System.Net SocketsHttpHandler: NTLM auth does not work by default on Unix HttpClient with credentials explicitly set. SocketHttpHandler throws on NTLM authentication requested by server: ``` System.ComponentModel.Win32Exception (0x80090020): GSSAPI operation failed with error - An invalid status code was supplied (Unknown error). at System.Net.Security.NegotiateStreamPal.AcquireCredentialsHandle(String package, Boolean isServer, NetworkCredential credential) in /home/build/github/corefx/src/Common/src/System/Net/Security/NegotiateStreamPal.Unix.cs:line 316 at System.Net.NTAuthentication.Initialize(Boolean isServer, String package, NetworkCredential credential, String spn, ContextFlagsPal requestedContextFlags, ChannelBinding channelBinding) in /home/build/github/corefx/src/Common/src/System/Net/NTAuthentication.Common.cs:line 128 at System.Net.NTAuthentication..ctor(Boolean isServer, String package, NetworkCredential credential, String spn, ContextFlagsPal requestedContextFlags, ChannelBinding channelBinding) in /home/build/github/corefx/src/Common/src/System/Net/NTAuthentication.Common.cs:line 98 at System.Net.Http.AuthenticationHelper.SendWithNtAuthAsync(HttpRequestMessage request, Uri authUri, ICredentials credentials, Boolean isProxyAuth, HttpConnection connection, CancellationToken cancellationToken) in /home/build/github/corefx/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/AuthenticationHelper.NtAuth.cs:line 61 at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken) in /home/build/github/corefx/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:line 283 at System.Net.Http.AuthenticationHelper.SendWithAuthAsync(HttpRequestMessage request, Uri authUri, ICredentials credentials, Boolean preAuthenticate, Boolean isProxyAuth, Boolean doRequestAuth, HttpConnectionPool pool, CancellationToken cancellationToken) in /home/build/github/corefx/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/AuthenticationHelper.cs:line 204 at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) in /home/build/github/corefx/src/Sys ``` **Workarounds:** 1. Install package called `gss-ntlmssp` (plugin into MIT Kerberos GSSAPI layer) 2. Install Heimdal (alternative Kerberos implementation with NTLM support): https://www.h5l.org/manual/heimdal-1-5-branch/ntlm/ One of the options installed is sufficient to make SocketHttpHandler work for NTLM without any additional changes to CoreFX or the app. **Details:** .NET Core 2.0 / 2.1 with libcurl works fine. This is because curl has it's own implementation but SocketHttpHandler depends on authentication code shared with NegotiateStream class. The shared authentication depends on GSSAPI and that is typically provided by MIT kerberos. (this is also true for 2.1.300 preview docker images) It does not have ability to do NTLM. This is follow up on #27876 and #27872. This may be also related to https://github.com/dotnet/wcf/issues/943 28962 area-System.Memory Fix TODO to cleanup Tests by removing AsReadOnySpan/Memory and update callsites cc @AtsushiKan, @KrzysztofCwalina Fixes leftover work from https://github.com/dotnet/corefx/issues/26894 28963 area-System.Net SocketsHttpHandler: unable to use pre-authenticated kerberos ticket for auth on Unix This is fllow-up on #27876 I have setup where Linux machine joined domain (using MIT krb5) > clruser@CLRPERFTST003:$ kinit > Password for clradmin@COREFX.NET: > clruser@CLRPERFTST003:$ klist > Ticket cache: FILE:/tmp/krb5cc_1000 > Default principal: clradmin@COREFX.NET > > Valid starting Expires Service principal > 2018-03-08 14:16:54 2018-03-09 00:16:54 krbtgt/COREFX.NET@COREFX.NET > renew until 2018-03-09 14:16:48 > 2018-03-08 14:37:52 2018-03-09 00:16:54 HTTP/clrperftst003.corefx.net@COREFX.NET > renew until 2018-03-09 14:16:48 > Unlike curl handler, SocketsHttpHandler is not able to use it for authentication. Explicit authentication works when specified in user@FQDN and DNS is configured properly. (not that for Kerberos time and name services are essential) 28964 area-System.Net propagate default credentials so we can pick up default kerberos ticket "fixes #28963 This duplicates code from Windows counter part. This makes SocketsHttpHandler behave like curl. Note there is no unit test yet. Kerberos setup will need some more work. This was tested manually: > ~/latest/dotnet run http://toweinfu-iis/test/auth/negotiate/Showidentity.ashx > result1=StatusCode: 200, ReasonPhrase: 'OK', Version: 1.1, Content: System.Net.Http.HttpConnection+HttpConnectionResponseContent, Headers: > { > Cache-Control: private > Server: Microsoft-IIS/10.0 > X-AspNet-Version: 4.0.30319 > Persistent-Auth: true > X-Powered-By: ASP.NET > WWW-Authenticate: Negotiate oRQwEqADCgEAoQsGCSqGSIb3EgECAg== > Date: Tue, 10 Apr 2018 03:58:37 GMT > Content-Type: application/json; charset=utf-8 > Content-Length: 60 > } > result1 lenght = System.Threading.Tasks.Task > { > ""Authenticated"": ""True"", > ""User"": ""pri\testuser"" > } " 28965 area-System.Net Fix perf hit from WinHttpGetProxyForUrl "Per offline discussion, here is the summary of optimization approach: 1. We don't want to modify existing WinHttpHandler code. Only improve the perf hit from SocketsHttpHandler side. 2. Introduce `WinHttpDetectAutoProxyConfigUrl`. When ""Automatic detect settings"" is checked, we will call into this function to see if we can auto detect config file. 3. If we are not able to auto detect config file and ""Use automatic configuration script"" is turned off, we can safely skip calling into WinHttpGetProxyForUrl. 4. Add timer optimization for calling `WinHttpDetectAutoProxyConfigUrl`. We don't call it per request, instead call it every 2 minutes, cache/update the info, to improve performance. Replace: #28859 Fix: #28543" 28966 area-System.Security Make X509_store_add_crl throw on unexpected errors Fixes #3063 and part 2 of #25676: clear error queue on X509_store_add_crl failures (X509StoreAddCrl). 28968 area-System.Net [Windows] Test hang: System.Net.Http.Functional.Tests "From https://github.com/dotnet/corefx/pull/28962 https://mc.dot.net/#/user/ahsonkhan/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/a206cf92c713b91e74bf786ef3f980ce29c2b4bb/workItem/System.Net.Http.Functional.Tests/wilogs Windows.7.Amd64.Open-x64:Debug ```text 2018-04-10 03:37:43,569: INFO: proc(54): run_and_log_output: Output: 2018-04-10 03:37:43,631: INFO: proc(54): run_and_log_output: Output: Discovering: System.Net.Http.Functional.Tests 2018-04-10 03:37:43,960: INFO: proc(54): run_and_log_output: Output: Discovered: System.Net.Http.Functional.Tests 2018-04-10 03:37:44,210: INFO: proc(54): run_and_log_output: Output: Starting: System.Net.Http.Functional.Tests 2018-04-10 03:37:44,740: INFO: proc(54): run_and_log_output: Output: System.Net.Http.Functional.Tests.PlatformHandler_HttpClientMiniStress.ManyClients_ManyPosts_Async [SKIP] 2018-04-10 03:37:44,740: INFO: proc(54): run_and_log_output: Output: Condition(s) not met: \""IsStressModeEnabled\"" ``` ... ```text 2018-04-10 03:57:16,631: INFO: servicebusrepository(84): renew_workitem_lock: Entering renew_workitem_lock for https://nethelix.servicebus.windows.net/windows.7.amd64.open/messages/42002763/01e87693-ce18-4c7c-9e80-042ff46d0dd7 2018-04-10 03:57:16,740: INFO: saferequests(90): request_with_retry: Response complete with status code '200' 2018-04-10 03:57:16,740: INFO: servicebusrepository(97): renew_workitem_lock: renew_workitem_lock Status Code: 200 2018-04-10 03:57:43,053: ERROR: job(44): kill: Job running for too long. Killing... 2018-04-10 03:57:43,053: ERROR: executor(399): _execute_command: Executor timed out after 1200 seconds and was killed. 2018-04-10 03:57:43,053: INFO: event(43): send: Sending event type WorkItemTimeout 2018-04-10 03:57:43,898: INFO: saferequests(90): request_with_retry: Response complete with status code '201' 2018-04-10 03:57:43,898: INFO: executor(418): _execute_command: Finished _execute_command, exit code: -3 ``` cc @davidsh, @wfurt, @caesar1995, @rmkerr, @karelz" 28969 area-System.Memory Add GetPinnableReference back to Span and ReadOnlySpan ### Proposed Api ```csharp public readonly ref partial struct ReadOnlySpan<T> { [EditorBrowsable(EditorBrowsableState.Never)] public readonly ref T GetPinnableReference(); } public readonly ref partial struct Span<T> { [EditorBrowsable(EditorBrowsableState.Never)] public ref T GetPinnableReference(); } ``` **Question** Unlike `MemoryMarshal` it should return null pointer should it return null pointer for zero length Span? (see further down https://github.com/dotnet/corefx/issues/28969#issuecomment-379979579) - though `null` `ref`s are odd? ### Rational So C#7.3 is outish now https://docs.microsoft.com/en-us/visualstudio/releasenotes/vs2017-preview-relnotes#csharp and it supports: ``` Custom `fixed` statement: Types that implement a suitable `GetPinnableReference` can be used in a `fixed` statement. ``` However, this method on span has been moved to `MemoryMarshal.GetReference` so span cannot participate directly in a `fixed` statement. To allow direct using a fixed statement the methods should be returned; **with the caveat** of adding the attribute `[EditorBrowsable(EditorBrowsableState.Never)]` so the route for a user getting a reference remaining via `MemoryMarshal` cc @davidfowl, @GrabYourPitchforks, @stephentoub, @KrzysztofCwalina, @pakrym, @ahsonkhan @jkotas 28971 area-System.Net SocketsHttpHandler: Add workaround for ipv6 LLA address Uri.Host LLA (Link-local address) IPv6 address doesn't contain %number (scope) part, and scope is mandatory for LLA. We will use uri.IdnHost for IPv6 LLA address on SocketsHttpHandler. This PR is a workaround for #28863, and should be reverted when #28863 is fixed. Close #28749 28972 area-System.Data Fix ConnectionTimeoutTestWithThread test Port the change #28618 into 2.0 Fixes #26382 SqlConnectionTimeout test failing breaking CI 28974 area-System.Security Impersonation "I need to do a impersonation in one of my services, but this service will run on a linux container. In windows i use like that [DllImport(""advapi32.dll"", SetLastError = true, CharSet = CharSet.Unicode)] I could not find any reference do this situation, could you have example of that?" 28978 area-Serialization Enable DCS_TypeWithPrimitiveKnownTypes Need enable [DCS_TypeWithPrimitiveKnownTypes](https://github.com/dotnet/corefx/blob/master/src/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs#L4019) test on UWP since #24265 has been closed. 28979 area-System.Net SocketsHttpHandler does not work on single core machines While trying to repro an issue on Win7 I have been running into consistent failures in all tests using Http. I think that it is a result of the changes introduced in PR #28638. The assertion being hit is on line 48 of ConcurrentQueue_Segment.cs. `boundedLength` has a value of 1. https://github.com/dotnet/corefx/blob/943e316297df4b0767e46dbb87f97ea861c6817e/src/Common/src/System/Collections/Concurrent/ConcurrentQueue_Segment.cs#L47-L49 The assertion is failing because of the following lines in SocketsHttpHandler ConnectHelper: https://github.com/dotnet/corefx/blob/943e316297df4b0767e46dbb87f97ea861c6817e/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ConnectHelper.cs#L19-L22 When the processor count is 1, RoundUpToPowerOf2 returns 1 (2<sup>0</sup>...), which is below the lower bound enforced by ConcurrentQueue. The failures don't repro in CI because all of the test machines have more than one core. cc: @stephentoub @davidsh 28980 area-System.Net Clear SSL error queue after MultiDestroy and MultiRemoveHandle Part 3 of separating PR #28862: Clear SSL error queue after MultiDestroy and MultiRemoveHandle (CurlHandler). These methods wrap calls to SSL_shutdown that can leave unwanted errors on the SSL error queue. There is no return to indicate if an error happened, so whenever MultiDestroy and MultiRemoveHandle are called a corresponding call to ErrClearError was added. 28981 area-System.Memory Remove MemoryManager.length Resolves https://github.com/dotnet/corefx/issues/28751 Requires coreclr change https://github.com/dotnet/coreclr/pull/17498 /cc @ahsonkhan @davidfowl @GrabYourPitchforks @KrzysztofCwalina 28982 area-System.Net fix get for UseDefaultCredentials with SockerHttpHandler follow-up on #28964 28983 area-System.Net Ensure ConnectHelper creates a Segment with a min of 2 Fixes https://github.com/dotnet/corefx/issues/28979 cc: @rmkerr 28984 area-System.Net Allow HTTPListener to grab unprotected ports on Windows "@doyouevensunbro commented on [Mon Apr 09 2018](https://github.com/dotnet/core/issues/1413) Currently, to get HTTPListener in .Net Core 2 I have to run the following block of code: ```C# if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { using (Process process = new Process()) { var command = ""netsh.exe""; var args = string.Format(""http add urlacl url=\""{0}\"" user=Everyone"", _host); process.StartInfo = new ProcessStartInfo(command, args) { Verb = ""runas"", UseShellExecute = true, }; try { process.Start(); process.WaitForExit(); } catch (Exception e) { Log.Error(Tag, ""Couldn't set HTTPListener permissions: "", e); throw; } } } ``` I'm assuming that this is for security reasons (I'm more familiar with Linux over Windows, and HTTPListener works without issue on those platforms). So I tried listening to the port using TcpListener and had no issues. I'm a bit confused by this since I can write a HTTP server using a TcpListener, there are libraries out there that do it now. Any chance we can change .Net Core 2 to do the same, or this is a Windows issue that can't be bypassed? Thanks! " 28985 area-Infrastructure .NET Core 2.0: FileLoadException @Krakean commented on [Tue Apr 10 2018](https://github.com/dotnet/core/issues/1416) Hello. Using Win 10 x64 Fall Creators Update and .NET Core 2.1.104 I'm getting this when trying to run my game launcher: https://i.imgur.com/WCzLzah.png (previously it was: BadImageException bla bla reference assemblies should not be loaded for execution bla bla; but after I downgraded System.Numerics.Vector to 4.4.0 - error changed to current one) Can't understand why this happens. I'm referencing only System.Numerics.Vectors 4.4.0: https://i.imgur.com/YrZYU5t.png Can this be a problem because of this: I'm making game engine, and dlls of my engine - like system, renderer, 3d engine, sound, network and so on - are Net Standard 2.0 (but I complie them using .NET Core 2.0 toolchain) to force me avoid windows-only functions and trying to keep cross-platform, but game launcher executable (that is just instantiate .net core's game dll that initialize engine) is .NET Framework 4.7.1. Could this be a root of issue? If so, how it can be solved? 28988 area-System.Numerics Reenable ASin test Fixes https://github.com/dotnet/corefx/issues/15455 Test is passing locally now. 28989 area-System.Xml Clean dead code System.Private.Xml* 28990 area-System.Memory Removing SequenceMarshal.TryGetMemoryManager for ReadOnlySequence Fixes https://github.com/dotnet/corefx/issues/28959 cc @pakrym, @KrzysztofCwalina, @davidfowl 28992 area-System.Memory Add CreateFromPinnedArray to System.Memory ref and add tests Part of https://github.com/dotnet/corefx/issues/28954 Depends on: https://github.com/dotnet/coreclr/pull/17500 ~**TODO:** Update newly added tests to use MemoryMarshal.CreateFromPinnedArray~ cc @KrzysztofCwalina, @stephentoub, @GrabYourPitchforks, @davidfowl, @pakrym 28993 area-System.IO Reenable negative compression tests 28994 area-System.Net Handle User-Agent/Server writing similarly to HttpHeaders.GetHeaderString Fixes https://github.com/dotnet/corefx/issues/28951 (Tests pending) This changes writing headers similarly to what we do here: https://github.com/dotnet/corefx/blob/d5351fe933f0f4682ac465b656b2a438b076c24e/src/System.Net.Http/src/System/Net/Http/Headers/HttpHeaders.cs#L309-L329 28997 area-System.Diagnostics Modify test to only try open file with vi not nano "Fixes: #28668 As explained in #28668, the test failure in `System.Diagnostics.Tests.ProcessTests/ProcessStart_OpenFileOnLinux_UsesSpecifiedProgram(programToOpenWith: \""nano\"")` seems due to nano exiting when stdin is not a terminal. This PR changes this test and test `ProcessStart_OpenFileOnLinux_UsesSpecifiedProgramUsingArgumentList` to only use vi. cc: @danmosemsft @tmds " 28998 area-System.Net Disable SSL3 test case on RedHat 6 Because of [this issue](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html-single/6.9_release_notes/index#known_issues_security), one of our SSL tests consistently fails on RedHat 6.9. The test tries to detect what version of OpenSsl is loaded in order to decide which test cases are valid. The call we're actually using to do that is `SSLEay`. As documented in the RedHat 6.9 known issues, that value is not reported correctly: ``` Because certain applications perform incorrect version check of the OpenSSL version, the actual runtime version of OpenSSL is masked and the build-time version is reported instead. Consequently, it is impossible to detect the currently running OpenSSL version using the SSLeay() function. ``` The misreported version causes us to use a test case we would not otherwise, which then fails. This fix disables the test case on RedHat. 28999 area-System.Threading Regenerate System.Threading ref with latest buildtools changes cc @kouvel, @tarekgh, @weshaggard, @danmosemsft, @ericstj, @joshfree Most of it is just formatting, sorting order. 29000 area-Infrastructure StringComparer.InvariantCultureIgnoreCase and StringComparer.CurrentCultureIgnoreCase serialization tests failing on netfx ci Related to https://github.com/dotnet/corefx/issues/28816 29001 area-System.Memory Remove SequencePosition comparison operators or change their description We do not guarantee that any comparison of sequence positions would have any meaning but that they contain same values. https://github.com/aspnet/SignalR/pull/1916/files/1ca2e5f2638f498bb4b57a9d2c69084ecf99bc8f#diff-00c0a7c2117eaeddb8f9964fbdda240aR79 /cc @ahsonkhan @davidfowl @KrzysztofCwalina 29002 area-Infrastructure [1.1] Add packaging for Fedora28 and Debian9 cc: @weshaggard @janvorli 29003 area-System.Memory Add GetPinnableReference to ref and add tests Part of https://github.com/dotnet/corefx/issues/28969 Depends on coreclr: https://github.com/dotnet/coreclr/pull/17504 cc @davidfowl, @GrabYourPitchforks, @stephentoub, @KrzysztofCwalina, @pakrym, @ahsonkhan @jkotas, @VSadov, @benaadams 29004 area-Infrastructure Making Spanish CI leg as the defaut target CI Merge After https://github.com/dotnet/corefx/pull/28952 and https://github.com/dotnet/corefx/pull/29009 29005 area-System.Net Unobserved websocket task exceptions when attempting to read/write on non-existent connections Valid repro: [WebSocketRepro.zip](https://github.com/dotnet/corefx/files/1896745/WebSocketRepro.zip) Firstly start server with `dotnet run -c Release`, then keep starting client with `dotnet run -c Release` until server app prints the exception we're looking for. Reproducing it might require a few tries, but I've never needed more than 3. I reproduced it on both latest stable `2.1.103` SDK, as well as `2.1.300-preview1-008174`. This issue seems to be reproducible **only on Windows**, I had no luck running into this issue on linux. As you can see in the source, we have generic try-catch all across entire flow, which should catch any potential exceptions (and does, we intentionally ignore them since this is working as intended). However, under special circumstances it's possible that we can receive unobserved exception instead, which isn't caught but instead thrown back on `TaskScheduler.UnobservedTaskException`. This doesn't influence the app in any significant way (it doesn't crash or stop working), but if this is expected then it should be observed, similar how it was done in other case I reported: https://github.com/dotnet/corefx/issues/24002 (that has nothing to do with this one). The exception we're looking for is: ``` Reproduced! This should not happen: System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. (Próbowano wykonać operację na nieistniejącym połączeniu sieciowym) ---> System.Net.HttpListenerException: Próbowano wykonać operację na nieistniejącym połączeniu sieciowym (translation: an attempt was made to perform an operation on a non-existent network connection) at System.Net.WebSockets.WebSocketHttpListenerDuplexStream.ReadAsyncFast(HttpListenerAsyncEventArgs eventArgs) at System.Net.WebSockets.WebSocketHttpListenerDuplexStream.<ReadAsyncCore>d__30.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() at System.Net.WebSockets.WebSocketBase.WebSocketOperation.<Process>d__19.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() at System.Net.WebSockets.WebSocketBase.<ReceiveAsyncCore>d__44.MoveNext() --- End of inner exception stack trace --- ---> (Inner Exception #0) System.Net.HttpListenerException (0x80004005): Próbowano wykonać operację na nieistniejącym połączeniu sieciowym (translation: an attempt was made to perform an operation on a non-existent network connection) at System.Net.WebSockets.WebSocketHttpListenerDuplexStream.ReadAsyncFast(HttpListenerAsyncEventArgs eventArgs) at System.Net.WebSockets.WebSocketHttpListenerDuplexStream.<ReadAsyncCore>d__30.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() at System.Net.WebSockets.WebSocketBase.WebSocketOperation.<Process>d__19.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() at System.Net.WebSockets.WebSocketBase.<ReceiveAsyncCore>d__44.MoveNext()<--- ```  ``` Product Information: Version: 2.1.300-preview1-008174 Commit SHA-1 hash: b8df89a54f Runtime Environment: OS Name: Windows OS Version: 10.0.16299 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\2.1.300-preview1-008174\ Microsoft .NET Core Shared Framework Host Version : 2.1.0-preview1-26216-03 Build : f2c3216183d20416568a4bbf5bb7d153e826f153 ``` *Initial issue reported in: https://github.com/mono/linker/issues/295* Thank you in advance. 29006 area-System.Net Make HttpWebResponse.LastModified throw when invalid date is provided Fixes https://github.com/dotnet/corefx/issues/28941 cc: @Clockwork-Muse 29007 area-System.Diagnostics Performance Counter tests failing on spanish CI A couple of the tests are failing ``` System.ComponentModel.Win32Exception : No se puede encontrar el módulo especificado(The specified module can not be found) Stack Trace : at System.Diagnostics.CounterSampleCalculator.LoadPerfCounterDll() in D:\j\workspace\windows-TGrou---db113413\src\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\CounterSampleCalculator.cs:line 245 at System.Diagnostics.CounterSampleCalculator.ComputeCounterValue(CounterSample oldSample, CounterSample newSample) in D:\j\workspace\windows-TGrou---db113413\src\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\CounterSampleCalculator.cs:line 93 at System.Diagnostics.CounterSampleCalculator.ComputeCounterValue(CounterSample newSample) in D:\j\workspace\windows-TGrou---db113413\src\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\CounterSampleCalculator.cs:line 56 at System.Diagnostics.CounterSample.Calculate(CounterSample counterSample) in D:\j\workspace\windows-TGrou---db113413\src\System.Diagnostics.PerformanceCounter\src\System\Diagnostics\CounterSample.cs:line 148 at System.Diagnostics.Tests.CounterSampleTests.CounterSample_Calculate_CalculateCounterSample() in D:\j\workspace\windows-TGrou---db113413\src\System.Diagnostics.PerformanceCounter\tests\CounterSampleTests.cs:line 49 ``` CounterSample_Calculate_CalculateCounterSample CounterSample_Calculate_CalculateCounterSampleCounterSample 29009 area-System.Diagnostics Work around occasional IOException using OpenRemoteBaseKey against local machine "RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, ""."") "" is sporadically hitting an IOException with ""Network path not found"" because the underlying call to RegConnectRegistry is returning an error. I am working around the problem by using Registry.LocalMachine when the key requested is against the local machine. I will open the issue to consider whether OpenRemoteBaseKey should do this itself. I will tag the issue here (after I create it) Fixes https://github.com/dotnet/corefx/issues/29007" 29011 area-System.Net Constructor System.Uri(Uri baseUri, string relativeUri) fails if relativeUri is long and contains a colon "I observed strange behavior when working with OData queries. When I tried to debug this problem I found that the root cause it most likely in `System.Uri.CreateThis` which validates scheme before actually checking if the scheme is necessary. ```c# static void Main(string[] args) { var baseUri = new Uri(""https://stansw.analytics.visualstudio.com/_odata/v2.0-preview/""); var relativeUri = ""WorkItems?$filter= "" // 128 + "" "" // 256 + "" "" // 384 + "" "" // 512 + "" "" // 640 + "" "" // 768 + "" "" // 896 + ""Processes/any(b:b/BacklogName eq 'Features')""; var uri = new Uri(baseUri, relativeUri); Console.WriteLine(uri.ToString()); relativeUri = ""WorkItems?$filter= "" // 128 + "" "" // 256 + "" "" // 384 + "" "" // 512 + "" "" // 640 + "" "" // 768 + "" "" // 896 + "" "" // 1024 + ""Processes/any(b:b/BacklogName eq 'Features')""; uri = new Uri(baseUri, relativeUri); Console.WriteLine(uri.ToString()); } ``` Output: ``` https://stansw.analytics.visualstudio.com/_odata/v2.0-preview/WorkItems?$filter= Processes/any(b:b/BacklogName eq 'Features') Unhandled Exception: System.UriFormatException: Invalid URI: The Uri scheme is too long. at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind) at System.Uri.CreateUri(Uri baseUri, String relativeUri, Boolean dontEscape) at System.Uri..ctor(Uri baseUri, String relativeUri) at ConsoleApp4.Program.Main(String[] args) in C:\Users\stansw\Documents\Visual Studio 2017\Projects\ConsoleApp4\ConsoleApp4\Program.cs:line 35 Press any key to continue . . . ``` [EDIT] Add syntax highlighting by @karelz" 29014 area-System.Runtime Value of Environment.CommandLine is different with the actual input "Hi, We are porting a .Net application to .Net Core. The application will run on Windows and we'd want it to have the same behavior with the origin one. In the application, we implemented a command line parser which reads command line from `Environment.CommandLine`. We'd want to reuse the code, while found `Environment.CommandLine` returns different value with .Net. In .Net, it can return exactly the same string I input on console. In .Net Core, it uses `\` to escape double quote marks, which is different from the string I input from console. For example: When the input is `"""""" 1234`, `Environment.CommandLine` returns `""\"" 1234""`, when input is `""\"" 1234 ""`, it also returns `""\"" 1234""`. In this condition, I have no way to know what the actual input is. Could you please help to take a look? Emma " 29015 area-System.Console Test failure: WindowAndCursorProps/Title_Get_Windows Opened on behalf of @Sunny-pu The test `WindowAndCursorProps/Title_Get_Windows` has failed. System.IO.IOException : The data area passed to a system call is too small.\r Stack Trace: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.Console.get_Title() at WindowAndCursorProps.Title_Get_Windows() in E:\A\_work\3\s\corefx\src\System.Console\tests\WindowAndCursorProps.cs:line 139 Build : Master - 20180411.01 (Full Framework Tests) Failing configurations: - Windows.10.Amd64.ClientRS2-x64 - Release Details: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fdesktop~2Fcli~2F/build/20180411.01/workItem/System.Console.Tests/analysis/xunit/WindowAndCursorProps~2FTitle_Get_Windows 29016 area-System.Collections Test failure: System.Collections.Generic.Tests.EqualityComparerTests/NullableEquals(left: 0, right: 128, expected: False) Opened on behalf of @Sunny-pu The test `System.Collections.Generic.Tests.EqualityComparerTests/NullableEquals(left: 0, right: 128, expected: False)` has failed. System.NullReferenceException : Object reference not set to an instance of an object. Stack Trace: at System.Nullable$1<System.__UniversalCanon>.get_HasValue() in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\shared\System\Nullable.cs:line 34 at System.Collections.Generic.NullableEqualityComparer$1<System.__UniversalCanon>.Equals(Nullable$1<__UniversalCanon> x, Nullable$1<__UniversalCanon> y) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\Internal\IntrinsicSupport\EqualityComparerHelpers.cs:line 253 at Internal.Runtime.Augments.RuntimeAugments.CallDescrWorker(IntPtr callDescr) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\Internal\Runtime\Augments\RuntimeAugments.cs:line 969 at Internal.Runtime.TypeLoader.CallConverterThunk.InvokeTarget(Void* allocatedStackBuffer, $CallConversionParameters conversionParams) in InvokeTarget:line 16707566 at Internal.Runtime.Augments.RuntimeAugments.RunFunctionWithConservativelyReportedBufferInternal<Internal.Runtime.CallInterceptor.CallConversionInterpreter+CallConversionInterpreterLocals>(Int32 cbBuffer, IntPtr pfnTargetToInvoke, $CallConversionInterpreterLocals context, ConservativelyReportedRegionDesc regionDesc) in RunFunctionWithConservativelyReportedBufferInternal:line 15732480 at Internal.Runtime.Augments.RuntimeAugments.RunFunctionWithConservativelyReportedBuffer<Internal.Runtime.TypeLoader.CallConversionParameters>(Int32 cbBuffer, IntPtr pfnTargetToInvoke, $CallConversionParameters context) in RunFunctionWithConservativelyReportedBuffer:line 16707566 at Internal.Runtime.TypeLoader.CallConverterThunk.CallConversionThunk(IntPtr callerTransitionBlockParam, IntPtr callConversionId) in CallConversionThunk:line 16707566 at Internal.Runtime.Augments.RuntimeAugments.CallDescrWorker(IntPtr callDescr) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\Internal\Runtime\Augments\RuntimeAugments.cs:line 969 at Internal.Runtime.TypeLoader.CallConverterThunk.InvokeTarget(Void* allocatedStackBuffer, $CallConversionParameters conversionParams) in InvokeTarget:line 16707566 at Internal.Runtime.Augments.RuntimeAugments.RunFunctionWithConservativelyReportedBufferInternal<Internal.Runtime.CallInterceptor.CallConversionInterpreter+CallConversionInterpreterLocals>(Int32 cbBuffer, IntPtr pfnTargetToInvoke, $CallConversionInterpreterLocals context, ConservativelyReportedRegionDesc regionDesc) in RunFunctionWithConservativelyReportedBufferInternal:line 15732480 at Internal.Runtime.Augments.RuntimeAugments.RunFunctionWithConservativelyReportedBuffer<Internal.Runtime.TypeLoader.CallConversionParameters>(Int32 cbBuffer, IntPtr pfnTargetToInvoke, $CallConversionParameters context) in RunFunctionWithConservativelyReportedBuffer:line 16707566 at Internal.Runtime.TypeLoader.CallConverterThunk.CallConversionThunk(IntPtr callerTransitionBlockParam, IntPtr callConversionId) in CallConversionThunk:line 16707566 at System.Collections.Generic.Tests.EqualityComparerTests.NullableEquals<System.__UniversalCanon>(__UniversalCanon left, __UniversalCanon right, Boolean expected) at Internal.Runtime.Augments.RuntimeAugments.CallDescrWorker(IntPtr callDescr) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\Internal\Runtime\Augments\RuntimeAugments.cs:line 969 at Internal.Runtime.TypeLoader.CallConverterThunk.InvokeTarget(Void* allocatedStackBuffer, $CallConversionParameters conversionParams) in InvokeTarget:line 16707566 at Internal.Runtime.Augments.RuntimeAugments.RunFunctionWithConservativelyReportedBufferInternal<Internal.Runtime.CallInterceptor.CallConversionInterpreter+CallConversionInterpreterLocals>(Int32 cbBuffer, IntPtr pfnTargetToInvoke, $CallConversionInterpreterLocals context, ConservativelyReportedRegionDesc regionDesc) in RunFunctionWithConservativelyReportedBufferInternal:line 15732480 at Internal.Runtime.Augments.RuntimeAugments.RunFunctionWithConservativelyReportedBuffer<Internal.Runtime.TypeLoader.CallConversionParameters>(Int32 cbBuffer, IntPtr pfnTargetToInvoke, $CallConversionParameters context) in RunFunctionWithConservativelyReportedBuffer:line 16707566 at Internal.Runtime.TypeLoader.CallConverterThunk.CallConversionThunk(IntPtr callerTransitionBlockParam, IntPtr callConversionId) in CallConversionThunk:line 16707566 at Internal.Runtime.Augments.RuntimeAugments.CallDescrWorker(IntPtr callDescr) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\Internal\Runtime\Augments\RuntimeAugments.cs:line 969 at Internal.Runtime.TypeLoader.CallConverterThunk.InvokeTarget(Void* allocatedStackBuffer, $CallConversionParameters conversionParams) in InvokeTarget:line 16707566 at Internal.Runtime.Augments.RuntimeAugments.RunFunctionWithConservativelyReportedBufferInternal<Internal.Runtime.CallInterceptor.CallConversionInterpreter+CallConversionInterpreterLocals>(Int32 cbBuffer, IntPtr pfnTargetToInvoke, $CallConversionInterpreterLocals context, ConservativelyReportedRegionDesc regionDesc) in RunFunctionWithConservativelyReportedBufferInternal:line 15732480 at Internal.Runtime.Augments.RuntimeAugments.RunFunctionWithConservativelyReportedBuffer<Internal.Runtime.TypeLoader.CallConversionParameters>(Int32 cbBuffer, IntPtr pfnTargetToInvoke, $CallConversionParameters context) in RunFunctionWithConservativelyReportedBuffer:line 16707566 at Internal.Runtime.TypeLoader.CallConverterThunk.CallConversionThunk(IntPtr callerTransitionBlockParam, IntPtr callConversionId) in CallConversionThunk:line 16707566 at System.InvokeUtils.CalliIntrinsics.Call(IntPtr dynamicInvokeHelperMethod, Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean isTargetThisCall) at System.InvokeUtils.CallDynamicInvokeMethod(Object thisPtr, IntPtr methodToCall, Object thisPtrDynamicInvokeMethod, IntPtr dynamicInvokeHelperMethod, IntPtr dynamicInvokeHelperGenericDictionary, Object targetMethodOrDelegate, Object[] parameters, BinderBundle binderBundle, Boolean wrapInTargetInvocationException, Boolean invokeMethodHelperIsThisCall, Boolean methodToCallIsThisCall) in CallDynamicInvokeMethod:line 16707566 Build : Master - 20180411.01 (UWP ILC Tests) Failing configurations: - Windows.10.Amd64.ClientRS3-x64 - Release Details: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Filc~2F/build/20180411.01/workItem/System.Collections.Tests/analysis/xunit/System.Collections.Generic.Tests.EqualityComparerTests~2FNullableEquals(left:%200,%20right:%20128,%20expected:%20False) 29018 area-System.Threading Test failure: System.Threading.Tasks.Tests.ExecutionContextFlowTest/SuppressFlow_TaskCapturesContextAccordingly(suppressFlow: True) Opened on behalf of @Sunny-pu The test `System.Threading.Tasks.Tests.ExecutionContextFlowTest/SuppressFlow_TaskCapturesContextAccordingly(suppressFlow: True)` has failed. Assert.Equal() Failure\r Expected: 42\r Actual: 0 Stack Trace: at System.Threading.Tasks.Tests.ExecutionContextFlowTest.SuppressFlow_TaskCapturesContextAccordingly(Boolean suppressFlow) in E:\A\_work\6\s\corefx\src\System.Threading.Tasks\tests\Task\ExecutionContextFlowTest.cs:line 25 at _$ILCT$.$ILT$ReflectionDynamicInvoke$.InvokeRetVI<System.Boolean>(Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean targetIsThisCall) at System.InvokeUtils.CalliIntrinsics.Call(IntPtr dynamicInvokeHelperMethod, Object thisPtrForDynamicInvokeHelperMethod, Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState) at System.InvokeUtils.CallDynamicInvokeMethod(Object thisPtr, IntPtr methodToCall, Object thisPtrDynamicInvokeMethod, IntPtr dynamicInvokeHelperMethod, IntPtr dynamicInvokeHelperGenericDictionary, Object targetMethodOrDelegate, Object[] parameters, BinderBundle binderBundle, Boolean wrapInTargetInvocationException, Boolean invokeMethodHelperIsThisCall, Boolean methodToCallIsThisCall) in CallDynamicInvokeMethod:line 16707566 Build : Master - 20180411.01 (UWP ILC Tests) Failing configurations: - Windows.10.Amd64.ClientRS3-x86 - Release - Windows.10.Amd64.ClientRS3-x64 - Release Details: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Filc~2F/build/20180411.01/workItem/System.Threading.Tasks.Tests/analysis/xunit/System.Threading.Tasks.Tests.ExecutionContextFlowTest~2FSuppressFlow_TaskCapturesContextAccordingly(suppressFlow:%20True) 29019 area-System.Text Test failure: System.Text.RegularExpressions.Tests.RegexCacheTests/Ctor_Cache_Promote_entries Opened on behalf of @Sunny-pu The test `System.Text.RegularExpressions.Tests.RegexCacheTests/Ctor_Cache_Promote_entries` has failed. $BlockedFromReflection_0_225208da : Remote process failed with an unhandled exception. Stack Trace: Child exception: System.NullReferenceException: Object reference not set to an instance of an object. at System.Text.RegularExpressions.Tests.RegexCacheTests.GetCachedItemsNum() in E:\A\_work\6\s\corefx\src\System.Text.RegularExpressions\tests\Regex.Cache.Tests.cs:line 151 at System.Text.RegularExpressions.Tests.RegexCacheTests.<Ctor_Cache_Promote_entries>b__4_0() in E:\A\_work\6\s\corefx\src\System.Text.RegularExpressions\tests\Regex.Cache.Tests.cs:line 74 at _$ILCT$.$ILT$ReflectionDynamicInvoke$.InvokeRetO<System.Int32>(Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean targetIsThisCall) at System.InvokeUtils.CalliIntrinsics.Call(IntPtr dynamicInvokeHelperMethod, Object thisPtrForDynamicInvokeHelperMethod, Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState) at System.InvokeUtils.CallDynamicInvokeMethod(Object thisPtr, IntPtr methodToCall, Object thisPtrDynamicInvokeMethod, IntPtr dynamicInvokeHelperMethod, IntPtr dynamicInvokeHelperGenericDictionary, Object targetMethodOrDelegate, Object[] parameters, BinderBundle binderBundle, Boolean wrapInTargetInvocationException, Boolean invokeMethodHelperIsThisCall, Boolean methodToCallIsThisCall) in CallDynamicInvokeMethod:line 16707566 Child process: System.Text.RegularExpressions.Tests, Version=4.2.1.0, Culture=neutral, PublicKeyToken=9d77cc7ad39b68eb System.Text.RegularExpressions.Tests.RegexCacheTests Int32 <Ctor_Cache_Promote_entries>b__4_0() Build : Master - 20180411.01 (UWP ILC Tests) Failing configurations: - Windows.10.Amd64.ClientRS3-x86 - Release - Windows.10.Amd64.ClientRS3-x64 - Release Details: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Filc~2F/build/20180411.01/workItem/System.Text.RegularExpressions.Tests/analysis/xunit/System.Text.RegularExpressions.Tests.RegexCacheTests~2FCtor_Cache_Promote_entries 29020 area-System.Memory Faster ReadOnlySequence First and TryGet methods I suggest faster ReadOnlySequence First and TryGet methods. Performance tests:  29022 area-System.IO Support appending foreign buffers to pipe without copy Moved from https://github.com/dotnet/corefxlab/issues/2031 Foreign buffers are buffers not allocated with the Pipe MemoryPool. Use-cases (by @Drawaes @mgravell @ReubenBond) - Send the same data to multiple Pipes - Pass existing data that is not related to pipelines - Embed existing data (e.g. add header) With the current API, these buffers are copied into buffers owned by the Pipe MemoryPool: Challenges: - The buffer usage needs to be tracked in order to know when it can be re-used. - some Transports (e.g. RIO) may not be capable of sending foreign buffers. They should detect this and copy the data in an appropriate buffer. CC @davidfowl 29024 area-System.Net SslStream.ShutdownAsync doesn't take a CancellationToken [`SslStream.ShutdownAsync`](https://github.com/dotnet/corefx/blob/master/src/System.Net.Security/src/System/Net/Security/SslStream.cs#L434) returns a `Task` but does not take a `CancellationToken`. I found this to be odd as the other methods do take a `CancellationToken` and pass it to `Task.Factory.FromAsync`; I guess `ShutdownAsync` could behave the same way. If this was not intentional (and `ShutdownAsync` should indeed take a `CancellationToken`), I'd be happy to create a PR which implements that. 29025 area-System.Xml [System.Private.Xml.Linq] Remove SILVERLIGHT define This change removes the SILVERLIGHT define from System.Private.Xml.Linq. It makes the source code easier to import to [Mono] (https://github.com/mono/mono/issues/8122 ). 29026 area-System.Runtime Expose `System.Runtime.CompilerServices.SkipLocalsInitAttribute` ### Rationale C# is exposing new functionality which allows you to drop the `init` flag from a method's `.local` directive (see https://github.com/dotnet/roslyn/issues/25780 for more details). It would be beneficial if CoreFX/NetStandard exposed this standard type so that users are not required to always manually define this type themselves. ### Proposed API ``` namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeUsage.All, Inherited = false)] // TODO: Update AttributeUsage based on the compiler spec public sealed class SkipLocalsInitAttribute : Attribute { public SkipLocalsInitAttribute() { } } } ``` 29027 area-System.Net URI fails to find when # is present in local file path **Steps to Reproduce:** 1)Create a directory with # in it's name. 2)Try to access the directory via URI and FileInfo(Uri) **Expected Behavior:** Able to access resources contained within the directory. **Actual Behavior:** URI fails to locate any files contained within the directory. 29028 area-System.Net Default proxy issues "@IeuanWalker commented on [Tue Apr 03 2018](https://github.com/dotnet/core/issues/1404) # Default Proxy issues Our organisation has a proxy and in previous versions on .NET (.net full framework), you can add the following to the web.config and the application will use your system's default proxy. ```XML <system.net> <defaultProxy useDefaultCredentials=""true"" /> </system.net> ``` I have tried a lot of different options but just cant seem to get anything to work. ```csharp string username = ""test""; string password = ""test""; WebProxy proxy = new WebProxy($""http://{username}:{password}@bluecoat.domain.gov.uk"", 8080) { Address = new Uri(""http://{username}:{password}@bluecoat.domain.gov.uk:8080""), Credentials = new NetworkCredential(username, password) }; HttpClientHandler clientHandler = new HttpClientHandler { Proxy = proxy, UseProxy = true, Credentials = new NetworkCredential(username, password) }; var httpClient = new HttpClient(clientHandler); ``` Any help would be greatly appreciated. " 29029 area-System.Net Synchronous socket methods on Unix requiring extra thread "When just using synchronous methods on a Socket (e.g. Socket.Receive), the calls pass through to the corresponding synchronous methods in the OS (e.g. recvmsg) However, when an asynchronous operation is issued on a Socket, it puts the underlying socket into non-blocking mode, and due to race conditions that would otherwise result, the socket is left in non-blocking mode for the remainder of its existence. That means that subsequent synchronous calls to methods on Socket end up taking a sync-over-async path, where it initiates the operation and then blocks on an event that'll be signaled by the event loop when the operation completes. In .NET Core 2.0 and earlier, that signaling took place on the event loop itself, e.g. with the event loop: https://github.com/dotnet/corefx/blob/665a428f353ad7c18a59b8d76ac6d4235038db3a/src/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEngine.Unix.cs#L258 calling HandleEvents: https://github.com/dotnet/corefx/blob/665a428f353ad7c18a59b8d76ac6d4235038db3a/src/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEngine.Unix.cs#L287 which would in turn call Complete on the queue: https://github.com/dotnet/corefx/blob/665a428f353ad7c18a59b8d76ac6d4235038db3a/src/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncContext.Unix.cs#L1523 which would in turn call TryCompleteAsync on operations: https://github.com/dotnet/corefx/blob/665a428f353ad7c18a59b8d76ac6d4235038db3a/src/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncContext.Unix.cs#L440-L442 which for these ""synchronous"" operations would wake them up by setting the event: https://github.com/dotnet/corefx/blob/665a428f353ad7c18a59b8d76ac6d4235038db3a/src/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncContext.Unix.cs#L116-L120 In .NET Core 2.1 unfortunately, that signaling is now taking place via a queued work item. The event loop still calls HandleEvents: https://github.com/dotnet/corefx/blob/acb44e79ef7dc81817da9cf5f19c9819d0f491d1/src/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncContext.Unix.cs#L800-L801 but HandleEvents queues a work item to do the actual processing: https://github.com/dotnet/corefx/blob/acb44e79ef7dc81817da9cf5f19c9819d0f491d1/src/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncContext.Unix.cs#L838-L840 That was done for performance reasons for actual async operations, but for these synchronous operations, it creates a problem. Let's say the thread pool contained a single thread. If that thread was used to make the ""synchronous"" call, then that thread will end up blocking waiting for the operation to complete. For it to complete, a work item gets posted to the thread pool, and that work item needs to be processed, but all of the threads in the pool are currently blocked. So we end up waiting for the thread pool's starvation mechanism to kick in and introduce another thread. Now let's say the thread pool contains 10 threads and 10 such operations are initiated, each of which does a ""synchronous"" operation. Now all 10 threads are blocked, and 10 work items are going to be queued to unblock them. This can result in seconds of delay for each such operation, plus unnecessary growth in the thread pool." 29030 area-System.Memory Dedup FormattingHelpers.cs / FormattingHelpers.CountDigits.cs These routines had been copy-and-pasted into this file in coreclr to enable similar optimizations there. Now that the shared file has flowed back to corefx, dedup. cc: @ahsonkhan 29031 area-System.Net Simplify sspicli interop marshaling This makes it both faster and more AOT friendly Contributes to https://github.com/dotnet/corert/issues/5674 29032 area-System.Memory System.MissingMethodException when using 4.5.0-preview2-* library with master SDK Valid repro: [DirectoryRepro.zip](https://github.com/dotnet/corefx/files/1899838/DirectoryRepro.zip) Execute repro with `dotnet run -c Release`. ``` Unhandled Exception: System.MissingMethodException: Method not found: 'System.ReadOnlySpan`1<Char> System.MemoryExtensions.AsSpan(System.String)'. at System.IO.Enumeration.FileSystemEnumerableFactory.NormalizeInputs(String& directory, String& expression, EnumerationOptions options) at System.IO.Directory.InternalEnumeratePaths(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options) at DirectoryRepro.Program.Main() in /tmp/test4/Program.cs:line 9 ``` I reproduced it on Windows as well as Linux. This issue did not happen previously with using 4.5.0-preview1-* library also on latest master SDK. I suspect some API incompatibility (probably not in the library being pulled, but one of its dependencies). If this is intended then how we're expected to use this library with latest master SDK? Thank you in advance. ``` .NET Core SDK (reflecting any global.json): Version: 2.1.300-preview3-008443 Commit: 1e2e8138b9 Runtime Environment: OS Name: debian OS Version: OS Platform: Linux RID: debian-x64 Base Path: /opt/dotnet/sdk/2.1.300-preview3-008443/ Host (useful for support): Version: 2.1.0-preview3-26404-01 Commit: 1b1a652c15 .NET Core SDKs installed: 2.1.300-preview3-008443 [/opt/dotnet/sdk] .NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.0-preview2-30431 [/opt/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.0-preview2-30431 [/opt/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.0-preview3-26404-01 [/opt/dotnet/shared/Microsoft.NETCore.App] ``` 29033 area-System.IO bottom part of serial port support on Unix This is part of original #28415 after addressing feedback. We publish System.IO.Ports as separate package so we can iterate on upper parts later. I'm at the point where I can run Serial port tests and I still get 20-30 failures (out of few hundred) depending in what HW I uses. The upper part still may need some polishing so as the test suite. In general issues seems to be in two areas: - discarding sent data when using USB/Serial adapter does not work well. That seems to be know limitation with Linux drivers. (or possibly USB) - manipulating buffer sizes does not work as on Windows. That breaks tests. 29035 area-Infrastructure Consider pinning the C# language version to 7.2 instead of latest We are currently using latest (in our release/2.1 branch). Should it be pinned to C# 7.2 instead? https://github.com/dotnet/corefx/blob/cb372752e0cc03123459f57484ec2ea2c40cc85b/dir.props#L231 cc @joperezr, @weshaggard, @GrabYourPitchforks, @joshfree, @danmosemsft, @leecow 29036 area-System.Net DualModeConnectAsync_DnsEndPointToHost_Helper fails in CI with TrueException on OSX From https://github.com/dotnet/corefx/pull/28992 OSX.1012.Amd64.Open-x64-Debug System.Net.Sockets.Tests.DualModeConnectAsync/DualModeConnectAsync_DnsEndPointToHost_Helper(listenOn: ::, dualModeServer: True) https://mc.dot.net/#/user/ahsonkhan/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/95b8f31c8f84213f3192a6b9d96e8b2ecdb2dcfe/workItem/System.Net.Sockets.Tests/analysis/xunit/System.Net.Sockets.Tests.DualModeConnectAsync~2FDualModeConnectAsync_DnsEndPointToHost_Helper(listenOn:%20::,%20dualModeServer:%20True) ```text Unhandled Exception of Type Xunit.Sdk.TrueException Message : Timed out while waiting for connection Expected: True Actual: False Stack Trace : at System.Net.Sockets.Tests.DualModeConnectAsync.DualModeConnectAsync_DnsEndPointToHost_Helper(IPAddress listenOn, Boolean dualModeServer) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.Net.Sockets/tests/FunctionalTests/DualModeSocketTest.cs:line 588 ``` 29037 area-Infrastructure CoreFx still builds packages that have desktop reference assemblies Related https://github.com/dotnet/corefx/issues/23830, part 3 We still have some packages that have reference assemblies in their ref folder. We've found numerous tools that don't like this and shouldn't expect all those tools to get fixed. As such, we need to tactfully remove ref folders, or use the implementation instead in these cases. 29039 area-System.Memory Remove use of Unsafe code in ReadOnlySequence TryGet (and optimize) Part of https://github.com/dotnet/corefx/issues/28920  cc @pakrym, @AlexRadch, @davidfowl, @KrzysztofCwalina, @stephentoub, @GrabYourPitchforks, @krwq 29040 area-System.Net Regression in synchronous socket operations when timeout set on Unix "Likely due to https://github.com/dotnet/corefx/pull/22588. Repro: ``` using System; using System.Diagnostics; using System.IO; using System.Net; using System.Net.Sockets; using System.Threading.Tasks; class Repro { static void Main() { Console.WriteLine($""(Framework: {Path.GetDirectoryName(typeof(object).Assembly.Location)})""); using (var listener = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) using (var client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) { listener.Bind(new IPEndPoint(IPAddress.Loopback, 0)); listener.Listen(1); client.Connect(listener.LocalEndPoint); using (Socket server = listener.Accept()) { server.ReceiveTimeout = 10_000; client.ReceiveTimeout = 10_000; server.SendTimeout = 10_000; client.SendTimeout = 10_000; var buffer = new byte[1]; var sw = new Stopwatch(); while (true) { long mem = GC.GetAllocatedBytesForCurrentThread(); sw.Restart(); const int Iters = 30_000; Task t = Task.Run(() => { for (int i = 0; i < Iters; i++) { server.Send(buffer); server.Receive(buffer); } }); for (int i = 0; i < Iters; i++) { client.Receive(buffer); client.Send(buffer); } t.Wait(); sw.Stop(); mem = GC.GetAllocatedBytesForCurrentThread() - mem; Console.WriteLine($""Time: {sw.Elapsed.TotalSeconds:F4}\t Bytes: {mem:N0}""); } } } } } ``` results for me in output like: ``` stoub@SToubUbuntu17102:~/Perf21$ dotnet run -c Release -f netcoreapp20 (Framework: /usr/share/dotnet/shared/Microsoft.NETCore.App/2.0.0) Time: 1.5177 Bytes: 4,928 Time: 1.5099 Bytes: 64 Time: 1.4843 Bytes: 64 Time: 1.4977 Bytes: 64 Time: 1.5022 Bytes: 64 Time: 1.6063 Bytes: 64 Time: 1.5047 Bytes: 64 Time: 1.5376 Bytes: 64 Time: 1.4493 Bytes: 64 Time: 1.5510 Bytes: 64 ^C stoub@SToubUbuntu17102:~/Perf21$ dotnet run -c Release -f netcoreapp21 (Framework: /usr/share/dotnet/shared/Microsoft.NETCore.App/2.1.0-preview3-26404-01) Time: 3.2621 Bytes: 4,564,568 Time: 2.7214 Bytes: 4,559,144 Time: 2.9079 Bytes: 4,558,424 Time: 2.6705 Bytes: 4,528,376 Time: 2.5066 Bytes: 4,464,144 Time: 2.2573 Bytes: 4,458,912 Time: 2.0995 Bytes: 4,451,288 Time: 2.2442 Bytes: 4,343,672 Time: 2.1785 Bytes: 4,428,208 Time: 2.0658 Bytes: 4,465,600 ^C stoub@SToubUbuntu17102:~/Perf21$ ``` Related to https://github.com/dotnet/corefx/issues/27605 Related to https://github.com/dotnet/corefx/issues/29029 cc: @geoffkizer " 29047 area-Serialization set s_checkDeserializeAdvances=true In [26947](https://github.com/dotnet/corefx/pull/26947), we set s_checkDeserializeAdvances=false In full framework, we can set it to true through config, but we cannot do it in core. We need investigate if we just turn it on . A full test pass in full framework pass when set this value to true. Need well understand this impact if to set this value to true. 29048 area-System.ComponentModel System.ComponentModel.TypeConverterTests.SizeFConverterTests failing for locale en-DE "```xml <test name=""System.ComponentModel.TypeConverterTests.SizeFConverterTests.ConvertFromString(width: 3,402823E+38, height: 3,402823E+38)"" type=""System.ComponentModel.TypeConverterTests.SizeFConverterTests"" method=""ConvertFromString"" time=""1.3487067"" result=""Fail""> <failure exception-type=""System.ArgumentException""> <message><![CDATA[System.ArgumentException : 40282347e+38 is not a valid value for Single.\r\nParameter name: value\r\n---- System.OverflowException : Value was either too large or too small for a Single.]]></message> <stack-trace><![CDATA[ at System.ComponentModel.BaseNumberConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value) in D:\DEV\corefx\src\System.ComponentModel.TypeConverter\src\System\ComponentModel\BaseNumberConverter.cs:line 85 at System.ComponentModel.TypeConverter.ConvertFromString(ITypeDescriptorContext context, CultureInfo culture, String text) in D:\DEV\corefx\src\System.ComponentModel.TypeConverter\src\System\ComponentModel\TypeConverter.cs:line 107 at System.Drawing.SizeFConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value) in D:\DEV\corefx\src\System.ComponentModel.TypeConverter\src\System\Drawing\SizeFConverter.cs:line 61 at System.ComponentModel.TypeConverter.ConvertFromString(String text) in D:\DEV\corefx\src\System.ComponentModel.TypeConverter\src\System\ComponentModel\TypeConverter.cs:line 91 at System.ComponentModel.TypeConverterTests.SizeFConverterTests.ConvertFromString(Single width, Single height) in D:\DEV\corefx\src\System.ComponentModel.TypeConverter\tests\Drawing\SizeFConverterTests.cs:line 234 ----- Inner Stack Trace ----- at System.Number.ParseSingle(ReadOnlySpan`1 value, NumberStyles options, NumberFormatInfo numfmt) in E:\A\_work\104\s\src\mscorlib\shared\System\Number.Parsing.cs:line 793 at System.Single.Parse(String s, NumberStyles style, IFormatProvider provider) in E:\A\_work\104\s\src\mscorlib\shared\System\Single.cs:line 288 at System.ComponentModel.SingleConverter.FromString(String value, NumberFormatInfo formatInfo) in D:\DEV\corefx\src\System.ComponentModel.TypeConverter\src\System\ComponentModel\SingleConverter.cs:line 39 at System.ComponentModel.BaseNumberConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value) in D:\DEV\corefx\src\System.ComponentModel.TypeConverter\src\System\ComponentModel\BaseNumberConverter.cs:line 80]]></stack-trace> </failure> </test> ``` The problem here seems to be that german numbers use the comma (`,`) as a decimal separator instead of a dot (`.`): https://github.com/dotnet/corefx/blob/73214ff6da537eb9dcf522406ef1d0470b88db88/src/System.ComponentModel.TypeConverter/src/System/Drawing/SizeFConverter.cs#L55-L62 `text` is the input string to be converted. In `en-us`, the decimal point is represented by `.` and `ListSeparator` is `,` -> `text == ""3.402823E+38, 3.402823E+38""` In `de-de` (the ""normal"" german locale), the decimal point is `,` and `ListSeparator` is `;` -> `text == ""3,402823E+38; 3,402823E+38""` Since this locale mixes the two, unfortunately the two are the same: `text == ""3,402823E+38, 3,402823E+38""` This seems to break the code since `tokens` is not splitting the numbers correctly here, leading to the exception." 29049 area-System.IO System.IO.File.WriteAllBytes hangs when the file to overwrite is an already existing FIFO "In Linux, `System.IO.File.WriteAllBytes` method seems to hang when the given file path is an already existing FIFO. I believe such a silent freezing of the program should be avoided. I observed this issue in Ubuntu 16.04.4 and Debian 9.1 (both x64). I installed dotnet-sdk-2.1.103 package, and used F#. If you have a problem in reproducing it, please let me know. ``` jason@ubuntu:~/FIFOTest$ ls FIFOTest.fsproj Program.fs jason@ubuntu:~/FIFOTest$ cat Program.fs open System open System.IO [<EntryPoint>] let main argv = System.IO.File.WriteAllBytes(""bar"", [|0uy|]) 0 // return an integer exit code jason@ubuntu:~/FIFOTest$ dotnet build ... jason@ubuntu:~/FIFOTest$ mkfifo bar jason@ubuntu:~/FIFOTest$ dotnet run bin/Debug/netcoreapp2.0/FIFOTest.dll (hangs) ``` " 29050 area-System.Net Optimize proxy PAC file discovery process for SocketsHttpHandler "This PR will reduce the calls to WinHTTP GetProxyForUrl() if a previous call recently discovered no PAC file within a certain timeframe. We call this API when ""Automatically detect settings"" is turned on. The default configuration on Windows has this proxy setting always turned on. This is ironic given that most network environments don't have a PAC file on the network. So, it's important to try to optimize this common case on customers' networks. Initial testing shows at least a 2x speed improvement with these changes. I used simple constructs of using DateTime and TimeSpan comparisons instead of trying to further optimize this using Environment.Ticks. Looking at the performance numbers, there is not any significant improvement in speed compared with the best case of ""Automatically detect settings"" being turned OFF in the first place. I did not use any locking mechanisms since those would drag down performance. In the worst case, any race condition would mean we might call GetProxyForUrl() an extra time. But since we're only filtering on ERROR_WINHTTP_AUTODETECTION_FAILED, it is unlikely to actually change over time. That particular error means that the WPAD protocol was able to complete on the network, but the answer discovered is that there is no PAC file registered on the network. Fixes #28543" 29051 area-System.Memory Remove use of Unsafe code in ReadOnlySequence GetFirstBuffer (and optimize) Here are the results if we continue to use Unsafe.As to cast (mainly to showcase performance improvement):  cc @pakrym, @AlexRadch, @davidfowl, @KrzysztofCwalina, @krwq 29052 area-System.Diagnostics Test failure: System.Diagnostics.Tests.ProcessStartInfoTests/Verbs_GetWithSubkeys_ReturnsEmpty "Opened on behalf of @Sunny-pu The test `System.Diagnostics.Tests.ProcessStartInfoTests/Verbs_GetWithSubkeys_ReturnsEmpty` has failed. Assert.Equal() Failure\r Expected: String[] [\""verb1\"", \""verb2\""]\r Actual: String[] [] Stack Trace: at System.Diagnostics.Tests.ProcessStartInfoTests.Verbs_GetWithSubkeys_ReturnsEmpty() in E:\A\_work\16\s\corefx\src\System.Diagnostics.Process\tests\ProcessStartInfoTests.cs:line 656 at _$ILCT$.$ILT$ReflectionDynamicInvoke$.InvokeRetV(Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean targetIsThisCall) at System.InvokeUtils.CalliIntrinsics.Call(IntPtr dynamicInvokeHelperMethod, Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean isTargetThisCall) at System.InvokeUtils.CallDynamicInvokeMethod(Object thisPtr, IntPtr methodToCall, Object thisPtrDynamicInvokeMethod, IntPtr dynamicInvokeHelperMethod, IntPtr dynamicInvokeHelperGenericDictionary, Object targetMethodOrDelegate, Object[] parameters, BinderBundle binderBundle, Boolean wrapInTargetInvocationException, Boolean invokeMethodHelperIsThisCall, Boolean methodToCallIsThisCall) in CallDynamicInvokeMethod:line 16707566 Build : Master - 20180412.02 (UWP ILC Tests) Failing configurations: - Windows.10.Amd64.ClientRS3-x64 - Release Details: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Filc~2F/build/20180412.02/workItem/System.Diagnostics.Process.Tests/analysis/xunit/System.Diagnostics.Tests.ProcessStartInfoTests~2FVerbs_GetWithSubkeys_ReturnsEmpty" 29054 area-System.Memory Added ReadOnlySequence Slice tests and fixed Slice bounds checking issues I added ReadOnlySequence Slice tests and fixed Slice bounds checking issues. 29055 area-System.Net Server WebSocket packet fragmentation error Found this while testing web socket server on Windows platform. Attached test project reproduces error on Widows platform, but worked on Linux. [WSTest.zip](https://github.com/dotnet/corefx/files/1902389/WSTest.zip) 29056 area-System.Diagnostics StackTrace's LineNumber and FileName is empty on net461 When running the following code: ``` StackFrame stackFrame = new StackTrace(true).GetFrames().Last(); var lineNumber = stackFrame.GetFileLineNumber(); var fileName = stackFrame.GetFileName(); ``` In the following target frameworks `<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>`: The line number and file name are empty when the target is net461, but when the target is netcoreapp2.0 the line number and file name have the correct values. 29057 area-System.Security Add support for secp256k1 corefx/src/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECCurve.NamedCurves.cs 29058 area-System.Memory I removed ReadOnlySequence common tests from factory tests I removed ReadOnlySequence common tests from factory tests. They are duplicates of comment tests and they does not use factory. 29059 area-System.Runtime "double.TryParse of ""0,12"" incorrectly returns true with result of 0.12." "When executing the following the return value is true (parsing succeeded) and the number value becomes 0.12: `double.TryParse(""0,12"", NumberStyles.Number, CultureInfo.GetCultureInfo(""en-US""), out number)` The input is not a valid US number since the comma proceeded by a zero and followed by only 2 digits. US numbers with a comma are only valid if the integer part is a 1 to 3 digits (but not a sequence of zero digits) followed by zero or more groups of 3 digits separated by commas. VisualStudio 2015 Version 14.0.25431.01 Update 3 Microsoft .NET Framework Version 4.7.02556 Build for x64 and .Net 4.5 Installed Version: Community" 29060 area-System.Reflection Proposed: Add `System.Reflection.NullReference` sentinel type. "# Proposed Surface Area ``` namespace System.Reflection { public sealed class NullReference { public static readonly NullReference Value = new NullReference(); } } ``` ## Purpose To be used as the return value when Reflection Invoke is used to invoke a method or property returning a `ref` and the method returns a null reference. Invoking ref-return methods is not supported at this time but we already an in-progress issue to make it supported (https://github.com/dotnet/corefx/issues/15960) Could also be used by existing Reflection Invoke api to pass null references as arguments. # Alternatives considered ### Return `Missing.Value` instead. Pros: Saves us a little surface area. Cons: This has received significant pushback from @vsadov: > Missing.Value is used for many other purposes. DLR and VB latebinders, for example use Missing.Value to propagate the fact that user did not pass a particular argument to expected optional parameters. > Returning Missing.Value in a case of a failure will lead to situations where it will be impossible to tell whether the invocation failed or succeeded and returned a Missing.Value. > Indeed, it is overloading a sentinel with a defined meaning (""caller chose not to supply optional parameter"") for something completely different. ### Throw `NullReferenceException` Pros: No ambiguity, for this particular api, this represents an attempt to dereference a null reference which is a programming error and there is precedent for `NullReferenceException` here. Cons: Reflection Invoke throws all programming error-related exception before invoking the target method. This would be a new precedent as the exception would be thrown after a successful call of the target method." 29061 area-System.Security FriendlyName not supported in Unix it might be worth to mention from the [Cross-Platoform Cryptography doc](https://github.com/dotnet/corefx/blob/master/Documentation/architecture/cross-platform-cryptography.md) that FriendlyName(s) are not supported in Unix. provided you try to use Friendly Names in Unix-based systems it will result in this: System.PlatformNotSupportedException : The FriendlyName value cannot be set on Unix. 29063 area-System.Net [Question] Give a timeout to async socket on .net core (linux) _From @316181444 on April 12, 2018 4:19_ How set a timeout for Socket.ConnectAsync, Socket.SendAsync, Socket.ReceveAsync APIs? Thanks. _Copied from original issue: dotnet/coreclr#17525_ 29064 area-System.Security SSlStream on OSX High Sierra throws AuthenticationException when certificate revocation checking is enabled and the server’s certificate extensions includes a CRL but not OCSP "**Overview** A .Net Core 2.0 application running on OSX High Sierra cannot connect to a server using SSLStream with certificate revocation checking enabled. The server’s certificate has extensions for CRLs but not OCSP. If one builds this application on Linux or Windows, the application will connect (to the same server) without any problems. Additionally, using the same certificate chain to host a web server via openssl s_server, Safari is able to connect on OSX without any problems. **Exception details** AuthenticationException message: Remote certificate is invalid according to the validation procedure. The sole X509ChainStatus in the X509Chain is on the leaf certificate: ""An incomplete certificate revocation check has occurred."" The corresponding Apple error code is errSecIncompleteCertRevocationCheck (-67635) (https://developer.apple.com/documentation/security/errsecincompletecertrevocationcheck). **Workaround** 1. If one can retarget the application to .NET Core 1.1 (which uses OpenSSL instead of the Apple Security Framework), the application will connect without problems. Note: the root certificate will have to be installed for OpenSSL. 2. An alternative is to disable certificate revocation checking in SSLStream, but this has security implications. **Interesting observations** 1. The Apple result code is listed under ""OCSP result code"" (https://developer.apple.com/documentation/security/1542001-security_framework_result_codes), and the certificates I was using did not support OCSP. 2. However, when connecting to a server ""B"" whose certificate chain did support OCSP as well as CRLs, I was able to connect without any problems. For completeness's sake, Server B's certificate also had the following X509v3 extensions that the first server ""A"" did not: X509v3 Subject Alternative Name, X509v3 Key Usage, X509v3 Extended Key Usage, X509v3 Certificate Policies, Authority Information Access, CT Precertificate SCTs. **Additional thoughts** I am admittedly a little uncertain if the problem is on Apple's end: i.e. the Apple Security Framework has additional restrictions (compared to CNG and OpenSSL) on what it considers to be a well-formed chain. My only hint that indicates otherwise is that that Safari is able to connect a webserver utilizing the same set of certificates. **Reproduction steps** Create a chain of certificates that mimics a certificate signed by DigiCert SHA2 Secure Server CA. The following are the steps I used: 1. Create a self-signed root CA such that ""X509v3 Key Usage: Digital Signature, Certificate Sign, CRL Sign"". 2. Generate a CRL for the root CA, taking care that the CRL does _not_ have a X509v3 Issuing Distribution Point. 3. Create an intermediate certificate authority with the same key usage as the root CA and with a X509v3 Issuing Distribution Point (IDP) pointing to the CRL generated in step 2. 4. Generate a CRL for the intermediate CA. This CRL should contain an X509v3 IDP. 5. Create the server certificate ""A"" signed by the intermediate CA. This certificate should have an X509v3 IDP that matches the CRL generated in step 4. 6. Install the root CA certificate. On OSX, I used Keychain Access, adding the certificate to the login keychain. (I also tried adding the certificate to the system keychain). 7. Host a test server using openssl s_server ""openssl s_server -port 44330 -key keyA.pem -cert certA.pem -CAfile intermediatecert.pem"" 8. Create a test app that connects to the OpenSSL s_server using SslStream, calling AuthenticateAsClient with checkCertificateRevocation: true. On Windows and Linux (after installing the root CA certificate), the test app will connect without any problems, whereas the application will fail to connect on OSX. However, as previously noted, if you use the same certificate to host a webserver (e.g. ""openssl s_server -port 44330 -key keyA.pem -cert certA.pem -CAfile intermediatecert.pem -www""), then Safari will be able to connect to that webserver without any problems. I have reproduced this with the app targeting .NET Core 2.0 as well as 2.1 preview, using .NET Core SDK 2.1.300-preview1-008174. This also occurs when using SDK 2.1.104 (targeting .NET Core 2.0 only). I've included my test app below for convenience: ```c# // Program.cs using System; using Ssl; namespace crl_test_app { class Program { static void Main(string[] args) { string serverCertificateName = ""tyche""; string machineName = ""tyche""; while (true) { Console.WriteLine(""Press enter to connect and send a message.""); Console.ReadLine(); Console.WriteLine(""Attempting to connect...""); SslTcpClient.RunClient(machineName, serverCertificateName); } } } } // Ssl.cs using System; using System.IO; using System.Linq; using System.Net.Security; using System.Net.Sockets; using System.Security.Authentication; using System.Security.Cryptography.X509Certificates; using System.Text; namespace Ssl { public class SslTcpClient { // Purely for debugging purposes, not needed public static bool ValidateServerCertificate( object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { var errors = chain.ChainStatus.Aggregate("""", (str, x) => str + "","" + x.Status); Console.WriteLine($""SslPolicyError: {sslPolicyErrors} {errors}""); foreach (var item in chain.ChainElements) foreach (var elemStatus in item.ChainElementStatus) Console.WriteLine(item.Certificate.Subject + ""->"" + elemStatus.StatusInformation); return true; } public static void RunClient(string machineName, string serverName) { var socket = new Socket(SocketType.Stream, ProtocolType.Tcp); socket.Connect(serverName, 44330); Console.WriteLine(""Client connected.""); using (var stream = new NetworkStream(socket)) { var sslStream = new SslStream(innerStream: stream, leaveInnerStreamOpen: false, userCertificateValidationCallback: ValidateServerCertificate); try { sslStream.AuthenticateAsClientAsync(serverName, new X509Certificate2Collection(), SslProtocols.Tls12, checkCertificateRevocation: true).GetAwaiter().GetResult(); } catch (AuthenticationException e) { Console.WriteLine(""Exception: {0}"", e.Message); if (e.InnerException != null) Console.WriteLine(""Inner exception: {0}"", e.InnerException.Message); Console.WriteLine(""Authentication failed - closing the connection.""); return; } var w = new StreamWriter(sslStream); w.WriteLine(""Hello from the client.""); w.Flush(); var serverMessage = ReadLine(new StreamReader(sslStream)); Console.WriteLine(""Server says: {0}"", serverMessage); Console.WriteLine(""Press enter to close the connection.""); Console.ReadLine(); } socket.Dispose(); Console.WriteLine(""Client closed.""); } static string ReadLine(StreamReader reader) => reader.ReadLine(); static void SendMessage(SslStream sslStream, string s=""Hello from the client."") => sslStream.Write(Encoding.UTF8.GetBytes(s)); } } ``` [edit: whitespace, typos] [EDIT] Add C# syntax highlighting by @karelz " 29065 area-System.Net Http Client performance drop in preview-2 "@rahul10992 commented on [Thu Apr 12 2018](https://github.com/dotnet/core/issues/1437) Hello. I was trying out HttpClient benchmarking for net core 2.1 and well, I am seeing a serious drop in the HttpClient provided in preview 2. for simple Get requests between 2 Windows Server 2016 VMs set up with network acceleration in Azure, 1. for Preview-1 with the ""AppContext.SetSwitch(""System.Net.Http.UseManagedHttpClientHandler"", true);"" I get 75,000 requests/second 2. For preview-2 using the SocketsHttpHandler, the performance drops to 43,000 requests/second Is there a reason for this performance drop? " 29067 area-System.Memory Build failures in 'prodcon/corefx/master/' - '20180411.05' @dotnet-mc-bot commented on [Wed Apr 11 2018](https://github.com/dotnet/core-eng/issues/3237) There were a set of failures during this build. Here is a summary of these: * https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_build?_a=summary&buildId=1582339 - **Agent:** DDVSOLINUXAGE010 - **Error log:** /root/corefx-1582339/Tools/ApiCompat.targets(0,0): error : MembersMustExist : Member 'System.Memory<T>..ctor(System.Buffers.MemoryManager<T>, System.Int32, System.Int32)' does not exist in the implementation but it does exist in t... * https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_build?_a=summary&buildId=1582341 - **Agent:** DDVSOLINUXAGE013 - **Error log:** /root/corefx-1582341/Tools/ApiCompat.targets(0,0): error : MembersMustExist : Member 'System.Memory<T>..ctor(System.Buffers.MemoryManager<T>, System.Int32, System.Int32)' does not exist in the implementation but it does exist in t... * https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_build?_a=summary&buildId=1582344 - **Agent:** DDVSOMACAGE008 - **Error log:** /Users/buildagent/agent/_work/0/s/corefx/Tools/ApiCompat.targets(0,0): error : MembersMustExist : Member 'System.Memory<T>..ctor(System.Buffers.MemoryManager<T>, System.Int32, System.Int32)' does not exist in the implementation bu... 29068 area-System.Security Build failures in 'official/corefx/release/2.0.0-msrc/' - '20180411.01' Test test test 29069 area-System.Numerics Suggestion: System.Math Performance improvement In Performance Critical code System.Math is lacking following operators. (Natively supported by Gcc and Visual studios C++ compiler but slow in C#) **Fused Multiply Add** ``` x * y + z //Not natively compiled by compiler to single Instruction Math.Fadd(x,y,z) //Math operator for that ``` **Fused Division and Modulus with ValueTuple** (Handy for 1D array with 2D indices) updated for Valuetuple which is faster than out + return. ``` //p.x = index / 3; //p.y = index % 3; var (x, y) = Math.DivRem(index,3) //ValueTuple<int, int>DivMod(int a, int b) ``` **Support for Float Square Root** (Very Handy and badly needed in 3d apps where we dont want to cast to double and back for a single sqrt) `float root = Math.Sqrt(float nr)` 29072 area-System.Memory Replaced ReadOnlySequence unsafe casting to safe casting in GetLength method Replaced ReadOnlySequence unsafe casting to safe casting in GetLength method. Part of https://github.com/dotnet/corefx/issues/28920 29073 area-Meta One more issue in ECMA-335 Hi! I found an issue in ECMA-335 and want to know how you deal with it. In III.3.6 bge.<length> section there are contradictory statements (https://www.ecma-international.org/publications/files/ECMA-ST/ECMA-335.pdf): > The effect is identical to performing a clt.un instruction followed by a brfalse target and > The effect of a “bge target” instruction is identical to: > * If stack operands are integers, then clt followed by a brfalse target > * If stack operands are floating-point, then clt.un followed by a brfalse target So there you can see a discrepancy in case of integer operands. Could you pls say me what did you do with this? I was going to submit a report to someone interested in it (probably not you) but can't find the right persons. cc: @tmat @nguerrera 29074 area-System.Diagnostics Mass spawning of processes slower than with mono "Continuing discussion from #26291 : I know it's in the enhancement department, but since I felt a significant difference testing mono and .Net Core I decided to time it. The following snip takes 15s vs 10s in .Net Core 2.1 preview 2 vs. mono 5.8.1 : ```c# var stopwatch = Stopwatch.StartNew(); for (int i = 0; i < 10000; i++) Process.Start(""echo"", i.ToString()); Console.WriteLine(""Took "" + stopwatch.Elapsed); ``` 33% slower launch times for processes seems significant to me. (I'm on Darwin. You know best if this concerns all *nix) [EDIT] Add C# syntax highlighting by @karelz" 29075 area-System.Net AwaitableSocketAsyncEventArgs: Strange error message Odd error message on Kestrel Ubuntu 16.04 Release Build CI https://github.com/aspnet/KestrelHttpServer/pull/2488#issuecomment-380946151 ``` RejectsConnectionsWhenLimitReached [FAIL] Failed RejectsConnectionsWhenLimitReached Error Message: System.IO.IOException : Unable to read data from the transport connection: Invalid argument. ---- System.Net.Sockets.SocketException : Invalid argument Stack Trace: at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error) at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.GetResult(Int16 token) at System.IO.StreamReader.ReadBufferAsync() at System.IO.StreamReader.ReadAsyncInternal(Memory`1 buffer, CancellationToken cancellationToken) at Microsoft.AspNetCore.Testing.TaskExtensions.TimeoutAfter[T](Task`1 task, TimeSpan timeout, String filePath, Int32 lineNumber) at Microsoft.AspNetCore.Testing.TestConnection.Receive(String[] lines) in /_/test/shared/TestConnection.cs:line 131 at Microsoft.AspNetCore.Server.Kestrel.FunctionalTests.ConnectionLimitTests.RejectsConnectionsWhenLimitReached() in /_/test/Kestrel.FunctionalTests/ConnectionLimitTests.cs:line 113 --- End of stack trace from previous location where exception was thrown --- ``` /cc @stephentoub 29076 area-System.Data Add tests for System.Data.Common.RowUpdatedEventArgs and RowUpdatingEventArgs I wanted to contribute something, so I tried to add some unit tests. I'll probably add more after this, but I want to know if what I'm doing is correct before continuing :) 29077 area-System.Memory Remove Memory.CreateFromPinnedArray from the ref assemblies Leftover cleanup that fixes https://github.com/dotnet/corefx/issues/28954 Depends on https://github.com/dotnet/coreclr/pull/17532 going in first (along with the mirror PR) for NETFX. Related PR: https://github.com/dotnet/corefx/pull/28992 29078 area-Meta Collapse leftover AsSpan().Slice(...) into AsSpan(...) Leftover from https://github.com/dotnet/corefx/issues/27330 Mainly updating usage pattern in tests. cc @tarekgh 29080 area-System.Net HttpClient.Post sends separate TCP packets for Header and Body "This is a general issue with .net I am assuming. Using Microsoft Message Analyzer, I can see that post data using the HttpClient is being sent in two tcp packets. One for the header, then one for the post body. This data could easily fit into one packet, however it is being split into two. I have explicitly turned on nagling and expect 100 continue off using the ServicePointManager, though, it doesn't seem to help. ``` public void TestRequest() { var uri = new Uri(""http://www.webscantest.com/""); ServicePointManager.Expect100Continue = false; ServicePointManager.UseNagleAlgorithm = true; var p = ServicePointManager.FindServicePoint(uri); p.Expect100Continue = false; p.UseNagleAlgorithm = true; HttpClient client = new HttpClient(); client.DefaultRequestHeaders.Add(""Connection"", ""close""); var values = new Dictionary<string, string> { { ""thing1"", ""hello"" }, { ""thing2"", ""world"" } }; var content = new FormUrlEncodedContent(values); var response = client.PostAsync(""http://www.webscantest.com/"", content, CancellationToken.None).Result; } ``` I raised this on [stackoverflow](https://stackoverflow.com/questions/49727720/c-sharp-httpclient-post-force-single-packet/49788340#49788340) and did some research to find the problem. " 29081 area-System.Net Address some SocketsHttpHandler feedback - We were using WriteAsciiStringAsync in one place we shouldn't have been. Change it to WriteStringAsync. - We were potentially overflowing in a multiplication on MaxResponseHeadersLength if it was set to a very large value. Changed it to use long multiplication and to cap the max length at int.MaxValue. - We were accidentally using DateTimeOffset.Now instead of UtcNow when getting the current time during stale pool removal. Change to UtcNow. - We had an unnecessary/unreachable catch block. Remove it. - In a race condition where the handler and thus its pool manager was disposed while the cleaning timer callback was in flight (either already queued or already running), we could potentially dispose of the timer and then the callback attempt to change the timer and incur an ObjectDisposedException that would go unhandled on a thread pool thread. One fix would be to track disposal under the same lock that's used to mutate the cleaning timer, but that incurs the cost of tracking disposal and taking a lock on disposal in order to deal with a rare race condition (that we've never actually seen happen). Instead, I opt to simply catch and eat any ODEs that occur. - If either of the connection lifetime values are set at 0, we avoid putting connections back into a pool and thus also avoid creating the cleaning timer. But we're still putting the created pool into the pools collection, which in theory in an extreme case could be a leak. The fix is simply to not store the pool into the pools in this case. cc: @GrabYourPitchforks, @geoffkizer, @davidsh 29084 area-System.Memory Re-enable test to use span in a fixed statement after we upgrade to C# 7.3 See https://github.com/dotnet/corefx/pull/29003 for details Requires a newer roslyn compiler as well (2.8.0-beta4-62810-06 or higher). 29085 area-System.Diagnostics .Net Core Process.Start on Linux "I am facing the following issue when running my .Net Core 2.0 application on Linux as a SCD. I am attempting to start another .Net Core project (Console Application) though the Aspnet Core project. The exception below is thrown when I call `Start()`. The permissions on the file and folders have been set to `777` but still no luck. Exception: ``` System.ComponentModel.Win32Exception (0x80004005): Permission denied at Interop.Sys.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Int32& lpChildPid, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd) at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at Ombi.Schedule.Jobs.Ombi.OmbiAutomaticUpdater.<Update>d__18.MoveNext() in C:\projects\requestplex\src\Ombi.Schedule\Jobs\Ombi\OmbiAutomaticUpdater.cs:line 218 ``` Code to reproduce: ``` var updaterFile = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), ""TempUpdate"", $""Ombi.Updater""); var start = new ProcessStartInfo { UseShellExecute = false, CreateNoWindow = true, FileName = updaterFile, Arguments = GetArgs(settings), // This just gets some command line arguments for the app i am attempting to launch WorkingDirectory = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), ""TempUpdate""), }; using (var proc = new Process { StartInfo = start }) { proc.Start(); } ```" 29087 area-System.Net Unhandled Exception: System.Net.Mail.SmtpException On Linux "***smtp ehlo*** ```sh $ telnet mail-proxy.mycompanydomain.com 25 Trying xx.xx.xx.xx... Connected to mail-proxy.mycompanydomain.com. Escape character is '^]'. 220 mail.mycompanydomain.com Microsoft ESMTP MAIL Service ready at Fri, 13 Apr 2018 17:52:12 +0800 EHLO 250-mail.mycompanydomain.com Hello [xx.xx.xx.xx] 250-SIZE 209715200 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-STARTTLS 250-AUTH GSSAPI NTLM LOGIN 250-8BITMIME 250-BINARYMIME 250 CHUNKING ``` ***Stacktrace*** ```txt Unhandled Exception: System.Net.Mail.SmtpException: Failure sending mail. ---> System.ComponentModel.Win32Exception: GSSAPI operation failed with error - An invalid status code was supplied (Cannot find KDC for realm ""mycompanydomain.com""). at System.Net.Security.NegotiateStreamPal.AcquireCredentialsHandle(String package, Boolean isServer, NetworkCredential credential) at System.Net.NTAuthentication.Initialize(Boolean isServer, String package, NetworkCredential credential, String spn, ContextFlagsPal requestedContextFlags, ChannelBinding channelBinding) at System.Net.Mail.SmtpNegotiateAuthenticationModule.Authenticate(String challenge, NetworkCredential credential, Object sessionCookie, String spn, ChannelBinding channelBindingToken) at System.Net.Mail.SmtpConnection.SetContextAndTryAuthenticate(ISmtpAuthenticationModule module, NetworkCredential credential, ContextAwareResult context) at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpClient.GetConnection() at System.Net.Mail.SmtpClient.Send(MailMessage message) --- End of inner exception stack trace --- at System.Net.Mail.SmtpClient.Send(MailMessage message) ``` ***dotnet --info*** ```sh $ dotnet --info .NET Command Line Tools (2.1.300-preview1-008174) Product Information: Version: 2.1.300-preview1-008174 Commit SHA-1 hash: b8df89a54f Runtime Environment: OS Name: debian OS Version: 9 OS Platform: Linux RID: linux-x64 Base Path: /usr/share/dotnet/sdk/2.1.300-preview1-008174/ Microsoft .NET Core Shared Framework Host Version : 2.1.0-preview1-26216-03 Build : f2c3216183d20416568a4bbf5bb7d153e826f153 ``` ***Program.cs*** ```cs using System; using System.Net; using System.Net.Mail; namespace ConsoleApp1 { class Program { static void Main(string[] args) { var host = ""mail-proxy.mycompanydomain.com""; var user = ""user@mycompanydomain.com""; var password = ""xxxxxxxxxxxxx""; var from = ""fromuser@mycompanydomain.com""; var to = ""touser@mycompanydomain.com""; var client = new SmtpClient(host, 25); client.UseDefaultCredentials = true; client.Credentials = new NetworkCredential(user, password); // client.Credentials = new NetworkCredential(user, password).GetCredential(host, 25, ""NLTM""); var msg = new MailMessage(from, to); msg.Subject = ""Hello 世界""; msg.Body = ""Hello World"" + DateTime.Now.ToString(); client.Send(msg); Console.WriteLine(""Hello World!""); } } } " 29088 area-System.Memory Replaced ReadOnlySequence unsafe casting to safe casting in Seek method Replaced ReadOnlySequence unsafe casting to safe casting in Seek method. Part of #28920 29089 area-System.Collections Microsoft.Windows.Compatibility breaks Dictionary binary deserialization I have .NET Core 2.0 project with following code: ```csharp public class Program { static void Main(string[] args) { using (var stream = new MemoryStream()) { var formatter = new BinaryFormatter(); formatter.Serialize(stream, new Dictionary<string, string>()); stream.Seek(0, SeekOrigin.Begin); formatter.Deserialize(stream); } } } ``` When run, it works fine. But when I add Microsoft.Windows.Compatibility as dependency, deserialization fails with exception: ``` Unhandled Exception: System.InvalidCastException: Object must implement IConvertible. at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider) at System.Runtime.Serialization.FormatterConverter.Convert(Object value, Type type) at System.Runtime.Serialization.SerializationInfo.GetValue(String name, Type type) at System.Collections.Generic.Dictionary`2.OnDeserialization(Object sender) at System.Runtime.Serialization.ObjectManager.RaiseDeserializationEvent() at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(BinaryParser serParser, Boolean fCheck) at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, Boolean check) at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream) at ConsoleApp1.Program.Main(String[] args) in C:\devel\core\ConsoleApp1\Program.cs:line 13 ``` Just added as dependency, not used for anything (yet). And breaks the deserialization of Dictionary<string,string>. I was able to narrow the package to Microsoft.Windows.Compatibility.Shims - add just this one as dependency and it breaks. 29091 area-System.Net Remap EBADF in SocketErrorPal.Unix.cs to OperationAborted "Due to the way async operations on Socket are implemented on Unix, it's possible that a socket file descriptor could be closed and subsequent calls to methods like recvmsg as part of the async operation could report EBADF, meaning ""The argument sockfd is an invalid descriptor."" As part of our PAL layer, we currently map this error to SocketError.InvalidArgument, as that's the most direct equivalent, but in practice since this only ever occurs when the socket file descriptor was valid and has been closed to become invalid, it's more logically associated with OperationAborted, with the operation having been effectively canceled due to the socket having been closed. This matters for two reasons: 1) the resulting error message is more informative to the developer to help track down the cause (""Invalid argument"" can be misleading), and 2) code in various places checks for OperationAborted as a signal of cancellation / socket closure and would end up missing these cases. This commit just updates that mapping. Fixes https://github.com/dotnet/corefx/issues/29075 Related to https://github.com/dotnet/corefx/issues/24677 cc: @tmds, @geoffkizer, @benaadams " 29093 area-System.Security Add private, parameterless constructor Most serializers require classes to have parameterless constructors. During de-serialization an empty class is created and then populated. By keeping the constructor private misuse should be minimal. 29094 area-System.Memory System.Memory APICompat issue Opened on behalf of @weshaggard Warnings: 1 Status Message: failed Build : ProdCon - Master - 20180413.02 (Product Build) Failing configurations: - Windows - AllConfigurations-x64 - uapaot-x86 - uapaot-x64 - uapaot-arm64 - uapaot-arm - uap-x86 - uap-x64 - uap-arm - netcoreapp-x86 - netcoreapp-x64 - netcoreapp-arm64 - netcoreapp-arm [Mission Control Build Info](https://mc.dot.net/#/product/netcore/prodconmaster/source/prodcon~2Fcorefx~2Fmaster~2F/type/build~2Fproduct~2F/build/20180413.02/workItem/Orchestration/analysis/external/Link) 29095 area-System.IO Directory.EnumerateDirectories doesn't return directory list on rhel7.2 _From @jainaashish on April 7, 2018 0:18_ I've created a simple application to demonstrate the issue where `Directory.EnumerateDirectories` api doesn't return the list of child directories on rhel 7.2, although it works fine on Windows or Ubuntu. Sample Project - https://github.com/jainaashish/CoreClrIssue/tree/master/EnumerateDirectoriesIssue/EnumerateDirectoriesIssue _Copied from original issue: dotnet/coreclr#17465_ 29096 area-Infrastructure Run docker commands in a container without a local filesystem mounted volume Fixes https://github.com/dotnet/core-eng/issues/2918 Note, It's possible that this could cause build failures if it's submitted before some manual agent cleanup occurs. ie, This change enables VSTS build agent cleanup, and that step will fail (Permission Denied) if it tries to cleanup any build which was run using the previous model. @weshaggard @mmitche I'd like to manually cleanup all the current Corefx builds off of the Linux agents before submitting this change. The alternative way to deal with this is to leave in the previous cleanup model (change permissions and then delete) for about a week after the rest of this change goes in and then transition to using VSTS's cleanup system. 29097 area-System.Net Sockets: dispatch sync op handling back to calling thread to avoid thread starvation Fixes #29029 This change ended up a little more involved than I'd hoped, unfortunately. The main change is to handling of queued sync operations. Instead of dispatching a threadpool item to process these, we instead signal the waiting thread to process the IO itself. This solves the starvation issue. Related to this, I also changed how cancellation for timeout on sync operations works. The problem was that if a sync operation timed out, we'd still leave its operation in the queue. So when we received a readiness notification, we'd try to signal the associated blocked thread -- but it would be no longer waiting because it timed out. Instead, actually remove the timed out item from the queue, and handle any queue state fixup necessary from this. @stephentoub @dotnet/ncl 29098 area-Infrastructure WIP Test tiered compilation in CI 29099 area-System.Runtime Fix default style argument to Double/Single/Decimal.Parse Copy-and-paste error while adding in the Span-based overload led to these having the wrong default style. This wasn't caught by tests because a) the existing string-based tests were using the wrong default style (probably also a copy-and-paste error) such that the relevant string-based overloads weren't actually being tested as thought, and b) that code wasn't added to the span-based tests anyway. I've fixed the ref, fixed the string-based tests, and copied/modified the tests for the span-based overloads as well. Fixes https://github.com/dotnet/coreclr/issues/17553 Related to https://github.com/dotnet/coreclr/pull/17556 cc: @jkotas 29100 area-System.Security Remove unused TestHelper.AsReadOnlySpan Missed one file from https://github.com/dotnet/corefx/pull/28962 29102 area-System.Runtime GC.RegisterForFullGCNotification requires spinning up a thread for events GC.RegisterForFullGCNotification, and the WaitForFullGCApproach/Complete APIs require spinning up a thread for tracking. It would be nice to have It would be nice to provide an API that doesn't require spinning up a new thread and holding onto it. Perhaps a callback that we fire back on a threadpool thread (or maybe even on the finalizer thread)? Such a thing would have potentially been useful in ArrayPool cleanup. cc: @vancem, @Maoni0 29103 area-Infrastructure Update CoreClr, CoreFx, CoreSetup, Standard to preview2-26406-07, preview2-26406-04, preview2-26406-04, servicing-26409-02, respectively (release/2.1) 29104 area-Infrastructure Adding begin/end to build definitions Continuation of this PR: https://github.com/dotnet/corefx/pull/28624 Related to this issue: https://github.com/dotnet/core-eng/issues/2964 29105 area-System.Net Add basic GET SocketsHttpHandler perf tests Tests for: - http vs https - connection: close vs keep-alive - chunked vs content-length response - various response lengths These are not meant to be end-to-end tests, just basic perf tests to help get a quick read on regressions and the like. cc: @geoffkizer, @wfurt, @davidsh Example output on my machine (with a bunch of other stuff going on, so don't pay too much attention to the numbers): System.Net.Http.Performance.Tests.dll | Metric | Unit | Iterations | Average | STDEV.S | Min | Max :--------------------------------------------------------------------------------------------------------------------------------------------- |:-------- |:----:|:----------:| --------:| -------:| --------:| --------: System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: False, connectionPerRequest: False, chunkedResponse: False, responseLength: 1) | Duration | msec | 100 | 83.455 | 6.179 | 74.239 | 128.440 System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: False, connectionPerRequest: False, chunkedResponse: False, responseLength: 100000) | Duration | msec | 21 | 491.563 | 43.112 | 421.577 | 592.187 System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: False, connectionPerRequest: False, chunkedResponse: True, responseLength: 1) | Duration | msec | 100 | 79.547 | 7.700 | 65.360 | 105.538 System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: False, connectionPerRequest: False, chunkedResponse: True, responseLength: 100000) | Duration | msec | 22 | 463.553 | 13.256 | 433.116 | 498.969 System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: False, connectionPerRequest: True, chunkedResponse: False, responseLength: 1) | Duration | msec | 18 | 586.871 | 63.070 | 489.314 | 719.751 System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: False, connectionPerRequest: True, chunkedResponse: False, responseLength: 100000) | Duration | msec | 7 | 1448.363 | 295.026 | 1220.242 | 2023.730 System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: False, connectionPerRequest: True, chunkedResponse: True, responseLength: 1) | Duration | msec | 18 | 560.555 | 50.207 | 472.637 | 671.757 System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: False, connectionPerRequest: True, chunkedResponse: True, responseLength: 100000) | Duration | msec | 8 | 1309.533 | 39.894 | 1257.887 | 1372.492 System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: True, connectionPerRequest: False, chunkedResponse: False, responseLength: 1) | Duration | msec | 78 | 128.654 | 25.640 | 101.723 | 248.124 System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: True, connectionPerRequest: False, chunkedResponse: False, responseLength: 100000) | Duration | msec | 19 | 530.344 | 13.028 | 504.011 | 556.610 System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: True, connectionPerRequest: False, chunkedResponse: True, responseLength: 1) | Duration | msec | 93 | 108.198 | 13.686 | 90.941 | 166.983 System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: True, connectionPerRequest: False, chunkedResponse: True, responseLength: 100000) | Duration | msec | 18 | 570.010 | 49.106 | 527.718 | 711.297 System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: True, connectionPerRequest: True, chunkedResponse: False, responseLength: 1) | Duration | msec | 3 | 3726.067 | 207.902 | 3553.084 | 3956.715 System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: True, connectionPerRequest: True, chunkedResponse: False, responseLength: 100000) | Duration | msec | 2 | 5714.703 | 577.583 | 5306.290 | 6123.116 System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: True, connectionPerRequest: True, chunkedResponse: True, responseLength: 1) | Duration | msec | 3 | 3467.903 | 34.445 | 3446.754 | 3507.649 System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: True, connectionPerRequest: True, chunkedResponse: True, responseLength: 100000) | Duration | msec | 3 | 4173.551 | 46.385 | 4122.404 | 4212.891 29106 area-Infrastructure [1.1] Misc linux fixes Makes some misc fixes to get the portable linux bootstrap CLI completely working on 1.1 29108 area-System.Memory IBufferWriter should have a Length property This should be return the amount of buffered bytes. I was thinking that it would be simple to add this to PipeWriter but we actually should have this on `IBufferWriter<T>`. It's required for writing out length prefixed protocols: ```C# public void WriteMessage(Message message, IBufferWriter<byte> output) { // Always a 4 byte length prefix Span<byte> prefix = output.GetSpan(); output.Advance(4); long oldLength = output.Length; // Write message to a buffer so we can get its length WriteMessageCore(message, output); long written = output.Length - oldLength; // Fill in the length prefix afterwards BinaryPrimitives.WriteInt32BigEndian(prefix, (int)written); } ``` /cc @KrzysztofCwalina @pakrym 29109 area-System.Memory Removed unsafe casting in ReadOnlySequence TryGetXXX methods Removed unsafe casting in ReadOnlySequence TryGetXXX methods. Part of #28920 29110 area-System.Net SslStream LocalCertificateSelectionCallback The LocalCertificateSelectionCallback of SslStream is not called anymore on .Net Core 2.1 Preview. I looked in the code and it seems someone was trying to replace it with another callback but didn't finish the implementation. We need this for SNI, please fix this for the release. 29111 area-System.Linq Extend ICollection<T> and IList<T> handling in LINQ All/Any/First methods 29113 area-Infrastructure Windows builds should always be portable See dotnet/coreclr#17533. 29114 area-System.Memory Added unsafe casting for ReadOnlyMemory<char> in ReadOnlySequence Small performance suggestion. 29115 area-System.Memory Remove != and == from SequencePosition https://github.com/dotnet/corefx/issues/29001 29116 area-System.Runtime Binary serialization exceptions should help debugging by mentioning type / member information The following exception does not identify which type / member it's referring to, forcing the user to either debug and forage through `System.TypedReference.MakeTypedReference` or to manually walk the object graph in search of the offending type. ``` System.ArgumentException : Field in TypedReferences cannot be static or init only. at System.TypedReference.MakeTypedReference(Object target, FieldInfo[] flds) at System.Runtime.Serialization.ObjectManager.DoValueTypeFixup(FieldInfo memberToFix, ObjectHolder holder, Object value) at System.Runtime.Serialization.ObjectManager.CompleteObject(ObjectHolder holder, Boolean bObjectFullyComplete) at System.Runtime.Serialization.ObjectManager.DoNewlyRegisteredObjectFixups(ObjectHolder holder) at System.Runtime.Serialization.ObjectManager.RegisterObject(Object obj, Int64 objectID, SerializationInfo info, Int64 idOfContainingObj, MemberInfo member, Int32[] arrayIndex) at System.Runtime.Serialization.Formatters.Binary.ObjectReader.RegisterObject(Object obj, ParseRecord pr, ParseRecord objectPr, Boolean bIsString) at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ParseObjectEnd(ParseRecord pr) at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run() at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream) ``` 29117 area-System.Net Add test for socket sync-over-async thread usage To help validate that synchronous operations aren't requiring a secondary thread pool thread. Contributes to https://github.com/dotnet/corefx/issues/29029 cc: @geoffkizer 29118 area-System.Net Outbound connections time out with new managed sockets When upgrading from 2.1 preview 1 to preview 2, all of a sudden all the outbound calls from my asp.net core app (except Azure SQL calls for some reason) seem to hang and eventually timeout. I'm seeing this behavior with both an HttpClient and using the latest Azure Storage SDK. Based on the release notes, I suspected it's due to the switch to managed sockets and confirmed this by setting `DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER` to 0 and noticing the calls working again. I'm running on Azure App Services using self-contained deployment. 29119 area-System.Memory Add unmanaged constraint to MemoryMarshal.Cast With C# 7.3 there's now the [unmanaged generic constraint](https://github.com/dotnet/csharplang/blob/master/proposals/csharp-7.3/blittable.md) and it looks like it should be applied to [MemoryMarshal.Cast](https://github.com/dotnet/corefx/blob/27149e4a86ba5827229b8294f1dd19f3f7d58184/src/Common/src/CoreLib/System/Runtime/InteropServices/MemoryMarshal.Fast.cs#L115-L116) before that becomes a breaking change 29120 area-System.Runtime ApiProposal: string.Create method which takes an additional Span as data parameter "With the new ``Span<>`` based Apis an additional method to create strings was added which takes the length and an action + state as parameter to allow alloc-free modification of the string based on the action. The signature is: ```csharp public static string Create<TState>(int length, TState state, SpanAction<char, TState> action) ``` An example of the usage is in @stephentoub's article https://msdn.microsoft.com/en-us/magazine/mt814808.aspx I propose an additional method taking a ``ReadonlySpan<char>`` as parameter to be able to populate the new string more easily. It is currently not possible to use a custom TState with ``ReadOnlySpan<char>`` as a field, because such byref structs can't be type parameters, so the current method does not solve the problem. **Rationale and Usage** With span it is easy to create a substring and trim and such apis are included with ``Span``. Sometimes it might be useful to simply remove certain characters from a string, where you know the new length of the string in advance. One example is unescaping data, see the code snippet below for usage, the new length of the string can be easily calculated in advance, so a fixed size buffer is enough. **Proposed API** ```csharp public delegate void SpanDataAction<T, in TArg>(Span<T> span, in ReadOnlySpan<T> data, TArg arg); public static string Create<TState>(int length, in ReadOnlySpan<char> data, TState state, SpanDataAction<char, TState> action); ``` The new delegate is necessary to be able to use the data in the action. **Example usage** A shortened example of how to unescape a possible JSON span, in this example state is not used, but I imagine that State will be equally useful as in the original string.Create, so it is included in the proposal. ```csharp ReadOnlySpan<char> data = ""Hello\\nWorld""; // escaped newline int length = data.Length - 1; var output = Create(length, data, new State(), delegate(Span<char> span, in ReadOnlySpan<char> input, State state) { var counter = 0; for (int i = 0; i < input.Length; i++) { var c = input[i]; if (c == '\\') { i++; c = input[i]; switch (c) { case 'n': c = '\n'; break; } } span[counter++] = c; } }); private readonly struct State {} ``` **Proposed Implementation** Modified from the existing string.Create ```csharp public static string Create<TState>(int length, in ReadOnlySpan<char> data, TState state, SpanDataAction<char, TState> action) { if (action == null) throw new ArgumentNullException(nameof(action)); if (length <= 0) { if (length == 0) return string.Empty; throw new ArgumentOutOfRangeException(nameof(length)); } //Span<char> span = stackalloc char[length]; //action(span, data, state); //return span.ToString(); string result = FastAllocateString(length); action(new Span<char>(ref result.GetRawStringData(), length), data, state); return result; } ``` **Impact** Currently, as to my knowledge, you need to use either unsafe pointer logic and/or Unsafe.Write methods to replace the existing chars in the string. **Open Questions** * Better name for the delegate * Better workarounds than unsafe logic? " 29121 area-System.ComponentModel Added AssociatedMetadataTypeTypeDescriptionProvider & MetadataTypeAttribute to C.CM.DA #22469 #16101 Let me know if any change is required. Thanks for your efforts (-: 29122 area-System.Reflection How can I use the APIs in the System.Reflection.Metadata namespace? Hi! I'm developing a programming language of my own using the expression tree API and want to debug programs written in Expresso(which is the name of the programming language) in VS Code. To do that, I need to first generate *PDB/MDB* files and I found and heard that one can generate Portable PDB files by using APIs from the `System.Reflection.Metadata` namespace. But I just can't find any documentations on or about it, nor source codes that apparently use them. So, is here the right place to ask it? If so, would you mind if I ask how to use the APIs? 29123 area-System.Diagnostics Exception when launching a process On 2.1 preview 2 built for linux-arm (raspbian jessie), I get this after a few hours of spawning and exiting processes. ``` System.ArgumentException: An item with the same key has already been added. Key: 29932 at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, Insertion Behavior behavior) at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) at System.Diagnostics.ProcessWaitState.AddRef(Int32 processId, Boolean isNewChild) at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at System.Diagnostics.Process.Start(ProcessStartInfo startInfo) ``` It's just a guess, but could it be the dictionary is not properly reaped before a new process reuses the pid ? 29124 area-System.Drawing System.Drawing / Vector conversion? Just pointing out that I think it would be a fantastic idea to implement implicit conversion to and from things like PointF, RectangleF to Vector2 and Vector4. 29127 area-System.Net Failed SslStream assert in new HttpClient perf tests on Unix This appears to be happening consistently across all distros/versions, Linux and macOS. ``` 2018-04-15 12:54:25,475: INFO: proc(54): run_and_log_output: Output: Assertion Failed 2018-04-15 12:54:25,475: INFO: proc(54): run_and_log_output: Output: 2018-04-15 12:54:25,476: INFO: proc(54): run_and_log_output: Output: at System.Net.Security.SslStreamInternal.ResetReadBuffer() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_true_prtest/src/System.Net.Security/src/System/Net/Security/SslStreamInternal.cs:line 185 2018-04-15 12:54:25,476: INFO: proc(54): run_and_log_output: Output: at System.Net.Security.SslStreamInternal.ReadAsyncInternal[TReadAdapter](TReadAdapter adapter, Memory`1 buffer) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_true_prtest/src/System.Net.Security/src/System/Net/Security/SslStreamInternal.cs:line 256 2018-04-15 12:54:25,476: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /Users/buildagent/agent/_work/147/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 930 2018-04-15 12:54:25,476: INFO: proc(54): run_and_log_output: Output: at System.Net.Security.SslStreamInternal.ReadAsyncInternal[TReadAdapter](TReadAdapter adapter, Memory`1 buffer) 2018-04-15 12:54:25,477: INFO: proc(54): run_and_log_output: Output: at System.Net.Security.SslStreamInternal.ReadAsync(Memory`1 buffer, CancellationToken cancellationToken) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_true_prtest/src/System.Net.Security/src/System/Net/Security/SslStreamInternal.cs:line 158 2018-04-15 12:54:25,477: INFO: proc(54): run_and_log_output: Output: at System.Net.Security.SslStream.ReadAsync(Memory`1 buffer, CancellationToken cancellationToken) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_true_prtest/src/System.Net.Security/src/System/Net/Security/SslStream.cs:line 739 2018-04-15 12:54:25,477: INFO: proc(54): run_and_log_output: Output: at System.IO.StreamReader.ReadBufferAsync() in /Users/buildagent/agent/_work/147/s/src/mscorlib/shared/System/IO/StreamReader.cs:line 1328 2018-04-15 12:54:25,478: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /Users/buildagent/agent/_work/147/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 930 2018-04-15 12:54:25,478: INFO: proc(54): run_and_log_output: Output: at System.IO.StreamReader.ReadBufferAsync() 2018-04-15 12:54:25,478: INFO: proc(54): run_and_log_output: Output: at System.IO.StreamReader.ReadLineAsyncInternal() in /Users/buildagent/agent/_work/147/s/src/mscorlib/shared/System/IO/StreamReader.cs:line 888 2018-04-15 12:54:25,478: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /Users/buildagent/agent/_work/147/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 930 2018-04-15 12:54:25,479: INFO: proc(54): run_and_log_output: Output: at System.IO.StreamReader.ReadLineAsyncInternal() 2018-04-15 12:54:25,479: INFO: proc(54): run_and_log_output: Output: at System.IO.StreamReader.ReadLineAsync() in /Users/buildagent/agent/_work/147/s/src/mscorlib/shared/System/IO/StreamReader.cs:line 878 2018-04-15 12:54:25,479: INFO: proc(54): run_and_log_output: Output: at System.Net.Http.Tests.SocketsHttpHandlerPerfTest.<>c__DisplayClass2_3.<<Get>b__0>d.MoveNext() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_true_prtest/src/System.Net.Http/tests/Performance/Perf.SocketsHttpHandler.cs:line 68 2018-04-15 12:54:25,479: INFO: proc(54): run_and_log_output: Output: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /Users/buildagent/agent/_work/147/s/src/mscorlib/shared/System/Threading/ExecutionContext.cs:line 167 2018-04-15 12:54:25,480: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext() in /Users/buildagent/agent/_work/147/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 559 2018-04-15 12:54:25,480: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(IAsyncStateMachineBox box, Boolean allowInlining) in /Users/buildagent/agent/_work/147/s/src/mscorlib/src/System/Threading/Tasks/TaskContinuation.cs:line 798 2018-04-15 12:54:25,480: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.Task.RunContinuations(Object continuationObject) in /Users/buildagent/agent/_work/147/s/src/mscorlib/src/System/Threading/Tasks/Task.cs:line 3275 2018-04-15 12:54:25,481: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.Task`1.TrySetResult(TResult result) in /Users/buildagent/agent/_work/147/s/src/mscorlib/src/System/Threading/Tasks/future.cs:line 421 2018-04-15 12:54:25,481: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetExistingTaskResult(TResult result) in /Users/buildagent/agent/_work/147/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 639 2018-04-15 12:54:25,481: INFO: proc(54): run_and_log_output: Output: at System.IO.StreamReader.ReadLineAsyncInternal() in /Users/buildagent/agent/_work/147/s/src/mscorlib/shared/System/IO/StreamReader.cs:line 948 2018-04-15 12:54:25,481: INFO: proc(54): run_and_log_output: Output: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /Users/buildagent/agent/_work/147/s/src/mscorlib/shared/System/Threading/ExecutionContext.cs:line 167 2018-04-15 12:54:25,482: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext() in /Users/buildagent/agent/_work/147/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 559 2018-04-15 12:54:25,482: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(IAsyncStateMachineBox box, Boolean allowInlining) in /Users/buildagent/agent/_work/147/s/src/mscorlib/src/System/Threading/Tasks/TaskContinuation.cs:line 798 2018-04-15 12:54:25,482: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.Task.RunContinuations(Object continuationObject) in /Users/buildagent/agent/_work/147/s/src/mscorlib/src/System/Threading/Tasks/Task.cs:line 3275 2018-04-15 12:54:25,482: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.Task`1.TrySetResult(TResult result) in /Users/buildagent/agent/_work/147/s/src/mscorlib/src/System/Threading/Tasks/future.cs:line 421 2018-04-15 12:54:25,483: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetExistingTaskResult(TResult result) in /Users/buildagent/agent/_work/147/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 639 2018-04-15 12:54:25,483: INFO: proc(54): run_and_log_output: Output: at System.IO.StreamReader.ReadBufferAsync() in /Users/buildagent/agent/_work/147/s/src/mscorlib/shared/System/IO/StreamReader.cs:line 1361 2018-04-15 12:54:25,483: INFO: proc(54): run_and_log_output: Output: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /Users/buildagent/agent/_work/147/s/src/mscorlib/shared/System/Threading/ExecutionContext.cs:line 167 2018-04-15 12:54:25,483: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext() in /Users/buildagent/agent/_work/147/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 559 2018-04-15 12:54:25,484: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(IAsyncStateMachineBox box, Boolean allowInlining) in /Users/buildagent/agent/_work/147/s/src/mscorlib/src/System/Threading/Tasks/TaskContinuation.cs:line 798 2018-04-15 12:54:25,484: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.Task.RunContinuations(Object continuationObject) in /Users/buildagent/agent/_work/147/s/src/mscorlib/src/System/Threading/Tasks/Task.cs:line 3275 2018-04-15 12:54:25,484: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.Task`1.TrySetResult(TResult result) in /Users/buildagent/agent/_work/147/s/src/mscorlib/src/System/Threading/Tasks/future.cs:line 421 2018-04-15 12:54:25,485: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetExistingTaskResult(TResult result) in /Users/buildagent/agent/_work/147/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 639 2018-04-15 12:54:25,485: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder`1.SetResult(TResult result) in /Users/buildagent/agent/_work/147/s/src/mscorlib/shared/System/Runtime/CompilerServices/AsyncValueTaskMethodBuilder.cs:line 169 2018-04-15 12:54:25,485: INFO: proc(54): run_and_log_output: Output: at System.Net.Security.SslStreamInternal.ReadAsyncInternal[TReadAdapter](TReadAdapter adapter, Memory`1 buffer) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_true_prtest/src/System.Net.Security/src/System/Net/Security/SslStreamInternal.cs:line 339 2018-04-15 12:54:25,486: INFO: proc(54): run_and_log_output: Output: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /Users/buildagent/agent/_work/147/s/src/mscorlib/shared/System/Threading/ExecutionContext.cs:line 167 2018-04-15 12:54:25,486: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext() in /Users/buildagent/agent/_work/147/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 559 2018-04-15 12:54:25,486: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(IAsyncStateMachineBox box, Boolean allowInlining) in /Users/buildagent/agent/_work/147/s/src/mscorlib/src/System/Threading/Tasks/TaskContinuation.cs:line 798 2018-04-15 12:54:25,487: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.Task.RunContinuations(Object continuationObject) in /Users/buildagent/agent/_work/147/s/src/mscorlib/src/System/Threading/Tasks/Task.cs:line 3275 2018-04-15 12:54:25,487: INFO: proc(54): run_and_log_output: Output: at System.Threading.Tasks.Task`1.TrySetResult(TResult result) in /Users/buildagent/agent/_work/147/s/src/mscorlib/src/System/Threading/Tasks/future.cs:line 421 2018-04-15 12:54:25,487: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetExistingTaskResult(TResult result) in /Users/buildagent/agent/_work/147/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 639 2018-04-15 12:54:25,487: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetResult(TResult result) in /Users/buildagent/agent/_work/147/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 629 2018-04-15 12:54:25,488: INFO: proc(54): run_and_log_output: Output: at System.Net.Security.SslStreamInternal.<FillBufferAsync>g__InternalFillBufferAsync|38_0[TReadAdapter](TReadAdapter adap, ValueTask`1 task, Int32 min, Int32 initial) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_true_prtest/src/System.Net.Security/src/System/Net/Security/SslStreamInternal.cs:line 516 2018-04-15 12:54:25,488: INFO: proc(54): run_and_log_output: Output: at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /Users/buildagent/agent/_work/147/s/src/mscorlib/shared/System/Threading/ExecutionContext.cs:line 167 2018-04-15 12:54:25,488: INFO: proc(54): run_and_log_output: Output: at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext() in /Users/buildagent/agent/_work/147/s/src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs:line 559 2018-04-15 12:54:25,489: INFO: proc(54): run_and_log_output: Output: at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.InvokeContinuation(Action`1 continuation, Object state, Boolean forceAsync) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_true_prtest/src/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs:line 1038 2018-04-15 12:54:25,489: INFO: proc(54): run_and_log_output: Output: at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.OnCompleted(SocketAsyncEventArgs _) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_true_prtest/src/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs:line 869 2018-04-15 12:54:25,490: INFO: proc(54): run_and_log_output: Output: at System.Net.Sockets.SocketAsyncEventArgs.FinishOperationAsyncSuccess(Int32 bytesTransferred, SocketFlags flags) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_true_prtest/src/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEventArgs.cs:line 780 2018-04-15 12:54:25,490: INFO: proc(54): run_and_log_output: Output: at System.Net.Sockets.SocketAsyncEventArgs.CompletionCallback(Int32 bytesTransferred, SocketFlags flags, SocketError socketError) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_true_prtest/src/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEventArgs.Unix.cs:line 402 2018-04-15 12:54:25,491: INFO: proc(54): run_and_log_output: Output: at System.Net.Sockets.SocketAsyncEventArgs.TransferCompletionCallbackCore(Int32 bytesTransferred, Byte[] socketAddress, Int32 socketAddressSize, SocketFlags receivedFlags, SocketError socketError) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_true_prtest/src/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEventArgs.Unix.cs:line 121 2018-04-15 12:54:25,491: INFO: proc(54): run_and_log_output: Output: at System.Net.Sockets.SocketAsyncContext.BufferMemoryReceiveOperation.InvokeCallback(Boolean allowPooling) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_true_prtest/src/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncContext.Unix.cs:line 463 2018-04-15 12:54:25,491: INFO: proc(54): run_and_log_output: Output: at System.Net.Sockets.SocketAsyncContext.OperationQueue`1.ProcessAsyncOperation(TOperation op) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_true_prtest/src/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncContext.Unix.cs:line 853 2018-04-15 12:54:25,492: INFO: proc(54): run_and_log_output: Output: at System.Net.Sockets.SocketAsyncContext.OperationQueue`1.<>c.<.cctor>b__18_0(Object op) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_true_prtest/src/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncContext.Unix.cs:line 697 2018-04-15 12:54:25,492: INFO: proc(54): run_and_log_output: Output: at System.Threading.ThreadPoolWorkQueue.Dispatch() in /Users/buildagent/agent/_work/147/s/src/mscorlib/src/System/Threading/ThreadPool.cs:line 588 ``` 29129 area-System.IO FileStream.Windows useAsync WriteAsync calls blocking apis e.g SetEndOfFile in the async path is 50% of the time and it doesn't need to be called (as WriteFile will expand the File). SetEndOfFile is also a blocking api itself; so expanding the file using it blocks the thread for as much time (or more) as the async saves blocking. --- Previous Seen in https://github.com/electricessence/AsyncFileWriter/pull/1 (Windows 10; netcoreapp2.0 and netcoreapp2.1) Non-async (just for `FileStream.Write`) ``` AsyncFileWriterTester>dotnet run -c Release 100,000 bounded capacity. Total Time: 2.3680831 seconds Total Bytes: 115,888,890 Total Wait Time: 00:00:02.6254878 ------------------------ 10,000 bounded capacity. Total Time: 2.0399536 seconds Total Bytes: 115,888,890 Total Wait Time: 00:00:02.3390593 ------------------------ 1,000 bounded capacity. Total Time: 2.1499109 seconds Total Bytes: 115,888,890 Total Wait Time: 00:00:02.3699012 ------------------------ 100 bounded capacity. Total Time: 2.0656293 seconds Total Bytes: 115,888,890 Total Wait Time: 00:00:03.0224013 ------------------------ Press ENTER to continue. ``` Making the change https://github.com/electricessence/AsyncFileWriter/commit/752f7efd40b560ff40b13bd387466d9e298db343 `useAsync = true` and `fs.Write(` => `await fs.WriteAsync(` Causes a dramatic slow down: ``` AsyncFileWriterTester>dotnet run -c Release 100,000 bounded capacity. Total Time: 4.1238278 seconds Total Bytes: 115,888,890 Total Wait Time: 00:00:14.3291113 ------------------------ 10,000 bounded capacity. Total Time: 4.370184 seconds Total Bytes: 115,888,890 Total Wait Time: 00:00:19.3693952 ------------------------ 1,000 bounded capacity. Total Time: 4.1362524 seconds Total Bytes: 115,888,890 Total Wait Time: 00:00:19.0104628 ------------------------ 100 bounded capacity. Total Time: 4.2608508 seconds Total Bytes: 115,888,890 Total Wait Time: 00:00:20.4615956 ------------------------ Press ENTER to continue. ``` Seems to use a lot of threads, though maybe that's Channels 29130 area-System.Net Fix nestedRead tracking in SslStreamInternal.ReadAsyncInternal _nestedRead is getting reset back to 0 at the end of an iteration of the loop, but it may be looping back around again to do more reading. If we're going to try to protect against concurrent reads, we should at least do it right :) cc: @Drawaes, @geoffkizer, @davidsh 29131 area-System.Net Delete faulty assert in SslStreamInternal We're hitting an assert when a ReadAsync call is made on SslStream after the underlying stream encounters EOF. When calling FillBufferAsync, we've already allocated the read buffer, and we may not have any data in the buffer; if we then hit EOF, we've still not got any data in the buffer and we return. Then when ReadAsync is called again, the assert trips over the buffer being allocated and also being empty. The fix is to call ReturnReadBufferIfEmpty when we hit EOF, so that we promptly free the buffer. But I'm also deleting the failing assert, as it seems like we could hit this in other situations as well. Fixes https://github.com/dotnet/corefx/issues/29127 cc: @geoffkizer, @Drawaes, @davidsh 29132 area-System.Net change sync timeout handling back to use actual sync timeouts Fixes #29040 We made a change in 2.1 (#22588) to force sync operations with timeout to go through the sync-over-async path. This caused a nontrivial perf hit. This change reverts (mostly) the previous change and fixes the original issue by checking explicitly for blocking mode and not retrying when a timeout is exceeded. Also, remove timeout handling from accept and connect operations since it is never used. @stephentoub @dotnet/ncl 29133 area-System.Memory Update the ReadOnlySequence Slice performance tests to only measure the Slice method cc @pakrym, @AlexRadch 29134 area-System.Memory Marshaling of Default and Empty ReadOnlySequence Early ReadOnlySequences works incorrect with default value. Now it is fixed except marshaling methods. Now if we try to marshal Default ROS it will be converted to Default ReadOnlyMemory. But if we try to create ROS for default ReadOnlyMemory then Empty ROS will be created. So marshaling change Default ROS to Empty ROS. Is it issue? If we try to marshal Empty ROS it can be marshaled and ArraySegment or ReadOnlyMemory with length equal to 0. And if we create ROS for ArraySegment or ReadOnlyMemory then Empty ROS will be created. So both ways are correct. 29135 area-System.Memory Attempt at winning back performance regression from additional checks in ReadOnlySequence.Slice Builds on top of the changes in https://github.com/dotnet/corefx/pull/29054 (which added necessary bounds checks/input validation and tests). Focus on optimization to win back **most** of the performance regression. We are now **actually faster** than what was in master previously in almost all cases (by up to 15%). The major outliers which still regressed are: ```C# Slice(SequencePosition start); // only for multi segment sequence Slice(SequencePosition start, SequencePosition end); // only for multi segment sequence ``` This is predominantly because _correct_ bounds checking for multi-segment sequences is inherently more complex. There may still be some room for clever tricks here. Using the performance tests from https://github.com/dotnet/corefx/pull/29133:  Also includes changes from https://github.com/dotnet/corefx/pull/29072 / https://github.com/dotnet/corefx/pull/29088 cc @pakrym, @AlexRadch, @KrzysztofCwalina, @davidfowl 29136 area-System.Memory Add comments clarifying the logc in ReadOnlySequence GetFirstBuffer See https://github.com/dotnet/corefx/pull/29051#discussion_r181122012 for context 29137 area-System.Memory Update xml comment for {ReadOnly}Memory.Pin method See https://github.com/dotnet/coreclr/pull/17269#discussion_r177602812 for context. This will need to get mirrored to coreclr (cc @Anipik) 29138 area-System.Runtime Update ApiCompatBaseline for uap and uapaot for System.Runtime cc @jkotas, @weshaggard 29139 area-System.Data SqlClient UDT support needs an assembly-plugin model I built a .NET Standard implementation of the `Microsoft.SqlServer.Types` classes. This works great for insertion, but when deserializing I'll get an exception like this:  Instead I have to write something like: ```cs var binvalue = reader.GetSqlBytes(rowid); var g = SqlGeometry.Deserialize(binvalue); ``` This makes sense, because SqlClient has no idea I provided an implementation it could use. Assembly redirect only works for assemblies with the same name and public key, so that's not really an option. How do we across all the different platforms allow us to use UDT in assemblies defined on each platform, and get the SqlClient to import the types? The issue is somewhat called out in the doc: > SqlClient may fail to load a UDT in the event of mismatched UDT versions or other problems. [(1)](https://docs.microsoft.com/en-us/sql/relational-databases/clr-integration-database-objects-user-defined-types/accessing-user-defined-types-retrieving-udt-data?view=sql-server-2017) > A local copy of the UDT assembly must be available to the client project. [(2)](https://docs.microsoft.com/en-us/sql/relational-databases/clr-integration-database-objects-user-defined-types/accessing-user-defined-types-retrieving-udt-data?view=sql-server-2017#using-udts-in-query-parameters) > The assembly loaded in SQL Server and the assembly on the client must be compatible in order for the UDT to be created on the client. For UDTs defined with the Native serialization format, the assemblies must be structurally compatible. For assemblies defined with the UserDefined format, the assembly must be available on the client. > You do not need a copy of the UDT assembly on the client in order to retrieve the raw data from a UDT column in a table. [(3)](https://docs.microsoft.com/en-us/sql/relational-databases/clr-integration-database-objects-user-defined-types/accessing-user-defined-types-retrieving-udt-data?view=sql-server-2017#requirements-for-using-udts-in-adonet) > In some situations, you may want to retrieve the raw data from the UDT column. Perhaps the type is not available locally [(4)](https://docs.microsoft.com/en-us/sql/relational-databases/clr-integration-database-objects-user-defined-types/accessing-user-defined-types-retrieving-udt-data?view=sql-server-2017#binding-udts-as-bytes) > [Warning about client side usage of GEOMETRY, GEOGRAPHY and HIERARCHYID](https://msdn.microsoft.com/en-us/library/dn236441(v=sql.120).aspx) A .NET Standard Implementation of the geometry types for reference which can be used as an example (just tweak unit tests to call `GetValue` instead of `GetSqlBytes` on the data reader): https://github.com/dotMorten/Microsoft.SqlServer.Types/blob/89c5e6158867d9603d93fde6286a0f32f01fa96d/src/Microsoft.SqlServer.Types.Tests/DBTests.cs#L81 29142 area-System.Memory Fixed ReadOnlySequence Slice performance tests I fixed ReadOnlySequence Slice tests. Now it tests slicing with different positions and lengths. But positions are prepared before measurements. Also I added generator with requested number of segments. Using it I added tests for sequences with 10 and 100 segments. 29143 area-Meta .net core dll as a reference behaves differently from .net "create a .net standard dll , name it as Paas dll, and change the output path ..\Output\ add a class logger like below- ```c# public class Logger { public void LogMessage() { Console.Write(""test""); } } ``` Now create another .net core console project in solution and add dll as a refrence ( not project refrence) for pass.dll and make copy local to false. Also change output directory of console app to ..\Output\ add below code in console app - ```c# var logger = new Logger(); logger.LogMessage(); Console.Read(); ``` Build and run .net core app, but now application goes in break mode with below error ``` Could not load file or assembly 'Paas, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified. ``` But if you perform same steps with .net framework 4.6.1 projects it works, why this different behavior with .net core exists and how to fix it? Github project for more clarity - https://github.com/ankgupta067/DependencyInjection [EDIT] Change code & exception formatting by @karelz" 29144 area-Infrastructure NuGet build failures in 'prodcon/corefx/master/' - '20180416.01' @dotnet-mc-bot commented on [Sun Apr 15 2018](https://github.com/dotnet/core-eng/issues/3292) There were a set of failures during this build. Here is a summary of these: * https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_build?_a=summary&buildId=1594896 - **Agent:** DDVSOLINUXAGE007 - **Error log:** /root/corefx-1594896/external/runtime/runtime.depproj : error NU1102: - Found 414 version(s) in https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json [ Nearest version: 2.1.0-preview3-26416-01 ]... @mmitche 29147 area-System.Data SqlConnection.Open() throws System.InvalidOperationException: Internal connection fatal error on alpine I get the error below when connecting to a SQL Server 2008R2 using the microsoft/dotnet:2.1.0-preview2-runtime-alpine docker image, but it works fine with microsoft/dotnet:2.1.0-preview2-runtime. ``` System.InvalidOperationException: Internal connection fatal error. at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) at System.Data.SqlClient.SqlConnection.Open() [...my code..] System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) at System.Data.SqlClient.SqlConnection.Open() [...my code..] Boolean TryGetConnection(System.Data.Common.DbConnection, UInt32, Boolean, Boolean, System.Data.Common.DbConnectionOptions, System.Data.ProviderBase.DbConnectionInternal ByRef) ``` 29148 area-Infrastructure Bump versions for 2.2 PTAL @ericstj This change bumps the minor version of all the packages we produce as well as bumps the patch version of all the assemblies that ship in an individual package. If a library only ships in the platform package (aka Microsoft.NETCore.App/UAP) then we aren't bumping the assembly version at this time. 29149 area-Infrastructure Dependency bug with System.Memory in net461 Repro project: https://github.com/anurse/SpanDependencyBug Steps: 1. Create `net461` project 2. Reference `System.Memory` 3. Use `Span<T>.IndexOf` Expected Result: You get the index! Actual Result: ``` Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. at System.SpanHelpers.IndexOf(Char& searchSpace, Char value, Int32 length) at System.MemoryExtensions.IndexOf[T](ReadOnlySpan`1 span, T value) at SpanDependencyBug.Program.Main(String[] args) ``` I believe this is cause by the fact that System.Memory depends on the following for `net45` (see https://dotnet.myget.org/feed/dotnet-core/package/nuget/System.Memory). * System.Buffers (>= 4.4.0) * System.Runtime.CompilerServices.Unsafe (>= 4.5.0-preview3-26416-06) We are building for `net461` in the sample, but the `net45` dependencies are chosen over the `netstandard2.0` ones because NuGet finds an exact target framework name match (**unless this logic has changed since I last knew how this worked ;)**). At runtime, `System.Memory` only provides a `netstandard2.0` binary, so it loads that binary, which references `System.Numerics.Vectors`, and thus blows up. System.Memory's references: ``` // netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51 // System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a // System.Runtime.CompilerServices.Unsafe, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a // System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51 // mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ``` 29150 area-System.Data new SqlDouble(NaN) is only allowed on NETFX SqlDouble has a weird platform difference: ```cs public SqlDouble(double value) { #if !netfx if (!double.IsFinite(value)) #else if (double.IsInfinity(value) || double.IsNaN(value)) #endif { throw new OverflowException(SQLResource.ArithOverflowMessage); } else { m_value = value; m_fNotNull = true; } } ``` https://github.com/dotnet/corefx/blob/master/src/System.Data.Common/src/System/Data/SQLTypes/SQLDouble.cs#L40 This means I can insert NaN values when not using the .NET Framework, but when running the same code on a different platform, I get a crash here. Easy to reproduce: ``` new SqlDouble(double.NaN); //Crashes on NETFX ``` This is rather problematic because NaN is commonly used in the SqlGeometry and SqlGeography datatypes to represent Z and M values, where for instance a line generally contains Z measurements, but on some vertices they might not be available. The behavior is described in [Microsoft SQL Server CLR Types Serialization Formats ](https://msdn.microsoft.com/en-us/library/ee320529(v=sql.105).aspx) on Page 9:  29152 area-Serialization Enable DCS_TypeWithPrimitiveKnownTypes test on uapaot Enable DCS_TypeWithPrimitiveKnownTypes on Uapaot since the original issue #24265 has been fixed. Fix #28978 @mconnew @zhenlan @yujayee @Lxiamail 29154 area-Infrastructure Add command line install 29155 area-System.IO Populate the original path when creating directories The DirectoryInfo class should be the same when calling Directory.Create() as it would be creating DirectoryInfo directly then calling create on it. 29156 area-System.Globalization DateTime format with CultureInfo differences "Hello, I've got simple Core2.0 console application, which produces different outputs on different platforms. ``` static void Main(string[] args) { var d = new DateTime(2018, 3, 13, 0, 0, 0, DateTimeKind.Utc); Console.WriteLine(d.ToString(""d"", new CultureInfo(""fa-IR""))); } ``` Windows 10: (expected output) 22/12/1396 Windows Server 2012 R2: (not converted into persian calendar) 13/03/2018 Both platforms have runtime 2.0.6 installed. ``` Microsoft .NET Core Shared Framework Host Version : 2.0.6 Build : 74b1c703813c8910df5b96f304b0f2b78cdf194d ``` Desired culture is available on both platforms, checked with this piece of code. ``` var cultures = CultureInfo.GetCultures(CultureTypes.AllCultures); foreach (var culture in cultures) { Console.WriteLine($""{culture.Name} - {culture.DisplayName}""); } ``` Please what can I do to make it work as desired? Thank you. Martin" 29157 area-System.IO File.OpenRead () calls Win32 apis when running on Linux. This is an issue @jmacato has come across on Kubuntu and Ubuntu. (I cant reproduce on my system, so must be something confusing .net runtime. specific to his system.) to repro make a console application and call File.OpenRead() the exception: ``` Unhandled Exception: System.AggregateException: One or more errors occurred. (Could not find file '/mscorlib.dll'.) ---> System.IO.FileNotFoundException: Could not find file '/mscorlib.dll'. at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptionsoptions) at Roslyn.Utilities.FileUtilities.OpenFileStream(String path) ``` here is the affected systems environment incase it helps: ``` KDE_MULTIHEAD=false CLUTTER_IM_MODULE=xim GS_LIB=/home/<redacted>/.fonts KDE_FULL_SESSION=true LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36: LESSCLOSE=/usr/bin/lesspipe %s %s LANG=en_PH.UTF-8 DISPLAY=:0 COLORTERM=truecolor XDG_VTNR=7 PAM_KWALLET5_LOGIN= QT_QUICK_CONTROLS_STYLE=org.kde.desktop SSH_AUTH_SOCK= MANDATORY_PATH=/usr/share/gconf//usr/share/xsessions/plasma.mandatory.path XDG_SESSION_ID=3 USER=<redacted> DESKTOP_SESSION=/usr/share/xsessions/plasma QT4_IM_MODULE=xim TEXTDOMAINDIR=/usr/share/locale/ GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/home/<redacted>/.gtkrc-2.0:/home/<redacted>/.config/gtkrc-2.0 DEFAULTS_PATH=/usr/share/gconf//usr/share/xsessions/plasma.default.path PWD=/home/<redacted>/Desktop HOME=/home/<redacted> TEXTDOMAIN=im-config SSH_AGENT_PID=1202 QT_ACCESSIBILITY=1 XDG_SESSION_TYPE=x11 XDG_DATA_DIRS=/usr/share//usr/share/xsessions/plasma:/usr/local/share:/usr/share:/var/lib/snapd/desktop XDG_SESSION_DESKTOP=KDE TERM=xterm-termite SHELL=/bin/bash VTE_VERSION=4802 XDG_SESSION_CLASS=user XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0 QT_IM_MODULE=xim XMODIFIERS=@im=fcitx IM_CONFIG_PHASE=2 XCURSOR_THEME=breeze_cursors XDG_CURRENT_DESKTOP=KDE DOTNET_CLI_TELEMETRY_OPTOUT=1 XDG_SEAT=seat0 SHLVL=1 LANGUAGE=en_US:en_GB GTK_RC_FILES=/etc/gtk/gtkrc:/home/<redacted>/.gtkrc:/home/<redacted>/.config/gtkrc WINDOWID=96468995 LOGNAME=<redacted> DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-oLdDcAMVfg,guid=89c25e66de149eef77c1405a5ad5b765 XDG_RUNTIME_DIR=/run/user/1000 PAM_KWALLET_LOGIN=/run/user/1000/kwallet.socket XAUTHORITY=/tmp/xauth-1000-_0 XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session1 QT_AUTO_SCREEN_SCALE_FACTOR=0 XDG_CONFIG_DIRS=/etc/xdg/xdg-/usr/share/xsessions/plasma:/etc/xdg:/usr/share/kubuntu-default-settings/kf5-settings PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin KDE_SESSION_UID=1000 KDE_SESSION_VERSION=5 SESSION_MANAGER=local/n550jk:@/tmp/.ICE-unix/1257,unix/n550jk:/tmp/.ICE-unix/1257 LESSOPEN=| /usr/bin/lesspipe %s GTK_IM_MODULE=xim OLDPWD=/home/<redacted>/Desktop/AvalonStudio/AvalonStudio/AvalonStudio/bin/Debug/netcoreapp2.0/debian.8-x64/publish _=/usr/bin/printenv ``` Any further information we can get to help debug the issue? 29158 area-System.Runtime About 30% performance regression for GetTypeCode() test About 30% performance regression for GetTypeCode() test as seen in the chart below  Correction: Below is the corefx diff from early March: https://github.com/dotnet/corefx/compare/e1f304886a8315fd3303ff0e75dc7595c42b8cd0...dotnet:5cc8f36bec8ee6e67f8576bdc698bef1a280e9b9 Refer to [benchview](https://benchview/trendline?build_selector=latest&count=2000&aggregate=arithmeticMean&filterTail=one&filterVal=100&interval=INTERVAL_MIN_MAX&rtids=[957]&archids=[23]&mpids=[1292]&cfgids=[2706]&testids=[102192]&jobid=98308&) for more details. cc: @kouvel @danmosemsft 29159 area-System.Net Fix ClientWebSocket error message when endpoint is not a real websocket Close: #20360 29162 area-System.Numerics System.Numerics.Vectors is applying oob netstandard2.0 assembly to NETCoreApp2.0 The netstandard2.0 assembly doesn't have the same characteristics as the netcoreapp2.0 implementation that's in the shared framework. For example: it uses a private copy of MathF rather than the framework implementation. This could cause performance issues when the OOB implementation is used. Since we've already set the pattern starting in netcoreapp2.1 that we don't want the package to apply an OOB implementation we should make that apply from netcoreapp2.0 where the assembly first went inbox. /cc @weshaggard 29163 area-System.Net ClientWebSocket does not provide upgrade request error details "Related to #13773 ClientWebSocket on .NET Core does not provide the upgrade request errors in the exception details as it does on the .NET Framework. ### Repro code ```csharp var client = new ClientWebSocket(); client.ConnectAsync(new Uri(""wss://speech.platform.bing.com/speech/recognition/interactive/cognitiveservices/v1""), CancellationToken.None).GetAwaiter().GetResult(); ``` ### Behavior on .NET 462 ``` Unhandled Exception: System.Net.WebSockets.WebSocketException: Unable to connect to the remote server ---> System.Net.WebException: The remote server returned an error: (403) Forbidden. at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.WebSockets.ClientWebSocket.<ConnectAsyncCore>d__21.MoveNext() --- End of inner exception stack trace --- at System.Net.WebSockets.ClientWebSocket.<ConnectAsyncCore>d__21.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at ConsoleApp1.Program.Main(String[] args) ``` ### Behavior on .NET Core 2.1 preview 2 ``` Unhandled Exception: System.Net.WebSockets.WebSocketException: Unable to connect to the remote server at System.Net.WebSockets.WebSocketHandle.ConnectAsyncCore(Uri uri, CancellationToken cancellationToken, ClientWebSocketOptions options) at System.Net.WebSockets.ClientWebSocket.ConnectAsyncCore(Uri uri, CancellationToken cancellationToken) at ConsoleApp1.Program.Main(String[] args) ``` As you can see on .NET 462, the inner exception is a ```WebException``` with the error details. ### Proposed Fix Create an inner exception of type ```WebException``` in a similar fashion to https://github.com/dotnet/corefx/blob/6acd74dda7bc4f585d2c4006da4a8b2deb0261ad/src/System.Net.Requests/src/System/Net/HttpWebRequest.cs#L1211 and throw if the response is not 200. The original WebException in .NET framework was thrown from```HttpWebRequest.GetResponseAsync()```, so I think the exception needs to be bubbled up in a similar way. " 29167 area-System.Net Ensure LocalCertificateSelectionCallback is still called with AuthenticateAsServerAsync In .NET Core 2.0, we call `LocalCertificateSelectionCallback` to choose the certificate during `AuthenticateAsServerAsync`. As part of adding support for SNI, this functionality was removed. However, some users have already implemented SNI using `LocalCertificateSelectionCallback`, and we should aim to maintain compatibility for them. This change ensures that we maintain the old behavior of `LocalCertificateSelectionCallback` when the new SNI callback is not set. When both are set, we default to the new behavior. I also added two tests to verify this behavior. Fixes: #29110 29169 area-System.Data Compilation errors while linking corefx\src\Common\src\Interop\Windows\NtDll\Interop.NtCreateFile.cs I am getting the following compilation errors when linking [Interop.NtCreateFile.cs](https://github.com/dotnet/corefx/blob/a28a2cdda67c024126f690bbe1331174a194f9ce/src/Common/src/Interop/Windows/NtDll/Interop.NtCreateFile.cs) in `System.Data.SqlClient` project. [FileSystemEnumerator.Win32.cs](https://github.com/dotnet/corefx/blob/dd4519d0373e26789905a4836c3fc88a9257cc1c/src/System.IO.FileSystem/src/System/IO/Enumeration/FileSystemEnumerator.Win32.cs#L54) includes a call to `Interop.NtDll.CreateFile` method and no compilation issues are observer with this project. Could someone kindly help me with the following: - Are issues 1,2,3 and 5 are being resolved in the correct manner, if not is there a better solution ? - How can I resolve Issue 4 (*CS0029*) ? I have added my comments and an excerpt from the log below, the logs are after including the mentioned changes. | No |Error Code | Description | Project | File | Comments | |:------------- |:-------------|:------------------|:---------|:-----|:-----| | 1. | CS0208 | Cannot take the address of, get the size of, or declare a pointer to a managed type ('Interop.UNICODE_STRING') | System.Data.SqlClient | [Interop.NtCreateFile.cs](https://github.com/dotnet/corefx/blob/a28a2cdda67c024126f690bbe1331174a194f9ce/src/Common/src/Interop/Windows/NtDll/Interop.NtCreateFile.cs#L84) | Removing the `*` operator resolves the compilation error.| | 2. | CS0208 | Cannot take the address of, get the size of, or declare a pointer to a managed type ('Interop.UNICODE_STRING') | System.Data.SqlClient | [Interop.NtCreateFile.cs](https://github.com/dotnet/corefx/blob/a28a2cdda67c024126f690bbe1331174a194f9ce/src/Common/src/Interop/Windows/NtDll/Interop.NtCreateFile.cs#L102) | Removing the `*` operator resolves the compilation error.| | 3. | BCL0015 | ntdll.dll!NtCreateFile is not supported on one\more targeted platforms. | System.Data.SqlClient | [Interop.NtCreateFile.cs](https://github.com/dotnet/corefx/blob/a28a2cdda67c024126f690bbe1331174a194f9ce/src/Common/src/Interop/Windows/NtDll/Interop.NtCreateFile.cs#L14) | This error can be removed by suppressing the warning `#pragma warning disable BCL0015 // Invalid Pinvoke call.` Is there a better way to do this ?| | 4. | CS0029 | Cannot implicitly convert type 'System.IntPtr' to 'string' | System.Data.SqlClient | [Interop.NtCreateFile.cs](https://github.com/dotnet/corefx/blob/a28a2cdda67c024126f690bbe1331174a194f9ce/src/Common/src/Interop/Windows/NtDll/Interop.NtCreateFile.cs#L44) | Changing this to `Buffer = new string( c )` resolves the `intellisense` error, however the compilation error `convert type 'string' to 'System.IntPtr'` is observed. | | 5. | CS0208 | Cannot take the address of, get the size of, or declare a pointer to a managed type ('Interop.UNICODE_STRING') | System.Data.SqlClient | [Interop.NtCreateFile.cs](https://github.com/dotnet/corefx/blob/a28a2cdda67c024126f690bbe1331174a194f9ce/src/Common/src/Interop/Windows/NtDll/Interop.NtCreateFile.cs#L48) | Removing the `&` operator resolves the compilation error. | ```cmd System.Linq.Expressions -> D:\dotNetCore\corefx\bin\Windows_NT.AnyCPU.Debug\System.Linq.Expressions\netcoreapp\System .Linq.Expressions.dll System.Private.Xml.Linq -> D:\dotNetCore\corefx\bin\Windows_NT.AnyCPU.Debug\System.Private.Xml.Linq\netcoreapp\System .Private.Xml.Linq.dll System.Xml.XmlDocument -> D:\dotNetCore\corefx\bin\Windows_NT.AnyCPU.Debug\System.Xml.XmlDocument\netcoreapp\System.X ml.XmlDocument.dll System.Xml.XPath -> D:\dotNetCore\corefx\bin\Windows_NT.AnyCPU.Debug\System.Xml.XPath\netcoreapp\System.Xml.XPath.dll System.Xml.ReaderWriter -> D:\dotNetCore\corefx\bin\Windows_NT.AnyCPU.Debug\System.Xml.ReaderWriter\netcoreapp\System .Xml.ReaderWriter.dll System.Xml.XmlSerializer -> D:\dotNetCore\corefx\bin\Windows_NT.AnyCPU.Debug\System.Xml.XmlSerializer\netcoreapp\Syst em.Xml.XmlSerializer.dll System.Xml.XPath.XDocument -> D:\dotNetCore\corefx\bin\Windows_NT.AnyCPU.Debug\System.Xml.XPath.XDocument\netcoreapp\ System.Xml.XPath.XDocument.dll System.Xml.XDocument -> D:\dotNetCore\corefx\bin\Windows_NT.AnyCPU.Debug\System.Xml.XDocument\netcoreapp\System.Xml.X Document.dll Build FAILED. D:\dotNetCore\corefx\src\Common\src\Interop\Windows\NtDll\Interop.NtCreateFile.cs(46,30): error CS0029: Cannot implicit ly convert type 'string' to 'System.IntPtr' [D:\dotNetCore\corefx\src\System.IO.FileSystem\src\System.IO.FileSystem.csp roj] 0 Warning(s) 1 Error(s) Time Elapsed 00:02:26.71 Command execution failed with exit code 1. ``` cc @saurabh500 @AfsanehR 29170 area-System.Memory MemoryExtensions.Equals with StringComparison I'm trying to check for certain file extensions with the new `Span` APIs. I came across some odd behavior. Here's where I started, which, of course, only works for case-insensitive cases (i.e. Linux): ``` foreach (var extension in _extensionsToWatch) { if (Path.GetExtension(entry.FileName).SequenceEqual(extension)) return true; } ``` `SequenceEqual` doesn't have a case-insensitive overload, so I found `if (MemoryExtensions.Equals(Path.GetExtension(entry.FileName), extension, StringComparison.OrdinalIgnoreCase))` which works. But I like to call extension methods as extension methods, so I rewrite this as `if (Path.GetExtension(entry.FileName).Equals(extension, StringComparison.OrdinalIgnoreCase))` But now I get a compiler error > Member 'object.Equals(object, object)' cannot be accessed with an instance reference; qualify it with a type name instead OK, that's odd. Shouldn't it have picked up the `MemoryExtensions` extension method used above? Now this next one I stumbled into on accident `if (Path.GetExtension(entry.FileName).Equals((extension, StringComparison.OrdinalIgnoreCase)))` The difference is subtle, but all I did was add some redundant(?) parentheses. No compiler error, but I get a runtime error > System.NotSupportedException: 'Equals() on Span and ReadOnlySpan is not supported. Use operator== instead.' So now it is telling me to use the `==` operator, which, I assume, will do a case-sensitive comparison, which is the opposite of what I want, and is not valid replacement for `StringComparison`. Why are things not working like I think they should? 29171 area-System.Security More SSL error queue cleaning Another batch of cleaning SSL error queue. Trying to be minimize the extension of the changes while ensuring the SSL error queue is clean of typical errors without affecting exceptions currently throw by the code. In interest of keeping the perf unchanged calls to cleanup the queue are ideally only added in case of errors and preferably via ERR_clear_error. The targets addressed on this change were identified via debugger by selecting calls that were putting errors on the SSL queue. The removal of the active issue is at this point still tentative: I can't be sure that it is going to pass reliable on Outerloop and I do not have any more local repros. Contributes to #25676. 29172 area-System.Reflection Add High level System.Reflection.Metadata API Please add high-level APIs that can be used without having to deference/follow all the pointers/handles. I would love to just load an assembly and loop through the tree. 29174 area-System.Memory Correctness checking and perf improvements on ReadOnlySequence Currently APIs like `ReadOnlySequence<T>.Slice(SequencePosition, ...)` cannot validate certain aspects of their input parameters (such as that the provided _SequencePosition_ parameters are actually within the _this_ object) without incurring an O(n) traversal through the linked list of segments, where _n_ is the number of segments in the list. One option is to forego validation of the input parameters in this respect, but at the cost of the developer encountering undefined behavior in their application. A better solution would be to make validation constant-time so that the developer gets the benefit of parameter validation with minimal cost. One potential way to do this would be to add a `public object Tag { get; protected set; }` property on the `ReadOnlySequenceSegment<T>` type. The general idea is that the tag identifies the linked list that this segment belongs to, and every segment within that linked list should reference the same tag object. The onus is on the creator of the individual segments to set the correct value. (By convention I'd recommend that _Tag_ point to the last segment in the linked list, but the particular implementation doesn't matter as long as the tags for each segment have referential equality.) When the developer calls any API on `ReadOnlySequence<T>` that accepts a `SequencePosition` parameter, the API would check that the parameter's backing `ReadOnlySequenceSegment<T>.Tag` object has referential equality to the `ReadOnlySequence<T>.Start`'s own backing `ReadOnlySequenceSegment<T>.Tag`. If the tags don't match, then the provided _SequencePosition_ doesn't belong to this instance, and the API should throw. Additionally, as a potential optimization, the `ReadOnlySequence<T>` type could forego its existing logic of trying to special-case `T[]` vs. `string` vs `MemoryManager<T>` vs `ReadOnlySequenceSegment<T>` and could say simply that its own _SequencePosition_ instances are _always_ backed by a `ReadOnlySequenceSegment<T>`. In some cases this may result in an allocation internally, but this may pay for itself by resulting in much simpler / faster logic in `Slice` and other routines. The allocation penalty could also be optimized by having a custom internal `ReadOnlySequenceSegment<T>`-derived type with a finalizer and pulling a pooling trick [similar to what `PinnableBufferCache` does](https://referencesource.microsoft.com/#System/parent/parent/parent/InternalApis/NDP_Common/inc/PinnableBufferCache.cs,4a9f14fd83c457e5). It also has the added benefit that `ReadOnlySequence<T>` would no longer try to reach into `Memory<T>`'s internals, which could provide better support in the future if we add a direct `void*` constructor to that type. This latter optimization would be purely an implementation detail of `ReadOnlySequence<T>` and wouldn't change the public API surface. When combined with the _Tag_ proposal mentioned earlier, I think this is compelling in that it provides fast, robust parameter validation and simpler runtime logic for common operations. 29175 area-System.Net AuthenticateAsClientAsync hangs on core 1.1.4 [Question] Here's my stack overflow post with all the investigation I have done thus far: https://stackoverflow.com/questions/49891249/tcp-close-wait-apple-apns It seems like this api hangs on .net core 1. I tried it on 1.1.4 and 1.1.8 without any success. 29178 area-System.Text Porting roslyn regex tests to corefx Fixes https://github.com/dotnet/corefx/issues/28508 Fixes https://github.com/dotnet/corefx/issues/27618 - Adding InternalsVisibleTo to src assembly as we need to access internals to test the RegexParser thoroughly. - Adding internal `RegexParseException` that derives from ArgumentException to provide internal error information `RegexParseError`. - Porting test cases from the roslyn PR over to corefx and changing them to InlineData instead of a method per test case. - Asserting on the specific `RegexParseError` for negative tests to be more precise (existing tests + roslyn tests) TODO: - [x] Adding sub expression checks (probably without asserting on the specific RegexParseError) - [x] Refine RegexParseError options and add comments to each. 29179 area-System.Text Disable regex cache tests using reflection for uapaot Fixes https://github.com/dotnet/corefx/issues/29019 & remove dead code I overlooked last time. 29180 area-System.Security Conditional access support in IIdentity "This is not a feature request, more raising an issue for possible consideration. When logging in from a new IP address, a new device or other criteria a identity provider could flag the authentication as limited. The `IIdentity` interface could be extended with a property to communicate this information. Perhaps a boolean, possibly named `IsAuthenticationLimited` or something. ## Rationale and Usage Allows you to hide/reduce functionality in case of any uncertainty in the authentication. ```cshtml @if (User.Identity.IsAuthenticationLimited) { <video src=""movie_720p.webm"" /> } else { <video src=""movie_4k.webm"" /> } ``` ```cshtml @if (!User.Identity.IsAuthenticationLimited) { <button class=""btn btn-danger"" type=""submit"">Delete data and close my account</button> } ``` ```cs [HttpPost] public IActionResult DeleteAccount() { if (User.Identity.IsAuthenticationLimited) { return BadRequest(); } await _userManager.DeleteAsync(User); return View(); } ``` ## Proposed API ```cs public interface IIdentity { string Name { get; } string AuthenticationType { get; } bool IsAuthenticated { get; } bool IsAuthenticationLimited { get; } // The possible addition } ``` ## Open Questions * Does any identity provider communicate this? * Is this standardized in any authentication protocol such as OAuth or OpenID Connect?" 29181 area-System.Data SqlDataReader.Close blocks in SNIReadSyncOverAsync after early breaking from reading large dataset "SqlDataReader is taking unproportionaly long time to Dispose if you are early breaking enumeration through large data set. I can observer order of magnitude difference in Dispose time depending on number in top clause in select statement, but regardless of the number of rows actually selected. Let's have the following code: public static void Test() { IEnumerable<int> en1 = EnumerateLargeData(1000); // log time here foreach (int i in en1) { } // log time here IEnumerable<int> en2 = EnumerateLargeData(2000000000); foreach (int i in en2) { } // log time here } public static IEnumerable<int> EnumerateLargeData(int maxCount) { using (SqlConnection sqlConnection = new SqlConnection(connectionString)) { sqlConnection.Open(); using (SqlCommand getDataCommand = new SqlCommand(""[dbo].[GetLargeData_SP]"", sqlConnection)) { getDataCommand.CommandTimeout = 0; getDataCommand.CommandType = CommandType.StoredProcedure; getDataCommand.Parameters.AddWithValue(""@MaxCount"", maxCount); using (var reader = getDataCommand.ExecuteReader()) { int recordsCount = 0; while (reader.Read()) { yield return 1; if (recordsCount++ > 100) { //Here is where issue happens break; } } } } } } Where SP is selecting data from some very large table: CREATE procedure [dbo].[GetLargeData_SP] @MaxCount INT AS BEGIN SELECT TOP (@MaxCount) [DataPoint] FROM [dbo].[LargeDataTable] WITH(NOLOCK) END You will see a very large difference in Dispose time depending on the `maxCount` argument - especially when pulling data over slower netwrok. In my scenario I'm done fetching data in few hundreds milliseconds but then stuck in Dispose for 2 minutes. Exactly in this stack:  " 29182 area-System.Numerics [release/2.1] Lock Vectors reference assembly to 4.1.3.0 and don't OOB it on netcoreapp2.0 System.Numerics.Vectors was made inbox in netcoreapp2.0, we were still allowing distribution in the package, however the package was applying the netstandard2.0 implementation to netcoreapp2.0. Now that we've disabled oobing the netcoreapp2.1 build (since many types were moved into corelib) it no longer makes sense for us to mantain the ability to oob the netcoreapp2.0 build. Doing so not only degrades the inbox version (by not using the framework's MathF implementation) but also creates type-unfication issues on roll forward: app targets 2.0 carries OOB copy of Vectors with higher version than 2.1, rolls forward to 2.1 and host will use the OOB copy, no longer unifying to the types in corelib. Fixes #29162 29183 area-System.Numerics Lock Vectors reference assembly to 4.1.3.0 and don't OOB it on netcoreapp2.0 System.Numerics.Vectors was made inbox in netcoreapp2.0, we were still allowing distribution in the package, however the package was applying the netstandard2.0 implementation to netcoreapp2.0. Now that we've disabled oobing the netcoreapp2.1 build (since many types were moved into corelib) it no longer makes sense for us to mantain the ability to oob the netcoreapp2.0 build. Doing so not only degrades the inbox version (by not using the framework's MathF implementation) but also creates type-unfication issues on rollforward: app targets 2.0 carries OOB copy of Vectors with higher version than 2.1, rolls forward to 2.1 and host will use the OOB copy, no longer unifying to the types in corelib. Master branch version of https://github.com/dotnet/corefx/pull/29182. We should only merge in master if we're certain we're taking the release side of the fix. 29184 area-System.Memory Port 'Remove != and == from SequencePosition (#29115)' to release https://github.com/dotnet/corefx/issues/29001 29186 area-System.Security Add config to force OpenSsl error queue cleanup before Encrypt/Decrypt "This is an escape valve in case the optimization of removing the calls to ERR_clear_error() for each SSL_write/SSL_read causes troubles. There will be a performance impact but depending on the scenario it can be a desired trade-off. The AppContext switch is ""System.Net.Security.SslStream.ForceOpenSslErrorQueueCleanupBeforeEncryptDecrypt"" The env var is ""DOTNET_FORCE_OPENSSL_ERROR_QUEUE_CLEANUP_BEFORE_ENCRYPT_DECRYPT"" Any naming suggestion is appreciated... " 29187 area-System.IO System.IO.FileSystem.DriveInfo.Tests hung on RHEL73 @Anipik shouldn't this have dumped a stack for us? https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20180418.02/workItem/System.IO.FileSystem.DriveInfo.Tests/wilogs 29188 area-System.Net Add config to force OpenSsl error queue cleanup before Encrypt/Decrypt The optimization done in #25646 is risky per OpenSsl documentation: [The current thread's error queue must be empty before the TLS/SSL I/O operation is attempted, or SSL_get_error() will not work reliably.](https://www.openssl.org/docs/man1.0.2/ssl/SSL_get_error.html). We have fixed various locations in which CoreFX code was leaving errors on the SSL error queue, but it is possible that some locations were missid, and also 3rd party libraries may interact with OpenSsl leaving errors on the queue. Adding a config is an escape valve in case the optimization of removing the calls to ERR_clear_error() for each SSL_write/SSL_read causes troubles. There will be a performance impact but depending on the scenario it can be a desired trade-off. PR #29186 addresses the issue in 2.2. 29190 area-Microsoft.CSharp RuntimeBinder MethodTypeInferrer should handle pointer types The method type inference for the C# runtime binder should be able to handle pointer types. With the introduction of `T : unmanaged` constraints, it became possible to have pointers as type arguments. Source: https://github.com/dotnet/corefx/blob/master/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/MethodTypeInferrer.cs Feature Spec: https://github.com/dotnet/csharplang/blob/master/proposals/csharp-7.3/blittable.md Related to: https://github.com/dotnet/roslyn/issues/25654 29191 area-Infrastructure Enable closure validation on desktop frameworks during package testing Essentially remove this comment: https://github.com/dotnet/corefx/blob/6b2a3fe8ec3ab26627f5e8eb7abaace03eafa185/pkg/test/frameworkSettings/net/settings.targets#L4-L5 To do this we need to make sure we can handle cycles that exist in the desktop assemblies and we ignore all intentional dangling references in the desktop facades and reference assemblies themselves. 29192 area-System.Runtime Support time zone 'n' Julian day POSIX format "On Linux when we read the time zone data files, we support parsing the POSIX format for specifying the adjustment rules. e.g.: ``` std offset[dst[offset][,start[/time],end[/time]]] ``` http://man7.org/linux/man-pages/man3/tzset.3.html The ""start"" and the ""end"" in the format can be specified by Julian day. one format which we support is is ""Jn"" but we don't support the 'n' Julian day format. The reason is we didn't encounter this case so far and also, we'll need to handle this as a new rule type. we have this issue to track supporting 'n' format. https://github.com/dotnet/coreclr/issues/17393 https://github.com/dotnet/coreclr/pull/17635 " 29193 area-System.Data System.Data.SqlClient .NET Core 2.1.3 Preview 2 - Unable to open connection to the database "Unable to use System.Data.SqlClient to open a connection in .NET Core 2.1.3 Preview 2. I also tried previous versions of .NET Core 2 and encountered the same issue. I also manually updated to use the latest preview version of System.Data.SqlClient and same outcome. **DB in question is SQL Server 2008 R2 running in 2000 compatibility mode, though this has never been an issue previously** **UPDATE: Querying the 2008 instance as a linked server through a SQL Server 2016 instance DOES work.** # **Code** ```c# public IEnumerable<string> Get() { using (var db = new SqlConnection(@""valid conn string"")) { try { db.Open(); db.Close(); } catch (Exception e) { var trace = e.StackTrace; } } return new string[] { }; } ``` # **Environment** - Running locally on Win 10 when this happens # **Exception** ``` System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling) at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) at System.Data.SqlClient.SqlConnection.Open() at MyDumbAPI.Controllers.ValuesController.Get() in C:\dev\MyDumbAPI\Controllers\ValuesController.cs:line 19 ClientConnectionId:00000000-0000-0000-0000-000000000000 Error Number:-1,State:0,Class:20 ``` # **Reproduce** - Create new .NET Core console or web application - Try and use SqlClient API to open a connection to a SQL Server database # **dotnet --info** ``` .NET Core SDK (reflecting any global.json): Version: 2.1.300-preview2-008530 Commit: 822ae6d43a Runtime Environment: OS Name: Windows OS Version: 10.0.16299 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\2.1.300-preview2-008530\ Host (useful for support): Version: 2.1.0-preview2-26406-04 Commit: 6833f3026b .NET Core SDKs installed: 1.0.0-preview2-003121 [C:\Program Files\dotnet\sdk] 1.0.0-preview2.1-003155 [C:\Program Files\dotnet\sdk] 1.0.3 [C:\Program Files\dotnet\sdk] 1.0.4 [C:\Program Files\dotnet\sdk] 1.1.0 [C:\Program Files\dotnet\sdk] 2.0.0 [C:\Program Files\dotnet\sdk] 2.0.2 [C:\Program Files\dotnet\sdk] 2.0.3 [C:\Program Files\dotnet\sdk] 2.1.4 [C:\Program Files\dotnet\sdk] 2.1.101 [C:\Program Files\dotnet\sdk] 2.1.102 [C:\Program Files\dotnet\sdk] 2.1.104 [C:\Program Files\dotnet\sdk] 2.1.300-preview2-008530 [C:\Program Files\dotnet\sdk] .NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.0-preview2-final [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.0-preview2-final [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 1.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 1.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 1.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 1.1.0-preview1-001100-00 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 1.1.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 1.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.0-preview2-26406-04 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] ``` " 29194 area-System.Security Port: More SSL error queue cleaning (#29171) * Cleaning up more instances leaving errors on SSL queue * Fixes #25676 * PR merged into master is #29171 29195 area-Infrastructure Adding default initialization for AgentToolsPath 29196 area-System.Diagnostics TraceInternal fails with null reference exception We publish Microsoft.SqlServer.SqlManagementObjects to Nuget.Org with NetStandard2.0 binaries. One of our customers built an app and runs it on Ubuntu with netcore-hosting and the app crashes: ``` Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. at System.Diagnostics.TraceInternal.get_AppName() at System.Diagnostics.TraceInternal.TraceEvent(TraceEventType eventType, Int32 id, String format, Object[] args) at Microsoft.SqlServer.Management.Smo.ExecutionManager.GetEnumeratorData(Request req) at Microsoft.SqlServer.Management.Smo.SqlSmoObject.GetDbCollation(String dbname) at Microsoft.SqlServer.Management.Smo.SqlSmoObject.GetDbComparer(Boolean inServer) at Microsoft.SqlServer.Management.Smo.SqlSmoObject.InitializeStringComparer() at Microsoft.SqlServer.Management.Smo.SqlSmoObject.get_StringComparer() at Microsoft.SqlServer.Management.Smo.SimpleObjectCollectionBase.InitInnerCollection() at Microsoft.SqlServer.Management.Smo.SmoCollectionBase.InitializeChildCollection(Boolean refresh, ScriptingPreferences sp, String filterQuery, IEnumerable`1 extraFields) at Microsoft.SqlServer.Management.Smo.SmoCollectionBase.GetEnumerator(ScriptingPreferences sp) at SMOLib.GetDatabases() in C:\temp\demo_SMOLib\SMOLib\SMOLib\Program.cs:line 42 ``` Looking at the code for TraceInternal, it appears to use `GetEntryAssembly().GetName().Name`, but from looking around the repo it appears GetEntryAssembly() can return null in some cases. Is there a workaround the customer could put in his app to make this work? It seems like TraceInternal.AppName should be checking for null and using something else for its value. 29197 area-Infrastructure Adding default initialization of variable AgentToolsPath 29198 area-Infrastructure Adding begin/end steps to build definitions 29199 area-Infrastructure Adding begin/end steps to build definitions and removing deprecated cleanup step 29204 area-System.Memory Remove unused private helper method GetTypeAndIndices on ReadOnlySequence. Related to https://github.com/dotnet/corefx/pull/29109#discussion_r182328045 cc @pakrym, @AlexRadch 29205 area-System.Memory Fix bug in ReadOnlySequence Slice(SequencePosition start, long length) for null next segment cc @pakrym, @AlexRadch 29207 area-System.Diagnostics Public setter for System.Diagnostics.Activity.Current "# Motivation `Activity` represents a context for distributed operation tracing. It is created when an operation (e.g. Http request) starts and flows with async calls within a process. `Activity.Current` is `AsyncLocal` static variable that any logger/tracing system can use to stamp logs and telemetry with 'correlation ids'. `Activity.Current` could be set via calling `Activity.Start` or `Activity.Stop` which are enough as long as managed asyncronous flow is guaranteed which is not always the case. Typical example is ASP.NET application hosed with IIS where hop from managed to native thread chould happen at any step in the request execution pipeline. ASP.NET propagates `HttpContext` through such hops. With current API, it is not possible to assign Current Activity 'back' to what it was before the hop. # Proposed API Add public setter for `Activity.Current`. # Usage Such method could be called from the certain points in the request execution pipeline: ```csharp public void RestoreActivityIfNeeded(HttpContext context) { if (Activity.Current == null) { var storedActivity = (Activity)context.Items[""AspNetActivityKey""]; if (storedActivity != null) { Activity.Current = storedActivity; //!!! } } } ``` # Details * stopped/not started Activities *should not* be allowed as it makes Current stack *invalid*. E.g. ```csharp Activity.Current = stopped; Activity.Current.Stop(); // Noop, never changes Current to Parent ``` ```csharp Activity.Current = notStarted; notStarted.Stop() // Noop, never changes Current to Parent ``` * arguably, Activity.Current = null is valid. E.g. fork a background task with no context without stopping all stack ```csharp Activity a = new Activity(""incoming request"").Start(); Task.Run(() => { Activity.Current = null; // start long-running task }); // continune execution in the same context ``` # Pull Request Proposed changes: #29208 cc @vancem " 29208 area-System.Diagnostics Introduce public setter for Activity See #29207 29209 area-Infrastructure Debuging hung test with lldb This PR is just for testing purposes. so no review is required 29210 area-System.Net How to trace System.Net ? I am following the similar steps of [Network Tracing in .NET Framework](https://docs.microsoft.com/en-us/dotnet/framework/network-programming/network-tracing) for CoreClr web app. However, I don't see the `network.log` getting generated. When I do the same steps in .Net Framework web app, it does generate the log file. Sample coreclr web app with config file : [TraceSystemNetCoreClrNotWorking.zip](https://github.com/dotnet/corefx/files/1926810/TraceSystemNetCoreClrNotWorking.zip) Sample .Net Framework project which is working : [TraceSystemNetNetFrameworkWorking.zip](https://github.com/dotnet/corefx/files/1926818/TraceSystemNetNetFrameworkWorking.zip) Note : Change the absolute path in `WebApplication1.web.config` while trying above app locally. I need this so that i can debug the network connection failures in production. 29211 area-System.Data "Test System.Data.SqlTypes.Tests.SqlStringSortingTest.SqlStringValidComparisonTest(cultureName: \""el-GR\"", localeId: 1032) failed in CI." "Tests System.Data.SqlTypes.Tests.SqlStringSortingTest.SqlStringValidComparisonTest(cultureName: \""el-GR\"", localeId: 1032) had failed. Message: FAILED: (SqlString Operator Comparison): SqlStrings are out of order\nExpected: True\nActual: False ~~~ STACK TRACE: at System.Data.SqlTypes.Tests.SqlStringSortingTest.VerifySortedSqlStringList(SortedList`2 items, SqlCompareOptions compareOption, CultureInfo cInfo) in /mnt/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_ubuntu14.04_debug/src/System.Data.Common/tests/System/Data/SqlTypes/SqlStringSortingTest.cs:line 162 at System.Data.SqlTypes.Tests.SqlStringSortingTest.SqlStringCompareTest(Int32 numberOfItems, SqlCompareOptions compareOption, CultureInfo cInfo, Int32 localeID) in /mnt/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_ubuntu14.04_debug/src/System.Data.Common/tests/System/Data/SqlTypes/SqlStringSortingTest.cs:line 104 at System.Data.SqlTypes.Tests.SqlStringSortingTest.SqlStringValidComparisonTest(String cultureName, Int32 localeId) in /mnt/j/workspace/dotnet_corefx/master/outerloop_netcoreapp_ubuntu14.04_debug/src/System.Data.Common/tests/System/Data/SqlTypes/SqlStringSortingTest.cs:line 63 ~~~ Details: https://ci.dot.net/job/dotnet_corefx/job/master/job/outerloop_netcoreapp_ubuntu14.04_debug/383/testReport/System.Data.SqlTypes.Tests/SqlStringSortingTest/SqlStringValidComparisonTest_cultureName____el_GR____localeId__1032_/" 29212 area-Serialization DataContractJsonSerializer.CanonicalizeObject() There is an alternative to https://tools.ietf.org/id/draft-erdtman-jose-cleartext-jws-00.html in preparation which in addition to ES6 compatible string and number generation (https://github.com/dotnet/corefx/issues/5647), also requires that property names are _sorted_ as described in: https://cyberphone.github.io/doc/security/draft-rundgren-json-canonicalization-scheme.html. This is trivial to accomplish in **Json.NET** through an extra parameter to the serializer (https://github.com/cyberphone/json-canonicalization/blob/master/dotnet/newtonsoft/Program.cs#L32), but using the DataContractJsonSerializer I'm stuck. One way to achieve this would be to add a specific method` CanonicalizeObject()` , that would be identical to `WriteObject()` except for property order. Well, it would enforce ES6 compatible string and number generation as well. 29213 area-System.Net System.Net.Http.Native: correct hex for libcurl versions I encountered a bug in native bindings for libcurl. Sometimes there is a version check to know if an option (for example h2 multiplexing support) is available. In code version constants are specified as hex values. However they are converted to hex in a wrong way: 7.43.0 becomes 0x074300 but it should be 0x072B00. I found two places affected by this issue, but maybe there are more. @janvorli please take a look. 29214 area-System.Diagnostics Fix TraceSource handling of GetEntryAssembly Check that GetEntryAssembly doesn't return null before dereferencing it. Fixes https://github.com/dotnet/corefx/issues/29196 @jkotas, I tried to trace through the source to see why GetEntryAssembly might return null, but the conditions that would cause that weren't clear to me. I'd like to write a test for this. Suggestions? cc: @brianrob, @valenis 29215 area-System.Memory ReadOnlySequence ToString optimization Made small ReadOnlySequence ToString optimization 29216 area-System.Memory Port fixes to remove use of unsafe in ReadOnlySequence APIs and fix bounds checks on Slice Fixes https://github.com/dotnet/corefx/issues/28920 Grabbing changes from https://github.com/dotnet/corefx/pull/29135 / https://github.com/dotnet/corefx/pull/29109 As part of the fix to remove use of Unsafe.As and add proper input validation, the goal was to minimize regression to Kestrel and and the HttpParser benchmarks. There should be little to no regression. This was confirmed in https://github.com/dotnet/corefx/pull/29135#issuecomment-381816589. cc @pakrym, @joshfree 29218 area-Infrastructure CoreFx needs to version assemblies in the shared framework past those which are OOB and have different surface area "Previously whenever we added API to a contract or moved types down we had to version the assembly. This was necessary because the contract was meant to be a portable representation along a single timeline of the API. Up to this point we haven't cared about the assembly version when adding .NETCore-specific API. This was because we were viewing .NETCore as a ""fork"" of the contract. We could imagine .NETCore having more API than the portable view of the contract since the portable view was constrained by what was in other frameworks/netstandard. Not caring about this was OK because there was never the case that someone would be getting a different assembly when targeting .NETCore: all those .NETCore specific assemblies were in the same package and/or in the framework package for targeting .NETCore. This has changed since we started allowing framework roll-forward. Framework roll-forward allows for a snapshot of the asset resolution for an older framework to be used on a newer framework. This breaks the assumption I mentioned above. This will cause a problem whenever we 1. Permit a package to provide an asset on a previous version of .NETCore. 2. The same assembly in that package has significantly different API that would have caused us to version the contract in the newer version of .NETCore: a. Added API b. Forwarded API in the reference assembly. c. *Forwarded API in the implementation assembly* - I need to think through this more to understand if this is an issue. My gut feel is that it is, since some other assembly might be compiling against implementation assemblies and expect the type to exist at the forwarded location. In practice we may be able to rely on B in order to force things that might compile against implementation into non-oob mode. This need not be in two different versions of the package and indeed is a problem at steady state. Consider the System.Memory issue https://github.com/dotnet/corefx/issues/29032. We build a netstandard2.0 version of System.Memory that defines all the types as living in System.Memory. We build a netcoreapp2.1 version that has forwarded the types down to System.Runtime. Today these have the same assembly version, and if they are from the same build have the same file version as well. An application uses System.Memory and targets netcoreapp2.0. At runtime the application is rolled forward to netcoreapp2.1. Today if the version is the same the applocal copy will be preferred. I'll assert that is a bug and inconsistent with the way build works: https://github.com/dotnet/core-setup/issues/4047. Ignoring that, if a newer package of System.Memory was used the same will happen. This is a problem. At steady state the System.Memory package will contain a netstandard2.0 asset and nothing in our current versioning policy will cause us to bump the inbox version. To address this issue I propose that we need to increase the assembly version of the implementation assembly in NETCoreApp whenever the netcoreapp version will have different API than another reference in the same package. This is more than is needed: technically the only requirement is that we do this whenever the older API surface would have been oob-able to a previous roll-forward capable framework but that feels like too specific of a rule to maintain. Perhaps we can implement the more specific rule in 2.1 to limit the churn, then start following the generic rule in 2.2. /cc @weshaggard " 29222 area-Infrastructure Add missing call operator Add missing call operator to execute powershell begin/end.ps1 29223 area-System.Reflection Wrong debug directory entry in some .NET Core 2.1 preview1 libraries "@KKatsnel commented on [Thu Mar 29 2018](https://github.com/dotnet/core/issues/1392) Here two possible versions of the data format of a debug directory are described: https://github.com/dotnet/corefx/blob/master/src/System.Reflection.Metadata/specs/PE-COFF.md However, there are two Debug Directory Entries in the ""System.IO.FileSystem.dll"" library of 4.1.1.0 version (it's from .NET Core 2.1 preview1): - Major = 0x0100, Minor = 0x504d that corresponds to the Portable PDB format, and - Major = 0x0100, Minor = 0, that doesn't correspond to any version. As far as I understand the second entry is wrong, isn't it? --- @Petermarcu commented on [Thu Mar 29 2018](https://github.com/dotnet/core/issues/1392#issuecomment-377456884) @tmat " 29224 area-Infrastructure arm32 and clang 5.0 Due to bugs in clang3.9 on arm, coreclr changed builds to require >=clang4.0, and official build and CI system docker container was updated to use clang5.0. It seems like corefx should match this. The coreclr change: https://github.com/dotnet/coreclr/pull/17422 29226 area-Meta De-duplicate resource ID's to make Mono merge easier "When Mono pulls in CoreFX code they factor their assemblies like .NET Framework. This means .resx files from multiple libraries must get merged. When those libraries have resources with the same ID, and the string is not identical, this will not merge. Below is a list I grepped out of all cases where we use a resource ID for multiple distinct string values. In some cases the difference is whitespace so it isn't visible. 1. Where it's a trivial spacing/punctuation/quoting difference we should keep the ID and make the strings the same 1. Where the string is clearly intended to be distinct, we should disambiguate the ID's and update the code to match. Some, like `InternalError`, could just be simplified (eg to just `Internal error.`) so they are no longer distinct. @marek-safar Key | Value -- | -- ADP_InvalidMultipartName | {0} '{1}'. ADP_InvalidMultipartName | {0} ""{1}"". ADP_InvalidMultipartNameQuoteUsage | {0} '{1}', incorrect usage of quotes. ADP_InvalidMultipartNameQuoteUsage | {0} ""{1}"", incorrect usage of quotes. ADP_InvalidMultipartNameToManyParts | {0} '{1}', the current limit of '{2}' is insufficient. ADP_InvalidMultipartNameToManyParts | {0} ""{1}"", the current limit of ""{2}"" is insufficient. Arg_ArrayPlusOffTooSmall | Array is not long enough. Check array index and length. Arg_ArrayPlusOffTooSmall | Destination array is not long enough to copy all the items in the collection. Check array index and length. Arg_EnumIllegalVal | Illegal enum value: {0}. Arg_EnumIllegalVal | Illegal enum value: {0} Arg_HTCapacityOverflow | Capacity overflowed and went negative. Arg_HTCapacityOverflow | Hashtable's capacity overflowed and went negative. Check load factor, capacity and the current size of the table. Arg_InvalidSearchPattern | Arg_InvalidSearchPattern {0} Arg_InvalidSearchPattern | Search pattern cannot contain '..' to move up directories and can be contained only internally in file/directory names, as in 'a..b'. Argument_AddingDuplicate | An entry with the same key already exists. Argument_AddingDuplicate | An item with the same key has already been added. Key: {0} Argument_InvalidHandle | handle' has been disposed or is an invalid handle. Argument_InvalidHandle | Invalid handle. Argument_InvalidPathChars | Argument_InvalidPathChars {0} Argument_InvalidPathChars | Illegal characters in path '{0}'. Argument_InvalidValue | Argument {0} should be larger than {1}. Argument_InvalidValue | Arguments are not valid. Argument_InvalidValue | Value was invalid. ArgumentOutOfRange_BiggerThanCollection | Larger than collection size. ArgumentOutOfRange_BiggerThanCollection | Must be less than or equal to the size of the collection. ArgumentOutOfRange_GenericPositive | Number must be positive. ArgumentOutOfRange_GenericPositive | Value must be positive. ArgumentOutOfRange_Index | Index was out of range. Must be non-negative and less than the size of the collection. ArgumentOutOfRange_Index | Index was out of range. Must be non-negative and less than the size of the collection. ArgumentOutOfRange_NeedNonNegNum | Index is less than zero. ArgumentOutOfRange_NeedNonNegNum | Non negative number is required. ArgumentOutOfRange_NeedNonNegNum | Non-negative number required. ArgumentOutOfRange_NeedValidPipeAccessRights | Invalid PipeAccessRights value. ArgumentOutOfRange_NeedValidPipeAccessRights | Need valid PipeAccessRights value. ArrayTypeIsNotSupported | An internal error has occurred. '{0}[]' is not supported when generating code for serialization. ArrayTypeIsNotSupported | Array of type {0} is not supported. CardinalityMismatch_TooManyExports | Only one export for the contract '{0}' is allowed, multiple implementations were found. CardinalityMismatch_TooManyExports | More than one export was found that matches the constraint: {0} Cryptography_InvalidCurveOid | The specified Oid is not valid. The Oid.FriendlyName or Oid.Value property must be set. Cryptography_InvalidCurveOid | The specified Oid is not valid. The Oid.FriendlyName property must be set, or be determined from Oid.Value. IndexOutOfRange_IORaceCondition | Probable I/O race condition detected while copying memory. The I/O package is not thread safe by default. In multithreaded applications, a stream must be accessed in a thread-safe way, such as a thread-safe wrapper returned by TextReader's or TextWriter's Synchronized methods. This also applies to classes like StreamWriter and StreamReader. IndexOutOfRange_IORaceCondition | Probable I/O race condition detected while copying memory. The I/O package is not thread safe by default. In multithreaded applications, a stream must be accessed in a thread-safe way, such as a thread-safe wrapper returned by TextReader's or TextWriter's Synchronized methods. This also applies to classes like StreamWriter and StreamReader. InternalError | Internal error in ScanRegex. InternalError | Internal error in the Microsoft Visual Basic runtime. InternalError | Internal Error InvalidArgument | {1}' is not a valid value for '{0}'. InvalidArgument | Value of '{1}' is not valid for '{0}'. InvalidArgument | The argument is invalid. InvalidOperation_EnumFailedVersion | Collection was modified after the enumerator was instantiated. InvalidOperation_EnumFailedVersion | Collection was modified; enumeration operation may not execute. InvalidOperation_EnumNotStarted | Enumeration has not started. Call MoveNext. InvalidOperation_EnumNotStarted | Enumeration has not started. Call MoveNext. InvalidOperation_EnumOpCantHappen | Enumeration has either not started or has already finished. InvalidOperation_EnumOpCantHappen | Enumerator is positioned before the first element or after the last element of the collection. InvalidOperation_PipeNotYetConnected | Pipe hasn't been connected yet. InvalidOperation_PipeNotYetConnected | Pipe is not connected. InvalidParameter | Invalid value '{1}' for parameter '{0}'. InvalidParameter | Invalid value {1} for parameter {0}. InvalidPdbChecksumDataFormat | Invalid PDB Checksum data data format. InvalidPdbChecksumDataFormat | Invalid PDB Checksum data format. InvalidPrimitiveType | Invalid Primitive Type: {0}. Consider using CodeObjectCreateExpression. InvalidPrimitiveType | Type '{0}' is not a valid serializable type. InvalidToken | A token is not valid. Refer to RFC 2616 for correct grammar of content types. InvalidToken | Invalid token. IO_AlreadyExists_Name | Cannot create '{0}' because a file or directory with the same name already exists. IO_AlreadyExists_Name | Cannot create \""{0}\"" because a file or directory with the same name already exists. IO_FileExists_Name | The file '{0}' already exists. IO_FileNotFound | Unable to find the specified file. IO_FileNotFound_FileName | Could not find file '{0}'. IO_OperationAborted | IO operation was aborted unexpectedly. IO_OperationAborted | The I/O operation has been aborted because of either a thread exit or an application request. IO_PathNotFound_NoPathName | Could not find a part of the path. IO_PathNotFound_Path | Could not find a part of the path '{0}'. IO_PathTooLong | The specified file name or path is too long, or a component of the specified path is too long. IO_PathTooLong | The specified port name is too long. The port name must be less than 260 characters. IO_PathTooLong_Path | The path '{0}' is too long, or a component of the specified path is too long. IO_PathTooLong_Path | The specified port name '{0}' is too long. The port name must be less than 260 characters. IO_SharingViolation_File | The process cannot access the file '{0}' because it is being used by another process. IO_SharingViolation_File | The process cannot access the port '{0}' because it is being used by another process. IO_SharingViolation_NoFileName | The process cannot access the file because it is being used by another process. IO_SharingViolation_NoFileName | The process cannot access the port because it is being used by another process. MDF_UnsupportedVersion | requested collection ({0}) is not supported by this version of the provider. MDF_UnsupportedVersion | The requested collection ({0}) is not supported by this version of the provider. net_context_buffer_too_small | Insufficient buffer space. Required: {0} Actual: {1}. net_context_buffer_too_small | Insufficient buffer space. Required: {0} Actual: {1} net_gssapi_operation_failed | GSSAPI operation failed with status: {0} (Minor status: {1}). net_gssapi_operation_failed | GSSAPI operation failed with status: {0} (Minor status: {1}) net_gssapi_operation_failed_detailed | Gss api operation failed with error : {0} ({1}). net_gssapi_operation_failed_detailed | GSSAPI operation failed with error - {0} ({1}). net_nego_not_supported_empty_target_with_defaultcreds | Target name should be non empty if default credentials are passed. net_nego_not_supported_empty_target_with_defaultcreds | Target name should be non-empty if default credentials are passed. net_nego_protection_level_not_supported | Requested protection level is not supported with the GSSAPI implementation currently installed. net_nego_protection_level_not_supported | Requested protection level is not supported with the gssapi implementation currently installed. net_nego_server_not_supported | Server implementation is not supported. net_nego_server_not_supported | Server implementation is not supported NoNegativeTime | A negative value is not permitted for the replication interval. NoNegativeTime | A negative value is not permitted for the time limit. NotSupported | Not supported on this platform. NotSupported | This operation is not supported. ObjectDisposed_StreamClosed | Can not access a closed Stream. ObjectDisposed_StreamClosed | Cannot access a closed Stream. Serialization_MissingKeys | The keys for this dictionary are missing. Serialization_MissingKeys | The Keys for this Hashtable are missing. Serialization_MissingValues | The values for this dictionary are missing. Serialization_MissingValues | The Values for this Hashtable are missing. SqlConvert_ConvertFailed | Cannot convert object of type '{0}' to object of type '{1}'. SqlConvert_ConvertFailed | Cannot convert object of type '{0}' to object of type '{1}'. SupportedPlatforms | System.DirectoryServices.Protocols namespace is only supported on Windows 2000 and later operating systems. SupportedPlatforms | The System.DirectoryServices.ActiveDirectory namespace is only supported on computers running Windows 2000 and later operating systems. UnauthorizedAccess_IODenied_NoPathName | Access to the path is denied. UnauthorizedAccess_IODenied_NoPathName | Access to the port is denied. UnauthorizedAccess_IODenied_NoPathName | UnauthorizedAccess_IODenied_NoPathName UnauthorizedAccess_IODenied_Path | Access to the path '{0}' is denied. UnauthorizedAccess_IODenied_Path | Access to the port '{0}' is denied. UnauthorizedAccess_IODenied_Path | UnauthorizedAccess_IODenied_Path {0} UnknownConstantType | Internal Error: Unrecognized constant type {0}. UnknownConstantType | Unrecognized constant type '{0}'. Xml_InvalidPrefix | Prefixes beginning with ""xml"" (regardless of whether the characters are uppercase, lowercase, or some combination thereof) are reserved for use by XML. Xml_InvalidPrefix | Prefix '{0}' is not valid, because it contains special characters. XmlInvalidEncoding | Referenced type '{0}' is only valid for encoded SOAP. XmlInvalidEncoding | XML encoding must be 'UTF-8'. " 29227 area-System.IO Cut string allocations for filtered watcher files This changes the Win32 watcher code to not allocate strings until after we've matched the name and know that we're going to actually fire an event. Unix code can be changed to encode into a temporary buffer to get a similar reduction. I'll open an up-for-grabs issue on it. Flip a test to have expected in the expected argument. cc: @danmosemsft, @Anipik 29230 area-System.Runtime Update ApiCompatBaseline for uapaot for System.Runtime Leftover from https://github.com/dotnet/corefx/pull/29138. cc @jkotas, @morganbr 29231 area-System.Memory Created ReadOnlySequence GetPositionAndSliceAreEqual test and fixed where was not Created ReadOnlySequence GetPositionAndSliceAreEqual test to test that all GetPosition methods and Slice methods return the same result for the same input parameters. Fixed where was not. 29232 area-System.Diagnostics Add cross platform support for CLR Runtime counters (JIT, GC) The recent addition of PerformanceCounters to 2.1 only supports Windows. It would be great to offer a cross platform solution that worked on OSX & Linux as well. The main categories that come to mind are .NET CLR Memory (Gen[0-2,Large] Heap Size, % Time in GC, etc...), .NET CLR LocksAndThreads, .NET CLR Jit, .NET CLR Exceptions, and Process. 29233 area-System.Net [release/2.1] Ensure LocalCertificateSelectionCallback is still called with AuthenticateAsServerAsync In .NET Core 2.0, we call LocalCertificateSelectionCallback to choose the certificate during AuthenticateAsServerAsync. As part of adding support for SNI, this functionality was removed. However, some users have already implemented SNI using LocalCertificateSelectionCallback, and we should aim to maintain compatibility for them. This change ensures that we maintain the old behavior of LocalCertificateSelectionCallback when the new SNI callback is not set. The fix has been merged into master in [this commit](https://github.com/dotnet/corefx/commit/eeea6babf28188887f99aa0b459dc5877b39f31e). See issue #29110 for details. cc: @karelz 29236 area-System.Net Invalid HttpListener.Stop() behaviour "SDK Version: 2.1.300-preview2-008533 Commit: 996eb6c92c Runtime OS Name: Windows OS Version: 10.0.16299 OS Platform: Windows RID: win10-x64 Host (useful for support): Version: 2.1.0-preview2-26406-04 Commit: 6833f3026b Method description says ""Causes this instance to stop receiving incoming requests."" In fact after this call all client connections created with specified HttpListener being closed with error. ``` Error System.Net.WebSockets.WebSocketException (0x80004005): An internal WebSocket error occurred. Please see the innerException, if present, for more details. ---> System.Net.HttpListenerException (995): Операция ввода/вывода была прервана из-за завершения потока команд или по запросу приложения at System.Net.WebSockets.WebSocketHttpListenerDuplexStream.ReadAsyncCore(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) at System.Net.WebSockets.WebSocketBase.WebSocketOperation.Process(Nullable`1 buffer, CancellationToken cancellationToken) at System.Net.WebSockets.WebSocketBase.ReceiveAsyncCore(ArraySegment`1 buffer, CancellationToken cancellationToken) at System.Net.WebSockets.WebSocketBase.ThrowIfConvertibleException(String methodName, Exception exception, CancellationToken cancellationToken, Boolean aborted) at System.Net.WebSockets.WebSocketBase.ReceiveAsyncCore(ArraySegment`1 buffer, CancellationToken cancellationToken) at WSTest.Program.Reader(WebSocket webSocket) in C:\Projects\Globo\skillgames\BRANCH\dev\UpDAU\tests\WSTest\Program.cs:line 49 ``` In addition after HttpListener.Stop() call opened ClientWebSocket connection has ""Open"" state but if ClientWebSocket .Close() call performed exception being thrown. ``` Close failed System.IO.IOException: Unable to read data from the transport connection: Удаленный хост принудительно разорвал существующее подключение. ---> System.Net.Sockets.SocketException: Удаленный хост принудительно разорвал существующее подключение --- End of inner exception stack trace --- at System.Net.WebSockets.ManagedWebSocket.SendCloseFrameAsync(WebSocketCloseStatus closeStatus, String closeStatusDescription, CancellationToken cancellationToken) at System.Net.WebSockets.ManagedWebSocket.CloseAsyncPrivate(WebSocketCloseStatus closeStatus, String statusDescription, CancellationToken cancellationToken) at WSTest.Program.Test() in C:\Projects\Globo\skillgames\BRANCH\dev\UpDAU\tests\WSTest\Program.cs:line 94 ``` Here is code I've used to test this case. ```c# using System; using System.Net; using System.Net.WebSockets; using System.Threading; using System.Threading.Tasks; namespace WSTest { class Program { static HttpListener listener = new HttpListener(); static void RunLiStenerAsync(string enpoint) { TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(); Task.Run(async () => { try { listener.Prefixes.Add($""http://{enpoint}/""); listener.Start(); tcs.SetResult(true); while (listener.IsListening) { HttpListenerContext context = listener.GetContext(); if (!context.Request.IsWebSocketRequest) { context.Response.Close(); } else { WebSocket ws = (await context.AcceptWebSocketAsync(null)).WebSocket; Console.WriteLine(""Got client connection""); // start reader async StartReaderAsync(ws); } } Console.WriteLine($""Stop listen at ws://{enpoint}""); } catch (Exception ex) { Console.WriteLine($""Server failed {ex.ToString()}""); } }); tcs.Task.Wait(); Console.WriteLine($""Listen at ws://{enpoint}""); } static void StartReaderAsync(WebSocket webSocket) { Task.Run(async () => { await Reader(webSocket); }); } static async Task Reader(WebSocket webSocket) { int received = 0; while (true) { try { WebSocketReceiveResult result = await webSocket.ReceiveAsync(new ArraySegment<byte>(new byte[1024]), CancellationToken.None); switch (result.MessageType) { case WebSocketMessageType.Text: case WebSocketMessageType.Binary: // chunked packets assembling here received += result.Count; if (result.EndOfMessage == true) { Console.WriteLine($""Received packet {received} bytes""); received = 0; } else { Console.WriteLine($""Received chunk {result.Count} bytes""); } break; case WebSocketMessageType.Close: Console.WriteLine($""Client disconected""); await webSocket.CloseAsync(WebSocketCloseStatus.Empty, null, CancellationToken.None); return; } } catch (Exception ex) { Console.WriteLine($""Error {ex.ToString()}""); return; } } } static async Task Test() { string enpoint = ""localhost:9002""; // listening RunLiStenerAsync(enpoint); // create large buffer to send byte[] buf = new byte[4096]; // connecting ClientWebSocket cws = new ClientWebSocket(); await cws.ConnectAsync(new Uri($""ws://{enpoint}/""), CancellationToken.None); // sending await cws.SendAsync(new ArraySegment<byte>(buf), WebSocketMessageType.Binary, true, CancellationToken.None); // wait for data await Task.Delay(500); // dispose listener listener.Stop(); // wait for stop await Task.Delay(500); try { // closing if (cws.State == WebSocketState.Open) { await cws.CloseAsync(WebSocketCloseStatus.Empty, null, CancellationToken.None); Console.WriteLine(""Closed""); } else { Console.WriteLine(""Already closed""); } } catch (Exception ex) { // pokemon exception handling Console.WriteLine($""Close failed {ex.ToString()}""); } } static void Main(string[] args) { Test().Wait(); } } } ``` Perhaps this is also linked to #28169 [EDIT] Add C# syntax highlighting by @karelz" 29238 area-System.Net Several Http test fixes to hopefully improve test reliability - Add “Connection: close\r\n” response header in more cases where the loopback server explicitly closes a connection, and in particular where the client makes multiple connections. - Change several Task.WaitAlls on paired tasks to instead use our WhenAllOrAnyFailed helper. Fixes https://github.com/dotnet/corefx/issues/27064 (hopefully). The failure from https://github.com/dotnet/corefx/issues/9543 also appears to now be much more deterministic; at least with WinHttpHandler the failure now repros for me every time. cc: @davidsh, @geoffkizer 29239 area-System.Memory "Memory<T>.Slice doesn't preserve ""this buffer is already pinned"" flag" See https://github.com/aspnet/KestrelHttpServer/issues/2510. 29242 area-Infrastructure Post 2.1 RTM: update packageindex to account for 2.1 and harvest all locked reference assemblies /cc @weshaggard @joperezr 29243 area-System.Net Add DecompressionMethods.All? The addition of `System.Net.DecompressionMethods.Brotli` was [recently approved](https://github.com/dotnet/corefx/issues/26995). I have been writing `DecompressionMethods.Deflate | DecompressionMethods.GZip` in my source automatically; since I don't want to exclude the possibility of Brotli, I'm going to be writing `DecompressionMethods.Deflate | DecompressionMethods.GZip | DecompressionMethods.Brotli`. I am very interested in an `All` member, since that sums up exactly what I care about. ```diff namespace System.Net { [Flags] public enum DecompressionMethods { None = 0, GZip = 1, Deflate = 2, Brotli = 4, + All = ~None } } ``` Would you please review this possibility? 29244 area-System.Security Clean SSL error queue: X509 related functions This is a continuation of #25676 clean up, also related to #29188. Below is an assessment of the native functions from CryptoNative related to X509 (80 functions) and suggested actions. - [x] CryptoNative_CheckX509Hostname => Relatively large native, likely leaving errors on queue - [x] CryptoNative_CheckX509IpAddress => Relatively large native, likely leaving errors on queue - [X] CryptoNative_DecodeX509 - covered in push to clean up error queue - [X] CryptoNative_DecodeX509BasicConstraints2Extension - Relatively large native, errors left on queue cleaned on managed side in case of error - [ ] CryptoNative_DecodeX509Crl => single location, missing clean up at usage, check caller - [ ] CryptoNative_DecodeX509Name => single location, missing clean up at usage, check caller - [ ] CryptoNative_EncodeX509 => single location, assert checks no error but for safety error needs to be cleaned in OpenSslEncode src\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Encode.cs - [ ] CryptoNative_EncodeX509SubjectPublicKeyInfo => single location, assert checks no error but for safety error needs to be cleaned in OpenSslEncode src\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Encode.cs - [x] CryptoNative_GetX509CrlNextUpdate => single call, didn't find doc, we should check for null and clean up just in case - [X] CryptoNative_GetX509DerSize - single call, error cleaned in OpenSslEncode - [X] CryptoNative_GetX509EkuField - single call covered by throw Interop.Crypto.CreateOpenSslCryptographicException in case of failure - [X] CryptoNative_GetX509EkuFieldCount - single call, return does not indicate error or not, assuming that it doesn't log errorif we pass valid argument - [X] CryptoNative_GetX509EvpPublicKey - single call covered by CheckValidOpenSslHandle - [x] CryptoNative_GetX509NameEntry => called via GetX509NameEntry_private in GetX509NameEntry, check if caller or SafeInteriorHandle.OpenInteriorHandle handle error - [x] CryptoNative_GetX509NameEntryCount => single call, we should check for negative and clean up just in case - [x] CryptoNative_GetX509NameEntryData => called via GetX509NameEntryData_private in GetX509NameEntryData, check if caller or SafeInteriorHandle.OpenInteriorHandle handle error - [x] CryptoNative_GetX509NameEntryOid => called via GetX509NameEntryOid_private in GetX509NameEntryOid, check if caller or SafeInteriorHandle.OpenInteriorHandle handle error - [x] CryptoNative_GetX509NameInfo => single call not covered, needs to clean up error queue - [X] CryptoNative_GetX509NameRawBytes - no actual call to lib - [x] CryptoNative_GetX509NameStackField => called via GetX509NameStackField_private in GetX509NameStackField, check if caller or SafeInteriorHandle.OpenInteriorHandle handle error - [x] CryptoNative_GetX509NameStackFieldCount => single call, didn't find doc, we should check for negative and clean up just in case - [X] CryptoNative_GetX509NotAfter - no actual call to lib - [X] CryptoNative_GetX509NotBefore - no actual call to lib - [X] CryptoNative_GetX509PublicKeyAlgorithm - no actual call to lib - [X] CryptoNative_GetX509PublicKeyBytes - no actual call to lib - [x] CryptoNative_GetX509PublicKeyParameterBytes => two calls, need to check callers of KeyAlgorithmParameters property, and also relatively large native code - [x] CryptoNative_GetX509RootStoreFile => called via GetX509RootStoreFile_private in GetX509RootStoreFile, needs error clean up in one location - [x] CryptoNative_GetX509RootStorePath => same as above - [X] CryptoNative_GetX509SignatureAlgorithm - no actual call to lib - [x] CryptoNative_GetX509StackField => several calls, cleaned in single one, need to check callers before adding throw for them - [X] CryptoNative_GetX509StackFieldCount - single call, didn't find doc, assuming that it doesn't log errorif we pass valid argument - [X] CryptoNative_GetX509SubjectPublicKeyInfoDerSize - single call covered by OpenSslEncode - [X] CryptoNative_GetX509Thumbprint - single call covered in GetDynamicBuffer - [x] CryptoNative_GetX509Version => single call throws CryptographicException without cleaning the error queue (should we throw more detailed exception?) - [x] CryptoNative_NewX509NameStack => DEADCODE - [x] CryptoNative_NewX509Stack => two calls, call in ExportPfx needs to be double checked (it is covered if handle reaches PushHandle but need deeper check) - [ ] CryptoNative_PemReadBioX509Crl => two locations, need to check from callers, likely need clean up - [X] CryptoNative_PemReadX509FromBio - covered in push to clean up error queue - [ ] CryptoNative_PemWriteBioX509Crl => single call, return code not checked, add clean up - [x] CryptoNative_PushX509NameStackField => DEADCODE - [X] CryptoNative_PushX509StackField - two calls, covered by CreateOpenSslCryptographicException() - [X] CryptoNative_ReadX509AsDerFromBio - covered in push to clean up error queue - [X] CryptoNative_RecursiveFreeX509NameStack - single call, void, assuming that it doesn't log errorif we pass valid argument - [X] CryptoNative_RecursiveFreeX509Stack - single call, void, assuming that it doesn't log errorif we pass valid argument - [X] CryptoNative_SetX509ChainVerifyTime - manager wrapper throw in case of failure - [x] CryptoNative_X509CheckIssued => single call not covered, needs to clean up error queue - [X] CryptoNative_X509CheckPurpose - single call covered by throw CreateOpenSslCryptographicException - [X] CryptoNative_X509CrlDestroy - actually calls X509_CRL_free ensuring the argument is not null, single call, it is void, assuming that it doesn't log error if we pass valid argument - [X] CryptoNative_X509Destroy - actually calls X509_free ensuring the argument is not null, single call, it is void, assuming that it doesn't log error if we pass valid argument - [ ] CryptoNative_X509Duplicate => DEADCODE - [ ] CryptoNative_X509ExtensionCreateByObj => single call not covered, caller FormatNative in C:\s\github\pjanotti\corefx\src\System.Security.Cryptography.Encoding\src\Internal\Cryptography\OpenSslAsnFormatter.cs - [X] CryptoNative_X509ExtensionDestroy - actually calls X509_EXTENSION_free ensuring the argument is not null, single call, it is void, assuming that it doesn't log error if we pass valid argument - [X] CryptoNative_X509ExtensionGetCritical - single call, return does not indicate error or not, assuming that it doesn't log errorif we pass valid argument - [X] CryptoNative_X509ExtensionGetData - single call covered by CheckValidOpenSslHandle - [X] CryptoNative_X509ExtensionGetOid - single call covered by CheckValidOpenSslHandle - [X] CryptoNative_X509GetExt - single call covered by CheckValidOpenSslHandle - [X] CryptoNative_X509GetExtCount - single call, return does not indicate error or not, assuming that it doesn't log errorif we pass valid argument - [X] CryptoNative_X509GetIssuerName - single call covered by ChecckValidOpenSslHandle in LoadX500Name - [x] CryptoNative_X509GetSerialNumber => called via X509GetSerialNumber_private in X509GetSerialNumber, check if caller or SafeInteriorHandle.OpenInteriorHandle handle error - [X] CryptoNative_X509GetSubjectName - single call covered by ChecckValidOpenSslHandle in LoadX500Name - [ ] CryptoNative_X509IssuerNameHash => single call returns hash, likely doesn't log errorif we pass valid argument, https://github.com/dotnet/corefx/issues/28724 - [X] CryptoNative_X509NameDestroy - actually calls X509_NAME_free ensuring the argument is not null, single call, it is void, assuming that it doesn't log error if we pass valid argument - [X] CryptoNative_X509StoreAddCert - single call covered by throw Interop.Crypto.CreateOpenSslCryptographicException in case of failure - [X] CryptoNative_X509StoreAddCrl - covered in push to clean up error queue - [X] CryptoNative_X509StoreCreate - single call covered by CheckValidOpenSslHandle - [X] CryptoNative_X509StoreCtxCreate - single call covered by CheckValidOpenSslHandle - [X] CryptoNative_X509StoreCtxDestroy - actually calls X509_STORE_CTX_free ensuring the argument is not null, single call, it is void, assuming that it doesn't log error if we pass valid argument - [x] CryptoNative_X509StoreCtxGetChain => single call not covered, although calling method throws CryptographicException on other points - [x] CryptoNative_X509StoreCtxGetError => single call returns code, likely doesn't log errorif we pass valid argument - [x] CryptoNative_X509StoreCtxGetErrorDepth => single call returns code, likely doesn't log errorif we pass valid argument - [X] CryptoNative_X509StoreCtxGetSharedUntrusted - no actual call to lib - [X] CryptoNative_X509StoreCtxGetTargetCert - no actual call to lib - [X] CryptoNative_X509StoreCtxInit - single call covered by throw Interop.Crypto.CreateOpenSslCryptographicException in case of failure - [X] CryptoNative_X509StoreCtxSetVerifyCallback- single call, it is void, assuming that it doesn't log error if we pass valid argument - [X] CryptoNative_X509StoreDestoryactually - calls X509_STORE_free ensuring the argument is not null, single call, it is void, assuming that it doesn't log error if we pass valid argument - [X] CryptoNative_X509StoreSetRevocationFlag - single call covered by throw Interop.Crypto.CreateOpenSslCryptographicException in case of failure - [X] CryptoNative_X509UpRef - called in many places, internally calls CRYPTO_add, assuming that it doesn't log error if we pass valid argument - [ ] CryptoNative_X509V3ExtPrint => single call not covered, caller FormatNative in C:\s\github\pjanotti\corefx\src\System.Security.Cryptography.Encoding\src\Internal\Cryptography\OpenSslAsnFormatter.cs - [ ] CryptoNative_X509VerifyCert => 2 calls one not covered in VerifyCertChain in C:\s\github\pjanotti\corefx\src\System.Net.Http\src\System\Net\Http\CurlHandler\CurlHandler.SslProvider.Linux.cs - [X] CryptoNative_X509VerifyCertErrorString - single call, returns string for error code, likely doesn't log errorif we pass valid error code 29245 area-System.Runtime TimeZoneInfo.ConvertTimeFromUtc makes ToUnixTimeMilliseconds wrong in linux "``` Console.WriteLine(new DateTimeOffset(DateTime.UtcNow).ToUnixTimeMilliseconds()); Console.WriteLine(new DateTimeOffset(DateTime.Now).ToUnixTimeMilliseconds()); Console.WriteLine(new DateTimeOffset(TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, TimeZoneInfo.FindSystemTimeZoneById(""America/New_York""))).ToUnixTimeMilliseconds()); ``` the 3rd line generates different value than the previous 2 in linux " 29246 area-System.Memory Preserve pinned flag in {ReadOnly}Memory<T>.Slice Fixes https://github.com/dotnet/corefx/issues/29239 cc @joshfree, @GrabYourPitchforks, @geoffkizer, @stephentoub, @benaadams This change will need to be mirrored to coreclr. cc @Anipik, @safern 29247 area-System.Runtime Considering merging Intel HW Intrinsics for SSE and SSE2 This was discussed during the API design (https://github.com/dotnet/corefx/pull/23489#issuecomment-326433485) but has come under discussion again in the context of https://github.com/dotnet/coreclr/pull/17691. A related issue is, if the APIs remain separate, how to deal with an API, e.g. `SetZeroVector128` that provides support for float vectors in SSE, but supports the full range of generic types in SSE2. 29248 area-Infrastructure Run mirror between corefx release/2.1 and coreclr release/2.1 We have noticed there are several commits missing in the coreclr release/2.1 branch that exists in corefx release/2.1 branch. This means the mirror is not running on the release/2.1 branch and only runs on master. This could lead to unexpected bugs in the product. For example, this PR just got opened for master, but corefx/2.1 and coreclr/2.1 are out of sync: https://github.com/dotnet/coreclr/pull/17709 cc @weshaggard, @RussKeldorph, @joshfree, @Anipik, @safern 29249 area-Infrastructure Remove workaround in package testing See https://github.com/dotnet/corefx/pull/29241#issuecomment-383237638 We're walking the closure of packages that build on top of netcoreapp2.1. Those build using live references but the current package testing infrastructure tests against an LKG framework package. As a result when we bump reference versions every package will see a break until we get an updated LKG with the new reference assemblies. Once we have a new Microsoft.NETCore.App we can remove this closure exception. 29250 area-System.Memory Coudn't build System.Memory for netfx TargetGroup Next command `msbuild /t:Build /p:ConfigurationGroup=Debug /p:TargetGroup=netfx` return next errors in log: ``` ReportConfigurationErrorMessage: C:\Code\corefx\src\System.Runtime\ref\System.Runtime.csproj ConfigurationErrorMessage: Could not find a compatible configuration for BuildConfiguration 'netfx-Windows_NT-Debug-x64' from BuildConfigurations ';netcoreapp;uap;;'. Considered netfx-Windows_NT;net461-Windows_NT;net46-Windows_NT;net451-Windows_NT;net45-Windows_NT;netstandard-Windows_NT;netstandard2.0-Windows_NT;netstandard1.6-Windows_NT;netstandard1.5-Windows_NT;netstandard1.4-Windows_NT;netstandard1.3-Windows_NT;netstandard1.2-Windows_NT;netstandard1.1-Windows_NT;netstandard1.0-Windows_NT;netfx;netfx-AnyOS;net461;net461-AnyOS;net46;net46-AnyOS;net451;net451-AnyOS;net45;net45-AnyOS;netstandard;netstandard-AnyOS;netstandard2.0;netstandard2.0-AnyOS;netstandard1.6;netstandard1.6-AnyOS;netstandard1.5;netstandard1.5-AnyOS;netstandard1.4;netstandard1.4-AnyOS;netstandard1.3;netstandard1.3-AnyOS;netstandard1.2;netstandard1.2-AnyOS;netstandard1.1;netstandard1.1-AnyOS;netstandard1.0;netstandard1.0-AnyOS.Could not find a value for TargetGroup from Configuration ''. ``` There is no error for `uap` and `netcoreapp` TargetGroup only for `netfx`. Also build from root is successful `build -framework=netfx` 29251 area-System.Memory Add tests to check Memory<T>.Slice doesn't reset the high-bit in length Addendum to https://github.com/dotnet/corefx/pull/29246 cc @stephentoub, @GrabYourPitchforks, @joshfree, @KrzysztofCwalina 29252 area-System.Memory [release/2.1] Port Preserve pinned flag in {ReadOnly}Memory<T>.Slice (#29246) Fixes #29239 (port of PR #29246 in master) cc @joshfree, @GrabYourPitchforks, @geoffkizer, @stephentoub, @benaadams, @davidfowl 29254 area-System.Reflection System.Reflection.Emit: ILGenerator.Emit(OpCodes.Ldtoken, <MethodInfo>) produces incorrect metadata for methods with C# 7.2 `in` parameters in generic types "@TAGC recently noted in https://github.com/castleproject/Core/issues/339#issuecomment-372605885 that DynamicProxy-based mocking libraries (e.g. Moq, NSubstitute) appear to have problems mocking the following generic interface: > ```csharp > public interface IGenericStructByRefConsumer<T> > { > T Consume(in Struct message); > } > ``` Mocking such a type will typically result in a `MissingMethodException`. It only seems to occur with generic types/methods, and in the presence of a C# 7.2 `in` parameter modifier. I've been able to track this down to what appears to be a bug in System.Reflection.Emit. A brief description follows below; if more detail or code is required, I can probably provide it... please ask. --- Given this C# 7.2+ interface: ```csharp public interface WithIn<T> { void Method(in int arg); } ``` <details> <summary>(Expand to see the equivalent type definition in IL.)</summary> ``` .class public abstract interface auto ansi WithIn`1<T> { .method public hidebysig newslot abstract virtual instance void Method([in] int32& modreq([mscorlib]System.Runtime.InteropServices.InAttribute) arg) cil managed { .param [1] .custom instance void [mscorlib]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) } } ``` </details> <br> DynamicProxy would need to generate the following IL instruction sequence using a `System.Reflection.Emit.ILGenerator` (because it caches `MethodInfo` for proxied methods): ``` ldtoken method instance void class WithIn`1<int32>::Method(int32& modreq([mscorlib]System.Runtime.InteropServices.InAttribute)) ldtoken class WithIn`1<int32> call class [mscorlib]System.Reflection.MethodBase ``` This is how one would supposedly do it with `ILGenerator`: ```csharp var methodType = typeof(WithIn<int>); var method = methodType.GetMethod(""Method""); var getMethodFromHandle = typeof(MethodBase).GetMethod(""GetMethodFromHandle"", new[] { typeof(RuntimeMethodHandle), typeof(RuntimeTypeHandle) }); ilGenerator.Emit(OpCodes.Ldtoken, method); // <-- !!! ilGenerator.Emit(OpCodes.Ldtoken, methodType); ilGenerator.EmitCall(OpCodes.Call, getMethodFromHandle, null); ``` I've verified (by saving the dynamic assembly to disk using the .NET Framework 4.7, then dumping it with ILDASM) that the following IL is generated instead: ``` ldtoken method instance void class WithIn`1<int32>::Method(int32&) ldtoken class WithIn`1<int32> call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle, ``` Note the absence of the `modreq` in the first instruction's method reference. This will result in a `MissingMethodException` (because method signatures don't match) when the generated code is run: > System.MissingMethodException: Method not found: 'Void IWithIn`1.Method(Int32 ByRef)'. The same `MissingMethodException` occurs with .NET Core 2.0, so I suspect it inherited the exact same problem from the .NET Framework. If you'd rather have repro code for .NET Core, you'll find it below. <details> <summary>(Expand for an error reproduction on .NET Core.)</summary> ```csharp using System; using System.Diagnostics; using System.Reflection; using System.Reflection.Emit; public interface WithIn<T> { void Method(in int arg); } class Program { static void Main() { var methodType = typeof(WithIn<int>); var method = methodType.GetMethod(""Method""); var getMethodFromHandle = typeof(MethodBase).GetMethod(""GetMethodFromHandle"", new[] { typeof(RuntimeMethodHandle), typeof(RuntimeTypeHandle) }); var assemblyBuilder = AssemblyBuilder.DefineDynamicAssembly(new AssemblyName(""DynamicAssembly""), AssemblyBuilderAccess.Run); var moduleBuilder = assemblyBuilder.DefineDynamicModule(""DynamicModule""); var typeBuilder = moduleBuilder.DefineType(""DynamicType"", TypeAttributes.Public | TypeAttributes.Abstract | TypeAttributes.Class); var methodBuilder = typeBuilder.DefineMethod(""Get"", MethodAttributes.Public | MethodAttributes.Static, typeof(MethodBase), new Type[0]); var ilBuilder = methodBuilder.GetILGenerator(); ilBuilder.Emit(OpCodes.Ldtoken, method); ilBuilder.Emit(OpCodes.Ldtoken, methodType); ilBuilder.EmitCall(OpCodes.Call, getMethodFromHandle, null); ilBuilder.Emit(OpCodes.Ret); var type = typeBuilder.CreateType(); var il = type.GetMethod(""Get"").GetMethodBody().GetILAsByteArray(); Debug.Assert(il[0] == OpCodes.Ldtoken.Value, ""First op-code is not `ldtoken`.""); var ilMethodMetadataToken = BitConverter.ToInt32(il, 1); Debug.Assert(type.Module.ResolveMethod(ilMethodMetadataToken) == method, ""First `ldtoken` does not refer to the correct method.""); } } ``` </details> <br> Note again that this problem only occurs for methods in generic types/methods, and in the presence of an `in` parameter modifier. /cc @jonorossi (for DynamicProxy), @zvirja (for NSubstitute), @thomaslevesque (for FakeItEasy)" 29257 area-System.Memory Enable Create From Pinned Array Slice tests for core ~Depends on new coreclr build.~ Enabling tests added in https://github.com/dotnet/corefx/pull/29246 cc @stephentoub, @GrabYourPitchforks, @joshfree, @KrzysztofCwalina 29258 area-System.Runtime API Proposal: RuntimeFeature.HasJit # Rationale The most efficient patterns for reflection depend on the current runtime. On .NET Core, ```System.Reflection. Emit``` or LINQ Expressions are usually most efficient because the JIT compiles them at runtime. However, for .NET Native, CoreRT, (and I believe Mono AoT), ```System.Reflection.Emit``` isn't available and LINQ Expressions are interpreted. Mono has progress on an interpreter that could make ```System.Reflection.Emit``` work, but it would still likely be less efficient than using reflection APIs directly. Library developers occasionally ask for a way to find out what will both work and be efficient on the current runtime. This has come up in #10470 and https://github.com/aspnet/Home/issues/3079. # Proposed API Add ```HasJit``` ~~and ```CanEmitIL```~~ properties to the existing ```System.Runtime.CompilerServices.RuntimeFeature``` class: ``` public class RuntimeFeature { public static bool HasJit { get; } } ``` ```HasJit``` is true if the current runtime can emit optimized native code at runtime. ~~CanEmitIL is true if System.Reflection.Emit works at all, whether it's implemented by a JIT or an interpreter.~~ # Example Usage Serializers or dependency injection frameworks often have methods that construct an object with some knowledge of its signature. With this API, it could be optimized to look something like this: ``` T CreateInstance<T>(int ctorParameter) { if (RuntimeFeature.HasJit) { // Since this runtime has a JIT, use refemit to construct a specialized method if(cachedFactoryMethodDelegate == null) { DynamicMethod factoryMethod = new DynamicMethod(...); // Emit some IL to instantiate T cachedFactoryMethodDelegate = (Func<int, T>)factoryMethod.CreateDelegate(typeof(Func<int, T>)); } return cachedFactoryMethodDelegate(ctorParameter); } else { // No JIT, just use reflection ConstructorInfo ctorInfo = typeof(T).GetConstructor(new Type[] { typeof(int)}); return (T)ctorInfo.Invoke(ctorParameter); } } 29260 area-System.Xml About 40% regression or the XmlDocument performance test Create() "_From @maryamariyan on April 21, 2018 1:43_ The Regression for the XmlDocument performance test [Create()](https://github.com/dotnet/corefx/blob/697e2b910e6cccbc1f3d58be111e309db4823ab7/src/System.Private.Xml/tests/XmlDocument/Performance/Perf.XmlDocument.cs#L16) is illustrated in the chart below. <img width=""1062"" alt=""screen shot 2018-04-20 at 6 03 33 pm"" src=""https://user-images.githubusercontent.com/5897654/39078880-32feeb30-44c5-11e8-9886-3b5f311fb9c5.png""> Refer to [benchview](https://benchview/trendline?build_selector=latest&count=2000&aggregate=arithmeticMean&filterTail=one&filterVal=100&interval=INTERVAL_MIN_MAX&rtids=[957]&archids=[23]&mpids=[1292]&cfgids=[2785,2706]&testids=[61756]&jobid=94550&) for more details. @krwq I was looking at the Marvin hashcode commit dotnet/corefx@697e2b9 you submitted in January and it seems when instantiating XmlDocument it suddenly regressed. Was this by design or not intentional? Overall the regression is about 45% on Linux (and around 30% on Windows). Although the regression seems to have started from January, there have been some ups and downs since so not exactly sure if I can find the exact root cause for the overall regression here in a straightforward way. The test Create() as seen [here](https://github.com/dotnet/corefx/blob/697e2b910e6cccbc1f3d58be111e309db4823ab7/src/System.Private.Xml/tests/XmlDocument/Performance/Perf.XmlDocument.cs#L16), just attempts to create new XmlDocument() multiple times. cc: @kouvel @danmosemsft _Copied from original issue: dotnet/coreclr#17715_" 29262 area-System.Memory Refactoring ReadOnlySequence tests I refactored ReadOnlySequence tests to remove code duplicates and to not duplicate tests in future. It was part of https://github.com/dotnet/corefx/pull/29231 PR 29263 area-System.Memory Portable Span IndexOf for OrdinalIgnoreCase I added Portable Span IndexOf for OrdinalIgnoreCase. Close https://github.com/dotnet/corefx/issues/28336 issue. I did not found any performance tests for any Span methods with OrdinalIgnoreCase comparison. Should I add such test inly for Span IndexOf or for other Span methods also? 29264 area-Infrastructure Build for netfx does not run tests if tests source files was not changed To run `netfx` tests for `System.Memory` library I use next command `..\..\build . -framework:netfx` in `src\System.Memory ` folder. If source files for tests are not changed than this command does not start tests. It only build library. To run tests I should change some source file in `src\System.Memory\tests` folder. If run `build` command without `-framework:netfx` option it will run tests always. But I want run tests for `netfx` without touching tests source files. Can it be fixed? 29265 area-System.Diagnostics System.Diagnostics.Activity does not use Correlation-Context: Id in GetRootId While `Activity` is implementing the hierarchical request id spec, in the case of a mixed hierarchical and non-hierarchical scenario, if the parent service only supports the flat request id, but it sets the `Correlation-Context: Id` header, then that `Id` should have made it into the baggage and would be available to pull from. I think `Activity.RootId` should also check the baggage keys in addition to the `Id` and `ParentId`. @lmolkova as an author of the spec and `Activity` implementation. 29266 area-System.Reflection Reflection.Emit.ILGeneration.Tests test fails in CI for OSX "From https://github.com/dotnet/corefx/pull/29259 https://mc.dot.net/#/user/dotnet-maestro-bot/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/b2c471b57bdf01d46ed9c2855b460880d2fc1c12/workItem/System.Reflection.Emit.ILGeneration.Tests/wilogs OSX.1012.Amd64.Open-x64:Debug System.Reflection.Emit.ILGeneration.Tests ```text 2018-04-21 07:07:20,391: INFO: proc(54): run_and_log_output: Output: Discovering: System.Reflection.Emit.ILGeneration.Tests 2018-04-21 07:07:20,532: INFO: proc(54): run_and_log_output: Output: Discovered: System.Reflection.Emit.ILGeneration.Tests 2018-04-21 07:07:20,595: INFO: proc(54): run_and_log_output: Output: Starting: System.Reflection.Emit.ILGeneration.Tests 2018-04-21 07:07:20,824: INFO: proc(54): run_and_log_output: Output: 0 2018-04-21 07:07:20,824: INFO: proc(54): run_and_log_output: Output: emitWriteLine 2018-04-21 07:07:20,824: INFO: proc(54): run_and_log_output: Output: False 2018-04-21 07:07:26,786: INFO: proc(54): run_and_log_output: Output: /Users/dotnet-bot/dotnetbuild/work/e9b67638-12f9-4fe2-9c10-da8dac0aea76/Work/bf31de7e-072c-41df-a5da-15dd5fe59d9c/Unzip/RunTests.sh: line 129: 87728 Segmentation fault: 11 (core dumped) $RUNTIME_PATH/dotnet xunit.console.netcore.exe System.Reflection.Emit.ILGeneration.Tests.dll -xml testResults.xml -notrait Benchmark=true -notrait category=nonnetcoreapptests -notrait category=nonosxtests -notrait category=OuterLoop -notrait category=failing 2018-04-21 07:07:27,085: INFO: proc(54): run_and_log_output: Output: Traceback (most recent call last): 2018-04-21 07:07:27,085: INFO: proc(54): run_and_log_output: Output: File ""/Users/dotnet-bot/.dumpling/dumpling.py"", line 33, in <module> 2018-04-21 07:07:27,085: INFO: proc(54): run_and_log_output: Output: import psutil 2018-04-21 07:07:27,085: INFO: proc(54): run_and_log_output: Output: ImportError: No module named psutil 2018-04-21 07:07:27,096: INFO: proc(54): run_and_log_output: Output: Trying to find crash dumps for project: System.Reflection.Emit.ILGeneration.Tests 2018-04-21 07:07:27,096: INFO: proc(54): run_and_log_output: Output: Uploading dump file: /Users/dotnet-bot/dotnetbuild/work/e9b67638-12f9-4fe2-9c10-da8dac0aea76/Work/bf31de7e-072c-41df-a5da-15dd5fe59d9c/Unzip/core.87728 2018-04-21 07:07:27,103: INFO: proc(54): run_and_log_output: Output: ~/dotnetbuild/work/e9b67638-12f9-4fe2-9c10-da8dac0aea76/Work/bf31de7e-072c-41df-a5da-15dd5fe59d9c/Unzip 2018-04-21 07:07:27,107: INFO: proc(54): run_and_log_output: Output: ----- end 07:07:27 ----- exit code 139 ---------------------------------------------------------- 2018-04-21 07:07:27,107: INFO: proc(54): run_and_log_output: Output: exit code 139 means SIGSEGV Illegal memory access. Deref invalid pointer, overrunning buffer, stack overflow etc. Core dumped. 2018-04-21 07:07:27,111: INFO: proc(58): run_and_log_output: Exit Code: 139 2018-04-21 07:07:27,111: ERROR: scriptrunner(91): _main: Error: No exception thrown, but XUnit results not created 2018-04-21 07:07:27,111: ERROR: helix_test_execution(83): report_error: Error running xunit None ```" 29268 area-Meta Fix crossfs build for armel jessie The source list was incorrectly containing stable/main sources in addition to the jessie/main. That caused the openssl 1.1 to creep in and the build with such crossfs was failing since we were trying to compile against ssl 1.1 headers. The reason why it was working in the past is that the stable branch used to be something older and so it didn't have this issue. The stable repo reference most likely came from coreclr where it was needed to get the lldb-dev package. 29269 area-System.Drawing SystemColors values wrong Hi guys, I noticed that the values of SystemColors are wrong in 2.0, so I checked with 2.1 and they were alright. It looks like SystemColors is exposed in different places for 2.0/2.1 and I don't get where things go wrong. ### NET Core 2.0 ``` SystemColors.ActiveBorder = Color [AliceBlue] SystemColors.ActiveCaption = Color [AntiqueWhite] SystemColors.ActiveCaptionText = Color [Aqua] SystemColors.AppWorkspace = Color [Aquamarine] SystemColors.ButtonFace = Color [] SystemColors.ButtonHighlight = Color [] SystemColors.ButtonShadow = Color [] SystemColors.Control = Color [Azure] SystemColors.ControlDark = Color [Beige] SystemColors.ControlDarkDark = Color [Bisque] SystemColors.ControlLight = Color [Black] SystemColors.ControlLightLight = Color [BlanchedAlmond] SystemColors.ControlText = Color [Blue] SystemColors.Desktop = Color [BlueViolet] SystemColors.GradientActiveCaption = Color [] SystemColors.GradientInactiveCaption = Color [] SystemColors.GrayText = Color [Brown] SystemColors.Highlight = Color [BurlyWood] SystemColors.HighlightText = Color [CadetBlue] SystemColors.HotTrack = Color [Chartreuse] SystemColors.InactiveBorder = Color [Chocolate] SystemColors.InactiveCaption = Color [Coral] SystemColors.InactiveCaptionText = Color [CornflowerBlue] SystemColors.Info = Color [Cornsilk] SystemColors.InfoText = Color [Crimson] SystemColors.Menu = Color [Cyan] SystemColors.MenuBar = Color [] SystemColors.MenuHighlight = Color [] SystemColors.MenuText = Color [DarkBlue] SystemColors.ScrollBar = Color [DarkCyan] SystemColors.Window = Color [DarkGoldenrod] SystemColors.WindowFrame = Color [DarkGray] SystemColors.WindowText = Color [DarkGreen] ``` ### NET Core 2.1 (Preview) ``` SystemColors.ActiveBorder = Color [ActiveBorder] SystemColors.ActiveCaption = Color [ActiveCaption] SystemColors.ActiveCaptionText = Color [ActiveCaptionText] SystemColors.AppWorkspace = Color [AppWorkspace] SystemColors.ButtonFace = Color [ButtonFace] SystemColors.ButtonHighlight = Color [ButtonHighlight] SystemColors.ButtonShadow = Color [ButtonShadow] SystemColors.Control = Color [Control] SystemColors.ControlDark = Color [ControlDark] SystemColors.ControlDarkDark = Color [ControlDarkDark] SystemColors.ControlLight = Color [ControlLight] SystemColors.ControlLightLight = Color [ControlLightLight] SystemColors.ControlText = Color [ControlText] SystemColors.Desktop = Color [Desktop] SystemColors.GradientActiveCaption = Color [GradientActiveCaption] SystemColors.GradientInactiveCaption = Color [GradientInactiveCaption] SystemColors.GrayText = Color [GrayText] SystemColors.Highlight = Color [Highlight] SystemColors.HighlightText = Color [HighlightText] SystemColors.HotTrack = Color [HotTrack] SystemColors.InactiveBorder = Color [InactiveBorder] SystemColors.InactiveCaption = Color [InactiveCaption] SystemColors.InactiveCaptionText = Color [InactiveCaptionText] SystemColors.Info = Color [Info] SystemColors.InfoText = Color [InfoText] SystemColors.Menu = Color [Menu] SystemColors.MenuBar = Color [MenuBar] SystemColors.MenuHighlight = Color [MenuHighlight] SystemColors.MenuText = Color [MenuText] SystemColors.ScrollBar = Color [ScrollBar] SystemColors.Window = Color [Window] SystemColors.WindowFrame = Color [WindowFrame] SystemColors.WindowText = Color [WindowText] ``` 29270 area-Infrastructure Dumpling documentation points to empty website https://github.com/dotnet/corefx/blob/master/Documentation/debugging/crash-dumps.md has link to https://dumpling.azurewebsites.net/ . This is a empty website. What is the up to date way to get dumpling crash dumps for corefx? 29271 area-Serialization DataContractJsonSerializer: I-JSON Option Request Related: https://github.com/javaee/jsonb-spec/issues/80 29273 area-System.IO Add FileSystem.Watcher.FilterList Property "# Rationale Currently there is no support for using multiple regex filters to monitor the file system using FileSystemWatcher Class. eg. If we want to monitor files with two extensions (.dll and .pdb), we wont be able to directly to due it. There are 2 ways to work around this issue but non of them is optimal. 1. Create an instance of fileSystemWatcher class and listen to all the files using ```""*"" ``` filter and then prune the files manually in the event handler. ``` eg. If (filename.endswith(""*.txt"") || filename.endswith(""*.csv"")) // do ``` This approach is highly inefficient because first of all we are listening to all files and then user have to manually filter the files which defeats the purpose of having the ```Filter``` in the first place. Here are some links where people asked for this new functionality but has to settle down for this approach https://stackoverflow.com/questions/6965184/how-to-set-filter-for-filesystemwatcher-for-multiple-file-types https://social.msdn.microsoft.com/Forums/vstudio/en-US/91ebc868-2661-4477-b825-5b796d020ab1/how-do-i-setup-filewatcher-filter-for-multiple-document-types?forum=csharpgeneral https://stackoverflow.com/questions/38467389/filter-to-not-include-multiple-extensions 2. The Second approach is two create multiple instances of FileSystemWatcher with different regex filters and hook them to the same event handlers. # Proposed API ``` C# namespace System.IO { public class FileSystemWatcher { public Collection<string> FilterList { get; set; } } } ``` Currently we use ```string _filter``` as a backing field for ```Filter``` property. I suggest using ```Collection<string> _filterList``` as a backing field for both the ```Filter and FilterList Property```. Filter property will always return the first element of the list (In Case of multiple Filters too) # Implementation Branch https://github.com/Anipik/corefx/tree/Filter This is the rough implementation of the api and how it will modify the ```constructor and Filter property```. >what happens when you set Filter? It just sets the first element and does not reduce the size of collection. >What happens if you set FilterList to null or empty or clear it or removeall items using removeAt? In all the above cases, we change it to the collection with just only one element i.e ```*``` >What do we do if an element in Filters is null or empty? If we match everything, can/should we optimize? We never have a ```null or empty element``` in the collection. We always replace it with ```*``` while adding to the collection >If we match everything, can/should we optimize? We can optimise by not going further through the collection of the list if we encounter ```*```. >What about a constructor overload that takes the filters? we can use Initializer to initialize the FilterList ``` var watcher3 = new FileSystemWatcher() { FilterList = new Collection<string> { ""*.pdb"", "".exe"", "".doc"" } }; Assert.Equal(3, watcher3.FilterList.Count); ``` It will be breaking change as ```FileSystemWatcher(""path"", null)``` will be ambiguous call for ```FileSystemWater(string path, IEnumnerable<string> FilterList)``` # Usage ``` C# var watcher = new FileSystemWatcher(); watcher.FilterList[0] = ""*.pdb""; watcher.FilterList.Add(""*.exe""); watcher.FilterList.Add(""*.dll""); Assert.Equal(3, watcher.FilterList.Count); var watcher2 = new FileSystemWatcher( @""C:\git\corefx"",""*.pdb""); watcher2.FilterList.Add(""*.exe""); watcher2.FilterList.Add(""*.dll""); Assert.Equal(3, watcher2.FilterList.Count); var watcher3 = new FileSystemWatcher() { FilterList = new Collection<string> { ""*.pdb"", "".exe"", "".doc"" } }; Assert.Equal(3, watcher3.FilterList.Count); var watcher4 = new FileSystemWatcher() { FilterList = null }; Assert.Equal(1, watcher4.FilterList.Count); var watcher5 = new FileSystemWatcher() { FilterList = new Collection<string> { null } }; Assert.Equal(""*"", watcher5.Filter); var watcher6 = new FileSystemWatcher(); watcher6.FilterList = new Collection<string> { ""*.pdb"", "".exe"", "".doc"" }; Assert.Equal(3, watcher6.FilterList.Count); ``` cc @danmosemsft @JeremyKuhne " 29274 area-System.Diagnostics Add FileLogTraceListener, Log and AspLog classes to .Net Core FileLogTraceListener class is available in .net framework in the Microsoft.VisualBasic.Logging namespace. It has some useful features that are not available in other TraceListeners, as descried here: https://docs.microsoft.com/en-us/dotnet/api/microsoft.visualbasic.logging.filelogtracelistener?view=netframework-4.7.2 This class is not available in .Net Core, so I suggest you add it and make it available to both VB.NET and C#. And I suggest the same for Log Class https://docs.microsoft.com/en-us/dotnet/api/microsoft.visualbasic.logging.log?view=netframework-4.7.2 and AspLog Class: https://docs.microsoft.com/en-us/dotnet/api/microsoft.visualbasic.logging.asplog?view=netframework-4.7.2 29275 area-System.IO FileSecurity fails accessing file with path >= 260 characters "Under .NET Core 2.1.104 (Windows 10 / 64-bit), [FileSecurity](https://github.com/dotnet/corefx/blob/master/src/System.IO.FileSystem.AccessControl/src/System/Security/AccessControl/FileSecurity.cs#L606) fails to read permissions from file that have a path length exceeding 259 characters. Stack trace snippet: ``` Parameter name: name at System.Security.AccessControl.NativeObjectSecurity.CreateInternal(ResourceType resourceType, Boolean isContainer, String name, SafeHandle handle, AccessControlSections includeSections, Boolean createByName, ExceptionFromErrorCode exceptionFromErrorCode, Object exceptionContext) at System.Security.AccessControl.FileSystemSecurity..ctor(Boolean isContainer, String name, AccessControlSections includeSections, Boolean isDirectory) at System.Security.AccessControl.FileSecurity..ctor(String fileName, AccessControlSections includeSections) ``` [Sample code demostrating this](https://gist.github.com/scovetta/01a6bca7881d3772a2b7bcf71cecf6aa) A workaround for this is to prefix the path with `\\?\`, as shown below: ``` // Fails var fs = new FileSecurity(@""c:\temp\really-long-name.txt"", AccessControlSections.All); // Succeeds var fs = new FileSecurity(@""\\?\c:\temp\really-long-name.txt"", AccessControlSections.All); ``` It would be useful if the FileSecurity class (and probably others) could do this on the caller's behalf, or if that could cause breakage, then updating the FileSecurity [documentation](https://github.com/dotnet/dotnet-api-docs/blob/master/xml/System.Security.AccessControl/FileSecurity.xml) to describe this (or if there's a better workaround). " 29277 area-System.Memory How to run System.Memory performance tests for netfx TargetGroup I added performance test for Span.IndexOf with comparisonType parameter. See https://github.com/dotnet/corefx/pull/29263 PR. I want to run them for netfx TargetGroup but next command `msbuild /t:BuildAndTest /p:Performance=true /p:ConfigurationGroup=Release /p:TargetOS=Windows_NT /p:TargetGroup=netfx` doesn't run performance tests for netfx TargetGroup. I need run them for netfx TargetGroup because I need test portable span methods. 29278 area-System.Net "Test System.Net.Security.Tests.SslStreamSniTest.SslStream_ServerCallbackNotSet_UsesLocalCertificateSelection(hostName: \""a\"") failed with ""System.ComponentModel.Win32Exception""" "Test: System.Net.Security.Tests.SslStreamSniTest.SslStream_ServerCallbackNotSet_UsesLocalCertificateSelection(hostName: \""a\"") (from (empty)) has failed. MESSAGE: System.ComponentModel.Win32Exception : The client and server cannot communicate, because they do not possess a common algorithm ~~~ +++++++++++++++++++ STACK TRACE: at System.Net.SSPIWrapper.AcquireCredentialsHandle(SSPIInterface secModule, String package, CredentialUse intent, SCHANNEL_CRED scc) in D:\j\workspace\outerloop_net---92764178\src\Common\src\Interop\Windows\sspicli\SSPIWrapper.cs:line 170 at System.Net.Security.SslStreamPal.AcquireCredentialsHandle(CredentialUse credUsage, SCHANNEL_CRED secureCredential) in D:\j\workspace\outerloop_net---92764178\src\System.Net.Security\src\System\Net\Security\SslStreamPal.Windows.cs:line 472 at System.Net.Security.SslStreamPal.AcquireCredentialsHandle(X509Certificate certificate, SslProtocols protocols, EncryptionPolicy policy, Boolean isServer) in D:\j\workspace\outerloop_net---92764178\src\System.Net.Security\src\System\Net\Security\SslStreamPal.Windows.cs:line 177 at System.Net.Security.SecureChannel.AcquireServerCredentials(Byte[]& thumbPrint, Byte[] clientHello) in D:\j\workspace\outerloop_net---92764178\src\System.Net.Security\src\System\Net\Security\SecureChannel.cs:line 699 at System.Net.Security.SecureChannel.GenerateToken(Byte[] input, Int32 offset, Int32 count, Byte[]& output) in D:\j\workspace\outerloop_net---92764178\src\System.Net.Security\src\System\Net\Security\SecureChannel.cs:line 802 at System.Net.Security.SecureChannel.NextMessage(Byte[] incoming, Int32 offset, Int32 count) in D:\j\workspace\outerloop_net---92764178\src\System.Net.Security\src\System\Net\Security\SecureChannel.cs:line 725 at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) in D:\j\workspace\outerloop_net---92764178\src\System.Net.Security\src\System\Net\Security\SslState.cs:line 744 at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest) in D:\j\workspace\outerloop_net---92764178\src\System.Net.Security\src\System\Net\Security\SslState.cs:line 959 at System.Net.Security.SslState.ReadFrameCallback(AsyncProtocolRequest asyncRequest) in D:\j\workspace\outerloop_net---92764178\src\System.Net.Security\src\System\Net\Security\SslState.cs:line 1125 --- End of stack trace from previous location where exception was thrown --- at System.Net.Security.SslState.ThrowIfExceptional() in D:\j\workspace\outerloop_net---92764178\src\System.Net.Security\src\System\Net\Security\SslState.cs:line 96 at System.Net.Security.SslState.InternalEndProcessAuthentication(LazyAsyncResult lazyResult) in D:\j\workspace\outerloop_net---92764178\src\System.Net.Security\src\System\Net\Security\SslState.cs:line 735 at System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult result) in D:\j\workspace\outerloop_net---92764178\src\System.Net.Security\src\System\Net\Security\SslState.cs:line 705 at System.Net.Security.SslStream.EndAuthenticateAsServer(IAsyncResult asyncResult) in D:\j\workspace\outerloop_net---92764178\src\System.Net.Security\src\System\Net\Security\SslStream.cs:line 271 at System.Net.Security.SslStream.<>c.<AuthenticateAsServerAsync>b__51_1(IAsyncResult iar) in D:\j\workspace\outerloop_net---92764178\src\System.Net.Security\src\System\Net\Security\SslStream.cs:line 430 at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization) in E:\A\_work\48\s\src\mscorlib\src\System\Threading\Tasks\FutureFactory.cs:line 533 --- End of stack trace from previous location where exception was thrown --- at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks) in D:\j\workspace\outerloop_net---92764178\src\Common\tests\System\Threading\Tasks\TaskTimeoutExtensions.cs:line 64 at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks) in D:\j\workspace\outerloop_net---92764178\src\Common\tests\System\Threading\Tasks\TaskTimeoutExtensions.cs:line 92 at System.Net.Security.Tests.SslStreamSniTest.SslStream_ServerCallbackNotSet_UsesLocalCertificateSelection(String hostName) in D:\j\workspace\outerloop_net---92764178\src\System.Net.Security\tests\FunctionalTests\SslStreamSniTest.cs:line 133 ~~~ Details: https://ci.dot.net/job/dotnet_corefx/job/master/job/outerloop_netcoreapp_win7_debug/474/testReport/System.Net.Security.Tests/SslStreamSniTest/SslStream_ServerCallbackNotSet_UsesLocalCertificateSelection_hostName____a___/" 29285 area-System.Net Socket.ConnectAsync with an IPAddress and a failed connection leaves a Socket for finalization "The static Socket.ConnectAsync method creates one or more Sockets to use to establish the connection, and that Socket is then returned when the connection is made successfully. When the connection fails, it's supposed to Dispose of the created Socket(s). But it's failing to do so when something other than a DnsEndPoint is supplied, hitting this code path: https://github.com/dotnet/corefx/blob/4fc38265fb35fd6bfc982b8e35a2545502e596b3/src/System.Net.Sockets/src/System/Net/Sockets/Socket.cs#L3975-L3976 that creates the Socket but then uses the public `ConnectAsync(SocketAsyncEventArgs)`, which can't Dispose of the Socket because it doesn't know that it's one internally created (since it's a public method and the caller owns the Socket instance). This ends up leaking a socket handle / file descriptor until the Socket / SafeHandle's finalizer runs to close it, eventually. This issue exists in both .NET Core and .NET Framework, and appears to have existed for a long time. However, it's showing up as an issue for SocketsHttpHandler, due to this optimization: https://github.com/dotnet/corefx/blob/4fc38265fb35fd6bfc982b8e35a2545502e596b3/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ConnectHelper.cs#L57-L59 where SocketsHttpHandler is trying to take the more optimized IPEndPoint path when an IP address is supplied. This then means that HttpClient failed connects end up leaking a handle / file descriptor similarly until the finalizer runs, which if lots of requests are being made, could result in ""too many open files"" errors on Unix. I'm marking this as a 2.1 issue just for the SocketsHttpHandler fix, as it's a new issue in 2.1. The Sockets issue should be addressed, but it's long-standing and can be deferred to 2.2." 29286 area-System.Net Always use DnsEndPoint in SocketHttpHandler's ConnectAsync We had a minor optimization here, but there's a long-standing issue with Socket.ConnectAsync where it's leaving for finalization a socket when the connect with an IP address fails. It's more important to address that issue, and using DnsEndPoint does so (it's also the code we want, anyway). Contributes to https://github.com/dotnet/corefx/issues/26517 Contributes to https://github.com/dotnet/corefx/issues/29285 cc: @geoffkizer, @davidsh 29287 area-System.Security * NO MERGE * example of tactical changes to ensure SSL error queue is kept clean Addressed the following native calls that were pending from initial list: CryptoNative_Asn1OctetStringNew CryptoNative_Asn1OctetStringSet CryptoNative_BigNumFromBinary CryptoNative_BioDestroy CryptoNative_BioNewFile CryptoNative_BioRead CryptoNative_BioSeek CryptoNative_BioTell CryptoNative_BioWrite CryptoNative_CreateMemoryBio CryptoNative_DecodeAsn1OctetString CryptoNative_DecodeAsn1TypeBytes If the native failure is ignored on managed I opted to clear the queue on native. Some of the functions, typically set or related may actually have no chance of returning error assuming we pass good parameters. 29288 area-System.IO FileSystemWatcher does not need to allocate strings until they pass the filter This change was already done for Windows: https://github.com/dotnet/corefx/commit/11a12e6538a0a024c3adfb944c3983c0d66c3768 The Unix/MacOS implementations can do the same sort of optimization by converting the UTF-8 bytes into a temporary buffer that is passed to the filter method before converting to string. 29289 area-System.Runtime Add Iran Timezone test case 29290 area-System.IO Add UTF-8 match algorithm for FileSystemName? A UTF-8 implementation of [`FileSystemName.MatchesSimpleExpression`](https://github.com/dotnet/corefx/blob/master/src/System.IO.FileSystem/src/System/IO/Enumeration/FileSystemName.cs#L95) would allow matching Unix/Mac data without having to first convert to UTF-16. Something like this perhaps: ``` C# namespace System.IO.Enumeration { // name is UTF-8 public static bool MatchesSimpleExpression(ReadOnlySpan<char> expression, ReadOnlySpan<byte> name, bool ignoreCase = true) } ``` This could potentially improve performance. We currently convert from UTF-8 into a temporary UTF-16 buffer on the stack- it may also be that improvements here don't register against the cost of I/O. https://github.com/dotnet/corefx/blob/master/src/System.IO.FileSystem/src/System/IO/Enumeration/FileSystemEntry.Unix.cs#L88-L103 If anyone has a particular interest in this they are welcome to try and implement. If we find there is, in fact, a measurable benefit we can look at making a formal API proposal at that point. 29292 area-System.Net [arm32] corefx System.Net.Http.Functional.Tests fails _From @BruceForstall on April 23, 2018 21:44_ 60 failures in this test suite: https://ci.dot.net/job/dotnet_coreclr/job/dev_unix_test_workflow/job/jitstress/job/arm_cross_checked_ubuntu_corefx_baseline_tst_prtest/3/consoleText Some seem like timeout (which is probably just too tight): ``` System.Net.Http.Functional.Tests.PlatformHandler_HttpClientHandler_Cancellation_Test.GetAsync_CancelDuringResponseHeadersReceived_TaskCanceledQuickly(chunkedTransfer: True, connectionClose: True, mode: Token) [FAIL] Elapsed time 00:00:31.6604110 should be less than 30 seconds, was 31.660411 Expected: True Actual: False ``` There are many other error modes, though, e.g., ``` Assert.Throws() Failure Expected: typeof(System.Net.Http.HttpRequestException) Actual: typeof(System.Threading.Tasks.TaskCanceledException): A task was canceled. ``` _Copied from original issue: dotnet/coreclr#17739_ 29293 area-System.Net [arm32] corefx System.Net.NameResolution.Pal.Tests fails _From @BruceForstall on April 23, 2018 21:46_ https://ci.dot.net/job/dotnet_coreclr/job/dev_unix_test_workflow/job/jitstress/job/arm_cross_checked_ubuntu_corefx_baseline_tst_prtest/3/consoleText ``` Running tests in /ssd/j/workspace/dotnet_coreclr/dev_unix_test_workflow/jitstress/arm_cross_checked_ubuntu_corefx_baseline_tst_prtest/_/fx/bin/tests/System.Net.NameResolution.Pal.Tests/netcoreapp-Linux-Release-arm ./RunTests.sh /ssd/j/workspace/dotnet_coreclr/dev_unix_test_workflow/jitstress/arm_cross_checked_ubuntu_corefx_baseline_tst_prtest/_/fx/bin/testhost/netcoreapp-Linux-Release-arm ----- start 04:53:57 =============== To repro directly: ===================================================== pushd . #!/usr/bin/env bash chmod +x /ssd/j/workspace/dotnet_coreclr/dev_unix_test_workflow/jitstress/arm_cross_checked_ubuntu_corefx_baseline_tst_prtest/_/fx/bin/testhost/netcoreapp-Linux-Release-arm/dotnet /ssd/j/workspace/dotnet_coreclr/dev_unix_test_workflow/jitstress/arm_cross_checked_ubuntu_corefx_baseline_tst_prtest/_/fx/bin/testhost/netcoreapp-Linux-Release-arm/dotnet xunit.console.netcore.exe System.Net.NameResolution.Pal.Tests.dll -xml testResults.xml -notrait Benchmark=true -notrait category=nonnetcoreapptests -notrait category=nonlinuxtests -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing popd =========================================================================================================== /ssd/j/workspace/dotnet_coreclr/dev_unix_test_workflow/jitstress/arm_cross_checked_ubuntu_corefx_baseline_tst_prtest/_/fx/bin/tests/System.Net.NameResolution.Pal.Tests/netcoreapp-Linux-Release-arm /ssd/j/workspace/dotnet_coreclr/dev_unix_test_workflow/jitstress/arm_cross_checked_ubuntu_corefx_baseline_tst_prtest/_/fx/bin/tests/System.Net.NameResolution.Pal.Tests/netcoreapp-Linux-Release-arm xUnit.net console test runner (32-bit .NET Core) Copyright (C) 2014 Outercurve Foundation. Discovering: System.Net.NameResolution.Pal.Tests Discovered: System.Net.NameResolution.Pal.Tests Starting: System.Net.NameResolution.Pal.Tests System.Net.NameResolution.PalTests.NameResolutionPalTests.TryGetNameInfo_LocalHost_IPv6_TryGetAddrInfo [FAIL] Assert.Equal() Failure Expected: Success Actual: HostNotFound Stack Trace: /mnt/j/workspace/dotnet_coreclr/dev_unix_test_workflow/jitstress/arm_cross_checked_ubuntu_corefx_baseline_prtest/_/fx/src/System.Net.NameResolution/tests/PalTests/NameResolutionPalTests.cs(161,0): at System.Net.NameResolution.PalTests.NameResolutionPalTests.TryGetNameInfo_LocalHost_IPv6_TryGetAddrInfo() System.Net.NameResolution.PalTests.NameResolutionPalTests.TryGetNameInfo_LocalHost_IPv6 [FAIL] Assert.Equal() Failure Expected: Success Actual: HostNotFound Stack Trace: /mnt/j/workspace/dotnet_coreclr/dev_unix_test_workflow/jitstress/arm_cross_checked_ubuntu_corefx_baseline_prtest/_/fx/src/System.Net.NameResolution/tests/PalTests/NameResolutionPalTests.cs(77,0): at System.Net.NameResolution.PalTests.NameResolutionPalTests.TryGetNameInfo_LocalHost_IPv6() Finished: System.Net.NameResolution.Pal.Tests === TEST EXECUTION SUMMARY === System.Net.NameResolution.Pal.Tests Total: 10, Errors: 0, Failed: 2, Skipped: 0, Time: 4.381s /ssd/j/workspace/dotnet_coreclr/dev_unix_test_workflow/jitstress/arm_cross_checked_ubuntu_corefx_baseline_tst_prtest/_/fx/bin/tests/System.Net.NameResolution.Pal.Tests/netcoreapp-Linux-Release-arm ----- end 04:54:07 ----- exit code 1 ---------------------------------------------------------- ``` _Copied from original issue: dotnet/coreclr#17740_ 29294 area-System.Security Test failure: System.Security.Cryptography.X509Certificates.Tests.CertificateCreation.CertificateRequestChainTests/CreateChain_Hybrid The test `System.Security.Cryptography.X509Certificates.Tests.CertificateCreation.CertificateRequestChainTests/CreateChain_Hybrid` has failed. ``` Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException : An internal consistency check failed Stack Trace: at System.Security.Cryptography.CngKeyLite.GenerateNewExportableKey(String algorithm, Int32 keySize) in E:\A\_work\2\s\corefx\src\System.Security.Cryptography.Algorithms\src\System\Security\Cryptography\CngKeyLite.cs:line 138 at System.Security.Cryptography.RSAImplementation.RSACng.GetDuplicatedKeyHandle() in E:\A\_work\2\s\corefx\src\System.Security.Cryptography.Algorithms\src\System\Security\Cryptography\RSACng.cs:line 34 at System.Security.Cryptography.RSAImplementation.RSACng.ExportKeyBlob(Boolean includePrivateParameters) in E:\A\_work\2\s\corefx\src\System.Security.Cryptography.Algorithms\src\System\Security\Cryptography\RSACng.cs:line 48 at System.Security.Cryptography.RSAImplementation.RSACng.ExportParameters(Boolean includePrivateParameters) in E:\A\_work\2\s\corefx\src\Common\src\System\Security\Cryptography\RSACng.ImportExport.cs:line 118 at System.Security.Cryptography.X509Certificates.RSAPkcs1X509SignatureGenerator.BuildPublicKey(RSA rsa) in E:\A\_work\2\s\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\RSAPkcs1X509SignatureGenerator.cs:line 33 at System.Security.Cryptography.X509Certificates.RSAPkcs1X509SignatureGenerator.BuildPublicKey() in E:\A\_work\2\s\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\RSAPkcs1X509SignatureGenerator.cs:line 28 at System.Security.Cryptography.X509Certificates.CertificateRequest..ctor(String subjectName, RSA key, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) in E:\A\_work\2\s\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\CertificateRequest.cs:line 136 at System.Security.Cryptography.X509Certificates.Tests.CertificateCreation.CertificateRequestChainTests.OpenCertRequest(String dn, AsymmetricAlgorithm key, HashAlgorithmName hashAlgorithm) in E:\A\_work\2\s\corefx\src\System.Security.Cryptography.X509Certificates\tests\CertificateCreation\CertificateRequestChainTests.cs:line 210 at System.Security.Cryptography.X509Certificates.Tests.CertificateCreation.CertificateRequestChainTests.CreateChainRequest(String dn, AsymmetricAlgorithm key, HashAlgorithmName hashAlgorithm, Boolean isCa, Nullable`1 pathLen) in E:\A\_work\2\s\corefx\src\System.Security.Cryptography.X509Certificates\tests\CertificateCreation\CertificateRequestChainTests.cs:line 252 at System.Security.Cryptography.X509Certificates.Tests.CertificateCreation.CertificateRequestChainTests.CreateAndTestChain(AsymmetricAlgorithm rootPrivKey, AsymmetricAlgorithm intermed1PrivKey, AsymmetricAlgorithm intermed2PrivKey, AsymmetricAlgorithm leafPubKey) in E:\A\_work\2\s\corefx\src\System.Security.Cryptography.X509Certificates\tests\CertificateCreation\CertificateRequestChainTests.cs:line 361 at System.Security.Cryptography.X509Certificates.Tests.CertificateCreation.CertificateRequestChainTests.CreateChain_Hybrid() in E:\A\_work\2\s\corefx\src\System.Security.Cryptography.X509Certificates\tests\CertificateCreation\CertificateRequestChainTests.cs:line 60 Build : Master - 20180423.04 (Core Tests) ``` Failing configurations: - Windows.81.Amd64-x86 - Release 29296 area-System.Diagnostics Disable StartInfo_TextFile_ShellExecute for NETFX Relates to https://github.com/dotnet/corefx/issues/20388 It's now disabled for several platforms, and for 3 frameworks, but still has value running for netcoreapp where it seems to be stable currently. Multiple ActiveIssue attributes are allowed. 29298 area-System.Memory Rollforward from .NET Core 2.0 to 2.1 throws with MissingMethodException when System.Memory package is referenced "**Conditions** An application that is: - compiled against netcoreapp2.0 - has a package reference to System.Memory (v4.5.0-rc1-26423-06) - runs on a machine **without** Microsoft.NETCore.App 2.0.x installed, but has a Microsoft.NETCore.App 2.1.0 version... **Result** The application - rolls to execute on Microsoft.NETCore.App 2.1 ✅ , but - some System.IO apis throw MissingMethodException :x: ``` System.MissingMethodException: Method not found: '!!0 ByRef System.Runtime.InteropServices.MemoryMarshal.GetReference(System.Span`1<!!0>)'. at Interop.Sys.LStat(ReadOnlySpan`1 path, FileStatus& output) at System.IO.FileStatus.Refresh(ReadOnlySpan`1 path) at System.IO.FileStatus.EnsureStatInitialized(ReadOnlySpan`1 path, Boolean continueOnError) at System.IO.FileStatus.GetAttributes(ReadOnlySpan`1 path, ReadOnlySpan`1 fileName) at System.IO.FileSystemInfo.get_Attributes() at System.IO.FileInfo.get_Length() ``` **Repro** In a directory, create 3 files, `Dockerfile`, `program.cs`, and `test.csproj` and run `docker build .`: ```Dockerfile FROM microsoft/dotnet:2.0-sdk as builder WORKDIR /code COPY Program.cs . COPY test.csproj . RUN dotnet publish -o pub/ FROM microsoft/dotnet-nightly:2.1-runtime WORKDIR /app COPY --from=builder /code/pub . RUN dotnet test.dll ``` ```xml <!-- test.csproj--> <Project Sdk=""Microsoft.NET.Sdk""> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>netcoreapp2.0</TargetFramework> <LangVersion>7.1</LangVersion> <RestoreSources> https://dotnet.myget.org/F/dotnet-core/api/v3/index.json; https://api.nuget.org/v3/index.json; </RestoreSources> </PropertyGroup> <ItemGroup> <PackageReference Include=""System.Memory"" Version=""4.5.0-rc1-26423-06"" /> </ItemGroup> </Project> ``` ```csharp // Program.cs using System; using System.IO; class Program { public static int Main(string[] args) { try { var path = Path.Combine(AppContext.BaseDirectory, ""test.txt""); File.WriteAllText(path, ""hello""); var fileinfo = new FileInfo(path); Console.WriteLine(""System.IO.File.Exists = "" + File.Exists(path)); Console.WriteLine(""System.IO.FileInfo.Exists = "" + fileinfo.Exists); Console.WriteLine(""System.IO.FileInfo.FullName = "" + fileinfo.FullName); Console.WriteLine(""System.IO.FileInfo.Length = "" + fileinfo.Length); return 0; } catch (Exception ex) { Console.Error.WriteLine(ex.ToString()); return 1; } } } ``` **Details** Inside the container: ``` dotnet --info Host (useful for support): Version: 2.1.0-rc1-26419-02 Commit: 515f580aa0 .NET Core SDKs installed: No SDKs were found. .NET Core runtimes installed: Microsoft.NETCore.App 2.1.0-rc1-26419-02 [/usr/share/dotnet/shared/Microsoft.NETCore.App] ```" 29301 area-System.Runtime Optionally disabling AggregateException from showing other Exception messages in its own Message? I've noticed that `AggregateException`'s `Message` property always shows the messages of the exceptions within it in parentheses after the `AggregateException`'s own `Message`. Is there any chance that a change will be made to allow the customisation of this behaviour, such as setting whether to display the `Message` of the `AggregateException` only without the messages of its `InnerExceptions`? I've read that this was changed a while back to make `AggregateException` messages more descriptive, but sometimes I want to have the `Message` of an `AggregateException` remain as I entered it. 29302 area-System.Net Clean dead code System.Net* Contributes to #17905 29303 area-System.Net [release/2.1] Always use DnsEndPoint in SocketHttpHandler's ConnectAsync (#29286) Port of #29286 29305 area-System.Reflection Add tests for Invoke of ref-returning members https://github.com/dotnet/corefx/issues/15960 29308 area-System.Net [Benchmark][Windows] One or more tests failed while running tests from 'System.Net.Http.Performance.Tests' The specified benchmark has been broken for few days now, and it's blocking uploading performance results on Windows. System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: True, connectionPerRequest: True, chunkedResponse: False, responseLength: 1): Only one usage of each socket address (protocol/network address/port) is normally permitted ```log [4/23/2018 1:30:50 PM][INF] Running 16 [Benchmark]s [4/23/2018 1:30:50 PM][INF] System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: False, connectionPerRequest: True, chunkedResponse: False, responseLength: 100000) [4/23/2018 1:30:56 PM][INF] System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: False, connectionPerRequest: False, chunkedResponse: True, responseLength: 1) [4/23/2018 1:30:57 PM][INF] System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: True, connectionPerRequest: False, chunkedResponse: True, responseLength: 1) [4/23/2018 1:30:58 PM][INF] System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: True, connectionPerRequest: True, chunkedResponse: False, responseLength: 1) [4/23/2018 1:31:05 PM][ERR] System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: True, connectionPerRequest: True, chunkedResponse: False, responseLength: 1): Only one usage of each socket address (protocol/network address/port) is normally permitted [4/23/2018 1:31:05 PM][ERR] at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) in C:\J\w\perf_windows_---356c2fc4\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\ConnectHelper.cs:line 86 at System.Net.Http.HttpConnectionPool.CreateConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) in C:\J\w\perf_windows_---356c2fc4\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnectionPool.cs:line 342 at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync(ValueTask`1 creationTask) in C:\J\w\perf_windows_---356c2fc4\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnectionPool.cs:line 484 at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken) in C:\J\w\perf_windows_---356c2fc4\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnectionPool.cs:line 275 at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in C:\J\w\perf_windows_---356c2fc4\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\RedirectHandler.cs:line 32 at System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(Boolean ssl, Boolean connectionPerRequest, Boolean chunkedResponse, Int32 responseLength) in C:\J\w\perf_windows_---356c2fc4\src\System.Net.Http\tests\Performance\Perf.SocketsHttpHandler.cs:line 107 at Microsoft.Xunit.Performance.BenchmarkTestInvoker.<>c__DisplayClass1_0.<<CallTestMethod>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.Xunit.Performance.Internal.BenchmarkIterator.RunAsync(Func`1 testMethod) at Xunit.Sdk.TestInvoker`1.<>c__DisplayClass46_1.<<InvokeTestMethodAsync>b__1>d.MoveNext() in C:\BuildAgent\work\cb37e9acf085d108\src\xunit.execution\Sdk\Frameworks\Runners\TestInvoker.cs:line 227 --- End of stack trace from previous location where exception was thrown --- at Xunit.Sdk.ExecutionTimer.AggregateAsync(Func`1 asyncAction) in C:\BuildAgent\work\cb37e9acf085d108\src\xunit.execution\Sdk\Frameworks\ExecutionTimer.cs:line 48 at Xunit.Sdk.ExceptionAggregator.RunAsync(Func`1 code) in C:\BuildAgent\work\cb37e9acf085d108\src\xunit.core\Sdk\ExceptionAggregator.cs:line 90 [4/23/2018 1:31:05 PM][INF] System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: False, connectionPerRequest: True, chunkedResponse: True, responseLength: 100000) [4/23/2018 1:31:11 PM][INF] System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: True, connectionPerRequest: True, chunkedResponse: True, responseLength: 1) [4/23/2018 1:31:17 PM][ERR] System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: True, connectionPerRequest: True, chunkedResponse: True, responseLength: 1): Only one usage of each socket address (protocol/network address/port) is normally permitted [4/23/2018 1:31:17 PM][ERR] at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) in C:\J\w\perf_windows_---356c2fc4\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\ConnectHelper.cs:line 86 at System.Net.Http.HttpConnectionPool.CreateConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) in C:\J\w\perf_windows_---356c2fc4\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnectionPool.cs:line 342 at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync(ValueTask`1 creationTask) in C:\J\w\perf_windows_---356c2fc4\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnectionPool.cs:line 484 at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken) in C:\J\w\perf_windows_---356c2fc4\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnectionPool.cs:line 275 at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in C:\J\w\perf_windows_---356c2fc4\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\RedirectHandler.cs:line 32 at System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(Boolean ssl, Boolean connectionPerRequest, Boolean chunkedResponse, Int32 responseLength) in C:\J\w\perf_windows_---356c2fc4\src\System.Net.Http\tests\Performance\Perf.SocketsHttpHandler.cs:line 107 at Microsoft.Xunit.Performance.BenchmarkTestInvoker.<>c__DisplayClass1_0.<<CallTestMethod>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.Xunit.Performance.Internal.BenchmarkIterator.RunAsync(Func`1 testMethod) at Xunit.Sdk.TestInvoker`1.<>c__DisplayClass46_1.<<InvokeTestMethodAsync>b__1>d.MoveNext() in C:\BuildAgent\work\cb37e9acf085d108\src\xunit.execution\Sdk\Frameworks\Runners\TestInvoker.cs:line 227 --- End of stack trace from previous location where exception was thrown --- at Xunit.Sdk.ExecutionTimer.AggregateAsync(Func`1 asyncAction) in C:\BuildAgent\work\cb37e9acf085d108\src\xunit.execution\Sdk\Frameworks\ExecutionTimer.cs:line 48 at Xunit.Sdk.ExceptionAggregator.RunAsync(Func`1 code) in C:\BuildAgent\work\cb37e9acf085d108\src\xunit.core\Sdk\ExceptionAggregator.cs:line 90 [4/23/2018 1:31:17 PM][INF] System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: True, connectionPerRequest: True, chunkedResponse: True, responseLength: 100000) [4/23/2018 1:31:29 PM][INF] System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: False, connectionPerRequest: False, chunkedResponse: False, responseLength: 1) [4/23/2018 1:31:29 PM][INF] System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: True, connectionPerRequest: False, chunkedResponse: False, responseLength: 100000) [4/23/2018 1:31:34 PM][INF] System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: False, connectionPerRequest: False, chunkedResponse: True, responseLength: 100000) [4/23/2018 1:31:37 PM][INF] System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: True, connectionPerRequest: True, chunkedResponse: False, responseLength: 100000) [4/23/2018 1:31:39 PM][ERR] System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: True, connectionPerRequest: True, chunkedResponse: False, responseLength: 100000): Only one usage of each socket address (protocol/network address/port) is normally permitted [4/23/2018 1:31:39 PM][ERR] at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) in C:\J\w\perf_windows_---356c2fc4\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\ConnectHelper.cs:line 86 at System.Net.Http.HttpConnectionPool.CreateConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) in C:\J\w\perf_windows_---356c2fc4\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnectionPool.cs:line 342 at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync(ValueTask`1 creationTask) in C:\J\w\perf_windows_---356c2fc4\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnectionPool.cs:line 484 at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken) in C:\J\w\perf_windows_---356c2fc4\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnectionPool.cs:line 275 at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in C:\J\w\perf_windows_---356c2fc4\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\RedirectHandler.cs:line 32 at System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(Boolean ssl, Boolean connectionPerRequest, Boolean chunkedResponse, Int32 responseLength) in C:\J\w\perf_windows_---356c2fc4\src\System.Net.Http\tests\Performance\Perf.SocketsHttpHandler.cs:line 107 at Microsoft.Xunit.Performance.BenchmarkTestInvoker.<>c__DisplayClass1_0.<<CallTestMethod>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.Xunit.Performance.Internal.BenchmarkIterator.RunAsync(Func`1 testMethod) at Xunit.Sdk.TestInvoker`1.<>c__DisplayClass46_1.<<InvokeTestMethodAsync>b__1>d.MoveNext() in C:\BuildAgent\work\cb37e9acf085d108\src\xunit.execution\Sdk\Frameworks\Runners\TestInvoker.cs:line 227 --- End of stack trace from previous location where exception was thrown --- at Xunit.Sdk.ExecutionTimer.AggregateAsync(Func`1 asyncAction) in C:\BuildAgent\work\cb37e9acf085d108\src\xunit.execution\Sdk\Frameworks\ExecutionTimer.cs:line 48 at Xunit.Sdk.ExceptionAggregator.RunAsync(Func`1 code) in C:\BuildAgent\work\cb37e9acf085d108\src\xunit.core\Sdk\ExceptionAggregator.cs:line 90 [4/23/2018 1:31:39 PM][INF] System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: True, connectionPerRequest: False, chunkedResponse: False, responseLength: 1) [4/23/2018 1:31:40 PM][INF] System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: False, connectionPerRequest: True, chunkedResponse: False, responseLength: 1) [4/23/2018 1:31:42 PM][ERR] System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: False, connectionPerRequest: True, chunkedResponse: False, responseLength: 1): Only one usage of each socket address (protocol/network address/port) is normally permitted [4/23/2018 1:31:42 PM][ERR] at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) in C:\J\w\perf_windows_---356c2fc4\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\ConnectHelper.cs:line 86 at System.Net.Http.HttpConnectionPool.CreateConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) in C:\J\w\perf_windows_---356c2fc4\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnectionPool.cs:line 342 at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync(ValueTask`1 creationTask) in C:\J\w\perf_windows_---356c2fc4\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnectionPool.cs:line 484 at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken) in C:\J\w\perf_windows_---356c2fc4\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnectionPool.cs:line 275 at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in C:\J\w\perf_windows_---356c2fc4\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\RedirectHandler.cs:line 32 at System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(Boolean ssl, Boolean connectionPerRequest, Boolean chunkedResponse, Int32 responseLength) in C:\J\w\perf_windows_---356c2fc4\src\System.Net.Http\tests\Performance\Perf.SocketsHttpHandler.cs:line 107 at Microsoft.Xunit.Performance.BenchmarkTestInvoker.<>c__DisplayClass1_0.<<CallTestMethod>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.Xunit.Performance.Internal.BenchmarkIterator.RunAsync(Func`1 testMethod) at Xunit.Sdk.TestInvoker`1.<>c__DisplayClass46_1.<<InvokeTestMethodAsync>b__1>d.MoveNext() in C:\BuildAgent\work\cb37e9acf085d108\src\xunit.execution\Sdk\Frameworks\Runners\TestInvoker.cs:line 227 --- End of stack trace from previous location where exception was thrown --- at Xunit.Sdk.ExecutionTimer.AggregateAsync(Func`1 asyncAction) in C:\BuildAgent\work\cb37e9acf085d108\src\xunit.execution\Sdk\Frameworks\ExecutionTimer.cs:line 48 at Xunit.Sdk.ExceptionAggregator.RunAsync(Func`1 code) in C:\BuildAgent\work\cb37e9acf085d108\src\xunit.core\Sdk\ExceptionAggregator.cs:line 90 [4/23/2018 1:31:42 PM][INF] System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: False, connectionPerRequest: False, chunkedResponse: False, responseLength: 100000) [4/23/2018 1:31:45 PM][INF] System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: False, connectionPerRequest: True, chunkedResponse: True, responseLength: 1) [4/23/2018 1:31:47 PM][ERR] System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: False, connectionPerRequest: True, chunkedResponse: True, responseLength: 1): Only one usage of each socket address (protocol/network address/port) is normally permitted [4/23/2018 1:31:47 PM][ERR] at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) in C:\J\w\perf_windows_---356c2fc4\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\ConnectHelper.cs:line 86 at System.Net.Http.HttpConnectionPool.CreateConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) in C:\J\w\perf_windows_---356c2fc4\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnectionPool.cs:line 342 at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync(ValueTask`1 creationTask) in C:\J\w\perf_windows_---356c2fc4\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnectionPool.cs:line 484 at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken) in C:\J\w\perf_windows_---356c2fc4\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnectionPool.cs:line 275 at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in C:\J\w\perf_windows_---356c2fc4\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\RedirectHandler.cs:line 32 at System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(Boolean ssl, Boolean connectionPerRequest, Boolean chunkedResponse, Int32 responseLength) in C:\J\w\perf_windows_---356c2fc4\src\System.Net.Http\tests\Performance\Perf.SocketsHttpHandler.cs:line 107 at Microsoft.Xunit.Performance.BenchmarkTestInvoker.<>c__DisplayClass1_0.<<CallTestMethod>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.Xunit.Performance.Internal.BenchmarkIterator.RunAsync(Func`1 testMethod) at Xunit.Sdk.TestInvoker`1.<>c__DisplayClass46_1.<<InvokeTestMethodAsync>b__1>d.MoveNext() in C:\BuildAgent\work\cb37e9acf085d108\src\xunit.execution\Sdk\Frameworks\Runners\TestInvoker.cs:line 227 --- End of stack trace from previous location where exception was thrown --- at Xunit.Sdk.ExecutionTimer.AggregateAsync(Func`1 asyncAction) in C:\BuildAgent\work\cb37e9acf085d108\src\xunit.execution\Sdk\Frameworks\ExecutionTimer.cs:line 48 at Xunit.Sdk.ExceptionAggregator.RunAsync(Func`1 code) in C:\BuildAgent\work\cb37e9acf085d108\src\xunit.core\Sdk\ExceptionAggregator.cs:line 90 [4/23/2018 1:31:47 PM][INF] System.Net.Http.Tests.SocketsHttpHandlerPerfTest.Get(ssl: True, connectionPerRequest: False, chunkedResponse: True, responseLength: 100000) [4/23/2018 1:31:52 PM][INF] Finished 16 tests in 62.075s (5 failed, 0 skipped) [ERROR] Benchmark execution failed. System.Exception: 5 benchmark(s) failed to execute. at Microsoft.Xunit.Performance.Api.XunitPerformanceHarness.<RunBenchmarks>g__xUnitAction8_0(String assemblyPath) at Microsoft.Xunit.Performance.Api.ETWProfiler.Record(XUnitPerformanceSessionData xUnitPerformanceSessionData, XUnitPerformanceMetricData xUnitPerformanceMetricData, Action action) at Microsoft.Xunit.Performance.Api.XunitPerformanceHarness.RunBenchmarks(String assemblyFileName) at PerfHarness.Main(String[] args) in C:\J\w\perf_windows_---356c2fc4\src\Common\perf\PerfRunner\PerfRunner.cs:line 19 ``` 29311 area-Infrastructure "Removing initialization of ""AgentToolsPath""" The agent pool will have the environment variable defined. 29313 area-System.Security Keep SSL error queue clean Closing #29244 that covered only X509 and tracking all required changes in this issue. The APIs listed below were selected after a scrub of the CryptoNative_* APIs by me and @bartonjs. [EDIT 1: Removing deadcode ones, will address later] /cc @karelz - [ ] CryptoNative_Asn1OctetStringNew => single call, needs ERR_clear_error - [ ] CryptoNative_Asn1OctetStringSet => single call, needs ERR_clear_error - [ ] CryptoNative_BigNumFromBinary => single call, missing clean up check calltree but likely clear on call site Cleanup (only reports OOM) - [ ] CryptoNative_BioNewFile => handful of calls, need to check call tree for AddCachedCrl, DownloadAndAddCrl, and LoadMachineStores - [ ] CryptoNative_BioRead => all call sites protected but some taking only last error (perhaps we should ensure queue is clear) - [ ] CryptoNative_BioSeek => ops, I missed two locations of this one in previous change - [ ] CryptoNative_BioTell => debug assert but no clean up in case of error - [ ] CryptoNative_BioWrite => Some calls not fully protected, other only last error - [ ] CryptoNative_CreateMemoryBio => some calls not cleaned, need to check call tree Cleanup (only reports OOM) - [ ] CryptoNative_DecodeAsn1TypeBytes => single call, needs ERR_clear_error - [ ] CryptoNative_DecodeX509Crl => single location, missing clean up at usage, check caller - [ ] CryptoNative_DecodeX509Name => single location, missing clean up at usage, check caller - [ ] CryptoNative_DsaKeyCreateByExplicitParameters => error on managed side is handled, but potential errors in SetDsaParameter on native are not (Needs native cleanup) - [ ] CryptoNative_DsaVerify => single call not protected on the caller, need to check calltree (probably only theoretical) - [ ] CryptoNative_EcDsaSize => two locations need to check for 0 return and throw in such cases Cleanup (only reports OOM) - [ ] CryptoNative_EcDsaVerify => single call, needs clear error, double-check call tree but seems simple (probably only theoretical) - [ ] CryptoNative_EcKeyCreateByExplicitParameters => 3 calls, relatively large native code, seems covered on managed side need to check if native can return success but leave errors on queue. #if HAVE_OPENSSL_EC2M check seems wrong (if char2 was requested and no char2 is present it passes to GFp and hopes that fails). No check that G, gxBn, gyBn, orderBn, cofactorBn didn't fail (which might produce an error and continue-with-bad-data) (Needs native cleanup) - [ ] CryptoNative_EcKeyCreateByOid => 2 calls (plus a handful in tests), needs error clean up - [ ] CryptoNative_EncodeAsn1Integer => single location, assert checks no error but for safety error needs to be cleaned in OpenSslEncode src\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Encode.cs (probably only theoretical) - [ ] CryptoNative_EncodePkcs12 => single call, 2nd parameter of OpenSslEncode, not covered (probably only theoretical) - [ ] CryptoNative_EncodePkcs7 => single call, 2nd parameter of OpenSslEncode, not covered (probably only theoretical) - [ ] CryptoNative_EncodeX509 => single location, assert checks no error but for safety error needs to be cleaned in OpenSslEncode src\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Encode.cs (probably only theoretical) - [ ] CryptoNative_EncodeX509SubjectPublicKeyInfo => single location, assert checks no error but for safety error needs to be cleaned in OpenSslEncode src\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Encode.cs (probably only theoretical) - [ ] CryptoNative_GetDsaParameters => doesn't seem to touch ERR_, single call, throws exception, should clean up the queue - [ ] CryptoNative_GetObjectDefinitionByName => calls other natives, error clean-up can be made on native side - [ ] CryptoNative_GetRsaParameters => single call, throws CryptographicException, needs error cleanup - [ ] CryptoNative_GetSslConnectionInfo => single call, will be covered if CreateSslException cleans up the error queue - [ ] CryptoNative_LookupFriendlyNameByOid => single call, protected on managed but logic on native indicates that it may leave errors on the queue - [ ] CryptoNative_ObjSn2Nid => single call, there is CryptographicException but needs error clean up - [ ] CryptoNative_ObjTxt2Obj => single call, being covered by same change to cover Asn1OctetStringNew (prototype of tactical change) - [ ] CryptoNative_PemReadBioX509Crl => two locations, need to check from callers, likely need clean up - [ ] CryptoNative_PemWriteBioX509Crl => single call, return code not checked, add clean up - [ ] CryptoNative_RsaVerify => single call, in VerifyHash seems to need to clear error before return - [ ] CryptoNative_SetEncryptionPolicy => single call, missing clean up - [ ] CryptoNative_SetProtocolOptions => 2 calls, doesn't check return but it seems function doesn't log error, need to double check - [ ] CryptoNative_SetRsaParameters => single call, it seems to only set fields, likely doesn't log error, need to double check - [ ] CryptoNative_SslAddExtraChainCert => single call, not cleared, per docs SSL_CTX_add_extra_chain_cert can leave error on queue - [ ] CryptoNative_SslCtxCheckPrivateKey => single call, will be protected by fixing CreateSslException - [ ] CryptoNative_SslCtxCreate => single call, will be protected by fixing CreateSslException - [ ] CryptoNative_SslCtxSetAlpnProtos => single call, will be protected by fixing CreateSslException - [ ] CryptoNative_SslCtxUseCertificate => single call, will be protected by fixing CreateSslException, but likely doesn't set errors anyway - [ ] CryptoNative_SslCtxUsePrivateKey => single call, will be protected by fixing CreateSslException - [ ] CryptoNative_SslSessionReused => single call, call log error per docs, may need specific clean up - [ ] CryptoNative_SslSetTlsExtHostName => single call, docs not clear, return value ignored, for safety we should clean up error queue - [ ] CryptoNative_X509ExtensionCreateByObj => single call not covered, caller FormatNative in src\System.Security.Cryptography.Encoding\src\Internal\Cryptography\OpenSslAsnFormatter.cs - [ ] CryptoNative_X509IssuerNameHash => single call returns hash, likely doesn't log errorif we pass valid argument, https://github.com/dotnet/corefx/issues/28724 - [ ] CryptoNative_X509V3ExtPrint => single call not covered, caller FormatNative in src\System.Security.Cryptography.Encoding\src\Internal\Cryptography\OpenSslAsnFormatter.cs - [ ] CryptoNative_X509VerifyCert => 2 calls one not covered in VerifyCertChain in src\System.Net.Http\src\System\Net\Http\CurlHandler\CurlHandler.SslProvider.Linux.cs 29314 area-Infrastructure Update the Release Notes link for NuGet packages to point to .NET Core 2.1 Currently, the release notes link in the published packages point to [.NET Core 2.0.4](https://go.microsoft.com/fwlink/?LinkID=799421): https://github.com/dotnet/corefx/blob/a985f20d1a04d49ad086e3ef066565d05701cdaa/Packaging.props#L14 For example, see the preview2 System.Memory package which links to old release notes: https://www.nuget.org/packages/System.Memory/4.5.0-preview2-26406-04 We should update it to point to the .NET Core 2.1 release notes (once they are a available). We have preview1/preview2 notes at the moment in: https://github.com/dotnet/core/tree/master/release-notes/2.1 cc @ericstj, @joshfree, @weshaggard, @leecow, @danmosemsft, @karelz 29315 area-System.IO Added Filters Property to FileSystemWatcher class Fixes https://github.com/dotnet/corefx/issues/29273 This property will help to use multiple filters for FileSystemWatcher. The tests are built against netstandard, so have to add the tests to new files with .netcoreapp. @JeremyKuhne should I need to copy all the tests for all the operations like DirectoryChanged, DIrectoryDelete etc,. Currently I have just added a test for CreateDirectory Operation. 29316 area-System.Threading Test that AsyncLocal<class> changed event is not raised multiple times for one change in value - Depends on and tests https://github.com/dotnet/coreclr/pull/17767 - Tests for and closes https://github.com/dotnet/coreclr/issues/17758 29317 area-System.Net Re-enable the SocketsHttpHandler microbenchmarks "The perf tests were wholesale disabled due to port exhaustion errors. Those errors are just coming from the ""connectionPerRequest"" tests, which are inherently flawed in this regard, so I've just deleted them. Closes #29308 cc: @jorive, @geoffkizer " 29318 area-System.Net Bug in HttpWebRequest when call an endpoint that returns 302 "@mrquake commented on [Mon Apr 23 2018](https://github.com/dotnet/core/issues/1473) # Issue Title When you call an endpoint that returns 302 the redirection url will have backslashes instead of forward slashes in ""localpath"". # General For example when you call Azure API using Fiddler or any other web debugging tool: ""https://management.azure.com/subscriptions/xxx-xxx-xxx-xxxx/providers/Microsoft.Commerce/RateCard"" with property parameters, token, etc... It will return 302 and redirect to: https://ratecard.blob.core.windows.net/ratecards/xxxx-xxxx-xxxxx-xxxxx/MS-AZR-0017P/USD/en-US/False/2015-06-01-preview/yyyy-yyyyy-yyyyy-yyyyy.json No problem whatsoever... But when you make the request using .NET Core 1.1/2.0 HttpWebRequest... The redirection tries to call something like that: https://ratecard.blob.core.windows.net/ratecards/xxxx-xxxx-xxxx-xxxxx%5CMS-AZR-0017P%5CUSD%5Cen-US%5CFalse/2015-06-01-preview/yyyy-yyyy-yyyy-yyyy-yyyy.json With encoded backslashes instead of forward slashes.... " 29319 area-System.Runtime Cleanup some System.Runtime.WindowsRuntime.* dependencies on CoreLib internals Contributes to https://github.com/dotnet/coreclr/issues/17768 29320 area-System.Collections Test failure: System.Collections.Concurrent.Tests.PartitionerStaticTests/TestStaticPartitioningArray Opened on behalf of @Sunny-pu The test `System.Collections.Concurrent.Tests.PartitionerStaticTests/TestStaticPartitioningArray` has failed. System.AggregateException : One or more errors occurred. (Assert.Throws() Failure\r Expected: typeof(System.InvalidOperationException)\r Actual: typeof(System.Exception): Cannot create a file when that file already exists. (Exception from HRESULT: 0x800700B7))\r ---- Assert.Throws() Failure\r Expected: typeof(System.InvalidOperationException)\r Actual: typeof(System.Exception): Cannot create a file when that file already exists. (Exception from HRESULT: 0x800700B7) Stack Trace: at System.Threading.Tasks.Task.WaitAllCore(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken) at System.Collections.Concurrent.Tests.PartitionerStaticTests.TestPartitioningCore(Int32 dataSize, Int32 partitionCount, Int32[] data, Boolean staticPartitioning, IEnumerator`1[] partitions) in E:\A\_work\4\s\corefx\src\System.Collections.Concurrent\tests\PartitionerStaticTests.cs:line 288 at System.Collections.Concurrent.Tests.PartitionerStaticTests.RunTestWithAlgorithm(Int32 dataSize, Int32 partitionCount, Int32 algorithm) in E:\A\_work\4\s\corefx\src\System.Collections.Concurrent\tests\PartitionerStaticTests.cs:line 186 at System.Collections.Concurrent.Tests.PartitionerStaticTests.TestStaticPartitioningArray() in E:\A\_work\4\s\corefx\src\System.Collections.Concurrent\tests\PartitionerStaticTests.cs:line 29 ----- Inner Stack Trace ----- at Windows.ApplicationModel.Resources.Core.ResourceContext.Clone() at System.Resources.WindowsRuntimeResourceManager.Initialize(String libpath, String reswFilename, PRIExceptionInfo& exceptionInfo) in E:\A\_work\4\s\corefx\src\System.Runtime.WindowsRuntime\src\System\Resources\WindowsRuntimeResourceManager.cs:line 401 at System.Resources.ResourceManager.SetAppXConfiguration() at System.Resources.ResourceManager..ctor(Type resourceSource) at System.SR.get_ResourceManager() in E:\A\_work\4\s\corefx\src\Common\src\System\SR.cs:line 15 at System.SR.GetResourceString(String resourceKey, String defaultString) in E:\A\_work\4\s\corefx\src\Common\src\System\SR.cs:line 27 at System.Collections.Concurrent.Partitioner.StaticIndexRangePartitionForArray`1.get_Current() in E:\A\_work\4\s\corefx\src\System.Collections.Concurrent\src\System\Collections\Concurrent\PartitionerStatic.cs:line 1614 at System.Collections.Concurrent.Tests.PartitionerStaticTests.<>c__DisplayClass11_1.<TestPartitioningCore>b__1() in E:\A\_work\4\s\corefx\src\System.Collections.Concurrent\tests\PartitionerStaticTests.cs:line 253 Build : Master - 20180425.01 (UWP F5 Tests) Failing configurations: - Windows.10.Amd64.ClientRS3-x64 - Release Details: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fuwp~2F/build/20180425.01/workItem/System.Collections.Concurrent.Tests/analysis/xunit/System.Collections.Concurrent.Tests.PartitionerStaticTests~2FTestStaticPartitioningArray 29321 area-System.Xml [System.Private.Xml.Linq] Rename FunctionalTests classes It allows to fix build issues and makes easier import System.Private.Xml.Linq tests to Mono (https://github.com/mono/mono/issues/8122). 29322 area-System.Runtime Remove hashtable & friends compiled files from System.Runtime.Extensions This commit needs to be reverted when the new uapaot build (that contains the hashtable changes) is ingested: https://github.com/dotnet/corefx/commit/2e34bf9d93e23c2fdf978e457543b95906226721. cc @jkotas 29323 area-System.IO MacOS - Special hidden folders Dear corefx team, We have encountered a special case of hidden folders in MacOs based machines. When using DirectoryInfo to map the users machine, we are interested in knowing which folders are hidden, therefore checking the `FileAttributes.Hidden` attribute, which is determined if the file\directory name starts with a dot - '.' Sadly, we found out that in MacOS uses additional file system flags to mark folders as - **hidden**. We can check it by using the Terminal, or iTerm in my case and navigating to the home folder of a user and using `ls -l` to output the file dir.  as we can see there are no UNIX hidden folders which starts with a dot. But `Library` is a hidden folder. If we would pass the `O` flag to show file flags (-O is a flag only in MacOS)  As we can see there are additional flags that mark a folder as hidden. to set or unset the flag we use `chflags` with the `hidden` or `nohidden` arguments. .NET Core info ``` .NET Command Line Tools (2.0.0) Product Information: Version: 2.0.0 Commit SHA-1 hash: cdcd1928c9 Runtime Environment: OS Name: Mac OS X OS Version: 10.13 OS Platform: Darwin RID: osx.10.12-x64 Base Path: /usr/local/share/dotnet/sdk/2.0.0/ Microsoft .NET Core Shared Framework Host Version : 2.0.0 Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d ``` Is there anything we can do to workaround this? I've poked around corefx + coreclr and saw that the DirectoryEntry struct only uses iNodeType to determine multiple attributes. Is there a plan to support flags in the future? Thank you very much, Hagai. 29324 area-Infrastructure Remove manual typeforwards to S.P.CoreLib for now exposed types. Relates to https://github.com/dotnet/coreclr/pull/17185 @safern I would like to get rid off the ValueTuple typeforwards and with that get rid of the whole manual shim for mscorlib. That requires that we compile against a newer netfx version where ValueTuples are inbox. cc @jkotas 29325 area-System.Runtime The type initializer for 'TimeZoneConverter.TZConvert' threw an exception. "I got this error on aws lambda. The type initializer for 'TimeZoneConverter.TZConvert' threw an exception. ""errorMessage"": ""An item with the same key has already been added. Key: Canada/East-Saskatchewan""," 29327 area-System.Security Enable EnvelopedCms to work with an external private key There are two scenarios that are not currently possible with the EnvelopedCms class. 1) Decrypting the contents of an EnvelopedCms with an unattached/unattachable key (a la RSAKeyVault). 2) Being able to prove which certificate+key were used for the decryption operation, because the existing members all dive into the CurrentUser\My certificate store looking for other candidate certs+keys. (https://stackoverflow.com/questions/49815448/can-envelopedcms-be-used-to-identify-the-encryption-certificate) The strawman suggestion is a new Decrypt overload which does not initiate a store search, and happens to allow specifying a private key. ```diff public partial class EnvelopedCms { + public void Decrypt(X509Certificate2 certificate, AsymmetricAlgorithm privateKey) => throw null; } ``` Maybe it also makes sense for the RecipientInfo overload. Verifying the private key really belongs to the public key is a little trickier. Maybe it's not important for Decrypt, since the certificate finds the matching recipient key info and the private key turns that back into the symmetric key... it either works or it doesn't. Maybe this would be `TryDecrypt`, and returns false if the cert matches no recipients? 29328 area-Infrastructure Port LTTng fix for rootfs from CoreCLR Port https://github.com/dotnet/coreclr/pull/17762 to CoreFx. 29329 area-System.ComponentModel Port System.ComponentModel.Composition.Registration (MEF1) to .NET Core Greetings, regarding [Port System.ComponentModel.Composition (MEF1) to .NET Core](https://github.com/dotnet/corefx/issues/11857) the following is still missing: - `System.ComponentModel.Composition.Registration.RegistrationBuilder` - `System.ComponentModel.Composition.Registration.PartBuilder` - `System.ComponentModel.Composition.Registration.PartBuilder<>` See also https://github.com/dotnet/corefx/issues/11857#issuecomment-382342975 edit by @ViktorHofer: fixed link. 29331 area-Infrastructure "[Perf] Ubuntu16.04 runs blocked by multiple ""PE file is already strong-name signed."" errors" [perf_ubuntu16.04_release](https://ci2.dot.net/job/dotnet_corefx/job/perf/job/master/job/perf_ubuntu16.04_release/1715/consoleText) ```bash bash ./build-managed.sh -release -tests -- /p:Performance=true /p:TargetOS=Linux /m:1 /p:LogToBenchview=true /p:BenchviewRunType=rolling /p:PerformanceType=Profile ``` ... /home/administrator/jenkins/w/dotnet_corefx/perf/master/perf_ubuntu16.04_release/Tools/sign.targets(113,5): error : /home/administrator/jenkins/w/dotnet_corefx/perf/master/perf_ubuntu16.04_release/bin/obj/ref/System.Threading.Tasks.Dataflow/4.6.3.0/netstandard/System.Threading.Tasks.Dataflow.dll: PE file is already strong-name signed. [/home/administrator/jenkins/w/dotnet_corefx/perf/master/perf_ubuntu16.04_release/src/System.Threading.Tasks.Dataflow/ref/System.Threading.Tasks.Dataflow.csproj] 0 Warning(s) 32 Error(s) 29334 area-System.Net Check URI scheme length only after verifying the scheme contains valid characters "URI construction is failing on valid URIs under the following conditions: - An absolute URI is constructed using the `Uri(Uri absolute, string relative)` constructor. - The relative string begins with 1024+ characters, followed by a colon. - The relative string contains but does not begin with a forward or back slash. See the test added in this PR for an example URI. The fix is to check the scheme length _after_ validating that the potential scheme contains only legal characters (ie, not a forward or back slash). This keeps us from running into the situation above, where the relative URI contains a colon that is unambiguously not a scheme separator because the ""scheme"" is actually just a path that contains a colon. This fix improves the correctness of our relative path parsing at the cost of an additional stacalloc in the case where the relative part of the URI is really an absolute URI with a scheme length >= 1024. Fixes: #29011 Details below: --------- When we construct an absolute URI from a relative URI, the first thing we try to do is parse the relative URI as an absolute URI. That parsing process returns an error code that we use to determine what happens next. The parsing errors are as follows: https://github.com/dotnet/corefx/blob/bffef76f6af208e2042a2f27bc081ee908bb390b/src/System.Private.Uri/src/System/UriEnumTypes.cs#L67-L93 If we successfully parse an absolute URI (error = None), we return that URI and ignore the absolute URI we were passed. That might seem a little odd, but it's a useful behavior in practice. If we get an error that is less than `LastRelativeUriOkErrIndex`(see the code above), we attempt to create a relative URI from the string and then root it with the absolute URI provided. If we return any other error, we believe that the string is neither a valid relative or absolute URI and throw an exception. In this case, PrivateParseMinimal is returning the error `SchemeLimit`, which indicates that we have too large of a scheme. As documented in the code above, this isn't considered a recoverable error. The relative string provided has some characters that are clearly invalid in a scheme, so the real error we should be returning from TryParse is `InvalidScheme`. Since `InvalidScheme` is less than `LastRelativeUriOkErrIndex`, we will then be able to create a relative URI. Fixing the returned parsing error allows this URI to be constructed successfully." 29337 area-System.Net Unify setting null CookieContainer behavior on HttpClientHandler For HttpClientHandler layer (above the WinHttpHandler layer on Windows), we should be consistent and throw the exception in the CookieContainer setter when null value is provided, to match .NET Framework's behavior. This would keep the same behavior across all platforms for the setter of the HttpClientHandler.CookieContainer property. Close: #3205 29338 area-System.Net Include fragment and query in Uri.LocalPath on Unix While testing XmlUriResolver, @pjanotti discovered that any segments of a file path following a '#' symbol will be cut out of Uri.LocalPath on Unix. Based on additional tests, this also occurs for the '?' symbol. This is happening because the Unix specific case for local path only uses the path component of the URI: https://github.com/dotnet/corefx/blob/9e8d443ff78c4f0a9a6bedf7f95961cf96ceff0a/src/System.Private.Uri/src/System/Uri.cs#L1032-L1037 The fix here is to include the fragment and query in LocalPath in the Unix path specific case. This PR enables the test case in XmlUriResolver that uncovered this issues, and adds some additional cases to our URI tests. Fixes: #28486