Skip to content

Conversation

@kzrnm
Copy link
Contributor

@kzrnm kzrnm commented Jan 13, 2024

parts of #96746

Reproduce

cd src/libraries/System.Runtime.Numerics/tests
dotnet build /t:Test /p:XUnitOptions="-class System.Numerics.Tes
ts.parseTest" /p:Outerloop=true
Process terminated. Assertion failed.
     at System.Number.TryParseNumber(Char*& str, Char* strEnd, NumberStyles styles, NumberBuffer& number, NumberFormatInfo info) in /repo/dotnet/runtime/src/libraries/Common/src/System/Number.Parsing.Common.cs:line 15
     at System.Number.TryStringToNumber(ReadOnlySpan`1 value, NumberStyles styles, NumberBuffer& number, NumberFormatInfo info) in /repo/dotnet/runtime/src/libraries/Common/src/System/Number.Parsing.Common.cs:line 285
     at System.Number.TryParseBigIntegerNumber(ReadOnlySpan`1 value, NumberStyles style, NumberFormatInfo info, BigInteger& result) in /repo/dotnet/runtime/src/libraries/System.Runtime.Numerics/src/System/Number.BigInteger.cs:line 364
     at System.Number.TryParseBigInteger(ReadOnlySpan`1 value, NumberStyles style, NumberFormatInfo info, BigInteger& result) in /repo/dotnet/runtime/src/libraries/System.Runtime.Numerics/src/System/Number.BigInteger.cs:line 341
     at System.Numerics.BigInteger.TryParse(ReadOnlySpan`1 value, NumberStyles style, IFormatProvider provider, BigInteger& result) in /repo/dotnet/runtime/src/libraries/System.Runtime.Numerics/src/System/Numerics/BigInteger.cs:line 698
     at System.Numerics.BigInteger.TryParse(String value, NumberStyles style, IFormatProvider provider, BigInteger& result) in /repo/dotnet/runtime/src/libraries/System.Runtime.Numerics/src/System/Numerics/BigInteger.cs:line 683
     at System.Numerics.BigInteger.TryParse(String value, BigInteger& result) in /repo/dotnet/runtime/src/libraries/System.Runtime.Numerics/src/System/Numerics/BigInteger.cs:line 678
     at System.Numerics.Tests.parseTest.VerifyFailParseToString(String num1, Type expectedExceptionType) in /repo/dotnet/runtime/src/libraries/System.Runtime.Numerics/tests/BigInteger/parse.cs:line 621
     at System.Numerics.Tests.parseTest.VerifyDefaultParse(Random random) in /repo/dotnet/runtime/src/libraries/System.Runtime.Numerics/tests/BigInteger/parse.cs:line 211
     at System.Numerics.Tests.parseTest.<>c__DisplayClass4_0.<RunParseToStringTests>g__Test|0() in /repo/dotnet/runtime/src/libraries/System.Runtime.Numerics/tests/BigInteger/parse.cs:line 48
     at System.Numerics.Tests.parseTest.RunParseToStringTests(CultureInfo culture) in /repo/dotnet/runtime/src/libraries/System.Runtime.Numerics/tests/BigInteger/parse.cs:line 39
     at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
     at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) in /repo/dotnet/runtime/src/coreclr/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.CoreCLR.cs:line 36
     at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr) in /repo/dotnet/runtime/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs:line 178
     at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) in /repo/dotnet/runtime/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs:line 104
     at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) in /repo/dotnet/runtime/src/libraries/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs:line 129
     at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) in /repo/dotnet/runtime/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBase.cs:line 56
     at Xunit.Sdk.TestInvoker`1.CallTestMethod(Object testClassInstance) in /_/src/xunit.execution/Sdk/Frameworks/Runners/TestInvoker.cs:line 150

@ghost ghost added community-contribution Indicates that the PR has been added by a community member area-System.Numerics labels Jan 13, 2024
@ghost
Copy link

ghost commented Jan 13, 2024

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

Issue Details

parts of #96746

Reproduce

cd src/libraries/System.Runtime.Numerics/tests
dotnet build /t:Test /p:XUnitOptions="-class System.Numerics.Tes
ts.parseTest" /p:Outerloop=true
Process terminated. Assertion failed.
     at System.Number.TryParseNumber(Char*& str, Char* strEnd, NumberStyles styles, NumberBuffer& number, NumberFormatInfo info) in /repo/dotnet/runtime/src/libraries/Common/src/System/Number.Parsing.Common.cs:line 15
     at System.Number.TryStringToNumber(ReadOnlySpan`1 value, NumberStyles styles, NumberBuffer& number, NumberFormatInfo info) in /repo/dotnet/runtime/src/libraries/Common/src/System/Number.Parsing.Common.cs:line 285
     at System.Number.TryParseBigIntegerNumber(ReadOnlySpan`1 value, NumberStyles style, NumberFormatInfo info, BigInteger& result) in /repo/dotnet/runtime/src/libraries/System.Runtime.Numerics/src/System/Number.BigInteger.cs:line 364
     at System.Number.TryParseBigInteger(ReadOnlySpan`1 value, NumberStyles style, NumberFormatInfo info, BigInteger& result) in /repo/dotnet/runtime/src/libraries/System.Runtime.Numerics/src/System/Number.BigInteger.cs:line 341
     at System.Numerics.BigInteger.TryParse(ReadOnlySpan`1 value, NumberStyles style, IFormatProvider provider, BigInteger& result) in /repo/dotnet/runtime/src/libraries/System.Runtime.Numerics/src/System/Numerics/BigInteger.cs:line 698
     at System.Numerics.BigInteger.TryParse(String value, NumberStyles style, IFormatProvider provider, BigInteger& result) in /repo/dotnet/runtime/src/libraries/System.Runtime.Numerics/src/System/Numerics/BigInteger.cs:line 683
     at System.Numerics.BigInteger.TryParse(String value, BigInteger& result) in /repo/dotnet/runtime/src/libraries/System.Runtime.Numerics/src/System/Numerics/BigInteger.cs:line 678
     at System.Numerics.Tests.parseTest.VerifyFailParseToString(String num1, Type expectedExceptionType) in /repo/dotnet/runtime/src/libraries/System.Runtime.Numerics/tests/BigInteger/parse.cs:line 621
     at System.Numerics.Tests.parseTest.VerifyDefaultParse(Random random) in /repo/dotnet/runtime/src/libraries/System.Runtime.Numerics/tests/BigInteger/parse.cs:line 211
     at System.Numerics.Tests.parseTest.<>c__DisplayClass4_0.<RunParseToStringTests>g__Test|0() in /repo/dotnet/runtime/src/libraries/System.Runtime.Numerics/tests/BigInteger/parse.cs:line 48
     at System.Numerics.Tests.parseTest.RunParseToStringTests(CultureInfo culture) in /repo/dotnet/runtime/src/libraries/System.Runtime.Numerics/tests/BigInteger/parse.cs:line 39
     at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
     at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) in /repo/dotnet/runtime/src/coreclr/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.CoreCLR.cs:line 36
     at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr) in /repo/dotnet/runtime/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs:line 178
     at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) in /repo/dotnet/runtime/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs:line 104
     at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) in /repo/dotnet/runtime/src/libraries/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs:line 129
     at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) in /repo/dotnet/runtime/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBase.cs:line 56
     at Xunit.Sdk.TestInvoker`1.CallTestMethod(Object testClassInstance) in /_/src/xunit.execution/Sdk/Frameworks/Runners/TestInvoker.cs:line 150
Author: kzrnm
Assignees: -
Labels:

area-System.Numerics, community-contribution

Milestone: -

@tannergooding tannergooding merged commit 7de8f09 into dotnet:main Jan 16, 2024
@kzrnm kzrnm deleted the BigIntegerTryParseNull branch January 17, 2024 07:18
tmds pushed a commit to tmds/runtime that referenced this pull request Jan 23, 2024
* Fix assertion at BigInteger.TryParse(null)

* Add test using null pointer Span

* Avoid goto

* ReadOnlySpan<char>.Empty
@github-actions github-actions bot locked and limited conversation to collaborators Feb 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Numerics community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants