Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the argument checks to Unix-part of Mutex.OpenExistingWorker #59634

Merged
merged 1 commit into from
Sep 27, 2021

Conversation

MaximLipnin
Copy link
Contributor

The test run in #59503 uncovered some System.Threading.Tests failures, e.g.:

<failure exception-type="Xunit.Sdk.EqualException">
   <message><![CDATA[Assert.Equal() Failure\n          ↓ (pos 0)\nExpected: name\nActual:   key\n          ↑ (pos 0)]]></message>
   <stack-trace><![CDATA[   at System.AssertExtensions.Throws[ArgumentNullException](String expectedParamName, Func`1 testCode)
       at System.Threading.Tests.MutexTests.OpenExisting_InvalidNames()
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)]]></stack-trace>
</failure>

...

<failure exception-type="Xunit.Sdk.ThrowsException">
   <message><![CDATA[Assert.Throws() Failure\nExpected: typeof(System.ArgumentException)\nActual:   (No exception was thrown)]]></message>
   <stack-trace><![CDATA[   at System.AssertExtensions.Throws[ArgumentException](String netCoreParamName, String netFxParamName, Func`1 testCode)
       at System.Threading.Tests.MutexTests.Ctor_InvalidNames_Unix()
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)]]></stack-trace>
</failure>

The reason seems to be that the unix-part of related code has no checks for null/empty string arguments which windows-part does so that the underlying code throws

@ghost
Copy link

ghost commented Sep 27, 2021

Tagging subscribers to this area: @Anipik, @safern, @ViktorHofer
See info in area-owners.md if you want to be subscribed.

Issue Details

The test run in #59503 uncovered some System.Threading.Tests failures, e.g.:

<failure exception-type="Xunit.Sdk.EqualException">
   <message><![CDATA[Assert.Equal() Failure\n          ↓ (pos 0)\nExpected: name\nActual:   key\n          ↑ (pos 0)]]></message>
   <stack-trace><![CDATA[   at System.AssertExtensions.Throws[ArgumentNullException](String expectedParamName, Func`1 testCode)
       at System.Threading.Tests.MutexTests.OpenExisting_InvalidNames()
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)]]></stack-trace>
</failure>

...

<failure exception-type="Xunit.Sdk.ThrowsException">
   <message><![CDATA[Assert.Throws() Failure\nExpected: typeof(System.ArgumentException)\nActual:   (No exception was thrown)]]></message>
   <stack-trace><![CDATA[   at System.AssertExtensions.Throws[ArgumentException](String netCoreParamName, String netFxParamName, Func`1 testCode)
       at System.Threading.Tests.MutexTests.Ctor_InvalidNames_Unix()
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)]]></stack-trace>
</failure>

The reason seems to be that the unix-part of related code has no checks for null/empty string arguments which windows-part does so that the underlying code throws

Author: MaximLipnin
Assignees: -
Labels:

area-Infrastructure-libraries

Milestone: -

@ghost
Copy link

ghost commented Sep 27, 2021

Tagging subscribers to this area: @dotnet/area-system-runtime
See info in area-owners.md if you want to be subscribed.

Issue Details

The test run in #59503 uncovered some System.Threading.Tests failures, e.g.:

<failure exception-type="Xunit.Sdk.EqualException">
   <message><![CDATA[Assert.Equal() Failure\n          ↓ (pos 0)\nExpected: name\nActual:   key\n          ↑ (pos 0)]]></message>
   <stack-trace><![CDATA[   at System.AssertExtensions.Throws[ArgumentNullException](String expectedParamName, Func`1 testCode)
       at System.Threading.Tests.MutexTests.OpenExisting_InvalidNames()
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)]]></stack-trace>
</failure>

...

<failure exception-type="Xunit.Sdk.ThrowsException">
   <message><![CDATA[Assert.Throws() Failure\nExpected: typeof(System.ArgumentException)\nActual:   (No exception was thrown)]]></message>
   <stack-trace><![CDATA[   at System.AssertExtensions.Throws[ArgumentException](String netCoreParamName, String netFxParamName, Func`1 testCode)
       at System.Threading.Tests.MutexTests.Ctor_InvalidNames_Unix()
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)]]></stack-trace>
</failure>

The reason seems to be that the unix-part of related code has no checks for null/empty string arguments which windows-part does so that the underlying code throws

Author: MaximLipnin
Assignees: -
Labels:

area-System.Runtime

Milestone: -

@MaximLipnin
Copy link
Contributor Author

The System.Text.RegularExpressions.Tests.RegexMatchTests.Match_ExcessPrefix failures on checked lanes seem to be fixed in #59564

@jkotas jkotas merged commit b7ac14b into dotnet:main Sep 27, 2021
@MaximLipnin MaximLipnin deleted the fix_System.Threading.Tests_on_tvos branch September 27, 2021 15:02
@ghost ghost locked as resolved and limited conversation to collaborators Nov 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants