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

Double.Parse throws AccessViolationException on .NET Core 3.0 #28872

Closed
Metalnem opened this issue Mar 5, 2019 · 1 comment · Fixed by dotnet/coreclr#23043
Closed

Double.Parse throws AccessViolationException on .NET Core 3.0 #28872

Metalnem opened this issue Mar 5, 2019 · 1 comment · Fixed by dotnet/coreclr#23043
Labels
Milestone

Comments

@Metalnem
Copy link

Metalnem commented Mar 5, 2019

Double.Parse sometimes throws AccessViolationException on .NET Core 3.0. Here's the snippet you can use to reproduce this:

Double.Parse("0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000");

The stack trace:

System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at System.Number+BigInteger.CountSignificantBits(BigInteger ByRef)
   at System.Number.NumberToFloatingPointBitsSlow(NumberBuffer ByRef, FloatingPointInfo ByRef, UInt32, UInt32, UInt32)
   at System.Number.NumberToFloatingPointBits(NumberBuffer ByRef, FloatingPointInfo ByRef)
   at System.Number.NumberToDouble(NumberBuffer ByRef)
   at System.Number.TryParseDouble(System.ReadOnlySpan`1<Char>, System.Globalization.NumberStyles, System.Globalization.NumberFormatInfo, Double ByRef)
   at System.Double.Parse(System.String)

I'm using the latest .NET Core 3.0 daily build:

.NET Core SDK (reflecting any global.json):
 Version:   3.0.100-preview4-010607
 Commit:    ccd2f7cfaa

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.14
 OS Platform: Darwin
 RID:         osx.10.14-x64
 Base Path:   /Users/Metalnem/Temp/dotnet-sdk-latest-osx-x64/sdk/3.0.100-preview4-010607/

Found via SharpFuzz.

@benaadams
Copy link
Member

benaadams commented Mar 5, 2019

/cc @tannergooding, @stephentoub

@tannergooding tannergooding self-assigned this Mar 5, 2019
@msftgits msftgits transferred this issue from dotnet/corefx Feb 1, 2020
@msftgits msftgits added this to the 3.0 milestone Feb 1, 2020
@tannergooding tannergooding removed their assignment May 26, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants