-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Utf8JsonReader.BytesConsumed incorrect for input "2e2" in multi-segment mode #30462
Comments
If you compare the parsing of Are you interested in fixing error cases as well? If yes I can report them, too. I can see that the tests attempt to validate situations like this e.g. in For
Another discrepancy:
Here, it says
Here is a discrepancy in
I'm doing some exhaustive testing with It would help my testing a lot if you could fix all the discrepancies in the messages. Maybe, I can find more serious bugs that way. Currently, the logs are polluted from all the differences in the error messages and in the positions. |
OK, please let me know when a new nightly is out with fixes. I have paused my efforts because the logs are currently not legible. |
I think I have more issues to report but the logs are too polluted to work efficiently on this. I think we'll need 2-3 cycles of fixing and testing. Can we be in time to get the fixes into 3.0? |
Yes, that would be great. We should fix those. Edit: For the specific case where
Can you share the whole log within a gist or some other format? It might be easier to fix many of them in one shot, especially if the root cause is identical. I have just fixed the first issue (for valid JSON): dotnet/corefx#40303
Depends on the severity of the issue, but we should definitely fix anything that could affect correctness within user code. The mutli-segment code paths within the |
Fixed in dotnet/corefx#40303 and dotnet/corefx#40349 for master. Fixed in dotnet/corefx#40422 release/3.0. @GSPP - if you observe other inconsistencies or bugs within the Utf8JsonReader as part of your testing, please file a new issue. Thanks for finding these! |
I installed the latest 5.0 master SDK (5.0.0-alpha1.19422.13) and tested the In there a build that I can download to test the fix? |
Looks like the latest SDK is referencing a version of the corefx libraries from a few days old (~Aug 9) and hence doesn't contain the fix: You could explicitly add a reference to the latest S.T.Json NuGet package (even with the SDK version you currently have) and test the fix: <ItemGroup>
<PackageReference Include="System.Text.Json" Version="5.0.0-alpha1.19423.7" />
</ItemGroup> Otherwise, you'd have to wait for a new build of the SDK that contains the latest fix. Looks like master is up-to-date, but the build being produced isn't latest: |
Thanks for that tip! These prerelease versions are not on the official NuGet site but I added the custom I can confirm the fix. I will open a new issue with more findings. |
When parsing "2e2",
BytesConsumed
seems to be smaller by 1 than it should be. The number itself is being parsed correctly."[2e2]"
also is being parsed correctly and again,BytesConsumed
is incorrect.Single-segment mode is correct.
Another interesting case to test is
2e+2
.This is 3.0.0-preview7-27912-14.
The text was updated successfully, but these errors were encountered: